测试分享的简单方法
wxml:
<button open-type="share">分享</button>
<button bindtap="testShare">测试分享</button>
js:
onShareAppMessage: function () {
let title = 'title'
let imageUrl = 'url'
letlet path = '/pages/index/index?postId=' + this.data.post._id
return { title, imageUrl, path }
},
testShare:function(){
let path = '/pages/index/index?postId=' + this.data.post._id
wx.navigateTo({
url: path,
})
}