Commit 27e1aa78 authored by spc's avatar spc

去除分享朋友圈

parent 9019576f
......@@ -185,7 +185,9 @@
"style": {
"navigationBarTitleText": "",
"navigationStyle": "custom",
"enableShare": true
"enableShare": true,
"shareAppMessage": true,
"shareTimeline": false
}
},
{
......
......@@ -126,7 +126,7 @@ const fetchDetailData = async (id) => {
detailData.value = result.data
recordId.value = id // 保存记录ID
console.log('✅ 详情数据获取成功:', detailData.value)
// 初始化时同步收藏状态到上一页
syncCollectionStatusToPrevPage()
} else {
......@@ -243,7 +243,7 @@ const handleShareClick = () => {
// 手动触发分享(如果需要的话)
// uni.showShareMenu({
// withShareTicket: true,
// menus: ['shareAppMessage', 'shareTimeline']
// menus: ['shareAppMessage'] // 仅分享给好友,禁用朋友圈
// })
}
......@@ -268,7 +268,7 @@ const handleGoBack = () => {
}
// 生命周期
onMounted(async () => {
onMounted(async (options) => {
md.sensorComponentLogTake({
xcxComponentExposure: "true",
......@@ -305,18 +305,23 @@ onMounted(async () => {
componentContent: "藏品详情页+" + detailData.value.content
});
} else {
console.warn('⚠️ 未获取到页面参数 id')
uni.showToast({
title: '参数错误',
icon: 'none'
})
console.warn('⚠️ 未获取到页面参数 id', options, currentPage.options)
// uni.showToast({
// title: '参数错误',
// icon: 'none'
// })
// uni.redirectTo({
// url: `/pages/xingmaLab/xingmaLab`
// })
}
// 启用分享菜单
uni.hideShareMenu({
menus: ['shareTimeline']
})
// 启用分享菜单(仅限分享给好友,禁用朋友圈)
uni.showShareMenu({
withShareTicket: true,
menus: ['shareAppMessage', 'shareTimeline']
menus: ['shareAppMessage']
})
})
......@@ -375,34 +380,18 @@ export default {
// 如果无法获取页面实例,返回默认分享内容
return {
title: '星妈实验室详情',
title: '',
path: `/pages/XingmaLabDetailPage/XingmaLabDetailPage?id=${id}`,
imageUrl: ''
}
},
onShareTimeline() {
console.log('onShareTimeline 被调用')
// 获取当前页面的数据
const pages = getCurrentPages()
const currentPage = pages[pages.length - 1]
const options = currentPage.options || {}
const id = options.id || ''
// 获取页面实例
const pageInstance = currentPage.$vm
if (pageInstance && pageInstance.getShareData) {
return pageInstance.getShareData()
}
// 如果无法获取页面实例,返回默认分享内容
return {
title: '星妈实验室详情',
path: `/pages/XingmaLabDetailPage/XingmaLabDetailPage?id=${id}`,
imageUrl: ''
}
}
// 朋友圈分享已禁用
// onShareTimeline() {
// console.log('onShareTimeline 被调用')
// // 朋友圈分享功能已禁用
// return null
// }
}
</script>
......
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