浏览代码

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

tangchao 2 天之前
父节点
当前提交
fc44be9ed2

+ 5 - 1
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController.swift

@@ -1035,7 +1035,11 @@ import Cocoa
                             var vc = KMToolCompareWindowController(toolType: .Convert, selectNum: 1)
                             vc.showWindow(nil)
                         }
-                        
+                        let userScenarioType = KMMemberInfo.shared.userScenarioType
+                        let platforms = KMMemberInfo.shared.vip_platforms
+                        let platformsArray = platforms
+                            .components(separatedBy: ",")
+                            .map { $0.trimmingCharacters(in: .whitespaces) }
                         if userScenarioType == .lite_type2 ||
                                     userScenarioType == .lite_type4 ||
                                     userScenarioType == .lite_type6 ||

+ 23 - 23
PDF Office/PDF Master/MemberCenter/WindowsController/KMProductCompareWC.swift

@@ -408,6 +408,17 @@ class KMProductCompareWC: NSWindowController {
             advancedPlanPurchaseLabel.stringValue = model.getProductPrice(.pdfReaderProAdvanced_dmg)
         }
 #else
+        var isTrialPeriod = false
+        if IAPProductsManager.default().fourDevicesAllAccessPackNew12months_lite.isTrialPeriod == true {
+            isTrialPeriod = true
+        }
+        if(!isTrialPeriod &&
+           KMMemberInfo.shared.canTrail) {
+            if(model.state == .trial) {
+                advancedPlanPurchaseLbl.stringValue = NSLocalizedString("Free Trial", comment: "")
+            }
+        }
+
     // AppStore 免费版本
         if model.state == .lite_Base {
             permanentPurchaseLabel.stringValue = model.getProductPrice(.allAccessPackPermanent_lite)
@@ -743,34 +754,23 @@ class KMProductCompareWC: NSWindowController {
         let isSubscribed_year = fourDevicesAllAccessPackNew12months_lite?.isSubscribed ?? false
         let introductoryPrice_newlyMonth = fourDevicesAllAccessPackNew6Months_lite?.product?.introductoryPrice
         let introductoryPrice_year = fourDevicesAllAccessPackNew12months_lite?.product?.introductoryPrice
-
-        if isTrialPeriod_newlyMonth {
-            value1PurchaseBtnLbl.stringValue = NSLocalizedString("Subscribe", comment: "")
-            if isSubscribed_newlyMonth {
-                value1PurchaseBtnLbl.stringValue = NSLocalizedString("Subscribed", comment: "")
-            }
-        } else if isTrialPeriod_year {
-            value1PurchaseBtnLbl.stringValue = NSLocalizedString("Subscribe", comment: "")
-            if isSubscribed_year {
-                value1PurchaseBtnLbl.stringValue = NSLocalizedString("Subscribed", comment: "")
-            }
+        
+        if(isSubscribed_newlyMonth || isSubscribed_year) {
+            value1PurchaseBtnLbl.stringValue = NSLocalizedString("Subscribed", comment: "")
         } else {
-            if isSubscribed_newlyMonth || isSubscribed_year {
-                value1PurchaseBtnLbl.stringValue = NSLocalizedString("Subscribed", comment: "")
-            } else {
-                value1PurchaseBtnLbl.stringValue = NSLocalizedString("Free Trial", comment: "")
-                if #available(macOS 10.13.2, *) {
-    #if !VERSION_DMG
-                    if introductoryPrice_newlyMonth == nil {
-                        value1PurchaseBtnLbl.stringValue = NSLocalizedString("Subscribe", comment: "")
-                    } else if introductoryPrice_year == nil {
-                        value1PurchaseBtnLbl.stringValue = NSLocalizedString("Subscribe", comment: "")
-                    }
-    #endif
+            if(model.isPurchaseSwitch == true) {
+                if(!isTrialPeriod_year &&
+                   KMMemberInfo.shared.canTrail) {
+                    value1PurchaseBtnLbl.stringValue = NSLocalizedString("Free Trial", comment: "")
+                } else {
+                    value1PurchaseBtnLbl.stringValue = NSLocalizedString("Subscribe", comment: "")
                 }
+            } else {
+                value1PurchaseBtnLbl.stringValue = NSLocalizedString("Subscribe", comment: "")
             }
         }
 
+
         value1PurchaseBtnLbl.textColor = value1PurchaseBtnLblBtn.isEnabled ? NSColor.white : NSColor.white.withAlphaComponent(0.5)
         permanentPurchaseLblBtn.isEnabled = permanentPurchaseButton.isEnabled
         standardPlanPurchaseLblBtn.isEnabled = standardPlanPurchaseButton.isEnabled