|
|
|
@ -1,7 +1,7 @@ |
|
|
|
<script setup> |
|
|
|
import { onLoad } from "@dcloudio/uni-app"; |
|
|
|
import { ref } from "vue"; |
|
|
|
import { useHeight } from "@/libs/utils"; |
|
|
|
import { nextTick, ref } from "vue"; |
|
|
|
import { useHeight, useRect } from "@/libs/utils"; |
|
|
|
import useStore from "@/store"; |
|
|
|
|
|
|
|
const store = useStore(); |
|
|
|
@ -17,13 +17,22 @@ const safeHeight = ref({ |
|
|
|
onLoad(() => { |
|
|
|
store.fontScale = uni.getStorageSync("fontScale") || 1; |
|
|
|
const height = useHeight(); |
|
|
|
// console.log(height); |
|
|
|
|
|
|
|
safeHeight.value.status = height.status; |
|
|
|
safeHeight.value.menu = height.menu; |
|
|
|
safeHeight.value.screen = height.screen; |
|
|
|
safeHeight.value.content = height.content; |
|
|
|
safeHeight.value.bottom = height.bottom; |
|
|
|
|
|
|
|
// #ifdef H5 |
|
|
|
nextTick(async () => { |
|
|
|
const rect = await useRect(".h5Title"); |
|
|
|
if (rect) { |
|
|
|
safeHeight.value.menu = rect.height; |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
// #endif |
|
|
|
}); |
|
|
|
</script> |
|
|
|
|
|
|
|
@ -40,6 +49,14 @@ onLoad(() => { |
|
|
|
:bottom="safeHeight.bottom" |
|
|
|
:tabbar="safeHeight.tabbar" |
|
|
|
:content="safeHeight.content" |
|
|
|
:style="{ |
|
|
|
height: safeHeight.menu ? `${safeHeight.menu}px` : '45px', |
|
|
|
paddingTop: `${safeHeight.status}px`, |
|
|
|
backgroundColor: '#f8f8f8', |
|
|
|
width: '100%', |
|
|
|
display: 'flex', |
|
|
|
alignItems: 'center', |
|
|
|
}" |
|
|
|
:fix-style=" { |
|
|
|
height: safeHeight.menu ? `${safeHeight.menu}px` : '45px', |
|
|
|
paddingTop: `${safeHeight.status}px`, |
|
|
|
|