Kaynağa Gözat

【fix】【登录】AppStore-免费版,忘记密码-输入未注册的账号,提示未注册时点击确定,返回注册页面需要自动发送一封验证码

tangchao 6 gün önce
ebeveyn
işleme
5e13a05ab0

+ 4 - 3
PDF Office/PDF Master/MemberCenter/View/KMForgotPasswordView.swift

@@ -83,10 +83,11 @@ class KMForgotPasswordView: KMBaseXibView {
         emailErrorLabel.isHidden = !viewModel.emailError()
     }
     
-    private func skipSignUpView() -> Void {
+    private func skipSignUpView(sendCode: Bool) -> Void {
         guard let parentView = self.superview else { return }
         if parentView is NSBox {
             let model = KMSignUpViewModel()
+            model.sendCode = sendCode
             model.email = viewModel.email
             let signUpView = KMSignUpView(model: model, superView: parentView)
             NSAnimationContext.runAnimationGroup { context in
@@ -194,7 +195,7 @@ class KMForgotPasswordView: KMBaseXibView {
                     alert.addButton(withTitle: "OK")
                     let response = alert.runModal()
                     if response == .alertFirstButtonReturn {
-                        self.skipSignUpView()
+                        self.skipSignUpView(sendCode: true)
                     }
                 }
             }
@@ -202,7 +203,7 @@ class KMForgotPasswordView: KMBaseXibView {
     }
     
     @IBAction func backButtonAction(_ sender: NSButton) {
-        skipSignUpView()
+        skipSignUpView(sendCode: false)
     }
 }
 

+ 5 - 0
PDF Office/PDF Master/MemberCenter/View/KMSignUpView.swift

@@ -50,6 +50,11 @@ class KMSignUpView: KMBaseXibView {
         bindViewModel()
         languageLocalized()
         initializeUI()
+        
+        if model.sendCode {
+            self.viewModel.countDown(type: .login, callback: nil)
+            model.sendCode = false
+        }
     }
     
     public override init(frame frameRect: NSRect) {

+ 3 - 0
PDF Office/PDF Master/MemberCenter/ViewModel/KMSignUpViewModel.swift

@@ -78,6 +78,9 @@ class KMSignUpViewModel: ObservableObject {
     private var remainingSeconds: Int = 60
     
     var sendBoxSelect: Bool = false
+    
+    // 是否发送验证码
+    var sendCode = false
 
     // MARK: Public Method