/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
//分享
console.log("分享")
var that = this
console.log("分享1")
return {
title: '双十一来了瞧一瞧看一看喽',
path: '/hyb_zylxc/index/index',
success: res => {
console.log("分享2")
console.log("分享成功" + res)
console.log(res.shareTickets[0]);
// shareTicket 是获取转发目标群信息的票据,只有拥有 shareTicket 才能拿到群信息,用户每次转发都会生成对应唯一的shareTicket 。
// 如果这里有 shareTickets,则说明是分享到群de 如果没有则是转发到好友的
wx.getShareInfo({
shareTicket: res.shareTickets[0],
success: res => {
that.setData({
isShow: true
})
console.log(that.setData.isShow)
},
fail: function (res) { console.log(res) },
complete: function (res) { console.log(res) }
})
},
fail: function (res) {
console.log("分享失败" + res)
}
}
}