获取某个元素的高度
getRect(){
var that = this;
wx.createSelectorQuery().select('#advert').boundingClientRect(function(rect){
that.setData({
ad_height:rect.height,
})
}).exec()
},
onLoad: function (options) {
this.getRect();
var that = this;
wx.getSystemInfo({
success: function (res) {
that.setData({
win_height: res.windowHeight
});
},
})
}
获取屏幕信息
wx.getSystemInfo({
success: function (res) {
that.setData({
win_height: res.windowHeight
});
},
})