浏览代码

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

zenghong 1 周之前
父节点
当前提交
4b4842933c

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

@@ -761,6 +761,10 @@ class AppDelegate: NSObject, NSApplicationDelegate, iRateDelegate{
     }
     
     @objc func restoreSubscriptions(_ sender: NSMenuItem) {
+        if(KMMemberInfo.shared.isLogin == false) {
+            KMLoginWindowsController.shared.showWindow(nil)
+            return
+        }
 #if VERSION_FREE
         KMPrint("restoreSubscriptions ...")
         KMProductCompareWC.shared.orientation = false

+ 8 - 9
PDF Office/PDF Master/Class/AIInfo/AIPurchaseWindowController/AIPurchaseWindowController.swift

@@ -129,7 +129,6 @@ class AIPurchaseWindowController: NSWindowController, NSWindowDelegate {
         NotificationCenter.default.addObserver(self, selector: #selector(IAPProductRestoreFinishedNotification), name: NSNotification.Name(rawValue: NSNotification.Name.KMIAPProductRestoreFinished.rawValue), object: nil)
         NotificationCenter.default.addObserver(self, selector: #selector(IAPProductRestoreFailedNotification), name: NSNotification.Name(rawValue: NSNotification.Name.KMIAPProductRestoreFailed.rawValue), object: nil)
         NotificationCenter.default.addObserver(self, selector: #selector(AIDeviceStatusChangeNotification), name: NSNotification.Name(rawValue: "kDeviceAIStatusChangeNotification"), object: nil)
-        
     }
     
     func refreshUI() -> Void {
@@ -143,9 +142,9 @@ class AIPurchaseWindowController: NSWindowController, NSWindowDelegate {
     func reloadData() -> Void {
         self.purchaseButton.isEnabled = true
 #if VERSION_FREE
-        let priceLabel = IAPProductsManager.default().liteAIProduct.price()
+        let priceLabel = IAPProductsManager.default().aiAllAccessPack1month_lite.price()
 #else
-        let priceLabel = IAPProductsManager.default().proAIProduct.price()
+        let priceLabel = IAPProductsManager.default().aiAllAccessPack1month_pro.price()
 #endif
         
         let aiInfoValid = KMMemberInfo.shared.isPermitAI
@@ -162,9 +161,9 @@ class AIPurchaseWindowController: NSWindowController, NSWindowDelegate {
     func appStoreRestoreFinish() -> Void {
         var didPurchased: Bool = false
 #if VERSION_FREE
-        didPurchased = IAPProductsManager.default().liteAIProduct.isSubscribed
+        didPurchased = IAPProductsManager.default().aiAllAccessPack1month_lite.isSubscribed
 #else
-        didPurchased = IAPProductsManager.default().proAIProduct.isSubscribed
+        didPurchased = IAPProductsManager.default().aiAllAccessPack1month_pro.isSubscribed
 #endif
         if didPurchased {
             AIInfoManager.default().restoreAI(withInfo: ["receipt_str":IAPProductsManager.default().temptransactioReceipt as Any]) { dict, error in
@@ -201,9 +200,9 @@ class AIPurchaseWindowController: NSWindowController, NSWindowDelegate {
     //MARK: - IBAction
     @IBAction func purchaseAction(_ sender: KMButton) {
 #if VERSION_FREE
-        IAPProductsManager.default().make(IAPProductsManager.default().liteAIProduct)
+        IAPProductsManager.default().make(IAPProductsManager.default().aiAllAccessPack1month_lite)
 #else
-        IAPProductsManager.default().make(IAPProductsManager.default().proAIProduct)
+        IAPProductsManager.default().make(IAPProductsManager.default().aiAllAccessPack1month_pro)
 #endif
         self.addWaingView((self.window?.contentView)!)
         FMTrackEventManager.defaultManager.trackOnceEvent(event: "PUW", withProperties: ["PUW_Btn":"PUW_Btn_BuyAITools"])
@@ -254,7 +253,7 @@ class AIPurchaseWindowController: NSWindowController, NSWindowDelegate {
             
             //Appstore购买结束后绑定票据信息
 #if VERSION_FREE
-            if IAPProductsManager.default().liteAIProduct.isSubscribed {
+            if IAPProductsManager.default().aiAllAccessPack1month_lite.isSubscribed {
                 AIInfoManager.default().activateAI(withInfo: ["receipt_str":IAPProductsManager.default().temptransactioReceipt as Any]) { dict, error in
                     self.reloadData()
                     if KMMemberInfo.shared.isPermitAI {
@@ -263,7 +262,7 @@ class AIPurchaseWindowController: NSWindowController, NSWindowDelegate {
                 }
             }
 #else
-            if IAPProductsManager.default().proAIProduct.isSubscribed {
+            if IAPProductsManager.default().aiAllAccessPack1month_pro.isSubscribed {
                 AIInfoManager.default().activateAI(withInfo: ["receipt_str":IAPProductsManager.default().temptransactioReceipt as Any]) { dict, error in
                     self.reloadData()
                     if KMMemberInfo.shared.isPermitAI {

+ 1 - 1
PDF Office/PDF Master/Class/AIInfo/AIPurchaseWindowController/AIPurchaseWindowController.xib

@@ -28,7 +28,7 @@
         <window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" titlebarAppearsTransparent="YES" titleVisibility="hidden" id="F0z-JX-Cv5">
             <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES" fullSizeContentView="YES"/>
             <rect key="contentRect" x="196" y="240" width="490" height="530"/>
-            <rect key="screenRect" x="0.0" y="0.0" width="1800" height="1125"/>
+            <rect key="screenRect" x="0.0" y="0.0" width="2560" height="1415"/>
             <view key="contentView" id="se5-gp-TjO">
                 <rect key="frame" x="0.0" y="0.0" width="490" height="530"/>
                 <autoresizingMask key="autoresizingMask"/>

+ 15 - 6
PDF Office/PDF Master/Class/AIInfo/KMAIRequestServerManager.swift

@@ -317,18 +317,27 @@ class ResultWrapper: NSObject {
             if responseObject != nil {
                 let data: NSDictionary = responseObject as? NSDictionary ?? [:]
                 if data.count > 0 {
-                    let wrapper = ResultWrapper(success: true, resultData: data)
-                    if let value = data["fileKey"] {
-                        wrapper.content = value as! String
+                    let code: Int = data["code"] as? Int ?? 06005
+                    if code == 200 {
+                        let wrapper = ResultWrapper(success: true, resultData: data)
+                        if let value = data["fileKey"] {
+                            wrapper.content = value as! String
+                        }
+                        complete(wrapper)
+                    } else {
+                        let wrapper = ResultWrapper(success: false, resultData: data)
+                        if let value = data["msg"] {
+                            wrapper.content = value as! String
+                        }
+                        complete(wrapper)  
                     }
-                    complete(wrapper)
                 } else {
                     let error = NSError(domain: "unknown error", code: 404)
-                     complete(ResultWrapper(success: false, content: "unknown error"))
+                    complete(ResultWrapper(success: false, content: "unknown error"))
                 }
             } else {
                 let error = NSError(domain: "unknown error", code: 404)
-                 complete(ResultWrapper(success: false, content: "unknown error"))
+                complete(ResultWrapper(success: false, content: "unknown error"))
             }
         }
     }

+ 8 - 1
PDF Office/PDF Master/Class/Purchase/DMG/Verification/KMVerificationMessageViewController.m

@@ -217,7 +217,14 @@ NSPopoverDelegate>
         [KMMemberInfo shared].userScenarioType == KMUserScenarioTypePro_type3 ||
         [KMMemberInfo shared].userScenarioType == KMUserScenarioTypePro_type4) {
         if ([KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type1) {
-            self.button.title = [NSString stringWithFormat:@" %@ ",NSLocalizedString(@"Free Trial", nil)];
+#if !VERSION_DMG
+            if(IAPProductsManager.defaultManager.fourDevicesAllAccessPackNew12months_lite.isTrialPeriod == YES) {
+                self.button.title = [NSString stringWithFormat:@" %@ ",NSLocalizedString(@"Upgrade", nil)];
+            } else {
+                self.button.title = [NSString stringWithFormat:@" %@ ",NSLocalizedString(@"Free Trial", nil)];
+            }
+#else
+#endif
             
             if (KMAdvertisementManager.manager.info.topRightInfoContent != nil) {
                 if (KMAdvertisementManager.manager.info.topRightInfoContent.content.firstObject != nil) {

+ 2 - 2
PDF Office/PDF Master/Class/Purchase/DMG/Verification/VerificationManager/AIInfoManager.m

@@ -294,11 +294,11 @@ static AIInfoManager *__Manager = nil;
                 //当前票据未激活设备(针对AppStore版购买过但未激活的情况)
                 BOOL didPurchase = NO;
 #if VERSION_FREE
-                if ([IAPProductsManager defaultManager].liteAIProduct.isSubscribed) {
+                if ([IAPProductsManager defaultManager].aiAllAccessPack1month_lite.isSubscribed) {
                     didPurchase = YES;
                 }
 #else
-                if ([IAPProductsManager defaultManager].proAIProduct.isSubscribed) {
+                if ([IAPProductsManager defaultManager].aiAllAccessPack1month_pro.isSubscribed) {
                     didPurchase = YES;
                 }
 #endif

+ 4 - 2
PDF Office/PDF Master/MemberCenter/Model/KMMemberInfo.swift

@@ -351,7 +351,8 @@ import Cocoa
                         .map { $0.trimmingCharacters(in: .whitespaces) }
 
                     if userScenarioType == .lite_type5 ||
-                        userScenarioType == .lite_type4 {
+                        userScenarioType == .lite_type4 ||
+                        userScenarioType == .lite_type8 {
                         if(platformsArray.contains("mac")) {
                             return true
                         }
@@ -401,7 +402,8 @@ import Cocoa
                     if(userScenarioType == .lite_type2) {
                         return true
                     } else if userScenarioType == .lite_type5 ||
-                        userScenarioType == .lite_type4 {
+                        userScenarioType == .lite_type4  ||
+                                userScenarioType == .lite_type8 {
                         if(platformsArray.contains("mac")) { //购买了
                             return true
                         }