Prechádzať zdrojové kódy

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

tangchao 1 týždeň pred
rodič
commit
3d745a302e

+ 163 - 63
PDF Office/PDF Master/Class/Purchase/DMG/KMPurchaseEmbeddedWindowController.swift

@@ -16,6 +16,21 @@ import Cocoa
     case alipay
 }
 
+@objc enum KMDMGProductType: UInt32 {
+    
+    case advanced_annual_subscription_trail = 0                    // 全平台高级版年订阅             99.9 美金,带免费试用
+    case advanced_annual_subscription                              // 全平台高级版年订阅             99.9 美金
+    case advanced_annual_subscription_blackFive                    // 全平台高级版年订阅             99.9 美金,黑五订单,优惠价格不为空
+    
+    case standard_annual_subscription                              // 全平台标准版年订阅             79.9 美金
+    
+    case advanced_permanent                                        // Mac & Win 双平台高级永久      119.99 美金
+    case advanced_permanent_blackFive                              // Mac & Win 双平台高级永久      119.99 美金,黑五订单,优惠价格不为空
+    
+    case ai_subscription_year_trail                                // AI 年订阅                    125.99 美金,带免费试用
+    case ai_subscription_month                                     // AI 月订阅                    14.99 美金
+}
+
 class KMPurchaseEmbeddedWindowController: NSWindowController {
     
     @IBOutlet weak var mainBox: NSBox!
@@ -31,6 +46,9 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
     @IBOutlet weak var originalPriceLabel1: NSTextField! // 原价
     @IBOutlet weak var discountPriceLabel1: NSTextField! // 折扣
     
+    @IBOutlet weak var usualAddonView: NSView!
+    @IBOutlet weak var usualAddCountView: NSView!
+    
     @IBOutlet weak var aiAddOnView: NSView!
     @IBOutlet weak var aiAddOnButton: NSButton!
     @IBOutlet weak var aiAddOnLabel: NSTextField!
@@ -131,6 +149,9 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
     @IBOutlet weak var successfullyLabel: NSTextField!
     @IBOutlet weak var imageBottomLayout: NSLayoutConstraint!
     @IBOutlet weak var image2BottomLayout: NSLayoutConstraint!
+    
+    private var _dmgProductType: KMDMGProductType = .advanced_annual_subscription_trail
+    private var _product_Info: KMListingProductsModel = KMListingProductsModel(id: "23", productName: "PDF Reader Pro Advanced - Annual Plan", price: NSNumber(value: 99.99), maxDeviceNum: 4, levels: "3", platforms: "Windows,Android,Mac,iOS", productLineId: 1, paymentModel: 1, cycle: 4, code: "advanced-annual-subscription-trail", cnyPrice: 0)
 
     private var pdfCount: Int = 1
     private var _paymentMethod: KMPaymentType = .paypal
@@ -218,6 +239,18 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
     private var licenseAI1 = ""
     private var isApplyCoupon: Bool = false
 
+    @objc static func currentWC(_ productInfo: KMListingProductsModel) -> KMPurchaseEmbeddedWindowController {
+        if currentWindowController != nil {
+            currentWindowController.product_Info = productInfo
+            return currentWindowController
+        } else {
+            let configWC: KMPurchaseEmbeddedWindowController = KMPurchaseEmbeddedWindowController.init(windowNibName: "KMPurchaseEmbeddedWindowController")
+            currentWindowController = configWC;
+            currentWindowController.product_Info = productInfo
+            return currentWindowController
+        }
+     }
+    
     @objc static func currentFirstTrialWC(_ productId: String) -> KMPurchaseEmbeddedWindowController {
         if currentWindowController != nil {
             currentWindowController.productID = productId
@@ -254,6 +287,15 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
         self.clearEventData()
     }
     
+    // MARK: DMG Action
+    func isMoreCountViewShouldHidden(_ productinfo: KMListingProductsModel) -> Bool {
+        //买断版本才能一次购买多个,并且购买多个时,不会自动绑定,需要在后台给自己绑定才能有会员权益
+        if productinfo.paymentModel == 2 {
+            return false
+        }
+        return true
+    }
+    
     // MARK: UI
     
     private func xibInitialization() -> Void {
@@ -272,74 +314,106 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
         discountPriceLabel1.textColor = NSColor(named: "KMPurchaseDiscountColor")
         discountPriceLabel1.font = NSFont.SFProTextRegularFont(9.0)
         refreshLicenseCodeView(isReveal: false)
-        if productType == .ipaConvert || productType == .ipaAI {
+        usualAddCountView.isHidden = isMoreCountViewShouldHidden(product_Info)
+        
+        if _dmgProductType == .advanced_annual_subscription_trail {
             aiAddOnView.isHidden = true
             extendedView.isHidden = true
             
-            if productType == .ipaConvert {
-                pdfReaderProLabel.stringValue = NSLocalizedString("PDF to Office", comment: "")
-                prmiumLabel.stringValue = NSLocalizedString("Export PDF to Word(.docx), Excel (.xlsx), PowerPoint(.pptx)", comment: "")
-                oneLicenseLabel.stringValue = NSLocalizedString("and more offline. It's one time purchase.", comment: "")
-                licenseCodeLabel.stringValue = NSLocalizedString("License Code", comment: "")
-                licenseCodeLabel.textColor = NSColor(named: "KMPurchaseTitleColor1")
-                licenseCodeLabel.font = NSFont.SFProTextRegularFont(14.0)
-                licenseCodeTextField.placeholderString = NSLocalizedString("Input license code previously activated the app", comment: "")
-                licenseCodeTextField.delegate = self
-                licenseCodeBox.borderColor = NSColor(named: "KMPurchase_DADBDE")!
-                licenseCodeBox.fillColor = NSColor(named: "KMPurchase_FFFFFF")!
-                notFoundButton.title = NSLocalizedString("Not Found?", comment: "")
-                notFoundButton.setTitleColor(color: NSColor(named: "KMPurchaseCouponColor")!, font: NSFont(name: "body-s-regular", size: 14))
-                licenseCodeTextField.stringValue = VerificationManager.default().originLicenseCode ?? ""
-                refreshLicenseCodeView(isReveal: true)
-                licenseCodeErrorLabel.stringValue = NSLocalizedString("Please enter right license code. How to Retrieve License.", comment: "")
-                licenseCodeErrorLabel.textColor = NSColor(named: "KMPurchaseErrorColor")
-                licenseCodeErrorLabel.font = NSFont.SFProTextRegularFont(11.0)
-                refreshLicenseCodeErrorView(isReveal: false)
-            } else if productType == .ipaAI {
-                pdfReaderProLabel.stringValue = NSLocalizedString("PDF Reader Pro AI Tools", comment: "")
-                prmiumLabel.stringValue = NSLocalizedString("50 credits for 30 days", comment: "")
-                oneLicenseLabel.stringValue = NSLocalizedString("Manually renew at USD 14.99", comment: "")
-            }
-        } else {
-            pdfReaderProLabel.stringValue = NSLocalizedString("PDF Reader Pro for Mac", comment: "")
-            if productToType(originalProductID) == .ipaPremium {
-                prmiumLabel.stringValue = NSLocalizedString("Premium", comment: "")
-                oneLicenseLabel.stringValue = NSLocalizedString("One license for one device. One time purchase.", comment: "")
-            } else if productToType(originalProductID) == .ipaPermanent {
-                prmiumLabel.stringValue = NSLocalizedString("Permanent version (with PDF to Office Pack)", comment: "")
-                oneLicenseLabel.stringValue = NSLocalizedString("One license for one device. One time purchase.", comment: "")
-            }
-            aiAddOnButton.image = NSImage(named: "EmbeddedPayment06")
-            aiAddOnLabel.stringValue = NSLocalizedString("AI Add-on", comment: "")
-            aiAddOnLabel.textColor = NSColor(named: "KMPurchaseTitleColor")
-            aiAddOnLabel.font = NSFont.SFProTextRegularFont(14.0)
-            IndividualLabel.stringValue = NSLocalizedString("Individual monthly plan. Manually renew.", comment: "")
-            IndividualLabel.textColor = NSColor(named: "KMPurchaseSubTitleColor")
-            IndividualLabel.font = NSFont.SFProTextRegularFont(12.0)
-            originalPriceLabel2.textColor = NSColor(named: "KMPurchaseTitleColor")
-            originalPriceLabel2.font = NSFont.SFProTextRegularFont(16.0)
-            discountPriceLabel2.textColor = NSColor(named: "KMPurchaseDiscountColor")
-            discountPriceLabel2.font = NSFont.SFProTextRegularFont(9.0)
+            pdfReaderProLabel.stringValue = NSLocalizedString("PDF Reader Pro Standard - Annual Plan", comment: "")
             
-            if originalProductID == "com.brother.pdfreaderpro.mac.product_3" {
-                extendedLabel.stringValue = NSLocalizedString("Extended Device Access", comment: "")
-                accessLabel.stringValue = NSLocalizedString("Get access to your plan on up to 2 devices.", comment: "")
-                extendedImageView.isHidden = false
-            } else {
-                extendedLabel.stringValue = NSLocalizedString("PDF to Office Pack", comment: "")
-                accessLabel.stringValue = NSLocalizedString("One time purchase", comment: "")
-                extendedImageView.isHidden = true
-            }
-            extendedButton.image = NSImage(named: "EmbeddedPayment06")
-            extendedLabel.textColor = NSColor(named: "KMPurchaseTitleColor")
-            extendedLabel.font = NSFont.SFProTextRegularFont(14.0)
-            accessLabel.textColor = NSColor(named: "KMPurchaseSubTitleColor")
-            accessLabel.font = NSFont.SFProTextRegularFont(12.0)
-            originalPriceLabel3.textColor = NSColor(named: "KMPurchaseTitleColor")
-            originalPriceLabel3.font = NSFont.SFProTextRegularFont(16.0)
-            discountPriceLabel3.textColor = NSColor(named: "KMPurchaseDiscountColor")
-            discountPriceLabel3.font = NSFont.SFProTextRegularFont(9.0)
+            let tipsString = NSLocalizedString("%.2@/year, auto-renewal", comment: "")
+            let fullString = String(format: tipsString, product_Info.price)
+            prmiumLabel.stringValue = fullString
+            
+            
+            oneLicenseLabel.stringValue = NSLocalizedString("and more offline. It's one time purchase.", comment: "")
+            licenseCodeLabel.stringValue = NSLocalizedString("License Code", comment: "")
+            licenseCodeLabel.textColor = NSColor(named: "KMPurchaseTitleColor1")
+            licenseCodeLabel.font = NSFont.SFProTextRegularFont(14.0)
+            licenseCodeTextField.placeholderString = NSLocalizedString("Input license code previously activated the app", comment: "")
+            licenseCodeTextField.delegate = self
+            licenseCodeBox.borderColor = NSColor(named: "KMPurchase_DADBDE")!
+            licenseCodeBox.fillColor = NSColor(named: "KMPurchase_FFFFFF")!
+            notFoundButton.title = NSLocalizedString("Not Found?", comment: "")
+            notFoundButton.setTitleColor(color: NSColor(named: "KMPurchaseCouponColor")!, font: NSFont(name: "body-s-regular", size: 14))
+            licenseCodeTextField.stringValue = VerificationManager.default().originLicenseCode ?? ""
+            refreshLicenseCodeView(isReveal: true)
+            licenseCodeErrorLabel.stringValue = NSLocalizedString("Please enter right license code. How to Retrieve License.", comment: "")
+            licenseCodeErrorLabel.textColor = NSColor(named: "KMPurchaseErrorColor")
+            licenseCodeErrorLabel.font = NSFont.SFProTextRegularFont(11.0)
+            refreshLicenseCodeErrorView(isReveal: false)
         }
+        
+        
+//        if productType == .ipaConvert || productType == .ipaAI {
+//            aiAddOnView.isHidden = true
+//            extendedView.isHidden = true
+//            
+//            if productType == .ipaConvert {
+//                pdfReaderProLabel.stringValue = NSLocalizedString("PDF to Office", comment: "")
+//                prmiumLabel.stringValue = NSLocalizedString("Export PDF to Word(.docx), Excel (.xlsx), PowerPoint(.pptx)", comment: "")
+//                oneLicenseLabel.stringValue = NSLocalizedString("and more offline. It's one time purchase.", comment: "")
+//                licenseCodeLabel.stringValue = NSLocalizedString("License Code", comment: "")
+//                licenseCodeLabel.textColor = NSColor(named: "KMPurchaseTitleColor1")
+//                licenseCodeLabel.font = NSFont.SFProTextRegularFont(14.0)
+//                licenseCodeTextField.placeholderString = NSLocalizedString("Input license code previously activated the app", comment: "")
+//                licenseCodeTextField.delegate = self
+//                licenseCodeBox.borderColor = NSColor(named: "KMPurchase_DADBDE")!
+//                licenseCodeBox.fillColor = NSColor(named: "KMPurchase_FFFFFF")!
+//                notFoundButton.title = NSLocalizedString("Not Found?", comment: "")
+//                notFoundButton.setTitleColor(color: NSColor(named: "KMPurchaseCouponColor")!, font: NSFont(name: "body-s-regular", size: 14))
+//                licenseCodeTextField.stringValue = VerificationManager.default().originLicenseCode ?? ""
+//                refreshLicenseCodeView(isReveal: true)
+//                licenseCodeErrorLabel.stringValue = NSLocalizedString("Please enter right license code. How to Retrieve License.", comment: "")
+//                licenseCodeErrorLabel.textColor = NSColor(named: "KMPurchaseErrorColor")
+//                licenseCodeErrorLabel.font = NSFont.SFProTextRegularFont(11.0)
+//                refreshLicenseCodeErrorView(isReveal: false)
+//            } else if productType == .ipaAI {
+//                pdfReaderProLabel.stringValue = NSLocalizedString("PDF Reader Pro AI Tools", comment: "")
+//                prmiumLabel.stringValue = NSLocalizedString("50 credits for 30 days", comment: "")
+//                oneLicenseLabel.stringValue = NSLocalizedString("Manually renew at USD 14.99", comment: "")
+//            }
+//        } else {
+//            pdfReaderProLabel.stringValue = NSLocalizedString("PDF Reader Pro for Mac", comment: "")
+//            if productToType(originalProductID) == .ipaPremium {
+//                prmiumLabel.stringValue = NSLocalizedString("Premium", comment: "")
+//                oneLicenseLabel.stringValue = NSLocalizedString("One license for one device. One time purchase.", comment: "")
+//            } else if productToType(originalProductID) == .ipaPermanent {
+//                prmiumLabel.stringValue = NSLocalizedString("Permanent version (with PDF to Office Pack)", comment: "")
+//                oneLicenseLabel.stringValue = NSLocalizedString("One license for one device. One time purchase.", comment: "")
+//            }
+//            aiAddOnButton.image = NSImage(named: "EmbeddedPayment06")
+//            aiAddOnLabel.stringValue = NSLocalizedString("AI Add-on", comment: "")
+//            aiAddOnLabel.textColor = NSColor(named: "KMPurchaseTitleColor")
+//            aiAddOnLabel.font = NSFont.SFProTextRegularFont(14.0)
+//            IndividualLabel.stringValue = NSLocalizedString("Individual monthly plan. Manually renew.", comment: "")
+//            IndividualLabel.textColor = NSColor(named: "KMPurchaseSubTitleColor")
+//            IndividualLabel.font = NSFont.SFProTextRegularFont(12.0)
+//            originalPriceLabel2.textColor = NSColor(named: "KMPurchaseTitleColor")
+//            originalPriceLabel2.font = NSFont.SFProTextRegularFont(16.0)
+//            discountPriceLabel2.textColor = NSColor(named: "KMPurchaseDiscountColor")
+//            discountPriceLabel2.font = NSFont.SFProTextRegularFont(9.0)
+//            
+//            if originalProductID == "com.brother.pdfreaderpro.mac.product_3" {
+//                extendedLabel.stringValue = NSLocalizedString("Extended Device Access", comment: "")
+//                accessLabel.stringValue = NSLocalizedString("Get access to your plan on up to 2 devices.", comment: "")
+//                extendedImageView.isHidden = false
+//            } else {
+//                extendedLabel.stringValue = NSLocalizedString("PDF to Office Pack", comment: "")
+//                accessLabel.stringValue = NSLocalizedString("One time purchase", comment: "")
+//                extendedImageView.isHidden = true
+//            }
+//            extendedButton.image = NSImage(named: "EmbeddedPayment06")
+//            extendedLabel.textColor = NSColor(named: "KMPurchaseTitleColor")
+//            extendedLabel.font = NSFont.SFProTextRegularFont(14.0)
+//            accessLabel.textColor = NSColor(named: "KMPurchaseSubTitleColor")
+//            accessLabel.font = NSFont.SFProTextRegularFont(12.0)
+//            originalPriceLabel3.textColor = NSColor(named: "KMPurchaseTitleColor")
+//            originalPriceLabel3.font = NSFont.SFProTextRegularFont(16.0)
+//            discountPriceLabel3.textColor = NSColor(named: "KMPurchaseDiscountColor")
+//            discountPriceLabel3.font = NSFont.SFProTextRegularFont(9.0)
+//        }
         removeButton1.isEnabled = false
         amountTextField1.delegate = self
         amountTextField2.isEditable = false
@@ -1166,6 +1240,32 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
     
     // MARK: get & set
     
+    var product_Info: KMListingProductsModel {
+        get {
+            return _product_Info
+        }
+        set {
+            _product_Info = newValue
+            xibInitialization()
+            priceRefresh()
+            
+            confirmPayment(isConfirm: false)
+        }
+    }
+    
+    var dmgProductType: KMDMGProductType {
+        get {
+           return _dmgProductType
+        }
+        set {
+            _dmgProductType = newValue
+            xibInitialization()
+            priceRefresh()
+            
+            confirmPayment(isConfirm: false)
+        }
+    }
+    
     private var paymentMethod : KMPaymentType {
         get {
            return _paymentMethod

+ 7 - 5
PDF Office/PDF Master/Class/Purchase/DMG/KMPurchaseEmbeddedWindowController.xib

@@ -1,8 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22505" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="23094" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
         <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22505"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="23094"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
@@ -99,6 +99,8 @@
                 <outlet property="scanLabel" destination="8Om-Bo-EFk" id="aau-Ii-1du"/>
                 <outlet property="successfullyLabel" destination="hj7-ST-7me" id="Kft-CA-jiD"/>
                 <outlet property="successfullyView" destination="LRb-Y6-ZvE" id="eWl-If-q4N"/>
+                <outlet property="usualAddCountView" destination="Sat-nf-b5q" id="qjf-Zb-wOb"/>
+                <outlet property="usualAddonView" destination="M6b-Qf-5FA" id="6Bw-Ee-0uH"/>
                 <outlet property="weChatBox" destination="3RR-ng-Us6" id="H3Q-Zj-hJo"/>
                 <outlet property="weChatButton" destination="hj1-6S-4j5" id="768-we-YrD"/>
                 <outlet property="weChatPayView" destination="pBx-yN-WZs" id="1hO-qE-DpL"/>
@@ -114,7 +116,7 @@
             <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
             <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
             <rect key="contentRect" x="196" y="240" width="970" height="612"/>
-            <rect key="screenRect" x="0.0" y="0.0" width="2560" height="1415"/>
+            <rect key="screenRect" x="0.0" y="0.0" width="1440" height="875"/>
             <value key="minSize" type="size" width="970" height="612"/>
             <value key="maxSize" type="size" width="970" height="612"/>
             <view key="contentView" id="se5-gp-TjO">
@@ -481,7 +483,7 @@
                                                                 <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="EmbeddedPayment26" id="dr8-sG-J6H"/>
                                                             </imageView>
                                                             <button translatesAutoresizingMaskIntoConstraints="NO" id="EEw-fo-cIt">
-                                                                <rect key="frame" x="260" y="48" width="75" height="20"/>
+                                                                <rect key="frame" x="261" y="48" width="74" height="20"/>
                                                                 <buttonCell key="cell" type="bevel" title="Not Found?" bezelStyle="rounded" alignment="center" imageScaling="proportionallyDown" inset="2" id="zXn-dP-FsP">
                                                                     <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                                                     <font key="font" metaFont="system"/>
@@ -1380,7 +1382,7 @@
                             <rect key="frame" x="-5" y="0.0" width="229" height="28"/>
                             <popUpButtonCell key="cell" type="square" bezelStyle="shadowlessSquare" alignment="left" lineBreakMode="truncatingTail" inset="2" arrowPosition="noArrow" id="7Au-hp-0Cm" customClass="KMPopUpButtonCell" customModule="PDF_Reader_Pro" customModuleProvider="target">
                                 <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
-                                <font key="font" metaFont="menu"/>
+                                <font key="font" metaFont="message"/>
                                 <menu key="menu" id="pry-dI-PhA"/>
                             </popUpButtonCell>
                             <connections>

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

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

+ 2 - 0
PDF Office/PDF Master/MemberCenter/Assets/en.lproj/MemberCenterLocalizable.strings

@@ -104,3 +104,5 @@
 "Subscribe to All Access Pack to Enjoy More Expanded Features" = "Subscribe to All Access Pack to Enjoy More Expanded Features";
 "Auto-renewal | Billed yearly" = "Auto-renewal | Billed yearly";
 "(Tax Incl.)" = "(Tax Incl.)";
+"6-Month Plan" = "6-Month Plan";
+"Monthly Plan" = "Monthly Plan";

+ 2 - 0
PDF Office/PDF Master/MemberCenter/Assets/zh-Hans.lproj/MemberCenterLocalizable.strings

@@ -100,3 +100,5 @@
 "Subscribe to All Access Pack to Enjoy More Expanded Features" = "升级会员套餐解锁更多功能";
 "Auto-renewal | Billed yearly" = "自动续费 | 年订阅";
 "(Tax Incl.)" = "(含税)";
+"6-Month Plan" = "半年订阅";
+"Monthly Plan" = "月订阅";

+ 3 - 0
PDF Office/PDF Master/MemberCenter/Assets/zh-Hant.lproj/MemberCenterLocalizable.strings

@@ -100,3 +100,6 @@
 "Subscribe to All Access Pack to Enjoy More Expanded Features" = "升級會員套餐解鎖更多功能";
 "Auto-renewal | Billed yearly" = "自動續費 | 年訂閱";
 "(Tax Incl.)" = "(含稅)";
+
+"6-Month Plan" = "半年訂閱";
+"Monthly Plan" = "月訂閱";

+ 9 - 10
PDF Office/PDF Master/MemberCenter/KMMemberCenterConfig.swift

@@ -9,15 +9,14 @@ import Cocoa
 
 class KMMemberCenterConfig: NSObject {
     func activityBaseURL() -> String {
-//        #if DEBUG
-//        if kTestMode == 1{
-//            return "http://test-store.kdan.cn:3019"
-//        } else {
-//            return "https://store.filmagepro.com:3018"
-//        }
-//        #else
-//        return "https://store.filmagepro.com:3018"
-//        #endif
-        return "http://139.196.160.101:8081"
+        #if DEBUG
+        if kTestMode == 1{
+            return "http://139.196.160.101:8081"
+        } else {
+            return "https://test-pdf-pro.kdan.cn"
+        }
+        #else
+        return "https://test-pdf-pro.kdan.cn"
+        #endif
     }
 }

+ 2 - 2
PDF Office/PDF Master/MemberCenter/Model/KMMemberCenterManager.swift

@@ -1244,7 +1244,7 @@ class KMMemberCenterManager: NSObject {
      @param num                      批量购买数量
      @param complete 回调
      */
-    func createOrder(productId: String, paymentMethod: Int, price: NSNumber, discountFlag: Int, couponCode: String, num: Int, _ complete: @escaping KMMemberProductComplete) {
+    func createOrder(productId: String, paymentMethod: Int, price: String, discountFlag: Int, couponCode: String, num: Int, _ complete: @escaping KMMemberProductComplete) {
         let token: String = KMMemberInfo.shared.access_token
         if token == "" {
             complete(false, nil)
@@ -1303,7 +1303,7 @@ class KMMemberCenterManager: NSObject {
      @param num                      批量购买数量
      @param complete 回调
      */
-    func createSubscriber(productId: String, paymentMethod: Int, price: NSNumber, discountFlag: Int, couponCode: String, num: Int, _ complete: @escaping KMMemberProductComplete) {
+    func createSubscriber(productId: String, paymentMethod: Int, price: String, discountFlag: Int, couponCode: String, num: Int, _ complete: @escaping KMMemberProductComplete) {
         let token: String = KMMemberInfo.shared.access_token
         if token == "" {
             complete(false, nil)

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

@@ -14,13 +14,13 @@ import Cocoa
     case lite_type3     // 免费版 无旧买断 试用过期或取消 (右上角导航栏按钮 - “登录领福利” + 开通会员)
     case lite_type4     // 免费版 无旧买断 可升级订阅 (右上角导航栏按钮 - “登录领福利”)
     case lite_type5     // 免费版 无旧买断 多平台永久 (右上角导航栏按钮 - “登录领福利” + 升级全平台)
-    case lite_type6     // 免费版 无旧买断 全平台高级年订阅 (右上角导航栏按钮 - “登录领福利”)
+    case lite_type6     // 免费版 无旧买断 全平台年订阅 (右上角导航栏按钮 - “登录领福利”)
     case lite_type7     // 免费版 无旧买断 会员到期 (右上角导航栏按钮 - “登录领福利” + 续费)
     case lite_type8     // 免费版 无旧买断 订阅中取消 (右上角导航栏按钮 - “登录领福利” + 续费)
     case lite_type9     // 免费版 有旧买断 免费未试用 (右上角导航栏按钮 - “登录领福利” + “升级至Pro”)
     case lite_type10    // 免费版 有旧买断 免费试用中 (右上角导航栏按钮 - “登录领福利”)
     case lite_type11    // 免费版 有旧买断 试用过期或取消 (右上角导航栏按钮 - “登录领福利” + 开通会员)
-    case lite_type12    // 免费版 有旧买断 全平台高级版年订阅 (右上角导航栏按钮 - “登录领福利”)
+    case lite_type12    // 免费版 有旧买断 订阅 (右上角导航栏按钮 - “登录领福利”)
     case lite_type13    // 免费版 有旧买断 订阅中取消 (右上角导航栏按钮 - “登录领福利” + 续费)
     case pro_type1      // 付费版 有旧PDF To Office (右上角导航栏按钮 - “登录领福利” + 升级(全平台))
     case pro_type2      // 付费版 有旧PDF To Office 全平台高级年订阅 (右上角导航栏按钮 - “登录领福利”)
@@ -35,11 +35,22 @@ import Cocoa
     case lite_old
 }
 
+// 当前注销状态
+@objc enum KMCurrentLogoutStatus : Int {
+    case null = 0  //
+    case prompt_unsubscribe
+    case prompt_signout
+    case closeAccount
+    case closeVerification
+    case closeApply
+}
+
 @objcMembers class KMMemberInfo: NSObject {
     
     static let shared = KMMemberInfo()
     
     var isLogin: Bool = false
+    var currentLogoutStatus: KMCurrentLogoutStatus = .null
     
     /**
      登录
@@ -250,7 +261,7 @@ import Cocoa
             }
 #else
     // AppStore 免费版本
-            if IAPProductsManager.default().allAccessPack6months_lite.isSubscribed == 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 {
@@ -262,10 +273,10 @@ import Cocoa
                     return .lite_type10
                 } else if KMMemberInfo.shared.vip_status == 4 {
                     return .lite_type11
-                }
-                if KMMemberInfo.shared.vip_paymentModel == "1" && KMMemberInfo.shared.vip_cycle == 4 && platformsArray.count == 4 {
+                } else if(KMMemberInfo.shared.vip_status == 1 && KMMemberInfo.shared.vip_paymentModel == "1") {
+                    // 订阅中
                     return .lite_type12
-                } 
+                }
                 if KMMemberInfo.shared.vip_paymentModel == "1" && KMMemberInfo.shared.vip_payType == 0 {
                     return .lite_type13
                 }
@@ -334,7 +345,19 @@ import Cocoa
                 if IAPProductsManager.default().isAvailableAllFunction() == true {
                     return true
                 } else {
-                    if userScenarioType == .lite_type2 || userScenarioType == .lite_type4 || userScenarioType == .lite_type5 || userScenarioType == .lite_type6 {
+                    let platforms = KMMemberInfo.shared.vip_platforms
+                    let platformsArray = platforms
+                        .components(separatedBy: ",")
+                        .map { $0.trimmingCharacters(in: .whitespaces) }
+
+                    if userScenarioType == .lite_type5 ||
+                        userScenarioType == .lite_type4 {
+                        if(platformsArray.contains("mac")) {
+                            return true
+                        }
+                        
+                    } else if userScenarioType == .lite_type2 ||
+                                userScenarioType == .lite_type6 {
                         return true
                     }
                     return false
@@ -370,14 +393,24 @@ import Cocoa
                 if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
                     return true
                 } else {
-                    if userScenarioType == .lite_type4 || 
-                        userScenarioType == .lite_type5 ||
-                        userScenarioType == .lite_type6 ||
-                        userScenarioType == .lite_type12 {
+                    let platforms = KMMemberInfo.shared.vip_platforms
+                    let platformsArray = platforms
+                        .components(separatedBy: ",")
+                        .map { $0.trimmingCharacters(in: .whitespaces) }
+
+                    if(userScenarioType == .lite_type2) {
                         return true
-                    } else {
-                        return false
+                    } else if userScenarioType == .lite_type5 ||
+                        userScenarioType == .lite_type4 {
+                        if(platformsArray.contains("mac")) { //购买了
+                            return true
+                        }
+                    } else if userScenarioType == .lite_type6 || userScenarioType == .lite_type12 {
+                        if KMMemberInfo.shared.vip_levels == "3" { //高级版本支持转档功能
+                            return true
+                        }
                     }
+                    return false
                 }
             } else {
                 if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
@@ -445,6 +478,7 @@ import Cocoa
             return false
         }
     }
+
     
     // MARK: Public Method
     

+ 2 - 2
PDF Office/PDF Master/MemberCenter/View/KMSignUpView.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="Named colors" minToolsVersion="9.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>

+ 55 - 16
PDF Office/PDF Master/MemberCenter/ViewController/KMUserInfoViewController.swift

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

+ 46 - 16
PDF Office/PDF Master/MemberCenter/ViewModel/KMProductModel.swift

@@ -112,10 +112,10 @@ class KMProductModel: ObservableObject {
      */
     func getDMGProductDatas() -> Void {
         checkConnectionAvailable()
-//        KMMemberCenterManager.manager.getListingProducts(isEducation: 0) { [weak self] success, result in
-//            guard let productsArrays : KMMemberProductResult = result else { return }
-//            self?.dmgProductDatas = productsArrays
-//        }
+        KMMemberCenterManager.manager.getListingProducts(isEducation: 0) { [weak self] success, result in
+            guard let productsArrays : KMMemberProductResult = result else { return }
+            self?.dmgProductDatas = productsArrays
+        }
         
         if KMMemberInfo.shared.isLogin {
 //            getDMGProductPriceInfosForMember(productId: "SP2024102300004", isEducation: 0) { [weak self] success, result in
@@ -132,12 +132,18 @@ class KMProductModel: ObservableObject {
 //                
 //            }
             
-//            creatOrder(productId: "SP2024102300004", paymentMethod: 0, price: NSNumber(value: 119.99), discountFlag: 0, couponCode: "", num: 1) { [weak self] success, result in
+            //创建买断订单
+//            creatOrder(productId: "SP2024102300004", paymentMethod: 0, price: "119.99", discountFlag: 0, couponCode: "", num: 1) { [weak self] success, result in
 //
 //            }
             
-//            createSubscriber(productId: "SP2024102300003", paymentMethod: 0, price: NSNumber(value: 119.99), discountFlag: 0, couponCode: "", num: 1) { [weak self] success, result in
+            //创建订阅订单(创建买断订单后会报错已经是购买用户,不能重复购买)
+//            createSubscriber(productId: "SP2024102300003", paymentMethod: 0, price: "99.99", discountFlag: 0, couponCode: "", num: 1) { [weak self] success, result in
 //
+//            }
+            
+//            getDMGProductOrderIdInfosForMember(orderId: "94b10d5f1ca193948e005503bff0df11") { [weak self] success, result in
+//                
 //            }
             
         }
@@ -241,7 +247,7 @@ class KMProductModel: ObservableObject {
      @param num                      批量购买数量
      @param complete 回调
      */
-    func creatOrder(productId: String, paymentMethod: Int, price: NSNumber, discountFlag: Int, couponCode: String, num: Int, _ complete: @escaping KMMemberProductComplete) {
+    func creatOrder(productId: String, paymentMethod: Int, price: String, discountFlag: Int, couponCode: String, num: Int, _ complete: @escaping KMMemberProductComplete) {
         checkConnectionAvailable()
         KMMemberCenterManager.manager.createOrder(productId: productId, paymentMethod: paymentMethod, price: price, discountFlag: discountFlag, couponCode: couponCode, num: num) { [weak self] success, result in
             if success {
@@ -267,7 +273,7 @@ class KMProductModel: ObservableObject {
      @param num                      批量购买数量
      @param complete 回调
      */
-    func createSubscriber(productId: String, paymentMethod: Int, price: NSNumber, discountFlag: Int, couponCode: String, num: Int, _ complete: @escaping KMMemberProductComplete) {
+    func createSubscriber(productId: String, paymentMethod: Int, price: String, discountFlag: Int, couponCode: String, num: Int, _ complete: @escaping KMMemberProductComplete) {
         checkConnectionAvailable()
         KMMemberCenterManager.manager.createSubscriber(productId: productId, paymentMethod: paymentMethod, price: price, discountFlag: discountFlag, couponCode: couponCode, num: num) { [weak self] success, result in
             if success {
@@ -283,6 +289,26 @@ class KMProductModel: ObservableObject {
         }
     }
     
+    /**
+     @abstract 支付后查询订单状态
+     @param productId 购买的产品id
+     @param complete 回调
+     */
+    func getDMGProductOrderIdInfosForMember(orderId: String, _ complete: @escaping KMMemberRequestInfoComplete) {
+        checkConnectionAvailable()
+        KMMemberCenterManager.manager.getStateByOrderId(orderId: orderId) { [weak self] success, result in
+            if success {
+                guard let productsInfos : NSDictionary = result else {
+                    complete(false, result)
+                    return
+                }
+                complete(true, productsInfos)
+            } else {
+                complete(false, result)
+            }
+        }
+    }
+    
     
     // MARK: Public Method
     
@@ -438,16 +464,20 @@ class KMProductModel: ObservableObject {
             }
         } else if state == .lite_MacWindows {
             if tag == 2 {
-                let platforms = KMMemberInfo.shared.vip_platforms
-                let platformsArray = platforms
-                    .components(separatedBy: ",")
-                    .map { $0.trimmingCharacters(in: .whitespaces) }
-                if platformsArray.count == 1 {
+                if KMMemberInfo.shared.userScenarioType == .lite_type5 {
                     membershipPurchase(.advancedAddDevicesAllAccessPack12months_lite)
-                } else if platformsArray.count == 2 {
-                    membershipPurchase(.advancedAdd2DevicesAllAccessPack12months_lite)
                 } else {
-                    membershipPurchase(.advancedAdd2DevicesAllAccessPack12months_lite)
+                    let platforms = KMMemberInfo.shared.vip_platforms
+                    let platformsArray = platforms
+                        .components(separatedBy: ",")
+                        .map { $0.trimmingCharacters(in: .whitespaces) }
+                    if platformsArray.count == 1 {
+                        membershipPurchase(.advancedAddDevicesAllAccessPack12months_lite)
+                    } else if platformsArray.count == 2 {
+                        membershipPurchase(.advancedAdd2DevicesAllAccessPack12months_lite)
+                    } else {
+                        membershipPurchase(.advancedAdd2DevicesAllAccessPack12months_lite)
+                    }
                 }
             }
         } else if state == .pro_Base {

+ 28 - 0
PDF Office/PDF Master/MemberCenter/WindowsController/KMLoginWindowsController.swift

@@ -49,8 +49,19 @@ class KMLoginWindowsController: NSWindowController {
         NotificationCenter.default.addObserver(self, selector: #selector(loginSuccessNotification), name: NSNotification.Name(rawValue: "MemberCenterLoginSuccess"), object: nil)
         
         NotificationCenter.default.addObserver(self, selector: #selector(logoutSuccessNotification), name: NSNotification.Name(rawValue: "MemberCenterLogoutSuccess"), object: nil)
+        
+        rightBox.addObserver(self, forKeyPath: "contentView", options: [.new, .old], context: nil)
+    }
+    
+    override func showWindow(_ sender: Any?) {
+        super.showWindow(sender)
+        
+        initializeUI()
     }
     
+    deinit {
+        rightBox.removeObserver(self, forKeyPath: "contentView")
+    }
     
     // MARK: Private Action
     
@@ -140,4 +151,21 @@ class KMLoginWindowsController: NSWindowController {
             .store(in: &cancellables)
         
     }
+    
+    override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
+        if keyPath == "contentView" {
+            if let newContentView = change?[.newKey] as? NSView {
+                if newContentView is KMSignUpView {
+                    viewModel.screenType = .signUp
+                } else if newContentView is KMForgotPasswordView {
+                    viewModel.screenType = .forgotPassword
+                } else if newContentView is KMEnterVerificationCodeView {
+                    viewModel.screenType = .enterVerificationCode
+                } else if newContentView is KMEnterNewPasswordView {
+                    viewModel.screenType = .enterNewPassword
+                }
+                refreshSplitView()
+            }
+        }
+    }
 }

+ 20 - 10
PDF Office/PDF Master/MemberCenter/WindowsController/KMProductCompareWC.swift

@@ -341,7 +341,7 @@ class KMProductCompareWC: NSWindowController {
         standardPlanPurchaseLbl.stringValue = NSLocalizedString("Subscribe", comment: "")
         if KMMemberInfo.shared.userScenarioType == .lite_type3 ||
             KMMemberInfo.shared.userScenarioType == .lite_type11 {
-            advancedPlanPurchaseLbl.stringValue = NSLocalizedString("Renew now", comment: "")
+            advancedPlanPurchaseLbl.stringValue = NSLocalizedString("Renew now",tableName: "MemberCenterLocalizable", comment: "")
         } else {
             advancedPlanPurchaseLbl.stringValue = NSLocalizedString("Subscribe", comment: "")
         }
@@ -362,16 +362,20 @@ class KMProductCompareWC: NSWindowController {
         if model.state == .lite_Base {
             permanentPurchaseLabel.stringValue = model.getProductPrice(.allAccessPackPermanent_lite)
         } else if model.state == .lite_MacWindows {
-            let platforms = KMMemberInfo.shared.vip_platforms
-            let platformsArray = platforms
-                .components(separatedBy: ",")
-                .map { $0.trimmingCharacters(in: .whitespaces) }
-            if platformsArray.count == 1 {
-                advancedPlanPurchaseLabel.stringValue = model.getProductPrice(.advancedAddDevicesAllAccessPack12months_lite)
-            } else if platformsArray.count == 2 {
-                advancedPlanPurchaseLabel.stringValue = model.getProductPrice(.advancedAdd2DevicesAllAccessPack12months_lite)
+            if KMMemberInfo.shared.userScenarioType == .lite_type5 {
+                let platforms = KMMemberInfo.shared.vip_platforms
+                let platformsArray = platforms
+                    .components(separatedBy: ",")
+                    .map { $0.trimmingCharacters(in: .whitespaces) }
+                if platformsArray.count == 1 {
+                    advancedPlanPurchaseLabel.stringValue = model.getProductPrice(.advancedAddDevicesAllAccessPack12months_lite)
+                } else if platformsArray.count == 2 {
+                    advancedPlanPurchaseLabel.stringValue = model.getProductPrice(.advancedAdd2DevicesAllAccessPack12months_lite)
+                } else {
+                    advancedPlanPurchaseLabel.stringValue = model.getProductPrice(.advancedAdd2DevicesAllAccessPack12months_lite)
+                }
             } else {
-                advancedPlanPurchaseLabel.stringValue = model.getProductPrice(.advancedAdd2DevicesAllAccessPack12months_lite)
+                advancedPlanPurchaseLabel.stringValue = model.getProductPrice(.advancedAddDevicesAllAccessPack12months_lite)
             }
         } else {
             // model.state == .trial
@@ -1024,10 +1028,16 @@ class KMProductCompareWC: NSWindowController {
     }
     
     @IBAction func appstorePurchaseAction(_ sender: NSButton) {
+#if VERSION_DMG
+        let embeddedWC = KMPurchaseEmbeddedWindowController.currentFirstTrialWC("com.brother.pdfreaderpro.mac.product_2")
+        embeddedWC.showWindow(nil)
+        embeddedWC.window?.center()
+#else
         model.appstorePurchaseAction(sender.tag) { [weak self] success, msg in
             guard let self = self else { return }
 
         }
+#endif
     }
     
     // MARK: - InAppPurchaseManager Notification