LoadBricsItem.ts 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. * @Author: mojunshou 1637302775@qq.com
  3. * @Date: 2025-04-18 15:09:04
  4. * @LastEditors: mojunshou 1637302775@qq.com
  5. * @LastEditTime: 2025-04-19 16:25:14
  6. * @Description: 金砖道具
  7. */
  8. import { _decorator, Component, Label, Node, Sprite, SpriteFrame } from 'cc';
  9. import VMParent from 'db://oops-framework/libs/model-view/VMParent';
  10. import { smc } from '../common/SingletonModuleComp';
  11. const { ccclass, property } = _decorator;
  12. @ccclass('LoadBricsItem')
  13. export class LoadBricsItem extends VMParent {
  14. @property(Node)
  15. private brickNode: Node = null!;
  16. //完成Node
  17. @property(Node)
  18. private completeNode: Node = null!;
  19. @property(Label)
  20. private levelLabel: Label = null!;
  21. @property(Node)
  22. private circleNode: Node = null!;
  23. @property(Node)
  24. private showOver: Node = null!;
  25. data: any = {
  26. level: 0,
  27. eventType: "",
  28. withdraw: false,
  29. position: 0, //位置
  30. isFirstNotWithdraw: false, //是否第一个没提现
  31. }
  32. start() {
  33. }
  34. //更新数据
  35. updateData(data: any) {
  36. this.data = data;
  37. this.levelLabel.string = `${this.data.level}`;
  38. this.brickNode.active = !this.data.withdraw;
  39. this.completeNode.active = this.data.withdraw;
  40. //显示光圈
  41. if (this.data.level === smc.account.AccountModel.curLevel) {
  42. this.circleNode.active = true;
  43. } else {
  44. this.circleNode.active = false;
  45. }
  46. this.showOver.active = this.data.isFirstNotWithdraw;
  47. }
  48. }