fix: default match tab to match center

This commit is contained in:
hajimi
2026-08-01 16:14:37 +08:00
parent 5633c9b51f
commit 42284ba6ac
5 changed files with 17 additions and 26 deletions
+13
View File
@@ -13,6 +13,19 @@
## 一、已完成事项 ## 一、已完成事项
### 91. 赛事 Tab 默认主页
- 状态:已完成 - 时间:2026-08-01
完成内容:
- `/packages_match/pages/worldcup` 改为默认展示赛事主页,不再进入世界杯专题。
- 移除底部“赛事”Tab 对世界杯专题视图的强制跳转;世界杯专题仍可通过赛事主页内入口打开。
涉及模块:
- `uniapp/src/packages_match/pages/worldcup.vue`
- `uniapp/src/packages_match/components/MatchShellPage.vue`
- `uniapp/src/components/tabbar/tabbar.vue`
### 90. 本地 Docker 开发编排 ### 90. 本地 Docker 开发编排
- 状态:已完成 - 时间:2026-08-01 - 状态:已完成 - 时间:2026-08-01
+1 -1
View File
@@ -22,7 +22,7 @@
| 设计稿名称 | uniapp 页面路径 | 状态 | 备注 | | 设计稿名称 | uniapp 页面路径 | 状态 | 备注 |
| --- | --- | --- | --- | | --- | --- | --- | --- |
| 赛事中心(含世界杯专题入口) | `uniapp/src/pages/match/match.vue` | ✅ 已完成 | 2026-07-11 赛程、直播、赔率改为在赛事中心当前内容区域切换;运动和联赛分类仅在赛程显示,赔率只保留盘口与联赛/球队搜索,顶部蓝色世界杯专题卡仍进入专题页 | | 赛事中心(含世界杯专题入口) | `uniapp/src/pages/match/match.vue` | ✅ 已完成 | 2026-07-11 赛程、直播、赔率改为在赛事中心当前内容区域切换;运动和联赛分类仅在赛程显示,赔率只保留盘口与联赛/球队搜索2026-08-01 `/packages_match/pages/worldcup` 作为赛事 Tab 入口时默认展示赛事主页,专题仅由页面内入口打开 |
| 赛事详情页 | `uniapp/src/pages/match_detail/match_detail.vue` | 🚧 部分完成 | 2026-05-29 优化顶部赛事摘要头部,补充联赛、对阵、状态与直播入口信息 | | 赛事详情页 | `uniapp/src/pages/match_detail/match_detail.vue` | 🚧 部分完成 | 2026-05-29 优化顶部赛事摘要头部,补充联赛、对阵、状态与直播入口信息 |
| 世界杯专题页(排名导航) | `uniapp/src/packages_match/pages/worldcup.vue` | 🚧 部分完成 | 2026-05-20 已按设计稿拆分排名导航、积分榜、球员榜组件,后续可继续细化表格视觉与新闻页样式 | | 世界杯专题页(排名导航) | `uniapp/src/packages_match/pages/worldcup.vue` | 🚧 部分完成 | 2026-05-20 已按设计稿拆分排名导航、积分榜、球员榜组件,后续可继续细化表格视觉与新闻页样式 |
| 首页 | `uniapp/src/pages/index/index.vue` | 🚧 部分完成 | 2026-07-31 已按当前设计图重构为“今日焦点赛程、主推大图、最新资讯”三段式首页;频道仍复用后台配置分类,待实际 H5 页面验收后确认最终状态 | | 首页 | `uniapp/src/pages/index/index.vue` | 🚧 部分完成 | 2026-07-31 已按当前设计图重构为“今日焦点赛程、主推大图、最新资讯”三段式首页;频道仍复用后台配置分类,待实际 H5 页面验收后确认最终状态 |
-4
View File
@@ -13,7 +13,6 @@ import { computed, ref, watch, onMounted } from 'vue'
import { onShow } from '@dcloudio/uni-app' import { onShow } from '@dcloudio/uni-app'
import AppLoading from '@/components/app-loading/app-loading.vue' import AppLoading from '@/components/app-loading/app-loading.vue'
import GlobalPopup from '@/components/global-popup/global-popup.vue' import GlobalPopup from '@/components/global-popup/global-popup.vue'
const MATCH_SHELL_VIEW_KEY = 'match_shell_view'
import UTabbar from '@/uni_modules/vk-uview-ui/components/u-tabbar/u-tabbar.vue' import UTabbar from '@/uni_modules/vk-uview-ui/components/u-tabbar/u-tabbar.vue'
const props = withDefaults(defineProps<{ const props = withDefaults(defineProps<{
@@ -151,9 +150,6 @@ const handleChange = (index: number) => {
uni.navigateTo({ url: targetRoute }) uni.navigateTo({ url: targetRoute })
return return
} }
if (targetRoute === '/packages_match/pages/worldcup') {
uni.setStorageSync(MATCH_SHELL_VIEW_KEY, 'worldcup')
}
if (nativeTabbar.includes(targetRoute)) { if (nativeTabbar.includes(targetRoute)) {
uni.switchTab({ url: targetRoute }) uni.switchTab({ url: targetRoute })
} else { } else {
@@ -12,17 +12,16 @@ import MatchCenterPanel from './MatchCenterPanel.vue'
import WorldCupPanel from './WorldCupPanel.vue' import WorldCupPanel from './WorldCupPanel.vue'
type ShellView = 'worldcup' | 'match' type ShellView = 'worldcup' | 'match'
const MATCH_SHELL_VIEW_KEY = 'match_shell_view'
const props = withDefaults(defineProps<{ const props = withDefaults(defineProps<{
initialView?: ShellView initialView?: ShellView
routeOptions?: Record<string, any> routeOptions?: Record<string, any>
}>(), { }>(), {
initialView: 'worldcup', initialView: 'match',
routeOptions: () => ({}) routeOptions: () => ({})
}) })
const currentView = ref<ShellView>('worldcup') const currentView = ref<ShellView>('match')
const worldcupState = ref<{ tab: string; cid: number | null }>({ const worldcupState = ref<{ tab: string; cid: number | null }>({
tab: 'live', tab: 'live',
cid: null cid: null
@@ -53,27 +52,10 @@ const showMatchCenter = () => {
currentView.value = 'match' currentView.value = 'match'
} }
const resetToWorldCup = () => {
currentView.value = 'worldcup'
worldcupState.value = {
tab: String(props.routeOptions?.tab || 'live'),
cid: parseNumber(props.routeOptions?.cid)
}
}
const consumeForcedView = () => {
const forceView = uni.getStorageSync(MATCH_SHELL_VIEW_KEY)
if (forceView === 'worldcup') {
uni.removeStorageSync(MATCH_SHELL_VIEW_KEY)
resetToWorldCup()
}
}
watch( watch(
() => [props.initialView, props.routeOptions], () => [props.initialView, props.routeOptions],
() => { () => {
applyState() applyState()
consumeForcedView()
}, },
{ immediate: true, deep: true } { immediate: true, deep: true }
) )
+1 -1
View File
@@ -1,5 +1,5 @@
<template> <template>
<MatchShellPage initial-view="worldcup" :route-options="routeOptions" /> <MatchShellPage initial-view="match" :route-options="routeOptions" />
</template> </template>
<script setup lang="ts"> <script setup lang="ts">