活动:添加通用签到活动
This commit is contained in:
@@ -75,23 +75,31 @@ export class SignInData extends ActivityBase {
|
||||
this.consume = dataObj.consume;
|
||||
// this.rebet = dataObj.rebet;
|
||||
|
||||
this.startDate = dataObj.startDate ? dataObj.startDate : SIGNIN_OPEN;
|
||||
this.endDate = dataObj.endDate ? dataObj.endDate : SIGNIN_CLOSE;
|
||||
|
||||
this.days = dataObj.days ? dataObj.days : 0;
|
||||
|
||||
let date = new Date();
|
||||
this.beginTime = moment(date.setDate(this.startDate)).startOf('day').add(REFRESH_TIME, 'h').valueOf();
|
||||
if (this.startDate > this.endDate) {//跨度下个月
|
||||
this.endTime = moment(date.setDate(this.endDate)).endOf('day').add(REFRESH_TIME, 'h').add(1, 'month').valueOf();
|
||||
|
||||
if (this.type === ACTIVITY_TYPE.COMMON_SIGN_IN) {//通用签到
|
||||
this.beginTime = moment(this.beginTime).startOf('day').add(REFRESH_TIME, 'h').valueOf();
|
||||
this.endTime = moment(this.endTime).endOf('day').add(REFRESH_TIME, 'h').valueOf();
|
||||
this.roundIndex = moment(this.beginTime).diff(moment(SERVER_OPEN_TIME).startOf('months'), 'months') + 1;
|
||||
this.todayIndex = Math.ceil((moment(date).valueOf() - this.beginTime) / (24 * 60 * 60 * 1000));
|
||||
} else {
|
||||
this.endTime = moment(date.setDate(this.endDate)).endOf('day').add(REFRESH_TIME, 'h').valueOf();
|
||||
this.startDate = dataObj.startDate ? dataObj.startDate : SIGNIN_OPEN;
|
||||
this.endDate = dataObj.endDate ? dataObj.endDate : SIGNIN_CLOSE;
|
||||
|
||||
this.days = dataObj.days ? dataObj.days : 0;
|
||||
this.beginTime = moment(date.setDate(this.startDate)).startOf('day').add(REFRESH_TIME, 'h').valueOf();
|
||||
if (this.startDate > this.endDate) {//跨度下个月
|
||||
this.endTime = moment(date.setDate(this.endDate)).endOf('day').add(REFRESH_TIME, 'h').add(1, 'month').valueOf();
|
||||
} else {
|
||||
this.endTime = moment(date.setDate(this.endDate)).endOf('day').add(REFRESH_TIME, 'h').valueOf();
|
||||
}
|
||||
this.roundIndex = moment(this.beginTime).diff(moment(SERVER_OPEN_TIME).startOf('months'), 'months') + 1;
|
||||
if (this.type === ACTIVITY_TYPE.NEW_PLAYER_SIGN_IN) {
|
||||
this.roundIndex = 1;
|
||||
}
|
||||
this.todayIndex = Math.ceil((moment(date).valueOf() - this.beginTime) / (24 * 60 * 60 * 1000));
|
||||
|
||||
}
|
||||
this.roundIndex = moment().diff(moment(SERVER_OPEN_TIME).startOf('months'), 'months') + 1;
|
||||
if (this.type === ACTIVITY_TYPE.NEW_PLAYER_SIGN_IN) {
|
||||
this.roundIndex = 1;
|
||||
}
|
||||
this.todayIndex = Math.ceil((moment(date).valueOf() - this.beginTime) / (24 * 60 * 60 * 1000));
|
||||
|
||||
let arr = dataObj.data
|
||||
for (let obj of arr) {
|
||||
|
||||
Reference in New Issue
Block a user