79 lines
2.3 KiB
Vue
79 lines
2.3 KiB
Vue
<template>
|
||
<div class="main_wrapper">
|
||
<div class="main_content">
|
||
<router-view v-slot="{ Component }">
|
||
<keep-alive :include="mainViewKeep">
|
||
<component :is="Component" />
|
||
</keep-alive>
|
||
</router-view>
|
||
</div>
|
||
<!-- 右侧导航抽屉 -->
|
||
<Drawer elType="home" />
|
||
<Drawer elType="darkNet" />
|
||
<AccountCredentialsPopup v-if="isMine" />
|
||
<TabBar />
|
||
<PaymentGuidePopup
|
||
:show="vipContentGuideVisible"
|
||
:guide="vipContentGuide"
|
||
:scene="vipContentGuideScene"
|
||
@close="closeVipContentGuide"
|
||
/>
|
||
<!-- 九宫格应用广告:启动后不管落在哪个 tab 都弹,每次启动只弹一次 -->
|
||
<NineGridPopup v-if="nineGridPopupVisible" :is-open="true" @close="nineGridPopupVisible = false" />
|
||
</div>
|
||
</template>
|
||
<script lang="ts">
|
||
export default {
|
||
name: 'mainView',
|
||
};
|
||
</script>
|
||
<script lang="ts" setup>
|
||
import { useGlobalStore } from '@/stores/global';
|
||
import { useConfigStore } from '@/stores/config';
|
||
import { computed } from 'vue';
|
||
import { useRoute } from 'vue-router';
|
||
import PaymentGuidePopup from '@/components/PaymentGuidePopup/index.vue';
|
||
import NineGridPopup from '@/components/NineGridPopup/index.vue';
|
||
import { useVipContentUpdateGuideOnMainTabs } from '@/hooks/useVipContentUpdateGuideOnMainTabs';
|
||
import { AdType } from '@/enums/app';
|
||
import { getAdItem } from '@/utils/getConfig';
|
||
import { nineGridPopupVisible } from '@/utils/nineGridPopup';
|
||
|
||
const route = useRoute();
|
||
const globalStore = useGlobalStore();
|
||
const configStore = useConfigStore();
|
||
|
||
if (!globalStore.nineGridFirst && (getAdItem(AdType.QualityApplication) || []).length > 0) {
|
||
globalStore.setNineGridFirst();
|
||
nineGridPopupVisible.value = true;
|
||
}
|
||
const {
|
||
visible: vipContentGuideVisible,
|
||
guide: vipContentGuide,
|
||
scene: vipContentGuideScene,
|
||
closeGuide: closeVipContentGuide,
|
||
} = useVipContentUpdateGuideOnMainTabs();
|
||
const mainViewKeep = computed(() => {
|
||
return globalStore.$state.mainViewKeep;
|
||
});
|
||
const backgroundTheme = computed(() => {
|
||
return configStore.appConfig.backgroundTheme;
|
||
});
|
||
const isMine = computed(() => {
|
||
let path = route.path;
|
||
if (path.indexOf('mine') > 0) {
|
||
return true;
|
||
}
|
||
return false;
|
||
});
|
||
</script>
|
||
<style lang="scss" scoped>
|
||
.main_wrapper {
|
||
height: 100%;
|
||
.main_content {
|
||
height: $contentHeight;
|
||
position: relative;
|
||
}
|
||
}
|
||
</style>
|