Browse Source

【fix】【购买比较表】未登录时,点击内容编辑,比较表,跳过登录直接订阅半年包,订阅成功后,登录窗口和比较表未自动关闭

tangchao 3 tháng trước cách đây
mục cha
commit
b3345b4e57

+ 6 - 0
PDF Office/PDF Master/MemberCenter/WindowsController/KMLoginWindowsController.swift

@@ -139,6 +139,8 @@ class KMLoginWindowsController: NSWindowController {
                     return
                 }
                 
+                KMProductCompareWC.shared.closeWindow()
+                
                 if theProduct.isEqual(to: IAPProductsManager.default().fourDevicesAllAccessPackNew6Months_lite) || theProduct.isEqual(to: IAPProductsManager.default().fourDevicesAllAccessPackNew12months_lite) {
                     IAPProductsManager.default().makeSubProduct(theProduct, discount: self?.needDiscount_ ?? false)
                     return
@@ -232,6 +234,10 @@ class KMLoginWindowsController: NSWindowController {
         }
     }
     
+    public func closeWindow() {
+        window?.close()
+    }
+    
     // MARK: - Actions
     
     @objc func closeAction() {

+ 14 - 10
PDF Office/PDF Master/MemberCenter/WindowsController/KMProductCompareWC.swift

@@ -373,6 +373,10 @@ class KMProductCompareWC: NSWindowController {
         
         subscribeType_ = type
     }
+    
+    public func closeWindow() {
+        window?.close()
+    }
 
     // MARK: - Private Methods
     
@@ -1281,11 +1285,7 @@ class KMProductCompareWC: NSWindowController {
                 }
                 
                 let info = KMMemberInfo.shared
-                var expired = info.vip_status == 2 || info.vip_status == 4
-                let state = info.userScenarioType
-                let platforms = info.userPlatforms()
-                let vip_levels = info.vip_levels
-                let vip_paymentModel = info.vip_paymentModel
+                let expired = info.vip_status == 2 || info.vip_status == 4
                 if info.vip_levels == "1" || expired {
                     if self.model.isPurchaseSwitch { // 免费账户/订阅过期账户
                         IAPProductsManager.default().makeSubProduct(IAPProductsManager.default().fourDevicesAllAccessPackNew12months_lite, discount: self.model.isCancelAutoRenew)
@@ -1465,11 +1465,7 @@ class KMProductCompareWC: NSWindowController {
                     }
                     
                     let info = KMMemberInfo.shared
-                    var expired = info.vip_status == 2 || info.vip_status == 4
-                    let state = info.userScenarioType
-                    let platforms = info.userPlatforms()
-                    let vip_levels = info.vip_levels
-                    let vip_paymentModel = info.vip_paymentModel
+                    let expired = info.vip_status == 2 || info.vip_status == 4
                     if info.vip_levels == "1" || expired {
                         self.model.appstorePurchaseAction(sender.tag) { [weak self] success, msg in
                             
@@ -1508,6 +1504,14 @@ class KMProductCompareWC: NSWindowController {
         KMMainThreadExecute {
             self.removeWaitingView(from: self.window?.contentView ?? NSView())
             self.reloadData()
+            
+            if KMMemberInfo.shared.isLogin {
+     
+            } else {
+                if let _ = KMLoginWindowsController.shared.subscribeType { // 付费->比较表->购买回来后 需要关闭登陆窗口
+                    KMLoginWindowsController.shared.closeWindow()
+                }
+            }
         }
 
 #if VERSION_FREE