DayLoginItem.ts 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import { _decorator, Node, Label } from 'cc';
  2. import InfiniteCell from '../core/InfiniteList/InfiniteCell';
  3. import { BitmapFont } from '../core/ui/BitmapFont';
  4. const { ccclass, property } = _decorator;
  5. @ccclass('DayLoginItem')
  6. export class DayLoginItem extends InfiniteCell {
  7. @property({ type: BitmapFont })
  8. public dayLabel: BitmapFont = null;
  9. @property({ type: Node })
  10. public get: Node = null;
  11. @property({ type: Node })
  12. public over: Node = null;
  13. /**
  14. * 数据更新
  15. * @param data
  16. */
  17. UpdateContent(data: any) {
  18. if (data.day != "起点") {
  19. this.dayLabel.string = `${data.day}`;
  20. } else {
  21. this.dayLabel.string = "";
  22. }
  23. this.over.active = data.isOver;
  24. this.get.active = !data.isOver;
  25. // if (data.isCan) {
  26. // this.get.active = true;
  27. // } else {
  28. // this.get.active = false;
  29. // }
  30. // this.over.active = !this.get.active;
  31. // if (data.isOver) {
  32. // this.get.active = this.over.active = false;
  33. // }
  34. }
  35. }