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("BagConst"), r = t("CostumeItem"), l = t("GameConst"), h = t("CongratulationItem"), { ccclass: c, property: d, menu: u } = cc._decorator; t = class extends o.default { constructor() { super(...arguments), (this.content = null), (this.ani = null), (this.congratulationItem = null), (this.passIcon = null), (this.passRewardIcon = null), (this.passCountLab = null), (this.titleLab = null), (this.items = []), (this.showItems = null), (this.callBack = null), (this.bgType = 1); } initUI() { super.initUI(); } open(t, e, i) { super.open(), (this.callBack = i), t instanceof Array ? ((this.showItems = t), this.resetView(this.showItems.pop())) : this.resetView(t, e); } showItem(t, e) { t = "number" == typeof t ? s.default.ControllerManager.applyFunc(a.ControllerConst.Item, n.BagConst.GET_ITEM, t) : t; if (((this.passIcon.node.active = !1), (this.congratulationItem.node.active = !0), t.isCostume())) { const i = t; this.congratulationItem.setCostumeItemData(i.getTempCostume(), e); } else this.congratulationItem.setItemData(t, e); } showCostumeItem(t, e) { (this.passIcon.node.active = !1), (this.congratulationItem.node.active = !0), this.congratulationItem.setCostumeItemData(t, e); } showCongratulationData(t) { t.type == l.CongratulationType.Pass ? ((this.passIcon.node.active = !0), (this.congratulationItem.node.active = !1), s.default.CommonUtils.setSpriteFrame(t.iconUrl, this.passRewardIcon), (this.passCountLab.string = "x" + t.cnt), s.default.CommonUtils.setSpriteFrameByBundle(l.BundleType.MAP_ICON, t.passIcon, this.passIcon)) : ((this.passIcon.node.active = !1), (this.congratulationItem.node.active = !0), t.data ? t.data instanceof r.default ? this.showCostumeItem(t.data, t.cnt) : this.showItem(t.data, t.cnt) : this.congratulationItem.setCustomeData(t)); } resetView(t, e = 1) { for (const s of this.ani.node.children) s.scale = 0; let i = "恭喜获得"; t instanceof r.default ? this.showCostumeItem(t, 1) : t instanceof l.CongratulationData ? (this.showCongratulationData(t), t.type == l.CongratulationType.Pass && (i = "新店开业")) : this.showItem(t, e), (this.titleLab.string = i), this.ani.once(cc.Animation.EventType.FINISHED, () => { this.ani.play("idle"); }), this.ani.play("work"); } onTouchClose() { this.showItems && this.showItems.length ? this.resetView(this.showItems.pop()) : (this.closeView(), this.callBack && (this.callBack(), (this.callBack = null))); } }; e([d(cc.Node)], t.prototype, "content", void 0), e([d(cc.Animation)], t.prototype, "ani", void 0), e([d(h.default)], t.prototype, "congratulationItem", void 0), e([d(cc.Sprite)], t.prototype, "passIcon", void 0), e([d(cc.Sprite)], t.prototype, "passRewardIcon", void 0), e([d(cc.Label)], t.prototype, "passCountLab", void 0), e([d(cc.Label)], t.prototype, "titleLab", void 0), (t = e([c], t)), (i.default = t);