Browse Source

【会员系统】梳理转档权限

dinglingui 1 week ago
parent
commit
28295fc106
1 changed files with 18 additions and 11 deletions
  1. 18 11
      PDF Office/PDF Master/MemberCenter/Model/KMMemberInfo.swift

+ 18 - 11
PDF Office/PDF Master/MemberCenter/Model/KMMemberInfo.swift

@@ -23,10 +23,10 @@ import Cocoa
     case lite_type12    // 免费版 有旧买断 订阅中 (右上角导航栏按钮 - “登录领福利”)
     case lite_type13    // 免费版 有旧买断 订阅未过期且取消订阅 (右上角导航栏按钮 - “登录领福利” + 续费)
     case pro_type1      // 付费版 有旧PDF To Office (右上角导航栏按钮 - “登录领福利” + 升级(全平台))
-    case pro_type2      // 付费版 有旧PDF To Office 订阅 (右上角导航栏按钮 - “登录领福利”)
+    case pro_type2      // 付费版 有旧PDF To Office 订阅且未过期 (右上角导航栏按钮 - “登录领福利”)
     case pro_type3      // 付费版 无旧PDF To Office (右上角导航栏按钮 - “登录领福利” + 升级(全平台/高级版永久))
     case pro_type4      // 付费版 无旧PDF To Office 高级版永久 (右上角导航栏按钮 - Info + 升级(全平台))
-    case pro_type5      // 付费版 无旧PDF To Office 订阅 (右上角导航栏按钮 - Info)
+    case pro_type5      // 付费版 无旧PDF To Office 订阅且未过期 (右上角导航栏按钮 - Info)
 }
 
 // 当前权益类型
@@ -309,16 +309,16 @@ import Cocoa
 #else
     // AppStore 付费版
             if IAPProductsManager.default().pdfToOfficeProduct.isSubscribed == true {
-                if KMMemberInfo.shared.vip_paymentModel == "1" && KMMemberInfo.shared.vip_payType == 0 {
+                if KMMemberInfo.shared.vip_paymentModel == "1" && KMMemberInfo.shared.ai_status == 1 { //订阅中
                     return .pro_type2
                 } else {
                     return .pro_type1
                 }
             } else {
-                if KMMemberInfo.shared.vip_paymentModel == "2" {
+                if KMMemberInfo.shared.vip_paymentModel == "2" { //买断
                     return .pro_type4
                 } else {
-                    if KMMemberInfo.shared.vip_paymentModel == "1" && KMMemberInfo.shared.vip_payType == 0 {
+                    if KMMemberInfo.shared.vip_paymentModel == "1" && KMMemberInfo.shared.ai_status == 1 {//订阅中
                         return .pro_type5
                     } else {
                         return .pro_type3
@@ -425,14 +425,21 @@ import Cocoa
                 if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
                     return true
                 } else {
-                    if userScenarioType == .pro_type1 ||
-                        userScenarioType == .pro_type2 ||
-                        userScenarioType == .pro_type4 ||
-                        userScenarioType == .pro_type5 {
+                    let platforms = KMMemberInfo.shared.vip_platforms
+                    let platformsArray = platforms
+                        .components(separatedBy: ",")
+                        .map { $0.trimmingCharacters(in: .whitespaces) }
+
+                    if  userScenarioType == .pro_type5 {
+                        if(platformsArray.contains("mac")) { //购买了mac
+                            return true
+                        }
+                    } else if userScenarioType == .pro_type1 ||
+                              userScenarioType == .pro_type2 ||
+                              userScenarioType == .pro_type4  {
                         return true
-                    } else {
-                        return false
                     }
+                    return false
                 }
             } else {
                 if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {