团购:修改字段

This commit is contained in:
luying
2022-10-12 10:32:18 +08:00
parent 764333e1c4
commit eccd9f0051
5 changed files with 45 additions and 45 deletions

View File

@@ -17,8 +17,8 @@ interface GroupShopDiscountInDb {
}
interface GroupShopItemInDb {
id: number; // 唯一id
gid: number; // 物品id
itemId: number; // 唯一id
id: number; // 物品id
count: number; // 一次购买能购买多少
max: number; // 单人可以购买多少次
price: number; // 无折扣单价
@@ -62,8 +62,8 @@ export class GroupShopDiscount {
}
class GroupShopItem {
id: number; // 唯一id
gid: number; // 物品id
itemId: number; // 唯一id
id: number; // 物品id
count: number; // 一次购买能购买多少
max: number; // 单人可以购买多少次
price: number; // 无折扣单价
@@ -73,8 +73,8 @@ class GroupShopItem {
hasBoughtCnt: number = 0; // 玩家购买次数
constructor(item: GroupShopItemInDb) {
this.itemId = item.itemId;
this.id = item.id;
this.gid = item.gid;
this.count = item.count;
this.max = item.max;
this.price = item.price;
@@ -128,17 +128,17 @@ export class GroupShopData extends ActivityBase {
for(let item of dataObj.items) {
this.items.push(new GroupShopItem(item));
this.itemMap.set(item.id, this.items.length - 1);
this.itemMap.set(item.itemId, this.items.length - 1);
if(item.timers && item.timers.length > 0) {
for(let timer of item.timers) {
this.timer.push(new GroupShopTimer(this.beginTime, item.id, timer));
this.timer.push(new GroupShopTimer(this.beginTime, item.itemId, timer));
}
}
}
}
public findItemById(id: number) {
let index = this.itemMap.get(id);
public findItemById(itemId: number) {
let index = this.itemMap.get(itemId);
return this.items[index];
}