需求分享商品详情页给微信好友
js
onShareAppMessage: function (res) {
let id = this.data.id;
return {
title: this.data.xiangqing.host_name,
path: '/pages/details/details?id=' + id ,
imageUrl: this.data.xiangqing.banner_image,
success: function (res) {
wx.showToast({
title: "分享成功",
icon: 'success',
duration: 2000
})
},
fail: function (res) {
},
}
},
wxml
<button data-info='{{order}}' open-type="share" hover-class='none'>分享</button>
分享按钮