open-type="share" onShareAppMessage不触发

发布于 6 年前作者 huangwei2308 次浏览最后编辑 6 年前来自 ask

button open-type=“share” 不写onShareAppMessage 能分享   写了onShareAppMessage 不触发

<button open-type=“share” class=‘fenxiang’></button>

//分享

onShareAppMessage: function (res) {

console.log(‘123’);

if (res.from === ‘button’) {

console.log(res.target)

}

return {

title: ‘123123’,

path: ‘/pages/list/play/play?id=’+this.data.playid,

success: function (res) {

},

fail: function (res) {

}

}

},

// 生命周期函数–监听页面显示

onShow: function() {

},

1 回复
rguo
rguo1 楼5 年前

你好,问题未复现。请提供一下出现问题的机型和微信版本,以及能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。