小程序分享朋友圈,ios部分手机无效
发布于 7 年前 作者 junxiang 9976 次浏览 来自 官方Issues
onShow: function () {
    const that = this;
    wx.cloud.callFunction({
      name: 'getUser',
      success: res => {
        if(res.result.data.lock==undefined){
          that.data.openid = that.data.options.shareid;
        }
      }
    })
    wx.showShareMenu({
      withShareTicket: true,
      menus: ['shareAppMessage''shareTimeline']
    })
  },
  /*用户点击右上角分享*/
  onShareAppMessage: function () {
    return {
      title: this.data.title,
      path: '/pages/article/index?shareid='+this.data.openid+'&id='+this.data.options.id
    }
  },
  onShareTimeline: function () {
    return {
      title: this.data.title,
      query: 'shareid='+this.data.openid+'&id='+this.data.options.id
    }
  }
1 回复

只支持安卓

回到顶部