活动:修复每日特惠礼包

This commit is contained in:
luying
2022-01-20 12:08:10 +08:00
parent c813762bf9
commit cd18ac4327
10 changed files with 37 additions and 36 deletions

View File

@@ -32,8 +32,8 @@ export abstract class ActivityBase {
this.nextRefreshTime = this.endTime;
this.type = activityData.type;
// console.log('今天是活动第几天', activityData.beginTime, new Date, this.todayIndex)
// console.log('***** activityData', activityData.timeType)
console.log('今天是活动第几天', activityData.beginTime, new Date, this.todayIndex)
console.log('***** activityData', activityData.timeType)
switch (activityData.timeType) {
case ACTIVITY_TIME_TYPE.SERVER_OPEN_TIME: {
this.beginTime = moment(SERVER_OPEN_TIME).add(this.delayDay, 'd').startOf('d').add(REFRESH_TIME, 'h').valueOf();
@@ -43,7 +43,7 @@ export abstract class ActivityBase {
this.endTime = moment(this.beginTime).add(1, 'd').valueOf();
}
this.todayIndex = deltaDays(moment(this.beginTime).toDate(), new Date) + 1;
// console.log('活动时间数据11...', activityData.timeType, this.beginTime, this.endTime, this.todayIndex, this.roundIndex, this.nextRefreshTime)
console.log('活动时间数据11...', activityData.timeType, this.beginTime, this.endTime, this.todayIndex, this.roundIndex, this.nextRefreshTime)
break;
}
case ACTIVITY_TIME_TYPE.ROLE_REGISTER_TIME: {
@@ -55,11 +55,11 @@ export abstract class ActivityBase {
}
this.todayIndex = deltaDays(moment(this.beginTime).toDate(), new Date) + 1;
// console.log('活动时间数据22...', activityData.timeType, this.beginTime, this.endTime, this.todayIndex, this.roundIndex, this.nextRefreshTime)
console.log('活动时间数据22...', activityData.timeType, this.beginTime, this.endTime, this.todayIndex, this.roundIndex, this.nextRefreshTime)
break;
}
case ACTIVITY_TIME_TYPE.DATE_TIME: {
// console.log('活动时间数据33...', activityData.timeType, this.beginTime, this.endTime, this.todayIndex, this.roundIndex, this.nextRefreshTime)
console.log('活动时间数据33...', activityData.timeType, this.beginTime, this.endTime, this.todayIndex, this.roundIndex, this.nextRefreshTime)
break;
}
default: {
@@ -71,9 +71,9 @@ export abstract class ActivityBase {
this.nextRefreshTime = moment(this.beginTime).add(activityData.interval * this.roundIndex, 'second').valueOf();
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(),
// '今天第几天:', this.todayIndex, '回合:', this.roundIndex, '下次刷新:', this.nextRefreshTime, moment(this.nextRefreshTime).toDate())
console.log('活动时间数据...', '活动id:', activityData.activityId, '类型:', activityData.timeType, '开始时间:', this.beginTime, moment(this.beginTime).toDate(),
'结束:', this.endTime, moment(this.endTime).toDate(),
'今天第几天:', this.todayIndex, '回合:', this.roundIndex, '下次刷新:', this.nextRefreshTime, moment(this.nextRefreshTime).toDate())
}
}

View File

@@ -35,7 +35,7 @@ export class LimitShopData extends ActivityBase {
name: string = '';//活动名称
interval: number = 0;//周期间隔(秒)
list: Array<ShopItem> = [];//商品列表
nextRefreshTime: number;//下次刷新时间
// nextRefreshTime: number;//下次刷新时间
roundIndex: number = 1;//周期数从1开始
public findItemByProductID(productID: string) {
@@ -73,7 +73,7 @@ export class LimitShopData extends ActivityBase {
public initData(data: string) {
this.nextRefreshTime = this.endTime;
// this.nextRefreshTime = this.endTime;
let dataObj = JSON.parse(data);
this.name = dataObj.name;
this.interval = dataObj.interval;

View File

@@ -151,7 +151,7 @@ export class RefreshShopData extends ActivityBase {
public initData(data: string) {
this.nextRefreshTime = this.endTime;
// this.nextRefreshTime = this.endTime;
let dataObj = JSON.parse(data);
this.shopType = dataObj.shopType;
this.name = dataObj.name;

View File

@@ -56,7 +56,7 @@ export class RefreshTaskData extends ActivityBase {
name: string = '';//活动名称
interval: number = 0;//周期间隔(秒)
list: Array<RefreshTaskPage> = [];
nextRefreshTime: number;//下次刷新时间
// nextRefreshTime: number;//下次刷新时间
roundIndex: number = 1;//周期数从1开始
addPointActivityId: number = 0;//获得的点数关联其他活动id(新将礼物)
@@ -106,7 +106,7 @@ export class RefreshTaskData extends ActivityBase {
}
public initData(data: string) {
this.nextRefreshTime = this.endTime;
// this.nextRefreshTime = this.endTime;
let dataObj = JSON.parse(data);
this.name = dataObj.name;
this.interval = dataObj.interval;