瀏覽代碼

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

wanjun 2 周之前
父節點
當前提交
2df1b5b3c4

+ 5 - 0
PDF Office/PDF Master/AppDelegate.swift

@@ -406,6 +406,11 @@ class AppDelegate: NSObject, NSApplicationDelegate, iRateDelegate{
         if let browser = windowControler?.browser {
             if browser.tabCount() == 1 {
                 windowControler?.window?.close()
+                
+                if KMAdvertisementManager.manager.appClosedCount == 0 {
+                    KMAdvertisementManager.manager.appClosedCount = 1
+                }
+                
             } else {
                 if let _ = windowControler?.window?.attachedSheet {
                     NSSound.beep()

+ 5 - 0
PDF Office/PDF Master/Class/Document/KMMainDocument.swift

@@ -303,6 +303,11 @@ typealias KMMainDocumentCloudUploadHanddler = (@escaping(Bool, String)->()) -> (
         let isPrompt = KMPreferenceManager.shared.closeFileIsPrompt()
         if (isPrompt) {
             super.canClose(withDelegate: delegate, shouldClose: shouldCloseSelector, contextInfo: contextInfo)
+            
+            if KMAdvertisementManager.manager.appClosedCount == 0 {
+                KMAdvertisementManager.manager.appClosedCount = 1
+            }
+            
             return
         }
 

+ 3 - 3
PDF Office/PDF Master/Class/Home/ViewController/KMHomeViewController.swift

@@ -116,9 +116,9 @@ import Cocoa
     
     override func viewWillAppear() {
         super.viewWillAppear()
-        if !KMLightMemberManager.manager.isLogin() {
-            KMLightMemberManager.manager.canShowAdvancedView = true
-        }
+//        if !KMLightMemberManager.manager.isLogin() {
+//            KMLightMemberManager.manager.canShowAdvancedView = true
+//        }
         self.homeContentView.reloadData()
 #if VERSION_DMG
         let kDMGFirstInstallKey = "DMGFirstInstallKey"

+ 2 - 0
PDF Office/PDF Master/Class/KMAdvertisement/Manager/KMAdvertisementManager.swift

@@ -10,6 +10,8 @@
     @objc public static let manager = KMAdvertisementManager()
     @objc public var configuration: KMAdvertisementConfig = KMAdvertisementConfig()
     
+    var appClosedCount = 0
+    
     var info: KMAdvertisementInfo = KMAdvertisementInfo()
     var infoDict: NSDictionary = NSDictionary()
     

+ 3 - 0
PDF Office/PDF Master/Class/KMAdvertisement/Model/KMAdvertisementModel.swift

@@ -41,6 +41,7 @@
     var show: String? //是否显示,内部有做了时间区间判断
     var subscriptionType: String? //类型
     var showType: KMAdvertisementShowType?
+    var jumpType: String?
     var startTime: String?
     var endTime: String?
     var version: String? //版本号,唯一标识符
@@ -48,10 +49,12 @@
     var image: Image? //APP互推,常规状态下的图片
     var saleImage: Image? // 订阅折扣图片
     var iconImage: String? //广告显示图片(自适应多语)
+    var dfpImage: Image?
     var name: Language? //名称(自适应多语)
     var tooltip: Language? //提示语(自适应多语)
     var linkURL: Language? //跳转链接(自适应多语)
     var subTitle: Language? //名称(自适应多语)
+    var newSubTitle: Language? //名称(自适应多语)
     var otherTitle: Language? //名称(自适应多语)
     var btnTitle: Language? //名称(自适应多语)
     

+ 8 - 3
PDF Office/PDF Master/Class/KMAdvertisement/View/KMRecommondPopWindow/KMRecommondPopWindow.m

@@ -75,7 +75,7 @@ NSWindowDelegate>
     }];
 
     self.titleLbl.stringValue = [KMAdvertisementModelTransition transitionLanguageWithLangeuage:_info.name];
-    NSString *subT = [KMAdvertisementModelTransition transitionLanguageWithLangeuage:_info.subTitle];
+    NSString *subT = [KMAdvertisementModelTransition transitionLanguageWithLangeuage:_info.newSubTitle];
     if ([subT containsString:@"\\n"]) {
         subT = [subT stringByReplacingOccurrencesOfString:@"\\n" withString:@"\n"];
     }
@@ -95,8 +95,13 @@ NSWindowDelegate>
 #pragma mark - IBAction
 - (IBAction)buyAction:(NSButton *)sender {
     if (_info.version) {
-        [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:[KMAdvertisementModelTransition transitionLanguageWithLangeuage:_info.linkURL]]];
-        
+        if ([_info.jumpType isEqualToString:@"Comparison Sheet"]) {
+            [[KMProductCompareWC shared] setOrientation:NO];
+            [[KMProductCompareWC shared] showWindow:nil];
+        } else {
+            [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:[KMAdvertisementModelTransition transitionLanguageWithLangeuage:_info.linkURL]]];
+        }
+         
         if (_info.firebase != nil) {
             [KMAdvertisementModelTransition sendFireBaseEventWithFirebase:_info.firebase];
         }

+ 8 - 5
PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController.swift

@@ -266,13 +266,16 @@ import Cocoa
         super.viewDidAppear()
         
         //春季活动
-        if ((KMAdvertisementManager.manager.info.popWindowContent) != nil) {
-            if KMAdvertisementManager.manager.info.popWindowContent!.content!.count > 0 {
-                let info = KMAdvertisementManager.manager.info.popWindowContent!.content?.first
-                if KMAdvertisementManager.checkAdvertisementValid(info!) {
-                    self.loadRecommondPopWindow()
+        if KMAdvertisementManager.manager.appClosedCount == 1 {
+            if ((KMAdvertisementManager.manager.info.popWindowContent) != nil) {
+                if KMAdvertisementManager.manager.info.popWindowContent!.content!.count > 0 {
+                    let info = KMAdvertisementManager.manager.info.popWindowContent!.content?.first
+                    if KMAdvertisementManager.checkAdvertisementValid(info!) {
+                        self.loadRecommondPopWindow()
+                    }
                 }
             }
+            KMAdvertisementManager.manager.appClosedCount = 2
         }
         
         //刷新前一页后一页按钮

+ 26 - 0
PDF Office/PDF Master/Class/Purchase/DMG/Verification/KMVerificationMessageViewController.m

@@ -445,6 +445,12 @@ NSPopoverDelegate>
                     KMAdvertisementItemInfo *info = KMAdvertisementManager.manager.info.topRightInfoContent.content.firstObject;
                     NSString *name = [KMAdvertisementModelTransition transitionLanguageWithLangeuage:info.name];
                     self.button.title = [NSString stringWithFormat:@" %@ ",NSLocalizedString(name, nil)];
+                    
+                    NSURL *url = [NSURL URLWithString: [KMAdvertisementModelTransition transitionImagePathWithImage:info.image highlight: YES]];
+                    __weak typeof(self)weakSelf = self;
+                    weakSelf.bgImg.image = [KMAdvertisementImage imageWithURLWithUrl:url completion:^(NSImage *image) {
+                        weakSelf.bgImg.image = image;
+                    }];
                 }
             }
         } else if ([KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type3 ||
@@ -462,6 +468,12 @@ NSPopoverDelegate>
                     KMAdvertisementItemInfo *info = KMAdvertisementManager.manager.info.topRightInfoContent.content.firstObject;
                     NSString *name = [KMAdvertisementModelTransition transitionLanguageWithLangeuage:info.name];
                     self.button.title = [NSString stringWithFormat:@" %@ ",NSLocalizedString(name, nil)];
+                    
+                    NSURL *url = [NSURL URLWithString: [KMAdvertisementModelTransition transitionImagePathWithImage:info.image highlight: YES]];
+                    __weak typeof(self)weakSelf = self;
+                    weakSelf.bgImg.image = [KMAdvertisementImage imageWithURLWithUrl:url completion:^(NSImage *image) {
+                        weakSelf.bgImg.image = image;
+                    }];
                 }
             }
         } else if ([KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type7
@@ -484,6 +496,20 @@ NSPopoverDelegate>
         totalWidth += userImageWidth;
         totalWidth += 8;
     } else {
+        if (KMAdvertisementManager.manager.info.topRightInfoContent != nil) {
+            if (KMAdvertisementManager.manager.info.topRightInfoContent.content.firstObject != nil) {
+                KMAdvertisementItemInfo *info = KMAdvertisementManager.manager.info.topRightInfoContent.content.firstObject;
+                NSString *name = [KMAdvertisementModelTransition transitionLanguageWithLangeuage:info.name];
+                self.button.title = [NSString stringWithFormat:@" %@ ",NSLocalizedString(name, nil)];
+                
+                NSURL *url = [NSURL URLWithString: [KMAdvertisementModelTransition transitionImagePathWithImage:info.image highlight: YES]];
+                __weak typeof(self)weakSelf = self;
+                weakSelf.bgImg.image = [KMAdvertisementImage imageWithURLWithUrl:url completion:^(NSImage *image) {
+                    weakSelf.bgImg.image = image;
+                }];
+            }
+        }
+        
         self.signUpView.hidden = NO;
         self.signUpView.frame = CGRectMake(totalWidth, 0, signUpWidth, self.view.frame.size.height);
         totalWidth+=CGRectGetWidth(self.signUpView.bounds);

+ 2 - 3
PDF Office/PDF Master/Class/Purchase/DMG/Verification/VerificationManager/KMAdsInfo.swift

@@ -86,8 +86,7 @@ enum KMDFPJumpType: Int {
     
     var adsImage: NSImage {
         get {
-            
-            let imageDict: [String: Any] = self.infoDict["image"] as! [String : Any]
+            let imageDict: [String: Any] = self.infoDict["dfpImage"] as! [String : Any]
             let imageURLString = imageDict[self.languageKey] as! NSString
             
             var imageName = self.versionKey
@@ -140,7 +139,7 @@ enum KMDFPJumpType: Int {
     
     var jumpType: KMDFPJumpType {
         get {
-            guard let typeString = self.infoDict.object(forKey: "jumpType") else {
+            guard let typeString = self.infoDict.object(forKey: "dfpJumpType") else {
                 return .Web
             }
             if typeString is String {

+ 5 - 37
PDF Office/PDF Reader Pro.xcodeproj/xcuserdata/kdanmobile.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -257,49 +257,17 @@
       <BreakpointProxy
          BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
          <BreakpointContent
-            uuid = "DEF8B62C-3C52-43B3-A129-91F42705A796"
+            uuid = "5E2E2C14-F04B-4D1C-B46B-631B24C10B00"
             shouldBeEnabled = "Yes"
             ignoreCount = "0"
             continueAfterRunningActions = "No"
-            filePath = "PDF Master/Class/Purchase/DMG/Verification/KMVerificationMessageViewController.m"
+            filePath = "PDF Master/Class/ChromiumTabs/src/Tab Strip/CTTabStripController.m"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "461"
-            endingLineNumber = "461"
-            landmarkName = "-reloadData"
+            startingLineNumber = "689"
+            endingLineNumber = "689"
+            landmarkName = "-closeTab:"
             landmarkType = "7">
-            <Locations>
-               <Location
-                  uuid = "DEF8B62C-3C52-43B3-A129-91F42705A796 - 58aa04bf38df9640"
-                  shouldBeEnabled = "Yes"
-                  ignoreCount = "0"
-                  continueAfterRunningActions = "No"
-                  symbolName = "-[KMVerificationMessageViewController reloadData]"
-                  moduleName = "PDF Reader Pro"
-                  usesParentBreakpointCondition = "Yes"
-                  urlString = "file:///Users/kdanmobile/Documents/Git/PDF_Office/PDF%20Office/PDF%20Master/Class/Purchase/DMG/Verification/KMVerificationMessageViewController.m"
-                  startingColumnNumber = "9223372036854775807"
-                  endingColumnNumber = "9223372036854775807"
-                  startingLineNumber = "461"
-                  endingLineNumber = "461"
-                  offsetFromSymbolStart = "7672">
-               </Location>
-               <Location
-                  uuid = "DEF8B62C-3C52-43B3-A129-91F42705A796 - 58aa04bf38df9640"
-                  shouldBeEnabled = "Yes"
-                  ignoreCount = "0"
-                  continueAfterRunningActions = "No"
-                  symbolName = "-[KMVerificationMessageViewController reloadData]"
-                  moduleName = "PDF Reader Pro"
-                  usesParentBreakpointCondition = "Yes"
-                  urlString = "file:///Users/kdanmobile/Documents/Git/PDF_Office/PDF%20Office/PDF%20Master/Class/Purchase/DMG/Verification/KMVerificationMessageViewController.m"
-                  startingColumnNumber = "9223372036854775807"
-                  endingColumnNumber = "9223372036854775807"
-                  startingLineNumber = "461"
-                  endingLineNumber = "461"
-                  offsetFromSymbolStart = "7700">
-               </Location>
-            </Locations>
          </BreakpointContent>
       </BreakpointProxy>
    </Breakpoints>