Pārlūkot izejas kodu

【会员系统】DMG未登录时跳转比较表逻辑整理

wanjun 6 dienas atpakaļ
vecāks
revīzija
a99af65109

+ 43 - 2
PDF Office/PDF Master/Class/AD/KMAdsWebView.swift

@@ -297,8 +297,49 @@ class KMAdsWebView: NSView, WKNavigationDelegate, CAAnimationDelegate {
         }
         
         if type == .ComparisonSheet {
-            KMProductCompareWC.shared.orientation = false
-            KMProductCompareWC.shared.showWindow(nil)
+            if KMMemberInfo.shared.isLogin {
+                if KMMemberInfo.shared.vip_levels == "1" {
+                    KMProductCompareWC.shared.orientation = true
+    #if VERSION_FREE
+    #if VERSION_DMG
+        // DMG
+                    KMProductCompareWC.shared.orientationType = .dmg_Base
+    #else
+        // AppStore 免费版本
+                    KMProductCompareWC.shared.orientationType = .lite_Base
+    #endif
+    #else
+        // AppStore 付费版
+                    KMProductCompareWC.shared.orientationType = .pro_Base
+    #endif
+                    KMProductCompareWC.shared.showWindow(nil)
+                } else {
+                    KMMemberInfo.shared.advancedFunctionUsage()
+                }
+            } else {
+                KMLoginWindowsController.shared.openWindow { success in
+                    if success {
+                        if KMMemberInfo.shared.vip_levels == "1" {
+                            KMProductCompareWC.shared.orientation = true
+            #if VERSION_FREE
+            #if VERSION_DMG
+                // DMG
+                            KMProductCompareWC.shared.orientationType = .dmg_Base
+            #else
+                // AppStore 免费版本
+                            KMProductCompareWC.shared.orientationType = .lite_Base
+            #endif
+            #else
+                // AppStore 付费版
+                            KMProductCompareWC.shared.orientationType = .pro_Base
+            #endif
+                            KMProductCompareWC.shared.showWindow(nil)
+                        } else {
+                            KMMemberInfo.shared.advancedFunctionUsage()
+                        }
+                    }
+                }
+            }
         } else {
             let newURL = NSURL(string: string)
             NSWorkspace.shared.open(newURL! as URL)

+ 43 - 2
PDF Office/PDF Master/Class/KMAdvertisement/View/KMRecommondPopWindow/KMRecommondPopWindow.m

@@ -96,8 +96,49 @@ NSWindowDelegate>
 - (IBAction)buyAction:(NSButton *)sender {
     if (_info.version) {
         if ([_info.jumpType isEqualToString:@"Comparison Sheet"]) {
-            [[KMProductCompareWC shared] setOrientation:NO];
-            [[KMProductCompareWC shared] showWindow:nil];
+            if ([KMMemberInfo shared].isLogin) {
+                if ([[KMMemberInfo shared].vip_levels isEqualToString:@"1"]) {
+                    [[KMProductCompareWC shared] setOrientation:YES];
+    #if VERSION_FREE
+    #if VERSION_DMG
+        // DMG
+                [[KMProductCompareWC shared] setOrientationType:KMCompareTableTypeDmg_Base];
+    #else
+        // AppStore 免费版本
+                [[KMProductCompareWC shared] setOrientationType:KMCompareTableTypeLite_Base];
+    #endif
+    #else
+        // AppStore 付费版
+                [[KMProductCompareWC shared] setOrientationType:KMCompareTableTypePro_Base];
+    #endif
+                    [[KMProductCompareWC shared] showWindow:nil];
+                } else {
+                    [[KMMemberInfo shared] advancedFunctionUsage];
+                }
+            } else {
+                [[KMLoginWindowsController shared] openWindow:^(BOOL success) {
+                    if (success) {
+                        if ([[KMMemberInfo shared].vip_levels isEqualToString:@"1"]) {
+                            [[KMProductCompareWC shared] setOrientation:YES];
+    #if VERSION_FREE
+    #if VERSION_DMG
+        // DMG
+                [[KMProductCompareWC shared] setOrientationType:KMCompareTableTypeDmg_Base];
+    #else
+        // AppStore 免费版本
+                [[KMProductCompareWC shared] setOrientationType:KMCompareTableTypeLite_Base];
+    #endif
+    #else
+        // AppStore 付费版
+                [[KMProductCompareWC shared] setOrientationType:KMCompareTableTypePro_Base];
+    #endif
+                            [[KMProductCompareWC shared] showWindow:nil];
+                        } else {
+                            [[KMMemberInfo shared] advancedFunctionUsage];
+                        }
+                    }
+                }];
+            }
         } else {
             [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:[KMAdvertisementModelTransition transitionLanguageWithLangeuage:_info.linkURL]]];
         }

+ 70 - 22
PDF Office/PDF Master/Class/Purchase/DMG/Verification/KMVerificationMessageViewController.m

@@ -528,34 +528,72 @@ NSPopoverDelegate>
         KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeRepeatTrialGuide];
         [vc showWindow:nil];
     } else {
-        [[KMProductCompareWC shared] setOrientation:NO];
-        [[KMProductCompareWC shared] showWindow:nil];
+        [[KMMemberInfo shared] advancedFunctionUsage];
     }
 }
 
 - (IBAction)buttonAction:(id)sender {
     if (KMAdvertisementManager.manager.info.topRightInfoContent != nil) {
         if (KMAdvertisementManager.manager.info.topRightInfoContent.content.firstObject != nil) {
-            [[KMProductCompareWC shared] setOrientation:YES];
-#if VERSION_FREE
-#if VERSION_DMG
-    // DMG
-            [[KMProductCompareWC shared] setOrientationType:KMCompareTableTypeDmg_Base];
-#else
-    // AppStore 免费版本
-            [[KMProductCompareWC shared] setOrientationType:KMCompareTableTypeLite_Base];
-#endif
-#else
-    // AppStore 付费版
-            [[KMProductCompareWC shared] setOrientationType:KMCompareTableTypePro_Base];
-#endif
-            [[KMProductCompareWC shared] showWindow:nil];
+            if ([KMMemberInfo shared].isLogin) {
+                if ([[KMMemberInfo shared].vip_levels isEqualToString:@"1"]) {
+                    [[KMProductCompareWC shared] setOrientation:YES];
+        #if VERSION_FREE
+        #if VERSION_DMG
+            // DMG
+                    [[KMProductCompareWC shared] setOrientationType:KMCompareTableTypeDmg_Base];
+        #else
+            // AppStore 免费版本
+                    [[KMProductCompareWC shared] setOrientationType:KMCompareTableTypeLite_Base];
+        #endif
+        #else
+            // AppStore 付费版
+                    [[KMProductCompareWC shared] setOrientationType:KMCompareTableTypePro_Base];
+        #endif
+                    [[KMProductCompareWC shared] showWindow:nil];
+                } else {
+                    [[KMMemberInfo shared] advancedFunctionUsage];
+                }
+            } else {
+                [[KMLoginWindowsController shared] openWindow:^(BOOL success) {
+                    if (success) {
+                        if ([[KMMemberInfo shared].vip_levels isEqualToString:@"1"]) {
+                            [[KMProductCompareWC shared] setOrientation:YES];
+                #if VERSION_FREE
+                #if VERSION_DMG
+                    // DMG
+                            [[KMProductCompareWC shared] setOrientationType:KMCompareTableTypeDmg_Base];
+                #else
+                    // AppStore 免费版本
+                            [[KMProductCompareWC shared] setOrientationType:KMCompareTableTypeLite_Base];
+                #endif
+                #else
+                    // AppStore 付费版
+                            [[KMProductCompareWC shared] setOrientationType:KMCompareTableTypePro_Base];
+                #endif
+                            [[KMProductCompareWC shared] showWindow:nil];
+                        } else {
+                            [[KMMemberInfo shared] advancedFunctionUsage];
+                        }
+                    }
+                }];
+            }
         } else {
             KMUserScenarioType type = [KMMemberInfo shared].userScenarioType;
             if (type == KMUserScenarioTypeDmg_type4) {
-                [[KMProductCompareWC shared] setOrientation:YES];
-                [[KMProductCompareWC shared] setOrientationType:KMCompareTableTypeTrial];
-                [[KMProductCompareWC shared] showWindow:nil];
+                if ([KMMemberInfo shared].isLogin) {
+                    [[KMProductCompareWC shared] setOrientation:YES];
+                    [[KMProductCompareWC shared] setOrientationType:KMCompareTableTypeTrial];
+                    [[KMProductCompareWC shared] showWindow:nil];
+                } else {
+                    [[KMLoginWindowsController shared] openWindow:^(BOOL success) {
+                        if (success) {
+                            [[KMProductCompareWC shared] setOrientation:YES];
+                            [[KMProductCompareWC shared] setOrientationType:KMCompareTableTypeTrial];
+                            [[KMProductCompareWC shared] showWindow:nil];
+                        }
+                    }];
+                }
             } else {
                 [[KMMemberInfo shared] advancedFunctionUsage];
             }
@@ -563,9 +601,19 @@ NSPopoverDelegate>
     } else {
         KMUserScenarioType type = [KMMemberInfo shared].userScenarioType;
         if (type == KMUserScenarioTypeDmg_type4) {
-            [[KMProductCompareWC shared] setOrientation:YES];
-            [[KMProductCompareWC shared] setOrientationType:KMCompareTableTypeTrial];
-            [[KMProductCompareWC shared] showWindow:nil];
+            if ([KMMemberInfo shared].isLogin) {
+                [[KMProductCompareWC shared] setOrientation:YES];
+                [[KMProductCompareWC shared] setOrientationType:KMCompareTableTypeTrial];
+                [[KMProductCompareWC shared] showWindow:nil];
+            } else {
+                [[KMLoginWindowsController shared] openWindow:^(BOOL success) {
+                    if (success) {
+                        [[KMProductCompareWC shared] setOrientation:YES];
+                        [[KMProductCompareWC shared] setOrientationType:KMCompareTableTypeTrial];
+                        [[KMProductCompareWC shared] showWindow:nil];
+                    }
+                }];
+            }
         } else {
             [[KMMemberInfo shared] advancedFunctionUsage];
         }

+ 1 - 2
PDF Office/PDF Master/Class/Purchase/DMG/Verification/KMVerificationWindowController.m

@@ -303,8 +303,7 @@ static KMVerificationWindowController *_currentWindowController = nil;
 //                NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@?utm_source=app_dmg&utm_medium=dmg_puw_sec_free_trial", Swift_oc_Tool.Store_Link_OC]];
 //                [[NSWorkspace sharedWorkspace] openURL:url];
 //                [blockSelf close];
-                [[KMProductCompareWC shared] setOrientation:NO];
-                [[KMProductCompareWC shared] showWindow:nil];
+                [[KMMemberInfo shared] advancedFunctionUsage];
             } else if (clickIndex == 2) {
                 //输入序列码
                 KMVerificationWindowController *vc = [KMVerificationWindowController verificationWithType:KMVerificationTypeActivate];