feat(player,admin): 钱包卡片与登录页 UI 优化
- 玩家端我的页:钱包背景图、银行卡式排版、自定义语言下拉与投注规则折叠 - 管理端登录:左右布局、金边半透明卡片、自定义语言选择 - 修复 API promotePlayerToTier1Agent 返回类型导致编译失败
This commit is contained in:
@@ -7,6 +7,7 @@ import { formatMoney } from '../utils/localeDisplay';
|
||||
import LocaleFlag from '../components/LocaleFlag.vue';
|
||||
import { useAuthStore } from '../stores/auth';
|
||||
import { useAppLocale } from '../composables/useAppLocale';
|
||||
import walletBg from '../assets/images/钱包.png';
|
||||
|
||||
const { t, locale } = useI18n();
|
||||
const router = useRouter();
|
||||
@@ -18,6 +19,8 @@ const profile = ref<{
|
||||
wallet?: { availableBalance: string; frozenBalance: string };
|
||||
} | null>(null);
|
||||
|
||||
const rulesExpanded = ref(false);
|
||||
|
||||
onMounted(async () => {
|
||||
const { data } = await api.get('/player/profile');
|
||||
profile.value = data.data;
|
||||
@@ -36,18 +39,28 @@ function logout() {
|
||||
|
||||
<template>
|
||||
<div class="profile-page">
|
||||
<div class="summary-card">
|
||||
<p class="username">{{ profile?.username }}</p>
|
||||
<div class="balance-row">
|
||||
<span class="balance-label">
|
||||
<LocaleFlag :locale="locale" :size="16" />
|
||||
{{ t('wallet.balance') }}
|
||||
</span>
|
||||
<span class="amount">{{ formatMoney(profile?.wallet?.availableBalance, locale) }}</span>
|
||||
<div class="wallet-banner">
|
||||
<img class="wallet-banner-img" :src="walletBg" alt="" />
|
||||
<img src="/logo.png" alt="TheBet365" class="wallet-card-logo" />
|
||||
<div class="wallet-banner-info">
|
||||
<div class="card-balance-block">
|
||||
<span class="card-kicker">
|
||||
<LocaleFlag :locale="locale" :size="14" />
|
||||
{{ t('wallet.balance') }}
|
||||
</span>
|
||||
<p class="card-balance">{{ formatMoney(profile?.wallet?.availableBalance, locale) }}</p>
|
||||
</div>
|
||||
<div class="card-foot">
|
||||
<div class="card-holder">
|
||||
<span class="card-kicker">{{ t('wallet.card_holder') }}</span>
|
||||
<span class="card-name">{{ profile?.username }}</span>
|
||||
</div>
|
||||
<div class="card-pending">
|
||||
<span class="card-kicker">{{ t('wallet.unsettled') }}</span>
|
||||
<span class="card-pending-val">{{ formatMoney(profile?.wallet?.frozenBalance, locale) }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p class="frozen">
|
||||
{{ t('wallet.unsettled') }}: {{ formatMoney(profile?.wallet?.frozenBalance, locale) }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<section class="settings-group">
|
||||
@@ -56,6 +69,25 @@ function logout() {
|
||||
<span class="cell-chevron" aria-hidden="true">›</span>
|
||||
</RouterLink>
|
||||
|
||||
<div class="rules-cell">
|
||||
<button
|
||||
type="button"
|
||||
class="settings-cell rules-toggle"
|
||||
:aria-expanded="rulesExpanded"
|
||||
@click="rulesExpanded = !rulesExpanded"
|
||||
>
|
||||
<span class="cell-label">{{ t('profile.rules_title') }}</span>
|
||||
<span class="cell-chevron" :class="{ open: rulesExpanded }" aria-hidden="true">›</span>
|
||||
</button>
|
||||
<div v-show="rulesExpanded" class="rules-body">
|
||||
<p>{{ t('profile.rules_p1') }}</p>
|
||||
<p>{{ t('profile.rules_p2') }}</p>
|
||||
<p>{{ t('profile.rules_p3') }}</p>
|
||||
<p>{{ t('profile.rules_p4') }}</p>
|
||||
<p>{{ t('profile.rules_p5') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="settings-cell settings-cell--stack">
|
||||
<div class="cell-head">
|
||||
<span class="cell-label">{{ t('profile.language') }}</span>
|
||||
@@ -74,19 +106,6 @@ function logout() {
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="settings-cell settings-cell--stack rules-cell">
|
||||
<div class="cell-head">
|
||||
<span class="cell-label">{{ t('profile.rules_title') }}</span>
|
||||
</div>
|
||||
<div class="rules-body">
|
||||
<p>{{ t('profile.rules_p1') }}</p>
|
||||
<p>{{ t('profile.rules_p2') }}</p>
|
||||
<p>{{ t('profile.rules_p3') }}</p>
|
||||
<p>{{ t('profile.rules_p4') }}</p>
|
||||
<p>{{ t('profile.rules_p5') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<button type="button" class="logout-btn" @click="logout">
|
||||
@@ -100,49 +119,140 @@ function logout() {
|
||||
padding: 8px 0 12px;
|
||||
}
|
||||
|
||||
.summary-card {
|
||||
background: var(--bg-card);
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--radius);
|
||||
padding: 14px 16px;
|
||||
.wallet-banner {
|
||||
position: relative;
|
||||
margin-bottom: 12px;
|
||||
line-height: 0;
|
||||
}
|
||||
|
||||
.username {
|
||||
font-size: 15px;
|
||||
font-weight: 800;
|
||||
color: var(--primary-light);
|
||||
margin-bottom: 10px;
|
||||
.wallet-banner-img {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.balance-row {
|
||||
.wallet-card-logo {
|
||||
position: absolute;
|
||||
top: 9%;
|
||||
right: 5.5%;
|
||||
z-index: 2;
|
||||
width: clamp(42px, 12.8vw, 64px);
|
||||
height: auto;
|
||||
object-fit: contain;
|
||||
pointer-events: none;
|
||||
filter:
|
||||
drop-shadow(0 2px 6px rgba(0, 0, 0, 0.45))
|
||||
drop-shadow(0 0 5px rgba(212, 175, 55, 0.32))
|
||||
drop-shadow(0 0 10px rgba(240, 216, 117, 0.18));
|
||||
}
|
||||
|
||||
.wallet-banner-info {
|
||||
position: absolute;
|
||||
inset: 11% 12% 9% 19%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
flex-direction: column;
|
||||
gap: clamp(14px, 3.5vw, 20px);
|
||||
line-height: normal;
|
||||
box-sizing: border-box;
|
||||
pointer-events: none;
|
||||
font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei UI', 'Helvetica Neue', Arial, sans-serif;
|
||||
font-stretch: semi-expanded;
|
||||
}
|
||||
|
||||
.balance-label {
|
||||
.card-kicker {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
font-size: 13px;
|
||||
color: var(--text-muted);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.amount {
|
||||
color: var(--primary-light);
|
||||
font-size: clamp(10px, 2.5vw, 11px);
|
||||
font-weight: 800;
|
||||
font-size: 20px;
|
||||
white-space: nowrap;
|
||||
letter-spacing: 0.1em;
|
||||
text-transform: uppercase;
|
||||
color: rgba(180, 180, 185, 0.92);
|
||||
text-shadow:
|
||||
0 1px 2px rgba(0, 0, 0, 0.75),
|
||||
0 2px 5px rgba(0, 0, 0, 0.35);
|
||||
}
|
||||
|
||||
.frozen {
|
||||
font-size: 12px;
|
||||
color: var(--text-muted);
|
||||
margin-top: 6px;
|
||||
font-weight: 500;
|
||||
.card-balance-block {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
gap: clamp(3px, 1vw, 6px);
|
||||
min-height: clamp(44px, 12vw, 60px);
|
||||
}
|
||||
|
||||
.card-balance {
|
||||
margin: 0;
|
||||
width: 100%;
|
||||
max-width: 100%;
|
||||
font-size: clamp(22px, 6.8vw, 36px);
|
||||
font-weight: 900;
|
||||
letter-spacing: -0.02em;
|
||||
font-variant-numeric: tabular-nums;
|
||||
line-height: 1.05;
|
||||
white-space: nowrap;
|
||||
background: var(--gradient-gold);
|
||||
-webkit-background-clip: text;
|
||||
background-clip: text;
|
||||
color: transparent;
|
||||
filter:
|
||||
drop-shadow(0 1px 2px rgba(0, 0, 0, 0.85))
|
||||
drop-shadow(0 3px 6px rgba(0, 0, 0, 0.45))
|
||||
drop-shadow(0 0 10px rgba(212, 175, 55, 0.22));
|
||||
}
|
||||
|
||||
.card-foot {
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
justify-content: space-between;
|
||||
gap: 16px;
|
||||
margin-top: auto;
|
||||
padding-top: 2px;
|
||||
}
|
||||
|
||||
.card-holder,
|
||||
.card-pending {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.card-pending {
|
||||
align-items: flex-end;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.card-name {
|
||||
font-size: clamp(12px, 3.2vw, 15px);
|
||||
font-weight: 900;
|
||||
letter-spacing: 0.06em;
|
||||
text-transform: uppercase;
|
||||
line-height: 1.25;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
max-width: 44vw;
|
||||
background: linear-gradient(180deg, #fff6d8 0%, #e8c96a 38%, #c9a227 100%);
|
||||
-webkit-background-clip: text;
|
||||
background-clip: text;
|
||||
color: transparent;
|
||||
filter:
|
||||
drop-shadow(0 1px 2px rgba(0, 0, 0, 0.8))
|
||||
drop-shadow(0 2px 5px rgba(0, 0, 0, 0.4));
|
||||
}
|
||||
|
||||
.card-pending-val {
|
||||
font-size: clamp(12px, 3.2vw, 14px);
|
||||
font-weight: 900;
|
||||
letter-spacing: -0.01em;
|
||||
font-variant-numeric: tabular-nums;
|
||||
color: rgba(210, 210, 215, 0.95);
|
||||
text-shadow:
|
||||
0 1px 2px rgba(0, 0, 0, 0.75),
|
||||
0 2px 5px rgba(0, 0, 0, 0.35);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.settings-group {
|
||||
@@ -199,6 +309,22 @@ function logout() {
|
||||
font-size: 20px;
|
||||
line-height: 1;
|
||||
font-weight: 300;
|
||||
transition: transform 0.15s ease;
|
||||
}
|
||||
|
||||
.cell-chevron.open {
|
||||
transform: rotate(90deg);
|
||||
}
|
||||
|
||||
.rules-toggle {
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
font-family: inherit;
|
||||
}
|
||||
|
||||
.rules-cell .rules-body {
|
||||
padding: 0 16px 14px;
|
||||
border-bottom: 1px solid var(--border);
|
||||
}
|
||||
|
||||
.lang-segment {
|
||||
@@ -246,7 +372,6 @@ function logout() {
|
||||
}
|
||||
|
||||
.rules-body {
|
||||
padding: 0 0 12px;
|
||||
font-size: 12px;
|
||||
line-height: 1.55;
|
||||
color: var(--text-muted);
|
||||
|
||||
Reference in New Issue
Block a user