diff --git a/.env.example b/.env.example index cbd6815..ac06a8a 100644 --- a/.env.example +++ b/.env.example @@ -11,7 +11,7 @@ LOTTERY_API_UPSTREAM=http://127.0.0.1:8000 # 线上 # LOTTERY_API_UPSTREAM=http://127.0.0.1:8000 -# LOTTERY_API_UPSTREAM=https://lotterylaravel.tanumo.com +# LOTTERY_API_UPSTREAM=https://lottery-api.cjdhr.top # Next 开发:局域网 IP 访问(逗号分隔 host,无协议) # ALLOWED_DEV_ORIGINS=192.168.0.101 diff --git a/src/api/play.ts b/src/api/play.ts index a43db48..a1234c1 100644 --- a/src/api/play.ts +++ b/src/api/play.ts @@ -4,6 +4,8 @@ import type { PlayEffectivePayload } from "@/types/api/play-effective"; export type GetPlayEffectiveParams = { /** 不传则后端取首个可下注币种(通常为 NPR) */ currency?: string; + /** 按开注商返回覆盖后的赔率;未传则返回通用赔率 */ + provider_code?: string; }; /** @@ -17,8 +19,13 @@ export function getPlayEffective( `/play/effective`, { params: - params?.currency !== undefined && params.currency !== "" - ? { currency: params.currency } + params + ? { + ...(params.currency !== undefined && params.currency !== "" ? { currency: params.currency } : {}), + ...(params.provider_code !== undefined && params.provider_code !== "" + ? { provider_code: params.provider_code } + : {}), + } : undefined, }, ); diff --git a/src/features/hall/hall-bet-preview-dialog.tsx b/src/features/hall/hall-bet-preview-dialog.tsx index 580c2ff..35cffa4 100644 --- a/src/features/hall/hall-bet-preview-dialog.tsx +++ b/src/features/hall/hall-bet-preview-dialog.tsx @@ -23,7 +23,7 @@ import { } from "@/components/ui/dialog"; import { formatMinorAsCurrency } from "@/lib/money"; import { playLabel } from "@/lib/play-labels"; -import type { TicketPreviewData, TicketPreviewWarning } from "@/types/api/ticket"; +import type { TicketPreviewData, TicketPreviewLine, TicketPreviewWarning } from "@/types/api/ticket"; type HallBetPreviewDialogProps = { open: boolean; @@ -65,6 +65,16 @@ function providerLabel(providerName?: string | null, providerCode?: string | nul return providerName || providerCode || "-"; } +function previewLineKey(line: TicketPreviewLine, index: number): string { + return [ + line.client_line_no, + line.provider_code ?? "provider", + line.play_code, + line.number, + index, + ].join(":"); +} + function SubmittingPanel() { const { t } = useTranslation("player"); @@ -221,7 +231,7 @@ export function HallBetPreviewDialog({ {t("orders.play")}