活动:修复限时排行榜
This commit is contained in:
@@ -61,7 +61,6 @@ export abstract class ActivityBase {
|
||||
this.endTime = moment(activityData.endTime).add(this.delayDay, 'd').valueOf();
|
||||
this.todayIndex = deltaDays(moment(this.beginTime).toDate(), new Date) + 1;
|
||||
this.roundIndex = 1;
|
||||
this.nextRefreshTime = this.endTime;
|
||||
this.name = activityData.name;
|
||||
this.isEnable = activityData.isEnable;
|
||||
this.interval = activityData.interval * 86400;
|
||||
@@ -102,6 +101,8 @@ export abstract class ActivityBase {
|
||||
this.roundIndex = Math.ceil((moment(new Date).valueOf() - this.beginTime) / (activityData.interval * 86400000));
|
||||
this.nextRefreshTime = moment(this.beginTime).add(activityData.interval * (this.roundIndex - 1), 'day').add(activityData.effectDay, 'd').valueOf();
|
||||
this.todayIndex = Math.ceil(((moment(new Date).valueOf() - this.beginTime) / (24 * 60 * 60 * 1000)));
|
||||
} else {
|
||||
this.nextRefreshTime = this.endTime;
|
||||
}
|
||||
if(activityData.hideDayByServer > 0) {
|
||||
let hidOverTime = moment(serverTime * 1000).add(activityData.hideDayByServer, 'd').startOf('d').add(REFRESH_TIME, 'h').valueOf();
|
||||
|
||||
@@ -49,8 +49,8 @@ export class TimeLimitRankData extends ActivityBase {
|
||||
public getRewardByRank(rank: number) {
|
||||
let result: TimeLimitRankReward;
|
||||
for(let reward of this.rankRewards) {
|
||||
if(reward.rank > rank) break;
|
||||
result = reward;
|
||||
if(reward.rank >= rank) break;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -68,8 +68,8 @@ export class TimeLimitRankData extends ActivityBase {
|
||||
let dataObj: TimeLimitInDb = JSON.parse(data);
|
||||
this.rankType = dataObj.rankType;
|
||||
this.hid = dataObj.hid;
|
||||
this.rankEndTime = new Date(moment(this.beginTime).add(dataObj.rankEndDay, 'd').format(`YYYY-MM-DD ${dataObj.rankEndTime}`)).getTime() ;
|
||||
this.sendMailTime = this.rankEndTime + this.sendMailTime * 1000;
|
||||
this.rankEndTime = new Date(moment(this.beginTime).add(dataObj.rankEndDay - 1, 'd').format(`YYYY-MM-DD ${dataObj.rankEndTime}`)).getTime() ;
|
||||
this.sendMailTime = this.rankEndTime + dataObj.sendMailTime * 1000;
|
||||
for(let rank of dataObj.rankRewards) {
|
||||
this.rankRewards.push(new TimeLimitRankReward(rank));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user