SKForgetPassWordViewController.m 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #import "SKForgetPassWordViewController.h"
  2. #import "SKEnterPassWordViewController.h"
  3. @implementation SKForgetPassWordViewController
  4. - (void)viewDidLoad {
  5. [super viewDidLoad];
  6. // Do any additional setup after loading the view.
  7. [self.navigationController setNavigationBarHidden:NO];
  8. if (@available(iOS 11.0, *)) {
  9. [self.navigationItem setLargeTitleDisplayMode:UINavigationItemLargeTitleDisplayModeAlways];
  10. self.edgesForExtendedLayout = UIRectEdgeAll;
  11. }
  12. [self setNavigationBarColor:1];
  13. [self initAccountType];
  14. #ifdef SK_DEBUG_ACCOUNT
  15. self.mEmailNumTextField.text = @"131459421@163.com";
  16. self.mPwdNewTextField.text = @"liu1234567";
  17. self.mPhoneNumTextField.text = @"18616012216";
  18. self.mPhoneNumTextField.text = @"liu1234567";
  19. #endif
  20. }
  21. - (void)viewWillAppear:(BOOL)animated {
  22. [super viewWillAppear:animated];
  23. [self.navigationController setNavigationBarHidden:NO];
  24. self.title = NSLocalizedString(@"Reset.Passcode.Title", nil);//@"重置密码";
  25. }
  26. - (void)viewWillDisappear:(BOOL)animated {
  27. [super viewWillDisappear:animated];
  28. self.title = @"";
  29. }
  30. - (IBAction)phoneCaptchaCodeAction:(id)sender {
  31. if (![self checkPhoneNumTextField]) {
  32. return;
  33. }
  34. [self requstPhoneCaptchaCode];
  35. [self startTimer];
  36. }
  37. - (IBAction)emailCaptchaCodeAction:(id)sender {
  38. if (![self checkEmailNumTextField]) {
  39. return;
  40. }
  41. [self requstEmailCaptchaCode];
  42. [self startTimer];
  43. }
  44. - (IBAction)confirmAction:(id)sender{
  45. [[UIApplication sharedApplication].keyWindow endEditing:YES];
  46. if ([self checkAccount] == NO)
  47. return;
  48. int area = [UserDataHelper getLoginType];
  49. SKEnterPassWordViewController* controller = [[self storyboard] instantiateViewControllerWithIdentifier:@"EnterPassWordVC"];
  50. if (area == 0) {
  51. NSString* areaCode = [self.mPhoneCountryLabel.text stringByReplacingOccurrencesOfString:@"+" withString:@""];
  52. controller.mAreaCode = areaCode;
  53. controller.mAccount = self.mPhoneNumTextField.text;
  54. controller.mCaptcha = self.mPhoneCaptchaTextField.text;
  55. } else {
  56. controller.mAccount = self.mEmailNumTextField.text;
  57. controller.mCaptcha = self.mEmailCaptchaLocalTextField.text;
  58. }
  59. [self pushViewController:controller animated:YES];
  60. }
  61. #pragma mark -
  62. - (void)onTimerCallback:(NSInteger)timeLeft {
  63. [self refreshCaptchaButton:timeLeft];
  64. }
  65. @end