活动:签到添加补签的规则
This commit is contained in:
@@ -46,13 +46,13 @@ export class SignInItem {
|
||||
}
|
||||
|
||||
|
||||
// 成长活动数据
|
||||
// 签到活动数据
|
||||
export class SignInData extends ActivityBase {
|
||||
list: Array<SignInItem> = [];
|
||||
roundIndex: number = 0;//活动周期
|
||||
todayIndex: number = 0;//本月第几天
|
||||
price: number = 0;//vip价格,普通签到为0
|
||||
productID: string = '';//商品ID
|
||||
consume: string = ''//补签消耗
|
||||
isVip: boolean = false;//是否购买了当前的vip活动
|
||||
|
||||
//第几天的签到奖励
|
||||
@@ -75,11 +75,16 @@ 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();
|
||||
|
||||
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();
|
||||
this.todayIndex = moment(Date.now()).date() - 4;
|
||||
|
||||
let arr = dataObj.data
|
||||
for (let obj of arr) {
|
||||
|
||||
Reference in New Issue
Block a user