Explorar o código

Merge branch 'develop_PDFReaderPro_V4.7.0' of git.kdan.cc:Mac_PDF/PDF_Office into develop_PDFReaderPro_V4.7.0

zenghong hai 1 semana
pai
achega
7409b77abc

+ 13 - 11
PDF Office/PDF Master/Class/Purchase/DMG/Verification/KMVerificationMessageViewController.m

@@ -210,7 +210,6 @@ NSPopoverDelegate>
         [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type3 ||
         [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type5 ||
         [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type7 ||
-        [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type8 ||
         [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type9 ||
         [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type13 ||
         [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type11 ||
@@ -236,7 +235,7 @@ NSPopoverDelegate>
         } else if ([KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type3 ) {
             self.button.title = [NSString stringWithFormat:@" %@ ",NSLocalizedStringFromTable(@"Buy Now", @"MemberCenterLocalizable", nil)];
         } else if ([KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type11) {
-            self.button.title = [NSString stringWithFormat:@" %@ ",NSLocalizedStringFromTable(@"Renew now", @"MemberCenterLocalizable", nil)];
+            self.button.title = [NSString stringWithFormat:@" %@ ",NSLocalizedString(@"Upgrade", nil)];
         } else if ([KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type5 ||
                    [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type9 ||
                    [KMMemberInfo shared].userScenarioType == KMUserScenarioTypePro_type1 ||
@@ -257,10 +256,8 @@ NSPopoverDelegate>
                     }];
                 }
             }
-        } else if ([KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type7 ||
-                   [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type8 ||
-                   [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type13) {
-            self.button.title = [NSString stringWithFormat:@" %@ ",NSLocalizedString(@"Renew now", nil)];
+        } else if ([KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type7) {
+            self.button.title = [NSString stringWithFormat:@" %@ ",NSLocalizedStringFromTable(@"Renew now", @"MemberCenterLocalizable", nil)];
         }
         [self.button setTitleColor:[NSColor whiteColor]];
         self.bgImg.hidden = NO;
@@ -275,11 +272,8 @@ NSPopoverDelegate>
         KMUserScenarioType type = [KMMemberInfo shared].userScenarioType;
         // 单平台高级版永久 未登录时 也不显示升级(因为点了也得先登录),但是登录后的卡片里是有升级按钮的,可以升级成全平台高级版年订阅
         //原来是订阅的,不需要升级,因为目前不支持订阅升级订阅这种场景
-        if(type == KMUserScenarioTypeLite_type9 ||
-           type == KMUserScenarioTypeLite_type10 ||
-           type == KMUserScenarioTypeLite_type11 ||
+        if(type == KMUserScenarioTypeLite_type10 ||
            type == KMUserScenarioTypeLite_type12 ||
-           type == KMUserScenarioTypeLite_type13 ||
            type == KMUserScenarioTypePro_type1 ||
            type == KMUserScenarioTypePro_type2 ||
            type == KMUserScenarioTypePro_type3 ||
@@ -289,7 +283,15 @@ NSPopoverDelegate>
                 self.button.hidden = YES;
                 self.bgImg.hidden = YES;
             }
-
+        } else if(type == KMUserScenarioTypeLite_type9 || type == KMUserScenarioTypeLite_type11) { //永久版+免费版显示升级
+            if ([KMMemberInfo shared].isLogin == NO || ([[KMMemberInfo shared].vip_paymentModel isEqualToString:@"1"] && [KMMemberInfo shared].isLogin == YES && (IAPProductsManager.defaultManager.allAccessPack6months_lite.isSubscribed == YES || IAPProductsManager.defaultManager.allAccessPack12months_lite.isSubscribed == YES))) {
+                
+                self.button.hidden = YES;
+                self.bgImg.hidden = YES;
+            }
+        } else if(type == KMUserScenarioTypeLite_type13) {
+            self.button.hidden = YES;
+            self.bgImg.hidden = YES;
         }
         self.button.frame = CGRectMake(totalWidth, kbottomGap, buttonWidth, self.view.frame.size.height -2 *kbottomGap);
         CGRect rect = self.button.frame;

+ 26 - 12
PDF Office/PDF Master/MemberCenter/ViewController/KMUserInfoViewController.swift

@@ -170,9 +170,11 @@ class KMUserInfoViewController: NSViewController {
         if KMMemberInfo.shared.userScenarioType == .lite_type1 || KMMemberInfo.shared.userScenarioType == .lite_type9 {
             buyNow1Label.stringValue = NSLocalizedString("Buy Now", tableName: "MemberCenterLocalizable", comment: "")
             buyNow2Label.stringValue = NSLocalizedString("7-Day Free Trial", tableName: "MemberCenterLocalizable", comment: "")
-        } else if KMMemberInfo.shared.userScenarioType == .lite_type3 || KMMemberInfo.shared.userScenarioType == .lite_type11 {
+        } else if KMMemberInfo.shared.userScenarioType == .lite_type3  {
             buyNow3Label.stringValue = NSLocalizedString("Buy Now", tableName: "MemberCenterLocalizable", comment: "")
-        } else if KMMemberInfo.shared.userScenarioType == .lite_type5 ||
+        } else if KMMemberInfo.shared.userScenarioType == .lite_type11 {
+            buyNow3Label.stringValue = NSLocalizedString("Upgrade Now", tableName: "MemberCenterLocalizable", comment: "")
+        }  else if KMMemberInfo.shared.userScenarioType == .lite_type5 ||
                     KMMemberInfo.shared.userScenarioType == .pro_type1 ||
                     KMMemberInfo.shared.userScenarioType == .pro_type3 ||
                     KMMemberInfo.shared.userScenarioType == .pro_type4 {
@@ -227,7 +229,15 @@ class KMUserInfoViewController: NSViewController {
             number4_1Label.textColor = NSColor(hex: "42464D")
             number5Label.textColor = NSColor(hex: "42464D")
         } else if KMMemberInfo.shared.userScenarioType == .lite_type4 {
-            lockedLabel.stringValue = NSLocalizedString("Annual Plan", tableName: "MemberCenterLocalizable", comment: "")
+            if(KMMemberInfo.shared.vip_cycle == 1) {
+                lockedLabel.stringValue = NSLocalizedString("Monthly Plan", tableName: "MemberCenterLocalizable", comment: "")
+            } else if(KMMemberInfo.shared.vip_cycle == 2) {
+                lockedLabel.stringValue = NSLocalizedString("", tableName: "MemberCenterLocalizable", comment: "")
+            } else if(KMMemberInfo.shared.vip_cycle == 3) {
+                lockedLabel.stringValue = NSLocalizedString("6-Month Plan", tableName: "MemberCenterLocalizable", comment: "")
+            } else if(KMMemberInfo.shared.vip_cycle == 4) {
+                lockedLabel.stringValue = NSLocalizedString("Annual Plan", tableName: "MemberCenterLocalizable", comment: "")
+            }
             lockedImageView.image = NSImage(named: "UpgradeImage2")
             number1Label.stringValue = NSLocalizedString("", tableName: "MemberCenterLocalizable", comment: "")
             if KMMemberInfo.shared.vip_levels == "2" {
@@ -293,7 +303,15 @@ class KMUserInfoViewController: NSViewController {
             number4_1Label.textColor = NSColor(hex: "42464D")
             number5Label.textColor = NSColor(hex: "42464D")
         } else if KMMemberInfo.shared.userScenarioType == .lite_type8 {
-            lockedLabel.stringValue = NSLocalizedString("Annual Plan", tableName: "MemberCenterLocalizable", comment: "")
+            if(KMMemberInfo.shared.vip_cycle == 1) {
+                lockedLabel.stringValue = NSLocalizedString("Monthly Plan", tableName: "MemberCenterLocalizable", comment: "")
+            } else if(KMMemberInfo.shared.vip_cycle == 2) {
+                lockedLabel.stringValue = NSLocalizedString("", tableName: "MemberCenterLocalizable", comment: "")
+            } else if(KMMemberInfo.shared.vip_cycle == 3) {
+                lockedLabel.stringValue = NSLocalizedString("6-Month Plan", tableName: "MemberCenterLocalizable", comment: "")
+            } else if(KMMemberInfo.shared.vip_cycle == 4) {
+                lockedLabel.stringValue = NSLocalizedString("Annual Plan", tableName: "MemberCenterLocalizable", comment: "")
+            }
             lockedImageView.image = NSImage(named: "UpgradeImage2")
             number1Label.stringValue = NSLocalizedString("", tableName: "MemberCenterLocalizable", comment: "")
             if KMMemberInfo.shared.vip_levels == "2" {
@@ -548,12 +566,11 @@ class KMUserInfoViewController: NSViewController {
         closeAccountImageView.image = NSImage(named: "CloseAccountImage")
         buyNow3Box.fillColor = NSColor(named: "FFFFFF") ?? .white
         
+        let isNoOldSubscribed = IAPProductsManager.default().allAccessPack6months_lite.isSubscribed == false && IAPProductsManager.default().allAccessPack12months_lite.isSubscribed == false
         if KMMemberInfo.shared.userScenarioType == .lite_type1 ||
             KMMemberInfo.shared.userScenarioType == .lite_type2 ||
             KMMemberInfo.shared.userScenarioType == .lite_type3 ||
-            KMMemberInfo.shared.userScenarioType == .lite_type9 ||
-            KMMemberInfo.shared.userScenarioType == .lite_type10 ||
-            KMMemberInfo.shared.userScenarioType == .lite_type11 {
+            KMMemberInfo.shared.userScenarioType == .lite_type10 {
             rightsBox.fillColor = NSColor(named: "7094F6_0.1") ?? .white
             membershipLabel.textColor = NSColor(hex: "0E1114")
             lockedLabel.textColor = NSColor(hex: "42464D")
@@ -571,9 +588,7 @@ class KMUserInfoViewController: NSViewController {
                 }
 #else
 #endif
-            } else if KMMemberInfo.shared.userScenarioType == .lite_type3 ||
-                        KMMemberInfo.shared.userScenarioType == .lite_type11 ||
-                        KMMemberInfo.shared.userScenarioType == .lite_type9 {
+            } else if KMMemberInfo.shared.userScenarioType == .lite_type3{
                 buyNow3Label.textColor = NSColor(named: "FFFFFF")
                 buyBox.contentView = buyView2
                 buyNow3ImageView.isHidden = false
@@ -601,8 +616,7 @@ class KMUserInfoViewController: NSViewController {
                 arrow3ImageView.image = NSImage(named: "BuyNewArrowImage2")
             }
         } else if KMMemberInfo.shared.userScenarioType == .lite_type7 ||
-                    KMMemberInfo.shared.userScenarioType == .lite_type8 ||
-                    KMMemberInfo.shared.userScenarioType == .lite_type13 {
+                    (KMMemberInfo.shared.userScenarioType == .lite_type9 && KMMemberInfo.shared.vip_paymentModel == "2" && isNoOldSubscribed) || (KMMemberInfo.shared.userScenarioType == .lite_type11 && KMMemberInfo.shared.vip_paymentModel == "2" && isNoOldSubscribed) {
             membershipLabel.textColor = NSColor(hex: "0E1114")
             lockedLabel.textColor = NSColor(hex: "42464D")