feat(player,admin): 钱包卡片与登录页 UI 优化
- 玩家端我的页:钱包背景图、银行卡式排版、自定义语言下拉与投注规则折叠 - 管理端登录:左右布局、金边半透明卡片、自定义语言选择 - 修复 API promotePlayerToTier1Agent 返回类型导致编译失败
This commit is contained in:
@@ -1,41 +1,177 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { ref, computed, onMounted, onUnmounted } from 'vue';
|
||||||
import { useAdminLocale, type AdminLocale } from '../composables/useAdminLocale';
|
import { useAdminLocale, type AdminLocale } from '../composables/useAdminLocale';
|
||||||
import AdminLocaleFlag from './AdminLocaleFlag.vue';
|
import AdminLocaleFlag from './AdminLocaleFlag.vue';
|
||||||
|
|
||||||
|
withDefaults(
|
||||||
|
defineProps<{
|
||||||
|
/** gold:与玩家端登录一致;admin:管理后台顶栏绿色主题 */
|
||||||
|
variant?: 'gold' | 'admin';
|
||||||
|
}>(),
|
||||||
|
{ variant: 'admin' },
|
||||||
|
);
|
||||||
|
|
||||||
const { locale, locales, setLocale, t } = useAdminLocale();
|
const { locale, locales, setLocale, t } = useAdminLocale();
|
||||||
|
|
||||||
function onChange(e: Event) {
|
const open = ref(false);
|
||||||
setLocale((e.target as HTMLSelectElement).value as AdminLocale);
|
const root = ref<HTMLElement | null>(null);
|
||||||
|
|
||||||
|
const currentLabel = computed(
|
||||||
|
() => locales.find((l) => l.code === locale.value)?.label ?? locale.value,
|
||||||
|
);
|
||||||
|
|
||||||
|
function pick(code: AdminLocale) {
|
||||||
|
open.value = false;
|
||||||
|
setLocale(code);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function toggle() {
|
||||||
|
open.value = !open.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
function onDocClick(e: MouseEvent) {
|
||||||
|
if (!root.value?.contains(e.target as Node)) open.value = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => document.addEventListener('click', onDocClick));
|
||||||
|
onUnmounted(() => document.removeEventListener('click', onDocClick));
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<label class="admin-locale" :title="t('lang')">
|
<div ref="root" class="admin-locale" :class="[variant, { open }]">
|
||||||
<AdminLocaleFlag :locale="locale" :size="20" />
|
<button
|
||||||
<select :value="locale" class="admin-locale-select" :aria-label="t('lang')" @change="onChange">
|
type="button"
|
||||||
<option v-for="l in locales" :key="l.code" :value="l.code">
|
class="admin-locale-trigger"
|
||||||
{{ l.label }}
|
:aria-expanded="open"
|
||||||
</option>
|
aria-haspopup="listbox"
|
||||||
</select>
|
:title="t('lang')"
|
||||||
</label>
|
@click.stop="toggle"
|
||||||
|
>
|
||||||
|
<AdminLocaleFlag :locale="locale" :size="20" />
|
||||||
|
<span class="admin-locale-label">{{ currentLabel }}</span>
|
||||||
|
<span class="locale-chevron" aria-hidden="true">▾</span>
|
||||||
|
</button>
|
||||||
|
<ul v-show="open" class="admin-locale-menu" role="listbox" :aria-label="t('lang')">
|
||||||
|
<li
|
||||||
|
v-for="l in locales"
|
||||||
|
:key="l.code"
|
||||||
|
role="option"
|
||||||
|
:aria-selected="locale === l.code"
|
||||||
|
class="admin-locale-option"
|
||||||
|
:class="{ active: locale === l.code }"
|
||||||
|
@click="pick(l.code)"
|
||||||
|
>
|
||||||
|
<AdminLocaleFlag :locale="l.code" :size="18" />
|
||||||
|
<span>{{ l.label }}</span>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.admin-locale {
|
.admin-locale {
|
||||||
|
position: relative;
|
||||||
|
display: inline-flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.admin-locale-trigger {
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
}
|
min-width: 120px;
|
||||||
.admin-locale-select {
|
padding: 5px 10px 5px 8px;
|
||||||
background: #0d0d0d;
|
|
||||||
color: var(--green-text);
|
|
||||||
border: 1px solid var(--green-border);
|
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
padding: 5px 24px 5px 8px;
|
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
font-weight: 600;
|
font-weight: 600;
|
||||||
min-width: 120px;
|
font-family: inherit;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
line-height: 1.2;
|
line-height: 1.2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.admin-locale-label {
|
||||||
|
flex: 1;
|
||||||
|
text-align: left;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.locale-chevron {
|
||||||
|
font-size: 10px;
|
||||||
|
opacity: 0.7;
|
||||||
|
transition: transform 0.15s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.admin-locale.open .locale-chevron {
|
||||||
|
transform: rotate(180deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.admin-locale-menu {
|
||||||
|
position: absolute;
|
||||||
|
top: calc(100% + 4px);
|
||||||
|
right: 0;
|
||||||
|
z-index: 50;
|
||||||
|
min-width: 100%;
|
||||||
|
margin: 0;
|
||||||
|
padding: 4px;
|
||||||
|
list-style: none;
|
||||||
|
border-radius: 8px;
|
||||||
|
box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
|
||||||
|
}
|
||||||
|
|
||||||
|
.admin-locale-option {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
padding: 8px 10px;
|
||||||
|
border-radius: 6px;
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 600;
|
||||||
|
cursor: pointer;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 管理顶栏 */
|
||||||
|
.admin-locale.admin .admin-locale-trigger {
|
||||||
|
background: #0d0d0d;
|
||||||
|
color: var(--green-text);
|
||||||
|
border: 1px solid var(--green-border);
|
||||||
|
}
|
||||||
|
|
||||||
|
.admin-locale.admin .admin-locale-menu {
|
||||||
|
background: #0f1411;
|
||||||
|
border: 1px solid var(--green-border);
|
||||||
|
}
|
||||||
|
|
||||||
|
.admin-locale.admin .admin-locale-option {
|
||||||
|
color: #8ab89a;
|
||||||
|
}
|
||||||
|
|
||||||
|
.admin-locale.admin .admin-locale-option:hover,
|
||||||
|
.admin-locale.admin .admin-locale-option.active {
|
||||||
|
background: var(--green-surface);
|
||||||
|
color: var(--green-text);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* 登录页:与玩家端金色主题一致 */
|
||||||
|
.admin-locale.gold .admin-locale-trigger {
|
||||||
|
background: #0d0d0d;
|
||||||
|
color: #f0d875;
|
||||||
|
border: 1px solid rgba(212, 175, 55, 0.28);
|
||||||
|
}
|
||||||
|
|
||||||
|
.admin-locale.gold .admin-locale-menu {
|
||||||
|
background: #141414;
|
||||||
|
border: 1px solid rgba(212, 175, 55, 0.28);
|
||||||
|
}
|
||||||
|
|
||||||
|
.admin-locale.gold .admin-locale-option {
|
||||||
|
color: #8e8e93;
|
||||||
|
}
|
||||||
|
|
||||||
|
.admin-locale.gold .admin-locale-option:hover,
|
||||||
|
.admin-locale.gold .admin-locale-option.active {
|
||||||
|
background: rgba(212, 175, 55, 0.1);
|
||||||
|
color: #f0d875;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -57,34 +57,42 @@ async function login() {
|
|||||||
<div class="login-page" :style="{ backgroundImage: `url(${bgImage})` }">
|
<div class="login-page" :style="{ backgroundImage: `url(${bgImage})` }">
|
||||||
<div class="login-mask" />
|
<div class="login-mask" />
|
||||||
<div class="login-wrap">
|
<div class="login-wrap">
|
||||||
<div class="login-lang">
|
|
||||||
<AdminLocaleSwitcher />
|
|
||||||
</div>
|
|
||||||
<form @submit.prevent="login" class="login-form" autocomplete="off">
|
<form @submit.prevent="login" class="login-form" autocomplete="off">
|
||||||
<img src="/logo.png" alt="TheBet365" class="logo" />
|
<div class="form-lang">
|
||||||
<h2 class="title">{{ t('login.title') }}</h2>
|
<AdminLocaleSwitcher variant="gold" />
|
||||||
|
</div>
|
||||||
|
|
||||||
<label>{{ t('login.username') }}</label>
|
<div class="form-body">
|
||||||
<input v-model="form.username" class="field" :placeholder="t('login.username_ph')" autocomplete="off" required />
|
<aside class="form-brand">
|
||||||
<label>{{ t('login.password') }}</label>
|
<img src="/logo.png" alt="TheBet365" class="logo-large" />
|
||||||
<input v-model="form.password" class="field" type="password" :placeholder="t('login.password_ph')" autocomplete="off" required />
|
</aside>
|
||||||
|
|
||||||
<RobotVerify ref="captchaRef" />
|
<div class="form-fields">
|
||||||
|
<h2 class="title">{{ t('login.title') }}</h2>
|
||||||
|
|
||||||
<button type="submit" class="btn-login" :disabled="loading">
|
<label>{{ t('login.username') }}</label>
|
||||||
{{ loading ? '...' : t('login.submit') }}
|
<input v-model="form.username" class="field" :placeholder="t('login.username_ph')" autocomplete="off" required />
|
||||||
</button>
|
<label>{{ t('login.password') }}</label>
|
||||||
|
<input v-model="form.password" class="field" type="password" :placeholder="t('login.password_ph')" autocomplete="off" required />
|
||||||
|
|
||||||
<div class="quick-label">{{ t('login.quick_label') }}</div>
|
<RobotVerify ref="captchaRef" />
|
||||||
<div class="quick-btns">
|
|
||||||
<button type="button" class="quick-btn" :disabled="loading" @click="quickLogin('admin', 'Admin@123')">
|
<button type="submit" class="btn-login" :disabled="loading">
|
||||||
<span class="quick-role">{{ t('login.quick_admin') }}</span>
|
{{ loading ? '...' : t('login.submit') }}
|
||||||
<span class="quick-acc">admin</span>
|
</button>
|
||||||
</button>
|
|
||||||
<button type="button" class="quick-btn" :disabled="loading" @click="quickLogin('agent1', 'Agent@123')">
|
<div class="quick-label">{{ t('login.quick_label') }}</div>
|
||||||
<span class="quick-role">{{ t('login.quick_agent') }}</span>
|
<div class="quick-btns">
|
||||||
<span class="quick-acc">agent1</span>
|
<button type="button" class="quick-btn" :disabled="loading" @click="quickLogin('admin', 'Admin@123')">
|
||||||
</button>
|
<span class="quick-role">{{ t('login.quick_admin') }}</span>
|
||||||
|
<span class="quick-acc">admin</span>
|
||||||
|
</button>
|
||||||
|
<button type="button" class="quick-btn" :disabled="loading" @click="quickLogin('agent1', 'Agent@123')">
|
||||||
|
<span class="quick-role">{{ t('login.quick_agent') }}</span>
|
||||||
|
<span class="quick-acc">agent1</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
@@ -112,37 +120,59 @@ async function login() {
|
|||||||
position: relative;
|
position: relative;
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 400px;
|
max-width: 720px;
|
||||||
padding: 0 20px;
|
padding: 0 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.login-lang {
|
.login-form {
|
||||||
|
position: relative;
|
||||||
|
padding: 14px 0 0;
|
||||||
|
background: rgba(14, 14, 14, 0.92);
|
||||||
|
border: 1px solid rgba(212, 175, 55, 0.28);
|
||||||
|
border-radius: 12px;
|
||||||
|
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-lang {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: flex-end;
|
justify-content: flex-end;
|
||||||
margin-bottom: 10px;
|
padding: 0 18px 10px;
|
||||||
}
|
}
|
||||||
.login-form {
|
|
||||||
|
.form-body {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: minmax(200px, 260px) 1fr;
|
||||||
|
align-items: stretch;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-brand {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 28px 20px;
|
||||||
|
background: rgba(0, 0, 0, 0.25);
|
||||||
|
border-right: 1px solid rgba(212, 175, 55, 0.15);
|
||||||
|
}
|
||||||
|
|
||||||
|
.logo-large {
|
||||||
|
width: 100%;
|
||||||
|
max-width: 220px;
|
||||||
|
height: auto;
|
||||||
|
object-fit: contain;
|
||||||
|
filter: drop-shadow(0 4px 24px rgba(212, 175, 55, 0.25));
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-fields {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
padding: 28px 22px 22px;
|
padding: 22px 24px 24px;
|
||||||
background: rgba(12, 12, 12, 0.95);
|
min-width: 0;
|
||||||
border: 1px solid var(--green-border);
|
|
||||||
border-radius: 14px;
|
|
||||||
box-shadow: 0 8px 40px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(36, 143, 84, 0.08);
|
|
||||||
backdrop-filter: blur(20px);
|
|
||||||
}
|
|
||||||
.logo {
|
|
||||||
max-width: 160px;
|
|
||||||
max-height: 56px;
|
|
||||||
width: auto;
|
|
||||||
height: auto;
|
|
||||||
object-fit: contain;
|
|
||||||
display: block;
|
|
||||||
margin: 0 auto 2px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
text-align: center;
|
text-align: left;
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
color: #aaa;
|
color: #aaa;
|
||||||
@@ -150,6 +180,34 @@ async function login() {
|
|||||||
text-transform: uppercase;
|
text-transform: uppercase;
|
||||||
margin-bottom: 4px;
|
margin-bottom: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 640px) {
|
||||||
|
.login-wrap {
|
||||||
|
max-width: 400px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-body {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-brand {
|
||||||
|
padding: 20px 24px 12px;
|
||||||
|
border-right: none;
|
||||||
|
border-bottom: 1px solid rgba(212, 175, 55, 0.15);
|
||||||
|
}
|
||||||
|
|
||||||
|
.logo-large {
|
||||||
|
max-width: 180px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-fields {
|
||||||
|
padding: 18px 20px 22px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.title {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
label {
|
label {
|
||||||
font-size: 11px;
|
font-size: 11px;
|
||||||
color: #666;
|
color: #666;
|
||||||
@@ -231,8 +289,8 @@ label {
|
|||||||
transition: all 0.15s;
|
transition: all 0.15s;
|
||||||
}
|
}
|
||||||
.quick-btn:hover:not(:disabled) {
|
.quick-btn:hover:not(:disabled) {
|
||||||
background: var(--green-surface);
|
background: rgba(255, 255, 255, 0.06);
|
||||||
border-color: var(--green-border);
|
border-color: rgba(255, 255, 255, 0.18);
|
||||||
}
|
}
|
||||||
.quick-btn:disabled { opacity: 0.4; cursor: not-allowed; }
|
.quick-btn:disabled { opacity: 0.4; cursor: not-allowed; }
|
||||||
.quick-role {
|
.quick-role {
|
||||||
|
|||||||
@@ -462,7 +462,11 @@ export class AgentsService {
|
|||||||
await this.recalculateUsedCredit(oldParentId);
|
await this.recalculateUsedCredit(oldParentId);
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.prisma.user.findUnique({ where: { id: userId } });
|
const updated = await this.prisma.user.findUnique({ where: { id: userId } });
|
||||||
|
if (!updated) {
|
||||||
|
throw new NotFoundException('用户不存在');
|
||||||
|
}
|
||||||
|
return updated;
|
||||||
}
|
}
|
||||||
|
|
||||||
async createAgent(
|
async createAgent(
|
||||||
|
|||||||
BIN
apps/player/src/assets/images/qianbao.png
Normal file
BIN
apps/player/src/assets/images/qianbao.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.2 MiB |
BIN
apps/player/src/assets/images/钱包.png
Normal file
BIN
apps/player/src/assets/images/钱包.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.3 MiB |
@@ -1,4 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
|
import { ref, computed, onMounted, onUnmounted } from 'vue';
|
||||||
import { useI18n } from 'vue-i18n';
|
import { useI18n } from 'vue-i18n';
|
||||||
import LocaleFlag from './LocaleFlag.vue';
|
import LocaleFlag from './LocaleFlag.vue';
|
||||||
import { useAppLocale } from '../composables/useAppLocale';
|
import { useAppLocale } from '../composables/useAppLocale';
|
||||||
@@ -13,30 +14,62 @@ withDefaults(
|
|||||||
const { locale } = useI18n();
|
const { locale } = useI18n();
|
||||||
const { locales, setLocale } = useAppLocale();
|
const { locales, setLocale } = useAppLocale();
|
||||||
|
|
||||||
async function onChange(code: string) {
|
const open = ref(false);
|
||||||
|
const root = ref<HTMLElement | null>(null);
|
||||||
|
|
||||||
|
const currentLabel = computed(
|
||||||
|
() => locales.find((l) => l.code === locale.value)?.label ?? locale.value,
|
||||||
|
);
|
||||||
|
|
||||||
|
async function pick(code: string) {
|
||||||
|
open.value = false;
|
||||||
await setLocale(code);
|
await setLocale(code);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function toggle() {
|
||||||
|
open.value = !open.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
function onDocClick(e: MouseEvent) {
|
||||||
|
if (!root.value?.contains(e.target as Node)) open.value = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
onMounted(() => document.addEventListener('click', onDocClick));
|
||||||
|
onUnmounted(() => document.removeEventListener('click', onDocClick));
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="locale-switch" :class="{ compact }">
|
<div ref="root" class="locale-switch" :class="{ compact, open }">
|
||||||
<LocaleFlag :locale="locale" :size="compact ? 16 : 18" />
|
<button type="button" class="locale-trigger" :aria-expanded="open" aria-haspopup="listbox" @click.stop="toggle">
|
||||||
<select
|
<LocaleFlag :locale="locale" :size="compact ? 16 : 18" />
|
||||||
:value="locale"
|
<span class="locale-label">{{ currentLabel }}</span>
|
||||||
class="locale-select"
|
<span class="locale-chevron" aria-hidden="true">▾</span>
|
||||||
:aria-label="compact ? 'Language' : undefined"
|
</button>
|
||||||
@change="onChange(($event.target as HTMLSelectElement).value)"
|
<ul v-show="open" class="locale-menu" role="listbox" :aria-label="compact ? 'Language' : undefined">
|
||||||
>
|
<li
|
||||||
<option v-for="l in locales" :key="l.code" :value="l.code">
|
v-for="l in locales"
|
||||||
{{ l.label }}
|
:key="l.code"
|
||||||
</option>
|
role="option"
|
||||||
</select>
|
:aria-selected="locale === l.code"
|
||||||
|
class="locale-option"
|
||||||
|
:class="{ active: locale === l.code }"
|
||||||
|
@click="pick(l.code)"
|
||||||
|
>
|
||||||
|
<LocaleFlag :locale="l.code" :size="16" />
|
||||||
|
<span>{{ l.label }}</span>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.locale-switch {
|
.locale-switch {
|
||||||
display: flex;
|
position: relative;
|
||||||
|
display: inline-flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
.locale-trigger {
|
||||||
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 5px;
|
gap: 5px;
|
||||||
height: 36px;
|
height: 36px;
|
||||||
@@ -44,22 +77,68 @@ async function onChange(code: string) {
|
|||||||
border: 1px solid var(--border);
|
border: 1px solid var(--border);
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
background: #0d0d0d;
|
background: #0d0d0d;
|
||||||
|
color: var(--primary-light);
|
||||||
|
font-size: 11px;
|
||||||
|
font-weight: 700;
|
||||||
|
font-family: inherit;
|
||||||
|
cursor: pointer;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
|
|
||||||
.locale-switch.compact {
|
.locale-switch.compact .locale-trigger {
|
||||||
height: auto;
|
height: auto;
|
||||||
padding: 2px 5px;
|
min-height: 30px;
|
||||||
|
padding: 4px 6px 4px 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.locale-select {
|
.locale-label {
|
||||||
background: transparent;
|
|
||||||
color: var(--primary-light);
|
|
||||||
border: none;
|
|
||||||
padding: 2px 2px 2px 0;
|
|
||||||
font-size: 11px;
|
|
||||||
font-weight: 700;
|
|
||||||
outline: none;
|
|
||||||
max-width: 120px;
|
max-width: 120px;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.locale-chevron {
|
||||||
|
font-size: 10px;
|
||||||
|
color: var(--text-muted);
|
||||||
|
transition: transform 0.15s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.locale-switch.open .locale-chevron {
|
||||||
|
transform: rotate(180deg);
|
||||||
|
}
|
||||||
|
|
||||||
|
.locale-menu {
|
||||||
|
position: absolute;
|
||||||
|
top: calc(100% + 4px);
|
||||||
|
right: 0;
|
||||||
|
z-index: 50;
|
||||||
|
min-width: 100%;
|
||||||
|
margin: 0;
|
||||||
|
padding: 4px;
|
||||||
|
list-style: none;
|
||||||
|
background: #141414;
|
||||||
|
border: 1px solid var(--border-gold-soft);
|
||||||
|
border-radius: 8px;
|
||||||
|
box-shadow: var(--shadow);
|
||||||
|
}
|
||||||
|
|
||||||
|
.locale-option {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
padding: 8px 10px;
|
||||||
|
border-radius: 6px;
|
||||||
|
color: var(--text-muted);
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 600;
|
||||||
|
cursor: pointer;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.locale-option:hover,
|
||||||
|
.locale-option.active {
|
||||||
|
background: rgba(212, 175, 55, 0.1);
|
||||||
|
color: var(--primary-light);
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ const i18n = createI18n({
|
|||||||
wallet: {
|
wallet: {
|
||||||
balance: '余额',
|
balance: '余额',
|
||||||
cash_balance: '现金余额',
|
cash_balance: '现金余额',
|
||||||
|
card_holder: '持卡人',
|
||||||
unsettled: '未结算',
|
unsettled: '未结算',
|
||||||
available: '可用',
|
available: '可用',
|
||||||
no_records: '暂无账单记录',
|
no_records: '暂无账单记录',
|
||||||
@@ -231,6 +232,7 @@ const i18n = createI18n({
|
|||||||
wallet: {
|
wallet: {
|
||||||
balance: 'Balance',
|
balance: 'Balance',
|
||||||
cash_balance: 'Cash Balance',
|
cash_balance: 'Cash Balance',
|
||||||
|
card_holder: 'Cardholder',
|
||||||
unsettled: 'Unsettled',
|
unsettled: 'Unsettled',
|
||||||
available: 'Available',
|
available: 'Available',
|
||||||
no_records: 'No records',
|
no_records: 'No records',
|
||||||
@@ -420,6 +422,7 @@ const i18n = createI18n({
|
|||||||
wallet: {
|
wallet: {
|
||||||
balance: 'Baki',
|
balance: 'Baki',
|
||||||
cash_balance: 'Baki Tunai',
|
cash_balance: 'Baki Tunai',
|
||||||
|
card_holder: 'Pemegang',
|
||||||
unsettled: 'Belum Selesai',
|
unsettled: 'Belum Selesai',
|
||||||
available: 'Tersedia',
|
available: 'Tersedia',
|
||||||
no_records: 'Tiada rekod',
|
no_records: 'Tiada rekod',
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import { formatMoney } from '../utils/localeDisplay';
|
|||||||
import LocaleFlag from '../components/LocaleFlag.vue';
|
import LocaleFlag from '../components/LocaleFlag.vue';
|
||||||
import { useAuthStore } from '../stores/auth';
|
import { useAuthStore } from '../stores/auth';
|
||||||
import { useAppLocale } from '../composables/useAppLocale';
|
import { useAppLocale } from '../composables/useAppLocale';
|
||||||
|
import walletBg from '../assets/images/钱包.png';
|
||||||
|
|
||||||
const { t, locale } = useI18n();
|
const { t, locale } = useI18n();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
@@ -18,6 +19,8 @@ const profile = ref<{
|
|||||||
wallet?: { availableBalance: string; frozenBalance: string };
|
wallet?: { availableBalance: string; frozenBalance: string };
|
||||||
} | null>(null);
|
} | null>(null);
|
||||||
|
|
||||||
|
const rulesExpanded = ref(false);
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
const { data } = await api.get('/player/profile');
|
const { data } = await api.get('/player/profile');
|
||||||
profile.value = data.data;
|
profile.value = data.data;
|
||||||
@@ -36,18 +39,28 @@ function logout() {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="profile-page">
|
<div class="profile-page">
|
||||||
<div class="summary-card">
|
<div class="wallet-banner">
|
||||||
<p class="username">{{ profile?.username }}</p>
|
<img class="wallet-banner-img" :src="walletBg" alt="" />
|
||||||
<div class="balance-row">
|
<img src="/logo.png" alt="TheBet365" class="wallet-card-logo" />
|
||||||
<span class="balance-label">
|
<div class="wallet-banner-info">
|
||||||
<LocaleFlag :locale="locale" :size="16" />
|
<div class="card-balance-block">
|
||||||
{{ t('wallet.balance') }}
|
<span class="card-kicker">
|
||||||
</span>
|
<LocaleFlag :locale="locale" :size="14" />
|
||||||
<span class="amount">{{ formatMoney(profile?.wallet?.availableBalance, locale) }}</span>
|
{{ 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>
|
</div>
|
||||||
<p class="frozen">
|
|
||||||
{{ t('wallet.unsettled') }}: {{ formatMoney(profile?.wallet?.frozenBalance, locale) }}
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<section class="settings-group">
|
<section class="settings-group">
|
||||||
@@ -56,6 +69,25 @@ function logout() {
|
|||||||
<span class="cell-chevron" aria-hidden="true">›</span>
|
<span class="cell-chevron" aria-hidden="true">›</span>
|
||||||
</RouterLink>
|
</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="settings-cell settings-cell--stack">
|
||||||
<div class="cell-head">
|
<div class="cell-head">
|
||||||
<span class="cell-label">{{ t('profile.language') }}</span>
|
<span class="cell-label">{{ t('profile.language') }}</span>
|
||||||
@@ -74,19 +106,6 @@ function logout() {
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</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>
|
</section>
|
||||||
|
|
||||||
<button type="button" class="logout-btn" @click="logout">
|
<button type="button" class="logout-btn" @click="logout">
|
||||||
@@ -100,49 +119,140 @@ function logout() {
|
|||||||
padding: 8px 0 12px;
|
padding: 8px 0 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.summary-card {
|
.wallet-banner {
|
||||||
background: var(--bg-card);
|
position: relative;
|
||||||
border: 1px solid var(--border);
|
|
||||||
border-radius: var(--radius);
|
|
||||||
padding: 14px 16px;
|
|
||||||
margin-bottom: 12px;
|
margin-bottom: 12px;
|
||||||
|
line-height: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.username {
|
.wallet-banner-img {
|
||||||
font-size: 15px;
|
width: 100%;
|
||||||
font-weight: 800;
|
height: auto;
|
||||||
color: var(--primary-light);
|
display: block;
|
||||||
margin-bottom: 10px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.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;
|
display: flex;
|
||||||
justify-content: space-between;
|
flex-direction: column;
|
||||||
align-items: center;
|
gap: clamp(14px, 3.5vw, 20px);
|
||||||
gap: 12px;
|
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;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 6px;
|
gap: 6px;
|
||||||
font-size: 13px;
|
font-size: clamp(10px, 2.5vw, 11px);
|
||||||
color: var(--text-muted);
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
|
|
||||||
.amount {
|
|
||||||
color: var(--primary-light);
|
|
||||||
font-weight: 800;
|
font-weight: 800;
|
||||||
font-size: 20px;
|
letter-spacing: 0.1em;
|
||||||
white-space: nowrap;
|
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 {
|
.card-balance-block {
|
||||||
font-size: 12px;
|
flex: 1;
|
||||||
color: var(--text-muted);
|
display: flex;
|
||||||
margin-top: 6px;
|
flex-direction: column;
|
||||||
font-weight: 500;
|
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 {
|
.settings-group {
|
||||||
@@ -199,6 +309,22 @@ function logout() {
|
|||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
font-weight: 300;
|
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 {
|
.lang-segment {
|
||||||
@@ -246,7 +372,6 @@ function logout() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.rules-body {
|
.rules-body {
|
||||||
padding: 0 0 12px;
|
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
line-height: 1.55;
|
line-height: 1.55;
|
||||||
color: var(--text-muted);
|
color: var(--text-muted);
|
||||||
|
|||||||
Reference in New Issue
Block a user