SKLoginViewController.m 2.5 KB

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