ShopBuffView.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. var t = require;
  2. var e = module;
  3. var i = exports;
  4. e =
  5. (this && this.__decorate) ||
  6. function (t, e, i, s) {
  7. var o,
  8. a = arguments.length,
  9. n = a < 3 ? e : null === s ? (s = Object.getOwnPropertyDescriptor(e, i)) : s;
  10. if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) n = Reflect.decorate(t, e, i, s);
  11. else
  12. for (var r = t.length - 1; 0 <= r; r--)
  13. (o = t[r]) && (n = (a < 3 ? o(n) : 3 < a ? o(e, i, n) : o(e, i)) || n);
  14. return 3 < a && n && Object.defineProperty(e, i, n), n;
  15. };
  16. Object.defineProperty(i, "__esModule", { value: !0 });
  17. const s = t("BaseView"),
  18. o = t("ShopConst"),
  19. a = t("ShopBuffItem"),
  20. { property: n, ccclass: r, menu: l } = cc._decorator;
  21. t = class extends s.default {
  22. constructor() {
  23. super(...arguments),
  24. (this.content = null),
  25. (this.item = null),
  26. (this.controller = null),
  27. (this.bgType = 1),
  28. (this.shopItems = []);
  29. }
  30. initUI() {
  31. super.initUI();
  32. var s = this.controller.model.shopItemDatas[o.ShopType.BUFF];
  33. console.error(s);
  34. console.error(o.ShopType.BUFF);
  35. for (let i = 0; i < s.length; i++) {
  36. this.shopItems || (this.shopItems = []);
  37. let t = cc.instantiate(this.item);
  38. this.content.addChild(t);
  39. let e = t.getComponent(a.ShopBuffItem);
  40. e.setData(s[i]), e.showItem(), this.shopItems.push(e);
  41. }
  42. this.item.destroy();
  43. }
  44. open() {
  45. super.open(),
  46. this.shopItems.forEach(t => {
  47. t.updateBuffState();
  48. });
  49. }
  50. updateTime(e) {
  51. this.shopItems.forEach(t => {
  52. t.updateTime(e);
  53. });
  54. }
  55. };
  56. e([n(cc.Node)], t.prototype, "content", void 0),
  57. e([n(cc.Node)], t.prototype, "item", void 0),
  58. (t = e([r, l("view/Shop/ShopBuffView")], t)),
  59. (i.default = t);