余额刷新添加点击限制

This commit is contained in:
TJH 2026-06-10 09:55:51 +08:00
parent 0ebfe00e4b
commit c666eb3228

View File

@ -407,11 +407,24 @@ export class SlotBar extends Component {
this.setBet(this.betGrade[this.betIndex]); this.setBet(this.betGrade[this.betIndex]);
} }
async onClickBalance() { private isGetBalance: boolean = false;
let balacneData = await callGameBalanceApi({ GameId: getGameId() }); async onClickBalance(): Promise<number | null> {
this.setBalance(balacneData.Balance) 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)
}
}
private currentTipTween: Tween<Node> = null; private currentTipTween: Tween<Node> = null;
private hideTimer: number = null; private hideTimer: number = null;