feat(player): 优化赛事详情与串关下注交互

- 合并玩法列表、单选投注单与玩法内确认下单
- 波胆底部确认与核对弹窗;串关底栏固定
- 帮助弹窗与投注单逻辑拆分(详情单关/串关页串关)

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-03 10:54:49 +08:00
parent 451cc3984a
commit d432de6fdf
12 changed files with 1089 additions and 540 deletions

View File

@@ -29,7 +29,6 @@ async function placeBet() {
success.value = '';
try {
const requestId = genId();
if (slip.mode === 'parlay' && slip.items.length >= 2) {
if (slip.hasSameMatch) {
error.value = t('bet.parlay_same_match');
@@ -41,7 +40,7 @@ async function placeBet() {
oddsVersion: i.oddsVersion,
})),
stake: slip.stake,
requestId,
requestId: genId(),
});
} else if (slip.items.length === 1) {
const item = slip.items[0];
@@ -49,17 +48,21 @@ async function placeBet() {
selectionId: item.selectionId,
oddsVersion: item.oddsVersion,
stake: slip.stake,
requestId,
requestId: genId(),
});
} else {
error.value = t('bet.parlay_need_more');
return;
}
success.value = '下注成功!';
success.value = t('bet.place_success');
slip.clear();
setTimeout(() => { show.value = false; success.value = ''; }, 1500);
setTimeout(() => {
show.value = false;
success.value = '';
}, 1500);
} catch (e: unknown) {
error.value = (e as { response?: { data?: { error?: string } } })?.response?.data?.error || '下注失败';
error.value =
(e as { response?: { data?: { error?: string } } })?.response?.data?.error ||
t('bet.place_failed');
} finally {
loading.value = false;
}
@@ -71,31 +74,46 @@ async function placeBet() {
<div class="drawer">
<div class="drawer-header">
<h3>{{ t('bet.bet_slip') }} <span class="count">({{ slip.count }})</span></h3>
<button class="close-btn" @click="show = false"></button>
<button type="button" class="close-btn" :aria-label="t('bet.cancel')" @click="show = false">
</button>
</div>
<div v-if="!slip.items.length" class="empty">点击赔率添加投注</div>
<div v-if="!slip.items.length" class="empty">{{ t('bet.slip_empty_hint') }}</div>
<div v-for="item in slip.items" :key="item.selectionId" class="slip-item">
<div class="item-name">{{ item.matchName }}</div>
<div class="item-sel">{{ item.selectionName }} @ <span class="odds">{{ item.odds }}</span></div>
<button class="remove" @click="slip.removeItem(item.selectionId)">移除</button>
<div class="item-sel">
{{ item.selectionName }} @ <span class="odds">{{ item.odds }}</span>
</div>
<button type="button" class="remove" @click="slip.removeItem(item.selectionId)">
{{ t('bet.slip_remove') }}
</button>
</div>
<div v-if="slip.hasSameMatch" class="warn">同场比赛不能串关可作为单关分别投注</div>
<p v-if="slip.isParlay" class="mode-hint mode-hint--parlay">
{{ t('bet.parlay') }} · {{ t('bet.slip_parlay_odds', { odds: slip.totalOdds.toFixed(2) }) }}
</p>
<div v-if="slip.items.length" class="stake-area">
<label>{{ t('bet.stake') }}</label>
<input v-model.number="slip.stake" type="number" min="1" />
<div v-if="slip.isParlay" class="mode-tag">{{ t('bet.parlay') }} · 赔率 {{ slip.totalOdds.toFixed(2) }}</div>
<div class="return">预计返还: <strong>{{ slip.potentialReturn.toFixed(2) }}</strong></div>
<div class="return">
{{ t('bet.slip_est_return') }}:
<strong>{{ slip.potentialReturn.toFixed(2) }}</strong>
</div>
</div>
<p v-if="error" class="error">{{ error }}</p>
<p v-if="success" class="success">{{ success }}</p>
<button class="btn-primary" :disabled="loading || !slip.items.length" @click="placeBet">
{{ t('bet.place_bet') }}
<button
type="button"
class="btn-primary"
:disabled="loading || !slip.items.length"
@click="placeBet"
>
{{ loading ? t('bet.placing') : t('bet.place_bet') }}
</button>
</div>
</div>
@@ -103,48 +121,130 @@ async function placeBet() {
<style scoped>
.overlay {
position: fixed; inset: 0;
position: fixed;
inset: 0;
background: rgba(0, 0, 0, 0.75);
z-index: 200;
display: flex; align-items: flex-end;
display: flex;
align-items: flex-end;
}
.drawer {
background: linear-gradient(180deg, #222 0%, #141414 100%);
width: 100%;
max-height: 80vh;
border-radius: 20px 20px 0 0;
padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0));
border-radius: 16px 16px 0 0;
padding: 14px 14px calc(14px + env(safe-area-inset-bottom, 0));
overflow-y: auto;
border-top: 1px solid var(--border);
box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.35);
}
.drawer-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.drawer-header h3 { font-size: 18px; font-weight: 800; letter-spacing: 0.04em; }
.count { color: var(--primary-light); font-size: 20px; font-weight: 800; }
.close-btn { background: none; color: var(--text-muted); font-size: 22px; padding: 4px; font-weight: 700; }
.drawer-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 12px;
}
.drawer-header h3 {
font-size: 16px;
font-weight: 800;
}
.count {
color: var(--primary-light);
}
.close-btn {
background: none;
color: var(--text-muted);
font-size: 20px;
padding: 4px;
}
.slip-item {
padding: 14px;
padding: 10px 12px;
background: #111;
border: 1px solid var(--border);
border-radius: var(--radius-sm);
margin-bottom: 10px;
border-radius: 6px;
margin-bottom: 8px;
}
.item-name { font-size: 14px; font-weight: 800; }
.item-sel { font-size: 13px; color: var(--text-muted); margin-top: 6px; font-weight: 500; }
.odds { color: var(--primary-light); font-weight: 800; }
.remove { background: none; color: var(--danger); font-size: 13px; margin-top: 8px; font-weight: 700; }
.stake-area { margin: 18px 0; }
.stake-area label { font-size: 13px; color: var(--primary-light); display: block; margin-bottom: 8px; font-weight: 700; letter-spacing: 0.04em; }
.return { font-size: 15px; color: var(--text-muted); margin-top: 12px; font-weight: 600; }
.item-name {
font-size: 13px;
font-weight: 800;
}
.item-sel {
font-size: 12px;
color: var(--text-muted);
margin-top: 4px;
}
.odds {
color: var(--primary-light);
font-weight: 800;
}
.remove {
background: none;
color: var(--danger);
font-size: 12px;
margin-top: 6px;
font-weight: 700;
}
.mode-hint {
font-size: 12px;
color: var(--text-muted);
margin-bottom: 8px;
}
.mode-hint--parlay {
color: var(--primary-light);
font-weight: 700;
}
.stake-area {
margin: 12px 0;
}
.stake-area label {
font-size: 12px;
color: var(--primary-light);
display: block;
margin-bottom: 6px;
font-weight: 700;
}
.return {
font-size: 13px;
color: var(--text-muted);
margin-top: 8px;
}
.return strong {
color: var(--primary-light);
font-size: 22px;
font-size: 18px;
font-weight: 800;
text-shadow: none;
}
.mode-tag { font-size: 13px; color: var(--primary-light); font-weight: 700; margin-top: 8px; }
.warn { color: var(--primary-light); font-size: 13px; margin-bottom: 10px; font-weight: 600; }
.error { color: var(--danger); font-size: 14px; margin-bottom: 8px; font-weight: 600; }
.success { color: var(--primary-light); font-size: 14px; font-weight: 700; margin-bottom: 8px; }
.empty { text-align: center; color: var(--text-muted); padding: 32px; font-weight: 600; }
.error {
color: var(--danger);
font-size: 13px;
margin-bottom: 8px;
}
.success {
color: var(--primary-light);
font-size: 13px;
margin-bottom: 8px;
}
.empty {
text-align: center;
color: var(--text-muted);
padding: 24px;
font-size: 13px;
}
</style>

