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

@@ -1,13 +1,15 @@
<script setup lang="ts">
import { ref, onMounted, onUnmounted, computed } from 'vue';
import { useI18n } from 'vue-i18n';
import api from '../api';
import { formatMoney } from '../utils/localeDisplay';
import { usePlayerProfile } from '../composables/usePlayerProfile';
const { locale, t } = useI18n();
const { profileRaw } = usePlayerProfile();
const open = ref(false);
const root = ref<HTMLElement | null>(null);
const wallet = ref<{ availableBalance?: unknown; frozenBalance?: unknown; currency?: string } | null>(null);
const wallet = computed(() => profileRaw.value?.wallet ?? null);
function amountValue(value: unknown): number {
if (value == null) return 0;
@@ -33,15 +35,6 @@ const total = computed(() =>
),
);
onMounted(async () => {
try {
const { data } = await api.get('/player/profile');
wallet.value = data.data?.wallet ?? null;
} catch {
wallet.value = null;
}
});
function toggle() {
open.value = !open.value;
}