promise优先wx.request执行,请问如何解决?
[代码]// pages/posts/posts.js[代码][代码]var[代码] [代码]WxParse = require([代码][代码]'../../wxParse/wxParse.js'[代码][代码]);[代码][代码]const app = getApp();[代码][代码]Page({[代码] [代码] [代码][代码]/**[代码][代码] [代码][代码]* 页面的初始数据[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]data: {[代码][代码] [代码][代码]posts: [代码][代码]''[代码][代码],[代码][代码]//文章[代码][代码] [代码][代码]title: [代码][代码]''[代码][代码],[代码][代码] [代码][代码]detailsId: [代码][代码]''[代码][代码],[代码][代码] [代码][代码]postsTag: [代码][代码]''[代码][代码],[代码][代码]//标签名称[代码][代码] [代码][代码]imgUrl: [代码][代码]''[代码][代码],[代码][代码]//分享图片,[代码][代码] [代码][代码]isGoIndex: [代码][代码]false[代码][代码]//返回首页按钮[代码][代码] [代码][代码]},[代码] [代码] [代码][代码]/**[代码][代码] [代码][代码]* 生命周期函数--监听页面加载[代码][代码] [代码][代码]*/[代码][代码] [代码][代码]onLoad: [代码][代码]function[代码] [代码](options) {[代码][代码] [代码][代码]var[代码] [代码]that = [代码][代码]this[代码][代码];[代码][代码] [代码][代码]// 判断数据来源[代码][代码] [代码][代码]if[代码] [代码](options.isshare == 1) {[代码][代码] [代码][代码]console.log([代码][代码]'我是从分享进来的'[代码][代码], options.isshare)[代码][代码] [代码][代码]// 重新请求数据[代码][代码] [代码][代码]wx.request({[代码][代码] [代码][代码]url: app.globalData.dataUrl.testUrl || app.globalData.dataUrl.officialUrl,[代码][代码] [代码][代码]success(res) {[代码][代码] [代码][代码]console.log([代码][代码]'详情页:请求成功'[代码][代码], res.data.posts)[代码][代码] [代码][代码]that.setData({[代码][代码] [代码][代码]posts: res.data.posts,[代码][代码] [代码][代码]isGoIndex: [代码][代码]true[代码][代码] [代码][代码]})[代码][代码] [代码][代码]},[代码][代码] [代码][代码]fail(res) {[代码][代码] [代码][代码]console.log([代码][代码]'详情页:请求失败'[代码][代码])[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码][代码] [代码][代码]} [代码][代码]else[代码] [代码]{[代码][代码] [代码][代码]console.log([代码][代码]'我是从列表进来的'[代码][代码], that.data.isGoIndex, options.isshare)[代码][代码] [代码][代码]that.setData({[代码][代码] [代码][代码]posts: app.globalData.posts,[代码][代码] [代码][代码]isGoIndex: [代码][代码]false[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}[代码][代码] [代码][代码]// 加载数据[代码][代码] [代码][代码]app.promiseData().then([代码][代码]function[代码] [代码]() {[代码][代码] [代码][代码]// 数据筛选[代码][代码] [代码][代码]setTimeout([代码][代码]function[代码] [代码]() {[代码][代码]// 解决异步获取步骤问题[代码][代码] [代码][代码]console.log([代码][代码]'log页的posts数据:'[代码] [代码]+ that.data.posts)[代码][代码] [代码][代码]that.data.posts.map([代码][代码]function[代码] [代码](item, idx) {[代码][代码] [代码][代码]if[代码] [代码](item.date == options.id) {[代码][代码] [代码][代码]WxParse.wxParse([代码][代码]'article'[代码][代码], [代码][代码]'html'[代码][代码], item.content, that, 5);[代码][代码] [代码][代码]that.setData({[代码][代码] [代码][代码]title: item.title,[代码][代码] [代码][代码]detailsId: options.id,[代码][代码] [代码][代码]postsTag: item.tags[0].name[代码][代码]//存储当前文章标签[代码][代码] [代码][代码]})[代码][代码] [代码][代码]console.log([代码][代码]'log页最终筛选出来的数据:'[代码] [代码]+ that.data.title)[代码][代码] [代码][代码]}[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}, 50)[代码][代码] [代码][代码]})[代码][代码] [代码][代码]}[代码] [代码]})[代码]以上是我的代码,根据options.isshare来判断是从分享链接(1)进来的还是列表页(0)进来的,从列表页面进入页面浏览显示没有问题,但是从分享链接进入页面的时候app.promiseData()会优先于wx.request执行,倒是页面内容无法渲染展示,请问我应该如何解决此问题呢?