<template>
  <view class="tab-page">
    <ComprehensivePrivate v-if="isComprehensive" ref="contentRef" />
    <IcePrivate v-else ref="contentRef" />
  </view>
</template>

<script setup>
import { ref } from 'vue'
import { onShow } from '@dcloudio/uni-app'
import { getStoredVenue } from '@/utils/venue'
import ComprehensivePrivate from '@/pages/comprehensive/private/index.vue'
import IcePrivate from '@/pages/ice/private/index.vue'

const isComprehensive = getStoredVenue() === 'comprehensive'
const contentRef = ref()
let isFirstShow = true

onShow(() => {
  if (isFirstShow) {
    isFirstShow = false
    return
  }
  contentRef.value?.refresh?.()
})
</script>

<style lang="scss" scoped>
.tab-page {
  min-height: 100vh;
}
</style>
