活动:弹出商店逻辑

This commit is contained in:
luying
2022-05-07 09:47:22 +08:00
parent 7347e6bd1f
commit 77bcfb28e6
2 changed files with 2406 additions and 2404 deletions

View File

@@ -203,10 +203,6 @@ export class PopUpShopPackage {
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) { // 正在进行中
for(let itemData of data.items) {
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) {
@@ -487,6 +487,8 @@ class PopUpShopShow {
for(let pkg of data.packages) {
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) {
let obj = new PopUpShopItemShow(item);
this.items.push({...obj});