活动:修改计算公式

This commit is contained in:
qiaoxin
2021-06-30 21:15:12 +08:00
parent 1c330fea03
commit 5d7b55fa2a
2 changed files with 7 additions and 2 deletions

View File

@@ -68,7 +68,7 @@ export abstract class ActivityBase {
if (activityData.interval > 0) {
this.roundIndex = Math.ceil((moment(new Date).valueOf() - this.beginTime) / (activityData.interval * 1000));
this.nextRefreshTime = moment(this.beginTime).add(activityData.interval * this.roundIndex, 'second').valueOf();
this.todayIndex = Math.ceil(((moment(new Date).valueOf() - this.beginTime) % (activityData.interval * 1000)) / (24 * 60 * 60 * 1000));
this.todayIndex = Math.ceil(((moment(new Date).valueOf() - this.beginTime) / (24 * 60 * 60 * 1000)));
}
console.log('活动时间数据...', '活动id:', activityData.activityId, '类型:', activityData.timeType, '开始时间:', this.beginTime, moment(this.beginTime).toDate(),
'结束:', this.endTime, moment(this.endTime).toDate(),