.main_body {
height: calc(100vh - var(--window-bottom) - var(--window-top));
}
getSmHeight() {
let that = this;
setTimeout(() => {
let windowHeight = uni.getSystemInfoSync().windowHeight;
let sm = uni.createSelectorQuery().select(".saoma"); //想要获取高度的元素名(class/id)
sm.boundingClientRect(data => {
console.log(data, '获取高度3')
const top = data ? data.top : 0;
that.smHeight = windowHeight - top - uni.upx2px(20);
if (that.smHeight < 200) {
that.smHeight = 200;
}
}).exec()
let order = uni.createSelectorQuery().select(".orders");
let btn = uni.createSelectorQuery().select(".send_list.fixed_bottom");
order.boundingClientRect(data => {
const top = data ? data.top : 0;
console.log(data, '获取高度1')
btn.boundingClientRect(data => {
console.log(data, '获取高度4')
const bottom = data ? data.height : 0;
console.log(bottom, '获取高度2')
that.orderHeight = windowHeight - top - bottom - uni.upx2px(30);
if (that.orderHeight < uni.upx2px(480)) {
that.orderHeight = uni.upx2px(480);
}
}).exec()
}).exec()
}, 300)
}