Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
飞
飞鹤小程序
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
FH
飞鹤小程序
Commits
7806c26d
Commit
7806c26d
authored
Aug 12, 2025
by
spc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sywebview
parent
21273336
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
6 deletions
+21
-6
sywebview.js
api/sywebview.js
+4
-0
syWebview.vue
pages/syWebview/syWebview.vue
+17
-6
No files found.
api/sywebview.js
0 → 100644
View file @
7806c26d
import
requestModule
from
'./request.js'
const
{
api
}
=
requestModule
export
const
fetchSyWebviewJSON
=
()
=>
api
.
get
(
'/c/front/content'
,
{
type
:
'sywebview'
})
pages/syWebview/syWebview.vue
View file @
7806c26d
...
...
@@ -39,6 +39,7 @@ Webview页面使用说明:
<
script
>
import
{
useUserStore
}
from
'@/stores/user.js'
;
import
{
useGlobalStore
}
from
'../../stores/global'
;
import
{
fetchSyWebviewJSON
}
from
'../../api/sywebview'
;
export
default
{
data
()
{
return
{
...
...
@@ -57,13 +58,23 @@ export default {
// 确保登录以获取 cuk(异步回调,可能未立即生效)
await
this
.
wxAutoLogin
();
const
res
=
await
fetchSyWebviewJSON
()
console
.
log
(
'res'
,
res
)
// if (!res.data.url) {
// uni.redirectTo({
// url: '/pages/index/index'
// })
// return
// }
// 固定写死的 URL(不从 options 读取 baseUrl)
const
baseUrl
=
'https://25niansuyuan.feihe.com/projects/Firmus/dev/index'
;
const
baseUrl
=
res
.
data
.
url
||
'https://25niansuyuan.feihe.com/projects/Firmus/dev/index'
;
const
store
=
useGlobalStore
();
const
cuk
=
store
.
cuk
;
const
openId
=
store
.
openId
;
const
unionId
=
store
.
unionId
;
// 将 options 的所有参数原样作为查询参数传给 H5,并补齐 cuk
const
params
=
{
...(
options
||
{})
};
if
(
cuk
&&
!
params
.
cuk
)
params
.
cuk
=
cuk
;
...
...
@@ -97,15 +108,15 @@ export default {
onShareAppMessage
(
options
)
{
// 分享功能
const
{
share
}
=
this
;
console
.
warn
(
share
?.
link
,
"share.link--------"
,
JSON
.
stringify
(
options
));
console
.
warn
(
share
?.
shareUrl
,
"share.link--------"
,
JSON
.
stringify
(
options
));
if
(
share
)
{
const
shareurl
=
share
.
link
;
const
shareurl
=
share
.
shareUrl
;
return
{
title
:
share
.
t
itle
,
title
:
share
.
shareT
itle
,
path
:
shareurl
,
imageUrl
:
share
.
img
Url
||
''
,
imageUrl
:
share
.
shareImage
Url
||
''
,
success
:
function
(
res
)
{
console
.
log
(
res
,
'分享成功'
);
// uni.showToast({
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment