分享按钮open-type="share"?
发布于 7 年前 作者 bye 14596 次浏览 来自 官方Issues

开发过程中使用分享功能时,在Button上 设置一个

bindtap=‘shareButton’ open-type=“share”

这两个属性,现在我想在shareButton事件执行完成之后在调用系统分享页面,不知道有没有办法!

3 回复
// 可以在成功回调里执行试试
// 提前把你要的数据提升到全局就不需要绑定额外事件
onShareAppMessage(e){
  return wx.navigateTo({
    url: `test?id=${this.id}`,
    success:(res)=>{
       return {
         title: this.title,
         path: `/page/user?id=${this.id}`
      }
     }
  })

可以在 onShareAppMessage 里边判断是否来自按钮点击分享

onShareAppMessage(e){

if(e.from==='button'){

	shareButton()

}

}

回到顶部