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

发布于 6 年前作者 chaoshi1214 次浏览最后编辑 6 年前来自 ask

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 回复
juanlong
juanlong1 楼6 年前

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

gang15
gang152 楼5 年前

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