uniapp 微信小程序分享到好友 朋友圈
微信小程序分享到朋友圈 只支持安卓部分机型 点击头部分享通过按钮分享
·
维信小程序分享到朋友圈 只支持安卓部分机型
点击头部分享
onLoad: function() {
wx.showShareMenu({
withShareTicket: true,
menus: ["shareAppMessage", "shareTimeline"]
})
},
通过按钮分享
<button open-type="share" class="share"><img src="./img/share.png" /></button>
//分享到好友
onShareAppMessage(res) {
return {
title: this.info.shareTitle,
path: '/pages/index/index',
imageUrl:'',
}
},
//分享到朋友圈 ,目前这个接口灰度中,只支持部分安卓机型
onShareTimeline:function(){
return {
title: this.info.shareTitle,
imageUrl:this.info.shareImageUrl,
query:''
}
},
更多推荐
已为社区贡献2条内容
所有评论(0)