微信小程序onShareAppMessage不起作用

onShareAppMessage里面不能加请求
在这里插入图片描述
去掉我选中的部分就生效了

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function (res) {
    
    
    if (res.from === 'button') {
    
    
      // 来自页面内转发按钮
      console.log(" 来自页面内转发按钮")
      //获取参数id
      this.data.idList = this.data.certInfo.id
      // api.get
      return {
    
    
        title: '我的分享',
        path: '/pages/share/share?id=' + this.data.idList, //这里拼接需要携带的参数
        imageUrl: '../../../images/sharePicture.png'
      },
      this.setData({
    
    
        hideFlag:true
      })
    }
  },

猜你喜欢

转载自blog.csdn.net/syiting/article/details/117286148