活动:成长活动、今日挑战奖励接口返回数据添加字段
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user