可以先把真个页面写在一个view里面 定义一个id
比如
<view id="zong">
所有内容
</view>
js
在onLoad里面写入即可获取页面总高度
var query = wx.createSelectorQuery();
query.select('#zong').boundingClientRect(function (rect) {
that.setData({
juligao: rect.height,
})
console.log("top", that.data.juligao)
}).exec();