Ver código fonte

【会员系统】比较表商品对齐调整

wanjun 5 dias atrás
pai
commit
b9fae599ae

+ 11 - 5
PDF Office/PDF Master/MemberCenter/ViewModel/KMProductModel.swift

@@ -757,13 +757,19 @@ class KMProductModel: ObservableObject {
                 }
             }
         } else if state == .pro_Advanced {
+            let platforms = KMMemberInfo.shared.vip_platforms
+            let platformsArray = platforms
+                .components(separatedBy: ",")
+                .map { $0.trimmingCharacters(in: .whitespaces) }
             if KMMemberInfo.shared.userScenarioType == .pro_type1 {
-                membershipPurchase(.advancedAddDevicesAllAccessPack12months_pro)
+                if platformsArray.count == 1 {
+                    membershipPurchase(.advancedAddDevicesAllAccessPack12months_pro)
+                } else if platformsArray.count == 2 {
+                    membershipPurchase(.advancedAdd2DevicesAllAccessPack12months_pro)
+                } else {
+                    membershipPurchase(.advancedAdd2DevicesAllAccessPack12months_pro)
+                }
             } else if KMMemberInfo.shared.userScenarioType == .pro_type4 {
-                let platforms = KMMemberInfo.shared.vip_platforms
-                let platformsArray = platforms
-                    .components(separatedBy: ",")
-                    .map { $0.trimmingCharacters(in: .whitespaces) }
                 if platformsArray.count == 1 {
                     membershipPurchase(.advancedAddDevicesAllAccessPack12months_pro)
                 } else if platformsArray.count == 2 {

+ 11 - 5
PDF Office/PDF Master/MemberCenter/WindowsController/KMProductCompareWC.swift

@@ -440,13 +440,19 @@ class KMProductCompareWC: NSWindowController {
                 permanentPurchaseLabel.stringValue = model.getProductPrice(.pdfToOfficePackPermanent_pro)
             }
         } else if model.state == .pro_Advanced {
+            let platforms = KMMemberInfo.shared.vip_platforms
+            let platformsArray = platforms
+                .components(separatedBy: ",")
+                .map { $0.trimmingCharacters(in: .whitespaces) }
             if KMMemberInfo.shared.userScenarioType == .pro_type1 {
-                advancedPlanPurchaseLabel.stringValue = model.getProductPrice(.advancedAddDevicesAllAccessPack12months_pro)
+                if platformsArray.count == 1 {
+                    advancedPlanPurchaseLabel.stringValue = model.getProductPrice(.advancedAddDevicesAllAccessPack12months_pro)
+                } else if platformsArray.count == 2 {
+                    advancedPlanPurchaseLabel.stringValue = model.getProductPrice(.advancedAdd2DevicesAllAccessPack12months_pro)
+                } else {
+                    advancedPlanPurchaseLabel.stringValue = model.getProductPrice(.advancedAdd2DevicesAllAccessPack12months_pro)
+                }
             } else if KMMemberInfo.shared.userScenarioType == .pro_type4 {
-                let platforms = KMMemberInfo.shared.vip_platforms
-                let platformsArray = platforms
-                    .components(separatedBy: ",")
-                    .map { $0.trimmingCharacters(in: .whitespaces) }
                 if platformsArray.count == 1 {
                     advancedPlanPurchaseLabel.stringValue = model.getProductPrice(.advancedAddDevicesAllAccessPack12months_pro)
                 } else if platformsArray.count == 2 {