Browse Source

验证码页面释放问题

吴彦祖 10 months ago
parent
commit
5076bdfd52

BIN
ADHTuanCan.xcworkspace/xcuserdata/aodeheng.xcuserdatad/UserInterfaceState.xcuserstate


+ 0 - 16
ADHTuanCan.xcworkspace/xcuserdata/aodeheng.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -179,21 +179,5 @@
             landmarkType = "7">
          </BreakpointContent>
       </BreakpointProxy>
-      <BreakpointProxy
-         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
-         <BreakpointContent
-            uuid = "159E3A2C-2206-4A9E-9795-4037EF1E4DEB"
-            shouldBeEnabled = "Yes"
-            ignoreCount = "0"
-            continueAfterRunningActions = "No"
-            filePath = "ADHTuanCan/Class/&#x767b;&#x5f55;/&#x9a8c;&#x8bc1;&#x7801;/CodeViewController.swift"
-            startingColumnNumber = "9223372036854775807"
-            endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "22"
-            endingLineNumber = "22"
-            landmarkName = "phone"
-            landmarkType = "24">
-         </BreakpointContent>
-      </BreakpointProxy>
    </Breakpoints>
 </Bucket>

+ 14 - 3
ADHTuanCan/Class/登录/验证码/CodeViewController.swift

@@ -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"))
         })