feat(活动): 新将擢迁保底显示

This commit is contained in:
luying
2023-06-20 19:51:54 +08:00
parent fac1b923a7
commit f3e82af5c9
4 changed files with 38 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
import { ActivityModelType } from '../../db/Activity';
import { UserGachaType } from '../../db/UserGacha';
import { DicGacha } from '../../pubUtils/dictionary/DicGacha';
import { getGachaRemainFloor } from '../../pubUtils/util';
import { ActivityBase } from './activityField';
interface NewHeroGachaItemInDb {
@@ -29,6 +30,7 @@ export class NewHeroGachaData extends ActivityBase {
pickHero: number = 0;
count: number = 0;
isFree: boolean = false; // 免费次数
remainFloor: number = 0;
constructor(activityData: ActivityModelType, createTime: number, serverTime: number) {
super(activityData, createTime, serverTime)
@@ -59,6 +61,7 @@ export class NewHeroGachaData extends ActivityBase {
this.pickHero = data.pickHero;
this.count = data.count;
this.isFree = data.freeCount < dic?.free.count;
this.remainFloor = getGachaRemainFloor(data.gachaId, data.floor||[])
}
}