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 o = t("App"), s = t("BaseView"), a = t("EffectUtils"), n = t("BagController"), r = t("GameConst"), l = t("CostumeConst"), h = t("CostumeController"), {ccclass: c, property: d} = cc._decorator; t = class extends s.default { constructor() { super(...arguments), (this.curItemBgSpr = null), (this.iconSpr = null), (this.costumeTypeSpr = null), (this.curArrowListNode = null), (this.lvLab = null), (this.originalItemBgSpr = null), (this.originalIconSpr = null), (this.originalCostumeTypeSpr = null), (this.originalArrowListNode = null), (this.originalLvLab = null), (this.refundBtnBtn = null), (this.diamondLabLab = null), (this.diamondIcon = null), (this.bgType = 1), (this.item = null); } initUI() { super.initUI(); } open(t) { super.open(), (this.item = t), this.updateUI(); } updateUI() { (this.lvLab.string = `Lv.${this.item.data.lv}/${this.item.gradeCfg.max_level}`), o.default.CommonUtils.setSpriteFrameByBundle(r.BundleType.MAP_ICON, this.item.getIcon(), this.iconSpr), o.default.CommonUtils.setSpriteFrameByBundle( r.BundleType.MAP_ICON, this.item.getTypeIcon(), this.costumeTypeSpr ), o.default.CommonUtils.setSpriteFrame(l.getRarityUrlByGrade(this.item.data.grade), this.curItemBgSpr), (this.originalLvLab.string = `Lv.1/${this.item.gradeCfg.max_level}`), o.default.CommonUtils.setSpriteFrameByBundle( r.BundleType.MAP_ICON, this.item.getIcon(), this.originalIconSpr ), o.default.CommonUtils.setSpriteFrameByBundle( r.BundleType.MAP_ICON, this.item.getTypeIcon(), this.originalCostumeTypeSpr ), o.default.CommonUtils.setSpriteFrame(l.getRarityUrlByGrade(this.item.data.grade), this.originalItemBgSpr), (this.diamondLabLab.string = "" + this.item.getLvCost(this.item.data.lv)); var e = l.getGradeLv(this.item.data.grade); const i = this.curArrowListNode.children, s = this.originalArrowListNode.children; for (let t = 0; t < i.length; t++) i[t].active = s[t].active = t < e; } playDiamonAni(t) { const e = o.default.ViewManager.uiRoot; var i = this.diamondLabLab.node.parent.convertToWorldSpaceAR(this.diamondLabLab.node.position), i = e.convertToNodeSpaceAR(i), s = this.diamondIcon.convertToWorldSpaceAR(cc.Vec2.ZERO), s = e.convertToNodeSpaceAR(s); a.default.instance.playMoneyAni(i, s, n.CostType.diamond, e, t); } onToucRefundBtn() { var t = this.item.getLvCost(this.item.data.lv); h.default.ins.refundCostume(this.item) && (this.closeView(), this.playDiamonAni(t)); } }; e([d({type: cc.Sprite})], t.prototype, "curItemBgSpr", void 0), e([d({type: cc.Sprite})], t.prototype, "iconSpr", void 0), e([d({type: cc.Sprite})], t.prototype, "costumeTypeSpr", void 0), e([d({type: cc.Node})], t.prototype, "curArrowListNode", void 0), e([d({type: cc.Label})], t.prototype, "lvLab", void 0), e([d({type: cc.Sprite})], t.prototype, "originalItemBgSpr", void 0), e([d({type: cc.Sprite})], t.prototype, "originalIconSpr", void 0), e([d({type: cc.Sprite})], t.prototype, "originalCostumeTypeSpr", void 0), e([d({type: cc.Node})], t.prototype, "originalArrowListNode", void 0), e([d({type: cc.Label})], t.prototype, "originalLvLab", void 0), e([d({type: cc.Button})], t.prototype, "refundBtnBtn", void 0), e([d({type: cc.Label})], t.prototype, "diamondLabLab", void 0), e([d(cc.Node)], t.prototype, "diamondIcon", void 0), (t = e([c], t)), (i.default = t);