Browse Source

【会员系统】比较表价格调整

wanjun 3 months ago
parent
commit
471ea35a24

+ 4 - 0
PDF Office/PDF Master/MemberCenter/Model/KMMemberInfo.swift

@@ -1110,9 +1110,13 @@ import Cocoa
                             return false
                         }
                     } else {
+#if VERSION_DMG
                         let embeddedWC = KMPurchaseEmbeddedWindowController.currentCode(KMAISubscriptionMonthCodeKey_DMG)
                         embeddedWC.showWindow(nil)
                         embeddedWC.window?.center()
+#else
+                        AIPurchaseWindowController.currentWC().showWindow(nil)
+#endif
                         return false
                     }
                 }

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

@@ -429,20 +429,20 @@ class KMProductModel: ObservableObject {
 #if VERSION_DMG
     // DMG
             if type == .pdfReaderProStandard_dmg {
-                if NSLocalizedString("USD", tableName: "MemberCenterLocalizable", comment: "") == "CN" {
+                if NSLocalizedString("USD", tableName: "MemberCenterLocalizable", comment: "") == "USD" {
                     return String(format: "USD $%@", getDMGPrice(productCode: KMStandardAnnualSubscriptionCodeKey_DMG))
                 } else {
                     return String(format: "CNY ¥%@", getDMGCNYPrice(productCode: KMStandardAnnualSubscriptionCodeKey_DMG))
                 }
             } else if type == .pdfReaderProAdvanced_dmg {
                 if isBlackFive {
-                    if NSLocalizedString("USD", tableName: "MemberCenterLocalizable", comment: "") == "CN" {
+                    if NSLocalizedString("USD", tableName: "MemberCenterLocalizable", comment: "") == "USD" {
                         return String(format: "USD $%@", getDMGPrice(productCode: KMAdvancedAnnualSubscriptionBlackFiveCodeKey_DMG))
                     } else {
                         return String(format: "CNY ¥%@", getDMGCNYPrice(productCode: KMAdvancedAnnualSubscriptionBlackFiveCodeKey_DMG))
                     }
                 } else {
-                    if NSLocalizedString("USD", tableName: "MemberCenterLocalizable", comment: "") == "CN" {
+                    if NSLocalizedString("USD", tableName: "MemberCenterLocalizable", comment: "") == "USD" {
                         return String(format: "USD $%@", getDMGPrice(productCode: KMAdvancedAnnualSubscriptionCodeKey_DMG))
                     } else {
                         return String(format: "CNY ¥%@", getDMGCNYPrice(productCode: KMAdvancedAnnualSubscriptionCodeKey_DMG))
@@ -450,26 +450,26 @@ class KMProductModel: ObservableObject {
                 }
             } else if type == .pdfReaderProPermanent_dmg {
                 if isBlackFive {
-                    if NSLocalizedString("USD", tableName: "MemberCenterLocalizable", comment: "") == "CN" {
+                    if NSLocalizedString("USD", tableName: "MemberCenterLocalizable", comment: "") == "USD" {
                         return String(format: "USD $%@", getDMGPrice(productCode: KMAdvancedPermanentBlackFiveCodeKey_DMG))
                     } else {
                         return String(format: "CNY ¥%@", getDMGCNYPrice(productCode: KMAdvancedPermanentBlackFiveCodeKey_DMG))
                     }
                 } else {
-                    if NSLocalizedString("USD", tableName: "MemberCenterLocalizable", comment: "") == "CN" {
+                    if NSLocalizedString("USD", tableName: "MemberCenterLocalizable", comment: "") == "USD" {
                         return String(format: "USD $%@", getDMGPrice(productCode: KMAdvancedPermanentCodeKey_DMG))
                     } else {
                         return String(format: "CNY ¥%@", getDMGCNYPrice(productCode: KMAdvancedPermanentCodeKey_DMG))
                     }
                 }
             } else if type == .pdfReaderProAIAnnual_dmg {
-                if NSLocalizedString("USD", tableName: "MemberCenterLocalizable", comment: "") == "CN" {
+                if NSLocalizedString("USD", tableName: "MemberCenterLocalizable", comment: "") == "USD" {
                     return String(format: "USD $%@", getDMGPrice(productCode: KMAISubscriptionYearTrailCodeKey_DMG))
                 } else {
                     return String(format: "CNY ¥%@", getDMGCNYPrice(productCode: KMAISubscriptionYearTrailCodeKey_DMG))
                 }
             } else if type == .pdfReaderProAIMonthly_dmg {
-                if NSLocalizedString("USD", tableName: "MemberCenterLocalizable", comment: "") == "CN" {
+                if NSLocalizedString("USD", tableName: "MemberCenterLocalizable", comment: "") == "USD" {
                     return String(format: "USD $%@", getDMGPrice(productCode: KMAISubscriptionMonthCodeKey_DMG))
                 } else {
                     return String(format: "CNY ¥%@", getDMGCNYPrice(productCode: KMAISubscriptionMonthCodeKey_DMG))

+ 13 - 8
PDF Office/PDF Master/MemberCenter/WindowsController/KMProductCompareWC.swift

@@ -379,14 +379,19 @@ class KMProductCompareWC: NSWindowController {
                         guard let results: KMMemberProductResult = result else { return }
                         guard let productModels2 = results.listingProducts else { return }
                         for productModel2 in productModels2 {
-                            if self.model.isBlackFive == true {
-                                if productModel2.code == "advanced-annual-subscription-blackFive" {
-                                    self.advancedPlanPurchaseLabel.stringValue = String(format: "%.2f", Float(productModel2.upgradePriceString ?? "") ?? 0)
-                                }
-                            } else {
-                                if productModel2.code == "advanced-annual-subscription" {
-                                    self.advancedPlanPurchaseLabel.stringValue = String(format: "%.2f", Float(productModel2.upgradePriceString ?? "") ?? 0)
-                                }
+                            if productModel2.code == "advanced-annual-subscription" {
+                                self.advancedPlanPurchaseLabel.stringValue = String(format: "%.2f", Float(productModel2.upgradePriceString ?? "") ?? 0)
+                            }
+                        }
+                    }
+                } else if productModel.code == "advanced-permanent-blackFive" {
+                    model.getDMGProductPriceInfosForMember(productId: productModel.id, isEducation: 0) { [weak self] success, result in
+                        guard let self = self else { return }
+                        guard let results: KMMemberProductResult = result else { return }
+                        guard let productModels2 = results.listingProducts else { return }
+                        for productModel2 in productModels2 {
+                            if productModel2.code == "advanced-annual-subscription-blackFive" {
+                                self.advancedPlanPurchaseLabel.stringValue = String(format: "%.2f", Float(productModel2.upgradePriceString ?? "") ?? 0)
                             }
                         }
                     }