Forráskód Böngészése

【会员系统】付费比较表权益绑定检查

wanjun 1 hete
szülő
commit
05f881a22a

+ 1 - 1
PDF Office/PDF Master/MemberCenter/ViewModel/KMProductModel.swift

@@ -752,7 +752,7 @@ class KMProductModel: ObservableObject {
                 if IAPProductsManager.default().fourDevicesAllAccessPack12months_pro.isSubscribed {
                     isSubscribed = true
                 }
-            } else if productId == "com.pdfreaderpro.mac.advanced_add_devices_all_access_pack_advanced_annual.001" {
+            } else if productId == "com.pdfreaderpro.mac.standard_add_devices_all_access_pack_advanced_annual.001" {
                 productCode = "advanced-annual-subscription-standard-upgrade"
                 if IAPProductsManager.default().standardAddDevicesAllAccessPack12months_pro.isSubscribed {
                     isSubscribed = true

+ 16 - 9
PDF Office/PDF Master/MemberCenter/WindowsController/KMProductCompareWC.swift

@@ -66,9 +66,9 @@ class KMProductCompareWC: NSWindowController {
     @IBOutlet @objc weak var standardPlanInfoLabel: NSTextField!
     @IBOutlet @objc weak var standardPlanPurchaseLabel: NSTextField!
     @IBOutlet @objc weak var standardPlanPurchaseSubLabel: NSTextField!
-    @IBOutlet @objc weak var standardPlanPurchaseButton: KMButton!
+    @IBOutlet @objc weak var standardPlanPurchaseButton: NSButton!
     @IBOutlet @objc weak var standardPlanPurchaseLbl: NSTextField!
-    @IBOutlet @objc weak var standardPlanPurchaseLblBtn: KMButton!
+    @IBOutlet @objc weak var standardPlanPurchaseLblBtn: NSButton!
     @IBOutlet @objc weak var standardPlanPurchaseSubLabel2: NSTextField!
     
     // 高级版年订阅
@@ -76,9 +76,9 @@ class KMProductCompareWC: NSWindowController {
     @IBOutlet @objc weak var advancedPlanInfoLabel: NSTextField!
     @IBOutlet @objc weak var advancedPlanPurchaseLabel: NSTextField!
     @IBOutlet @objc weak var advancedPlanPurchaseSubLabel: NSTextField!
-    @IBOutlet @objc weak var advancedPlanPurchaseButton: KMButton!
+    @IBOutlet @objc weak var advancedPlanPurchaseButton: NSButton!
     @IBOutlet @objc weak var advancedPlanPurchaseLbl: NSTextField!
-    @IBOutlet @objc weak var advancedPlanPurchaseLblBtn: KMButton!
+    @IBOutlet @objc weak var advancedPlanPurchaseLblBtn: NSButton!
     @IBOutlet @objc weak var advancedPlanPurchaseSubLabel2: NSTextField!
     @IBOutlet weak var backgroundImage3: NSImageView!
     @IBOutlet @objc weak var discountPermanent2: NSImageView!
@@ -748,7 +748,9 @@ class KMProductCompareWC: NSWindowController {
 
         value1PurchaseBtnLbl.textColor = value1PurchaseBtnLblBtn.isEnabled ? NSColor.white : NSColor.white.withAlphaComponent(0.5)
         permanentPurchaseLblBtn.isEnabled = permanentPurchaseButton.isEnabled
-        
+        standardPlanPurchaseLblBtn.isEnabled = standardPlanPurchaseButton.isEnabled
+        advancedPlanPurchaseLblBtn.isEnabled = advancedPlanPurchaseButton.isEnabled
+
         let averageMonthPrice: String?
         let monthPrice: String?
         let averageMonthPriceDiscount: String?
@@ -1134,11 +1136,16 @@ class KMProductCompareWC: NSWindowController {
     @objc func IAPSubscriptionLoadedNotification(_ notification: Notification) {
         removeWaitingView(from: window?.contentView ?? NSView())
         reloadData()
-        if KMMemberInfo.shared.isLogin {
-            model.appStoreEquityVerification(notification) { success, msg in
-                KMUserInfoVCModel().refreshUserInfo { success, msg,dic  in
+        DispatchQueue.global().async { [weak self] in
+            guard let self = self else { return }
+            if KMMemberInfo.shared.isLogin {
+                self.model.appStoreEquityVerification(notification) { success, msg in
+                    KMUserInfoVCModel().refreshUserInfo { success, msg,dic  in
+                    }
+                    DispatchQueue.main.async {
+                        self.window?.close()
+                    }
                 }
-                self.window?.close()
             }
         }
     }