Browse Source

Merge branch 'develop_PDFReaderPro_V4.7.0' of git.kdan.cc:Mac_PDF/PDF_Office into develop_PDFReaderPro_V4.7.0

wangshuai 3 months ago
parent
commit
9be2eb31f5

+ 1 - 1
PDF Office/PDF Master/AppDelegate.swift

@@ -768,7 +768,7 @@ class AppDelegate: NSObject, NSApplicationDelegate, iRateDelegate{
 #if VERSION_FREE
         KMPrint("restoreSubscriptions ...")
         KMProductCompareWC.shared.orientation = false
-        KMProductCompareWC.shared.showWindowRestore(nil)
+        KMProductCompareWC.shared.showWindowRestore(sender)
 #else
         var vc: KMToolCompareWindowController? = nil
         vc = KMToolCompareWindowController.toolCompare(toolType: .Convert, selectNum: 0)

+ 1 - 3
PDF Office/PDF Master/MemberCenter/Model/KMMemberInfo.swift

@@ -413,9 +413,7 @@ import Cocoa
                             return true
                         }
                     } else if userScenarioType == .lite_type6 || userScenarioType == .lite_type12 {
-                        if KMMemberInfo.shared.vip_levels == "3" { //高级版本支持转档功能
-                            return true
-                        }
+                        return true
                     }
                     return false
                 }

+ 21 - 0
PDF Office/PDF Master/MemberCenter/WindowsController/KMFreeGetAIWC.swift

@@ -60,6 +60,20 @@ class KMFreeGetAIWC: NSWindowController {
         termsServiceLabel.isEditable = false
         termsServiceLabel.isSelectable = true
         termsServiceLabel.allowsEditingTextAttributes = true
+        
+        NotificationCenter.default.addObserver(
+            self,
+            selector: #selector(IAPSubscriptionLoadedNotification(_:)),
+            name: NSNotification.Name(rawValue: "KMIAPSubscriptionLoadedNotification"),
+            object: nil
+        )
+        
+        NotificationCenter.default.addObserver(
+            self,
+            selector: #selector(IAPSubscriptionLoadedNotification(_:)),
+            name: NSNotification.Name(rawValue: "KMIAPProductFailedNotification"),
+            object: nil
+        )
 
         let privacyPolicy = NSLocalizedString("Privacy Policy", tableName: "MemberCenterLocalizable", comment: "")
         let termsService = NSLocalizedString("Terms of Service", tableName: "MemberCenterLocalizable", comment: "")
@@ -92,11 +106,14 @@ class KMFreeGetAIWC: NSWindowController {
 #if VERSION_DMG
     // DMG
 #else
+            self.window?.showWaitingView()
+
     // AppStore 免费版本
             IAPProductsManager.default().makeSubProduct(IAPProductsManager.default().aiAllAccessPack12month_lite, discount: IAPProductsManager.default().isCancelAutoRenew())
 #endif
 #else
     // AppStore 付费版
+            self.window?.showWaitingView()
             IAPProductsManager.default().makeSubProduct(IAPProductsManager.default().aiAllAccessPack12month_pro, discount: IAPProductsManager.default().isCancelAutoRenew())
 #endif
 
@@ -130,4 +147,8 @@ class KMFreeGetAIWC: NSWindowController {
     @IBAction func laterButtonAction(_ sender: NSButton) {
         window?.close()
     }
+    
+    @objc func IAPSubscriptionLoadedNotification(_ notification: Notification) {
+        self.removeWaitingView((self.window?.contentView)!)
+    }
 }