html52.com
我爱小程序-开发者交流社区

微信转发功能onShareAppMessage点击后设置无效问题

问题模块
API和组件

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都没有,仍然是当前页面,这是为什么?

网友回复

网无忌:

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

ZCL.:

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

『花嫁雾语微请柬』小程序:

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

ZCL.:

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

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

真正的个人免签约支付接口

云免签H5支付