使用 this.setData赋值失败?
onReady: function () {
let that = this
wx.getSystemInfo({
complete: (res) => {
var query = wx.createSelectorQuery()
query.select('#bottom').boundingClientRect(function(qRes) {
that.setData({
userInfoCardHeight:res.windowHeight-qRes.height
})
console.log(res.windowHeight-qRes.height)
}).exec();
},
})
console.log("用户卡片高度"+that.data.userInfoCardHeight)
},