活动:成长活动、今日挑战奖励接口返回数据添加字段

This commit is contained in:
qiaoxin
2021-05-20 17:16:01 +08:00
parent 14acc426a0
commit afc95d2e19
10 changed files with 119 additions and 158 deletions
@@ -26,6 +26,7 @@ export class DailyItem {
this.name = data.name;
this.taskType = data.taskType;
this.taskParam = data.taskParam;
this.condition = data.condition;
this.reward = data.reward;
}
@@ -50,7 +51,7 @@ export class DailyItem {
}
public canReceive(): boolean {
return this.receiveRewardCount != 0;
return this.receiveRewardCount == 0;
}
public isComplete(): boolean {
@@ -121,8 +122,11 @@ export class DailyChallengesData extends ActivityBase {
for (let obj of this.list) {
let index = data.findIndex(record => { return obj.dayIndex == record.dayIndex && obj.cellIndex == record.cellIndex })
if (index != -1) {
obj.totalCount = data[index].totalCount;
obj.receiveRewardCount = data[index].receiveRewardCount;
obj.totalCount = data[index].totalCount ? data[index].totalCount : 0;
obj.receiveRewardCount = data[index].receiveRewardCount ? data[index].receiveRewardCount : 0;
} else {
obj.totalCount = 0;
obj.receiveRewardCount = 0
}
}
}