fix: 移动端仪表板纵向布局

This commit is contained in:
fit2cloud-chenyw 2022-03-02 18:03:48 +08:00
parent c2d31d6207
commit c29759ad8a

View File

@ -31,6 +31,8 @@
@scrolltolower="lower" @scrolltolower="lower"
@scroll="scroll"> @scroll="scroll">
<!-- <web-view v-if="url" :style="{height: 'calc(100vh - ' + ktxStatusHeight +'px)'}" /> -->
<!-- <web-view v-if="url" style="height: 100vh;" /> -->
<web-view v-if="url" :style="{height: viewHeight}" /> <web-view v-if="url" :style="{height: viewHeight}" />
</scroll-view> </scroll-view>
@ -89,7 +91,8 @@
old: { old: {
scrollTop: 0 scrollTop: 0
}, },
viewHeight: null viewHeight: null,
ktxStatusHeight: null
} }
}, },
onLoad(event) { onLoad(event) {
@ -181,14 +184,12 @@
}, },
caclViewHeight() { caclViewHeight() {
let systemInfo = uni.getSystemInfoSync() let systemInfo = uni.getSystemInfoSync()
let pxToRpxScale = 750 / systemInfo.windowWidth; const h5Height = systemInfo.windowHeight - systemInfo.statusBarHeight
// 屏幕的高度 if(systemInfo.navigationBarHeight) {
let ktxScreentHeight = systemInfo.screenHeight * pxToRpxScale h5Height = h5Height - systemInfo.navigationBarHeight
// 状态栏的高度 }
let ktxStatusHeight = systemInfo.statusBarHeight * pxToRpxScale this.viewHeight = h5Height + 'px'
// 导航栏的高度
let navigationHeight = 44 * pxToRpxScale
this.viewHeight = (ktxScreentHeight - ktxStatusHeight) + 'px'
}, },
back() { back() {
// #ifdef H5 // #ifdef H5