活动:修改30天消耗点数的逻辑
This commit is contained in:
@@ -132,7 +132,7 @@ export class ThirtyDaysHandler {
|
|||||||
if (!thirtyDaysPointItemData) {
|
if (!thirtyDaysPointItemData) {
|
||||||
return resResult(STATUS.ACTIVITY_DATA_ERROR);
|
return resResult(STATUS.ACTIVITY_DATA_ERROR);
|
||||||
}
|
}
|
||||||
if (playerData.totalPoint - playerData.consumePoint < thirtyDaysPointItemData.consumePoint) {//点数不足
|
if (playerData.totalPoint < thirtyDaysPointItemData.consumePoint) {//点数不足
|
||||||
return resResult(STATUS.ACTIVITY_NO_POINT);
|
return resResult(STATUS.ACTIVITY_NO_POINT);
|
||||||
}
|
}
|
||||||
if (thirtyDaysPointItemData.isReceive) {//已经领取过
|
if (thirtyDaysPointItemData.isReceive) {//已经领取过
|
||||||
|
|||||||
@@ -117,7 +117,6 @@ export class ThirtyDaysData extends ActivityBase {
|
|||||||
list: Array<ThirtyDaysPage> = [];//任务完成奖励
|
list: Array<ThirtyDaysPage> = [];//任务完成奖励
|
||||||
pointRewardList: Array<ThirtyDaysPointItem> = [];//点数兑换奖励
|
pointRewardList: Array<ThirtyDaysPointItem> = [];//点数兑换奖励
|
||||||
totalPoint: number = 0;//总共点数
|
totalPoint: number = 0;//总共点数
|
||||||
consumePoint: number = 0;//消耗掉的点数
|
|
||||||
|
|
||||||
//未完成的任务
|
//未完成的任务
|
||||||
public findUncompleteTaskByType(type: number): ThirtyDaysItem[] {
|
public findUncompleteTaskByType(type: number): ThirtyDaysItem[] {
|
||||||
@@ -215,11 +214,9 @@ export class ThirtyDaysData extends ActivityBase {
|
|||||||
|
|
||||||
//解析玩家点数兑换领取记录
|
//解析玩家点数兑换领取记录
|
||||||
public setPlayerPointRecords(data: ActivityThirtyDaysPointRewardModelType[]) {
|
public setPlayerPointRecords(data: ActivityThirtyDaysPointRewardModelType[]) {
|
||||||
this.consumePoint = 0;
|
|
||||||
for (let obj of this.pointRewardList) {
|
for (let obj of this.pointRewardList) {
|
||||||
let index = data.findIndex(record => { return obj.cellIndex == record.cellIndex })
|
let index = data.findIndex(record => { return obj.cellIndex == record.cellIndex })
|
||||||
if (index != -1) {
|
if (index != -1) {
|
||||||
this.consumePoint += obj.consumePoint;
|
|
||||||
obj.isReceive = data[index].isReceive === true;
|
obj.isReceive = data[index].isReceive === true;
|
||||||
obj.isExpired = data[index].isExpired === true;
|
obj.isExpired = data[index].isExpired === true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user