Переглянути джерело

【会员系统 】DMG比较表模块调整

wanjun 1 тиждень тому
батько
коміт
240859f029

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

@@ -77,6 +77,11 @@ extern NSString * const KMIAPSubscriptionLoadedNotification;
 
 @property (nonatomic,readonly) IAPProduct *DMGAllAccessProduct;
 @property (nonatomic,readonly) IAPProduct *DMGPDFToOfficeProduct;
+@property (nonatomic,readonly) IAPProduct *DMGPDFReaderProAdcanced;
+@property (nonatomic,readonly) IAPProduct *DMGPDFReaderProPermanent;
+@property (nonatomic,readonly) IAPProduct *DMGPDFReaderProAI_Annual;
+@property (nonatomic,readonly) IAPProduct *DMGPDFReaderProAI_Monthly;
+@property (nonatomic,readonly) IAPProduct *DMGAdd2Device;
 
 @property (nonatomic, readonly) NSString *temptransactioReceipt;
 

+ 4 - 0
PDF Office/PDF Master/MemberCenter/ViewController/KMUserInfoViewController.swift

@@ -1126,6 +1126,10 @@ class KMUserInfoViewController: NSViewController {
             guard let self = self else { return }
             if KMMemberInfo.shared.userScenarioType == .lite_type1 {
                 self.viewModel.skipCompare(.trial)
+            } else if KMMemberInfo.shared.userScenarioType == .dmg_type4 ||
+                        KMMemberInfo.shared.userScenarioType == .dmg_type19 ||
+                        KMMemberInfo.shared.userScenarioType == .dmg_type34 {
+                self.viewModel.skipCompare(.trial)
             }
         }
         

+ 25 - 2
PDF Office/PDF Master/MemberCenter/ViewModel/KMProductModel.swift

@@ -57,7 +57,8 @@ import StoreKit
     case pdfReaderProAIAnnual_dmg  // AI 年订阅
     case pdfReaderProAIMonthly_dmg  // AI 月订阅
     case pdfToOffice_dmg  // 转档包 永久
-    case add2Device_dmg  // 转档包 永久
+    case add2Device_dmg  // 多设备全平台
+    case add3Device_dmg  // 单平台升级高级版
 }
 
 typealias AppstorePurchaseComplete = (_ success: Bool,_ msg: String) -> Void
@@ -457,13 +458,35 @@ class KMProductModel: ObservableObject {
             } else {
                 return IAPProductsManager.default().advancedAdd2DevicesAllAccessPack12months_pro.price()
             }
