2025-01-13 01:57:40 +00:00
|
|
|
<script setup>
|
2025-01-08 05:26:12 +00:00
|
|
|
import { useAppFooterRouteNames as routeWhiteList } from '~/config'
|
|
|
|
|
|
|
|
const route = useRoute()
|
|
|
|
const router = useRouter()
|
|
|
|
|
|
|
|
function onBack() {
|
|
|
|
if (window.history.state.back)
|
|
|
|
history.back()
|
|
|
|
else
|
|
|
|
router.replace('/')
|
|
|
|
}
|
|
|
|
|
|
|
|
const { t } = useI18n()
|
|
|
|
|
|
|
|
const title = computed(() => {
|
2025-01-13 03:25:37 +00:00
|
|
|
|
2025-01-08 05:26:12 +00:00
|
|
|
if (!route.meta)
|
|
|
|
return ''
|
|
|
|
return route.meta.i18n ? t(route.meta.i18n) : (route.meta.title || '')
|
|
|
|
})
|
2025-01-13 03:25:37 +00:00
|
|
|
const subTitle = computed(() => {
|
|
|
|
if (!route.meta)
|
|
|
|
return ''
|
|
|
|
return route.meta.subTitle ? t(route.meta.subTitle) : ''
|
|
|
|
})
|
2025-01-08 05:26:12 +00:00
|
|
|
const showLeftArrow = computed(() => route.name && routeWhiteList.includes(route.name))
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
|
|
<VanNavBar
|
|
|
|
:title="title"
|
|
|
|
:left-arrow="!showLeftArrow"
|
|
|
|
placeholder clickable fixed
|
|
|
|
@click-left="onBack"
|
2025-01-10 08:52:58 +00:00
|
|
|
>
|
2025-01-13 01:57:40 +00:00
|
|
|
<template #title v-if="route.meta.i18n==='menu.home'">
|
|
|
|
|
2025-01-10 08:52:58 +00:00
|
|
|
<div class="flex flex-col items-center justify-center">
|
2025-01-13 03:25:37 +00:00
|
|
|
<div class="text-#000000 text-17px mb-5px font-600">{{ title }}</div>
|
|
|
|
<div class="text-#939393 text-10px line-height-none font-100">{{subTitle}}</div>
|
2025-01-10 08:52:58 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</VanNavBar>
|
2025-01-08 05:26:12 +00:00
|
|
|
</template>
|