|
@@ -24,16 +24,16 @@ var o =
|
|
t.done
|
|
t.done
|
|
? i(t.value)
|
|
? i(t.value)
|
|
: ((e = t.value) instanceof r
|
|
: ((e = t.value) instanceof r
|
|
- ? e
|
|
|
|
- : new r(function (t) {
|
|
|
|
- t(e);
|
|
|
|
- })
|
|
|
|
- ).then(s, o);
|
|
|
|
|
|
+ ? e
|
|
|
|
+ : new r(function (t) {
|
|
|
|
+ t(e);
|
|
|
|
+ })
|
|
|
|
+ ).then(s, o);
|
|
}
|
|
}
|
|
a((l = l.apply(t, n || [])).next());
|
|
a((l = l.apply(t, n || [])).next());
|
|
});
|
|
});
|
|
};
|
|
};
|
|
-Object.defineProperty(i, "__esModule", {value: !0});
|
|
|
|
|
|
+Object.defineProperty(i, "__esModule", { value: !0 });
|
|
const a = t("App"),
|
|
const a = t("App"),
|
|
s = t("BaseController"),
|
|
s = t("BaseController"),
|
|
n = t("Toast"),
|
|
n = t("Toast"),
|
|
@@ -59,7 +59,7 @@ i.default = class extends s.default {
|
|
(this.shopViewIcon = null),
|
|
(this.shopViewIcon = null),
|
|
(this._model = null),
|
|
(this._model = null),
|
|
(this.neddOpenCnt = 4),
|
|
(this.neddOpenCnt = 4),
|
|
- a.default.ViewManager.register(7, {dir: "shop", prefabName: "ShopView", zIndex: 100, controller: this}),
|
|
|
|
|
|
+ a.default.ViewManager.register(7, { dir: "shop", prefabName: "ShopView", zIndex: 100, controller: this }),
|
|
a.default.ViewManager.register(28, {
|
|
a.default.ViewManager.register(28, {
|
|
dir: "shop",
|
|
dir: "shop",
|
|
prefabName: "ShopBuffView",
|
|
prefabName: "ShopBuffView",
|
|
@@ -84,7 +84,7 @@ i.default = class extends s.default {
|
|
zIndex: 100,
|
|
zIndex: 100,
|
|
controller: this
|
|
controller: this
|
|
}),
|
|
}),
|
|
- a.default.ViewManager.register(39, {dir: "shop", prefabName: "ShopViewIcon", zIndex: 50, controller: this}),
|
|
|
|
|
|
+ a.default.ViewManager.register(39, { dir: "shop", prefabName: "ShopViewIcon", zIndex: 50, controller: this }),
|
|
a.default.ViewManager.register(40, {
|
|
a.default.ViewManager.register(40, {
|
|
dir: "shop",
|
|
dir: "shop",
|
|
prefabName: "ShopFirstView",
|
|
prefabName: "ShopFirstView",
|
|
@@ -120,6 +120,20 @@ i.default = class extends s.default {
|
|
this.registerFunc(_.ShopConst.IS_BUY_REMOVE_AD, this.isBuyRemoveAd, this),
|
|
this.registerFunc(_.ShopConst.IS_BUY_REMOVE_AD, this.isBuyRemoveAd, this),
|
|
this.registerFunc(_.ShopConst.GET_BANK_DIAMOND, this.getBankDiamond, this),
|
|
this.registerFunc(_.ShopConst.GET_BANK_DIAMOND, this.getBankDiamond, this),
|
|
this.registerFunc(_.ShopConst.BUY_BANK, this.buyBank, this);
|
|
this.registerFunc(_.ShopConst.BUY_BANK, this.buyBank, this);
|
|
|
|
+
|
|
|
|
+ this.Hide()
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ Hide() {
|
|
|
|
+ console.error('默认隐藏首冲');
|
|
|
|
+ this.model.shopGiftDatas[_.ShopGiftType.FIRST_GIFT][0].buyCnt = 4
|
|
|
|
+
|
|
|
|
+ console.error('默认隐藏免广告');
|
|
|
|
+ this.model.shopGiftDatas[_.ShopGiftType.REMOVE_AD_GIFT][0].buyCnt = 1
|
|
|
|
+
|
|
}
|
|
}
|
|
initModleEvent() {
|
|
initModleEvent() {
|
|
a.default.NotificationCenter.addListener(l.NotificationConst.INIT_GAME, this.onInitGame, this, 200),
|
|
a.default.NotificationCenter.addListener(l.NotificationConst.INIT_GAME, this.onInitGame, this, 200),
|
|
@@ -130,7 +144,7 @@ i.default = class extends s.default {
|
|
var t = f.default.ins.define;
|
|
var t = f.default.ins.define;
|
|
(this._model.savaData.bankDiamond += t.piggybank_get_count),
|
|
(this._model.savaData.bankDiamond += t.piggybank_get_count),
|
|
this._model.savaData.bankDiamond > t.piggybank_full_count &&
|
|
this._model.savaData.bankDiamond > t.piggybank_full_count &&
|
|
- (this._model.savaData.bankDiamond = t.piggybank_full_count);
|
|
|
|
|
|
+ (this._model.savaData.bankDiamond = t.piggybank_full_count);
|
|
}
|
|
}
|
|
onInitGame() {
|
|
onInitGame() {
|
|
a.default.NotificationCenter.addListener(l.NotificationConst.SYS_OPEN, this.onCheckOpen, this);
|
|
a.default.NotificationCenter.addListener(l.NotificationConst.SYS_OPEN, this.onCheckOpen, this);
|
|
@@ -140,17 +154,17 @@ i.default = class extends s.default {
|
|
(t == m.OpenTypeConst.BUFF
|
|
(t == m.OpenTypeConst.BUFF
|
|
? (a.default.ViewManager.open(29), this.neddOpenCnt--)
|
|
? (a.default.ViewManager.open(29), this.neddOpenCnt--)
|
|
: t == m.OpenTypeConst.SHOP
|
|
: t == m.OpenTypeConst.SHOP
|
|
- ? (a.default.ViewManager.open(39), this.neddOpenCnt--)
|
|
|
|
- : t == m.OpenTypeConst.FIRST_GIFT
|
|
|
|
- ? (this.model.isFirstShowFirstGift() && a.default.ViewManager.open(40), this.neddOpenCnt--)
|
|
|
|
- : t == m.OpenTypeConst.BANK &&
|
|
|
|
- (a.default.NotificationCenter.addListener(
|
|
|
|
- l.NotificationConst.STAGE_UPGRADE_UPDATE,
|
|
|
|
- this.onStageUpgradeUpdate,
|
|
|
|
- this
|
|
|
|
- ),
|
|
|
|
- this.neddOpenCnt--),
|
|
|
|
- this.neddOpenCnt ||
|
|
|
|
|
|
+ ? (a.default.ViewManager.open(39), this.neddOpenCnt--)
|
|
|
|
+ : t == m.OpenTypeConst.FIRST_GIFT
|
|
|
|
+ ? (this.model.isFirstShowFirstGift() && a.default.ViewManager.open(40), this.neddOpenCnt--)
|
|
|
|
+ : t == m.OpenTypeConst.BANK &&
|
|
|
|
+ (a.default.NotificationCenter.addListener(
|
|
|
|
+ l.NotificationConst.STAGE_UPGRADE_UPDATE,
|
|
|
|
+ this.onStageUpgradeUpdate,
|
|
|
|
+ this
|
|
|
|
+ ),
|
|
|
|
+ this.neddOpenCnt--),
|
|
|
|
+ this.neddOpenCnt ||
|
|
a.default.NotificationCenter.removeListener(l.NotificationConst.SYS_OPEN, this.onCheckOpen, this));
|
|
a.default.NotificationCenter.removeListener(l.NotificationConst.SYS_OPEN, this.onCheckOpen, this));
|
|
}
|
|
}
|
|
onUpdateBuff() {
|
|
onUpdateBuff() {
|
|
@@ -195,11 +209,11 @@ i.default = class extends s.default {
|
|
(i.cfg.payId
|
|
(i.cfg.payId
|
|
? (t = yield a.default.Platform.buy(i.cfg.payId))
|
|
? (t = yield a.default.Platform.buy(i.cfg.payId))
|
|
: i.cfg.ad
|
|
: i.cfg.ad
|
|
- ? (e = yield a.default.ControllerManager.applyFunc(r.ControllerConst.AD, 0, s)) &&
|
|
|
|
- 0 === e.code &&
|
|
|
|
- (t = !0)
|
|
|
|
- : (t = g.default.ins.diamondChange(-i.cfg.diamond)) || n.default.launch("钻石不足!"),
|
|
|
|
- t)
|
|
|
|
|
|
+ ? (e = yield a.default.ControllerManager.applyFunc(r.ControllerConst.AD, 0, s)) &&
|
|
|
|
+ 0 === e.code &&
|
|
|
|
+ (t = !0)
|
|
|
|
+ : (t = g.default.ins.diamondChange(-i.cfg.diamond)) || n.default.launch("钻石不足!"),
|
|
|
|
+ t)
|
|
) {
|
|
) {
|
|
switch ((this.model.updateCnt(i), i.shopType)) {
|
|
switch ((this.model.updateCnt(i), i.shopType)) {
|
|
case _.ShopType.Diamond:
|
|
case _.ShopType.Diamond:
|
|
@@ -295,9 +309,9 @@ i.default = class extends s.default {
|
|
var e;
|
|
var e;
|
|
t.shopType == _.ShopType.BOX &&
|
|
t.shopType == _.ShopType.BOX &&
|
|
((e = a.default.ControllerManager.applyFunc(r.ControllerConst.Item, h.BagConst.USE_ITEM, t.cfg.itemId)),
|
|
((e = a.default.ControllerManager.applyFunc(r.ControllerConst.Item, h.BagConst.USE_ITEM, t.cfg.itemId)),
|
|
- this.shopOpenBoxView ? this.shopOpenBoxView.openBox(e[0]) : a.default.ViewManager.open(32, e[0], t),
|
|
|
|
- this.shopViewIcon && this.shopViewIcon.updateShowIndexs(),
|
|
|
|
- this.shopView.updateContentUI(_.ShopType.BOX));
|
|
|
|
|
|
+ this.shopOpenBoxView ? this.shopOpenBoxView.openBox(e[0]) : a.default.ViewManager.open(32, e[0], t),
|
|
|
|
+ this.shopViewIcon && this.shopViewIcon.updateShowIndexs(),
|
|
|
|
+ this.shopView.updateContentUI(_.ShopType.BOX));
|
|
}
|
|
}
|
|
startTime() {
|
|
startTime() {
|
|
a.default.TimerManager.isExists(this.countDownTime, this) ||
|
|
a.default.TimerManager.isExists(this.countDownTime, this) ||
|
|
@@ -330,7 +344,7 @@ i.default = class extends s.default {
|
|
t.items[0].id,
|
|
t.items[0].id,
|
|
t.items[0].cnt
|
|
t.items[0].cnt
|
|
),
|
|
),
|
|
- a.default.ViewManager.open(31, t.items[0].id, t.items[0].cnt));
|
|
|
|
|
|
+ a.default.ViewManager.open(31, t.items[0].id, t.items[0].cnt));
|
|
this._model.updateCnt(t);
|
|
this._model.updateCnt(t);
|
|
}
|
|
}
|
|
}
|
|
}
|