+        } else if type == .pdfReaderProStandard_dmg {
+            return "79.99"
+        } else if type == .pdfReaderProAdvanced_dmg {
+            return "99.99"
+        } else if type == .pdfReaderProPermanent_dmg {
+            return "119.99"
+        } else if type == .pdfReaderProAIAnnual_dmg {
+            return "125.99"
+        } else if type == .pdfReaderProAIMonthly_dmg {
+            return "14.99"
+        } else if type == .pdfToOffice_dmg {
+            return "29.99"
+        } else if type == .add2Device_dmg {
+            return "39.99"
+        } else if type == .add3Device_dmg {
+            return "49.99"
         }
         return ""
     }
     
     func appstorePurchaseAction(_ tag: Int, _ complete: @escaping AppstorePurchaseComplete) -> Void {
         if state == .dmg_Base {
-            
+            if tag == 0 {
+                
+            } else if tag == 3 {
+                
+            } else {
+                
+            }
         } else if state == .dmg_Upgrades1 {
             
         } else if state == .dmg_Upgrades2 {

+ 39 - 11
PDF Office/PDF Master/MemberCenter/WindowsController/KMProductCompareWC.swift

@@ -308,12 +308,18 @@ class KMProductCompareWC: NSWindowController {
 
     @objc override func showWindow(_ sender: Any?) {
         super.showWindow(sender)
+        if orientation {
+            model.state = orientationType
+        } else {
+            model.getCurrentComparisonTableType()
+        }
         languageLocalized()
         initializeUI()
         reloadData()
         if model.isShowSale {
             showDiscountToSaveWindow()
         }
+        reloadDataContent()
     }
 
     // MARK: - Private Methods
@@ -355,12 +361,15 @@ class KMProductCompareWC: NSWindowController {
 #if VERSION_DMG
     // DMG
         if model.state == .dmg_Base {
-
+            standardPlanPurchaseLabel.stringValue = model.getProductPrice(.pdfReaderProStandard_dmg)
+            advancedPlanPurchaseLabel.stringValue = model.getProductPrice(.pdfReaderProAdvanced_dmg)
+            permanentPurchaseLabel.stringValue = model.getProductPrice(.pdfReaderProPermanent_dmg)
         } else if model.state == .dmg_Upgrades1 {
-            
+            advancedPlanPurchaseLabel.stringValue = model.getProductPrice(.add2Device_dmg)
         } else if model.state == .dmg_Upgrades2 {
-            
+            advancedPlanPurchaseLabel.stringValue = model.getProductPrice(.add3Device_dmg)
         } else {
+            advancedPlanPurchaseLabel.stringValue = model.getProductPrice(.pdfReaderProAdvanced_dmg)
         }
 #else
     // AppStore 免费版本
@@ -1183,7 +1192,8 @@ extension KMProductCompareWC: NSTableViewDelegate, NSTableViewDataSource {
                     cellView.selectBoxLeft.constant = 352.0
                     cellView.selectBoxWidth.constant = 320.0
                 } else if model.state == .dmg_Upgrades2 {
-                    
+                    cellView.selectBoxLeft.constant = 352.0
+                    cellView.selectBoxWidth.constant = 320.0
                 } else if model.state == .lite_Base {
                     cellView.selectBoxLeft.constant = 352.0 + 179.0
                     cellView.selectBoxWidth.constant = 240.0
@@ -1269,8 +1279,8 @@ extension KMProductCompareWC: NSTableViewDelegate, NSTableViewDataSource {
             configureCellView(cellView, value: value4, label: cellView.value4Label, imageView: cellView.value4ImageView, platformsBox: cellView.platformsBox4)
         } else if model.state == .dmg_Upgrades1 {
             configureCellView(cellView, value: value3, label: cellView.value1Label, imageView: cellView.value1ImageView, platformsBox: cellView.platformsBox1)
-        } else if model.state == .dmg_Upgrades1 {
-            
+        } else if model.state == .dmg_Upgrades2 {
+            configureCellView(cellView, value: value3, label: cellView.value1Label, imageView: cellView.value1ImageView, platformsBox: cellView.platformsBox1)
         } else if model.state == .lite_Base {
             configureCellView(cellView, value: value1, label: cellView.value1Label, imageView: cellView.value1ImageView, platformsBox: cellView.platformsBox1)
             configureCellView(cellView, value: value3, label: cellView.value2Label, imageView: cellView.value2ImageView, platformsBox: cellView.platformsBox2)
@@ -1326,38 +1336,56 @@ extension KMProductCompareWC: NSTableViewDelegate, NSTableViewDataSource {
     }
     
     private func checkOrNot(_ cellView: KMProductCompareTableCell) {
+        cellView.selectBox1.isHidden = true
+        cellView.selectBox2.isHidden = true
+        cellView.selectBox3.isHidden = true
+        cellView.selectBox4.isHidden = true
+        cellView.cellView1.isHidden = true
+        cellView.cellView2.isHidden = true
+        cellView.cellView3.isHidden = true
+        cellView.cellView4.isHidden = true
         if model.state == .dmg_Base {
             cellView.selectBox3.isHidden = false
+            cellView.cellView1.isHidden = false
+            cellView.cellView2.isHidden = false
+            cellView.cellView3.isHidden = false
+            cellView.cellView4.isHidden = false
             cellView.viewWidth1.constant = 149.5
             cellView.viewWidth2.constant = 149.5
             cellView.viewWidth3.constant = 149.5
             cellView.viewWidth4.constant = 149.5
         } else if model.state == .dmg_Upgrades1 {
             cellView.selectBox1.isHidden = false
+            cellView.cellView1.isHidden = false
             cellView.viewWidth1.constant = 320.0
-        } else if model.state == .dmg_Upgrades1 {
+        } else if model.state == .dmg_Upgrades2 {
             cellView.selectBox1.isHidden = false
+            cellView.cellView1.isHidden = false
             cellView.viewWidth1.constant = 320.0
         } else if model.state == .lite_Base {
-            cellView.cellView4.isHidden = true
             cellView.selectBox2.isHidden = false
+            cellView.cellView1.isHidden = false
+            cellView.cellView2.isHidden = false
+            cellView.cellView3.isHidden = false
             cellView.viewWidth1.constant = 179.0
             cellView.viewWidth2.constant = 240.0
             cellView.viewWidth3.constant = 240.0
         } else if model.state == .lite_MacWindows {
             cellView.selectBox1.isHidden = false
             cellView.viewWidth1.constant = 320.0
+            cellView.cellView1.isHidden = false
         } else if model.state == .pro_Base {
-            cellView.cellView3.isHidden = true
             cellView.selectBox1.isHidden = false
             cellView.viewWidth1.constant = 299.0
+            cellView.cellView1.isHidden = false
         } else if model.state == .pro_Advanced {
             cellView.selectBox1.isHidden = false
             cellView.viewWidth1.constant = 320.0
+            cellView.cellView1.isHidden = false
         } else {
             // model.state == .trial
-            cellView.cellView3.isHidden = true
-            cellView.cellView4.isHidden = true
+            cellView.cellView1.isHidden = false
+            cellView.cellView2.isHidden = false
             cellView.selectBox2.isHidden = false
             cellView.viewWidth1.constant = 179.0
             cellView.viewWidth2.constant = 240.0

+ 21 - 21
PDF Office/PDF Master/MemberCenter/WindowsController/KMProductCompareWC.xib

@@ -102,7 +102,7 @@
         <window allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="documentWindow" titlebarAppearsTransparent="YES" id="7jy-UC-R98">
             <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES" fullSizeContentView="YES"/>
             <rect key="contentRect" x="77" y="40" width="970" height="660"/>
-            <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"/>
             <view key="contentView" wantsLayer="YES" misplaced="YES" id="BHT-Ss-56B">
                 <rect key="frame" x="0.0" y="0.0" width="970" height="660"/>
                 <autoresizingMask key="autoresizingMask"/>
@@ -1095,14 +1095,6 @@ https://www.pdfreaderpro.com/privacy-policy</mutableString>
             <rect key="frame" x="0.0" y="0.0" width="742" height="194"/>
             <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
             <subviews>
-                <box boxType="custom" cornerRadius="12" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="TbI-cd-sd7">
-                    <rect key="frame" x="0.0" y="-10" width="144" height="204"/>
-                    <view key="contentView" id="Cgn-Mc-kdm">
-                        <rect key="frame" x="1" y="1" width="142" height="202"/>
-                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                    </view>
-                    <color key="borderColor" red="1" green="0.36862745099999999" blue="0.17254901959999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
-                </box>
                 <box boxType="custom" borderWidth="0.0" cornerRadius="12" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="rtR-EN-GZe">
                     <rect key="frame" x="0.0" y="0.0" width="144" height="194"/>
                     <view key="contentView" id="WCI-ju-KkU">
@@ -1113,10 +1105,10 @@ https://www.pdfreaderpro.com/privacy-policy</mutableString>
                         <constraint firstAttribute="width" constant="144" id="dmj-ri-GBh"/>
                     </constraints>
                 </box>
-                <box boxType="custom" cornerRadius="12" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="eSr-Ep-bND">
-                    <rect key="frame" x="144" y="-10" width="300" height="204"/>
-                    <view key="contentView" id="eqd-ll-M9M">
-                        <rect key="frame" x="1" y="1" width="298" height="202"/>
+                <box boxType="custom" cornerRadius="12" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="TbI-cd-sd7">
+                    <rect key="frame" x="0.0" y="-10" width="144" height="204"/>
+                    <view key="contentView" id="Cgn-Mc-kdm">
+                        <rect key="frame" x="1" y="1" width="142" height="202"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                     </view>
                     <color key="borderColor" red="1" green="0.36862745099999999" blue="0.17254901959999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@@ -1131,10 +1123,10 @@ https://www.pdfreaderpro.com/privacy-policy</mutableString>
                         <constraint firstAttribute="width" constant="300" id="Fht-ba-6vO"/>
                     </constraints>
                 </box>
-                <box boxType="custom" cornerRadius="12" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="LHQ-au-Z59">
-                    <rect key="frame" x="444" y="-10" width="154" height="204"/>
-                    <view key="contentView" id="Up6-RM-FdN">
-                        <rect key="frame" x="1" y="1" width="152" height="202"/>
+                <box boxType="custom" cornerRadius="12" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="eSr-Ep-bND">
+                    <rect key="frame" x="144" y="-10" width="300" height="204"/>
+                    <view key="contentView" id="eqd-ll-M9M">
+                        <rect key="frame" x="1" y="1" width="298" height="202"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                     </view>
                     <color key="borderColor" red="1" green="0.36862745099999999" blue="0.17254901959999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@@ -1149,10 +1141,10 @@ https://www.pdfreaderpro.com/privacy-policy</mutableString>
                         <constraint firstAttribute="width" constant="154" id="UZc-yX-zJD"/>
                     </constraints>
                 </box>
-                <box boxType="custom" cornerRadius="12" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="fpi-Pf-NfD">
-                    <rect key="frame" x="598" y="-10" width="144" height="204"/>
-                    <view key="contentView" id="3FX-SF-Qg1">
-                        <rect key="frame" x="1" y="1" width="142" height="202"/>
+                <box boxType="custom" cornerRadius="12" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="LHQ-au-Z59">
+                    <rect key="frame" x="444" y="-10" width="154" height="204"/>
+                    <view key="contentView" id="Up6-RM-FdN">
+                        <rect key="frame" x="1" y="1" width="152" height="202"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                     </view>
                     <color key="borderColor" red="1" green="0.36862745099999999" blue="0.17254901959999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@@ -1167,6 +1159,14 @@ https://www.pdfreaderpro.com/privacy-policy</mutableString>
                         <constraint firstAttribute="width" constant="144" id="Vd3-5i-fHR"/>
                     </constraints>
                 </box>
+                <box boxType="custom" cornerRadius="12" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="fpi-Pf-NfD">
+                    <rect key="frame" x="598" y="-10" width="144" height="204"/>
+                    <view key="contentView" id="3FX-SF-Qg1">
+                        <rect key="frame" x="1" y="1" width="142" height="202"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                    </view>
+                    <color key="borderColor" red="1" green="0.36862745099999999" blue="0.17254901959999999" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
+                </box>
             </subviews>
             <constraints>
                 <constraint firstItem="Qq2-ys-Kfy" firstAttribute="trailing" secondItem="fpi-Pf-NfD" secondAttribute="trailing" id="37c-ei-nKe"/>