cwg-page-wrapper.vue 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. const props = defineProps({
  17. isHeaderFixed: {
  18. type: Boolean,
  19. default: false
  20. }
  21. })
  22. const globalStore = useGlobalStore()
  23. const statusBarHeight = computed(() => globalStore.statusBarHeight);
  24. const isTabBarPage = ref(false)
  25. onLoad(() => {
  26. updateRoute()
  27. })
  28. onShow(() => {
  29. updateRoute()
  30. })
  31. </script>
  32. <style lang="scss" scoped>
  33. @import "@/uni.scss";
  34. .page-wrapper {
  35. padding: 0 px2rpx(24) px2rpx(0) px2rpx(24);
  36. box-sizing: border-box;
  37. border: 1px solid rgba(0, 0, 0, 0);
  38. }
  39. </style>