小程序分享页面的时候,大部分的资料都是显示的是onShareAppMessage 这个方法
/*** 用户点击右上角分享*/onShareAppMessage(res) {return {title: '您的好友向您分享了一本通讯录: ' + this.data.setting.name,imageUrl: this.data.setting.share_img,path: 'pages/share/index?user_id=' + getApp().globalData.user_id + '&id=' + id }}
对于我来说, 上面的参数是在是太多了。
其实可以有更简单的方法,就是showShareMenu。
参考如下:
onShow(){wx.showShareMenu({withShareTicket: true});
},