活动:修复间隔天数位数

This commit is contained in:
luying
2022-05-11 17:45:13 +08:00
parent 3c711a0f27
commit a78ddabf35
4 changed files with 3 additions and 27 deletions

View File

@@ -16,6 +16,7 @@ export abstract class ActivityBase {
effectDay: number = 0;// 活动生效天数
hideDayByServer: number = 0;
isEnable: boolean = false;
interval: number = 0;
roundIndex: number = 0;//周期活动第几个周期从1开始
nextRefreshTime: number = 0;//周期活动下次刷新时间
@@ -63,10 +64,11 @@ export abstract class ActivityBase {
this.nextRefreshTime = this.endTime;
this.name = activityData.name;
this.isEnable = activityData.isEnable;
this.interval = activityData.interval * 86400;
this.type = activityData.type;
console.log('今天是活动第几天', activityData.beginTime, new Date, this.todayIndex)
console.log('***** activityData', activityData.timeType, this.beginTime, this.endTime, this.todayIndex, this.roundIndex, this.nextRefreshTime, this.effectDay)
console.log('***** activityData', activityData.timeType, this.beginTime, this.endTime, this.interval, this.todayIndex, this.roundIndex, this.nextRefreshTime, this.effectDay)
switch (activityData.timeType) {
case ACTIVITY_TIME_TYPE.SERVER_OPEN_TIME: {
this.beginTime = moment(serverTime * 1000).add(this.delayDay, 'd').startOf('d').add(REFRESH_TIME, 'h').valueOf();

View File

@@ -33,7 +33,6 @@ export class ShopItem {
// 商店数据
export class LimitShopData extends ActivityBase {
name: string = '';//活动名称
interval: number = 0;//周期间隔(秒)
list: Array<ShopItem> = [];//商品列表
// nextRefreshTime: number;//下次刷新时间
// roundIndex: number = 1;//周期数从1开始
@@ -76,14 +75,7 @@ export class LimitShopData extends ActivityBase {
// this.nextRefreshTime = this.endTime;
let dataObj = JSON.parse(data);
this.name = dataObj.name;
this.interval = dataObj.interval * 864000;
// this.beginTime = moment(this.beginTime).startOf('d').add(REFRESH_TIME, 'hour').valueOf();
// if (this.interval > 0) {
// this.roundIndex = Math.ceil((moment(new Date).valueOf() - this.beginTime) / (this.interval * 1000));
// this.nextRefreshTime = moment(this.beginTime).add(this.interval * this.roundIndex, 'second').valueOf();
// }
// console.log('ddddddddddddbbbbbbb', moment(new Date).valueOf(), moment(this.beginTime).valueOf(), this.roundIndex,)
let arr = dataObj.data;
for (let obj of arr) {
this.list.push(new ShopItem(obj))

View File

@@ -59,7 +59,6 @@ export class RefreshShopPage {
export class RefreshShopData extends ActivityBase {
shopType: number = 0;//商店类型,用于客户端显示使用
name: string = '';//活动名称
interval: number = 0;//周期间隔(秒)
list: Array<RefreshShopPage> = [];//商品列表
//随机出商店可购买的商品数据
@@ -155,14 +154,6 @@ export class RefreshShopData extends ActivityBase {
let dataObj = JSON.parse(data);
this.shopType = dataObj.shopType;
this.name = dataObj.name;
this.interval = dataObj.interval * 864000;
// this.beginTime = moment(this.beginTime).startOf('d').add(REFRESH_TIME, 'hour').valueOf();
// if (this.interval > 0) {
// this.roundIndex = Math.ceil((moment(new Date).valueOf() - this.beginTime) / (this.interval * 1000));
// this.nextRefreshTime = moment(this.beginTime).add(this.interval * this.roundIndex, 'second').valueOf();
// }
// console.log('cccccccccccccccccccccccc', this.beginTime, this.roundIndex,)
let arr = dataObj.data;
for (let obj of arr) {
this.list.push(new RefreshShopPage(obj))

View File

@@ -57,7 +57,6 @@ export class RefreshTaskPage {
// 任务活动数据
export class RefreshTaskData extends ActivityBase {
name: string = '';//活动名称
interval: number = 0;//周期间隔(秒)
list: Array<RefreshTaskPage> = [];
// nextRefreshTime: number;//下次刷新时间
// roundIndex: number = 1;//周期数从1开始
@@ -112,19 +111,11 @@ export class RefreshTaskData extends ActivityBase {
// this.nextRefreshTime = this.endTime;
let dataObj = JSON.parse(data);
this.name = dataObj.name;
this.interval = dataObj.interval * 864000;
this.consumePoint = dataObj.consumePoint;
this.reward = dataObj.reward;
this.addPointActivityId = dataObj.addPointActivityId ? dataObj.addPointActivityId : 0;
this.totalPoint = 0;
this.exchangePoint = 0;
// this.beginTime = moment(this.beginTime).startOf('d').add(REFRESH_TIME, 'hour').valueOf();
// if (this.interval > 0) {
// this.roundIndex = Math.ceil((moment(new Date).valueOf() - this.beginTime) / (this.interval * 1000));
// this.nextRefreshTime = moment(this.beginTime).add(this.interval * this.roundIndex, 'second').valueOf();
// }
// console.log('ddddddddddddbbbbbbb', moment(new Date).valueOf(), moment(this.beginTime).valueOf(), this.roundIndex, this.nextRefreshTime)
let arr = dataObj.data;
for (let obj of arr) {
this.list.push(new RefreshTaskPage(obj))