Sfoglia il codice sorgente

【会员系统】梳理全功能+转档权限

dinglingui 1 settimana fa
parent
commit
050e03441d

+ 29 - 7
PDF Office/PDF Master/MemberCenter/Model/KMMemberInfo.swift

@@ -345,7 +345,19 @@ import Cocoa
                 if IAPProductsManager.default().isAvailableAllFunction() == true {
                     return true
                 } else {
-                    if userScenarioType == .lite_type2 || userScenarioType == .lite_type4 || userScenarioType == .lite_type5 || userScenarioType == .lite_type6 {
+                    let platforms = KMMemberInfo.shared.vip_platforms
+                    let platformsArray = platforms
+                        .components(separatedBy: ",")
+                        .map { $0.trimmingCharacters(in: .whitespaces) }
+
+                    if userScenarioType == .lite_type5 ||
+                        userScenarioType == .lite_type4 {
+                        if(platformsArray.contains("mac")) {
+                            return true
+                        }
+                        
+                    } else if userScenarioType == .lite_type2 ||
+                                userScenarioType == .lite_type6 {
                         return true
                     }
                     return false
@@ -381,14 +393,24 @@ import Cocoa
                 if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
                     return true
                 } else {
-                    if userScenarioType == .lite_type4 || 
-                        userScenarioType == .lite_type5 ||
-                        userScenarioType == .lite_type6 ||
-                        userScenarioType == .lite_type12 {
+                    let platforms = KMMemberInfo.shared.vip_platforms
+                    let platformsArray = platforms
+                        .components(separatedBy: ",")
+                        .map { $0.trimmingCharacters(in: .whitespaces) }
+
+                    if(userScenarioType == .lite_type2) {
                         return true
-                    } else {
-                        return false
+                    } else if userScenarioType == .lite_type5 ||
+                        userScenarioType == .lite_type4 {
+                        if(platformsArray.contains("mac")) { //购买了
+                            return true
+                        }
+                    } else if userScenarioType == .lite_type6 || userScenarioType == .lite_type12 {
+                        if KMMemberInfo.shared.vip_levels == "3" { //高级版本支持转档功能
+                            return true
+                        }
                     }
+                    return false
                 }
             } else {
                 if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {