一、全局主题重构(52 文件) - 设计体系从深色/金色奢华调性全面迁移至 Pinnacle 风格的清爽专业调性 - 主色:深海蓝 #003D6B,辅色:橙色 #F8971F / #E8870A(赔率强调色) - 背景从纯黑/深灰改为白色/浅灰 (#F5F7FA, #E8EDF2) - 更新 CSS 变量设计令牌体系:--primary, --border, --text-muted, --bg-body, --bg-hover, --radius-sm 等 - styles.css 全量重写,所有组件 scoped CSS 同步适配 二、紧凑布局优化 - 首页:BannerCarousel 轮播高度缩减 (clamp 148→120px),MatchBetCard 内边距/间距/字号全面收紧 - 首页:赛事卡片 padding 14px→10px,队旗尺寸 72×48→56×38,VS 区域缩小 - 个人中心:钱包横幅宽高比 2/1→1.75/1,设置单元格 min-height 48→42px - 钱包页:交易行 padding/字号收紧,金额字号 15→14px - MainLayout:顶栏高度 50→48px,底部导航间距微调 三、对比度与可读性增强 - 赛事详情/投注页背景从透明加深至 #E8EDF2 - 所有卡片边框从 #E5E7EB 加深至 #CBD5E1,阴影强度提升 - 盘口选择面板背景 #F5F7FA→#EDF0F4,增加 border-top 分隔线 - 赔率颜色从 #F8971F 加深至 #E8870A,选中态 border-width 加粗至 2px - 标签字号增大并加粗 (font-weight: 600),颜色从 #6B7280 加深至 #4B5563 四、首页快捷入口 & 个人中心网格布局 - 首页新增 4 宫格快捷入口(投注/充值/账单/活动),彩色图标区分功能 - 个人中心重构为「4 宫格快捷操作 + 列表」结构:钱包/充值/返水/记录 - 移除原个人中心金色入口列表项,精简设置列表为修改资料/投注规则/语言 五、顶部导航栏重设计 - Logo 从 img 标签替换为内联 SVG 纯文字:THE(灰) + BET(深蓝) + 365(橙) - 客服按钮改为纯图标圆形按钮 (32×32px),增加竖线分隔符 - Chip 高度 34→32px,间距 8→6px - 底部导航激活态指示条加粗至 2.5px,左右缩进从 22% 调至 18% 六、SVG Favicon - 新增纯路径 SVG favicon(无 <text> 元素,确保浏览器 favicon 沙箱兼容) - 深蓝圆角方块 + 白色 "B" 字母路径 + 橙色圆点 + 白色 "365" 数字路径 - index.html 更新 favicon 引用为 /favicon.svg 🤖 Generated with [Qoder][https://qoder.com]
322 lines
7.6 KiB
Vue
322 lines
7.6 KiB
Vue
<script setup lang="ts">
|
|
import { ref, computed } from 'vue';
|
|
import { useRouter, useRoute } from 'vue-router';
|
|
import { useI18n } from 'vue-i18n';
|
|
import { defaultPhoneIsoForLocale, getPhoneDialFromIso } from '@thebet365/shared';
|
|
import { useAuthStore } from '../stores/auth';
|
|
import { useAppLocale } from '../composables/useAppLocale';
|
|
import LocaleSwitcher from '../components/LocaleSwitcher.vue';
|
|
import PhoneCountrySelect from '../components/PhoneCountrySelect.vue';
|
|
import RobotVerify from '../components/RobotVerify.vue';
|
|
import loginBg from '../assets/images/h5bg.webp';
|
|
|
|
type LoginMode = 'account' | 'phone';
|
|
|
|
const { t, locale } = useI18n();
|
|
const { syncLocaleToBackend } = useAppLocale();
|
|
const auth = useAuthStore();
|
|
const router = useRouter();
|
|
const route = useRoute();
|
|
const captchaRef = ref<InstanceType<typeof RobotVerify> | null>(null);
|
|
const loginMode = ref<LoginMode>('account');
|
|
const account = ref('');
|
|
const phone = ref('');
|
|
const countryIso = ref(defaultPhoneIsoForLocale(locale.value));
|
|
const password = ref('');
|
|
const error = ref('');
|
|
const loading = ref(false);
|
|
|
|
const resetSuccess = computed(() => route.query.reset === 'success');
|
|
|
|
function goForgotPassword() {
|
|
router.push({
|
|
path: '/forgot-password',
|
|
query: route.query.redirect ? { redirect: route.query.redirect as string } : {},
|
|
});
|
|
}
|
|
|
|
function switchLoginMode(mode: LoginMode) {
|
|
if (loginMode.value === mode) return;
|
|
loginMode.value = mode;
|
|
error.value = '';
|
|
}
|
|
|
|
async function submit() {
|
|
if (!captchaRef.value?.validate()) {
|
|
error.value = t('auth.captcha_wrong');
|
|
captchaRef.value?.refresh();
|
|
return;
|
|
}
|
|
loading.value = true;
|
|
error.value = '';
|
|
try {
|
|
const isPhone = loginMode.value === 'phone';
|
|
const loginId = isPhone ? phone.value : account.value;
|
|
const countryCode = isPhone ? getPhoneDialFromIso(countryIso.value) : undefined;
|
|
await auth.login(loginId, password.value, countryCode);
|
|
await syncLocaleToBackend();
|
|
const redirectTo = (route.query.redirect as string) || '/';
|
|
router.push(redirectTo);
|
|
} catch (e: unknown) {
|
|
error.value = (e as { response?: { data?: { error?: string } } })?.response?.data?.error || 'Login failed';
|
|
} finally {
|
|
loading.value = false;
|
|
}
|
|
}
|
|
|
|
function isGuestBrowsablePath(path: string): boolean {
|
|
if (!path || path === '/' || path === '/bet') return true;
|
|
if (path.startsWith('/match/')) return true;
|
|
return false;
|
|
}
|
|
|
|
function continueBrowsing() {
|
|
const redirect = typeof route.query.redirect === 'string' ? route.query.redirect : '';
|
|
const target = isGuestBrowsablePath(redirect) ? redirect || '/' : '/';
|
|
router.replace(target);
|
|
}
|
|
|
|
function goRegister() {
|
|
router.push({
|
|
path: '/register',
|
|
query: route.query.redirect ? { redirect: route.query.redirect as string } : {},
|
|
});
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<div class="login-page" :style="{ backgroundImage: `url(${loginBg})` }">
|
|
<div class="login-lang">
|
|
<LocaleSwitcher compact />
|
|
</div>
|
|
<form @submit.prevent="submit" class="login-form ps-gold-frame">
|
|
<div v-if="loginMode === 'account'" class="field">
|
|
<label>{{ t('auth.username') }}</label>
|
|
<input
|
|
v-model="account"
|
|
class="field-input"
|
|
required
|
|
autocomplete="username"
|
|
maxlength="32"
|
|
:placeholder="t('auth.username_placeholder')"
|
|
/>
|
|
</div>
|
|
|
|
<div v-else class="field">
|
|
<label>{{ t('auth.phone') }}</label>
|
|
<div class="inline-row">
|
|
<PhoneCountrySelect v-model="countryIso" />
|
|
<input
|
|
v-model="phone"
|
|
class="field-input"
|
|
type="tel"
|
|
required
|
|
autocomplete="tel-national"
|
|
:placeholder="t('auth.phone_local_placeholder')"
|
|
/>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="field">
|
|
<label>{{ t('auth.password') }}</label>
|
|
<input v-model="password" class="field-input" type="password" required autocomplete="current-password" />
|
|
</div>
|
|
|
|
<button type="button" class="btn-forgot" @click="goForgotPassword">
|
|
{{ t('auth.forgot_password') }}
|
|
</button>
|
|
|
|
<button type="button" class="btn-mode-switch" @click="switchLoginMode(loginMode === 'account' ? 'phone' : 'account')">
|
|
{{ loginMode === 'account' ? t('auth.login_by_phone') : t('auth.login_by_account') }}
|
|
</button>
|
|
|
|
<RobotVerify ref="captchaRef" />
|
|
<p v-if="resetSuccess" class="success">{{ t('auth.reset_success') }}</p>
|
|
<p v-if="error" class="error">{{ error }}</p>
|
|
<button type="submit" class="btn-login btn-gold-outline" :disabled="loading">
|
|
{{ t('auth.login') }}
|
|
</button>
|
|
<button type="button" class="btn-skip" @click="goRegister">
|
|
{{ t('auth.go_register') }}
|
|
</button>
|
|
</form>
|
|
<button type="button" class="btn-skip-light" @click="continueBrowsing">
|
|
{{ t('auth.continue_browsing') }}
|
|
</button>
|
|
</div>
|
|
</template>
|
|
|
|
<style scoped>
|
|
.login-lang {
|
|
position: absolute;
|
|
top: max(12px, env(safe-area-inset-top));
|
|
right: 16px;
|
|
z-index: 2;
|
|
}
|
|
|
|
.login-page {
|
|
position: relative;
|
|
height: 100%;
|
|
min-height: 100dvh;
|
|
overflow-y: auto;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
justify-content: flex-end;
|
|
padding: 34vh 20px calc(15vh + max(28px, env(safe-area-inset-bottom)));
|
|
background: linear-gradient(160deg, #E8EDF2 0%, #F5F7FA 40%, #FFFFFF 100%);
|
|
background-size: cover;
|
|
background-position: center top;
|
|
background-repeat: no-repeat;
|
|
}
|
|
|
|
.login-form {
|
|
width: 100%;
|
|
max-width: 320px;
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 8px;
|
|
padding: 20px;
|
|
background: #FFFFFF;
|
|
border: 1px solid #E5E7EB;
|
|
border-radius: 8px;
|
|
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
|
|
}
|
|
|
|
.field {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 4px;
|
|
}
|
|
|
|
.field-input {
|
|
width: 100%;
|
|
height: 36px;
|
|
padding: 0 10px;
|
|
border: 1px solid #E5E7EB;
|
|
border-radius: 6px;
|
|
background: #FFFFFF;
|
|
color: #1A1A2E;
|
|
font-size: 14px;
|
|
font-family: inherit;
|
|
}
|
|
|
|
.field-input:focus {
|
|
outline: none;
|
|
border-color: #0066CC;
|
|
box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.15);
|
|
}
|
|
|
|
.inline-row {
|
|
display: flex;
|
|
gap: 6px;
|
|
align-items: center;
|
|
}
|
|
|
|
.inline-row .field-input {
|
|
flex: 1;
|
|
min-width: 0;
|
|
}
|
|
|
|
label {
|
|
font-size: 11px;
|
|
color: #6B7280;
|
|
font-weight: 600;
|
|
letter-spacing: 0.04em;
|
|
}
|
|
|
|
.btn-mode-switch {
|
|
align-self: flex-start;
|
|
margin: -2px 0 0;
|
|
padding: 0;
|
|
border: none;
|
|
background: transparent;
|
|
color: #005B9F;
|
|
font-size: 12px;
|
|
font-weight: 600;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.btn-forgot {
|
|
align-self: flex-end;
|
|
margin: -4px 0 0;
|
|
padding: 0;
|
|
border: none;
|
|
background: transparent;
|
|
color: #6B7280;
|
|
font-size: 12px;
|
|
font-weight: 600;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.btn-forgot:active {
|
|
color: #003D6B;
|
|
}
|
|
|
|
.btn-mode-switch:active {
|
|
color: #003D6B;
|
|
}
|
|
|
|
.btn-login {
|
|
margin-top: 4px;
|
|
padding: 10px 14px;
|
|
border-radius: 6px;
|
|
font-size: 14px;
|
|
font-weight: 800;
|
|
letter-spacing: 0.06em;
|
|
}
|
|
|
|
.btn-login:disabled {
|
|
opacity: 0.45;
|
|
cursor: not-allowed;
|
|
}
|
|
|
|
.btn-skip {
|
|
margin-top: 2px;
|
|
padding: 8px 14px;
|
|
border: none;
|
|
background: transparent;
|
|
color: #003D6B;
|
|
font-size: 13px;
|
|
font-weight: 600;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.btn-skip:active {
|
|
color: #005B9F;
|
|
}
|
|
|
|
.btn-skip-light {
|
|
position: absolute;
|
|
bottom: calc(20px + env(safe-area-inset-bottom));
|
|
left: 50%;
|
|
transform: translateX(-50%);
|
|
padding: 8px 16px;
|
|
border: none;
|
|
background: transparent;
|
|
color: #6B7280;
|
|
font-size: 13px;
|
|
font-weight: 400;
|
|
cursor: pointer;
|
|
white-space: nowrap;
|
|
}
|
|
|
|
.btn-skip-light:active {
|
|
color: #003D6B;
|
|
}
|
|
|
|
.error {
|
|
color: #DC2626;
|
|
font-size: 13px;
|
|
font-weight: 600;
|
|
}
|
|
|
|
.success {
|
|
margin: 0;
|
|
color: #059669;
|
|
font-size: 12px;
|
|
font-weight: 600;
|
|
line-height: 1.4;
|
|
}
|
|
</style>
|