| | |
| | | super.viewDidAppear(animated) |
| | | c1.becomeFirstResponder() |
| | | c1.jq_borderWidth = 1 |
| | | starTimer() |
| | | sendCode() |
| | | } |
| | | |
| | | override func viewDidLoad() { |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | private func sendCode(){ |
| | | Services.sendCode(type: .forgetPwd).subscribe(onNext: { _ in |
| | | self.starTimer() |
| | | }).disposed(by: disposeBag) |
| | | } |
| | | |
| | | private func starTimer(){ |
| | | times = 60 |
| | | btn_retry.isEnabled = false |
| | |
| | | } |
| | | |
| | | @IBAction func checkingAction(_ sender: UIButton) { |
| | | view.endEditing(true) |
| | | if inputCode.count != 6{ |
| | | alertError(msg: "请输入验证码");return |
| | | } |
| | | view.endEditing(true) |
| | | Popup_1_View.show(state: .success, title: "验证成功", subtitle:"手机号验证成功") { |
| | | let vc = ForgotPasswordChangeVC() |
| | | self.push(vc: vc) |
| | | } |
| | | |
| | | Services.forgotPwdVerifyCode(cellPhone: phone, captcha: inputCode).subscribe(onNext: {data in |
| | | if data.data?.successFlag ?? false{ |
| | | Popup_1_View.show(state: .success, title: "验证成功", subtitle:"手机号验证成功") { |
| | | let vc = ForgotPasswordChangeVC(phone:self.phone,secretCode: data.data?.secret ?? "") |
| | | self.push(vc: vc) |
| | | } |
| | | }else{ |
| | | Popup_1_View.show(state: .fail, title: "验证失败", subtitle:"手机号验证失败") { |
| | | |
| | | } |
| | | } |
| | | }).disposed(by: disposeBag) |
| | | |
| | | } |
| | | |
| | | @IBAction func tryAgainAction(_ sender: UIButton) { |
| | | view.endEditing(true) |
| | | starTimer() |
| | | sendCode() |
| | | } |
| | | |
| | | |