微信小程序分享到好友或朋友圈 : onShareAppMessage(object)
1)
wxml:
open-type="" : 微信开放能力 share:出发用户转发
js:
/
用户点击右上角分享
/*
onShareAppMessage: function (options) {
var that = this;
return {
title: ‘//自定义’,
path: ‘/pages/doctordetail/index’,
imageUrl: ‘/images/lobby/bg_musicguess.png’,
success: function(options) {
if (options.shareTickets) {
wx.showToast({
title: ‘已经分享到群’,
});
} else {
wx.showToast({
title: ‘请分享到群’,
});
}
},
fail: function (options) {
that.setData({
msg: JSON.stringify(options)
});
}
}
},