Преглед на файлове

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

tangchao преди 1 седмица
родител
ревизия
2d22ea4ce3
променени са 1 файла, в които са добавени 21 реда и са изтрити 8 реда
  1. 21 8
      PDF Office/PDF Master/MemberCenter/ViewModel/KMUserInfoVCModel.swift

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

@@ -158,8 +158,12 @@ class KMUserInfoVCModel: ObservableObject {
      */
      */
     func signOutAction() -> Void {
     func signOutAction() -> Void {
         NotificationCenter.default.post(name: NSNotification.Name("CloseMenuNotification"), object: nil)
         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
                 let msg = resultDict.msg
                 if success {
                 if success {
                     self.refreshUserInfo { success, msg,resdic  in
                     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 {
                 } else {
                     print(msg as Any)
                     print(msg as Any)
@@ -196,13 +203,19 @@ class KMUserInfoVCModel: ObservableObject {
                 (KMMemberInfo.shared.ai_payType == 1) {
                 (KMMemberInfo.shared.ai_payType == 1) {
                 // 在续订中用户提示退订
                 // 在续订中用户提示退订
                 NotificationCenter.default.post(name: NSNotification.Name("CloseMenuNotification"), object: nil)
                 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 {
             } else {
                 // 手动注销
                 // 手动注销
                 NotificationCenter.default.post(name: NSNotification.Name("CloseMenuNotification"), object: nil)
                 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
+                }
             }
             }
         }
         }
     }
     }