feat: 优化下注结果展示与大厅表单交互,适配新端口配置
This commit is contained in:
@@ -31,9 +31,10 @@ export function HallBetResultDialog({
|
||||
}: HallBetResultDialogProps) {
|
||||
const { t } = useTranslation("player");
|
||||
|
||||
const totalItems = data?.items.length ?? 0;
|
||||
const totalSuccess = totalItems;
|
||||
const totalFailure = 0;
|
||||
const successItems = data?.items.filter((item) => (item.status ?? "success") === "success") ?? [];
|
||||
const failedItems = data?.items.filter((item) => item.status === "failed") ?? [];
|
||||
const totalSuccess = data?.summary.success_count ?? successItems.length;
|
||||
const totalFailure = data?.summary.failure_count ?? failedItems.length;
|
||||
|
||||
return (
|
||||
<Dialog open={open} onOpenChange={onOpenChange}>
|
||||
@@ -131,7 +132,7 @@ export function HallBetResultDialog({
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{data.items.map((item, index) => (
|
||||
{successItems.map((item, index) => (
|
||||
<tr
|
||||
key={`${item.ticket_no}-${index}`}
|
||||
className="border-t border-[#e8eef7] bg-white"
|
||||
@@ -162,7 +163,27 @@ export function HallBetResultDialog({
|
||||
<div className="rounded-lg border border-emerald-100 bg-emerald-50 px-3 py-3 text-sm font-semibold text-emerald-700">
|
||||
{t("hall.result.noFailures", { defaultValue: "本次提交没有失败注项。" })}
|
||||
</div>
|
||||
) : null}
|
||||
) : (
|
||||
<div className="space-y-2 rounded-lg border border-rose-100 bg-rose-50 px-3 py-3">
|
||||
<p className="text-sm font-black text-[#e5002c]">
|
||||
{t("hall.result.failedItems", { defaultValue: "失败注项明细" })}
|
||||
</p>
|
||||
{failedItems.map((item, index) => (
|
||||
<div
|
||||
key={`${item.ticket_no}-${index}`}
|
||||
className="flex items-center justify-between gap-3 rounded-md bg-white px-3 py-2 text-xs"
|
||||
>
|
||||
<span className="min-w-0 truncate font-semibold text-slate-700">
|
||||
<span className="font-mono font-black text-slate-950">{item.number}</span>{" "}
|
||||
{playLabel(item.play_code, t)}
|
||||
</span>
|
||||
<span className="shrink-0 font-bold text-[#e5002c]">
|
||||
{item.fail_reason_text ?? item.fail_reason_code ?? t("hall.result.failed", { defaultValue: "失败" })}
|
||||
</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user