feat(player/admin/api): 玩家端暗色极简主题重构与盘口单串关修复
## 管理端 / API(Bug 修复) - matches.service:getAdminMatchDetail 返回 markets 时补充 allowSingle、allowParlay 字段 - MatchMarketsPanel:mapMarkets 从接口读取单关/串关开关,不再硬编码为 true - match-form.ts:AdminMarket 类型补充 allowSingle、allowParlay ## 玩家端 — 全局主题(styles.css / index.html / site.webmanifest) - 海军暗色 + 白色强调 token,卡片高光渐变(--gradient-card) - 下拉/弹窗实底不透明(--dropdown-bg: #0A2540) - 统一 sub-toolbar、status-ribbon、filter-tab 等全局样式 - theme-color 同步为 #001A33 ## 玩家端 — 布局与壳层 - MainLayout:详情子页去顶栏/公告,sub-toolbar 全宽铺底 - WalletBalanceCard(新):个人页钱包卡片(反水 + 未结算) - walletStats.ts(新):钱包统计逻辑抽取 ## 玩家端 — 赛事 / 投注 - MatchDetailView:顶栏 8px 顶距、卡片全宽(--detail-gutter-x: 0) - 盘口状态标签(暂停/已关闭)、去掉 MarketTypeTile 右侧箭头 - VsBadge(新):纯文字 VS,删除 vs.png - isMarketLocked:仅关单关但允许串关时仍可点击,支持串关流程 - BetSlipDrawer:仅串关盘口禁用单关提交并提示 slip_parlay_only_hint - betSlip:SlipItem 增加 allowSingle 字段 - MatchBetCard / LeagueAccordionItem:45° 待开赛角标,去掉展开左侧白边 - OutrightEventSection:去掉展开时左侧白色选中条 - FootballView:加大左右边距、筛选栏去 sticky、选中态增强 - BannerCarousel:恢复原始全宽轮播 ## 玩家端 — 钱包 / 个人 / 认证 / 其他页面 - WalletView:移除顶部钱包卡片,保留账单列表 - ProfileView:保留 WalletBalanceCard - 充值/账单/注单/登录注册等页面配色与间距统一 - 公告标签、余额面板、语言切换、区号选择等弹层改为实底 ## 国际化 - zh-CN / en-US / ms-MY:新增 slip_parlay_only_hint(仅串关盘口提示) ## 资产 - 更新 banner.svg、empty-matches.svg 配色 - 删除 vs.png Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,126 +1,260 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { useI18n } from 'vue-i18n';
|
||||
|
||||
import { formatMoneyCompact, parseAmount } from '../utils/localeDisplay';
|
||||
|
||||
|
||||
|
||||
interface Transaction {
|
||||
|
||||
transactionType: string;
|
||||
|
||||
amount: string;
|
||||
|
||||
createdAt: string;
|
||||
|
||||
transactionId?: string;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
const props = withDefaults(defineProps<{
|
||||
|
||||
items: Transaction[];
|
||||
|
||||
cashbackTotal?: string;
|
||||
|
||||
}>(), {
|
||||
|
||||
cashbackTotal: '0',
|
||||
|
||||
});
|
||||
|
||||
const { t, locale } = useI18n();
|
||||
|
||||
|
||||
|
||||
const CASHBACK_TYPES = new Set(['CASHBACK', 'CASHBACK_DEPOSIT']);
|
||||
|
||||
|
||||
|
||||
const stats = computed(() => {
|
||||
|
||||
let income = 0;
|
||||
|
||||
let expense = 0;
|
||||
|
||||
let cashback = 0;
|
||||
|
||||
|
||||
|
||||
for (const tx of props.items) {
|
||||
|
||||
const amt = parseAmount(tx.amount);
|
||||
|
||||
const isCb = CASHBACK_TYPES.has(tx.transactionType.toUpperCase());
|
||||
|
||||
if (isCb) {
|
||||
|
||||
cashback += Math.abs(amt);
|
||||
|
||||
}
|
||||
|
||||
if (amt >= 0) income += amt;
|
||||
|
||||
else expense += Math.abs(amt);
|
||||
|
||||
}
|
||||
|
||||
// Use server-side cashback total if provided (more accurate across all pages)
|
||||
|
||||
|
||||
if (props.cashbackTotal !== '0') {
|
||||
|
||||
cashback = Math.abs(parseAmount(props.cashbackTotal));
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
const net = income - expense;
|
||||
|
||||
|
||||
|
||||
return { income, expense, net, cashback };
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<template>
|
||||
|
||||
<div class="wallet-stats-panel">
|
||||
<div class="stats-row">
|
||||
<div class="stat-item">
|
||||
|
||||
<div class="stats-grid">
|
||||
|
||||
<div class="stat-cell">
|
||||
|
||||
<span class="stat-label">{{ t('wallet.stats_income') }}</span>
|
||||
|
||||
<span class="stat-val income">{{ formatMoneyCompact(stats.income, locale) }}</span>
|
||||
|
||||
</div>
|
||||
<div class="stat-item">
|
||||
|
||||
<div class="stat-cell">
|
||||
|
||||
<span class="stat-label">{{ t('wallet.stats_expense') }}</span>
|
||||
|
||||
<span class="stat-val expense">{{ formatMoneyCompact(stats.expense, locale) }}</span>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="stats-divider" />
|
||||
<div class="stats-row">
|
||||
<div class="stat-item">
|
||||
|
||||
<div class="stat-cell">
|
||||
|
||||
<span class="stat-label">{{ t('wallet.stats_net') }}</span>
|
||||
<span class="stat-val" :class="stats.net >= 0 ? 'income' : 'expense'">
|
||||
|
||||
<span class="stat-val" :class="stats.net >= 0 ? 'income' : 'muted'">
|
||||
|
||||
{{ formatMoneyCompact(stats.net, locale) }}
|
||||
|
||||
</span>
|
||||
|
||||
</div>
|
||||
<div class="stat-item">
|
||||
|
||||
<div class="stat-cell">
|
||||
|
||||
<span class="stat-label">{{ t('wallet.stats_cashback') }}</span>
|
||||
<span class="stat-val cashback">{{ formatMoneyCompact(stats.cashback, locale) }}</span>
|
||||
|
||||
<span class="stat-val">{{ formatMoneyCompact(stats.cashback, locale) }}</span>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
|
||||
|
||||
<style scoped>
|
||||
|
||||
.wallet-stats-panel {
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--border);
|
||||
|
||||
position: relative;
|
||||
|
||||
background: var(--gradient-card);
|
||||
|
||||
border: 1px solid rgba(255, 255, 255, 0.11);
|
||||
|
||||
border-radius: var(--radius);
|
||||
padding: 12px;
|
||||
margin-bottom: 12px;
|
||||
|
||||
padding: 14px 16px;
|
||||
|
||||
margin-bottom: var(--space-section);
|
||||
|
||||
box-shadow: var(--shadow-card-sm);
|
||||
|
||||
overflow: hidden;
|
||||
|
||||
}
|
||||
|
||||
.stats-row {
|
||||
|
||||
|
||||
.wallet-stats-panel::before {
|
||||
|
||||
content: '';
|
||||
|
||||
position: absolute;
|
||||
|
||||
top: 0;
|
||||
|
||||
left: 10%;
|
||||
|
||||
right: 10%;
|
||||
|
||||
height: 1px;
|
||||
|
||||
background: var(--gradient-card-shine);
|
||||
|
||||
pointer-events: none;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
.stats-grid {
|
||||
|
||||
display: grid;
|
||||
|
||||
grid-template-columns: repeat(2, minmax(0, 1fr));
|
||||
|
||||
gap: 12px 16px;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
.stat-cell {
|
||||
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
flex-direction: column;
|
||||
|
||||
gap: 4px;
|
||||
|
||||
min-width: 0;
|
||||
|
||||
}
|
||||
|
||||
.stat-item {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
min-width: 0;
|
||||
padding: 4px 8px;
|
||||
}
|
||||
|
||||
|
||||
.stat-label {
|
||||
display: block;
|
||||
font-size: 11px;
|
||||
font-weight: 700;
|
||||
color: var(--text-muted);
|
||||
letter-spacing: 0.03em;
|
||||
margin-bottom: 2px;
|
||||
|
||||
font-size: 12px;
|
||||
|
||||
font-weight: 500;
|
||||
|
||||
color: var(--text-dim);
|
||||
|
||||
letter-spacing: 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
.stat-val {
|
||||
display: block;
|
||||
font-size: 14px;
|
||||
font-weight: 800;
|
||||
|
||||
font-size: 15px;
|
||||
|
||||
font-weight: 600;
|
||||
|
||||
font-variant-numeric: tabular-nums;
|
||||
|
||||
white-space: nowrap;
|
||||
|
||||
overflow: hidden;
|
||||
|
||||
text-overflow: ellipsis;
|
||||
|
||||
color: var(--text);
|
||||
|
||||
letter-spacing: -0.02em;
|
||||
|
||||
}
|
||||
|
||||
.stat-val.income { color: #3db865; }
|
||||
.stat-val.expense { color: #e05050; }
|
||||
.stat-val.cashback { color: #f0b90b; }
|
||||
|
||||
.stats-divider {
|
||||
height: 1px;
|
||||
margin: 6px 8px;
|
||||
background: linear-gradient(90deg, transparent, var(--border), transparent);
|
||||
}
|
||||
|
||||
.stat-val.income { color: var(--success); }
|
||||
|
||||
.stat-val.expense { color: var(--text-muted); }
|
||||
|
||||
.stat-val.muted { color: var(--text-muted); }
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user