…
onLoad: function(options) {
var user = wx.getStorageSync(‘user’);
wx.request({
url: app.url + ‘/Api/GetDefault’,
data: {
yh_id: user.id,
yh_tel: user.mobile
},
method: ‘post’,
success: res => {
if (res.data.isok == ‘yes’) {
yemian=res.data.info;
this.setData({
yemian: yemian
});
}
}
})
},
…
onReady: function() {
var yemian = this.data.yemian;
console.log(yemian);
},
问题:执行onload 中的 wx.request,返回值用setData渲染到wxml页面,onReady 是获取setData渲染完毕之后的值还是之前的值