View File

@@ -0,0 +1,253 @@
<script setup lang="ts">
import { computed } from 'vue';
import { useI18n } from 'vue-i18n';
import { formatMoney } from '../../utils/localeDisplay';
export interface CsConfirmLine {
scoreDisplay: string;
odds: string;
stake: number;
}
const props = defineProps<{
open: boolean;
marketLabel: string;
homeTeamName: string;
awayTeamName: string;
lines: CsConfirmLine[];
loading?: boolean;
}>();
const emit = defineEmits<{ confirm: []; close: [] }>();
const { t, locale } = useI18n();
const totalStake = computed(() =>
props.lines.reduce((sum, line) => sum + line.stake, 0),
);
const totalReturn = computed(() =>
props.lines.reduce((sum, line) => {
const odds = parseFloat(line.odds);
return sum + line.stake * (Number.isFinite(odds) ? odds : 0);
}, 0),
);
function formatOdds(odds: string) {
const n = parseFloat(odds);
return Number.isFinite(n) ? n.toFixed(2) : odds;
}
</script>
<template>
<div v-if="open && lines.length" class="overlay" @click.self="emit('close')">
<div class="modal" role="dialog" aria-modal="true">
<button type="button" class="close-x" :aria-label="t('bet.cancel')" @click="emit('close')"></button>
<h3 class="title">{{ t('bet.cs_confirm_title') }}</h3>
<p class="match-line">{{ homeTeamName }} vs {{ awayTeamName }}</p>
<p class="market-tag">{{ marketLabel }}</p>
<p class="count">{{ t('bet.cs_confirm_count', { n: lines.length }) }}</p>
<ul class="line-list">
<li v-for="(line, idx) in lines" :key="idx" class="line-item">
<span class="score">{{ line.scoreDisplay }}</span>
<span class="odds">@ {{ formatOdds(line.odds) }}</span>
<span class="stake">{{ formatMoney(line.stake, locale) }}</span>
</li>
</ul>
<div class="totals">
<div class="total-row">
<span>{{ t('bet.cs_confirm_total_stake') }}</span>
<span class="gold">{{ formatMoney(totalStake, locale) }}</span>
</div>
<div class="total-row">
<span>{{ t('history.est_return') }}</span>
<span class="gold">{{ formatMoney(totalReturn, locale) }}</span>
</div>
</div>
<div class="actions">
<button type="button" class="btn-cancel" :disabled="loading" @click="emit('close')">
{{ t('bet.cancel') }}
</button>
<button
type="button"
class="btn-confirm btn-gold-outline"
:disabled="loading"
@click="emit('confirm')"
>
{{ loading ? t('bet.placing') : t('bet.place_bet_short') }}
</button>
</div>
</div>
</div>
</template>
<style scoped>
.overlay {
position: fixed;
inset: 0;
z-index: 210;
background: rgba(0, 0, 0, 0.72);
display: flex;
align-items: center;
justify-content: center;
padding: 20px;
backdrop-filter: blur(4px);
}
.modal {
position: relative;
width: 100%;
max-width: 320px;
max-height: 85vh;
overflow-y: auto;
background: linear-gradient(165deg, #1a1810 0%, #121212 45%, #0a0a0a 100%);
border: 1px solid var(--border-gold-soft);
border-radius: var(--radius);
padding: 16px 14px 14px;
box-shadow: var(--shadow), 0 0 24px rgba(212, 175, 55, 0.08);
}
.close-x {
position: absolute;
top: 10px;
right: 10px;
width: 28px;
height: 28px;
border-radius: 50%;
background: rgba(255, 255, 255, 0.06);
color: var(--text-muted);
font-size: 14px;
}
.title {
font-size: 16px;
font-weight: 800;
color: var(--primary-light);
text-align: center;
margin-bottom: 6px;
padding-right: 24px;
}
.match-line {
text-align: center;
font-size: 14px;
font-weight: 700;
color: var(--text);
margin-bottom: 4px;
}
.market-tag {
text-align: center;
font-size: 12px;
color: var(--text-muted);
margin-bottom: 4px;
}
.count {
text-align: center;
font-size: 11px;
color: var(--text-muted);
margin-bottom: 12px;
}
.line-list {
list-style: none;
margin: 0 0 12px;
padding: 0;
max-height: 220px;
overflow-y: auto;
border: 1px solid var(--border);
border-radius: 6px;
background: rgba(0, 0, 0, 0.35);
}
.line-item {
display: grid;
grid-template-columns: 1fr auto auto;
gap: 8px;
align-items: center;
padding: 9px 10px;
font-size: 13px;
border-bottom: 1px solid var(--border);
}
.line-item:last-child {
border-bottom: none;
}
.score {
font-weight: 800;
color: var(--primary-light);
}
.odds {
color: var(--text-muted);
font-weight: 600;
font-size: 12px;
}
.stake {
font-weight: 800;
color: var(--text);
text-align: right;
min-width: 56px;
}
.totals {
padding: 10px;
margin-bottom: 12px;
background: rgba(212, 175, 55, 0.06);
border: 1px solid var(--border-gold-soft);
border-radius: 6px;
}
.total-row {
display: flex;
justify-content: space-between;
font-size: 13px;
color: var(--text-muted);
font-weight: 600;
}
.total-row + .total-row {
margin-top: 8px;
padding-top: 8px;
border-top: 1px solid var(--border);
}
.gold {
color: var(--primary-light);
font-weight: 800;
}
.actions {
display: grid;
grid-template-columns: 1fr 1.2fr;
gap: 8px;
}
.btn-cancel {
padding: 10px;
border-radius: 6px;
background: #1a1a1a;
border: 1px solid var(--border);
color: var(--text-muted);
font-size: 14px;
font-weight: 700;
}
.btn-confirm {
padding: 10px;
border-radius: 6px;
font-size: 14px;
font-weight: 800;
}
.btn-confirm:disabled {
opacity: 0.45;
}
</style>

View File

@@ -5,8 +5,6 @@ import { groupCorrectScoreSelections, type CsSelection } from '../../utils/corre
const props = defineProps<{
marketType: string;
homeTeamName: string;
awayTeamName: string;
selections: Array<{
id: string;
selectionCode: string;
@@ -38,11 +36,6 @@ function formatOdds(odds: string) {
<template>
<div class="cs-panel">
<div class="teams-bar">
<div class="team-box">{{ homeTeamName }}</div>
<div class="team-box">{{ awayTeamName }}</div>
</div>
<div class="cols-head">
<span>{{ t('bet.col_home') }}</span>
<span>{{ t('bet.col_draw') }}</span>
@@ -51,20 +44,17 @@ function formatOdds(odds: string) {
<div class="cols-grid">
<div v-for="colKey in ['home', 'draw', 'away'] as const" :key="colKey" class="col">
<div
v-for="sel in columns[colKey]"
:key="sel.id"
class="score-card"
>
<div class="score-line">{{ sel.scoreDisplay }}</div>
<div class="odds-box">{{ formatOdds(sel.odds) }}</div>
<div v-for="sel in columns[colKey]" :key="sel.id" class="score-card">
<span class="score-line">{{ sel.scoreDisplay }}</span>
<span class="odds">{{ formatOdds(sel.odds) }}</span>
<input
type="number"
class="stake-input"
min="0"
step="1"
inputmode="decimal"
:value="stakes[sel.id] ?? 0"
:placeholder="t('bet.stake_placeholder')"
:value="stakes[sel.id] ?? ''"
@input="setStake(sel, ($event.target as HTMLInputElement).value)"
/>
</div>
@@ -75,92 +65,71 @@ function formatOdds(odds: string) {
<style scoped>
.cs-panel {
padding: 0 10px 14px;
}
.teams-bar {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 8px;
margin-bottom: 12px;
}
.team-box {
padding: 10px 8px;
text-align: center;
font-size: 14px;
font-weight: 800;
color: var(--primary-light);
background: #0d0d0d;
border: 1px solid #333;
border-radius: 4px;
padding: 6px 8px 0;
}
.cols-head {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 6px;
margin-bottom: 8px;
gap: 4px;
margin-bottom: 4px;
text-align: center;
font-size: 13px;
font-weight: 800;
color: var(--primary-light);
font-size: 10px;
font-weight: 700;
color: var(--text-muted);
}
.cols-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 6px;
align-items: start;
gap: 4px;
}
.col {
display: flex;
flex-direction: column;
gap: 8px;
gap: 4px;
}
.score-card {
background: #1c1c1c;
border: 1px solid #333;
border-radius: 4px;
padding: 8px 6px 6px;
text-align: center;
display: flex;
flex-direction: column;
align-items: center;
gap: 2px;
padding: 4px 3px;
background: #161616;
border-radius: 3px;
}
.score-line {
font-size: 15px;
font-size: 11px;
font-weight: 800;
color: var(--text);
margin-bottom: 6px;
}
.odds-box {
display: inline-block;
min-width: 52px;
padding: 3px 8px;
margin-bottom: 6px;
border: 1px solid var(--primary);
border-radius: 3px;
font-size: 12px;
font-weight: 800;
.odds {
font-size: 10px;
font-weight: 700;
color: var(--primary-light);
background: rgba(212, 175, 55, 0.08);
}
.stake-input {
width: 100%;
padding: 6px 4px;
border-radius: 3px;
border: none;
background: #f2f2f2;
color: #111;
font-size: 14px;
font-weight: 700;
padding: 4px 2px;
border-radius: 2px;
border: 1px solid #2a2a2a;
background: #0a0a0a;
color: var(--text);
font-size: 12px;
text-align: center;
outline: none;
-moz-appearance: textfield;
}
.stake-input:focus {
border-color: var(--border-gold-soft);
}
.stake-input::-webkit-outer-spin-button,
.stake-input::-webkit-inner-spin-button {
-webkit-appearance: none;

View File

@@ -1,160 +0,0 @@
<script setup lang="ts">
import { useI18n } from 'vue-i18n';
const props = defineProps<{
label: string;
expanded: boolean;
hasMarket: boolean;
rewardActive?: boolean;
}>();
const emit = defineEmits<{
bet: [];
expand: [];
collapse: [];
}>();
const { t } = useI18n();
function onBet() {
if (!props.hasMarket) return;
emit('bet');
}
function onExpand() {
if (!props.hasMarket) return;
emit('expand');
}
function onCollapse() {
emit('collapse');
}
</script>
<template>
<div class="featured-wrap" :class="{ expanded, disabled: !hasMarket }">
<div class="featured-row">
<div class="featured-main">
<span class="market-name">{{ label }}</span>
<span v-if="rewardActive && hasMarket" class="reward-badge">
🏆 {{ t('bet.reward_active') }}
</span>
<span v-else-if="!hasMarket" class="closed-tag">{{ t('bet.market_closed') }}</span>
</div>
<div class="featured-actions">
<button type="button" class="btn-bet btn-gold-outline" :disabled="!hasMarket" @click="onBet">
{{ t('bet.place_bet_short') }}
</button>
<button
type="button"
class="btn-icon btn-gold-outline"
:disabled="!hasMarket"
:aria-label="expanded ? t('bet.collapse_market') : t('bet.expand_market')"
@click="expanded ? onCollapse() : onExpand()"
>
{{ expanded ? '' : '+' }}
</button>
<button
type="button"
class="btn-icon btn-gold-outline"
:aria-label="t('bet.collapse_market')"
@click="onCollapse"
>
×
</button>
</div>
</div>
<div v-if="expanded && hasMarket" class="panel-slot">
<slot />
</div>
</div>
</template>
<style scoped>
.featured-wrap {
margin-bottom: 10px;
border-radius: 6px;
border: 1px solid #3a3218;
background: #121212;
box-shadow: 0 0 0 1px rgba(212, 175, 55, 0.12);
}
.featured-wrap.expanded {
box-shadow:
0 0 0 1px rgba(212, 175, 55, 0.35),
0 0 12px rgba(212, 175, 55, 0.15);
}
.featured-wrap.disabled {
opacity: 0.55;
}
.featured-row {
display: flex;
align-items: center;
justify-content: space-between;
gap: 10px;
padding: 12px 10px;
}
.featured-main {
flex: 1;
min-width: 0;
}
.market-name {
display: block;
font-size: 15px;
font-weight: 800;
color: var(--primary-light);
margin-bottom: 4px;
}
.reward-badge {
display: inline-block;
font-size: 11px;
font-weight: 700;
color: #e8c84a;
background: rgba(212, 175, 55, 0.12);
padding: 2px 8px;
border-radius: 4px;
}
.closed-tag {
font-size: 11px;
color: var(--text-muted);
}
.featured-actions {
display: flex;
align-items: center;
gap: 6px;
flex-shrink: 0;
}
.btn-bet {
padding: 8px 14px;
border-radius: 6px;
font-size: 13px;
}
.btn-bet:disabled {
opacity: 0.45;
}
.btn-icon {
width: 32px;
height: 32px;
border-radius: 6px;
font-size: 18px;
font-weight: 900;
line-height: 1;
display: flex;
align-items: center;
justify-content: center;
}
.btn-icon:disabled {
opacity: 0.45;
}
</style>

View File

@@ -6,60 +6,69 @@ defineProps<{
odds: string;
}[];
isSelected: (id: string) => boolean;
compact?: boolean;
}>();
const emit = defineEmits<{ pick: [id: string] }>();
</script>
<template>
<div class="panel">
<button
v-for="sel in selections"
:key="sel.id"
type="button"
class="odds-btn"
:class="{ selected: isSelected(sel.id) }"
@click="emit('pick', sel.id)"
>
<span class="label">{{ sel.selectionName }}</span>
<span class="odds">{{ sel.odds }}</span>
</button>
<div class="wrap" :class="{ compact }">
<div class="panel">
<button
v-for="sel in selections"
:key="sel.id"
type="button"
class="odds-btn"
:class="{ selected: isSelected(sel.id) }"
@click="emit('pick', sel.id)"
>
<span class="label">{{ sel.selectionName }}</span>
<span class="odds">{{ sel.odds }}</span>
</button>
</div>
</div>
</template>
<style scoped>
.wrap {
padding: 6px 8px 8px;
background: #0c0c0c;
}
.panel {
display: flex;
flex-wrap: wrap;
gap: 8px;
padding: 0 10px 12px;
display: grid;
grid-template-columns: repeat(3, 1fr);
gap: 4px;
}
.odds-btn {
min-width: calc(33.33% - 6px);
flex: 1 1 calc(33.33% - 6px);
max-width: calc(50% - 4px);
padding: 10px 8px;
border-radius: 6px;
background: #0d0d0d;
border: 1px solid #333;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
gap: 2px;
min-height: 44px;
padding: 6px 4px;
border-radius: 4px;
background: #141414;
border: 1px solid #262626;
text-align: center;
}
.odds-btn.selected {
border-color: var(--primary);
background: rgba(212, 175, 55, 0.12);
background: rgba(212, 175, 55, 0.1);
}
.label {
display: block;
font-size: 11px;
font-size: 9px;
color: var(--text-muted);
margin-bottom: 4px;
line-height: 1.15;
}
.odds {
font-size: 15px;
font-size: 14px;
font-weight: 800;
color: var(--primary-light);
}

View File

@@ -3,82 +3,71 @@ import { useI18n } from 'vue-i18n';
defineProps<{
label: string;
active: boolean;
expanded: boolean;
hasMarket: boolean;
}>();
const emit = defineEmits<{ expand: []; collapse: [] }>();
const emit = defineEmits<{ toggle: [] }>();
const { t } = useI18n();
</script>
<template>
<div class="tile" :class="{ active, disabled: !hasMarket }">
<span class="tile-label">{{ label }}</span>
<div class="tile-actions">
<button
type="button"
class="btn-icon btn-gold-outline"
:disabled="!hasMarket"
:aria-label="t('bet.expand_market')"
@click="emit('expand')"
>
+
</button>
<button
type="button"
class="btn-icon btn-gold-outline"
:aria-label="t('bet.collapse_market')"
@click="emit('collapse')"
>
×
</button>
</div>
</div>
<button
type="button"
class="row"
:class="{ expanded, disabled: !hasMarket }"
:disabled="!hasMarket"
@click="emit('toggle')"
>
<span class="row-label">{{ label }}</span>
<span v-if="!hasMarket" class="row-muted">{{ t('bet.market_closed') }}</span>
<span v-else class="row-chevron" aria-hidden="true">{{ expanded ? '▾' : '▸' }}</span>
</button>
</template>
<style scoped>
.tile {
.row {
display: flex;
align-items: center;
justify-content: space-between;
gap: 6px;
padding: 12px 10px;
background: #141414;
border: 1px solid #2a2a2a;
border-radius: 6px;
min-height: 48px;
gap: 8px;
width: 100%;
padding: 10px 12px;
background: transparent;
border: none;
text-align: left;
}
.tile.active {
border-color: var(--primary);
box-shadow: 0 0 8px rgba(212, 175, 55, 0.2);
.row.expanded {
background: rgba(255, 255, 255, 0.03);
}
.tile.disabled {
opacity: 0.5;
.row.disabled {
opacity: 0.4;
}
.tile-label {
font-size: 12px;
font-weight: 800;
color: var(--primary-light);
line-height: 1.25;
.row-label {
flex: 1;
min-width: 0;
font-size: 13px;
font-weight: 700;
color: var(--text);
}
.tile-actions {
display: flex;
gap: 4px;
flex-shrink: 0;
.row.expanded .row-label {
color: var(--primary-light);
}
.btn-icon {
width: 26px;
height: 26px;
border-radius: 5px;
font-size: 16px;
font-weight: 900;
line-height: 1;
.row-muted {
font-size: 10px;
color: var(--text-muted);
}
.row-chevron {
font-size: 11px;
color: var(--text-muted);
}
.row.expanded .row-chevron {
color: var(--primary-light);
}
</style>

View File

@@ -0,0 +1,156 @@
<script setup lang="ts">
import { ref } from 'vue';
import { useI18n } from 'vue-i18n';
const { t } = useI18n();
const open = ref(false);
function close() {
open.value = false;
}
</script>
<template>
<button
type="button"
class="help-btn"
:aria-label="t('bet.guide_help_aria')"
:title="t('bet.guide_help_aria')"
@click="open = true"
>
?
</button>
<Teleport to="body">
<div v-if="open" class="overlay" @click.self="close">
<div class="modal" role="dialog" aria-modal="true" :aria-label="t('bet.guide_title')">
<button type="button" class="close-x" :aria-label="t('bet.cancel')" @click="close"></button>
<h3 class="title">{{ t('bet.guide_title') }}</h3>
<div class="guide-body">
<div class="flow">
<p class="flow-name">{{ t('bet.guide_flow_normal') }}</p>
<ol>
<li>{{ t('bet.guide_normal_1') }}</li>
<li>{{ t('bet.guide_normal_2') }}</li>
<li>{{ t('bet.guide_normal_3') }}</li>
</ol>
</div>
<div class="flow flow--cs">
<p class="flow-name">{{ t('bet.guide_flow_cs') }}</p>
<ol>
<li>{{ t('bet.guide_cs_1') }}</li>
<li>{{ t('bet.guide_cs_2') }}</li>
<li>{{ t('bet.guide_cs_3') }}</li>
</ol>
</div>
</div>
<button type="button" class="btn-ok btn-gold-outline" @click="close">
{{ t('bet.guide_got_it') }}
</button>
</div>
</div>
</Teleport>
</template>
<style scoped>
.help-btn {
flex-shrink: 0;
width: 30px;
height: 30px;
border-radius: 50%;
border: 1px solid var(--border-gold-soft);
background: rgba(0, 0, 0, 0.2);
color: var(--primary-light);
font-size: 14px;
font-weight: 800;
line-height: 1;
padding: 0;
}
.overlay {
position: fixed;
inset: 0;
z-index: 205;
background: rgba(0, 0, 0, 0.72);
display: flex;
align-items: center;
justify-content: center;
padding: 20px;
backdrop-filter: blur(4px);
}
.modal {
position: relative;
width: 100%;
max-width: 340px;
max-height: 85vh;
overflow-y: auto;
background: linear-gradient(165deg, #1a1810 0%, #121212 45%, #0a0a0a 100%);
border: 1px solid var(--border-gold-soft);
border-radius: var(--radius);
padding: 16px 14px 14px;
box-shadow: var(--shadow), 0 0 24px rgba(212, 175, 55, 0.08);
}
.close-x {
position: absolute;
top: 10px;
right: 10px;
width: 28px;
height: 28px;
border-radius: 50%;
background: rgba(255, 255, 255, 0.06);
color: var(--text-muted);
font-size: 14px;
}
.title {
font-size: 16px;
font-weight: 800;
color: var(--primary-light);
text-align: center;
margin-bottom: 12px;
padding-right: 24px;
}
.guide-body {
display: grid;
gap: 10px;
margin-bottom: 14px;
}
.flow-name {
font-size: 13px;
font-weight: 800;
color: var(--primary-light);
margin-bottom: 8px;
}
.flow ol {
margin: 0;
padding-left: 20px;
font-size: 13px;
color: var(--text-muted);
line-height: 1.55;
}
.flow li + li {
margin-top: 6px;
}
.flow--cs {
padding-top: 10px;
border-top: 1px solid var(--border);
}
.btn-ok {
width: 100%;
padding: 10px;
border-radius: 6px;
font-size: 14px;
font-weight: 800;
}
</style>

View File

@@ -120,20 +120,18 @@ function pickSelection(match: ParlayMatch, market: Market, sel: Selection) {
function openSlip() {
slip.openDrawer();
}
const showParlayFoot = computed(() => slip.mode === 'parlay' && slip.count > 0);
</script>
<template>
<div class="parlay-panel">
<div class="parlay-panel" :class="{ 'has-fixed-foot': showParlayFoot }">
<header class="panel-head">
<div class="head-title">
<span class="layers-icon" aria-hidden="true" />
<h2>{{ t('bet.parlay_title') }}</h2>
</div>
<p class="head-desc">{{ t('bet.parlay_desc') }}</p>
<button type="button" class="slip-link btn-gold-outline" @click="openSlip">
{{ t('bet.bet_slip') }}
<span v-if="slip.count" class="slip-count">({{ slip.count }})</span>
</button>
</header>
<div class="toolbar">
@@ -184,6 +182,24 @@ function openSlip() {
<span class="empty-icon" aria-hidden="true">📅</span>
<p>{{ t('bet.parlay_empty') }}</p>
</div>
<Teleport to="body">
<div v-if="showParlayFoot" class="parlay-foot-fixed">
<p v-if="slip.count < 2" class="foot-hint">{{ t('bet.parlay_need_more') }}</p>
<p v-else class="foot-meta">
{{ t('bet.bet_slip') }} ({{ slip.count }}) · {{ t('bet.parlay') }}
{{ slip.totalOdds.toFixed(2) }}
</p>
<button
type="button"
class="market-foot-btn"
:disabled="slip.count < 2"
@click="openSlip"
>
{{ t('bet.cs_confirm_cell') }}
</button>
</div>
</Teleport>
</div>
</template>
@@ -192,6 +208,10 @@ function openSlip() {
padding: 0 12px 16px;
}
.parlay-panel.has-fixed-foot {
padding-bottom: 100px;
}
.panel-head {
background: #141414;
border: 1px solid #2a2a2a;
@@ -231,15 +251,45 @@ function openSlip() {
margin-bottom: 10px;
}
.slip-link {
padding: 6px 12px;
border-radius: 6px;
font-size: 12px;
.parlay-foot-fixed {
position: fixed;
left: 0;
right: 0;
bottom: calc(50px + env(safe-area-inset-bottom, 0px));
z-index: 95;
padding: 10px 12px 10px;
background: rgba(14, 14, 14, 0.98);
border-top: 1px solid var(--border-gold-soft);
box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.45);
}
.slip-count {
margin-left: 4px;
.foot-hint,
.foot-meta {
margin: 0 0 8px;
font-size: 11px;
color: var(--text-muted);
text-align: center;
}
.foot-meta {
color: var(--primary-light);
font-weight: 600;
}
.market-foot-btn {
display: block;
width: 100%;
padding: 9px;
border-radius: 4px;
border: 1px solid var(--border-gold-soft);
background: rgba(212, 175, 55, 0.1);
color: var(--primary-light);
font-size: 13px;
font-weight: 800;
}
.market-foot-btn:disabled {
opacity: 0.45;
}
.toolbar {