余额刷新添加点击限制

This commit is contained in:
TJH 2026-06-10 09:55:32 +08:00
parent 897f305ae3
commit d604ecde60

View File

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