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("ViewConst"), t("CostumeConst")), n = t("CostumeBagItem"), {ccclass: r, property: l} = cc._decorator; t = class extends o.default { constructor() { super(...arguments), (this.infoAni = null), (this.infoNode = null), (this.newIcon = null), (this.specialSpr = null), (this.specialRichText = null), (this.nameLab = null), (this.moneyRateLab = null), (this.mergeAni = null), (this.newItem = null), (this.mergeItems = []), (this.isCanClose = !1), (this.num = 0), (this.bgType = 1); } initUI() { super.initUI(), this.mergeAni.on(cc.Animation.EventType.FINISHED, this.onMergeAniFinished, this), this.infoAni.on(cc.Animation.EventType.FINISHED, this.onInfoAniFinished, this); } open(e, t, i) { if ((super.open(), (this.infoNode.active = !1), (this.num = i), 1 === e.length)) this.mergeItems[0].setData(e[0]), this.mergeItems[1].setData(t.getLastGradeItem()), this.mergeAni.play("work2"); else { for (let t = 0; t < e.length; t++) this.mergeItems[t].setData(e[t]); this.mergeItems[2].setData(t.getLastGradeItem()), this.mergeAni.play("work"); } this.scheduleOnce(() => { (this.infoNode.active = !0), this.infoAni.play("work"); }, 1.15), this.newItem.setData(t), (this.nameLab.string = t.getName()), (this.moneyRateLab.string = "+" + t.getValue() + "%"), t.data.grade < a.RarityType.rare ? (this.specialSpr.node.active = !1) : (s.default.CommonUtils.setSpriteFrame(a.getGradeBgByGrade(t.data.grade), this.specialSpr), (this.specialRichText.string = t.getCurMaxSpecialAbilityStr()), (t = a.getGradeLv(t.data.grade)), (this.newIcon.active = 0 === t)), (this.isCanClose = !1); } onMergeAniFinished() { this.isCanClose = !0; } onInfoAniFinished() { this.infoAni.play("idle"); } onTouchClose() { this.isCanClose && (this.closeView(), this.num && s.default.ViewManager.open(49, this.num)); } }; e([l(cc.Animation)], t.prototype, "infoAni", void 0), e([l(cc.Node)], t.prototype, "infoNode", void 0), e([l(cc.Node)], t.prototype, "newIcon", void 0), e([l(cc.Sprite)], t.prototype, "specialSpr", void 0), e([l(cc.RichText)], t.prototype, "specialRichText", void 0), e([l(cc.Label)], t.prototype, "nameLab", void 0), e([l(cc.Label)], t.prototype, "moneyRateLab", void 0), e([l(cc.Animation)], t.prototype, "mergeAni", void 0), e([l(n.CostumeBagItem)], t.prototype, "newItem", void 0), e([l([n.CostumeBagItem])], t.prototype, "mergeItems", void 0), (t = e([r], t)), (i.default = t);