Files
thebet365/apps/player/src/components/RobotVerify.vue
Mars 4a93fcfce0 feat(player): 全站 UI 主题重构与布局优化 — 从暗金奢华风格迁移至 Pinnacle 风格蓝白专业主题
一、全局主题重构(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]
2026-06-16 12:24:41 +08:00

200 lines
4.4 KiB
Vue

<script setup lang="ts">
import { ref, onMounted } from 'vue';
import { useI18n } from 'vue-i18n';
const { t } = useI18n();
const input = ref('');
const code = ref('');
const canvasRef = ref<HTMLCanvasElement | null>(null);
const honeypot = ref('');
const validated = ref(false);
const errorMsg = ref('');
const CHARS = 'ABCDEFGHJKLMNPQRSTUVWXYZ23456789';
const CANVAS_W = 96;
const CANVAS_H = 36;
function generateCode() {
let result = '';
for (let i = 0; i < 4; i++) {
result += CHARS[Math.floor(Math.random() * CHARS.length)];
}
code.value = result;
}
function drawCaptcha() {
const canvas = canvasRef.value;
if (!canvas) return;
canvas.width = CANVAS_W;
canvas.height = CANVAS_H;
const ctx = canvas.getContext('2d');
if (!ctx) return;
ctx.fillStyle = '#0d0d0d';
ctx.fillRect(0, 0, CANVAS_W, CANVAS_H);
for (let i = 0; i < 20; i++) {
ctx.fillStyle = `rgba(255, 255, 255, ${0.03 + Math.random() * 0.06})`;
ctx.beginPath();
ctx.arc(Math.random() * CANVAS_W, Math.random() * CANVAS_H, Math.random() * 1.8, 0, Math.PI * 2);
ctx.fill();
}
for (let i = 0; i < 3; i++) {
ctx.strokeStyle = `rgba(255, 255, 255, ${0.06 + Math.random() * 0.08})`;
ctx.lineWidth = 1;
ctx.beginPath();
ctx.moveTo(Math.random() * CANVAS_W, Math.random() * CANVAS_H);
ctx.lineTo(Math.random() * CANVAS_W, Math.random() * CANVAS_H);
ctx.stroke();
}
const charWidth = CANVAS_W / (code.value.length + 1);
for (let i = 0; i < code.value.length; i++) {
ctx.save();
const x = charWidth * (i + 0.5) + (Math.random() - 0.5) * 3;
const y = CANVAS_H / 2 + (Math.random() - 0.5) * 4;
ctx.translate(x, y);
ctx.rotate((Math.random() - 0.5) * 0.35);
ctx.font = `bold ${15 + Math.random() * 4}px 'Courier New', monospace`;
ctx.fillStyle = `rgba(240, 216, 117, ${0.85 + Math.random() * 0.15})`;
ctx.textAlign = 'center';
ctx.textBaseline = 'middle';
ctx.fillText(code.value[i], 0, 0);
ctx.restore();
}
}
function refresh() {
generateCode();
input.value = '';
validated.value = false;
errorMsg.value = '';
drawCaptcha();
}
function validate(): boolean {
if (honeypot.value) { refresh(); return false; }
if (!input.value.trim()) {
errorMsg.value = t('auth.captcha_wrong');
return false;
}
if (input.value.trim().toUpperCase() !== code.value.toUpperCase()) {
errorMsg.value = t('auth.captcha_wrong');
refresh();
return false;
}
validated.value = true;
errorMsg.value = '';
return true;
}
onMounted(refresh);
defineExpose({ validate, refresh });
</script>
<template>
<div class="captcha-wrap">
<div class="captcha-row">
<input
v-model="honeypot"
type="text"
name="website"
tabindex="-1"
autocomplete="off"
class="hp-field"
aria-hidden="true"
/>
<input
v-model="input"
type="text"
maxlength="4"
class="captcha-input"
:placeholder="t('auth.captcha_placeholder')"
autocomplete="off"
/>
<canvas
ref="canvasRef"
class="captcha-canvas"
:width="CANVAS_W"
:height="CANVAS_H"
:title="t('auth.captcha_refresh')"
role="button"
tabindex="0"
@click="refresh"
@keydown.enter="refresh"
/>
</div>
<p v-if="errorMsg" class="captcha-error">{{ errorMsg }}</p>
</div>
</template>
<style scoped>
.captcha-wrap {
width: 100%;
}
.captcha-row {
display: flex;
align-items: stretch;
height: 36px;
border: 1px solid #E5E7EB;
border-radius: 8px;
background: #FFFFFF;
overflow: hidden;
}
.captcha-row:focus-within {
border-color: #003D6B;
}
.hp-field {
position: absolute;
left: -9999px;
width: 1px;
height: 1px;
opacity: 0;
pointer-events: none;
}
.captcha-input {
flex: 1;
min-width: 0;
padding: 0 10px;
border: none;
background: transparent;
color: #1A1A2E;
font-size: 14px;
font-weight: 700;
letter-spacing: 0.12em;
text-transform: uppercase;
outline: none;
font-family: inherit;
}
.captcha-input::placeholder {
color: #6B7280;
font-weight: 600;
letter-spacing: 0.02em;
text-transform: none;
}
.captcha-canvas {
flex-shrink: 0;
width: 96px;
height: 36px;
cursor: pointer;
display: block;
border: none;
border-left: 1px solid #E5E7EB;
}
.captcha-error {
color: #DC2626;
font-size: 12px;
font-weight: 600;
margin: 4px 0 0;
}
</style>