Files
thebet365/apps/player/src/components/BetStatsPanel.vue
Mars 4a93fcfce0 feat(player): 全站 UI 主题重构与布局优化 — 从暗金奢华风格迁移至 Pinnacle 风格蓝白专业主题
一、全局主题重构(52 文件)
  - 设计体系从深色/金色奢华调性全面迁移至 Pinnacle 风格的清爽专业调性
  - 主色:深海蓝 #003D6B,辅色:橙色 #F8971F / #E8870A(赔率强调色)
  - 背景从纯黑/深灰改为白色/浅灰 (#F5F7FA, #E8EDF2)
  - 更新 CSS 变量设计令牌体系:--primary, --border, --text-muted, --bg-body, --bg-hover, --radius-sm 等
  - styles.css 全量重写,所有组件 scoped CSS 同步适配

二、紧凑布局优化
  - 首页:BannerCarousel 轮播高度缩减 (clamp 148→120px),MatchBetCard 内边距/间距/字号全面收紧
  - 首页:赛事卡片 padding 14px→10px,队旗尺寸 72×48→56×38,VS 区域缩小
  - 个人中心:钱包横幅宽高比 2/1→1.75/1,设置单元格 min-height 48→42px
  - 钱包页:交易行 padding/字号收紧,金额字号 15→14px
  - MainLayout:顶栏高度 50→48px,底部导航间距微调

三、对比度与可读性增强
  - 赛事详情/投注页背景从透明加深至 #E8EDF2
  - 所有卡片边框从 #E5E7EB 加深至 #CBD5E1,阴影强度提升
  - 盘口选择面板背景 #F5F7FA→#EDF0F4,增加 border-top 分隔线
  - 赔率颜色从 #F8971F 加深至 #E8870A,选中态 border-width 加粗至 2px
  - 标签字号增大并加粗 (font-weight: 600),颜色从 #6B7280 加深至 #4B5563

四、首页快捷入口 & 个人中心网格布局
  - 首页新增 4 宫格快捷入口(投注/充值/账单/活动),彩色图标区分功能
  - 个人中心重构为「4 宫格快捷操作 + 列表」结构:钱包/充值/返水/记录
  - 移除原个人中心金色入口列表项,精简设置列表为修改资料/投注规则/语言

五、顶部导航栏重设计
  - Logo 从 img 标签替换为内联 SVG 纯文字:THE(灰) + BET(深蓝) + 365(橙)
  - 客服按钮改为纯图标圆形按钮 (32×32px),增加竖线分隔符
  - Chip 高度 34→32px,间距 8→6px
  - 底部导航激活态指示条加粗至 2.5px,左右缩进从 22% 调至 18%

六、SVG Favicon
  - 新增纯路径 SVG favicon(无 <text> 元素,确保浏览器 favicon 沙箱兼容)
  - 深蓝圆角方块 + 白色 "B" 字母路径 + 橙色圆点 + 白色 "365" 数字路径
  - index.html 更新 favicon 引用为 /favicon.svg

🤖 Generated with [Qoder][https://qoder.com]
2026-06-16 12:24:41 +08:00

161 lines
4.2 KiB
Vue

<script setup lang="ts">
import { computed } from 'vue';
import { useI18n } from 'vue-i18n';
import { formatMoney, parseAmount } from '../utils/localeDisplay';
import type { BetHistoryItem } from './BetHistoryCard.vue';
const props = defineProps<{ items: BetHistoryItem[] }>();
const { t, locale } = useI18n();
const stats = computed(() => {
let total = 0;
let won = 0;
let lost = 0;
let pending = 0;
let push = 0;
let totalStake = 0;
let totalReturn = 0;
for (const bet of props.items) {
total++;
const s = bet.status.toUpperCase();
if (s === 'WON' || s === 'WIN') won++;
else if (s === 'LOST' || s === 'LOSE') lost++;
else if (s === 'PUSH' || s === 'VOID' || s === 'CANCELLED') push++;
else pending++;
totalStake += parseAmount(bet.stake);
if (s === 'WON' || s === 'WIN') totalReturn += parseAmount(bet.actualReturn);
else if (s === 'PENDING') totalReturn += parseAmount(bet.potentialReturn);
}
return { total, won, lost, pending, push, totalStake, totalReturn };
});
</script>
<template>
<div class="stats-panel">
<div class="stats-row">
<div class="stat-item">
<span class="stat-val">{{ stats.total }}</span>
<span class="stat-label">{{ t('history.stats_total') }}</span>
</div>
<div class="stat-item won">
<span class="stat-val">{{ stats.won }}</span>
<span class="stat-label">{{ t('history.stats_won') }}</span>
</div>
<div class="stat-item lost">
<span class="stat-val">{{ stats.lost }}</span>
<span class="stat-label">{{ t('history.stats_lost') }}</span>
</div>
<div class="stat-item pending">
<span class="stat-val">{{ stats.pending }}</span>
<span class="stat-label">{{ t('history.stats_pending') }}</span>
</div>
<div class="stat-item push">
<span class="stat-val">{{ stats.push }}</span>
<span class="stat-label">{{ t('history.stats_push') }}</span>
</div>
</div>
<div class="stats-bar" :class="{ empty: stats.total === 0 }" aria-hidden="true">
<template v-if="stats.total > 0">
<div v-if="stats.won > 0" class="bar-seg won" :style="{ flex: stats.won }" />
<div v-if="stats.lost > 0" class="bar-seg lost" :style="{ flex: stats.lost }" />
<div v-if="stats.pending > 0" class="bar-seg pending" :style="{ flex: stats.pending }" />
<div v-if="stats.push > 0" class="bar-seg push" :style="{ flex: stats.push }" />
</template>
</div>
<div class="stats-row secondary">
<div class="stat-item">
<span class="stat-val small">{{ formatMoney(stats.totalStake, locale) }}</span>
<span class="stat-label">{{ t('history.stats_stake') }}</span>
</div>
<div class="stat-item">
<span class="stat-val small gold">{{ formatMoney(stats.totalReturn, locale) }}</span>
<span class="stat-label">{{ t('history.stats_return') }}</span>
</div>
</div>
</div>
</template>
<style scoped>
.stats-panel {
background: #FFFFFF;
border: 1px solid #E5E7EB;
border-radius: 8px;
padding: 14px 12px 10px;
margin-bottom: 12px;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.stats-row {
display: flex;
gap: 4px;
margin-bottom: 8px;
}
.stats-row.secondary {
margin-bottom: 0;
margin-top: 8px;
justify-content: space-around;
}
.stat-item {
flex: 1;
text-align: center;
min-width: 0;
}
.stat-val {
display: block;
font-size: 18px;
font-weight: 900;
font-variant-numeric: tabular-nums;
color: #1A1A2E;
}
.stat-val.small {
font-size: 14px;
color: #6B7280;
}
.stat-val.gold {
color: #003D6B;
}
.stat-item.won .stat-val { color: #059669; }
.stat-item.lost .stat-val { color: #DC2626; }
.stat-item.pending .stat-val { color: #F8971F; }
.stat-item.push .stat-val { color: #6B7280; }
.stat-label {
display: block;
font-size: 10px;
font-weight: 700;
color: #6B7280;
letter-spacing: 0.04em;
margin-top: 2px;
}
.stats-bar {
display: flex;
height: 4px;
border-radius: 2px;
overflow: hidden;
gap: 2px;
}
.stats-bar.empty {
background: #E8EDF2;
}
.bar-seg {
border-radius: 2px;
transition: flex 0.3s ease;
}
.bar-seg.won { background: #059669; }
.bar-seg.lost { background: #DC2626; }
.bar-seg.pending { background: #F8971F; }
.bar-seg.push { background: #6B7280; }
</style>