feat: 优化大厅下注结果与风险提示展示,重构期号与订单详情样式

This commit is contained in:
2026-05-15 15:31:00 +08:00
parent f2c7f5e4f1
commit a83920aa2a
13 changed files with 1078 additions and 492 deletions

View File

@@ -33,7 +33,7 @@ function WarningsBlock({ warnings }: { warnings: TicketPreviewWarning[] }) {
if (warnings.length === 0) return null;
return (
<Alert className="border-amber-500/40 bg-amber-500/5 text-amber-950 dark:text-amber-100">
<Alert className="border-amber-200 bg-amber-50 text-amber-950">
<AlertTriangleIcon />
<AlertTitle>{t("hall.preview.warningsTitle")}</AlertTitle>
<AlertDescription className="space-y-1">
@@ -70,16 +70,18 @@ export function HallBetPreviewDialog({
return (
<Dialog open={open} onOpenChange={onOpenChange}>
<DialogContent className="max-h-[min(90vh,560px)] gap-0 overflow-hidden p-0 sm:max-w-md">
<DialogContent className="max-h-[min(90vh,560px)] gap-0 overflow-hidden border-[#e8eef7] p-0 shadow-[0_12px_40px_rgba(15,23,42,0.12)] ring-[#e8eef7] sm:max-w-md">
<div className="p-4 pb-2">
<DialogHeader>
<DialogTitle>{t("hall.preview.title")}</DialogTitle>
<DialogDescription>
<DialogTitle className="text-lg font-black text-[#0b3f96]">
{t("hall.preview.title")}
</DialogTitle>
<DialogDescription className="text-xs leading-relaxed text-slate-500">
{t("hall.preview.description")}
</DialogDescription>
</DialogHeader>
{!allowSubmit ? (
<Alert className="mt-3 border-[#ff4d4f]/35 bg-[#ff4d4f]/8 text-[#ff4d4f] dark:bg-[#ff4d4f]/12">
<Alert className="mt-3 border-[#ff4d4f]/35 bg-[#ff4d4f]/8 text-[#ff4d4f]">
<AlertTriangleIcon />
<AlertTitle>{t("hall.preview.sealedTitle")}</AlertTitle>
<AlertDescription className="text-xs leading-relaxed">
@@ -89,42 +91,42 @@ export function HallBetPreviewDialog({
) : null}
</div>
<ScrollArea className="max-h-[min(52vh,360px)] border-y px-4">
<ScrollArea className="max-h-[min(52vh,360px)] border-y border-[#e8eef7] px-4">
<div className="space-y-4 py-3 pr-3">
{!data ? (
<p className="text-sm text-muted-foreground">{t("hall.preview.empty")}</p>
<p className="text-sm text-slate-500">{t("hall.preview.empty")}</p>
) : (
<>
<div className="rounded-lg border bg-muted/30 p-3 text-xs">
<p>
<div className="rounded-xl border border-[#e8eef7] bg-[#f8fbff] p-3 text-xs shadow-[0_4px_14px_rgba(15,23,42,0.04)]">
<p className="text-slate-600">
{t("hall.preview.draw")}{" "}
<span className="font-mono font-semibold">{data.draw.draw_id}</span> ·{" "}
<span className="font-mono font-black text-[#0b3f96]">{data.draw.draw_id}</span> ·{" "}
{t("hall.preview.status")}{" "}
<span className="font-medium">{data.draw.status}</span>
<span className="font-semibold text-[#32518d]">{data.draw.status}</span>
</p>
{summary ? (
<ul className="mt-2 space-y-1 tabular-nums">
<ul className="mt-2 space-y-1 tabular-nums text-slate-700">
<li>
{t("hall.preview.totalBet")}{" "}
<span className="font-medium">
<span className="font-semibold text-[#d81435]">
{formatMinorAsCurrency(summary.total_bet_amount, currencyCode)}
</span>
</li>
<li>
{t("hall.preview.rebateDeduct")}{" "}
<span className="font-medium">
<span className="font-semibold text-emerald-600">
{formatMinorAsCurrency(summary.total_rebate_amount, currencyCode)}
</span>
</li>
<li>
{t("hall.preview.actualDeduct")}{" "}
<span className="font-semibold text-primary">
<span className="font-bold text-[#0b3f96]">
{formatMinorAsCurrency(summary.total_actual_deduct, currencyCode)}
</span>
</li>
<li>
{t("hall.preview.estimatedPayout")}{" "}
<span className="font-medium">
<span className="font-medium text-slate-800">
{formatMinorAsCurrency(summary.total_estimated_payout, currencyCode)}
</span>
</li>
@@ -135,39 +137,41 @@ export function HallBetPreviewDialog({
<WarningsBlock warnings={data.warnings} />
<div className="space-y-2">
<p className="text-xs font-medium text-muted-foreground">
<p className="text-[11px] font-semibold uppercase tracking-wide text-slate-400">
{t("hall.preview.lines")}
</p>
<ul className="space-y-2 text-sm">
{lines.map((ln) => (
<li
key={ln.client_line_no}
className="rounded-md border border-border/80 bg-card px-2 py-2"
className="rounded-xl border border-[#e6edf8] bg-white px-3 py-2 shadow-[0_4px_14px_rgba(15,23,42,0.04)]"
>
<div className="flex flex-wrap items-baseline justify-between gap-2">
<span className="font-mono text-xs text-muted-foreground">
<span className="font-mono text-xs text-slate-400">
#{ln.client_line_no}
</span>
<span className="font-mono font-medium">{ln.play_code}</span>
<span className="font-mono text-sm font-semibold text-[#32518d]">
{ln.play_code}
</span>
</div>
<p className="mt-1 font-mono text-base">{ln.number}</p>
<Separator className="my-2" />
<p className="mt-1 font-mono text-lg font-black text-[#0b3f96]">{ln.number}</p>
<Separator className="my-2 bg-[#e8eef7]" />
<div className="grid grid-cols-2 gap-x-2 gap-y-1 text-xs tabular-nums">
<span className="text-muted-foreground">
<span className="text-slate-500">
{t("hall.preview.normalizedNumber")}
</span>
<span className="text-right font-mono">{ln.normalized_number}</span>
<span className="text-muted-foreground">
<span className="text-slate-500">
{t("hall.preview.combinationCount")}
</span>
<span className="text-right">{ln.combination_count}</span>
<span className="text-muted-foreground">
<span className="text-slate-500">
{t("hall.preview.actual")}
</span>
<span className="text-right">
<span className="text-right font-semibold text-[#0b3f96]">
{formatMinorAsCurrency(ln.actual_deduct_amount, currencyCode)}
</span>
<span className="text-muted-foreground">
<span className="text-slate-500">
{t("hall.preview.estimatedMax")}
</span>
<span className="text-right">
@@ -183,11 +187,22 @@ export function HallBetPreviewDialog({
</div>
</ScrollArea>
<div className="flex flex-col-reverse gap-2 border-t bg-muted/30 p-4 sm:flex-row sm:justify-between">
<Button type="button" variant="outline" onClick={() => onOpenChange(false)} disabled={placing}>
<div className="flex flex-col-reverse gap-2 border-t border-[#e8eef7] bg-[#f8fbff] p-4 sm:flex-row sm:justify-between">
<Button
type="button"
variant="outline"
onClick={() => onOpenChange(false)}
disabled={placing}
className="h-11 rounded-xl border-[#dce7f7] bg-white text-sm font-semibold text-[#07459f] hover:bg-[#f1f6ff]"
>
{t("hall.preview.backEdit")}
</Button>
<Button type="button" onClick={onConfirmPlace} disabled={!data || placing || !allowSubmit}>
<Button
type="button"
onClick={onConfirmPlace}
disabled={!data || placing || !allowSubmit}
className="h-11 rounded-xl border-0 bg-[#e5002c] text-sm font-bold text-white shadow-[0_8px_20px_rgba(229,0,44,0.26)] hover:bg-[#d10028] disabled:bg-slate-300 disabled:shadow-none"
>
{placing
? t("hall.preview.submitting")
: allowSubmit