ソースを参照

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

niehaoyu 1 週間 前
コミット
0e9b2bd508
22 ファイル変更267 行追加157 行削除
  1. 2 2
      PDF Office/PDF Master/Class/Batch/Data/KMBatchConvertParameter.swift
  2. 0 4
      PDF Office/PDF Master/Class/Batch/View/KMBatchoperateConvertCollectionViewItem.swift
  3. 2 6
      PDF Office/PDF Master/Class/Batch/View/KMConvertCollectionViewHeader.swift
  4. 1 1
      PDF Office/PDF Master/Class/Batch/WindowController/KMBatchOperateWindowController.swift
  5. 12 19
      PDF Office/PDF Master/Class/Batch/WindowController/VC/KMBatchOperateConvertViewController.swift
  6. 1 1
      PDF Office/PDF Master/Class/Common/OC/StatusBar/KMStatusBar.m
  7. 2 2
      PDF Office/PDF Master/Class/Home/ViewController/KMHomeViewController.swift
  8. 10 20
      PDF Office/PDF Master/Class/PDFTools/Convert/NewController/KMConvertWindowController.swift
  9. 1 1
      PDF Office/PDF Master/Class/PDFTools/Convert/NewController/KMConvertWindowController.xib
  10. 1 1
      PDF Office/PDF Master/Class/PDFTools/Convert/NewController/KMToolCompareWindowController.swift
  11. 1 1
      PDF Office/PDF Master/Class/PDFWindowController/ViewController/KMMainViewController.swift
  12. 2 10
      PDF Office/PDF Master/Class/Purchase/DMG/KMPurchaseEmbeddedWindowController.swift
  13. 1 1
      PDF Office/PDF Master/Class/Purchase/DMG/KMPurchaseLimitWindowController.swift
  14. 11 5
      PDF Office/PDF Master/Class/Purchase/DMG/Verification/KMVerificationMessageViewController.m
  15. 1 0
      PDF Office/PDF Master/Class/Purchase/IAPProductsManager.h
  16. 43 5
      PDF Office/PDF Master/Class/Purchase/IAPProductsManager.m
  17. 4 4
      PDF Office/PDF Master/Class/Purchase/KMConvertComparePayViewController.m
  18. 128 47
      PDF Office/PDF Master/MemberCenter/Model/KMMemberInfo.swift
  19. 7 1
      PDF Office/PDF Master/MemberCenter/ViewController/KMUserInfoViewController.swift
  20. 2 2
      PDF Office/PDF Master/MemberCenter/ViewController/KMUserInfoViewController.xib
  21. 31 22
      PDF Office/PDF Master/MemberCenter/ViewModel/KMProductModel.swift
  22. 4 2
      PDF Office/PDF Master/MemberCenter/WindowsController/KMProductCompareWC.swift

+ 2 - 2
PDF Office/PDF Master/Class/Batch/Data/KMBatchConvertParameter.swift

