feat: 增强开奖 API 的币种支持并优化钱包处理逻辑

更新 getDrawCurrent、getDrawResults 与 getDrawResultByNo 方法,新增币种参数支持,以适配玩家币种偏好。
优化 HallBettingGrid 及相关组件:支持币种切换时自动刷新钱包数据。
重构钱包处理逻辑,简化余额更新流程并提升用户体验。
新增会话过期相关多语言提示文案,并优化现有翻译内容,提升多语言环境下的提示清晰度。
This commit is contained in:
2026-05-27 16:52:12 +08:00
parent adae4a0be1
commit 58afa8e844
34 changed files with 373 additions and 379 deletions

View File

@@ -60,6 +60,11 @@ export function TransferInScreen() {
<TransferInPage
currency={currency}
lotteryMinor={Number(balance?.balance ?? 0)}
mainMinor={
balance?.main_balance === null || balance?.main_balance === undefined
? null
: Number(balance.main_balance)
}
onSuccess={onSuccess}
/>
);

View File

@@ -192,6 +192,11 @@ export function WalletScreen() {
idPrefix="wallet-"
currency={currency}
lotteryMinor={Number(balance?.balance ?? 0)}
mainMinor={
balance?.main_balance === null || balance?.main_balance === undefined
? null
: Number(balance.main_balance)
}
onSuccess={refreshAll}
triggerVariant="hall"
triggerLabel={t("wallet.transferIn", { defaultValue: "Transfer In" })}

View File

@@ -28,6 +28,7 @@ type BaseProps = {
export function TransferInDialog({
currency,
lotteryMinor,
mainMinor = null,
onSuccess,
idPrefix = "",
triggerClassName,
@@ -35,6 +36,7 @@ export function TransferInDialog({
triggerLabel,
}: BaseProps & {
lotteryMinor: number;
mainMinor?: number | null;
triggerClassName?: string;
triggerVariant?: "wallet" | "hall";
triggerLabel?: string;
@@ -70,6 +72,7 @@ export function TransferInDialog({
variant="dialog"
currency={currency}
lotteryMinor={lotteryMinor}
mainMinor={mainMinor}
idPrefix={idPrefix}
onCancel={() => setOpen(false)}
onSuccess={async () => {

View File

@@ -135,12 +135,14 @@ function TransferDialogFooter({
export function TransferInPanel({
currency,
lotteryMinor,
mainMinor = null,
onSuccess,
idPrefix = "",
onCancel,
variant = "dialog",
}: PanelBase & {
lotteryMinor: number;
mainMinor?: number | null;
onCancel: () => void;
variant?: PanelVariant;
}) {
@@ -226,7 +228,11 @@ export function TransferInPanel({
<TransferInfoBlock>
<p className="text-muted-foreground">
{t("wallet.mainBalance")}{" "}
<span className="font-medium text-foreground">{t("wallet.mainPending")}</span>
<span className="font-medium tabular-nums text-foreground">
{mainMinor != null
? formatMinorAsCurrency(mainMinor, currency)
: t("wallet.mainPending")}
</span>
</p>
<p className="mt-2 text-muted-foreground">
{t("wallet.lotteryBalance")}{" "}
@@ -413,8 +419,9 @@ export function TransferOutPanel({
export function TransferInPage({
currency,
lotteryMinor,
mainMinor = null,
onSuccess,
}: PanelBase & { lotteryMinor: number }) {
}: PanelBase & { lotteryMinor: number; mainMinor?: number | null }) {
const { t } = useTranslation("player");
return (
@@ -433,6 +440,7 @@ export function TransferInPage({
variant="page"
currency={currency}
lotteryMinor={lotteryMinor}
mainMinor={mainMinor}
idPrefix="page-"
onSuccess={onSuccess}
onCancel={() => {}}