//分享朋友圈
onShareTimeline(res) {
console.log("分享到朋友圈", res)
return {
title: '租车', // 标题
path: '/pages/index/index', // 分享路径
query: `shangji_id=${this.userInfo.id}`, // 动态参数1
imageUrl: 'https://bs.dzqiji.com/uploads/20240123/081bdb2c4438566e0adc9cafa78fa7e7.jpg' // 分享图
};
},
//分享给好友
onShareAppMessage(res) {
if (res.from === 'button') {// 来自页面内分享按钮
console.log(res.target)
}
return {
title: '分享的标题',
path: '/pages/index/index?shangji_id='+this.userInfo.id,
imageUrl: 'https://bs.dzqiji.com/uploads/20240123/081bdb2c4438566e0adc9cafa78fa7e7.jpg' // 分享图
}
},
uniapp小程序右上角分享朋友圈分享好友
最新推荐文章于 2024-06-16 13:17:28 发布
本文介绍了如何在微信小程序中实现分享到朋友圈和好友的功能,包括设置分享标题、路径、动态参数和分享图片。
摘要由CSDN通过智能技术生成