AutoLogin.ts 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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 onBtnCloseClick() {
  20. AppKernel.ui.close(UIViewID.ResetPsd);
  21. const loginView = AppKernel.ui.get(UIViewID.LoginView) as any;
  22. if (loginView && loginView?.enabled) {
  23. loginView?._googleWebBtn?.setActive(true);
  24. }
  25. }
  26. private onBtnPlayClick() {
  27. this.onBtnCloseClick()
  28. }
  29. }