// calcToBottomHeight 计算后所需要的高度
<div class="c-button" :style="{'bottom': calcToBottomHeight + 'px'}">
<div class="c-button-item c-align-center" @click="deSendInvoice">
<span class="c-font-16">确定</span>
</div>
</div>computed: {
calcToBottomHeight () {
let flat = 0
const needSafeAreaMap = [
'iPhone X',
'iPhone 11',
'iPhone 12',
'iPhone 13'
]
wx.getSystemInfo({
success: res => {
console.log('61', res)
this.statusBatHeight = res.statusBarHeight
for (let i = 0; i < needSafeAreaMap.length; i++) {
if (res.model.includes(needSafeAreaMap[i])) {
flat = 1
}
}
}
})
return flat ? this.statusBatHeight : 0
}
},