look at the online code is written like this
Page({
data: {
},
onLoad: function () {
wx.showShareMenu({
withShareTicket: true,
success: function (res) {
//
console.log(res)
},
fail: function (res) {
//
console.log(res)
}
})
},
onShareAppMessage: function () {
return {
title: "",
path: "/page/index/index?id=123",
success: function (res) {
console.log(res.shareTickets[0])
wx.getShareInfo({
shareTicket: res.shareTickets[0],
success: function (res) { console.log(res) },
fail: function (res) { console.log(res) },
complete: function (res) { console.log(res) }
})
},
fail: function (res) {
//
console.log(res)
}
}
}
})
however, when I forwarded it to my friends, I reported an error and found that there was no res.shareTickets
attribute at all. Later, I took a look at how this code should be organized only when it was transferred to the group. I feel that the API of Mini Program"s official website is not detailed. Urgent ~
if you do not use the getShareInfo ()
method, you can only pass the forwarder id as a parameter, and then go to the forwarded page to query the forwarder"s information.