一秒内点击confirm,后续点击不会调用的bug
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 1m18s

This commit is contained in:
TJH 2026-06-10 16:16:10 +08:00
parent c13b703633
commit ac146bba38
2 changed files with 4 additions and 3 deletions

View File

@ -542,7 +542,8 @@ export class SlotBar extends Component {
} }
private isGetBalance: boolean = false; private isGetBalance: boolean = false;
async onClickBalance(): Promise<number | null> { async onClickBalance(isConfirm = false): Promise<number | null> {
let delay = isConfirm ? 0 : 1
if (this.isGetBalance) return if (this.isGetBalance) return
this.isGetBalance = true; this.isGetBalance = true;
try { try {
@ -555,7 +556,7 @@ export class SlotBar extends Component {
} finally { } finally {
this.scheduleOnce(() => { this.scheduleOnce(() => {
this.isGetBalance = false; this.isGetBalance = false;
}, 1) }, delay)
} }
} }

View File

@ -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) { 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() }); this.showErrorTip(2, "", () => { this.slotBar.onClickBalance(true) });
this.handleErrSpin(); this.handleErrSpin();
return return
} }