boundingClientRect 不准确
//节点选择
wx.createSelectorQuery().select(’#orderDeSec_idParam’).boundingClientRect(function (secRect) {
wx.createSelectorQuery().select(’#bottom_idParam’).boundingClientRect(function (bottomRect) {
let tempConHei = (bottomRect.top - secRect.top)*2 -20
console.log(‘内容高度:’, tempConHei)
that.setData({
contHei: tempConHei
})
}).exec()
}).exec()
👆这个代码拿到的数据,在部分机型上不适配(模拟器都没适配完,iPhone5、Nexus系列都不对,
具体效果见代码片段:wechatide://minicode/ATBV14mi7ZTu