// // ModifyPhoneCheckController.m // TeacherDaya // // Created by Kyle on 2020/3/9. // Copyright © 2020 DayaMusic. All rights reserved. // #import "ModifyPhoneCheckController.h" #import "PhoneCheckBodyView.h" #import "ModifyPhoneChangeController.h" #import "UserInfoManager.h" @interface ModifyPhoneCheckController () @property (nonatomic, strong) PhoneCheckBodyView *bodyView; @end @implementation ModifyPhoneCheckController - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. [self allocTitle:@"修改手机号"]; [self configUI]; } - (void)configUI { self.bodyView = [PhoneCheckBodyView shareInstance]; _bodyView.frame = CGRectMake(0, 0, kScreenWidth, kScreenHeight - kNaviBarHeight - iPhoneXSafeBottomMargin); _bodyView.phoneField.userInteractionEnabled = NO; _bodyView.phoneField.text = USER_MANAGER.userInfo.phone; MJWeakSelf; [_bodyView sureCallback:^(NSString * _Nonnull phoneNo, NSString * _Nonnull pwdStr) { [weakSelf checkWithPhone:phoneNo password:pwdStr]; }]; [self.scrollView addSubview:_bodyView]; } - (void)checkWithPhone:(NSString *)phoneNo password:(NSString *)password { [self showhud]; [KSRequestManager checkUserRequest:KS_GET phone:phoneNo password:password success:^(NSDictionary * _Nonnull dic) { [self removehub]; if ([dic integerValueForKey:@"code"] == 200 && [dic boolValueForKey:@"status"]) { [self nextChangeViewWithWithPhone:phoneNo]; } else { [self MBPShow:MESSAGEKEY]; } } faliure:^(NSError * _Nonnull error) { [self removehub]; }]; } - (void)nextChangeViewWithWithPhone:(NSString *)phone { ModifyPhoneChangeController *changeCtrl = [[ModifyPhoneChangeController alloc] init]; changeCtrl.prePhone = phone; [self.navigationController pushViewController:changeCtrl animated:YES]; } /* #pragma mark - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { // Get the new view controller using [segue destinationViewController]. // Pass the selected object to the new view controller. } */ @end