cwg-page-wrapper.vue 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <template>
  2. <view class="page-wrapper">
  3. <cwg-progress />
  4. <cwg-header v-if="!isHeaderFixed" />
  5. <view :style="{ height: `calc(${statusBarHeight}px + 60px)` }" />
  6. <slot></slot>
  7. <view :style="{ height: isTabBarPage ? '60px' : '0px' }" />
  8. <cwg-tab-bar v-model:isTabBarPage="isTabBarPage" />
  9. </view>
  10. </template>
  11. <script setup>
  12. import { ref, onMounted, computed, } from "vue";
  13. import { onLoad, onShow } from '@dcloudio/uni-app'
  14. import { updateRoute } from '@/hooks/useRoute'
  15. import useGlobalStore from '@/stores/use-global-store'
  16. import { useAppUpdate } from '@/hooks/useAppUpdate'
  17. const { checkUpdate } = useAppUpdate()
  18. const props = defineProps({
  19. isHeaderFixed: {
  20. type: Boolean,
  21. default: false
  22. }
  23. })
  24. const globalStore = useGlobalStore()
  25. const statusBarHeight = computed(() => globalStore.statusBarHeight);
  26. const isTabBarPage = ref(false)
  27. onLoad(() => {
  28. updateRoute()
  29. })
  30. onShow(() => {
  31. updateRoute()
  32. })
  33. </script>
  34. <style lang="scss" scoped>
  35. @import "@/uni.scss";
  36. .page-wrapper {
  37. padding: 0 px2rpx(24) px2rpx(0) px2rpx(24);
  38. box-sizing: border-box;
  39. border: 1px solid rgba(0, 0, 0, 0);
  40. }
  41. </style>