充值:添加充值前检查

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
+1
View File
@@ -512,6 +512,7 @@ export const STATUS = {
ORDER_PARAM_ERROR: { code: 70013, simStr: '订单参数错误' },
CHANNEL_INFO_NOT_FOUND: { code: 70014, simStr: '未找到玩家渠道数据' },
ACTIVITY_TASK_NOT_COMPLETE: { code: 70015, simStr: '条件未达成' },
ORDER_CANNOT_BUY: { code: 70016, simStr: '该礼包不可购买' },
}
@@ -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);