@@ -111,7 +111,7 @@ class KMBatchConvertParameter: KMBatchBaseParameter {
         var isLimitConvert = false
 #if VERSION_FREE
         //         桌机版
-        if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
+        if KMMemberInfo.shared.isPermitConvert {
             isLimitConvert = false
         } else {
             if .PNG == self.convertType ||
@@ -127,7 +127,7 @@ class KMBatchConvertParameter: KMBatchBaseParameter {
         }
 #else
         //         付费版
-        if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
+        if KMMemberInfo.shared.isPermitConvert {
             isLimitConvert = false
         } else {
             if .PNG == self.convertType ||

+ 0 - 4
PDF Office/PDF Master/Class/Batch/View/KMBatchoperateConvertCollectionViewItem.swift

@@ -48,10 +48,6 @@ class KMBatchoperateConvertCollectionViewItem: NSCollectionViewItem{
     }
     
     @IBAction func buttonClicked_AdvancedClicked(_ sender: Any) {
-//        if !IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
-//            KMProductCompareWC.shared.orientation = false
-//            KMProductCompareWC.shared.showWindow(nil)
-//        }
         if !KMMemberInfo.shared.isPermitConvert {
             KMMemberInfo.shared.advancedFunctionUsage()
         }

+ 2 - 6
PDF Office/PDF Master/Class/Batch/View/KMConvertCollectionViewHeader.swift

@@ -36,10 +36,6 @@ class KMConvertCollectionViewHeader: KMBaseXibView{
         super.awakeFromNib()
 
         containerView.wantsLayer = true
-//        containerView.layer?.cornerRadius = 12
-//                if IAPProductsManager.defaultManager().isAvailableAdvancedPDFToOffice {
-//                    containerView.isHidden = true
-//                }
 //        购买状态变化通知
         self.layerColorView.wantsLayer = true
         self.layerColorView.layer?.masksToBounds = true
@@ -67,14 +63,14 @@ class KMConvertCollectionViewHeader: KMBaseXibView{
         let point = event.locationInWindow
         let newPoint = convert(point, from: nil)
         if let data = self.containerView?.frame.contains(newPoint), data {
-            if !IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
+            if !KMMemberInfo.shared.isPermitConvert {
                 self.convertHeaderClickedCallBack?()
             }
         }
     }
     
     func refreshData() {
-        if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
+        if KMMemberInfo.shared.isPermitConvert {
             containerView.isHidden = true
         } else {
             containerView.isHidden = false

+ 1 - 1
PDF Office/PDF Master/Class/Batch/WindowController/KMBatchOperateWindowController.swift

@@ -320,7 +320,7 @@ let kBatchOperateToolbar_BatesIdentifier = "kBatchOperateToolbar_BatesIdentifier
         
         wc.switchToOperateType(.Convert, files:KMBatchOperateManager.defaultManager.files!)
         
-        wc.switchToConvertType(convertType: IAPProductsManager.default().isAvailableAdvancedPDFToOffice() ? .WordAdvance : .WordStandard)
+        wc.switchToConvertType(convertType: KMMemberInfo.shared.isPermitConvert ? .WordAdvance : .WordStandard)
         
         wc.updateViewColor()
         

+ 12 - 19
PDF Office/PDF Master/Class/Batch/WindowController/VC/KMBatchOperateConvertViewController.swift

@@ -153,7 +153,7 @@ class KMBatchOperateConvertViewController: KMBatchOperateBaseViewController{
 #if VERSION_DMG
         // 桌机版
         if KMMemberInfo.shared.isMemberAllFunction {
-            if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
+            if KMMemberInfo.shared.isPermitConvert {
             } else {
                 isShowUpgrade = true
             }
@@ -163,7 +163,7 @@ class KMBatchOperateConvertViewController: KMBatchOperateBaseViewController{
 #else
         // 免费版
         if KMMemberInfo.shared.isMemberAllFunction {
-            if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
+            if KMMemberInfo.shared.isPermitConvert {
             } else {
                 isShowUpgrade = true
             }
@@ -173,25 +173,18 @@ class KMBatchOperateConvertViewController: KMBatchOperateBaseViewController{
         
 #endif
 #else
-        if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
+        if KMMemberInfo.shared.isPermitConvert {
         } else {
             isShowUpgrade = true
         }
 #endif
-//        if !isShowUpgrade {
-//            headerView.isHidden = true
-//            headerTopOffset.constant = 0
-//        } else {
-//            headerView.isHidden = false
-//            headerTopOffset.constant = self.headerView.frame.height
-//        }
 
         var moreLabelString = ""
 #if VERSION_FREE
         if !KMMemberInfo.shared.isMemberAllFunction {
             moreLabelString = String(format: "%@ %@", KMLocalizedString("The first 10 pages for free"), KMLocalizedString("Unlimited Convert"))
         } else {
-            if !IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
+            if !KMMemberInfo.shared.isPermitConvert {
                 if .WordAdvance == self.convertType ||
                     .WordStandard == self.convertType ||
                     .Excel == self.convertType ||
@@ -210,7 +203,7 @@ class KMBatchOperateConvertViewController: KMBatchOperateBaseViewController{
         }
 #else
         // 付费版
-        if !IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
+        if !KMMemberInfo.shared.isPermitConvert {
             if .WordAdvance == self.convertType ||
                 .WordStandard == self.convertType ||
                 .Excel == self.convertType ||
@@ -422,13 +415,13 @@ class KMBatchOperateConvertViewController: KMBatchOperateBaseViewController{
 #if VERSION_FREE
         // 桌机版
         if KMMemberInfo.shared.isMemberAllFunction {
-            if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
+            if KMMemberInfo.shared.isPermitConvert {
                 needShowAdvance = true
                 needShowDefault = false
             }
         }
 #else
-        if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
+        if KMMemberInfo.shared.isPermitConvert {
             needShowAdvance = true
             needShowDefault = false
         }
@@ -453,7 +446,7 @@ class KMBatchOperateConvertViewController: KMBatchOperateBaseViewController{
         // 桌机版
         isShowAdvanced = true
         if KMMemberInfo.shared.isMemberAllFunction {
-            if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
+            if KMMemberInfo.shared.isPermitConvert {
                 isShowAdvanced = false
             }
         }
@@ -461,7 +454,7 @@ class KMBatchOperateConvertViewController: KMBatchOperateBaseViewController{
         // 免费版
         isShowAdvanced = true
         if KMMemberInfo.shared.isMemberAllFunction {
-            if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
+            if KMMemberInfo.shared.isPermitConvert {
                 isShowAdvanced = false
             }
         }
@@ -469,7 +462,7 @@ class KMBatchOperateConvertViewController: KMBatchOperateBaseViewController{
 #endif
 #else
         isShowAdvanced = true
-        if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
+        if KMMemberInfo.shared.isPermitConvert {
             isShowAdvanced = false
         }
 #endif
@@ -707,9 +700,9 @@ class KMBatchOperateConvertViewController: KMBatchOperateBaseViewController{
     }
     
     func moreConvertInfoAction() {
-        if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() == false {
+        if KMMemberInfo.shared.isPermitConvert == false {
 #if VERSION_DMG
-            if KMMemberInfo.shared.isMemberAllFunction && IAPProductsManager.default().isAvailableAdvancedPDFToOffice() == false {
+            if KMMemberInfo.shared.isMemberAllFunction && KMMemberInfo.shared.isPermitConvert == false {
                 let limitWC = KMPurchaseLimitWindowController.currentLimitWC()
                 limitWC.continueBlock = { windowController in
                     

+ 1 - 1
PDF Office/PDF Master/Class/Common/OC/StatusBar/KMStatusBar.m

@@ -124,7 +124,7 @@
                     [arr addObject:file];
                     [baseWindowController.window makeKeyAndOrderFront:nil];
                     [baseWindowController checkNeedPasswordSwitchToOperateTypeWithOperateType:KMBatchOperationTypeConvert files:arr];
-                    [baseWindowController switchToConvertTypeWithConvertType:[IAPProductsManager defaultManager].isAvailableAdvancedPDFToOffice? KMConvertWithPDFTypeWordAdvance:KMConvertWithPDFTypeWordStandard];
+                    [baseWindowController switchToConvertTypeWithConvertType:[KMMemberInfo shared].isPermitConvert? KMConvertWithPDFTypeWordAdvance:KMConvertWithPDFTypeWordStandard];
                 });
             }
         }];

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

@@ -209,7 +209,7 @@ import Cocoa
                 var infos: [KMAdvertisementItemInfo] = []
                 for info in item?.content ?? [] {
                     if info.version == "recommondPDF-PDFtoOfficePack" {
-                        if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() == false && KMMemberInfo.shared.isMemberAllFunction {
+                        if KMMemberInfo.shared.isPermitConvert == false && KMMemberInfo.shared.isMemberAllFunction {
                             infos.append(info)
                         }
                     } else {
@@ -889,7 +889,7 @@ extension KMHomeViewController {
             var infos: [KMAdvertisementItemInfo] = []
             for info in item?.content ?? [] {
                 if info.version == "recommondPDF-PDFtoOfficePack" {
-                    if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() == false && KMMemberInfo.shared.isMemberAllFunction {
+                    if KMMemberInfo.shared.isPermitConvert == false && KMMemberInfo.shared.isMemberAllFunction {
                         infos.append(info)
                     }
                 } else {

+ 10 - 20
PDF Office/PDF Master/Class/PDFTools/Convert/NewController/KMConvertWindowController.swift

@@ -279,7 +279,7 @@ let kConvertFileSavePath = (kTempSavePath?.stringByAppendingPathComponent("conve
         wordItem.tag = convertSample.rawValue
         isShowAdvanced = true
         if KMMemberInfo.shared.isMemberAllFunction {
-            if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
+            if KMMemberInfo.shared.isPermitConvert {
                 convertSample = .AdvancedWord
                 wordItem.tag = convertSample.rawValue
                 isShowAdvanced = false
@@ -295,7 +295,7 @@ let kConvertFileSavePath = (kTempSavePath?.stringByAppendingPathComponent("conve
         wordItem.tag = convertSample.rawValue
         isShowAdvanced = true
         if KMMemberInfo.shared.isMemberAllFunction {
-            if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
+            if KMMemberInfo.shared.isPermitConvert {
                 convertSample = .AdvancedWord
                 wordItem.tag = convertSample.rawValue
                 isShowAdvanced = false
@@ -312,7 +312,7 @@ let kConvertFileSavePath = (kTempSavePath?.stringByAppendingPathComponent("conve
         wordItem.tag = convertSample.rawValue
         // 付费版
         isShowAdvanced = true
-        if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
+        if KMMemberInfo.shared.isPermitConvert {
             isShowAdvanced = false
             convertSample = .AdvancedWord
             wordItem.tag = convertSample.rawValue
@@ -418,7 +418,7 @@ let kConvertFileSavePath = (kTempSavePath?.stringByAppendingPathComponent("conve
         if !KMMemberInfo.shared.isMemberAllFunction {
             moreLabelString = String(format: "%@ %@", KMLocalizedString("The first 10 pages for free"), KMLocalizedString("Unlimited Convert"))
         } else {
-            if !IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
+            if !KMMemberInfo.shared.isPermitConvert {
                 if .Word == self.convertType ||
                     self.convertType == .AdvancedWord ||
                     .Excel == self.convertType ||
@@ -438,7 +438,7 @@ let kConvertFileSavePath = (kTempSavePath?.stringByAppendingPathComponent("conve
         
 #else
         // 付费版
-        if !(IAPProductsManager.default().isAvailableAdvancedPDFToOffice()) {
+        if !(KMMemberInfo.shared.isPermitConvert) {
             if .Word == self.convertType ||
                 self.convertType == .AdvancedWord ||
                 .Excel == self.convertType ||
@@ -596,12 +596,6 @@ let kConvertFileSavePath = (kTempSavePath?.stringByAppendingPathComponent("conve
                 print("Error removing item at path: (error.localizedDescription)")
             }
         }
-//        if self.prePDFView.document != nil {
-//            self.prePDFView.document = nil
-//        }
-//        if self.tempPDFDocument != nil {
-//            self.tempPDFDocument = nil
-//        }
         self.km_quick_endSheet()
     }
     func showCriticalAlert(_ alertMsg: String?) {
@@ -618,19 +612,15 @@ let kConvertFileSavePath = (kTempSavePath?.stringByAppendingPathComponent("conve
     }
     func produceNewPDF(with pagesArray: [CPDFPage]) {
         tempPDFDocument = nil
-//        if self.tempPDFDocument == nil || self.tempPDFDocument!.isLocked {
-            self.tempPDFDocument = CPDFDocument()
-//        }
+        self.tempPDFDocument = CPDFDocument()
         var indexs = IndexSet()
         let pageCount = self.pdfDocument?.pageCount ?? 0
         for addedPage in pagesArray {
-//            tempPDFDocument?.insertPageObject(addedPage, at: tempPDFDocument!.pageCount)
             let idx = addedPage.pageIndex()
             if idx >= 0 && idx < pageCount {
                 indexs.insert(IndexSet.Element(idx))
             }
         }
-//        self.tempPDFDocument?.removePage(at: IndexSet(integersIn: 0..<(Int(self.tempPDFDocument?.pageCount ?? 0))))
         _ = self.tempPDFDocument?.importPages(indexs, from: self.pdfDocument, at: 0)
         self.prePDFView.document = self.tempPDFDocument
         self.prePDFView.layoutDocumentView()
@@ -760,7 +750,7 @@ let kConvertFileSavePath = (kTempSavePath?.stringByAppendingPathComponent("conve
 #if VERSION_DMG
         // 桌机版
         if KMMemberInfo.shared.isMemberAllFunction {
-            if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
+            if KMMemberInfo.shared.isPermitConvert {
                 isLimitConvert = false
             } else {
                 if (.PNG == self.convertType ||
@@ -779,13 +769,13 @@ let kConvertFileSavePath = (kTempSavePath?.stringByAppendingPathComponent("conve
         }
 #else
         // 免费版
-        if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() == false {
+        if KMMemberInfo.shared.isPermitConvert == false {
             isLimitConvert = true
         }
 #endif
 #else
         // 付费版
-        if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
+        if KMMemberInfo.shared.isPermitConvert {
             isLimitConvert = false
         } else {
             if (.PNG == self.convertType ||
@@ -1010,7 +1000,7 @@ let kConvertFileSavePath = (kTempSavePath?.stringByAppendingPathComponent("conve
             FMTrackEventManager.defaultManager.trackEvent(event: "PUW", withProperties: ["PUW_Btn": "Btn_PUW_Converter_Premium_Upgrade"])
         }
 #if VERSION_DMG
-        if KMMemberInfo.shared.isMemberAllFunction && !IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
+        if KMMemberInfo.shared.isMemberAllFunction && !KMMemberInfo.shared.isPermitConvert {
             let limitWC = KMPurchaseLimitWindowController.currentLimitWC()
             limitWC.continueBlock = { windowController in
                 

+ 1 - 1
PDF Office/PDF Master/Class/PDFTools/Convert/NewController/KMConvertWindowController.xib

@@ -57,7 +57,7 @@
             <windowStyleMask key="styleMask" titled="YES" closable="YES"/>
             <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
             <rect key="contentRect" x="196" y="240" width="740" height="461"/>
-            <rect key="screenRect" x="0.0" y="0.0" width="2560" height="1415"/>
+            <rect key="screenRect" x="0.0" y="0.0" width="1800" height="1125"/>
             <value key="minSize" type="size" width="700" height="524"/>
             <value key="maxSize" type="size" width="700" height="524"/>
             <view key="contentView" wantsLayer="YES" id="se5-gp-TjO">

+ 1 - 1
PDF Office/PDF Master/Class/PDFTools/Convert/NewController/KMToolCompareWindowController.swift

@@ -34,7 +34,7 @@ var currentWindowController: KMToolCompareWindowController? = nil
                 
                 self.addWaingView(view: self.window?.contentView ?? NSView())
             } else if type == .STORE {
-                IAPProductsManager.default().make(IAPProductsManager.default().pdfToOfficeProduct)
+                IAPProductsManager.default().make(IAPProductsManager.default().pdfToOfficePackPermanent_pro)
                 self.addWaingView(view: self.window?.contentView ?? NSView())
             } else if type == .DMG {
                 self.officeVerificationBuy()

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

@@ -1009,7 +1009,7 @@ import Cocoa
                 guideWC.purchaseHandle = { [weak self] windowVC in
 #if VERSION_DMG
                     if KMMemberInfo.shared.isMemberAllFunction {
-                        if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
+                        if KMMemberInfo.shared.isPermitConvert {
                             //Convert:
                             self?.showAllConvertWindow(convertT: .Word)
                         } else {

+ 2 - 10
PDF Office/PDF Master/Class/Purchase/DMG/KMPurchaseEmbeddedWindowController.swift

@@ -1541,7 +1541,7 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
                                             alert.addButton(withTitle: NSLocalizedString("OK", comment: ""))
                                             alert.runModal()
                                         }
-                                        if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
+                                        if KMMemberInfo.shared.isPermitConvert {
                                             self.close()
                                         }
                                     }
@@ -1554,16 +1554,12 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
                                             let license = dataInfo["license"] as? [String]
                                             if license!.count > 0 {
                                                 self.verificationActivate(license: license![0])
-//                                                self.embeddedPaymentPopWC?.close()
-//                                                self.embeddedPaymentPopWC = nil
                                             }
                                         }
                                         if dataInfo.keys.contains("ai_license") {
                                             let ai_license = dataInfo["ai_license"] as? [String]
                                             if ai_license!.count > 0 {
                                                 self.verificationActivateAIInfo(license: ai_license![0])
-//                                                self.embeddedPaymentPopWC?.close()
-//                                                self.embeddedPaymentPopWC = nil
                                             }
                                         }
                                     } else {
@@ -1572,8 +1568,6 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
                                             let license = dataInfo["license"] as? [String]
                                             if license!.count > 0 {
                                                 self.verificationActivate(license: license![0])
-//                                                self.embeddedPaymentPopWC?.close()
-//                                                self.embeddedPaymentPopWC = nil
                                             }
                                         } else if dataInfo.keys.contains("ai_license") {
                                             let ai_license = dataInfo["ai_license"] as? [String]
@@ -1581,8 +1575,6 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
                                                 if !KMMemberInfo.shared.isPermitAI {
                                                     self.verificationActivateAIInfo(license: ai_license![0])
                                                 }
-//                                                self.embeddedPaymentPopWC?.close()
-//                                                self.embeddedPaymentPopWC = nil
                                             }
                                         }
                                     }
@@ -1596,7 +1588,7 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
                                             alert.addButton(withTitle: NSLocalizedString("OK", comment: ""))
                                             alert.runModal()
                                         }
-                                        if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
+                                        if KMMemberInfo.shared.isPermitConvert {
                                             self.close()
                                         }
                                     }

+ 1 - 1
PDF Office/PDF Master/Class/Purchase/DMG/KMPurchaseLimitWindowController.swift

@@ -178,7 +178,7 @@ class KMPurchaseLimitWindowController: NSWindowController {
             }
             self.removeWaitingView(self.contendView)
             
-            if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
+            if KMMemberInfo.shared.isPermitConvert {
                 self.close()
             }
         }

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

@@ -210,9 +210,9 @@ 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_type8 ||
         [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type9 ||
-//        [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type13 ||
+        [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type13 ||
         [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type11 ||
         [KMMemberInfo shared].userScenarioType == KMUserScenarioTypePro_type1 ||
         [KMMemberInfo shared].userScenarioType == KMUserScenarioTypePro_type3 ||
@@ -256,14 +256,20 @@ NSPopoverDelegate>
                     }];
                 }
             }
-        } else if ([KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type7
-//                   [KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type8 ||
-                   /*[KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type13*/) {
+        } 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)];
         }
         [self.button setTitleColor:[NSColor whiteColor]];
         self.bgImg.hidden = NO;
         self.button.hidden = NO;
+        if ([KMMemberInfo shared].userScenarioType == KMUserScenarioTypeLite_type1) {
+            if ([IAPProductsManager defaultManager].fourDevicesAllAccessPackNew12months_lite.isTrialPeriod) {
+                self.bgImg.hidden = YES;
+                self.button.hidden = YES;
+            }
+        }
         
         KMUserScenarioType type = [KMMemberInfo shared].userScenarioType;
         // 单平台高级版永久 未登录时 也不显示升级(因为点了也得先登录),但是登录后的卡片里是有升级按钮的,可以升级成全平台高级版年订阅

+ 1 - 0
PDF Office/PDF Master/Class/Purchase/IAPProductsManager.h

@@ -60,6 +60,7 @@ extern NSString * const KMIAPSubscriptionLoadedNotification;
 @property (nonatomic, readonly) IAPProduct *allAccessPackPermanent_lite;
 @property (nonatomic, readonly) IAPProduct *advancedAddDevicesAllAccessPack12months_lite;
 @property (nonatomic, readonly) IAPProduct *advancedAdd2DevicesAllAccessPack12months_lite;
+@property (nonatomic, readonly) IAPProduct *allAccessProduct;
 
 @property (nonatomic, readonly) IAPProduct *aiAllAccessPack1month_pro;
 @property (nonatomic, readonly) IAPProduct *aiAllAccessPack12month_pro;

+ 43 - 5
PDF Office/PDF Master/Class/Purchase/IAPProductsManager.m

@@ -49,7 +49,7 @@ NSString * const KMAdvancedAddDevicesAllAccessPack12Months_Pro = @"com.pdfreader
 NSString * const KMAdvancedAdd2DevicesAllAccessPack12Months_Pro = @"com.pdfreaderpro.mac.advanced_add_2_devices_all_access_pack_advanced_annual.001"; // 产品名称:advanced_add_2_devices_all_access_pack_12months(多设备包订阅)
 
 //NSString * const KMNewMonthLicenseProductIdentifier = @"com.pdftechnologies.pdfreader.mac.yearly.002.Test";
-//NSString * const KMAllLicenseProductIdentifier = @"com.pdfreaderpro.mac_free.member.all_access_pack_permanent_license.001";
+NSString * const KMAllLicenseProductIdentifier = @"com.pdfreaderpro.mac_free.member.all_access_pack_permanent_license.001";
 NSString * const KMPDFToOfficeLicenseProductIdentifier = @"com.pdfreaderpro.mac.member.pdf_to_office_pack_permanent_license.001";
 NSString * const KMAILicenseProductIdentifier = @"com.pdfreaderpro.mac_free.ai_1_month_subscription";
 NSString * const KMProAILicenseProductIdentifier = @"com.pdfreaderpro.mac.ai_1_month_subscription";
@@ -297,6 +297,7 @@ NSString * const KMIAPSubscriptionLoadedNotification = @"KMIAPSubscriptionLoaded
 @property (nonatomic,retain) IAPProduct *allAccessPackPermanent_lite;               // all_access_pack_permanent(永久)
 @property (nonatomic,retain) IAPProduct *advancedAddDevicesAllAccessPack12months_lite;  // advanced_add_devices_all_access_pack_12months(订阅)
 @property (nonatomic,retain) IAPProduct *advancedAdd2DevicesAllAccessPack12months_lite;  // advanced_add_2_devices_all_access_pack_12months(订阅)
+@property (nonatomic,retain) IAPProduct *allAccessProduct; // 旧买断
 @property (nonatomic,retain) IAPProduct *aiAllAccessPack1month_pro;                 // ai_all_access_pack_1month(订阅)
 @property (nonatomic,retain) IAPProduct *aiAllAccessPack12month_pro;                // ai_all_access_pack_12month(订阅)
 @property (nonatomic,retain) IAPProduct *pdfToOfficePackPermanent_pro;              // pdf_to_office_pack_permanent(永久转档)
@@ -350,6 +351,12 @@ NSString * const KMIAPSubscriptionLoadedNotification = @"KMIAPSubscriptionLoaded
         
 #if VERSION_FREE
         // 免费版
+        self.allAccessProduct = [[[IAPProduct alloc] init] autorelease];
+        self.allAccessProduct.productIdentifier = KMAllLicenseProductIdentifier;
+        self.allAccessProduct.priceNumber = @(79.99);
+        self.allAccessProduct.offersPriceNumber = @(59.99);
+        self.allAccessProduct.isOffers = isOffers;
+        
         self.fourDevicesAllAccessPackNew6Months_lite = [[[IAPProduct alloc] init] autorelease];
         self.fourDevicesAllAccessPackNew6Months_lite.productIdentifier = KM4DevicesAllAccessPackNew6Months_Free;
         self.fourDevicesAllAccessPackNew6Months_lite.priceNumber = @(49.99);
@@ -426,6 +433,9 @@ NSString * const KMIAPSubscriptionLoadedNotification = @"KMIAPSubscriptionLoaded
         if ([[NSUserDefaults standardUserDefaults] objectForKey:@"allAccessPackPermanent_lite.isSubscribed"]) {
             self.allAccessPackPermanent_lite.isSubscribed = [[[NSUserDefaults standardUserDefaults] objectForKey:@"allAccessPackPermanent_lite.isSubscribed"] boolValue];
         }
+        if ([[NSUserDefaults standardUserDefaults] objectForKey:@"allAccessProduct.isSubscribed"]) {
+            self.allAccessProduct.isSubscribed = [[[NSUserDefaults standardUserDefaults] objectForKey:@"allAccessProduct.isSubscribed"] boolValue];
+        }
         
         self.productIdentifiers = @[KMMonthLicenseProductIdentifier_Free,
                                     KMNewMonthLicenseProductIdentifier_Free,
@@ -437,7 +447,8 @@ NSString * const KMIAPSubscriptionLoadedNotification = @"KMIAPSubscriptionLoaded
                                     KMAIAllAccessPack12Month_Free,
                                     KMAdvancedAddDevicesAllAccessPack12Months_Free,
                                     KMAdvancedAdd2DevicesAllAccessPack12Months_Free,
-                                    KMAILicenseProductIdentifier];
+                                    KMAILicenseProductIdentifier,
+                                    KMAllLicenseProductIdentifier];
 #else
         // 付费版
         self.PDFToOfficeProduct = [[[IAPProduct alloc] init] autorelease];
@@ -539,6 +550,7 @@ NSString * const KMIAPSubscriptionLoadedNotification = @"KMIAPSubscriptionLoaded
     [_standardAddDevicesAllAccessPack12months_pro release];
     [_advancedAddDevicesAllAccessPack12months_pro release];
     [_advancedAdd2DevicesAllAccessPack12months_pro release];
+    [_allAccessProduct release];
 
     [_allAccessPack6months_lite release];
     [_allAccessPackNew6months_lite release];
@@ -701,7 +713,8 @@ NSString * const KMIAPSubscriptionLoadedNotification = @"KMIAPSubscriptionLoaded
         self.fourDevicesAllAccessPackNew6Months_lite.isSubscribed ||
         self.fourDevicesAllAccessPackNew12months_lite.isSubscribed ||
         self.advancedAddDevicesAllAccessPack12months_lite.isSubscribed ||
-        self.advancedAdd2DevicesAllAccessPack12months_lite.isSubscribed) {
+        self.advancedAdd2DevicesAllAccessPack12months_lite.isSubscribed ||
+        self.allAccessProduct.isSubscribed) {
         return YES;
     }
     return NO;
@@ -747,7 +760,8 @@ NSString * const KMIAPSubscriptionLoadedNotification = @"KMIAPSubscriptionLoaded
         self.fourDevicesAllAccessPackNew6Months_lite.isSubscribed ||
         self.fourDevicesAllAccessPackNew12months_lite.isSubscribed ||
         self.advancedAddDevicesAllAccessPack12months_lite.isSubscribed ||
-        self.advancedAdd2DevicesAllAccessPack12months_lite.isSubscribed) {
+        self.advancedAdd2DevicesAllAccessPack12months_lite.isSubscribed ||
+        self.allAccessProduct.isSubscribed) {
         return YES;
     }
     return NO;
@@ -787,6 +801,9 @@ NSString * const KMIAPSubscriptionLoadedNotification = @"KMIAPSubscriptionLoaded
     if (result == false) {
         result = IAPProductsManager.defaultManager.advancedAdd2DevicesAllAccessPack12months_lite.isCancelAutoRenew;
     }
+    if (result == false) {
+        result = IAPProductsManager.defaultManager.allAccessProduct.isCancelAutoRenew;
+    }
     return result;
 }
 
@@ -1018,6 +1035,11 @@ NSString * const KMIAPSubscriptionLoadedNotification = @"KMIAPSubscriptionLoaded
                     self.fourDevicesAllAccessPack12months_pro.isTrialPeriod = YES;
                 }
                 self.fourDevicesAllAccessPack12months_pro.originalPurchased = YES;
+            } else if ([product_id isEqualToString:self.allAccessProduct.productIdentifier]) {
+                if (!self.allAccessProduct.isSubscribed) {
+                    self.allAccessProduct.isSubscribed = quantity > 0 ? YES : NO;
+                }
+                self.allAccessProduct.originalPurchased = YES;
             }
         }
     }
@@ -1174,6 +1196,11 @@ NSString * const KMIAPSubscriptionLoadedNotification = @"KMIAPSubscriptionLoaded
                     self.fourDevicesAllAccessPack12months_pro.isTrialPeriod = YES;
                 }
                 self.fourDevicesAllAccessPack12months_pro.originalPurchased = YES;
+            } else if ([product_id isEqualToString:self.allAccessProduct.productIdentifier]) {
+                if (!self.allAccessProduct.isSubscribed) {
+                    self.allAccessProduct.isSubscribed = quantity > 0 ? YES : NO;
+                }
+                self.allAccessProduct.originalPurchased = YES;
             }
         }
     }
@@ -1215,6 +1242,8 @@ NSString * const KMIAPSubscriptionLoadedNotification = @"KMIAPSubscriptionLoaded
                 self.aiAllAccessPack1month_pro.autoRenewStatus = status;
             } else if([product_id isEqualToString:self.fourDevicesAllAccessPack12months_pro.productIdentifier]) {
                 self.fourDevicesAllAccessPack12months_pro.autoRenewStatus = status;
+            } else if ([product_id isEqualToString:self.allAccessProduct.productIdentifier]) {
+                self.allAccessProduct.autoRenewStatus = status;
             }
         }
     }
@@ -1223,6 +1252,7 @@ NSString * const KMIAPSubscriptionLoadedNotification = @"KMIAPSubscriptionLoaded
     [[NSUserDefaults standardUserDefaults] setObject:self.PDFToOfficeProduct.isSubscribed ? @"YES":@"NO" forKey:@"PDFToOfficeProduct.isSubscribed"];
     [[NSUserDefaults standardUserDefaults] setObject:self.pdfToOfficePackPermanent_pro.isSubscribed ? @"YES":@"NO" forKey:@"pdfToOfficePackPermanent_pro.isSubscribed"];
     [[NSUserDefaults standardUserDefaults] synchronize];
+    [[NSUserDefaults standardUserDefaults] setObject:self.allAccessProduct.isSubscribed ? @"YES":@"NO" forKey:@"allAccessProduct.isSubscribed"];
     
     return YES;
 }
@@ -1440,6 +1470,10 @@ NSString * const KMIAPSubscriptionLoadedNotification = @"KMIAPSubscriptionLoaded
                                                                 object:nil];
         }];
         self.fourDevicesAllAccessPack12months_pro.isSubscribed = YES;
+    } else if ([productIdentifier isEqualToString:self.allAccessProduct.productIdentifier]) {
+        self.allAccessProduct.isSubscribed = YES;
+        [[NSUserDefaults standardUserDefaults] setObject:self.allAccessProduct.isSubscribed ? @"YES":@"NO" forKey:@"allAccessProduct.isSubscribed"];
+        [[NSUserDefaults standardUserDefaults] synchronize];
     }
     if (!self.isPurchasing) {
         return;
@@ -1522,7 +1556,9 @@ NSString * const KMIAPSubscriptionLoadedNotification = @"KMIAPSubscriptionLoaded
         if (self.allAccessPack6months_lite.isSubscribed ||
             self.allAccessPackNew6months_lite.isSubscribed || self.allAccessPack12months_lite.isSubscribed) {
             informative = NSLocalizedString(@"Restore successfully", nil);
-        } else if (self.allAccessPackPermanent_lite.isSubscribed || self.fourDevicesAllAccessPackNew6Months_lite.isSubscribed || self.fourDevicesAllAccessPackNew12months_lite.isSubscribed || self.advancedAddDevicesAllAccessPack12months_lite.isSubscribed || self.advancedAdd2DevicesAllAccessPack12months_lite.isSubscribed) {
+        } else if (self.allAccessPackPermanent_lite.isSubscribed ||
+                   self.fourDevicesAllAccessPackNew6Months_lite.isSubscribed || self.fourDevicesAllAccessPackNew12months_lite.isSubscribed || self.advancedAddDevicesAllAccessPack12months_lite.isSubscribed || self.advancedAdd2DevicesAllAccessPack12months_lite.isSubscribed ||
+                   self.allAccessProduct.isSubscribed) {
             informative = NSLocalizedString(@"Restore successfully. You can start using the advanced tools, including PDF to Office, PDF Watermark, Page Editor, and more.", nil);
         } else if (self.aiAllAccessPack12month_lite.isSubscribed || self.aiAllAccessPack1month_lite.isSubscribed) {
             informative = NSLocalizedString(@"Restore successfully", nil);
@@ -1691,6 +1727,8 @@ NSString * const KMIAPSubscriptionLoadedNotification = @"KMIAPSubscriptionLoaded
             self.aiAllAccessPack1month_pro.product = product;
         } else if ([product.productIdentifier isEqualToString:self.fourDevicesAllAccessPack12months_pro.productIdentifier]) {
             self.fourDevicesAllAccessPack12months_pro.product = product;
+        } else if ([product.productIdentifier isEqualToString:self.allAccessProduct.productIdentifier]) {
+            self.allAccessProduct.product = product;
         }
     }
     dispatch_async(dispatch_get_main_queue(), ^{

+ 4 - 4
PDF Office/PDF Master/Class/Purchase/KMConvertComparePayViewController.m

@@ -127,10 +127,10 @@
     
 
     NSString * price = @"";
-    if ([IAPProductsManager defaultManager].PDFToOfficeProduct.isOffers) {
-        price = [IAPProductsManager defaultManager].PDFToOfficeProduct.offersPrice;
+    if ([IAPProductsManager defaultManager].pdfToOfficePackPermanent_pro.isOffers) {
+        price = [IAPProductsManager defaultManager].pdfToOfficePackPermanent_pro.offersPrice;
     } else {
-        price = [IAPProductsManager defaultManager].PDFToOfficeProduct.price;
+        price = [IAPProductsManager defaultManager].pdfToOfficePackPermanent_pro.price;
     }
     
     self.priceLabel.stringValue = price ? : @"";
@@ -171,7 +171,7 @@
 
 - (void)reloadData {
 #ifndef VERSION_DMG
-    if ([IAPProductsManager defaultManager].isAvailableAdvancedPDFToOffice) {
+    if ([KMMemberInfo shared].isPermitConvert) {
         [self.purchaseButton setEnabled:NO];
         self.purchaseButton.layer.backgroundColor = [[NSColor whiteColor] colorWithAlphaComponent:0.4].CGColor;
     } else {

+ 128 - 47
PDF Office/PDF Master/MemberCenter/Model/KMMemberInfo.swift

@@ -12,12 +12,12 @@ import Cocoa
     case lite_type1 = 0 // 免费版 无旧买断 免费未试用 (右上角导航栏按钮 - “登录领福利” + “试用”)
     case lite_type2     // 免费版 无旧买断 免费试用中 (右上角导航栏按钮 - “登录领福利”)
     case lite_type3     // 免费版 无旧买断 试用过期或取消 (右上角导航栏按钮 - “登录领福利” + 开通会员)
-    case lite_type4     // 免费版 无旧买断 可升级订阅 (右上角导航栏按钮 - “登录领福利” + 升级)
+    case lite_type4     // 免费版 无旧买断 可升级订阅 (右上角导航栏按钮 - “登录领福利”)
     case lite_type5     // 免费版 无旧买断 多平台永久 (右上角导航栏按钮 - “登录领福利” + 升级全平台)
     case lite_type6     // 免费版 无旧买断 全平台高级年订阅 (右上角导航栏按钮 - “登录领福利”)
     case lite_type7     // 免费版 无旧买断 会员到期 (右上角导航栏按钮 - “登录领福利” + 续费)
     case lite_type8     // 免费版 无旧买断 订阅中取消 (右上角导航栏按钮 - “登录领福利” + 续费)
-    case lite_type9     // 免费版 有旧买断 免费未试用 (右上角导航栏按钮 - “登录领福利” + “升级至Pro” + 立即试用)
+    case lite_type9     // 免费版 有旧买断 免费未试用 (右上角导航栏按钮 - “登录领福利” + “升级至Pro”)
     case lite_type10    // 免费版 有旧买断 免费试用中 (右上角导航栏按钮 - “登录领福利”)
     case lite_type11    // 免费版 有旧买断 试用过期或取消 (右上角导航栏按钮 - “登录领福利” + 开通会员)
     case lite_type12    // 免费版 有旧买断 全平台高级版年订阅 (右上角导航栏按钮 - “登录领福利”)
@@ -248,7 +248,9 @@ import Cocoa
             }
 #else
     // AppStore 免费版本
-            if IAPProductsManager.default().allAccessPackPermanent_lite.isSubscribed == true || IAPProductsManager.default().isAvailableAllFunction() == true {
+            if IAPProductsManager.default().allAccessPack6months_lite.isSubscribed == true || IAPProductsManager.default().allAccessPackNew6months_lite.isSubscribed == true ||
+                IAPProductsManager.default().allAccessPack12months_lite.isSubscribed == true ||
+                IAPProductsManager.default().allAccessProduct.isSubscribed == true {
                 // 有旧买断
                 if KMMemberInfo.shared.canTrail {
                     return .lite_type9
@@ -264,6 +266,7 @@ import Cocoa
                 if KMMemberInfo.shared.vip_paymentModel == "1" && KMMemberInfo.shared.vip_payType == 0 {
                     return .lite_type13
                 }
+                return .lite_type9
             } else {
                 // 无旧买断
                 if KMMemberInfo.shared.canTrail && KMMemberInfo.shared.vip_levels == "1" {
@@ -319,11 +322,13 @@ import Cocoa
 #if VERSION_FREE
 #if VERSION_DMG
     // DMG
-
+            if KMMemberInfo.shared.isLogin {
+                
+            }
 #else
     // AppStore 免费版本
             if KMMemberInfo.shared.isLogin {
-                if IAPProductsManager.default().allAccessPackPermanent_lite.isSubscribed == true || IAPProductsManager.default().isAvailableAllFunction() == true {
+                if IAPProductsManager.default().isAvailableAllFunction() == true {
                     return true
                 } else {
                     if userScenarioType == .lite_type2 || userScenarioType == .lite_type4 || userScenarioType == .lite_type5 || userScenarioType == .lite_type6 {
@@ -348,21 +353,57 @@ import Cocoa
     
     // 是否允许使用转档
     var isPermitConvert: Bool {
-        if KMMemberInfo.shared.isLogin {
-            if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
-                return true
-            } else {
-                if userScenarioType == .lite_type4 || userScenarioType == .lite_type5 || userScenarioType == .lite_type6 || userScenarioType == .lite_type12 {
+        get {
+#if VERSION_FREE
+#if VERSION_DMG
+    // DMG
+            if KMMemberInfo.shared.isLogin {
+                
+            }
+#else
+    // AppStore 免费版本
+            if KMMemberInfo.shared.isLogin {
+                if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
                     return true
                 } else {
-                    return false
+                    if userScenarioType == .lite_type4 || 
+                        userScenarioType == .lite_type5 ||
+                        userScenarioType == .lite_type6 ||
+                        userScenarioType == .lite_type12 {
+                        return true
+                    } else {
+                        return false
+                    }
                 }
+            } else {
+                if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
+                    return true
+                }
+                return false
             }
-        } else {
-            if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
-                return true
+#endif
+#else
+    // AppStore 付费版
+            if KMMemberInfo.shared.isLogin {
+                if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
+                    return true
+                } else {
+                    if userScenarioType == .pro_type1 ||
+                        userScenarioType == .pro_type2 ||
+                        userScenarioType == .pro_type4 ||
+                        userScenarioType == .pro_type5 {
+                        return true
+                    } else {
+                        return false
+                    }
+                }
+            } else {
+                if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
+                    return true
+                }
+                return false
             }
-            return false
+#endif
         }
     }
     
@@ -425,26 +466,46 @@ import Cocoa
             .components(separatedBy: ",")
             .map { $0.trimmingCharacters(in: .whitespaces) }
         if KMMemberInfo.shared.isLogin {
-            if userScenarioType == .lite_type1 {
+            if userScenarioType == .lite_type1 ||
+                userScenarioType == .lite_type3 ||
+                userScenarioType == .lite_type11 ||
+                userScenarioType == .lite_type4 ||
+                userScenarioType == .lite_type5 ||
+                userScenarioType == .lite_type9 ||
+                userScenarioType == .lite_type13 ||
+                userScenarioType == .lite_type7 || 
+                userScenarioType == .lite_type8 {
                 KMProductCompareWC.shared.orientation = true
-                KMProductCompareWC.shared.orientationType = .trial
+                if userScenarioType == .lite_type1 {
+                    KMProductCompareWC.shared.orientationType = .trial
+                } else if userScenarioType == .lite_type3 || userScenarioType == .lite_type11 {
+                    KMProductCompareWC.shared.orientationType = .lite_Base
+                } else if userScenarioType == .lite_type4 || userScenarioType == .lite_type5 || userScenarioType == .lite_type9 || userScenarioType == .lite_type13 {
+                    KMProductCompareWC.shared.orientationType = .lite_MacWindows
+                } else if userScenarioType == .lite_type7 || userScenarioType == .lite_type8 {
+                    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_type2 || userScenarioType == .lite_type6 || userScenarioType == .lite_type10 || userScenarioType == .lite_type12 {
+            } else if userScenarioType == .lite_type2 || 
+                        userScenarioType == .lite_type6 ||
+                        userScenarioType == .lite_type10 ||
+                        userScenarioType == .lite_type12 ||
+                        userScenarioType == .pro_type2 ||
+                        userScenarioType == .pro_type5 {
                 
-            } 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 {
+            } else if userScenarioType == .pro_type1 ||
+                        userScenarioType == .pro_type3 ||
+                        userScenarioType == .pro_type4 {
                 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
+                if userScenarioType == .pro_type1 ||
+                    userScenarioType == .pro_type4 {
+                    KMProductCompareWC.shared.orientationType = .pro_Advanced
+                } else if userScenarioType == .pro_type3 {
+                    KMProductCompareWC.shared.orientationType = .pro_Base
                 }
                 KMProductCompareWC.shared.showWindow(nil)
             }
@@ -452,26 +513,46 @@ import Cocoa
             KMLoginWindowsController.shared.openWindow() { [weak self] success in
                 guard let self = self else { return }
                 if success {
-                    if self.userScenarioType == .lite_type1 {
+                    if self.userScenarioType == .lite_type1 ||
+                        self.userScenarioType == .lite_type3 ||
+                        self.userScenarioType == .lite_type11 ||
+                        self.userScenarioType == .lite_type4 ||
+                        self.userScenarioType == .lite_type5 ||
+                        self.userScenarioType == .lite_type9 ||
+                        self.userScenarioType == .lite_type13 ||
+                        self.userScenarioType == .lite_type7 ||
+                        self.userScenarioType == .lite_type8 {
                         KMProductCompareWC.shared.orientation = true
-                        KMProductCompareWC.shared.orientationType = .trial
+                        if self.userScenarioType == .lite_type1 {
+                            KMProductCompareWC.shared.orientationType = .trial
+                        } else if self.userScenarioType == .lite_type3 || self.userScenarioType == .lite_type11 {
+                            KMProductCompareWC.shared.orientationType = .lite_Base
+                        } else if self.userScenarioType == .lite_type4 || self.userScenarioType == .lite_type5 || self.userScenarioType == .lite_type9 || self.userScenarioType == .lite_type13 {
+                            KMProductCompareWC.shared.orientationType = .lite_MacWindows
+                        } else if self.userScenarioType == .lite_type7 || self.userScenarioType == .lite_type8 {
+                            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 self.userScenarioType == .lite_type2 || self.userScenarioType == .lite_type6 || self.userScenarioType == .lite_type10 || self.userScenarioType == .lite_type12 {
+                    } else if self.userScenarioType == .lite_type2 || 
+                                self.userScenarioType == .lite_type6 ||
+                                self.userScenarioType == .lite_type10 ||
+                                self.userScenarioType == .lite_type12 ||
+                                userScenarioType == .pro_type2 ||
+                                userScenarioType == .pro_type5{
                         
-                    } else if self.userScenarioType == .lite_type3 || self.userScenarioType == .lite_type11 {
+                    } else if userScenarioType == .pro_type1 ||
+                                userScenarioType == .pro_type3 ||
+                                userScenarioType == .pro_type4 {
                         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
+                        if userScenarioType == .pro_type1 ||
+                            userScenarioType == .pro_type4 {
+                            KMProductCompareWC.shared.orientationType = .pro_Advanced
+                        } else if userScenarioType == .pro_type3 {
+                            KMProductCompareWC.shared.orientationType = .pro_Base
                         }
                         KMProductCompareWC.shared.showWindow(nil)
                     }

+ 7 - 1
PDF Office/PDF Master/MemberCenter/ViewController/KMUserInfoViewController.swift

@@ -537,6 +537,10 @@ class KMUserInfoViewController: NSViewController {
                 buyNow2ImageView.isHidden = false
                 arrow1ImageView.image = NSImage(named: "BuyNewArrowImage1")
                 arrow2ImageView.image = NSImage(named: "BuyNewArrowImage1")
+                if IAPProductsManager.default().fourDevicesAllAccessPackNew12months_lite.isTrialPeriod == true {
+                    buyNow2Box.isHidden = true
+                    buyNow1BoxLeftConst.constant = (CGRectGetWidth(view.bounds) - CGRectGetWidth(buyNow1Box.frame))/2
+                }
             } else if KMMemberInfo.shared.userScenarioType == .lite_type3 ||
                         KMMemberInfo.shared.userScenarioType == .lite_type11 ||
                         KMMemberInfo.shared.userScenarioType == .lite_type9 {
@@ -566,7 +570,9 @@ class KMUserInfoViewController: NSViewController {
                 buyNow3ImageView.isHidden = true
                 arrow3ImageView.image = NSImage(named: "BuyNewArrowImage2")
             }
-        } else if KMMemberInfo.shared.userScenarioType == .lite_type7 {
+        } else if KMMemberInfo.shared.userScenarioType == .lite_type7 ||
+                    KMMemberInfo.shared.userScenarioType == .lite_type8 ||
+                    KMMemberInfo.shared.userScenarioType == .lite_type13 {
             membershipLabel.textColor = NSColor(hex: "0E1114")
             lockedLabel.textColor = NSColor(hex: "42464D")
             

+ 2 - 2
PDF Office/PDF Master/MemberCenter/ViewController/KMUserInfoViewController.xib

@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="23504" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22505" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
         <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="23504"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22505"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>

+ 31 - 22
PDF Office/PDF Master/MemberCenter/ViewModel/KMProductModel.swift

@@ -287,33 +287,42 @@ class KMProductModel: ObservableObject {
      @param
      */
     func getCurrentComparisonTableType() -> Void {
-        if KMMemberInfo.shared.canTrail {
-            state = .trial
-        } else {
-#if VERSION_FREE
-#if VERSION_DMG
-    // DMG
-            if KMMemberInfo.shared.vip_levels == "1" {
-                state = .dmg_Base
-            } else if KMMemberInfo.shared.vip_levels == "2" {
-                state = .dmg_MacWindows
-            }
-#else
-    // AppStore 免费版本
-            if KMMemberInfo.shared.vip_levels == "1" {
+        let userScenarioType = KMMemberInfo.shared.userScenarioType
+        let platforms = KMMemberInfo.shared.vip_platforms
+        let platformsArray = platforms
+            .components(separatedBy: ",")
+            .map { $0.trimmingCharacters(in: .whitespaces) }
+        if userScenarioType == .lite_type1 ||
+            userScenarioType == .lite_type3 ||
+            userScenarioType == .lite_type11 ||
+            userScenarioType == .lite_type4 ||
+            userScenarioType == .lite_type5 ||
+            userScenarioType == .lite_type9 ||
+            userScenarioType == .lite_type13 ||
+            userScenarioType == .lite_type7 ||
+            userScenarioType == .lite_type8 {
+            if userScenarioType == .lite_type1 {
+                state = .trial
+            } else if userScenarioType == .lite_type3 || userScenarioType == .lite_type11 {
                 state = .lite_Base
-            } else if KMMemberInfo.shared.vip_levels == "2" {
+            } else if userScenarioType == .lite_type4 || userScenarioType == .lite_type5 || userScenarioType == .lite_type9 || userScenarioType == .lite_type13 {
                 state = .lite_MacWindows
+            } else if userScenarioType == .lite_type7 || userScenarioType == .lite_type8 {
+                if KMMemberInfo.shared.vip_paymentModel == "1" && KMMemberInfo.shared.vip_cycle == 4 && platformsArray.count == 4 {
+                    state = .lite_MacWindows
+                } else {
+                    state = .lite_Base
+                }
             }
-#endif
-#else
-    // AppStore 付费版
-            if KMMemberInfo.shared.vip_levels == "1" {
-                state = .pro_Base
-            } else if KMMemberInfo.shared.vip_levels == "2" {
+        } else if userScenarioType == .pro_type1 ||
+                    userScenarioType == .pro_type3 ||
+                    userScenarioType == .pro_type4 {
+            if userScenarioType == .pro_type1 ||
+                userScenarioType == .pro_type4 {
                 state = .pro_Advanced
+            } else if userScenarioType == .pro_type3 {
+                state = .pro_Base
             }
-#endif
         }
     }
     

+ 4 - 2
PDF Office/PDF Master/MemberCenter/WindowsController/KMProductCompareWC.swift

@@ -375,7 +375,7 @@ class KMProductCompareWC: NSWindowController {
             }
         } else {
             // model.state == .trial
-            advancedPlanPurchaseLabel.stringValue = model.getProductPrice(.advancedAddDevicesAllAccessPack12months_pro)
+            advancedPlanPurchaseLabel.stringValue = model.getProductPrice(.fourDevicesAllAccessPackNew12months_lite)
         }
 #endif
 #else
@@ -392,7 +392,7 @@ class KMProductCompareWC: NSWindowController {
                 advancedPlanPurchaseLabel.stringValue = model.getProductPrice(.advancedAddDevicesAllAccessPack12months_pro)
             }
         } else {
-            advancedPlanPurchaseLabel.stringValue = model.getProductPrice(.fourDevicesAllAccessPackNew12months_lite)
+            advancedPlanPurchaseLabel.stringValue = model.getProductPrice(.fourDevicesAllAccessPack12months_pro)
         }
 #endif
     }
@@ -641,11 +641,13 @@ class KMProductCompareWC: NSWindowController {
     // AppStore 免费版本
         reloadData()
         if model.isPurchaseSwitch {
+            discountYearly.isHidden = false
             sixMouthProLabel.textColor = NSColor(red: 117/255.0, green: 119/255.0, blue: 128/255.0, alpha: 1.0)
             oneYearProLabel.textColor = NSColor.white
             switchCircleLeftConst.constant = 22
             value1InfoLabel.stringValue = NSLocalizedString("1-year Plan", comment: "")
         } else {
+            discountYearly.isHidden = true
             sixMouthProLabel.textColor = NSColor.white
             oneYearProLabel.textColor = NSColor(red: 117/255.0, green: 119/255.0, blue: 128/255.0, alpha: 1.0)
             switchCircleLeftConst.constant = 4