活动:签到开启时间调整
This commit is contained in:
@@ -33,7 +33,7 @@ export class SignInHandler {
|
||||
const serverId = session.get('serverId');
|
||||
|
||||
let todayIndex = moment(new Date()).date();
|
||||
if (todayIndex < 5 || todayIndex > 24) {//未开启
|
||||
if (todayIndex < SIGNIN_OPEN || todayIndex > SIGNIN_CLOSE) {//未开启
|
||||
return resResult(STATUS.ACTIVITY_CLOSED);
|
||||
}
|
||||
|
||||
|
||||
@@ -101,5 +101,5 @@ export const SIGNIN_VIP_OPEN_LIMIT = 15;
|
||||
export const DAILYRMBGIFTS_DAYS = 7;//一次性购买*天
|
||||
|
||||
//签到活动开启时间
|
||||
export const SIGNIN_OPEN = 5;//*号0点开启
|
||||
export const SIGNIN_CLOSE = 30;//*号晚上24点结束
|
||||
export const SIGNIN_OPEN = 1;//*号0点开启
|
||||
export const SIGNIN_CLOSE = 31;//*号晚上24点结束
|
||||
@@ -1,10 +1,7 @@
|
||||
import moment = require('moment');
|
||||
import { ACTIVITY_RESOURCES_TYPE } from '../../consts';
|
||||
import { ACTIVITY_RESOURCES_TYPE, SIGNIN_CLOSE, SIGNIN_OPEN } from '../../consts';
|
||||
import { ActivityModelType } from '../../db/Activity';
|
||||
import { ActivitySignInModelType } from '../../db/ActivitySignIn';
|
||||
import { RewardInter } from '../../pubUtils/interface';
|
||||
import { parseGoodStrWithType, parseHeroStrWithType } from '../../pubUtils/util';
|
||||
import { CreateHeroParam } from '../roleField/hero';
|
||||
import { ActivityBase } from './activityField';
|
||||
|
||||
|
||||
@@ -60,15 +57,15 @@ export class SignInData extends ActivityBase {
|
||||
|
||||
public initData(data: string) {
|
||||
let date = new Date();
|
||||
this.beginTime = moment(date.setDate(5)).startOf('day').valueOf();
|
||||
this.endTime = moment(date.setDate(25)).endOf('day').valueOf();
|
||||
this.beginTime = moment(date.setDate(SIGNIN_OPEN)).startOf('day').valueOf();
|
||||
this.endTime = moment(date.setDate(SIGNIN_CLOSE)).endOf('day').valueOf();
|
||||
|
||||
let dataObj = JSON.parse(data);
|
||||
this.price = dataObj.price;
|
||||
this.productID = dataObj.productID;
|
||||
this.consume = dataObj.consume;
|
||||
this.roundIndex = moment().diff(moment(this.beginTime).startOf('months'), 'months') + 1;
|
||||
this.todayIndex = moment(Date.now()).date() - 4;
|
||||
this.todayIndex = moment(Date.now()).date() - SIGNIN_OPEN + 1;
|
||||
|
||||
let arr = dataObj.data
|
||||
for (let obj of arr) {
|
||||
|
||||
Reference in New Issue
Block a user