活动:添加rmb活动类型判断

This commit is contained in:
qiaoxin
2021-05-28 10:04:14 +08:00
parent 8679ca946d
commit a328f02b25
9 changed files with 59 additions and 33 deletions

View File

@@ -63,16 +63,19 @@ export class SignInData extends ActivityBase {
}
//解析玩家签到记录
public setPlayerRecords(data: ActivitySignInModelType[]) {
public setPlayerRecords(data: ActivitySignInModelType) {
this.isVip = false;
if (!data) {
return;
}
let records = data.records ? data.records : [];
for (let obj of this.list) {
let index = data.findIndex(record => { return obj.dayIndex == record.dayIndex })
let index = records.findIndex(record => { return obj.dayIndex == record.dayIndex })
if (index != -1) {
obj.isReceive = data[index].isReceive;
obj.isReceive = true;
}
}
let isBuy = data.findIndex(obj => { return obj.dayIndex == 0 });
this.isVip = (isBuy != -1)
this.isVip = true
}
public initData(data: string) {