余额刷新添加点击限制
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 1m16s
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 1m16s
This commit is contained in:
parent
897f305ae3
commit
09f7990e6d
@ -422,9 +422,23 @@ 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)
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user