diff --git a/.gitignore b/.gitignore index fc6edee..6d820e3 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,8 @@ # testing /coverage +/.playwright-cli/ +/output/ # next.js /.next/ diff --git a/src/features/hall/hall-bet-rules.ts b/src/features/hall/hall-bet-rules.ts index a5e991f..a6087e4 100644 --- a/src/features/hall/hall-bet-rules.ts +++ b/src/features/hall/hall-bet-rules.ts @@ -56,7 +56,11 @@ export function isValidRollNumber(value: string): boolean { ); } -export type DraftLineIssueReason = "invalid_number_length" | "roll_requires_r" | "missing_digit_slot"; +export type DraftLineIssueReason = + | "invalid_number_length" + | "roll_requires_r" + | "missing_digit_slot" + | "full_cover_amount_not_divisible"; /** * 某玩法列已填金额但无法组成合法注单行时返回原因;合法则返回 null。 diff --git a/src/features/hall/hall-betting-grid.tsx b/src/features/hall/hall-betting-grid.tsx index 820c444..6c0d41f 100644 --- a/src/features/hall/hall-betting-grid.tsx +++ b/src/features/hall/hall-betting-grid.tsx @@ -1,9 +1,10 @@ "use client"; -import { ChevronDown, ChevronUp, Lock, Ticket, Trash2, Star } from "lucide-react"; +import { ChevronDown, ChevronUp, CircleHelp, Lock, Ticket, Trash2, Star } from "lucide-react"; import { useCallback, useEffect, useMemo, useRef, useState, memo } from "react"; import { useTranslation } from "react-i18next"; import { toast } from "sonner"; +import { Tooltip } from "@base-ui/react/tooltip"; import { getBetProviders } from "@/api/bet-providers"; import { getPlayEffective } from "@/api/play"; @@ -34,6 +35,7 @@ import { type DraftLineIssueReason, } from "@/features/hall/hall-bet-rules"; import { + isFullCoverAmountDivisible, isHighCostSelectionType, resolveSelectionTotalBet, selectionCombinationCount, @@ -1111,6 +1113,18 @@ export function HallBettingGrid({ drawLive }: { drawLive: HallDrawLiveSnapshot } playCode: column.play.play_code, reason, }); + return; + } + const comboCount = selectionCombinationCount(row.number, row.selectionType); + if ( + row.selectionType === "full_cover" + && !isFullCoverAmountDivisible(amount, comboCount) + ) { + issues.push({ + rowNo: rowIndex + 1, + playCode: column.play.play_code, + reason: "full_cover_amount_not_divisible", + }); } }); }); @@ -2257,7 +2271,7 @@ export function HallBettingGrid({ drawLive }: { drawLive: HallDrawLiveSnapshot } ) : null} ) : null} - +