From 9b051cb0971d1f9f173a1c62d65d05e8ac916200 Mon Sep 17 00:00:00 2001 From: TJH Date: Wed, 10 Jun 2026 09:56:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=99=E9=A2=9D=E5=88=B7=E6=96=B0=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E7=82=B9=E5=87=BB=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/Game/Scripts/SlotBar.ts | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/assets/Game/Scripts/SlotBar.ts b/assets/Game/Scripts/SlotBar.ts index 3ee289c..7c8c6ec 100644 --- a/assets/Game/Scripts/SlotBar.ts +++ b/assets/Game/Scripts/SlotBar.ts @@ -541,11 +541,26 @@ export class SlotBar extends Component { }); } - async onClickBalance() { - let balacneData = await callGameBalanceApi({ GameId: getGameId() }); - this.setBalance(balacneData.Balance) + private isGetBalance: boolean = false; + async onClickBalance(): Promise { + if (this.isGetBalance) return + this.isGetBalance = true; + try { + let balacneData = await callGameBalanceApi({ GameId: getGameId() }); + this.setBalance(balacneData.Balance) + return balacneData.Balance; + } catch (err) { + console.log('获取余额失败') + return null; + } finally { + this.scheduleOnce(() => { + this.isGetBalance = false; + }, 1) + + } } + setLeftAutoCount(count: number) { let num = this.getBtnNode(Btn_Key.StopAutoSpinBtn) .getChildByName("num")