## 管理端 / 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>
200 lines
4.4 KiB
Vue
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 = '#002244';
|
|
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 var(--border);
|
|
border-radius: 6px;
|
|
background: var(--bg-body);
|
|
overflow: hidden;
|
|
}
|
|
|
|
.captcha-row:focus-within {
|
|
border-color: var(--border-gold-soft);
|
|
}
|
|
|
|
.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: var(--text);
|
|
font-size: 14px;
|
|
font-weight: 700;
|
|
letter-spacing: 0.12em;
|
|
text-transform: uppercase;
|
|
outline: none;
|
|
font-family: inherit;
|
|
}
|
|
|
|
.captcha-input::placeholder {
|
|
color: var(--neutral);
|
|
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 var(--border);
|
|
}
|
|
|
|
.captcha-error {
|
|
color: var(--danger);
|
|
font-size: 12px;
|
|
font-weight: 600;
|
|
margin: 4px 0 0;
|
|
}
|
|
</style>
|