diff --git a/src/features/wallet/wallet-logs-block.tsx b/src/features/wallet/wallet-logs-block.tsx
index 5022c7f..f8d0c3d 100644
--- a/src/features/wallet/wallet-logs-block.tsx
+++ b/src/features/wallet/wallet-logs-block.tsx
@@ -48,7 +48,7 @@ type WalletLogsBlockProps = {
title?: string;
};
-/** 待对账 + 类型筛选 + 列表(供钱包主页与 `/wallet/logs` 共用) */
+/** 类型筛选 + 列表(待对账见顶栏通知铃铛) */
export function WalletLogsBlock({
logs,
logsLoading,
@@ -74,29 +74,6 @@ export function WalletLogsBlock({
return (
<>
- {logs && logs.pending_reconcile.length > 0 ? (
-
{resolvedTitle}
diff --git a/src/features/wallet/wallet-logs-screen.tsx b/src/features/wallet/wallet-logs-screen.tsx
index 441954d..4769870 100644
--- a/src/features/wallet/wallet-logs-screen.tsx
+++ b/src/features/wallet/wallet-logs-screen.tsx
@@ -7,6 +7,7 @@ import { getWalletLogs } from "@/api/wallet";
import { Button } from "@/components/ui/button";
import { PlayerPanel } from "@/components/layout/player-panel";
import { WalletLogsBlock } from "@/features/wallet/wallet-logs-block";
+import { dispatchWalletLogsRefresh } from "@/hooks/use-pending-wallet-reconcile";
import { useActivePlayerCurrency } from "@/hooks/use-active-player-currency";
import { PLAYER_CURRENCY_CHANGE_EVENT } from "@/lib/player-currency-preference";
import { formatWalletClientError } from "@/lib/wallet-api-error";
@@ -49,6 +50,7 @@ export function WalletLogsScreen() {
? { ...nextLogs, items: [...current.items, ...nextLogs.items] }
: nextLogs,
);
+ dispatchWalletLogsRefresh(nextLogs.pending_reconcile ?? []);
} catch (e) {
setError(formatWalletClientError(e, t));
if (!append) {
diff --git a/src/features/wallet/wallet-screen.tsx b/src/features/wallet/wallet-screen.tsx
index c4d573a..1ffd16a 100644
--- a/src/features/wallet/wallet-screen.tsx
+++ b/src/features/wallet/wallet-screen.tsx
@@ -14,6 +14,7 @@ import {
TransferOutDialog,
} from "@/features/wallet/wallet-transfer-dialogs";
import { WalletLogsBlock } from "@/features/wallet/wallet-logs-block";
+import { dispatchWalletLogsRefresh } from "@/hooks/use-pending-wallet-reconcile";
import { useActivePlayerCurrency } from "@/hooks/use-active-player-currency";
import { formatMinorAsCurrency } from "@/lib/money";
import { PLAYER_CURRENCY_CHANGE_EVENT } from "@/lib/player-currency-preference";
@@ -49,6 +50,7 @@ export function WalletScreen() {
? { ...nextLogs, items: [...current.items, ...nextLogs.items] }
: nextLogs,
);
+ dispatchWalletLogsRefresh(nextLogs.pending_reconcile ?? []);
return nextLogs;
}, [currency, filter]);
diff --git a/src/hooks/use-pending-wallet-reconcile.ts b/src/hooks/use-pending-wallet-reconcile.ts
new file mode 100644
index 0000000..6a2016a
--- /dev/null
+++ b/src/hooks/use-pending-wallet-reconcile.ts
@@ -0,0 +1,72 @@
+"use client";
+
+import { useCallback, useEffect, useState } from "react";
+
+import { getWalletLogs } from "@/api/wallet";
+import { usePlayerSessionStore } from "@/stores/player-session-store";
+import type { WalletPendingTransfer } from "@/types/api/wallet-logs";
+
+export const WALLET_LOGS_REFRESH_EVENT = "lottery:wallet-logs-refreshed";
+
+type WalletLogsRefreshDetail = {
+ pending?: WalletPendingTransfer[];
+};
+
+export function usePendingWalletReconcile(): {
+ pending: WalletPendingTransfer[];
+ hasPending: boolean;
+ loading: boolean;
+ refresh: () => Promise;
+} {
+ const bearerToken = usePlayerSessionStore((s) => s.bearerToken);
+ const [pending, setPending] = useState([]);
+ const [loading, setLoading] = useState(false);
+
+ const refresh = useCallback(async (): Promise => {
+ if (!bearerToken?.trim()) {
+ setPending([]);
+ return;
+ }
+ setLoading(true);
+ try {
+ const data = await getWalletLogs({ page: 1, size: 1 });
+ setPending(data.pending_reconcile ?? []);
+ } catch {
+ setPending([]);
+ } finally {
+ setLoading(false);
+ }
+ }, [bearerToken]);
+
+ useEffect(() => {
+ void refresh();
+
+ function onWalletLogsRefreshed(event: Event): void {
+ const detail = (event as CustomEvent).detail;
+ if (Array.isArray(detail?.pending)) {
+ setPending(detail.pending);
+ return;
+ }
+ void refresh();
+ }
+
+ window.addEventListener(WALLET_LOGS_REFRESH_EVENT, onWalletLogsRefreshed);
+ return () => window.removeEventListener(WALLET_LOGS_REFRESH_EVENT, onWalletLogsRefreshed);
+ }, [refresh]);
+
+ return {
+ pending,
+ hasPending: pending.length > 0,
+ loading,
+ refresh,
+ };
+}
+
+export function dispatchWalletLogsRefresh(pending: WalletPendingTransfer[]): void {
+ if (typeof window === "undefined") return;
+ window.dispatchEvent(
+ new CustomEvent(WALLET_LOGS_REFRESH_EVENT, {
+ detail: { pending },
+ }),
+ );
+}
diff --git a/src/i18n/locales/en/player.json b/src/i18n/locales/en/player.json
index a59b81f..a864b64 100644
--- a/src/i18n/locales/en/player.json
+++ b/src/i18n/locales/en/player.json
@@ -26,6 +26,9 @@
"rules": "Rules",
"wallet": "Wallet"
},
+ "notifications": {
+ "empty": "No notifications"
+ },
"panel": {
"home": "Home"
},
@@ -367,6 +370,7 @@
"flowsTitle": "Wallet logs",
"totalRecords": "{{total}} records",
"emptyLogs": "No wallet logs",
+ "noMoreLogs": "No more transactions",
"balanceAfter": "Balance after",
"wsBalanceUpdated": "Balance {{change}} ({{reason}})",
"wsReason": {
diff --git a/src/i18n/locales/ne/player.json b/src/i18n/locales/ne/player.json
index a5c4ca9..67d1c28 100644
--- a/src/i18n/locales/ne/player.json
+++ b/src/i18n/locales/ne/player.json
@@ -26,6 +26,9 @@
"rules": "नियम",
"wallet": "वालेट"
},
+ "notifications": {
+ "empty": "कुनै सूचना छैन"
+ },
"panel": {
"home": "गृह"
},
@@ -367,6 +370,7 @@
"flowsTitle": "वालेट लग",
"totalRecords": "{{total}} रेकर्ड",
"emptyLogs": "वालेट लग छैन",
+ "noMoreLogs": "थप लेनदेन छैन",
"balanceAfter": "पछि बाँकी ब्यालेन्स",
"wsBalanceUpdated": "ब्यालेन्स {{change}} ({{reason}})",
"wsReason": {
diff --git a/src/i18n/locales/zh/entry.json b/src/i18n/locales/zh/entry.json
index 5785000..1ff8efd 100644
--- a/src/i18n/locales/zh/entry.json
+++ b/src/i18n/locales/zh/entry.json
@@ -29,7 +29,7 @@
"retryProgress": "正在重试({{current}}/{{total}})…"
},
"failure": {
- "title": "授权失败111",
+ "title": "授权失败",
"subtitle": "无法完成授权,请重试。",
"detailsTitle": "失败详情",
"table": {
diff --git a/src/i18n/locales/zh/player.json b/src/i18n/locales/zh/player.json
index d44adfb..dba619f 100644
--- a/src/i18n/locales/zh/player.json
+++ b/src/i18n/locales/zh/player.json
@@ -26,6 +26,9 @@
"rules": "规则",
"wallet": "钱包"
},
+ "notifications": {
+ "empty": "暂无通知"
+ },
"panel": {
"home": "首页"
},
@@ -368,6 +371,7 @@
"flowsTitle": "资金流水",
"totalRecords": "共 {{total}} 条记录",
"emptyLogs": "暂无流水",
+ "noMoreLogs": "没有更多流水",
"balanceAfter": "变更后余额",
"wsBalanceUpdated": "余额 {{change}}({{reason}})",
"wsReason": {