充值:添加充值前检查

This commit is contained in:
luying
2022-04-29 10:47:33 +08:00
parent d7db67dd2b
commit 57da91f7f4
5 changed files with 54 additions and 2 deletions
@@ -114,6 +114,12 @@ export class PopUpShopData extends ActivityBase {
return new PopUpShopShow(this);
}
public checkItem(data: ActivityPopUpShopModelType, productID: string) {
let pkg = this.findPackageById(data.id);
let item = pkg.findItemByProductID(productID);
return item.hasBoughtCnt < item.buyCnt;
}
public updateRecord(data: ActivityPopUpShopModelType, productID: string) {
let pkg = this.findPackageById(data.id);
let dataItem = data.items.find(cur => cur.productID == productID);