liveh5-nuxt/app/components/AppHeader.vue
xingyy 226057ce8f feat(i18n): 优化国际化文案并添加通用拍卖术语- 更新了多个组件中的国际化文案,使其更加统一和准确
- 在 zh-CN.json 中添加了"common"字段,用于存储通用拍卖术语
- 调整了部分组件的布局和样式,以更好地展示国际化文案
2025-02-12 16:50:52 +08:00

52 lines
1.3 KiB
Vue

<script setup>
import { useAppHeaderRouteNames as routeWhiteList } from '@/config'
import { liveStore } from "@/stores/live/index.js";
import {goodStore} from "~/stores/goods/index.js";
const { fullLive } = liveStore()
const route = useRoute()
const router = useRouter()
const {auctionDetail} = goodStore();
function onBack() {
if (fullLive.value){
fullLive.value=false
return
}
if (window.history.state.back)
history.back()
else
router.replace('/')
}
const { t } = useI18n()
const title = computed(() => {
if (!route.meta)
return ''
return route.meta.i18n ? t(route.meta.i18n) : (route.meta.title || '')
})
const subTitle = computed(() => {
if (!route.meta)
return ''
return route.meta.subTitle ? t(route.meta.subTitle) : ''
})
const showLeftArrow = computed(() => route.name && routeWhiteList.includes(route.name))
</script>
<template>
<VanNavBar
v-memo="[title,fullLive,showLeftArrow,subTitle]"
:title="title"
:left-arrow="!showLeftArrow||fullLive"
placeholder clickable fixed
@click-left="onBack"
>
<template #title v-if="route.meta.i18n==='menu.home'">
<div class="flex flex-col items-center justify-center">
<div class="text-#000000 text-17px mb-5px font-600">{{ auctionDetail.title }}</div>
</div>
</template>
</VanNavBar>
</template>