liveh5-nuxt/app/components/AppHeader.vue
xingyy 6f67273a9a refactor(store): 重构 home store 并改名为 goods store
- 将 home store 重命名为 goods store,以更准确地反映其用途
- 更新了相关文件中的导入路径和引用
-调整了首页布局和组件以适应新的 goods store 结构
- 新增了 goods store 中的 actionDetails 和 itemList 属性
2025-01-17 16:56:13 +08:00

52 lines
1.2 KiB
Vue

<script setup>
import { useAppHeaderRouteNames as routeWhiteList } from '~/config'
import { homeStore } from "@/stores/goods/index.js";
const { fullLive } = homeStore()
const route = useRoute()
const router = useRouter()
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
:title="title"
:left-arrow="!showLeftArrow||fullLive"
placeholder clickable fixed
@click-left="onBack"
>
<template #title v-if="route.meta.i18n==='menu.goods'">
<div class="flex flex-col items-center justify-center">
<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>
</div>
</template>
</VanNavBar>
</template>