活动:弹出商店逻辑
This commit is contained in:
@@ -203,10 +203,6 @@ export class PopUpShopPackage {
|
|||||||
key.addHasBoughtCnt(data.items);
|
key.addHasBoughtCnt(data.items);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(let itemData of data.items) {
|
|
||||||
let item = this.findItemByProductID(itemData.productID);
|
|
||||||
item.addPushCnt();
|
|
||||||
}
|
|
||||||
if(data.beginTime <= now && data.endTime > now) { // 正在进行中
|
if(data.beginTime <= now && data.endTime > now) { // 正在进行中
|
||||||
for(let itemData of data.items) {
|
for(let itemData of data.items) {
|
||||||
let item = this.findItemByProductID(itemData.productID);
|
let item = this.findItemByProductID(itemData.productID);
|
||||||
@@ -221,6 +217,10 @@ export class PopUpShopPackage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for(let itemData of data.items) {
|
||||||
|
let item = this.findItemByProductID(itemData.productID);
|
||||||
|
item.addPushCnt();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public setLatestBought(data: ActivityPopUpShopModelType) {
|
public setLatestBought(data: ActivityPopUpShopModelType) {
|
||||||
@@ -487,6 +487,8 @@ class PopUpShopShow {
|
|||||||
|
|
||||||
for(let pkg of data.packages) {
|
for(let pkg of data.packages) {
|
||||||
for(let item of pkg.items) {
|
for(let item of pkg.items) {
|
||||||
|
let { id, isPushing, hasBoughtCnt, buyCnt, hasPushCnt, pushCnt } = item;
|
||||||
|
console.log('**** PopUpShopShow', { id, isPushing, hasBoughtCnt, buyCnt, hasPushCnt, pushCnt })
|
||||||
if(item.isPushing && item.hasBoughtCnt < item.buyCnt) {
|
if(item.isPushing && item.hasBoughtCnt < item.buyCnt) {
|
||||||
let obj = new PopUpShopItemShow(item);
|
let obj = new PopUpShopItemShow(item);
|
||||||
this.items.push({...obj});
|
this.items.push({...obj});
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user