Pārlūkot izejas kodu

【fix】 【新系统兼容】账户卡片,点击登出 或者 注销账户等,弹出的弹窗会盖在主界面后面

tangchao 1 nedēļu atpakaļ
vecāks
revīzija
2d22ea4ce3

+ 21 - 8
PDF Office/PDF Master/MemberCenter/ViewModel/KMUserInfoVCModel.swift

@@ -158,8 +158,12 @@ class KMUserInfoVCModel: ObservableObject {
      */
     func signOutAction() -> Void {
         NotificationCenter.default.post(name: NSNotification.Name("CloseMenuNotification"), object: nil)
-        KMMemberPromptWC.shared.showWindow(nil)
-        KMMemberPromptWC.shared.tipType = .logout
+        
+        DispatchQueue.main.async {
+            KMMemberPromptWC.shared.showWindow(nil)
+            KMMemberPromptWC.shared.window?.makeKeyAndOrderFront(nil)
+            KMMemberPromptWC.shared.tipType = .logout
+        }
     }
     
     /**
@@ -183,8 +187,11 @@ class KMUserInfoVCModel: ObservableObject {
                 let msg = resultDict.msg
                 if success {
                     self.refreshUserInfo { success, msg,resdic  in
-                        KMMemberPromptWC.shared.showWindow(nil)
-                        KMMemberPromptWC.shared.tipType = .cancelSignout
+                        DispatchQueue.main.async {
+                            KMMemberPromptWC.shared.showWindow(nil)
+                            KMMemberPromptWC.shared.window?.makeKeyAndOrderFront(nil)
+                            KMMemberPromptWC.shared.tipType = .cancelSignout
+                        }
                     }
                 } else {
                     print(msg as Any)
@@ -196,13 +203,19 @@ class KMUserInfoVCModel: ObservableObject {
                 (KMMemberInfo.shared.ai_payType == 1) {
                 // 在续订中用户提示退订
                 NotificationCenter.default.post(name: NSNotification.Name("CloseMenuNotification"), object: nil)
-                KMMemberPromptWC.shared.showWindow(nil)
-                KMMemberPromptWC.shared.tipType = .unsubscribe
+                DispatchQueue.main.async {
+                    KMMemberPromptWC.shared.showWindow(nil)
+                    KMMemberPromptWC.shared.window?.makeKeyAndOrderFront(nil)
+                    KMMemberPromptWC.shared.tipType = .unsubscribe
+                }
             } else {
                 // 手动注销
                 NotificationCenter.default.post(name: NSNotification.Name("CloseMenuNotification"), object: nil)
-                KMMemberPromptWC.shared.showWindow(nil)
-                KMMemberPromptWC.shared.tipType = .signout
+                DispatchQueue.main.async {
+                    KMMemberPromptWC.shared.showWindow(nil)
+                    KMMemberPromptWC.shared.window?.makeKeyAndOrderFront(nil)
+                    KMMemberPromptWC.shared.tipType = .signout
+                }
             }
         }
     }