sync(theme-2): 从 main 同步优胜赛结算态与钱包流水展示优化

- checkout shared/api/admin 自 d3c2114
- player: outright 结算态逻辑、wallet txAmountClass、i18n 新增 key(保留蓝白主题样式)
This commit is contained in:
2026-06-23 13:49:43 +08:00
parent 021d216613
commit 26e2adf786
36 changed files with 577 additions and 127 deletions

View File

@@ -6,6 +6,8 @@ import { formatMoneyCompact, parseAmount } from '../utils/localeDisplay';
interface Transaction {
transactionType: string;
amount: string;
frozenBefore?: string;
frozenAfter?: string;
createdAt: string;
transactionId?: string;
}

View File

@@ -14,6 +14,7 @@ export interface OutrightSelection {
logoUrl?: string | null;
odds: string;
oddsVersion: string;
isWinner?: boolean;
}
export interface OutrightEvent {
@@ -22,6 +23,8 @@ export interface OutrightEvent {
leagueCode?: string;
leagueName: string;
title: string;
status?: string;
bettingOpen?: boolean;
selectionCount?: number;
selections: OutrightSelection[];
}
@@ -47,16 +50,21 @@ const headMeta = computed(() => {
const total = props.event.selectionCount ?? props.event.selections.length;
return t('bet.outright_teams_count', { n: total });
});
const isSettled = computed(() => props.event.bettingOpen === false || props.event.status === 'SETTLED');
</script>
<template>
<section class="event-block">
<button type="button" class="event-head" :class="{ 'is-expanded': expanded }" :aria-expanded="expanded" @click="emit('toggle')">
<button type="button" class="event-head" :class="{ 'is-expanded': expanded, 'is-settled': isSettled }" :aria-expanded="expanded" @click="emit('toggle')">
<span class="toggle-icon" :class="{ open: expanded }">
<span class="toggle-mark">{{ expanded ? '' : '+' }}</span>
</span>
<span class="event-head-text">
<span class="event-title">{{ headTitle }}</span>
<span class="event-title-row">
<span class="event-title">{{ headTitle }}</span>
<span v-if="isSettled" class="event-settled-tag">{{ t('bet.outright_settled') }}</span>
</span>
<span v-if="event.leagueName && event.leagueName !== headTitle" class="event-league">
{{ event.leagueName }}
</span>
@@ -74,6 +82,8 @@ const headMeta = computed(() => {
:team-name="sel.teamName"
:logo-url="sel.logoUrl"
:odds="sel.odds"
:disabled="isSettled"
:is-winner="Boolean(sel.isWinner)"
@pick="emit('pick', sel)"
/>
</div>
@@ -150,6 +160,24 @@ const headMeta = computed(() => {
gap: 2px;
}
.event-title-row {
display: flex;
align-items: center;
gap: 6px;
flex-wrap: wrap;
}
.event-settled-tag {
flex-shrink: 0;
font-size: 10px;
font-weight: 800;
color: #F8971F;
border: 1px solid rgba(248, 151, 31, 0.45);
border-radius: 999px;
padding: 1px 7px;
line-height: 1.4;
}
.event-title {
font-size: 13px;
font-weight: 800;

View File

@@ -7,6 +7,8 @@ const props = defineProps<{
teamName: string;
odds: string;
logoUrl?: string | null;
disabled?: boolean;
isWinner?: boolean;
}>();
const emit = defineEmits<{ pick: [] }>();
@@ -56,7 +58,14 @@ onUnmounted(() => {
</script>
<template>
<button ref="cardRef" type="button" class="option-card" @click="emit('pick')">
<button
ref="cardRef"
type="button"
class="option-card"
:class="{ 'option-card--disabled': disabled, 'option-card--winner': isWinner }"
:disabled="disabled"
@click="emit('pick')"
>
<img
v-if="imgVisible && flag && !flagFailed"
:src="flag"
@@ -93,6 +102,21 @@ onUnmounted(() => {
box-shadow: 0 0 0 1px rgba(0, 61, 107, 0.12);
}
.option-card--disabled {
cursor: default;
opacity: 0.72;
}
.option-card--disabled:active {
border-color: #E5E7EB;
box-shadow: none;
}
.option-card--winner {
border-color: rgba(248, 151, 31, 0.75);
box-shadow: 0 0 0 1px rgba(248, 151, 31, 0.25);
}
.flag {
width: 28px;
height: 19px;

View File

@@ -114,6 +114,7 @@ function toggle(id: string) {
}
function openBet(event: OutrightEvent, sel: OutrightSelection) {
if (event.bettingOpen === false || event.status === 'SETTLED') return;
if (!auth.token) {
goLogin();
return;
@@ -144,6 +145,9 @@ function closeModal() {
<p v-if="eventCount > 1" class="panel-summary">
{{ t('bet.outright_events_summary', { events: eventCount, teams: totalSelections }) }}
</p>
<p v-if="events.some((e) => e.bettingOpen === false || e.status === 'SETTLED')" class="panel-settled-hint">
{{ t('bet.outright_settled_hint') }}
</p>
<div class="event-list">
<OutrightEventSection
@@ -182,6 +186,18 @@ function closeModal() {
line-height: 1.4;
}
.panel-settled-hint {
margin: 0 0 12px;
padding: 8px 10px;
border-radius: 8px;
background: rgba(248, 151, 31, 0.08);
border: 1px solid rgba(248, 151, 31, 0.22);
font-size: 12px;
font-weight: 600;
color: #F8971F;
line-height: 1.45;
}
.event-list {
padding-bottom: 8px;
}