AutoLogin.ts 1023 B

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