Files
thebet365/apps/player/src/components/PlayerAvatarPicker.vue
Mars d3ca8498fb 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>
2026-06-17 11:00:25 +08:00

168 lines
3.4 KiB
Vue

<script setup lang="ts">
import { computed, ref } from 'vue';
import { useI18n } from 'vue-i18n';
import {
BUILTIN_PLAYERS,
playerAvatarUrl,
getPlayerDisplayName,
formatPlayerMeta,
getPlayerSearchTokens,
} from '@thebet365/shared';
const props = defineProps<{
modelValue: string | null;
}>();
const emit = defineEmits<{
'update:modelValue': [value: string | null];
}>();
const { t, locale } = useI18n();
const keyword = ref('');
const filtered = computed(() => {
const q = keyword.value.trim().toLowerCase();
if (!q) return BUILTIN_PLAYERS;
return BUILTIN_PLAYERS.filter((p) => getPlayerSearchTokens(p).some((token) => token.includes(q)));
});
function select(key: string) {
emit('update:modelValue', props.modelValue === key ? null : key);
}
</script>
<template>
<div class="picker">
<div class="picker-head">
<label class="picker-label">{{ t('profile.avatar') }}</label>
<input
v-model="keyword"
type="search"
class="picker-search"
:placeholder="t('profile.avatar_search')"
/>
</div>
<div class="picker-grid">
<button
v-for="player in filtered"
:key="player.id"
type="button"
class="picker-item"
:class="{ active: modelValue === player.id }"
@click="select(player.id)"
>
<img
:src="playerAvatarUrl(player.id) ?? ''"
:alt="getPlayerDisplayName(player, locale)"
class="picker-photo"
/>
<span class="picker-name">{{ getPlayerDisplayName(player, locale) }}</span>
<span class="picker-meta">{{ formatPlayerMeta(player, locale) }}</span>
</button>
</div>
<p v-if="!filtered.length" class="picker-empty">{{ t('profile.avatar_empty') }}</p>
</div>
</template>
<style scoped>
.picker {
margin-bottom: 12px;
}
.picker-head {
margin-bottom: 10px;
}
.picker-label {
display: block;
font-size: 11px;
color: var(--text-muted);
font-weight: 600;
margin-bottom: 6px;
}
.picker-search {
width: 100%;
padding: 8px 10px;
border-radius: 6px;
border: 1px solid var(--border);
background: var(--bg-body);
color: var(--text);
font-size: 13px;
}
.picker-search:focus {
outline: none;
border-color: var(--border-gold-soft);
}
.picker-grid {
display: grid;
grid-template-columns: repeat(4, minmax(0, 1fr));
gap: 8px;
max-height: 280px;
overflow-y: auto;
padding-right: 2px;
}
.picker-item {
display: flex;
flex-direction: column;
align-items: center;
gap: 4px;
padding: 8px 4px 6px;
border-radius: 8px;
border: 1px solid var(--border);
background: var(--bg-body);
cursor: pointer;
min-width: 0;
}
.picker-item.active {
border-color: var(--border-gold-soft);
box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.35);
background: var(--surface-accent);
}
.picker-photo {
width: 52px;
height: 52px;
border-radius: 50%;
object-fit: cover;
object-position: top;
border: 1px solid rgba(255, 255, 255, 0.08);
}
.picker-name {
width: 100%;
font-size: 10px;
font-weight: 700;
color: var(--text);
text-align: center;
line-height: 1.2;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.picker-meta {
width: 100%;
font-size: 9px;
color: var(--text-muted);
text-align: center;
line-height: 1.2;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.picker-empty {
margin: 8px 0 0;
font-size: 12px;
color: var(--text-muted);
text-align: center;
}
</style>