// // YBYoungModifyVC.m // YBVideo // // Created by YB007 on 2022/6/2. // Copyright © 2022 cat. All rights reserved. // #import "YBYoungModifyVC.h" #import "RKCodeInputView.h" @interface YBYoungModifyVC () @property(nonatomic,strong)RKCodeInputView *civOld; //旧密码 @property(nonatomic,strong)RKCodeInputView *civNew; //新密码 @property(nonatomic,strong)RKCodeInputView *civSure; //确认密码 @property(nonatomic,strong)YBButton *modifyBtn; @end @implementation YBYoungModifyVC - (UIStatusBarStyle)preferredStatusBarStyle { if (@available(iOS 13.0,*)) { return UIStatusBarStyleDarkContent; } return UIStatusBarStyleDefault; } - (void)viewDidLoad { [super viewDidLoad]; self.titleL.text = YZMsg(@"修改密码"); self.titleL.textColor = RGB_COLOR(@"#323232", 1); [self.leftBtn setImage:[UIImage imageNamed:@"pubBlack_back"] forState:0]; self.subNavi.backgroundColor = UIColor.whiteColor; self.view.backgroundColor = UIColor.whiteColor; YBWeakSelf; NSArray *titleA = @[@"请输入当前密码",@"请输入新的密码",@"请确定新的密码"]; MASViewAttribute *mas_top = self.naviView.mas_bottom; for (int i =0 ; i=4 && _civNew.codeText.length>=4 && _civSure.codeText.length>=4) { _modifyBtn.enabled = YES; _modifyBtn.selected = YES; }else{ _modifyBtn.enabled = NO; _modifyBtn.selected = NO; } } -(void)inputFinish:(RKCodeInputView *)finishInput { if (finishInput == _civOld) { _civNew.becomeFirstRes = YES; }else if(finishInput == _civNew){ _civSure.becomeFirstRes = YES; } } -(void)resetAll { [_civOld clearText]; [_civNew clearText]; [_civSure clearText]; [_civNew cancelCursor]; [_civSure cancelCursor]; _civOld.becomeFirstRes = YES; [self changeEvent]; } -(void)clickModifyBtn { /** * type(1设置密码并开启 2开启青少年模式 3关闭青少年模式 4修改密码 5重新设置密码) * pwd当前密码 newpwd 修改新密码 newspwd 确认新密码 */ NSDictionary *postDic = @{ @"type":@"4", @"pwd":_civOld.codeText, @"newpwd":_civNew.codeText, @"newspwd":_civSure.codeText, }; YBWeakSelf; [YBNetworking postWithUrl:@"User.setTeenagers" Dic:postDic Suc:^(int code, id info, NSString *msg) { [MBProgressHUD showError:msg]; if (code == 0) { [[YBBaseAppDelegate sharedAppDelegate] popViewController:YES]; }else{ [weakSelf resetAll]; } } Fail:^(id fail) { [weakSelf resetAll]; }]; } @end