<template>
  <view class="page-wrapper">
    <cwg-progress />
    <cwg-header v-if="!isHeaderFixed" />
    <slot></slot>
    <view :style="{ height: isTabBarPage ? '60px' : '0px' }" />
    <cwg-tab-bar v-model:isTabBarPage="isTabBarPage" />
  </view>
</template>

<script setup>
import { ref } from "vue";
import { onLoad, onShow } from '@dcloudio/uni-app'
import { updateRoute } from '@/hooks/useRoute'
const props = defineProps({
  isHeaderFixed: {
    type: Boolean,
    default: false
  }
})
const isTabBarPage = ref(false)
onLoad(() => {
  updateRoute()
})

onShow(() => {
  updateRoute()
})

</script>

<style lang="scss" scoped>
@import "@/uni.scss";

.page-wrapper {
  padding: 0 px2rpx(24) px2rpx(0) px2rpx(24);
  box-sizing: border-box;
  border: 1px solid rgba(0, 0, 0, 0);
}
</style>
