分享微信好友
分享按钮
<button open-type="share" class="bot_btn" style="background: #FF3162;">按钮分享</button>
分享函数
res.from,可以监听到分享来源
onShareAppMessage(res) {
console.log(9999999999, res);
if (res.from == 'button') {
consnaole.log('按钮分享')
}
if (res.from == 'menu') {
consnaole.log('右上角分享')
}
const promise = new Promise(resolve => {
setTimeout(() => {
resolve({
title: '你接到一个管理示范园的邀请',
imageUrl: "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fs13.sinaimg.cn%2Fbmiddle%2F4d049168cc5e11e7fb13c&refer=http%3A%2F%2Fs13.sinaimg.cn&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1620790841&t=1c4be63584b12149be4814e3ec0b3126",
})
}, 2000)
})
return {
title: '你接到一个管理示范园的邀请',
path: '/pages/updata/login/example/example',
imageUrl: "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fs13.sinaimg.cn%2Fbmiddle%2F4d049168cc5e11e7fb13c&refer=http%3A%2F%2Fs13.sinaimg.cn&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1620790841&t=1c4be63584b12149be4814e3ec0b3126",
promise
}
},
分享朋友圈
暂无自定义分享
onShareTimeline() {
return {
title: '标题',
path: '路径',
imageUrl:'封面图片',
};
},