RedPackeWithdrawalViewComp.ts 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * @Author: mojunshou 1637302775@qq.com
  3. * @Date: 2025-03-20 17:53:50
  4. * @LastEditors: mojunshou 1637302775@qq.com
  5. * @LastEditTime: 2025-03-28 15:16:02
  6. * @Description: 红包提现
  7. */
  8. import { _decorator } from "cc";
  9. import { oops } from "db://oops-framework/core/Oops";
  10. import { ecs } from "db://oops-framework/libs/ecs/ECS";
  11. import { CCComp } from "db://oops-framework/module/common/CCComp";
  12. import { UIID } from "../../common/config/GameUIConfig";
  13. const { ccclass, property } = _decorator;
  14. /** 视图层对象 */
  15. @ccclass('RedEnvelopeWithdrawalViewComp')
  16. @ecs.register('RedEnvelopeWithdrawalView', false)
  17. export class RedEnvelopeWithdrawalViewComp extends CCComp {
  18. /** 视图层逻辑代码分离演示 */
  19. start() {
  20. // const entity = this.ent as ecs.Entity; // ecs.Entity 可转为当前模块的具体实体对象
  21. this.setButton();
  22. }
  23. /** 视图对象通过 ecs.Entity.remove(RedEnvelopeWithdrawalViewComp) 删除组件是触发组件处理自定义释放逻辑 */
  24. reset() {
  25. this.node.destroy();
  26. }
  27. private btn_back() {
  28. oops.gui.remove(UIID.RedPacketWithdraw);
  29. }
  30. private btn_record() {
  31. oops.gui.open(UIID.WithdrawRecord);
  32. }
  33. }