LoginSuccess.ts 840 B

123456789101112131415161718192021222324252627282930313233
  1. import { _decorator, Node } from 'cc';
  2. import { UIViewID } from '@scripts/define/UIDefine';
  3. import { addBtnClick } from '@scripts/utils/UIHelper';
  4. import { AppKernel } from '@scripts/app/AppKernel';
  5. import { UIPopup } from '@scripts/framework/ui/UIPopup';
  6. const { ccclass, property } = _decorator;
  7. @ccclass('LoginSuccess')
  8. export class LoginSuccess extends UIPopup {
  9. readonly viewId = UIViewID.LoginSuccess;
  10. @property(Node)
  11. private btnClose: Node = null;
  12. @property(Node)
  13. private btnPlay: Node = null;
  14. protected onCreate(): void | Promise<void> {
  15. addBtnClick(this.btnClose, this.onBtnCloseClick, this);
  16. addBtnClick(this.btnPlay, this.onBtnPlayClick, this);
  17. }
  18. private async onBtnCloseClick() {
  19. await AppKernel.appLobby.onLoginSuccess();
  20. }
  21. private onBtnPlayClick() {
  22. this.onBtnCloseClick();
  23. }
  24. }