一、全局主题重构(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]
279 lines
6.8 KiB
Vue
279 lines
6.8 KiB
Vue
<script setup lang="ts">
|
||
import { computed } from 'vue';
|
||
import { useI18n } from 'vue-i18n';
|
||
import { useRouter } from 'vue-router';
|
||
import { formatMoney } from '../utils/localeDisplay';
|
||
import StatusWatermark from './StatusWatermark.vue';
|
||
import { matchPhaseLabel, matchPhaseVariant, type MatchPhase } from '../utils/matchPhase';
|
||
|
||
export interface BetScore {
|
||
ht: string | null;
|
||
ft: string | null;
|
||
}
|
||
|
||
export interface BetHistoryItem {
|
||
betNo: string;
|
||
betType: string;
|
||
stake: unknown;
|
||
totalOdds?: unknown;
|
||
potentialReturn: unknown;
|
||
actualReturn: unknown;
|
||
status: string;
|
||
placedAt: string;
|
||
isCashbacked?: boolean;
|
||
leagueName?: string;
|
||
matchTitle: string;
|
||
pickLabel: string;
|
||
isParlay?: boolean;
|
||
legCount?: number;
|
||
matchScore?: BetScore | null;
|
||
matchPhase?: MatchPhase | null;
|
||
legs?: Array<{
|
||
marketLabel: string;
|
||
selectionName: string;
|
||
matchTitle: string;
|
||
odds: unknown;
|
||
resultStatus?: string | null;
|
||
score?: BetScore | null;
|
||
}>;
|
||
}
|
||
|
||
const props = defineProps<{ bet: BetHistoryItem }>();
|
||
const { t, locale } = useI18n();
|
||
const router = useRouter();
|
||
|
||
const statusKey = computed(() => {
|
||
const s = props.bet.status.toUpperCase();
|
||
if (s === 'WON' || s === 'WIN') return 'won';
|
||
if (s === 'LOST' || s === 'LOSE') return 'lost';
|
||
if (s === 'PUSH' || s === 'VOID' || s === 'CANCELLED') return 'push';
|
||
return 'pending';
|
||
});
|
||
|
||
const statusLabel = computed(() => t(`history.status_${statusKey.value}`));
|
||
|
||
const watermarkLabel = computed(() => {
|
||
if (statusKey.value === 'pending' && props.bet.matchPhase === 'closed_pending') {
|
||
return matchPhaseLabel(t, 'closed_pending');
|
||
}
|
||
if (statusKey.value === 'pending' && props.bet.matchPhase === 'settled') {
|
||
return matchPhaseLabel(t, 'settled');
|
||
}
|
||
return statusLabel.value;
|
||
});
|
||
|
||
const watermarkVariant = computed(() => {
|
||
if (statusKey.value === 'pending' && props.bet.matchPhase === 'closed_pending') return 'closed';
|
||
if (statusKey.value === 'pending' && props.bet.matchPhase === 'settled') return 'settled';
|
||
return statusKey.value;
|
||
});
|
||
|
||
const placedDate = computed(() =>
|
||
new Date(props.bet.placedAt).toLocaleDateString(locale.value, {
|
||
month: 'short', day: 'numeric',
|
||
}),
|
||
);
|
||
|
||
const title = computed(() => {
|
||
if (props.bet.isParlay) {
|
||
const n = props.bet.legCount ?? props.bet.legs?.length ?? 0;
|
||
return t('history.parlay_title', { n });
|
||
}
|
||
return props.bet.matchTitle;
|
||
});
|
||
|
||
const subtitle = computed(() => {
|
||
if (props.bet.isParlay) return props.bet.leagueName || t('history.parlay_league');
|
||
return props.bet.pickLabel || props.bet.leagueName || '';
|
||
});
|
||
|
||
const stakeAmount = computed(() => formatMoney(props.bet.stake, locale.value));
|
||
|
||
const oddsText = computed(() => {
|
||
const o = props.bet.totalOdds;
|
||
if (o == null || o === '' || o === 0) return '';
|
||
const n = parseFloat(String(o));
|
||
return Number.isFinite(n) ? n.toFixed(2) : String(o);
|
||
});
|
||
|
||
const betTypeLabel = computed(() => {
|
||
if (props.bet.isParlay) return t('bet.parlay');
|
||
return props.bet.betType || '';
|
||
});
|
||
|
||
const returnAmount = computed(() => {
|
||
if (statusKey.value === 'won') return formatMoney(props.bet.actualReturn, locale.value);
|
||
if (statusKey.value === 'pending') return formatMoney(props.bet.potentialReturn, locale.value);
|
||
if (statusKey.value === 'lost') return formatMoney(-parseFloat(String(props.bet.stake ?? 0)), locale.value);
|
||
return formatMoney(props.bet.actualReturn ?? props.bet.potentialReturn, locale.value);
|
||
});
|
||
|
||
const returnHighlight = computed(() => statusKey.value === 'won');
|
||
const returnPending = computed(() => statusKey.value === 'pending');
|
||
const returnLost = computed(() => statusKey.value === 'lost');
|
||
|
||
function goDetail() {
|
||
router.push(`/bets/${props.bet.betNo}`);
|
||
}
|
||
</script>
|
||
|
||
<template>
|
||
<article class="bet-card" @click="goDetail">
|
||
<StatusWatermark :label="watermarkLabel" :variant="watermarkVariant" />
|
||
<div class="card-body">
|
||
<div class="card-header">
|
||
<span v-if="betTypeLabel" class="bet-type-tag">{{ betTypeLabel }}</span>
|
||
<span v-if="bet.isCashbacked" class="cashback-tag">{{ t('history.cashbacked') }}</span>
|
||
<span class="card-date">{{ placedDate }}</span>
|
||
</div>
|
||
<span class="title">{{ title }}</span>
|
||
<div class="card-detail-row">
|
||
<span class="pick-label">{{ subtitle }}</span>
|
||
<span v-if="oddsText" class="odds-badge">@{{ oddsText }}</span>
|
||
</div>
|
||
<div class="card-footer">
|
||
<span class="stake-amt">{{ t('history.stake') }} {{ stakeAmount }}</span>
|
||
<span class="return-amt" :class="{ highlight: returnHighlight, pending: returnPending, lost: returnLost }">
|
||
{{ returnAmount }}
|
||
</span>
|
||
</div>
|
||
</div>
|
||
<span class="chevron">›</span>
|
||
</article>
|
||
</template>
|
||
|
||
<style scoped>
|
||
.bet-card {
|
||
position: relative;
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 10px;
|
||
padding: 14px 16px;
|
||
background: #FFFFFF;
|
||
border: 1px solid #E5E7EB;
|
||
border-radius: 8px;
|
||
margin-bottom: 8px;
|
||
cursor: pointer;
|
||
transition: background 0.15s, box-shadow 0.15s;
|
||
-webkit-tap-highlight-color: transparent;
|
||
overflow: hidden;
|
||
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
|
||
}
|
||
|
||
.bet-card:active {
|
||
background: #F5F7FA;
|
||
}
|
||
|
||
.card-body {
|
||
flex: 1;
|
||
min-width: 0;
|
||
display: flex;
|
||
flex-direction: column;
|
||
gap: 4px;
|
||
}
|
||
|
||
.card-header {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 8px;
|
||
flex-wrap: wrap;
|
||
}
|
||
|
||
.cashback-tag {
|
||
font-size: 10px;
|
||
font-weight: 700;
|
||
color: #F8971F;
|
||
background: rgba(248, 151, 31, 0.08);
|
||
border: 1px solid rgba(248, 151, 31, 0.2);
|
||
border-radius: 4px;
|
||
padding: 1px 6px;
|
||
}
|
||
|
||
.bet-type-tag {
|
||
font-size: 10px;
|
||
font-weight: 700;
|
||
color: #003D6B;
|
||
background: rgba(0, 61, 107, 0.06);
|
||
border: 1px solid rgba(0, 61, 107, 0.15);
|
||
border-radius: 4px;
|
||
padding: 1px 6px;
|
||
letter-spacing: 0.02em;
|
||
}
|
||
|
||
.card-date {
|
||
font-size: 10px;
|
||
color: #6B7280;
|
||
font-weight: 600;
|
||
flex-shrink: 0;
|
||
margin-left: auto;
|
||
}
|
||
|
||
.title {
|
||
font-size: 14px;
|
||
font-weight: 800;
|
||
color: #1A1A2E;
|
||
white-space: nowrap;
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
}
|
||
|
||
.card-detail-row {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 6px;
|
||
}
|
||
|
||
.pick-label {
|
||
font-size: 11px;
|
||
color: #6B7280;
|
||
font-weight: 600;
|
||
white-space: nowrap;
|
||
overflow: hidden;
|
||
text-overflow: ellipsis;
|
||
flex: 1;
|
||
min-width: 0;
|
||
}
|
||
|
||
.odds-badge {
|
||
font-size: 11px;
|
||
font-weight: 800;
|
||
color: #F8971F;
|
||
background: rgba(248, 151, 31, 0.08);
|
||
border-radius: 4px;
|
||
padding: 1px 6px;
|
||
flex-shrink: 0;
|
||
}
|
||
|
||
.card-footer {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
gap: 8px;
|
||
margin-top: 2px;
|
||
}
|
||
|
||
.stake-amt {
|
||
font-size: 11px;
|
||
color: #6B7280;
|
||
font-weight: 600;
|
||
}
|
||
|
||
.return-amt {
|
||
font-size: 15px;
|
||
font-weight: 900;
|
||
color: #6B7280;
|
||
}
|
||
|
||
.return-amt.highlight { color: #059669; }
|
||
.return-amt.pending { color: #F8971F; }
|
||
.return-amt.lost { color: #DC2626; }
|
||
|
||
.chevron {
|
||
flex-shrink: 0;
|
||
font-size: 18px;
|
||
color: #E5E7EB;
|
||
margin-left: 2px;
|
||
line-height: 1;
|
||
}
|
||
</style>
|