MaillistItem.js 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. var t = require;
  2. var e = module;
  3. var a = 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(a, "__esModule", {value: !0}), (a.ReadColor = a.NotReadColor = void 0);
  17. const n = t("App"),
  18. i = t("SwitchFrame"),
  19. s = t("NotificationConst"),
  20. r = (t("ViewConst"), t("MailController"));
  21. (a.NotReadColor = cc.color().fromHEX("#B86860")), (a.ReadColor = cc.color().fromHEX("#B6B6B6"));
  22. const {ccclass: o, property: l} = cc._decorator;
  23. t = class extends cc.Component {
  24. constructor() {
  25. super(...arguments),
  26. (this.mailIconFrame = null),
  27. (this.title = null),
  28. (this.expireTime = null),
  29. (this.expireTimeOutline = null),
  30. (this.id = 0),
  31. (this.state = 0);
  32. }
  33. setData(t, e, i, s, o) {
  34. n.default.DateUtils.getTimezoneOffset(), (this.id = t), (this.state = o), (this.title.string = e);
  35. i = new Date(1e3 * i).Format("yyyy-MM-dd");
  36. (this.expireTime.string = i),
  37. o === r.MailStatus.new
  38. ? ((this.expireTimeOutline.color = a.NotReadColor), (this.mailIconFrame.frameIndex = 0))
  39. : ((this.expireTimeOutline.color = a.ReadColor), (this.mailIconFrame.frameIndex = 1));
  40. }
  41. onTouchEmail() {
  42. console.log("参数", this.id, this.state),
  43. n.default.ViewManager.open(44, this.id, this.state),
  44. n.default.NotificationCenter.dispatch(s.NotificationConst.UPDATE_MAIL_LIST);
  45. }
  46. };
  47. e([l(i.default)], t.prototype, "mailIconFrame", void 0),
  48. e([l(cc.Label)], t.prototype, "title", void 0),
  49. e([l(cc.Label)], t.prototype, "expireTime", void 0),
  50. e([l(cc.LabelOutline)], t.prototype, "expireTimeOutline", void 0),
  51. (t = e([o], t)),
  52. (a.default = t);