123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- 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});
- const o = t("App"),
- a = t("BaseView"),
- n = t("ControllerConst"),
- r = t("BagConst"),
- l = t("ShopConst"),
- h = t("ShopNormalItem"),
- {property: c, ccclass: d, menu: u} = cc._decorator;
- t = class extends a.default {
- constructor() {
- super(...arguments),
- (this.titleLab = null),
- (this.priceLab = null),
- (this.originLab = null),
- (this.diamnodLab = null),
- (this.item = null),
- (this.btn = null),
- (this.finish = null),
- (this.controller = null),
- (this.bgType = 1),
- (this.data = null);
- }
- initUI() {
- super.initUI();
- }
- open(t) {
- super.open(),
- (t = t || this.controller.model.shopGiftDatas[l.ShopGiftType.REMOVE_AD_GIFT][0]),
- (this.data = t),
- (this.titleLab.string = this.data.getName());
- t = o.default.Platform.getPriceNum(this.data.cfg.payId);
- (this.priceLab.string = t + "元"),
- (this.diamnodLab.string = "" + this.data.cfg.diamond),
- this.data.cfg.rate && (this.originLab.string = Math.ceil(t / this.data.cfg.rate) + "元");
- const e = o.default.ControllerManager.applyFunc(
- n.ControllerConst.Item,
- r.BagConst.GET_ITEM,
- this.data.items[1].id
- );
- this.item.setData(e.getItemPic(), "" + this.data.items[1].cnt),
- (this.btn.active = !this.data.isBuyGift()),
- (this.finish.active = this.data.isBuyGift());
- }
- onTouchBuyBtn() {
- console.log(n.ControllerConst.Shop);
- console.log(l.ShopConst.BUY);
- console.log(this.data);
-
-
- return s(this, void 0, void 0, function* () {
- (yield o.default.ControllerManager.applyFunc(n.ControllerConst.Shop, l.ShopConst.BUY, this.data)) &&
- this.closeView();
- });
- }
- };
- e([c(cc.Label)], t.prototype, "titleLab", void 0),
- e([c(cc.Label)], t.prototype, "priceLab", void 0),
- e([c(cc.Label)], t.prototype, "originLab", void 0),
- e([c(cc.Label)], t.prototype, "diamnodLab", void 0),
- e([c(h.ShopNormalItem)], t.prototype, "item", void 0),
- e([c(cc.Node)], t.prototype, "btn", void 0),
- e([c(cc.Node)], t.prototype, "finish", void 0),
- (t = e([d, u("view/Shop/ShopRemoveAdView")], t)),
- (i.default = t);
|