活动:修复糜家商队
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
import moment = require('moment');
|
||||
import { SERVER_OPEN_TIME } from '../../consts';
|
||||
import { ActivityModelType } from '../../db/Activity';
|
||||
import { ActivitySelfServiceShopModelType } from '../../db/ActivitySelfServiceShop';
|
||||
import { deltaDays } from '../../pubUtils/util';
|
||||
import { ActivityBase } from './activityField';
|
||||
|
||||
// 自助商店数据坑位数据
|
||||
@@ -53,7 +50,6 @@ export class SelfServiceShopItem {
|
||||
// 自选商店
|
||||
export class SelfServiceShopData extends ActivityBase {
|
||||
list: Array<SelfServiceShopItem> = [];//货架
|
||||
days: number = 20;//刷新周期天数
|
||||
name: string = '';
|
||||
count: number = 1;//每天可挑战次数胜利,才会统计
|
||||
warid: string = '';//可挑战关卡
|
||||
@@ -63,7 +59,6 @@ export class SelfServiceShopData extends ActivityBase {
|
||||
|
||||
challengeCount: number = 0;//挑战次数
|
||||
unitBuyCount: number = 0;//元宝购买代币次数
|
||||
roundIndex: number = 0; //第几周期 从1开始
|
||||
|
||||
public getItemByProductID(productID: string): SelfServiceShopItem {
|
||||
let listIndex = this.list.findIndex(obj => { return obj.productID == productID });
|
||||
@@ -86,7 +81,6 @@ export class SelfServiceShopData extends ActivityBase {
|
||||
|
||||
public initData(data: string) {
|
||||
let dataObj = JSON.parse(data);
|
||||
this.days = dataObj.days;
|
||||
this.name = dataObj.name;
|
||||
this.count = dataObj.count;
|
||||
this.warid = dataObj.warid;
|
||||
@@ -99,9 +93,6 @@ export class SelfServiceShopData extends ActivityBase {
|
||||
for (let obj of arr) {
|
||||
this.list.push(new SelfServiceShopItem(obj))
|
||||
}
|
||||
this.todayIndex = deltaDays(moment(SERVER_OPEN_TIME).startOf('d').toDate(), new Date) + 1;
|
||||
|
||||
this.roundIndex = Math.ceil(this.todayIndex / this.days);
|
||||
}
|
||||
|
||||
constructor(activityData: ActivityModelType, createTime: number, serverTime: number) {
|
||||
|
||||
Reference in New Issue
Block a user