新武将活动:修改字段以及ur武将处理

This commit is contained in:
luying
2022-10-12 10:35:14 +08:00
parent eccd9f0051
commit 9f5771e923
16 changed files with 79 additions and 69 deletions
@@ -6,12 +6,10 @@ import { ActivityBase } from './activityField';
/******* 存在数据库里的数据 *******/
interface NewHeroGkWarInDb {
warId: number; // 关卡id
icon: string; // 图标文件名
startDay: number; // 活动第几天开启
}
interface NewHeroGkDataInDb {
bg: string; // 背景图
wars: NewHeroGkWarInDb[]; // 关卡
}
@@ -19,13 +17,11 @@ interface NewHeroGkDataInDb {
// 每日关卡活动数据
export class NewHeroGachaWar {
warId: number; // 关卡id
icon: string; // 图标文件名
startTime: number; // 活动第几天开启,13位时间戳
isSuccess: boolean = false; // 是否成功
constructor(data: NewHeroGkWarInDb, beginTime: number) {
this.warId = data.warId;
this.icon = data.icon;
this.startTime = <number>getTimeFunM(beginTime).getAfterDayWithHour(data.startDay - 1);
}
@@ -35,7 +31,6 @@ export class NewHeroGachaWar {
}
export class NewHeroGKData extends ActivityBase {
bg: string; // 背景图
wars: NewHeroGachaWar[] = []; // 关卡
constructor(activityData: ActivityModelType, createTime: number, serverTime: number) {
@@ -45,7 +40,6 @@ export class NewHeroGKData extends ActivityBase {
public initData(data: string) {
let dataObj: NewHeroGkDataInDb = JSON.parse(data);
this.bg = dataObj.bg;
let arr = dataObj.wars||[];
for (let obj of arr) {
this.wars.push(new NewHeroGachaWar(obj, this.beginTime))