修复跑马 不能正常显示赢后的奖励金额
This commit is contained in:
@@ -552,8 +552,12 @@
|
||||
// 判断本人是否中奖
|
||||
if (this.myBet && this.myBetHorseId === data.winner_horse_id) {
|
||||
this.myWon = true;
|
||||
// 赔付前端显示估算(实际以后端为准,后端 WebSocket 无返回赔付金额)
|
||||
this.myPayout = 0; // 无法前端计算,等用户看下一次余额或后端私信
|
||||
// 结算广播已携带冠军注池与可派奖池,这里按后端同公式还原个人赔付展示值。
|
||||
const winnerPool = Number(data.winner_pool || 0);
|
||||
const distributablePool = Number(data.distributable_pool || 0);
|
||||
this.myPayout = winnerPool > 0
|
||||
? Math.round(distributablePool * (Number(this.myBetAmount || 0) / winnerPool))
|
||||
: 0;
|
||||
} else {
|
||||
this.myWon = false;
|
||||
this.myPayout = 0;
|
||||
|
||||
Reference in New Issue
Block a user