收藏
回答

onShareAppMessage的path中的变量怎么异步获取后转发

Page({  

  onShareAppMessage: function (res) {    

    let queryId = ''

   wx.request({      

    url: '...',    

    method: 'GET',

     success (res) {        queryId = res.queryId      },

   })    


    return {      

        title: '自定义转发标题',      

        path: `/page/user?queryId=${queryId}`,

       success (res) {  

         // 转发成功

      },    }  } })


回答关注问题邀请回答
收藏

2 个回答

  • 2018-04-22

    +1,现阶段只能在share之前把数据获取完

    2018-04-22
    有用
    回复
  • 2017-10-17

    考虑在 share 动作之前获取这个 query?(比如 onLoad 或者 onShow

    2017-10-17
    有用
    回复
登录 后发表内容