Browse Source

【会员系统】修改会员权益

wanjun 4 months ago
parent
commit
1926ff8221

+ 82 - 41
PDF Office/PDF Master/Class/Purchase/DMG/Verification/KMVerificationMessageViewController.m

@@ -453,60 +453,101 @@ NSPopoverDelegate>
     if (fabs(buttonWidth-btnRect.size.width)>50) {
         buttonWidth = btnRect.size.width + 10;
     }
-    if ([KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type1 || [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type2) {
-        self.bgImg.hidden = NO;
-        self.button.hidden = NO;
-        self.signUpView.hidden = NO;
-        self.button.frame = CGRectMake(totalWidth, kbottomGap, buttonWidth, self.view.frame.size.height -2 *kbottomGap);
-        CGRect rect = self.button.frame;
-        self.bgImg.frame = rect;
-        totalWidth+=CGRectGetWidth(self.button.bounds);
-        totalWidth+=4;
-        self.signUpView.frame = CGRectMake(totalWidth, 0, signUpWidth, self.view.frame.size.height);
-        totalWidth+=CGRectGetWidth(self.signUpView.bounds);
-    } else if ([KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type3 || [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type4) {
-        self.signUpView.hidden = NO;
-        self.signUpView.frame = CGRectMake(totalWidth, 0, signUpWidth, self.view.frame.size.height);
-        totalWidth+=CGRectGetWidth(self.signUpView.bounds);
-    } else if ([KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type5 ||
-               [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type6 ||
-               [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type7 ||
-               [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type10 ||
-               [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type11) {
-        if ([KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type5) {
+    
+    if ([KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type1 ||
+        [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type3 ||
+        [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type4 ||
+        [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type5 ||
+        [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type7 ||
+        [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type8 ||
+        [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type9 ||
+        [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type11 ||
+        [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type13) {
+        if ([KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type1 ||
+            [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type9) {
             self.button.title = [NSString stringWithFormat:@" %@ ",NSLocalizedString(@"Free Trial", nil)];
-        } else if ([KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type6 ||
-                   [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type10 ||
+        } else if ([KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type3 ||
                    [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type11) {
-            self.button.title = [NSString stringWithFormat:@" %@ ",NSLocalizedStringFromTable(@"立即续费", @"MemberCenterLocalizable", nil)];
-        } else if ([KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type7) {
-            self.button.title = [NSString stringWithFormat:@" %@ ",NSLocalizedStringFromTable(@"立即升级", @"MemberCenterLocalizable", nil)];
+            self.button.title = [NSString stringWithFormat:@" %@ ",NSLocalizedString(@"开通会员", nil)];
+        } else if ([KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type4 ||
+                   [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type5) {
+            self.button.title = [NSString stringWithFormat:@" %@ ",NSLocalizedString(@"立即升级", nil)];
+        } else if ([KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type7 ||
+                   [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type8 ||
+                   [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type13) {
+            self.button.title = [NSString stringWithFormat:@" %@ ",NSLocalizedString(@"立即续费", nil)];
         }
-        [self.button setTitleColor:[NSColor whiteColor]];
         self.bgImg.hidden = NO;
         self.button.hidden = NO;
-        self.userButton.hidden = NO;
         self.button.frame = CGRectMake(totalWidth, kbottomGap, buttonWidth, self.view.frame.size.height -2 *kbottomGap);
-        CGRect rect = self.button.frame;
         self.bgImg.frame = rect;
         totalWidth+=CGRectGetWidth(self.button.bounds);
-        totalWidth+=8;
-        
-        self.userButton.frame = CGRectMake(totalWidth, 0, userImageWidth, userImageWidth);
-        totalWidth += userImageWidth;
-        totalWidth += 8;
-    } else if ([KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type8 ||
-               [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type9) {
-        self.userButton.hidden = NO;
+        totalWidth+=4;
+    }
+    if ([KMMemberInfo shared].isLogin) {
         self.userButton.frame = CGRectMake(totalWidth, 0, userImageWidth, userImageWidth);
         totalWidth += userImageWidth;
         totalWidth += 8;
     } else {
-        self.userButton.hidden = NO;
-        self.userButton.frame = CGRectMake(totalWidth, 0, userImageWidth, userImageWidth);
-        totalWidth += userImageWidth;
-        totalWidth += 8;
+        self.signUpView.hidden = NO;
+        self.signUpView.frame = CGRectMake(totalWidth, 0, signUpWidth, self.view.frame.size.height);
+        totalWidth+=CGRectGetWidth(self.signUpView.bounds);
     }
+    
+//    if ([KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type1 || [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type2) {
+//        self.bgImg.hidden = NO;
+//        self.button.hidden = NO;
+//        self.signUpView.hidden = NO;
+//        self.button.frame = CGRectMake(totalWidth, kbottomGap, buttonWidth, self.view.frame.size.height -2 *kbottomGap);
+//        CGRect rect = self.button.frame;
+//        self.bgImg.frame = rect;
+//        totalWidth+=CGRectGetWidth(self.button.bounds);
+//        totalWidth+=4;
+//        self.signUpView.frame = CGRectMake(totalWidth, 0, signUpWidth, self.view.frame.size.height);
+//        totalWidth+=CGRectGetWidth(self.signUpView.bounds);
+//    } else if ([KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type3 || [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type4) {
+//        self.signUpView.hidden = NO;
+//        self.signUpView.frame = CGRectMake(totalWidth, 0, signUpWidth, self.view.frame.size.height);
+//        totalWidth+=CGRectGetWidth(self.signUpView.bounds);
+//    } else if ([KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type5 ||
+//               [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type6 ||
+//               [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type7 ||
+//               [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type10 ||
+//               [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type11) {
+//        if ([KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type5) {
+//            self.button.title = [NSString stringWithFormat:@" %@ ",NSLocalizedString(@"Free Trial", nil)];
+//        } else if ([KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type6 ||
+//                   [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type10 ||
+//                   [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type11) {
+//            self.button.title = [NSString stringWithFormat:@" %@ ",NSLocalizedStringFromTable(@"立即续费", @"MemberCenterLocalizable", nil)];
+//        } else if ([KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type7) {
+//            self.button.title = [NSString stringWithFormat:@" %@ ",NSLocalizedStringFromTable(@"立即升级", @"MemberCenterLocalizable", nil)];
+//        }
+//        [self.button setTitleColor:[NSColor whiteColor]];
+//        self.bgImg.hidden = NO;
+//        self.button.hidden = NO;
+//        self.userButton.hidden = NO;
+//        self.button.frame = CGRectMake(totalWidth, kbottomGap, buttonWidth, self.view.frame.size.height -2 *kbottomGap);
+//        CGRect rect = self.button.frame;
+//        self.bgImg.frame = rect;
+//        totalWidth+=CGRectGetWidth(self.button.bounds);
+//        totalWidth+=8;
+//        
+//        self.userButton.frame = CGRectMake(totalWidth, 0, userImageWidth, userImageWidth);
+//        totalWidth += userImageWidth;
+//        totalWidth += 8;
+//    } else if ([KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type8 ||
+//               [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type9) {
+//        self.userButton.hidden = NO;
+//        self.userButton.frame = CGRectMake(totalWidth, 0, userImageWidth, userImageWidth);
+//        totalWidth += userImageWidth;
+//        totalWidth += 8;
+//    } else {
+//        self.userButton.hidden = NO;
+//        self.userButton.frame = CGRectMake(totalWidth, 0, userImageWidth, userImageWidth);
+//        totalWidth += userImageWidth;
+//        totalWidth += 8;
+//    }
     if (self.view.superview) {
         self.view.frame = CGRectMake(MAX(0, CGRectGetWidth(self.view.superview.frame)-totalWidth - 8), (CGRectGetHeight(self.view.superview.frame)-CGRectGetHeight(self.view.frame))/2., totalWidth, self.view.frame.size.height);
     } else {

+ 135 - 142
PDF Office/PDF Master/MemberCenter/Model/KMMemberInfo.swift

@@ -9,18 +9,25 @@ import Cocoa
 
 // 用户场景类型
 @objc enum KMUserScenarioType : Int {
-    case null = 0       // 默认状态
-    case lite_type1     // 免费版 未登录 - 无订阅+无AI    (右上角导航栏按钮 - “登录领福利” + “升级至Pro”)
-    case lite_type2     // 免费版 未登录 - 无订阅+有AI    (右上角导航栏按钮 - “登录领福利” + “升级至Pro”)
-    case lite_type3     // 免费版 未登录 - 有订阅高级版+有AI序列码  (右上角导航栏按钮 - “登录领福利”)
-    case lite_type4     // 免费版 未登录 - 有订阅高级版+无AI序列码  (右上角导航栏按钮 - “登录领福利”)
-    case lite_type5     // 免费版 已登录(未试用过的免费用户+未订阅AI) -  无订阅+无AI旧剩余点数 (右上角导航栏按钮 - 头像 + 立即试用)
-    case lite_type6     // 免费版 已登录(试用到期且未付费用户+未订阅AI) -  无旧订阅+有AI旧剩余点数   (右上角导航栏按钮 - 头像 + 立即续费)
-    case lite_type7     // 免费版 已登录(新的买断会员+有订阅AI) -  无旧订阅+无AI旧剩余点数   (右上角导航栏按钮 - 头像 + 立即升级)
-    case lite_type8     // 免费版 已登录(自动订阅中 + 订阅AI) -  无旧订阅+有AI旧剩余点数    (右上角导航栏按钮 - 头像)
-    case lite_type9     // 免费版 已登录(订阅中但取消续订用户) -  无旧订阅+无AI旧剩余点数    (右上角导航栏按钮 - 头像)
-    case lite_type10    // 免费版 已登录(订阅过期用户) -  无旧订阅+无AI旧剩余点数     (右上角导航栏按钮 - 头像 + 立即续费)
-    case lite_type11    // 免费版 已登录(试用过期用户) -  无旧订阅+无AI旧剩余点数     (右上角导航栏按钮 - 头像 + 立即续费)
+    case lite_type1 = 0 // 免费版 无旧买断 免费未试用 (右上角导航栏按钮 - “登录领福利” + “试用”)
+    case lite_type2     // 免费版 无旧买断 免费试用中 (右上角导航栏按钮 - “登录领福利”)
+    case lite_type3     // 免费版 无旧买断 试用过期或取消 (右上角导航栏按钮 - “登录领福利” + 开通会员)
+    case lite_type4     // 免费版 无旧买断 可升级订阅 (右上角导航栏按钮 - “登录领福利” + 升级)
+    case lite_type5     // 免费版 无旧买断 多平台永久 (右上角导航栏按钮 - “登录领福利” + 升级全平台)
+    case lite_type6     // 免费版 无旧买断 全平台高级年订阅 (右上角导航栏按钮 - “登录领福利”)
+    case lite_type7     // 免费版 无旧买断 会员到期 (右上角导航栏按钮 - “登录领福利” + 续费)
+    case lite_type8     // 免费版 无旧买断 订阅中取消 (右上角导航栏按钮 - “登录领福利” + 续费)
+    case lite_type9     // 免费版 有旧买断 免费未试用 (右上角导航栏按钮 - “登录领福利” + “升级至Pro” + 立即试用)
+    case lite_type10     // 免费版 有旧买断 免费试用中 (右上角导航栏按钮 - “登录领福利”)
+    case lite_type11     // 免费版 有旧买断 试用过期或取消 (右上角导航栏按钮 - “登录领福利” + 开通会员)
+    case lite_type12     // 免费版 有旧买断 全平台高级版年订阅 (右上角导航栏按钮 - “登录领福利”)
+    case lite_type13     // 免费版 有旧买断 订阅中取消 (右上角导航栏按钮 - “登录领福利” + 续费)
+}
+
+// 当前权益类型
+@objc enum KMCurrentUserEquityType : Int {
+    case lite_free = 0  // 免费版 免费
+    case lite_old
 }
 
 @objcMembers class KMMemberInfo: NSObject {
@@ -219,6 +226,11 @@ import Cocoa
                 startTime = dateFormatter.date(from: KMMemberInfo.shared.vip_endDate)!
             }
             let currentTime = Date()
+            
+            let platforms = KMMemberInfo.shared.vip_platforms
+            let platformsArray = platforms
+                .components(separatedBy: ",")
+                .map { $0.trimmingCharacters(in: .whitespaces) }
 #if VERSION_FREE
 #if VERSION_DMG
     // DMG
@@ -229,124 +241,69 @@ import Cocoa
             }
 #else
     // AppStore 免费版本
-            if KMMemberInfo.shared.isLogin {
-                if KMMemberInfo.shared.canTrail &&
-                    KMMemberInfo.shared.vip_levels == "1" &&
-                    KMMemberInfo.shared.ai_productName == "" &&
-                    !IAPProductsManager.default().isAvailableAllFunction() &&
-                    !AIInfoManager.default().aiInfoValid {
-                    /** 1、未试用过,也未订阅AI;2、APP中已登录该账户;3、未升级APP前,未订阅高级功能也未购买AI点数 */
-                    return .lite_type5  // 已登录(未试用过的免费用户+未订阅AI) -  无订阅+无AI旧剩余点数
-                } else if KMMemberInfo.shared.vip_status == 4 &&
-                            KMMemberInfo.shared.vip_levels == "1" &&
-                            KMMemberInfo.shared.ai_productName == "" &&
-                            !IAPProductsManager.default().isAvailableAllFunction() &&
-                            oldAIPoints > 0 {
-                    /** 1、试用中试用到期且未付费;2、APP中已登录该账户;3、未升级APP前,未订阅高级功能,有AI旧剩余点数 */
-                    return .lite_type6  // 已登录(试用到期且未付费用户+未订阅AI) -  无旧订阅+有AI旧剩余点数
-                } else if KMMemberInfo.shared.vip_paymentModel == "2" &&
-                            KMMemberInfo.shared.ai_productName != "" {
-                    /** 1、已付费Mac&Windows双平台高级版永久版;2、APP中已登录该账户;3、未升级APP前,未订阅高级功能也未购买AI点数 */
-                    return .lite_type7  // 已登录(新的买断会员+有订阅AI) -  无旧订阅+无AI旧剩余点数
-                } else if KMMemberInfo.shared.vip_status == 1 &&
-                            KMMemberInfo.shared.vip_payType == 1 {
-                    /** 1、试用高级版年订阅并自动订阅中;2、APP中已登录该账户;3、未升级APP前,未订阅高级功能,但有购买AI,有剩余点数 */
-                    return .lite_type8  // 已登录(自动订阅中 + 订阅AI) -  无旧订阅+有AI旧剩余点数
-                } else if KMMemberInfo.shared.vip_status == 1 &&
-                            KMMemberInfo.shared.vip_paymentModel == "1" &&
-                            KMMemberInfo.shared.vip_payType == 0 {
-                    /** 1、已付费标准版年订阅并取消续订;2、APP中已登录该账户;3、未升级APP前,未订阅高级功能也未购买AI点数 */
-                    return .lite_type9  // 已登录(订阅中但取消续订用户) -  无旧订阅+无AI旧剩余点数
-                } else if KMMemberInfo.shared.vip_status == 2 {
-                    /** 1、已订阅标准版年订阅过期;2、APP中已登录该账户;3、未升级APP前,未订阅高级功能也未购买AI点数 */
-                    return .lite_type10 // 已登录(订阅过期用户) -  无旧订阅+无AI旧剩余点数
+//        case lite_type1 = 0 // 免费版 无旧买断 免费未试用 (右上角导航栏按钮 - “登录领福利” + “试用”)
+//        case lite_type2     // 免费版 无旧买断 免费试用中 (右上角导航栏按钮 - “登录领福利”)
+//        case lite_type3     // 免费版 无旧买断 试用过期或取消 (右上角导航栏按钮 - “登录领福利” + 开通会员)
+//        case lite_type4     // 免费版 无旧买断 可升级订阅 (右上角导航栏按钮 - “登录领福利”)
+//        case lite_type5     // 免费版 无旧买断 多平台永久 (右上角导航栏按钮 - “登录领福利” + 升级全平台)
+//        case lite_type6     // 免费版 无旧买断 全平台高级年订阅 (右上角导航栏按钮 - “登录领福利”)
+//        case lite_type7     // 免费版 无旧买断 会员到期 (右上角导航栏按钮 - “登录领福利” + 续费)
+//        case lite_type8     // 免费版 无旧买断 订阅中取消 (右上角导航栏按钮 - “登录领福利” + 续费)
+//        case lite_type9     // 免费版 有旧买断 免费未试用 (右上角导航栏按钮 - “登录领福利” + “升级至Pro” + 立即试用)
+//        case lite_type10     // 免费版 有旧买断 免费试用中 (右上角导航栏按钮 - “登录领福利”)
+//        case lite_type11     // 免费版 有旧买断 试用过期或取消 (右上角导航栏按钮 - “登录领福利” + 开通会员)
+//        case lite_type12     // 免费版 有旧买断 全平台高级版年订阅 (右上角导航栏按钮 - “登录领福利”)
+//        case lite_type13     // 免费版 有旧买断 订阅中取消 (右上角导航栏按钮 - “登录领福利” + 续费)
+
+            if IAPProductsManager.default().allAccessProduct.isSubscribed == true {
+                // 有旧买断
+                if KMMemberInfo.shared.canTrail {
+                    return .lite_type9
+                }
+                if KMMemberInfo.shared.vip_status == 3 {
+                    return .lite_type10
                 } else if KMMemberInfo.shared.vip_status == 4 {
-                    /** 1、已试用高级版年订阅并取消续订,当前试用过期;2、APP中已登录该账户;3、未升级APP前,未订阅高级功能也未购买AI点数 */
-                    return .lite_type11 // 已登录(试用过期用户) -  无旧订阅+无AI旧剩余点数
+                    return .lite_type11
+                } else if KMMemberInfo.shared.vip_status == 1 && KMMemberInfo.shared.vip_payType == 0 {
+                    return .lite_type13
                 }
+                if KMMemberInfo.shared.vip_paymentModel == "1" && KMMemberInfo.shared.vip_cycle == 4 && platformsArray.count == 4 {
+                    return .lite_type12
+                } 
             } else {
-                if IAPProductsManager.default().isAvailableAllFunction() {
-                    if AIInfoManager.default().aiInfoValid {
-                        return .lite_type3  // 未登录 - 有订阅高级版+有AI序列码
-                    } else {
-                        return .lite_type4  // 未登录 - 有订阅高级版+无AI序列码
-                    }
+                // 无旧买断
+                if KMMemberInfo.shared.canTrail {
+                    return .lite_type1
+                }
+                if KMMemberInfo.shared.vip_status == 3 {
+                    return .lite_type2
+                } else if KMMemberInfo.shared.vip_status == 4 {
+                    return .lite_type3
+                } else if KMMemberInfo.shared.vip_status == 2 {
+                    return .lite_type7
+                } else if KMMemberInfo.shared.vip_status == 1 && KMMemberInfo.shared.vip_payType == 0 {
+                    return .lite_type8
+                }
+                if KMMemberInfo.shared.vip_paymentModel == "2" {
+                    return .lite_type5
                 } else {
-                    if AIInfoManager.default().aiInfoValid {
-                        return .lite_type2  // 未登录 - 无订阅 - 有AI
+                    if KMMemberInfo.shared.vip_cycle == 4 && platformsArray.count == 4 {
+                        return .lite_type6
                     } else {
-                        return .lite_type1  // 未登录 - 无订阅 - 无AI
+                        return .lite_type4
                     }
                 }
             }
 #endif
 #else
-            // 未登录 - 标准版+无AI
-            // 未登录 - 高级版(有购买转档包)+有AI序列码
-            // 已登录(未试用过的免费用户+未订阅AI) -  标准版+无AI旧剩余点数
-            // 已登录(新的买断会员+有订阅AI) -  高级版(有升级转档包)+无AI旧剩余点数
-            // 已登录(全平台高级版年订阅自动订阅中 + 订阅AI) -  无旧订阅+有AI旧剩余点数
-            // 已登录(全平台标准版年订阅订阅中但取消续订用户) -  标准版+无AI旧剩余点数
-            // 已登录(订阅过期用户) -  高级版+无AI旧剩余点数
-
     // AppStore 付费版
-//            if KMMemberInfo.shared.isLogin {
-//                
-//            } else {
-//                
-//            }
             if KMMemberInfo.shared.isLogin {
-                if KMMemberInfo.shared.canTrail &&
-                    KMMemberInfo.shared.vip_levels == "1" &&
-                    KMMemberInfo.shared.ai_productName == "" &&
-                    !IAPProductsManager.default().isAvailableAllFunction() &&
-                    !AIInfoManager.default().aiInfoValid {
-                    /** 1、未试用过,也未订阅AI;2、APP中已登录该账户;3、未升级APP前,未订阅高级功能也未购买AI点数 */
-                    return .lite_type5  // 已登录(未试用过的免费用户+未订阅AI) -  无订阅+无AI旧剩余点数
-                } else if KMMemberInfo.shared.vip_status == 4 &&
-                            KMMemberInfo.shared.vip_levels == "1" &&
-                            KMMemberInfo.shared.ai_productName == "" &&
-                            !IAPProductsManager.default().isAvailableAllFunction() &&
-                            oldAIPoints > 0 {
-                    /** 1、试用中试用到期且未付费;2、APP中已登录该账户;3、未升级APP前,未订阅高级功能,有AI旧剩余点数 */
-                    return .lite_type6  // 已登录(试用到期且未付费用户+未订阅AI) -  无旧订阅+有AI旧剩余点数
-                } else if KMMemberInfo.shared.vip_paymentModel == "2" &&
-                            KMMemberInfo.shared.ai_productName != "" {
-                    /** 1、已付费Mac&Windows双平台高级版永久版;2、APP中已登录该账户;3、未升级APP前,未订阅高级功能也未购买AI点数 */
-                    return .lite_type7  // 已登录(新的买断会员+有订阅AI) -  无旧订阅+无AI旧剩余点数
-                } else if KMMemberInfo.shared.vip_status == 1 &&
-                            KMMemberInfo.shared.vip_payType == 1 {
-                    /** 1、试用高级版年订阅并自动订阅中;2、APP中已登录该账户;3、未升级APP前,未订阅高级功能,但有购买AI,有剩余点数 */
-                    return .lite_type8  // 已登录(自动订阅中 + 订阅AI) -  无旧订阅+有AI旧剩余点数
-                } else if KMMemberInfo.shared.vip_status == 1 &&
-                            KMMemberInfo.shared.vip_paymentModel == "1" &&
-                            KMMemberInfo.shared.vip_payType == 0 {
-                    /** 1、已付费标准版年订阅并取消续订;2、APP中已登录该账户;3、未升级APP前,未订阅高级功能也未购买AI点数 */
-                    return .lite_type9  // 已登录(订阅中但取消续订用户) -  无旧订阅+无AI旧剩余点数
-                } else if KMMemberInfo.shared.vip_status == 2 {
-                    /** 1、已订阅标准版年订阅过期;2、APP中已登录该账户;3、未升级APP前,未订阅高级功能也未购买AI点数 */
-                    return .lite_type10 // 已登录(订阅过期用户) -  无旧订阅+无AI旧剩余点数
-                } else if KMMemberInfo.shared.vip_status == 4 {
-                    /** 1、已试用高级版年订阅并取消续订,当前试用过期;2、APP中已登录该账户;3、未升级APP前,未订阅高级功能也未购买AI点数 */
-                    return .lite_type11 // 已登录(试用过期用户) -  无旧订阅+无AI旧剩余点数
-                }
+                
             } else {
-                if IAPProductsManager.default().isAvailableAllFunction() {
-                    if AIInfoManager.default().aiInfoValid {
-                        return .lite_type3  // 未登录 - 有订阅高级版+有AI序列码
-                    } else {
-                        return .lite_type4  // 未登录 - 有订阅高级版+无AI序列码
-                    }
-                } else {
-                    if AIInfoManager.default().aiInfoValid {
-                        return .lite_type2  // 未登录 - 无订阅 - 有AI
-                    } else {
-                        return .lite_type1  // 未登录 - 无订阅 - 无AI
-                    }
-                }
+                
             }
 #endif
-            return .null
+            return .lite_type1
         }
     }
     
@@ -354,12 +311,16 @@ import Cocoa
     var isMemberAllFunction: Bool {
         get {
             if KMMemberInfo.shared.isLogin {
-                if userScenarioType == .lite_type7 || userScenarioType == .lite_type8 || userScenarioType == .lite_type9 {
+                if IAPProductsManager.default().allAccessProduct.isSubscribed == true {
                     return true
+                } else {
+                    if userScenarioType == .lite_type2 || userScenarioType == .lite_type4 || userScenarioType == .lite_type5 || userScenarioType == .lite_type6 {
+                        return true
+                    }
+                    return false
                 }
-                return false
             } else {
-                if IAPProductsManager.default().isAvailableAllFunction() {
+                if IAPProductsManager.default().allAccessProduct.isSubscribed == true {
                     return true
                 }
                 return false
@@ -370,10 +331,15 @@ import Cocoa
     // 是否允许使用转档
     var isPermitConvert: Bool {
         if KMMemberInfo.shared.isLogin {
-            if userScenarioType == .lite_type7 || userScenarioType == .lite_type8 {
+            if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
                 return true
+            } else {
+                if userScenarioType == .lite_type4 || userScenarioType == .lite_type5 || userScenarioType == .lite_type6 || userScenarioType == .lite_type12 {
+                    return true
+                } else {
+                    return false
+                }
             }
-            return false
         } else {
             if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
                 return true
@@ -389,7 +355,7 @@ import Cocoa
             if oldAIPoints > 0 {
                 return true
             } else {
-                if userScenarioType == .lite_type6 || userScenarioType == .lite_type7 || userScenarioType == .lite_type8 {
+                if userScenarioType == .lite_type4 || userScenarioType == .lite_type5 || userScenarioType == .lite_type6 || userScenarioType == .lite_type12 {
                     if KMMemberInfo.shared.aiPoint > 0 {
                         return true
                     } else {
@@ -425,36 +391,63 @@ import Cocoa
     }
     
     func advancedFunctionUsage() -> Void {
-        if userScenarioType == .lite_type1 || userScenarioType == .lite_type2 {
-            if KMMemberInfo.shared.isLogin {
+        let platforms = KMMemberInfo.shared.vip_platforms
+        let platformsArray = platforms
+            .components(separatedBy: ",")
+            .map { $0.trimmingCharacters(in: .whitespaces) }
+        if KMMemberInfo.shared.isLogin {
+            if userScenarioType == .lite_type1 {
                 KMProductCompareWC.shared.orientation = true
                 KMProductCompareWC.shared.orientationType = .trial
                 KMProductCompareWC.shared.showWindow(nil)
-            } else {
-                KMLoginWindowsController.shared.openWindow() { success in
-                    if success {
+            } else if userScenarioType == .lite_type2 || userScenarioType == .lite_type6 || userScenarioType == .lite_type10 || userScenarioType == .lite_type12 {
+                
+            } else if userScenarioType == .lite_type3 || userScenarioType == .lite_type11 {
+                KMProductCompareWC.shared.orientation = true
+                KMProductCompareWC.shared.orientationType = .lite_Base
+                KMProductCompareWC.shared.showWindow(nil)
+            } else if userScenarioType == .lite_type4 || userScenarioType == .lite_type5 || userScenarioType == .lite_type9 || userScenarioType == .lite_type13 {
+                KMProductCompareWC.shared.orientation = true
+                KMProductCompareWC.shared.orientationType = .lite_MacWindows
+                KMProductCompareWC.shared.showWindow(nil)
+            } else if userScenarioType == .lite_type7 || userScenarioType == .lite_type8 {
+                KMProductCompareWC.shared.orientation = true
+                if KMMemberInfo.shared.vip_paymentModel == "1" && KMMemberInfo.shared.vip_cycle == 4 && platformsArray.count == 4 {
+                    KMProductCompareWC.shared.orientationType = .lite_MacWindows
+                } else {
+                    KMProductCompareWC.shared.orientationType = .lite_Base
+                }
+                KMProductCompareWC.shared.showWindow(nil)
+            }
+        } else {
+            KMLoginWindowsController.shared.openWindow() { [weak self] success in
+                guard let self = self else { return }
+                if success {
+                    if self.userScenarioType == .lite_type1 {
                         KMProductCompareWC.shared.orientation = true
                         KMProductCompareWC.shared.orientationType = .trial
                         KMProductCompareWC.shared.showWindow(nil)
+                    } else if self.userScenarioType == .lite_type2 || self.userScenarioType == .lite_type6 || self.userScenarioType == .lite_type10 || self.userScenarioType == .lite_type12 {
+                        
+                    } else if self.userScenarioType == .lite_type3 || self.userScenarioType == .lite_type11 {
+                        KMProductCompareWC.shared.orientation = true
+                        KMProductCompareWC.shared.orientationType = .lite_Base
+                        KMProductCompareWC.shared.showWindow(nil)
+                    } else if self.userScenarioType == .lite_type4 || self.userScenarioType == .lite_type5 || self.userScenarioType == .lite_type9 || self.userScenarioType == .lite_type13 {
+                        KMProductCompareWC.shared.orientation = true
+                        KMProductCompareWC.shared.orientationType = .lite_MacWindows
+                        KMProductCompareWC.shared.showWindow(nil)
+                    } else if self.userScenarioType == .lite_type7 || self.userScenarioType == .lite_type8 {
+                        KMProductCompareWC.shared.orientation = true
+                        if KMMemberInfo.shared.vip_paymentModel == "1" && KMMemberInfo.shared.vip_cycle == 4 && platformsArray.count == 4 {
+                            KMProductCompareWC.shared.orientationType = .lite_MacWindows
+                        } else {
+                            KMProductCompareWC.shared.orientationType = .lite_Base
+                        }
+                        KMProductCompareWC.shared.showWindow(nil)
                     }
                 }
             }
-        } else if userScenarioType == .lite_type3 || userScenarioType == .lite_type4 {
-            
-        } else if userScenarioType == .lite_type5 {
-            KMProductCompareWC.shared.orientation = true
-            KMProductCompareWC.shared.orientationType = .trial
-            KMProductCompareWC.shared.showWindow(nil)
-        } else if userScenarioType == .lite_type6 {
-            KMProductCompareWC.shared.orientation = true
-            KMProductCompareWC.shared.orientationType = .lite_Base
-            KMProductCompareWC.shared.showWindow(nil)
-        } else if userScenarioType == .lite_type7 || userScenarioType == .lite_type8 || userScenarioType == .lite_type9  {
-            
-        } else if userScenarioType == .lite_type10 || userScenarioType == .lite_type11  {
-            KMProductCompareWC.shared.orientation = true
-            KMProductCompareWC.shared.orientationType = .lite_Base
-            KMProductCompareWC.shared.showWindow(nil)
         }
     }