liveh5-nuxt/app/components/AppHeader.vue
xingyy def6a6b71e refactor(live): 重构直播相关功能和状态管理
-将 fullLive 状态从 goodStore 移动到 liveStore
- 优化 liveRoom 页面逻辑,移除不必要的 props
- 更新 AppHeader 组件,使用 liveStore 中的 fullLive 状态
- 删除 floatingVideo 组件
- 调整 liveMinWindow 组件,增加 onClick 事件处理
- 更新 home 页面,使用 liveStore 中的 fullLive 状态
- 优化 liveRoom 中的 PaymentInput 和 SideButton 组件
2025-02-11 15:27:31 +08:00

52 lines
1.3 KiB
Vue

<script setup>
import { useAppHeaderRouteNames as routeWhiteList } from '@/config'
import { liveStore } from "@/stores/live/index.js";
const { fullLive } = liveStore()
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
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.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>