SKLoginViewController.m 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. //
  2. // SKLoginViewController.m
  3. // SikeyComm
  4. //
  5. // Created by 刘振兴 on 2024/2/5.
  6. // Copyright © 2024 BaH Cy. All rights reserved.
  7. //
  8. #import "SKLoginViewController.h"
  9. #import "SKLoginViewController+guide.h"
  10. #import "SKLoginViewController+thirdparty.h"
  11. #import "BlackDoorManager+click.h"
  12. #import "UserDataHelper.h"
  13. @interface SKLoginViewController ()
  14. @end
  15. @implementation SKLoginViewController
  16. - (void)viewDidLoad {
  17. [super viewDidLoad];
  18. [self createGoogleFacebook];
  19. [BlackDoorManager addBlackDoorButtons:self.view];
  20. [self createGuideView];
  21. [self initAccountType];
  22. [UserDataHelper setHasLogin:NO];
  23. [self autoAccount];
  24. }
  25. - (void)autoAccount {
  26. NSString *account = [UserDataHelper getUserName];
  27. NSString *passWord = [UserDataHelper getUserPassword:account];
  28. [self.mPhoneNumTextField setText:account];
  29. [self.mPwdTextField setText:passWord];
  30. [self.mEmailNumTextField setText:account];
  31. [self.mPwdTextField setText:passWord];
  32. #ifdef SK_DEBUG_ACCOUNT
  33. self.mEmailNumTextField.text = @"131459421@163.com";
  34. self.mPwdTextField.text = @"liu123456";
  35. self.mPhoneNumTextField.text = @"18616012216";
  36. self.mPhoneNumTextField.text = @"liu123456";
  37. #endif
  38. }
  39. - (void)viewWillAppear:(BOOL)animated {
  40. [super viewWillAppear:animated];
  41. [self.navigationController setNavigationBarHidden:YES];
  42. self.title = @"";
  43. //防止自动登陆时,联网屏蔽界面,但是未知原因,退出到登陆界面,导致屏幕不能点击问题//
  44. [[[UIApplication sharedApplication] delegate].window setUserInteractionEnabled:YES];
  45. }
  46. - (void)viewWillDisappear:(BOOL)animated {
  47. [super viewWillDisappear:animated];
  48. self.title = @"";
  49. }
  50. - (IBAction)onForgetPassWord:(id)sender {
  51. [MobClick event:@"ClickForgetPassWord"];
  52. UIViewController *controller = [[self storyboard] instantiateViewControllerWithIdentifier:@"ForgetPassWordVC"];
  53. [self pushViewController:controller animated:YES];
  54. }
  55. - (IBAction)onRegister:(id)sender {
  56. [MobClick event:@"ClickRegister"];
  57. UIViewController *controller = [[self storyboard] instantiateViewControllerWithIdentifier:@"RegisterVC"];
  58. [self pushViewController:controller animated:YES];
  59. }
  60. - (IBAction)confirmAction:(id)sender{
  61. [[UIApplication sharedApplication].keyWindow endEditing:YES];
  62. if ([self checkAccount] == NO)
  63. return;
  64. [self confirmActionEx];
  65. }
  66. - (void)confirmActionEx {
  67. int area = [UserDataHelper getLoginType];
  68. if (area == 0) {
  69. [self phoneLoginRequest];
  70. } else {
  71. [self emailLoginRequest];
  72. }
  73. }
  74. @end