onShareAppMessage(res) {
let shareimgs = uni.getStorageSync('shareimgs');
let sharetitle = uni.getStorageSync('sharetitle');
let imageUrl = this.myPageShareInfo.image || shareimgs || ''
console.log('---------11', imageUrl);
return {
title: this.myPageShareInfo.title || sharetitle || '玩乐主义',
imageUrl
};
},
onShareTimeline(res) {
let shareimgs = uni.getStorageSync('shareimgs');
let sharetitle = uni.getStorageSync('sharetitle');
let imageUrl = this.myPageShareInfo.image || shareimgs || ''
console.log('---------11', imageUrl);
return {
title: this.myPageShareInfo.title || sharetitle || '玩乐主义',
imageUrl
};
},
一样的代码onShareTimeline 分享时可以被触发打印内容也有 onShareAppMessage 内的打印就不会生效
也全局搜索了 onShareAppMessage 没有别的地方有定义
在开发者工具中onShareAppMessage 中设置的图片 标题 打印都是生效的在实际小程序中就会有这个问题
appid wx5b227b8c840700c9

这是两个不同入口。onShareAppMessage 只在“分享给朋友”时触发,需页面有分享入口(右上角菜单或 button open-type='share'),如果被 wx.hideShareMenu/uni.hideShareMenu 隐藏了就不会进。onShareTimeline 只管朋友圈。