From 7cbc029c0779750f307470afb206f14dabeaf82c Mon Sep 17 00:00:00 2001 From: TJH Date: Wed, 10 Jun 2026 16:43:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86=E7=82=B9=E5=87=BB=E4=BD=99=E9=A2=9D?= =?UTF-8?q?=E5=92=8C=E7=82=B9=E5=87=BB=E6=8F=90=E7=A4=BA=E7=A1=AE=E8=AE=A4?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E7=9A=84=E4=BA=8B=E4=BB=B6=E5=88=86=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/Game/Scripts/SlotBar.ts | 17 +++++++++++++++-- assets/Game/Scripts/SlotScene.ts | 2 +- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/assets/Game/Scripts/SlotBar.ts b/assets/Game/Scripts/SlotBar.ts index 02b54a7..c216f3d 100644 --- a/assets/Game/Scripts/SlotBar.ts +++ b/assets/Game/Scripts/SlotBar.ts @@ -542,9 +542,10 @@ export class SlotBar extends Component { } private isGetBalance: boolean = false; - async onClickBalance(isConfirm = false): Promise { - let delay = isConfirm ? 0 : 1 + async onClickBalance(): Promise { if (this.isGetBalance) return + + let delay = 0.5 this.isGetBalance = true; try { let balacneData = await callGameBalanceApi({ GameId: getGameId() }); @@ -561,6 +562,18 @@ export class SlotBar extends Component { } } + async onConfirmErr2(): Promise { + try { + let balacneData = await callGameBalanceApi({ GameId: getGameId() }); + this.setBalance(balacneData.Balance) + return balacneData.Balance; + } catch (err) { + console.log('获取余额失败') + return null; + } finally { + this.isGetBalance = false; + } + } setLeftAutoCount(count: number) { let num = this.getBtnNode(Btn_Key.StopAutoSpinBtn) diff --git a/assets/Game/Scripts/SlotScene.ts b/assets/Game/Scripts/SlotScene.ts index ebc55a5..1abaeb8 100644 --- a/assets/Game/Scripts/SlotScene.ts +++ b/assets/Game/Scripts/SlotScene.ts @@ -222,7 +222,7 @@ export class SlotScene extends Component { if (this.slotBar.getBalance() < (buyType == 1 ? this.slotBar.getBet() * this.gameInfo.BuyMul : (this.isDoubleWin ? this.slotBar.getdisplayBet() : this.slotBar.getBet())) && !this.isFreeSpin && !this.spinInfo.Frb.Ongoing) { //余额不足不经过服务器,在客户端拦截 - this.showErrorTip(2, "", () => { this.slotBar.onClickBalance(true) }); + this.showErrorTip(2, "", () => { this.slotBar.onConfirmErr2() }); this.handleErrSpin(); return }