Commit 5f3c87c2 authored by spc's avatar spc

act915

parent 7c06a476
......@@ -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)
},
// 朋友圈分享已禁用
......
{
"act915pagebanner": [
{
"image": "Act915Page/v2/Act915PageBanner.png",
"image": "Act915Page/v2/Act915PageBanner2.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"
}
}
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment