定时器
This commit is contained in:
@@ -32,12 +32,12 @@ interface GroupShopInDb {
|
||||
|
||||
// 数据
|
||||
class GroupShopTimer {
|
||||
time: number; // 活动开始之后的时间
|
||||
time: number; // 时间戳
|
||||
itemId: number; // items唯一id
|
||||
sum: number; // 如果次数不足sum次则强行设成sum次
|
||||
|
||||
constructor(id: number, data: GroupShopTimerInDb) {
|
||||
this.time = data.time;
|
||||
constructor(beginTime: number, id: number, data: GroupShopTimerInDb) {
|
||||
this.time = beginTime + data.time * 60 * 1000;
|
||||
this.sum = data.sum;
|
||||
this.itemId = id;
|
||||
}
|
||||
@@ -130,7 +130,7 @@ export class GroupShopData extends ActivityBase {
|
||||
this.itemMap.set(item.id, this.items.length - 1);
|
||||
if(item.timers && item.timers.length > 0) {
|
||||
for(let timer of item.timers) {
|
||||
this.timer.push(new GroupShopTimer(item.id, timer));
|
||||
this.timer.push(new GroupShopTimer(this.beginTime, item.id, timer));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user