var t = require; var e = module; var i = exports; var 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; }, s = (this && this.__awaiter) || function (t, n, r, l) { return new (r = r || Promise)(function (i, e) { function s(t) { try { a(l.next(t)); } catch (t) { e(t); } } function o(t) { try { a(l.throw(t)); } catch (t) { e(t); } } function a(t) { var e; t.done ? i(t.value) : ((e = t.value) instanceof r ? e : new r(function (t) { t(e); }) ).then(s, o); } a((l = l.apply(t, n || [])).next()); }); }; Object.defineProperty(i, "__esModule", { value: !0 }), (i.DiamondShopItem = void 0); const o = t("App"), a = t("ShopItem"), { property: n, ccclass: r, menu: l } = cc._decorator; t = class extends a.ShopItem { constructor() { super(...arguments), (this.title = null), (this.diamondNumLab = null), (this.extraRateLab = null), (this.rateNode = null), (this.orginalDiamonLab = null); } initItem() { this.data.buyCnt = 11 o.default.CommonUtils.setSpriteFrame(this.data.getDiamondIconUrl(), this.icon), this.data.cfg.rate && !this.data.buyCnt ? ((this.extraRateLab.node.active = !0), (this.diamondNumLab.string = "" + 2 * this.data.cfg.diamond), (this.orginalDiamonLab.string = "" + this.data.cfg.diamond)) : ((this.diamondNumLab.string = this.data.cfg.diamond.toString()), (this.extraRateLab.node.active = !1), (this.rateNode.active = !1), (this.orginalDiamonLab.node.active = !1), (this.diamondNumLab.node.x = 0)), (this.title.string = this.data.getName()), (this.costLab.string = o.default.Platform.getPrice(this.data.cfg.payId)); } updateItem() { this.data.buyCnt = 11 this.data.buyCnt && ((this.diamondNumLab.string = this.data.cfg.diamond.toString()), (this.extraRateLab.node.active = !1), (this.rateNode.active = !1), (this.orginalDiamonLab.node.active = !1), (this.diamondNumLab.node.x = 0)); } onTouchBuyBtn() { const t = Object.create(null, { onTouchBuyBtn: { get: () => super.onTouchBuyBtn } }); return s(this, void 0, void 0, function* () { yield t.onTouchBuyBtn.call(this), this.updateItem(); }); } }; e([n(cc.Label)], t.prototype, "title", void 0), e([n(cc.Label)], t.prototype, "diamondNumLab", void 0), e([n(cc.Label)], t.prototype, "extraRateLab", void 0), e([n(cc.Node)], t.prototype, "rateNode", void 0), e([n(cc.Label)], t.prototype, "orginalDiamonLab", void 0), (t = e([r, l("view/Shop/item/DiamondShopItem")], t)), (i.DiamondShopItem = t);