不说谎话,因为总有被拆穿的一天。
<button class="btn sendFriends shareTips" open-type="share">发送给朋友</button>
// 小程序 发送给朋友
onShareAppMessage: function(res) {
wx.showToast({ title: res, icon: 'success', duration: 2000 })
var that = this;
var courseId = that.data.courseId; //获取产品id
var title = that.data.title; //获取产品标题
var cover = that.data.cover; //产品图片
that.hideModal();
if (res.from === 'button') {
// 来自页面内转发按钮
return {
title: title,
path: '/page/index?courseId=' + courseId,
imageUrl: cover, //不设置则默认为当前页面的截图
success: (res) => {
wx.showToast({ title: res, icon: 'success', duration: 2000 })
},
fail: (res) => {
wx.showToast({ title: res, icon: 'success', duration: 2000 })
}
}
}
},
在最后附上我的QQ: 2489757828 有问题的话可以找我一同探讨