perf(player): 优化 Tab 切换性能并改进投注历史展示

- 主 Tab 启用 keep-alive,恢复各页滚动位置,避免切页重复加载与重复请求
- 首页数据缓存、余额/头像共用 profile 缓存,冠军盘与串关面板按需加载
- 球赛与串关列表新增「仅显示待开赛」筛选
- 重构历史注单卡片,展示注单类型、赔率与日期

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-10 17:33:06 +08:00
parent a8ee28fcce
commit 785fa4416d
10 changed files with 212 additions and 53 deletions

View File

@@ -61,6 +61,7 @@ const loading = ref(true);
const matches = ref<ParlayMatch[]>([]);
const timeFilter = ref<TimeFilter>('all');
const leagueFilter = ref('');
const showClosed = ref(false);
const collapsed = ref<Set<string>>(new Set());
const parlayMarketKeys = PARLAY_MARKET_TYPES.map((c) => c.key);
@@ -190,6 +191,12 @@ const filteredMatches = computed(() => {
if (leagueFilter.value) {
list = list.filter((m) => (m.leagueId ?? m.leagueName) === leagueFilter.value);
}
if (!showClosed.value) {
list = list.filter((m) => {
const phase = m.matchPhase ?? (m.bettingOpen === false ? 'closed_pending' : 'open');
return phase === 'open' || phase === undefined;
});
}
return list;
});
@@ -273,6 +280,14 @@ function toggleCollapse(id: string) {
<option value="">{{ t('bet.parlay_filter_all') }}</option>
<option v-for="lg in leagues" :key="lg.id" :value="lg.id">{{ lg.name }}</option>
</select>
<button
type="button"
class="phase-toggle"
:class="{ 'phase-toggle--active': showClosed }"
@click="showClosed = !showClosed"
>
{{ showClosed ? t('bet.show_all_matches') : t('bet.show_open_only') }}
</button>
<BetGuideHelp
:title="t('bet.parlay_guide_title')"
:aria-label="t('bet.parlay_guide_help')"
@@ -445,6 +460,25 @@ function toggleCollapse(id: string) {
max-width: 140px;
}
.phase-toggle {
padding: 7px 10px;
border-radius: 6px;
font-size: 11px;
font-weight: 600;
color: #888;
background: #141414;
border: 1px solid #333;
cursor: pointer;
transition: all 0.2s ease;
white-space: nowrap;
}
.phase-toggle--active {
color: var(--primary-light);
border-color: var(--primary);
background: rgba(200, 168, 78, 0.08);
}
.parlay-foot-fixed {
position: fixed;
left: 0;