微信转发功能onShareAppMessage点击后设置无效问题
发布于 6 年前 作者 yangxiong 5444 次浏览 来自 问答

JS中 

onShareAppMessage: function (res) {

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

      // 来自页面内转发按钮

      console.log(res.target)

    }

    return {

      title: ‘自定义转发标题’,

      path: ‘/pages/component/product/product’,

      success: function (res) {

        console.log(“转发成功”)

      },

      fail: function (res) {

        console.log(“转发失败”)

      }

    }

  },

通过HTML的button按钮触发

<button class=“icon-item” data-idx="{{item.id}}" open-type=“share” bindtap=“onShareAppMessage”>分享</button>

点击后的确有转发功能,但是我设置的title和path都没有,仍然是当前页面,这是为什么?

4 回复

而且也没有console.log出相关内容

我也发现这个问题,不知道楼主解决了没有

已去掉bindtap 效果依旧 只出现当前页面和没有title

已经有open-type了,你把bindtap去掉看看。

回到顶部