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
5f3c87c2
Commit
5f3c87c2
authored
Sep 09, 2025
by
spc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
act915
parent
7c06a476
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
37 deletions
+19
-37
act0915.vue
activity0915/act0915/act0915.vue
+8
-23
act915.json
mock/act915.json
+11
-14
No files found.
activity0915/act0915/act0915.vue
View file @
5f3c87c2
...
...
@@ -144,12 +144,14 @@ defineOptions({
// 定义分享函数
const
getShareData
=
()
=>
{
const
getShareData
=
(
type
)
=>
{
console
.
log
(
'getShareData 被调用'
,
type
)
const
{
proxy
}
=
getCurrentInstance
()
const
$baseUrl
=
proxy
.
$baseUrl
const
shareTitle
=
invitationText
.
value
||
'
飞鹤915活动
'
const
shareTitle
=
invitationText
.
value
||
'
星妈会超级品牌周来啦!666积分兑换爱本纤纤3日装!
'
const
shareImage
=
invitationImageUrl
.
value
||
$baseUrl
+
'Act915Page/v2/act915ShareImg.png'
const
sharePath
=
`/activity0915/act0915/act0915?invitationCode=
${
invitationCode
.
value
}
`
const
sharePath
=
type
.
from
==
'button'
?
`/activity0915/act0915/act0915?invitationCode=
${
invitationCode
.
value
}
`
:
`/activity0915/act0915/act0915`
console
.
log
(
'分享参数:'
,
{
title
:
shareTitle
,
...
...
@@ -644,29 +646,12 @@ defineExpose({
// 微信小程序分享配置 - 使用 Options API
export default {
// 自定义分享内容
onShareAppMessage() {
console.log('onShareAppMessage 被调用')
// 获取全局属性
const { proxy } = getCurrentInstance()
const $baseUrl = proxy.$baseUrl
// 获取当前页面的数据
onShareAppMessage(type) {
console.log('onShareAppMessage 被调用', type)
const pages = getCurrentPages()
const currentPage = pages[pages.length - 1]
const options = currentPage.options || {}
const invitationCode = options.invitationCode || ''
// 获取页面实例
const pageInstance = currentPage.$vm
if (pageInstance && pageInstance.getShareData) {
return pageInstance.getShareData()
}
// 如果无法获取页面实例,返回默认分享内容
return {
title: '飞鹤915活动',
path: `
/
activity0915
/
act0915
/
act0915
?
invitationCode
=
$
{
invitationCode
}
`,
imageUrl: $baseUrl + 'Act915Page/v2/act915ShareImg.png'
}
return pageInstance.getShareData(type)
},
// 朋友圈分享已禁用
...
...
mock/act915.json
View file @
5f3c87c2
{
"act915pagebanner"
:
[
{
"image"
:
"Act915Page/v2/Act915PageBanner.png"
,
"image"
:
"Act915Page/v2/Act915PageBanner
2
.png"
,
"link"
:
{
"type"
:
1
,
"url"
:
"
/pages/syWebview/syWebview?p=act915_banner1
"
"type"
:
-
1
,
"url"
:
""
}
},
{
"image"
:
"Act915Page/v2/Act915PageBanner.png"
,
"link"
:
{
"type"
:
1
,
"url"
:
"/pages/syWebview/syWebview?p=act915_banner2"
}
},
{
"image"
:
"Act915Page/v2/Act915PageBanner.png"
,
"link"
:
{
"type"
:
1
,
"url"
:
"/pages/syWebview/syWebview?p=act915_banner3"
"type"
:
-1
,
"url"
:
""
}
}
],
...
...
@@ -206,8 +199,12 @@
"goods1"
:
{
"image"
:
"Act915Page/v2/Act915PageGoods1.png"
,
"link"
:
{
"type"
:
1
,
"url"
:
"/pages/goodsDetail/goodsDetail?id=16"
"extra"
:
{
"envVersion"
:
"release"
,
"appId"
:
"wx4205ec55b793245e"
},
"type"
:
2
,
"url"
:
"subPackages/shopMainProcess/product/index?productId=809227403994695284&skuId=809227403994695285"
}
}
},
...
...
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