活动:修改任务接口
This commit is contained in:
@@ -60,6 +60,43 @@ export class GrowthFundData extends ActivityBase {
|
||||
buyRecords: Array<number> = [];//高阶购买记录
|
||||
receiveRecords: Array<ActivityGrowthFundModelType> = [];//领取记录
|
||||
|
||||
public unLockItem(condition: number) {
|
||||
let items = [];
|
||||
for (let page of this.list) {
|
||||
if (this.isVipActivity() && !this.isBuy(page.pageIndex)) {
|
||||
continue;
|
||||
}
|
||||
for (let item of page.items) {
|
||||
switch (this.type) {
|
||||
case ACTIVITY_TYPE.GROWTH_FUND_MAIN:
|
||||
case ACTIVITY_TYPE.GROWTH_FUND_MAIN_VIP: {
|
||||
if (!this.isReceive(page.pageIndex, item.cellIndex) && item.condition == condition) {
|
||||
item.isComplete = true;
|
||||
items.push(Object.assign(item, { pageIndex: page.pageIndex, activityId: this.activityId }))
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ACTIVITY_TYPE.GROWTH_FUND_MAIN:
|
||||
case ACTIVITY_TYPE.GROWTH_FUND_MAIN_VIP:
|
||||
case ACTIVITY_TYPE.GROWTH_FUND_MAIN_ELITE:
|
||||
case ACTIVITY_TYPE.GROWTH_FUND_MAIN_ELITE_VIP: {
|
||||
if (!this.isReceive(page.pageIndex, item.cellIndex) && item.condition <= condition) {
|
||||
item.isComplete = true;
|
||||
items.push(Object.assign(item, { pageIndex: page.pageIndex, activityId: this.activityId }))
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return items;
|
||||
}
|
||||
|
||||
public findPageByProductID(productID: string) {
|
||||
let index = this.list.findIndex(obj => { return obj && obj.productID === productID });
|
||||
return (index != -1) ? this.list[index] : null;
|
||||
}
|
||||
|
||||
//是否是高阶,需要购买
|
||||
public isVipActivity() {
|
||||
return this.type == ACTIVITY_TYPE.GROWTH_FUND_MAIN_VIP
|
||||
|
||||
@@ -24,6 +24,7 @@ export class YuanBaoShopItem {
|
||||
this.firstReward = data.firstReward;
|
||||
this.extraReward = data.extraReward;
|
||||
this.imageName = data.imageName;
|
||||
this.buyCount = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +48,7 @@ export class YuanBaoShopData extends ActivityBase {
|
||||
return;
|
||||
}
|
||||
for (let obj of this.list) {
|
||||
let arr = data.filter(obj => { return obj.productID === obj.productID })
|
||||
let arr = data.filter(order => { return order.productID === obj.productID })
|
||||
obj.buyCount = arr.length;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user