|
@@ -88,11 +88,19 @@ class CodeViewController: ADHBaseVC {
|
|
|
|
|
|
self.typeLab.text = LanguagesUtil.createTextBy(Ctext: "验证码发送至\(phone ?? "")", Etext: "Text to +\(phone ?? "")")
|
|
|
|
|
|
- self.codeCountdown(isCodeTimer: true)
|
|
|
self.getCode()
|
|
|
|
|
|
}
|
|
|
|
|
|
+ override func viewWillDisappear(_ animated: Bool) {
|
|
|
+ super.viewWillDisappear(true)
|
|
|
+ self.codeCountdown(isCodeTimer: false)
|
|
|
+ //注销计时器
|
|
|
+ codeTimer.cancel()
|
|
|
+ //移除通知
|
|
|
+ addNotification(isAdd: false)
|
|
|
+ }
|
|
|
+
|
|
|
func addNotification(isAdd:Bool) {
|
|
|
|
|
|
if isAdd {
|
|
@@ -181,8 +189,11 @@ class CodeViewController: ADHBaseVC {
|
|
|
func getCode(){
|
|
|
self.viewModel.signalGetGetCode()?.on(success: { dd in
|
|
|
self.codeDetail = self.viewModel.codeModel!
|
|
|
- self.hud.showSuccess()
|
|
|
-
|
|
|
+
|
|
|
+ if self.codeDetail.id?.count ?? 0 > 0{
|
|
|
+ self.codeCountdown(isCodeTimer: true)
|
|
|
+ self.hud.showSuccess()
|
|
|
+ }
|
|
|
}, error: { error in
|
|
|
self.hud.showFailure(error.msg ?? LanguagesUtil.createTextBy(Ctext: "网络错误", Etext: "network error"))
|
|
|
})
|