## 管理端 / 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>
165 lines
3.6 KiB
Vue
165 lines
3.6 KiB
Vue
<script setup lang="ts">
|
|
import { ref, computed, onMounted, onUnmounted } from 'vue';
|
|
import { useRouter } from 'vue-router';
|
|
import { useI18n } from 'vue-i18n';
|
|
import { playerAvatarUrl, randomAvatarKey } from '@thebet365/shared';
|
|
import { useAuthStore } from '../stores/auth';
|
|
import { usePlayerProfile } from '../composables/usePlayerProfile';
|
|
|
|
const { t } = useI18n();
|
|
const auth = useAuthStore();
|
|
const router = useRouter();
|
|
const { avatarUrl } = usePlayerProfile();
|
|
const open = ref(false);
|
|
const root = ref<HTMLElement | null>(null);
|
|
|
|
const displayAvatarUrl = computed(() => {
|
|
if (avatarUrl.value) return avatarUrl.value;
|
|
const seed = auth.user?.username;
|
|
return seed ? playerAvatarUrl(randomAvatarKey(seed)) : null;
|
|
});
|
|
|
|
function toggle() {
|
|
open.value = !open.value;
|
|
}
|
|
|
|
function close() {
|
|
open.value = false;
|
|
}
|
|
|
|
function onOutsideClick(e: Event) {
|
|
if (!root.value?.contains(e.target as Node)) open.value = false;
|
|
}
|
|
|
|
onMounted(() => {
|
|
document.addEventListener('click', onOutsideClick);
|
|
document.addEventListener('touchend', onOutsideClick);
|
|
});
|
|
onUnmounted(() => {
|
|
document.removeEventListener('click', onOutsideClick);
|
|
document.removeEventListener('touchend', onOutsideClick);
|
|
});
|
|
|
|
function goEdit() {
|
|
close();
|
|
router.push('/profile/edit');
|
|
}
|
|
|
|
function goRecharge() {
|
|
close();
|
|
router.push('/wallet/recharge');
|
|
}
|
|
|
|
function logout() {
|
|
close();
|
|
auth.logout();
|
|
router.push('/');
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<div ref="root" class="avatar-wrap">
|
|
<button type="button" class="avatar-btn" :aria-expanded="open" @click="toggle">
|
|
<img v-if="displayAvatarUrl" :src="displayAvatarUrl" alt="" class="avatar-img" />
|
|
</button>
|
|
|
|
<div v-if="open" class="avatar-menu">
|
|
<div class="menu-user">{{ auth.user?.username }}</div>
|
|
<button type="button" class="menu-item recharge" @click="goRecharge">{{ t('recharge.title') }}</button>
|
|
<button type="button" class="menu-item" @click="goEdit">{{ t('profile.edit') }}</button>
|
|
<button type="button" class="menu-item danger" @click="logout">{{ t('auth.logout') }}</button>
|
|
</div>
|
|
|
|
<div v-if="open" class="backdrop" @click="close" />
|
|
</div>
|
|
</template>
|
|
|
|
<style scoped>
|
|
.avatar-wrap {
|
|
position: relative;
|
|
z-index: 130;
|
|
}
|
|
|
|
.avatar-btn {
|
|
width: 36px;
|
|
height: 36px;
|
|
box-sizing: border-box;
|
|
border-radius: 50%;
|
|
border: 1px solid var(--border-gold-soft);
|
|
background: var(--bg-card);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
cursor: pointer;
|
|
flex-shrink: 0;
|
|
overflow: hidden;
|
|
padding: 0;
|
|
}
|
|
|
|
.avatar-img {
|
|
width: 100%;
|
|
height: 100%;
|
|
object-fit: cover;
|
|
object-position: top;
|
|
}
|
|
|
|
.avatar-letter {
|
|
font-size: 13px;
|
|
font-weight: 800;
|
|
color: var(--primary-light);
|
|
}
|
|
|
|
.avatar-menu {
|
|
position: absolute;
|
|
top: calc(100% + 8px);
|
|
right: 0;
|
|
min-width: 168px;
|
|
padding: 8px 0;
|
|
border: 1px solid var(--border-strong);
|
|
border-radius: var(--radius-sm);
|
|
background: var(--dropdown-bg);
|
|
backdrop-filter: none;
|
|
-webkit-backdrop-filter: none;
|
|
box-shadow: var(--shadow);
|
|
z-index: 140;
|
|
}
|
|
|
|
.menu-user {
|
|
padding: 8px 14px 10px;
|
|
font-size: 13px;
|
|
font-weight: 800;
|
|
color: var(--primary-light);
|
|
border-bottom: 1px solid var(--border);
|
|
margin-bottom: 4px;
|
|
}
|
|
|
|
.menu-item {
|
|
width: 100%;
|
|
text-align: left;
|
|
padding: 10px 14px;
|
|
background: none;
|
|
color: var(--text);
|
|
font-size: 14px;
|
|
font-weight: 600;
|
|
}
|
|
|
|
.menu-item:hover {
|
|
background: rgba(255, 255, 255, 0.08);
|
|
}
|
|
|
|
.menu-item.recharge {
|
|
color: var(--primary-light);
|
|
font-weight: 700;
|
|
}
|
|
|
|
.menu-item.danger {
|
|
color: var(--danger);
|
|
}
|
|
|
|
.backdrop {
|
|
position: fixed;
|
|
inset: 0;
|
|
z-index: 120;
|
|
}
|
|
</style>
|