CostumeStatisticsView.js 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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 l = t("App"),
  18. s = t("BaseView"),
  19. h = t("GameUtils"),
  20. c = t("CostumeConst"),
  21. {ccclass: o, property: a} = cc._decorator;
  22. t = class extends s.default {
  23. constructor() {
  24. super(...arguments),
  25. (this.bg = null),
  26. (this.item = null),
  27. (this.content = null),
  28. (this.moneyRateLab = null),
  29. (this.widgetArr = []),
  30. (this.bgType = 1);
  31. }
  32. initUI() {
  33. super.initUI();
  34. }
  35. open() {
  36. super.open();
  37. }
  38. updateUI(t, e, i) {
  39. this.moneyRateLab.string = "+" + i + "%";
  40. let s = 0;
  41. for (var o in t) {
  42. var a = t[o];
  43. const i = cc.instantiate(this.item);
  44. this.content.addChild(i), i.setSiblingIndex(parseInt(o));
  45. var n = i.getComponent(cc.Sprite);
  46. (i.getComponentInChildren(cc.RichText).string = h.getCostumeAttrStr(parseInt(o), a.value)),
  47. l.default.CommonUtils.setSpriteFrame("Texture/quality/dk_" + a.gradeIndex, n),
  48. s++;
  49. }
  50. for (var r of e) {
  51. const t = cc.instantiate(this.item);
  52. this.content.addChild(t), t.setSiblingIndex(0);
  53. const e = t.getComponent(cc.Sprite);
  54. (t.getComponentInChildren(cc.RichText).string = r),
  55. l.default.CommonUtils.setSpriteFrame(c.getGradeBgByGrade(c.RarityType.mystic), e),
  56. s++;
  57. }
  58. this.item.removeFromParent(), (this.bg.height = 60 * s + 360);
  59. for (const l of this.widgetArr) l.updateAlignment();
  60. }
  61. };
  62. e([a(cc.Node)], t.prototype, "bg", void 0),
  63. e([a(cc.Node)], t.prototype, "item", void 0),
  64. e([a(cc.Node)], t.prototype, "content", void 0),
  65. e([a(cc.Label)], t.prototype, "moneyRateLab", void 0),
  66. e([a([cc.Widget])], t.prototype, "widgetArr", void 0),
  67. (t = e([o], t)),
  68. (i.default = t);