var t = require; var e = module; var i = exports; e = (this && this.__decorate) || function (t, e, i, s) { var o, a = arguments.length, n = a < 3 ? e : null === s ? (s = Object.getOwnPropertyDescriptor(e, i)) : s; if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, s); else for (var r = t.length - 1; 0 <= r; r--) (o = t[r]) && (n = (a < 3 ? o(n) : 3 < a ? o(e, i, n) : o(e, i)) || n); return 3 < a && n && Object.defineProperty(e, i, n), n; }; Object.defineProperty(i, "__esModule", {value: !0}); const s = t("App"), o = t("BaseView"), a = t("ControllerConst"), n = (t("ViewConst"), t("ADController"), t("ADManageBase"), t("BagConst")), r = t("ShopConst"), {ccclass: l, property: h, menu: c} = cc._decorator; t = class extends o.default { constructor() { super(...arguments), (this.bubbleNode = null), (this.iconSpr = null), (this.boxItems = []), (this.time = 0), (this.showIndexArry = null), (this.showIndex = 0); } initUI() { super.initUI(); const t = s.default.ControllerManager.applyFunc( a.ControllerConst.Shop, r.ShopConst.GET_ITEM_DATA_BY_TYPE, r.ShopType.BOX ); for (const e of t) { const t = s.default.ControllerManager.applyFunc(a.ControllerConst.Item, n.BagConst.GET_ITEM, e.cfg.itemId); this.boxItems.push(t); } } open() { super.open(), this.updateShowIndexs(), this.updateBubble(s.default.DateUtils.Now()); } updateShowIndexs() { let e = []; var t = s.default.ControllerManager.applyFunc(a.ControllerConst.AD, 4, 7), i = s.default.ControllerManager.applyFunc(a.ControllerConst.AD, 3, 7); (t.freeCnt < i.freeCnt || t.adCnt < i.adTimes) && e.push(0); for (let t = 1; t < this.boxItems.length; t++) this.boxItems[t].cnt && e.push(t); e.length ? ((this.bubbleNode.active = !0), (this.showIndexArry = e)) : (this.bubbleNode.active = !1); } updateBubble(t) { !this.bubbleNode.active || t - this.time < 5e3 || ((this.time = t), (this.bubbleNode.active = !0), this.showIndex++, (this.showIndex = this.showIndex % this.showIndexArry.length), (t = this.showIndexArry[this.showIndex]), s.default.CommonUtils.setSpriteFrame(this.boxItems[t].getItemPic(), this.iconSpr)); } onTouchIcon() { s.default.ViewManager.open(7); } }; e([h(cc.Node)], t.prototype, "bubbleNode", void 0), e([h(cc.Sprite)], t.prototype, "iconSpr", void 0), (t = e([l, c("view/Shop/ShopViewIcon")], t)), (i.default = t);