Procházet zdrojové kódy

Merge branch 'develop_v1.2' of git.kdan.cc:Mac_PDF/PDF_Office into develop_v1.2

tangchao před 1 rokem
rodič
revize
4206f83b59

+ 0 - 2
PDF Office/PDF Master.xcodeproj/project.pbxproj

@@ -1144,8 +1144,6 @@
 		AD015FB729AB484400A57062 /* KMLightMemberConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD015FB629AB484400A57062 /* KMLightMemberConfig.swift */; };
 		AD015FB829AB484400A57062 /* KMLightMemberConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD015FB629AB484400A57062 /* KMLightMemberConfig.swift */; };
 		AD015FB929AB484400A57062 /* KMLightMemberConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD015FB629AB484400A57062 /* KMLightMemberConfig.swift */; };
-		AD032CB82A4E6AC100F1D745 /* Starscream.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AD032CB62A4E6A7E00F1D745 /* Starscream.framework */; };
-		AD032CB92A4E6AC100F1D745 /* Starscream.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = AD032CB62A4E6A7E00F1D745 /* Starscream.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
 		AD032CBA2A525DAC00F1D745 /* KMInAppPurchaseManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD0E8AAF2A31B76300DBFD3C /* KMInAppPurchaseManager.swift */; };
 		AD0E8AB02A31B76300DBFD3C /* KMInAppPurchaseManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD0E8AAF2A31B76300DBFD3C /* KMInAppPurchaseManager.swift */; };
 		AD0E8AB12A31B76300DBFD3C /* KMInAppPurchaseManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = AD0E8AAF2A31B76300DBFD3C /* KMInAppPurchaseManager.swift */; };

+ 3 - 3
PDF Office/PDF Master/Class/ChromiumTabs/KMBrowserWindowController.xib

@@ -24,8 +24,8 @@
             <windowCollectionBehavior key="collectionBehavior" fullScreenPrimary="YES"/>
             <windowPositionMask key="initialPositionMask" leftStrut="YES" bottomStrut="YES"/>
             <rect key="contentRect" x="632" y="533" width="1280" height="800"/>
-            <rect key="screenRect" x="0.0" y="0.0" width="1800" height="1125"/>
-            <value key="minSize" type="size" width="460" height="460"/>
+            <rect key="screenRect" x="0.0" y="0.0" width="2560" height="1415"/>
+            <value key="minSize" type="size" width="640" height="640"/>
             <view key="contentView" id="WVd-Ye-yWx">
                 <rect key="frame" x="0.0" y="0.0" width="1280" height="800"/>
                 <autoresizingMask key="autoresizingMask"/>
@@ -306,7 +306,7 @@
             <windowStyleMask key="styleMask" titled="YES" closable="YES"/>
             <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
             <rect key="contentRect" x="1127" y="748" width="369" height="111"/>
-            <rect key="screenRect" x="0.0" y="0.0" width="1800" height="1125"/>
+            <rect key="screenRect" x="0.0" y="0.0" width="2560" height="1415"/>
             <value key="minSize" type="size" width="234" height="87"/>
             <value key="maxSize" type="size" width="235" height="88"/>
             <view key="contentView" id="tjv-WI-5S2">

+ 12 - 5
PDF Office/PDF Master/Class/Common/Category/NSView+KMExtension.swift

@@ -7,10 +7,11 @@
 
 import Foundation
 
-protocol KMLoadingProtocol: NSObjectProtocol {
-    
+@objc protocol KMLoadingProtocol: NSObjectProtocol {
     func beginLoading()
     func endLoading()
+    
+    @objc optional func beginLoading(backgroundColor: NSColor)
 }
 
 extension NSView: KMLoadingProtocol {
@@ -21,13 +22,17 @@ extension NSView: KMLoadingProtocol {
     }
     
     func beginLoading() {
+        self.beginLoading(backgroundColor: NSColor.clear)
+    }
+    
+    func beginLoading(backgroundColor: NSColor) {
         self.endLoading()
         
         if (Thread.isMainThread) {
-            self.beginLoadingInMainThread()
+            self.beginLoadingInMainThread(color: backgroundColor)
         } else {
             DispatchQueue.main.async {
-                self.beginLoadingInMainThread()
+                self.beginLoadingInMainThread(color: backgroundColor)
             }
         }
     }
@@ -44,8 +49,10 @@ extension NSView: KMLoadingProtocol {
     
     // MARK: - do in main thread.
     
-    private func beginLoadingInMainThread() {
+    private func beginLoadingInMainThread(color: NSColor = NSColor.clear) {
         let maskView = self.createLoadingMaskView()
+        maskView.wantsLayer = true
+        maskView.layer?.backgroundColor = color.cgColor
         self.addSubview(maskView)
         maskView.frame = self.bounds
         maskView.autoresizingMask = [.width, .height]

+ 38 - 1
PDF Office/PDF Master/Class/Home/ViewController/KMAIOpenPDFFilesVC.swift

@@ -24,7 +24,14 @@ class KMAIOpenPDFFilesVC: NSViewController {
     @IBOutlet weak var importFromScannerLabel: NSTextField!
     @IBOutlet weak var importFromScannerImageView: NSImageView!
     var deviceBrowserWC: KMDeviceBrowserWindowController?
-
+    
+    @IBOutlet weak var leftBox: NSBox!
+    @IBOutlet weak var rightBox: NSBox!
+    @IBOutlet weak var leftBoxRightConstraint: NSLayoutConstraint!
+    @IBOutlet weak var rightBoxLeftConstraint: NSLayoutConstraint!
+    @IBOutlet weak var rightBoxTopConstraint: NSLayoutConstraint!
+    @IBOutlet weak var rightBoxHeightConstraint: NSLayoutConstraint!
+    
     override func viewDidLoad() {
         super.viewDidLoad()
         // Do view setup here.
@@ -326,6 +333,36 @@ class KMAIOpenPDFFilesVC: NSViewController {
         }
     }
     
+    func refreshLayout(isLimit limit: Bool) -> Void {
+        if limit {
+            if self.rightBoxTopConstraint != nil {
+                self.rightBoxTopConstraint.constant = 348 + 40
+            }
+            if self.leftBoxRightConstraint != nil {
+                self.leftBoxRightConstraint.constant = 32
+            }
+            if self.rightBoxLeftConstraint != nil {
+                self.rightBoxLeftConstraint.constant = 32
+            }
+            if self.rightBoxHeightConstraint != nil {
+                self.rightBoxHeightConstraint.constant = leftBox.frame.width
+            }
+        } else {
+            if self.rightBoxTopConstraint != nil {
+                self.rightBoxTopConstraint.constant = 40
+            }
+            if self.leftBoxRightConstraint != nil {
+                self.leftBoxRightConstraint.constant = 380
+            }
+            if self.rightBoxLeftConstraint != nil {
+                self.rightBoxLeftConstraint.constant = 32 + leftBox.frame.width + 20
+            }
+            if self.rightBoxHeightConstraint != nil {
+                self.rightBoxHeightConstraint.constant = 328
+            }
+        }
+    }
+    
     // MARK: Action
     
     @IBAction func createPDFAction(_ sender: NSButton) {

+ 31 - 21
PDF Office/PDF Master/Class/Home/ViewController/KMAIOpenPDFFilesVC.xib

@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
+        <deployment identifier="macosx"/>
         <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
@@ -10,6 +11,8 @@
                 <outlet property="creatPDFLabel" destination="ymv-tl-S9B" id="qbX-IF-uF5"/>
                 <outlet property="importFromScannerImageView" destination="ZkD-G1-ufi" id="q7O-PU-MPZ"/>
                 <outlet property="importFromScannerLabel" destination="6VI-X2-0F4" id="zsM-J0-dFn"/>
+                <outlet property="leftBox" destination="0Nz-PR-SKo" id="chj-Re-Rn8"/>
+                <outlet property="leftBoxRightConstraint" destination="NN5-z5-Oan" id="uWk-SG-l1t"/>
                 <outlet property="newBlankPageImageView" destination="vaH-Gg-RE3" id="tJh-vm-5gT"/>
                 <outlet property="newBlankPageLabel" destination="8tw-6D-nG5" id="QDW-PG-c2Q"/>
                 <outlet property="newFromFilesImageView" destination="Vo2-Q5-D0s" id="37d-ie-cRN"/>
@@ -17,6 +20,10 @@
                 <outlet property="openPDFFilesImageView" destination="G8R-Cd-sSC" id="FHu-Vv-wv5"/>
                 <outlet property="openPDFFilesLabel" destination="Kwa-7o-t9g" id="Kep-vK-wn3"/>
                 <outlet property="orDropFilesHereToOpenLabel" destination="Q7o-W4-U5i" id="h2T-uH-eYa"/>
+                <outlet property="rightBox" destination="rkU-6X-4PB" id="my5-yD-P2H"/>
+                <outlet property="rightBoxHeightConstraint" destination="zWD-RA-Sha" id="iiV-9o-beG"/>
+                <outlet property="rightBoxLeftConstraint" destination="De8-if-bLF" id="Hgg-st-HBG"/>
+                <outlet property="rightBoxTopConstraint" destination="XF4-iR-ChB" id="XY8-d7-iEZ"/>
                 <outlet property="selectYourFilesBox" destination="mEy-Af-9bc" id="Pvw-gR-WHT"/>
                 <outlet property="selectYourFilesImageView" destination="iFo-5S-2e6" id="4kU-cr-GPX"/>
                 <outlet property="selectYourFilesLabel" destination="I4g-Mc-xZP" id="tUp-Vx-QnG"/>
@@ -30,13 +37,13 @@
             <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
             <subviews>
                 <box boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="rkU-6X-4PB">
-                    <rect key="frame" x="498" y="40" width="328" height="308"/>
+                    <rect key="frame" x="32" y="40" width="794" height="308"/>
                     <view key="contentView" id="ITd-Xp-Gda">
-                        <rect key="frame" x="0.0" y="0.0" width="328" height="308"/>
+                        <rect key="frame" x="0.0" y="0.0" width="794" height="308"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <subviews>
                             <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ymv-tl-S9B">
-                                <rect key="frame" x="-2" y="280" width="332" height="28"/>
+                                <rect key="frame" x="-2" y="280" width="798" height="28"/>
                                 <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="OvS-AE-U4f">
                                     <font key="font" usesAppearanceFont="YES"/>
                                     <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@@ -44,7 +51,7 @@
                                 </textFieldCell>
                             </textField>
                             <customView translatesAutoresizingMaskIntoConstraints="NO" id="ijL-7x-C3M" customClass="KMDottedLineView" customModule="PDF_Master" customModuleProvider="target">
-                                <rect key="frame" x="0.0" y="184" width="328" height="80"/>
+                                <rect key="frame" x="0.0" y="184" width="794" height="80"/>
                                 <subviews>
                                     <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Vo2-Q5-D0s">
                                         <rect key="frame" x="20" y="16" width="48" height="48"/>
@@ -55,7 +62,7 @@
                                         <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" id="lUO-YD-f4Y"/>
                                     </imageView>
                                     <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="7DP-8M-cyh">
-                                        <rect key="frame" x="78" y="32" width="240" height="16"/>
+                                        <rect key="frame" x="78" y="32" width="706" height="16"/>
                                         <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="gOr-jf-tVk">
                                             <font key="font" metaFont="system"/>
                                             <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@@ -63,7 +70,7 @@
                                         </textFieldCell>
                                     </textField>
                                     <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="DEy-Ef-iCj">
-                                        <rect key="frame" x="0.0" y="0.0" width="328" height="80"/>
+                                        <rect key="frame" x="0.0" y="0.0" width="794" height="80"/>
                                         <buttonCell key="cell" type="bevel" bezelStyle="rounded" alignment="center" imageScaling="proportionallyDown" inset="2" id="FZ7-cc-TD5">
                                             <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                             <font key="font" metaFont="system"/>
@@ -87,7 +94,7 @@
                                 </constraints>
                             </customView>
                             <customView translatesAutoresizingMaskIntoConstraints="NO" id="Lt3-8t-GUS" customClass="KMDottedLineView" customModule="PDF_Master" customModuleProvider="target">
-                                <rect key="frame" x="0.0" y="92" width="328" height="80"/>
+                                <rect key="frame" x="0.0" y="92" width="794" height="80"/>
                                 <subviews>
                                     <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="vaH-Gg-RE3">
                                         <rect key="frame" x="20" y="16" width="48" height="48"/>
@@ -98,7 +105,7 @@
                                         <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" id="hSo-f9-vaK"/>
                                     </imageView>
                                     <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="8tw-6D-nG5">
-                                        <rect key="frame" x="78" y="32" width="240" height="16"/>
+                                        <rect key="frame" x="78" y="32" width="706" height="16"/>
                                         <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="UbN-Sa-wRR">
                                             <font key="font" metaFont="system"/>
                                             <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@@ -106,7 +113,7 @@
                                         </textFieldCell>
                                     </textField>
                                     <button verticalHuggingPriority="750" tag="1" translatesAutoresizingMaskIntoConstraints="NO" id="eB0-YT-Ld7">
-                                        <rect key="frame" x="0.0" y="0.0" width="328" height="80"/>
+                                        <rect key="frame" x="0.0" y="0.0" width="794" height="80"/>
                                         <buttonCell key="cell" type="bevel" bezelStyle="rounded" alignment="center" imageScaling="proportionallyDown" inset="2" id="kPc-Fw-cKJ">
                                             <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                             <font key="font" metaFont="system"/>
@@ -130,7 +137,7 @@
                                 </constraints>
                             </customView>
                             <customView translatesAutoresizingMaskIntoConstraints="NO" id="sWW-D6-Ohy" customClass="KMDottedLineView" customModule="PDF_Master" customModuleProvider="target">
-                                <rect key="frame" x="0.0" y="0.0" width="328" height="80"/>
+                                <rect key="frame" x="0.0" y="0.0" width="794" height="80"/>
                                 <subviews>
                                     <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="ZkD-G1-ufi">
                                         <rect key="frame" x="20" y="16" width="48" height="48"/>
@@ -141,7 +148,7 @@
                                         <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" id="Yd6-Gu-GJW"/>
                                     </imageView>
                                     <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="6VI-X2-0F4">
-                                        <rect key="frame" x="78" y="32" width="240" height="16"/>
+                                        <rect key="frame" x="78" y="32" width="706" height="16"/>
                                         <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="wph-cO-qrj">
                                             <font key="font" metaFont="system"/>
                                             <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@@ -149,7 +156,7 @@
                                         </textFieldCell>
                                     </textField>
                                     <button verticalHuggingPriority="750" tag="2" translatesAutoresizingMaskIntoConstraints="NO" id="0sY-bd-bsz">
-                                        <rect key="frame" x="0.0" y="0.0" width="328" height="80"/>
+                                        <rect key="frame" x="0.0" y="0.0" width="794" height="80"/>
                                         <buttonCell key="cell" type="bevel" bezelStyle="rounded" alignment="center" imageScaling="proportionallyDown" inset="2" id="vZ0-SU-FIM">
                                             <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                             <font key="font" metaFont="system"/>
@@ -191,17 +198,17 @@
                     </view>
                     <constraints>
                         <constraint firstAttribute="height" constant="308" id="Gbw-1F-7Pn"/>
-                        <constraint firstAttribute="width" constant="328" id="Q9u-eS-ZxW"/>
+                        <constraint firstAttribute="width" constant="794" id="zWD-RA-Sha"/>
                     </constraints>
                 </box>
                 <box boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="0Nz-PR-SKo">
-                    <rect key="frame" x="32" y="40" width="446" height="308"/>
+                    <rect key="frame" x="32" y="40" width="794" height="308"/>
                     <view key="contentView" id="Ccx-6r-SYL">
-                        <rect key="frame" x="0.0" y="0.0" width="446" height="308"/>
+                        <rect key="frame" x="0.0" y="0.0" width="794" height="308"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <subviews>
                             <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Kwa-7o-t9g">
-                                <rect key="frame" x="-2" y="292" width="450" height="16"/>
+                                <rect key="frame" x="-2" y="292" width="798" height="16"/>
                                 <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="5x9-0z-eD5">
                                     <font key="font" usesAppearanceFont="YES"/>
                                     <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@@ -209,10 +216,10 @@
                                 </textFieldCell>
                             </textField>
                             <customView translatesAutoresizingMaskIntoConstraints="NO" id="VFW-vA-QSU" customClass="KMDottedLineView" customModule="PDF_Master" customModuleProvider="target">
-                                <rect key="frame" x="0.0" y="0.0" width="446" height="264"/>
+                                <rect key="frame" x="0.0" y="0.0" width="794" height="264"/>
                                 <subviews>
                                     <box boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="PfB-2S-9kQ">
-                                        <rect key="frame" x="73" y="50" width="300" height="182"/>
+                                        <rect key="frame" x="247" y="50" width="300" height="182"/>
                                         <view key="contentView" id="8s4-Gn-uV5">
                                             <rect key="frame" x="0.0" y="0.0" width="300" height="182"/>
                                             <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
@@ -313,15 +320,18 @@
                             <constraint firstAttribute="trailing" secondItem="Kwa-7o-t9g" secondAttribute="trailing" id="cyk-wk-nOk"/>
                         </constraints>
                     </view>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="308" id="iQS-FT-iwr"/>
+                    </constraints>
                 </box>
             </subviews>
             <constraints>
                 <constraint firstItem="0Nz-PR-SKo" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="32" id="1yT-Xh-eRe"/>
-                <constraint firstItem="rkU-6X-4PB" firstAttribute="leading" secondItem="0Nz-PR-SKo" secondAttribute="trailing" constant="20" id="9hS-v6-iJ6"/>
+                <constraint firstItem="rkU-6X-4PB" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="32" id="De8-if-bLF"/>
                 <constraint firstAttribute="trailing" secondItem="rkU-6X-4PB" secondAttribute="trailing" constant="32" id="IdV-ca-59L"/>
                 <constraint firstAttribute="bottom" secondItem="rkU-6X-4PB" secondAttribute="bottom" constant="40" id="JAT-NW-dZI"/>
-                <constraint firstItem="rkU-6X-4PB" firstAttribute="top" secondItem="0Nz-PR-SKo" secondAttribute="top" id="MeE-TX-R0j"/>
-                <constraint firstItem="rkU-6X-4PB" firstAttribute="bottom" secondItem="0Nz-PR-SKo" secondAttribute="bottom" id="S51-tD-RFN"/>
+                <constraint firstItem="0Nz-PR-SKo" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" constant="40" id="Kix-7G-Xhq"/>
+                <constraint firstAttribute="trailing" secondItem="0Nz-PR-SKo" secondAttribute="trailing" constant="32" id="NN5-z5-Oan"/>
                 <constraint firstItem="rkU-6X-4PB" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" constant="40" id="XF4-iR-ChB"/>
             </constraints>
             <point key="canvasLocation" x="306" y="226"/>

+ 44 - 0
PDF Office/PDF Master/Class/Home/ViewController/KMHomeViewController+UI.swift

@@ -237,6 +237,48 @@ extension KMHomeViewController {
         }
     }
     
+    func refreshScrollView() -> Void {
+        let rect = self.homeSplitView.frame
+        let rightWidth = Int(rect.width) - 286
+        
+        if self.aiOpenPDFFilesViewController != nil {
+            if rightWidth >= (360 + 20 + 328) {
+                self.rightTopBoxHeightConstraint.constant = 348 + 40
+                self.aiOpenPDFFilesViewController.refreshLayout(isLimit: false)
+                self.homeRightScrollViewView.contentView.scroll(to: NSMakePoint(0, (self.homeRightScrollViewView.documentView?.frame.height)!))
+            } else {
+                self.rightTopBoxHeightConstraint.constant = (348 + 40) * 2
+                self.aiOpenPDFFilesViewController.refreshLayout(isLimit: true)
+                self.homeRightScrollViewView.contentView.scroll(to: NSMakePoint(0, (self.homeRightScrollViewView.documentView?.frame.height)!))
+            }
+        }
+        
+        var contentViewHeight = 0
+        if self.historyFileViewController.showMode == .Thumbnail {
+            if self.historyFileViewController.thumbnailSCrollView != nil {
+                var count = rightWidth/(226 + 32)
+                if count <= 0 {
+                    count = 1
+                }
+                var row = self.historyFileViewController.files.count/count
+                if self.historyFileViewController.files.count%count > 0 {
+                    row += 1
+                }
+                let height2 = (248 + 16) * row
+                contentViewHeight = Int(self.rightTopBox.frame.height + CGFloat(height2) + 76 + self.noneView.frame.height)
+                self.rightBottonHeight.constant = CGFloat(height2) + 76
+            }
+        } else {
+            if self.historyFileViewController.listScrollView != nil {
+                let height2 = self.historyFileViewController.files.count * 72 + 32
+                contentViewHeight = Int(self.rightTopBox.frame.height + CGFloat(height2) + 76 + self.noneView.frame.height)
+                self.rightBottonHeight.constant = CGFloat(height2) + 76
+            }
+        }
+        
+        self.homeRightScrollViewView.documentView!.frame = NSRect(x: 271, y: 0, width: rightWidth, height: contentViewHeight)
+    }
+    
     // MARK: - Private Methods
     
     fileprivate func _showConvertWindow(type: KMPDFConvertType, url: URL, password: String? = nil) {
@@ -363,6 +405,8 @@ extension KMHomeViewController: NSSplitViewDelegate {
         self.rightBox.frame = CGRect(origin: CGPoint(x: 271.0, y: 0), size: CGSize(width: rect.width - 271.0, height: rect.height))
         
         refreshProductActiveSpacing()
+        
+        refreshScrollView()
     }
     
     func splitView(_ splitView: NSSplitView, constrainSplitPosition proposedPosition: CGFloat, ofSubviewAt dividerIndex: Int) -> CGFloat {

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

@@ -122,7 +122,10 @@ import KMAdvertisement
     var progressController: SKProgressController?
     var timer: Timer?
     var timerCounter = 0.0
-
+    
+    @IBOutlet weak var rightBottonHeight: NSLayoutConstraint!
+    @IBOutlet weak var noneView: NSView!
+    
     override func viewWillAppear() {
         super.viewWillAppear()
         if !KMLightMemberManager.manager.isLogin() {
@@ -171,6 +174,17 @@ import KMAdvertisement
         NotificationCenter.default.addObserver(self, selector: #selector(homeFileRectChange(_:)), name: Notification.Name("KMHomeFileRectChange"), object: nil)
     }
     
+    override func viewDidAppear() {
+        super.viewDidAppear()
+        
+//        let rect = self.homeSplitView.frame
+//        let contentViewHeight = Int(self.rightTopBoxHeightConstraint.constant + (self.historyFileViewController.thumbnailSCrollView.contentView.documentRect.height) + 76 + self.noneView.frame.height)
+//        self.rightBottonHeight.constant = CGFloat((self.historyFileViewController.thumbnailSCrollView.contentView.documentRect.height) + 76)
+//        self.homeRightScrollViewView.documentView!.frame = NSRect(x: 271, y: 0, width: Int(rect.width) - 286, height: contentViewHeight)
+        refreshScrollView()
+//        self.homeRightScrollViewView.contentView.scroll(to: NSMakePoint(0, (self.homeRightScrollViewView.documentView?.frame.height)!))
+    }
+    
     func initNetworkingData() {
         KMAdvertisementManager.manager.fetchDataWithResponseObject { [unowned self] data, responseObject, error in
             print("获取广告数据成功")
@@ -349,6 +363,7 @@ import KMAdvertisement
         rightTopBox.fillColor = .white
         rightBottomBox.fillColor = .white
         rightFullBox.fillColor = .white
+        self.noneView.backgroundColor(.white)
 
         self.aiHomeBox.fillColor = .clear
         self.aiHomeBox.cornerRadius = 8.0

+ 20 - 8
PDF Office/PDF Master/Class/Home/ViewController/KMHomeViewController.xib

@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
+        <deployment identifier="macosx"/>
         <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
@@ -41,6 +42,7 @@
                 <outlet property="homeRightScrollViewView" destination="Fsd-Oz-v7c" id="AOG-NU-G8N"/>
                 <outlet property="homeSplitView" destination="yVp-SB-ljO" id="zSV-aW-5He"/>
                 <outlet property="leftBox" destination="ndG-c5-lCg" id="Gx0-kb-H6N"/>
+                <outlet property="noneView" destination="MRe-JP-3Hc" id="bWY-7Y-ysh"/>
                 <outlet property="openPDFBox" destination="IBc-Xn-ACX" id="rfa-yX-fM2"/>
                 <outlet property="openPDFBoxHeight" destination="mSn-iS-alV" id="UaX-Ju-Duw"/>
                 <outlet property="othersBox" destination="dvb-4g-gRa" id="Gm3-he-MwX"/>
@@ -59,6 +61,7 @@
                 <outlet property="product_active_scrollView" destination="Zv8-o9-nPx" id="zS7-N2-btc"/>
                 <outlet property="product_active_spacing" destination="Oxs-0g-w3P" id="VMf-lR-Qvd"/>
                 <outlet property="rightBottomBox" destination="UYd-oU-m2C" id="XYW-TM-vpq"/>
+                <outlet property="rightBottonHeight" destination="8mk-3b-brc" id="89T-Fn-FFM"/>
                 <outlet property="rightBox" destination="47d-27-CfS" id="m44-Ey-vUw"/>
                 <outlet property="rightFullBox" destination="VIr-YS-5o0" id="0cK-du-qOJ"/>
                 <outlet property="rightTopBox" destination="riD-ya-jJ5" id="xFv-Cd-vsI"/>
@@ -207,7 +210,7 @@ Gw
                                                 <scrollView borderType="none" autohidesScrollers="YES" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Zv8-o9-nPx">
                                                     <rect key="frame" x="0.0" y="0.0" width="270" height="652"/>
                                                     <clipView key="contentView" drawsBackground="NO" id="0m5-Ti-Llk">
-                                                        <rect key="frame" x="0.0" y="0.0" width="270" height="652"/>
+                                                        <rect key="frame" x="0.0" y="0.0" width="255" height="652"/>
                                                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                                         <subviews>
                                                             <view translatesAutoresizingMaskIntoConstraints="NO" id="TNl-3V-JVe">
@@ -314,7 +317,7 @@ Gw
                                                         <autoresizingMask key="autoresizingMask"/>
                                                     </scroller>
                                                     <scroller key="verticalScroller" wantsLayer="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="NO" id="eMA-3D-xnv" customClass="KMToolSetScroller" customModule="PDF_Master" customModuleProvider="target">
-                                                        <rect key="frame" x="254" y="0.0" width="16" height="652"/>
+                                                        <rect key="frame" x="255" y="0.0" width="15" height="652"/>
                                                         <autoresizingMask key="autoresizingMask"/>
                                                     </scroller>
                                                 </scrollView>
@@ -528,7 +531,7 @@ Gw
                                 <rect key="frame" x="0.0" y="0.0" width="803" height="820"/>
                                 <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                 <subviews>
-                                    <scrollView borderType="none" autohidesScrollers="YES" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Fsd-Oz-v7c">
+                                    <scrollView borderType="none" autohidesScrollers="YES" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" usesPredominantAxisScrolling="NO" verticalScrollElasticity="none" translatesAutoresizingMaskIntoConstraints="NO" id="Fsd-Oz-v7c">
                                         <rect key="frame" x="0.0" y="0.0" width="803" height="820"/>
                                         <clipView key="contentView" drawsBackground="NO" id="4Wb-9e-EKY">
                                             <rect key="frame" x="0.0" y="0.0" width="803" height="820"/>
@@ -536,7 +539,7 @@ Gw
                                             <subviews>
                                                 <view id="nNN-UX-CRH">
                                                     <rect key="frame" x="0.0" y="0.0" width="803" height="819"/>
-                                                    <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                                                    <autoresizingMask key="autoresizingMask"/>
                                                     <subviews>
                                                         <box boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="riD-ya-jJ5">
                                                             <rect key="frame" x="0.0" y="619" width="803" height="200"/>
@@ -549,12 +552,18 @@ Gw
                                                             </constraints>
                                                         </box>
                                                         <box boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="UYd-oU-m2C">
-                                                            <rect key="frame" x="0.0" y="0.0" width="803" height="619"/>
+                                                            <rect key="frame" x="0.0" y="119" width="803" height="500"/>
                                                             <view key="contentView" id="Ktd-K9-9Kt">
-                                                                <rect key="frame" x="0.0" y="0.0" width="803" height="619"/>
+                                                                <rect key="frame" x="0.0" y="0.0" width="803" height="500"/>
                                                                 <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                                             </view>
+                                                            <constraints>
+                                                                <constraint firstAttribute="height" constant="500" id="8mk-3b-brc"/>
+                                                            </constraints>
                                                         </box>
+                                                        <customView translatesAutoresizingMaskIntoConstraints="NO" id="MRe-JP-3Hc">
+                                                            <rect key="frame" x="0.0" y="0.0" width="803" height="119"/>
+                                                        </customView>
                                                         <box boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="VIr-YS-5o0">
                                                             <rect key="frame" x="0.0" y="0.0" width="803" height="819"/>
                                                             <view key="contentView" id="meL-Tj-h1p">
@@ -564,14 +573,17 @@ Gw
                                                         </box>
                                                     </subviews>
                                                     <constraints>
+                                                        <constraint firstItem="MRe-JP-3Hc" firstAttribute="top" secondItem="UYd-oU-m2C" secondAttribute="bottom" id="2fF-Qa-Ye6"/>
                                                         <constraint firstItem="UYd-oU-m2C" firstAttribute="leading" secondItem="nNN-UX-CRH" secondAttribute="leading" id="CoL-ok-bpJ"/>
+                                                        <constraint firstAttribute="trailing" secondItem="MRe-JP-3Hc" secondAttribute="trailing" id="L9d-K2-E7J"/>
                                                         <constraint firstAttribute="trailing" secondItem="riD-ya-jJ5" secondAttribute="trailing" id="SGj-C4-28a"/>
                                                         <constraint firstItem="riD-ya-jJ5" firstAttribute="leading" secondItem="nNN-UX-CRH" secondAttribute="leading" id="cEs-JL-ChJ"/>
                                                         <constraint firstItem="riD-ya-jJ5" firstAttribute="top" secondItem="nNN-UX-CRH" secondAttribute="top" id="dbJ-hz-GUi"/>
+                                                        <constraint firstAttribute="bottom" secondItem="MRe-JP-3Hc" secondAttribute="bottom" id="dqR-9q-zn2"/>
                                                         <constraint firstItem="VIr-YS-5o0" firstAttribute="top" secondItem="nNN-UX-CRH" secondAttribute="top" id="kP5-ds-LS1"/>
                                                         <constraint firstAttribute="trailing" secondItem="VIr-YS-5o0" secondAttribute="trailing" id="lRx-gI-z4m"/>
+                                                        <constraint firstItem="MRe-JP-3Hc" firstAttribute="leading" secondItem="nNN-UX-CRH" secondAttribute="leading" id="leb-Yb-ZQN"/>
                                                         <constraint firstAttribute="trailing" secondItem="UYd-oU-m2C" secondAttribute="trailing" id="len-PZ-9bi"/>
-                                                        <constraint firstAttribute="bottom" secondItem="UYd-oU-m2C" secondAttribute="bottom" id="qUQ-oy-SZq"/>
                                                         <constraint firstAttribute="bottom" secondItem="VIr-YS-5o0" secondAttribute="bottom" id="tJo-s6-Bni"/>
                                                         <constraint firstItem="VIr-YS-5o0" firstAttribute="leading" secondItem="nNN-UX-CRH" secondAttribute="leading" id="vJs-6s-heY"/>
                                                         <constraint firstItem="UYd-oU-m2C" firstAttribute="top" secondItem="riD-ya-jJ5" secondAttribute="bottom" id="yXX-eC-2uG"/>
@@ -584,7 +596,7 @@ Gw
                                             <rect key="frame" x="1" y="846" width="516" height="15"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                         </scroller>
-                                        <scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="NO" id="uYd-8v-9Da">
+                                        <scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" doubleValue="1" horizontal="NO" id="uYd-8v-9Da" customClass="KMToolSetScroller" customModule="PDF_Master" customModuleProvider="target">
                                             <rect key="frame" x="784" y="1" width="16" height="816"/>
                                             <autoresizingMask key="autoresizingMask"/>
                                         </scroller>

+ 33 - 0
PDF Office/PDF Master/Class/KMLightMember/Controller/ComparativeTable/KMComparativeTableViewController.swift

@@ -174,6 +174,9 @@ class KMComparativeTableViewController: NSWindowController {
     }
     
     func subscribeAction(controller: KMComparativeTableViewController, isRestore: Bool = false) {
+        //loading
+        controller.comparativeView.beginLoading(backgroundColor: NSColor.black.withAlphaComponent(0.2))
+        
         if KMLightMemberManager.manager.isLogin() {
             if isRestore {
                 KMPurchaseManager.manager.restorePurchases { isSuccess in
@@ -182,7 +185,10 @@ class KMComparativeTableViewController: NSWindowController {
                         comparativeMainWindow?.endSheet(controller.window!)
                         comparativeMainWindow = nil
                         controller.close()
+                    } else {
+                        controller.purchasefailed()
                     }
+                    controller.comparativeView.endLoading()
                 }
             } else {
                 KMPurchaseManager.manager.purchaseProduct(productIdentifier: PRODUCT_1) { isSuccess, error in
@@ -198,7 +204,11 @@ class KMComparativeTableViewController: NSWindowController {
                                 _ = KMSubscribeSuccessWindowController.show(window: NSApp.mainWindow!)
                             }
                         }
+                    } else {
+                        controller.purchasefailed()
                     }
+                    //loading
+                    controller.comparativeView.endLoading()
                 }
             }
         } else {
@@ -215,4 +225,27 @@ class KMComparativeTableViewController: NSWindowController {
             }
         }
     }
+    
+    func purchasefailed() {
+        DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.1, execute: {
+            let alert = NSAlert()
+            alert.messageText = NSLocalizedString("购买失败", comment: "")
+            alert.informativeText = NSLocalizedString("", comment: "")
+//            alert.addButton(withTitle: NSLocalizedString("OK", comment: ""))
+            alert.addButton(withTitle: NSLocalizedString("OK", comment: ""))
+            var window = NSApp.mainWindow
+            if NSApp.mainWindow?.sheets.first != nil {
+                window = NSApp.mainWindow?.sheets.first
+            }
+            if window != nil {
+                alert.beginSheetModal(for: window!) { result in
+                    if (result == .alertFirstButtonReturn) {
+
+                    } else if result == .alertSecondButtonReturn {
+                        return
+                    }
+                }
+            }
+        })
+    }
 }

+ 8 - 0
PDF Office/PDF Master/Class/KMLightMember/Controller/ComparativeTable/View/KMComparativeView/KMComparativeView.swift

@@ -136,6 +136,14 @@ class KMComparativeView: KMBaseXibView {
         
         self.textView.textStorage?.setAttributedString(attributedString)
     }
+    
+    override func reloadData() {
+        self.beginLoading(backgroundColor: NSColor.black.withAlphaComponent(0.2))
+        KMInAppPurchaseManager.manager.fetchProducts { [weak self] isSuccess, products, error in
+            self?.endLoading()
+            self?.collectionView.reloadData()
+        }
+    }
 }
 
 extension KMComparativeView: NSCollectionViewDataSource {

+ 15 - 12
PDF Office/PDF Master/Class/KMLightMember/Controller/ComparativeTable/View/KMComparativeView/View/KMComparativeViewCollectionItem.swift

@@ -64,11 +64,14 @@ class KMComparativeViewCollectionItem: NSCollectionViewItem {
     
     func reloadData() {
         if data.count != 0 {
-            self.titleLabel.stringValue = NSLocalizedString(data["title"] as! String, comment: "")
-            self.subtitleLabel.stringValue = NSLocalizedString(data["subtitle"] as! String, comment: "")
-            self.doneButton.title = NSLocalizedString(data["buttonTitle"] as! String, comment: "")
+            let title = NSLocalizedString(data["title"] as! String, comment: "")
+            let subtitle = NSLocalizedString(data["subtitle"] as! String, comment: "")
             let describe = NSLocalizedString(data["describe"] as? String ?? "", comment: "")
-            self.describeLabel.stringValue = describe
+            self.titleLabel.stringValue = title
+            self.subtitleLabel.stringValue = subtitle
+            self.describeLabel.stringValue = "$79.9 \(describe)"
+            self.doneButton.title = NSLocalizedString(data["buttonTitle"] as! String, comment: "")
+            self.doneButton.isHidden = false
             
             if data["type"] as! Int == 1 {
                 self.describeLabel.isHidden = false
@@ -86,13 +89,8 @@ class KMComparativeViewCollectionItem: NSCollectionViewItem {
                     self.iconImageView.isHidden = false
                 }
                 
-                if KMInAppPurchaseManager.manager.availableProducts.count == 0 {
-                    KMInAppPurchaseManager.manager.fetchProducts { [weak self] isSuccess, products, error in
-                        self?.updatePrice()
-                    }
-                } else {
-                    self.updatePrice()
-                }
+                self.updatePrice()
+                
             } else {
                 self.describeLabel.isHidden = true
                 self.iconImageView.isHidden = true
@@ -101,6 +99,11 @@ class KMComparativeViewCollectionItem: NSCollectionViewItem {
                 self.doneButton.border(NSColor(hex: "#DFE1E5"), 1, 20)
                 self.doneButton.contentTintColor = NSColor(hex: "#252629")
                 self.doneButton.font = NSFont.SFProTextRegular(16)
+                if KMLightMemberManager.manager.isLogin() {
+                    self.doneButton.isHidden = true
+                } else {
+                    self.doneButton.isHidden = false
+                }
             }
             self.contentCollectionView.reloadData()
         }
@@ -119,7 +122,7 @@ class KMComparativeViewCollectionItem: NSCollectionViewItem {
                 print("-----------------------------")
                 let currencyCode: String = product.priceLocale.currencyCode ?? "$"
                 let price: String = product.introductoryPrice?.price.description ?? "39.9"
-                let originPrice: String = product.price.description ?? "79.9"
+                let originPrice: String = product.price.description
                 self.subtitleLabel.stringValue = "\(currencyCode) \(price)"
                 self.describeLabel.stringValue = "\(currencyCode) \(originPrice) \(describe)"
             }

+ 34 - 1
PDF Office/PDF Master/Class/KMLightMember/Controller/SubscriptionView/WaterMark/KMSubscribeWaterMarkWindowController.swift

@@ -62,6 +62,7 @@ class KMSubscribeWaterMarkWindowController: NSWindowController {
         
         subscribeWaterMarkWindowController.subscribeAction = { controller in
             print("购买")
+            controller.waterMarkView.beginLoading(backgroundColor: NSColor.black.withAlphaComponent(0.2))
             KMPurchaseManager.manager.purchaseProduct(productIdentifier: PRODUCT_1) { isSuccess, error in
                 if isSuccess {
                     print("购买成功")
@@ -79,12 +80,19 @@ class KMSubscribeWaterMarkWindowController: NSWindowController {
                             }
                         }
                     }
-                } 
+                } else {
+                    print("购买失败")
+                    controller.purchasefailed()
+                    completion(false, false, false)
+                }
+                
+                controller.waterMarkView.endLoading()
             }
         }
         
         subscribeWaterMarkWindowController.restoreAction = { controller in
             print("restore")
+            controller.waterMarkView.beginLoading(backgroundColor: NSColor.black.withAlphaComponent(0.2))
             KMPurchaseManager.manager.restorePurchases { isSuccess in
                 if isSuccess {
                     print("restore成功")
@@ -102,8 +110,10 @@ class KMSubscribeWaterMarkWindowController: NSWindowController {
                     }
                 } else {
                     print("restore失败")
+                    controller.purchasefailed()
                     completion(false, false, false)
                 }
+                controller.waterMarkView.endLoading()
             }
         }
         
@@ -170,4 +180,27 @@ class KMSubscribeWaterMarkWindowController: NSWindowController {
         }
         return KMSubscribeWaterMarkWindowController()
     }
+    
+    func purchasefailed() {
+        DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.1, execute: {
+            let alert = NSAlert()
+            alert.messageText = NSLocalizedString("购买失败", comment: "")
+            alert.informativeText = NSLocalizedString("", comment: "")
+//            alert.addButton(withTitle: NSLocalizedString("OK", comment: ""))
+            alert.addButton(withTitle: NSLocalizedString("OK", comment: ""))
+            var window = NSApp.mainWindow
+            if NSApp.mainWindow?.sheets.first != nil {
+                window = NSApp.mainWindow?.sheets.first
+            }
+            if window != nil {
+                alert.beginSheetModal(for: window!) { result in
+                    if (result == .alertFirstButtonReturn) {
+
+                    } else if result == .alertSecondButtonReturn {
+                        return
+                    }
+                }
+            }
+        })
+    }
 }

+ 4 - 6
PDF Office/PDF Master/Class/KMLightMember/Controller/SubscriptionView/WaterMark/View/KMSubscribeWaterMarkView.swift

@@ -111,12 +111,10 @@ class KMSubscribeWaterMarkView: KMBaseXibView {
         self.restoreButton.isHidden = false
         self.textView.isHidden = false
         
-        if KMInAppPurchaseManager.manager.availableProducts.count == 0 {
-            KMInAppPurchaseManager.manager.fetchProducts { [weak self] isSuccess, products, error in
-                self?.updatePrice()
-            }
-        } else {
-            self.updatePrice()
+        self.beginLoading(backgroundColor: NSColor.black.withAlphaComponent(0.2))
+        KMInAppPurchaseManager.manager.fetchProducts { [weak self] isSuccess, products, error in
+            self?.endLoading()
+            self?.updatePrice()
         }
 #endif
 

+ 2 - 2
PDF Office/PDF Master/Class/KMLightMember/InAppPurchase/Appstore/KMInAppPurchaseManager.swift

@@ -208,7 +208,7 @@ extension KMInAppPurchaseManager: SKPaymentTransactionObserver {
             case .purchased:
                 // 购买成功,进行本地二次验证
                 print("购买成功,进行本地二次验证")
-                self.handleAction(state: .success)
+//                self.handleAction(state: .success)
                 validatePurchase(transaction: transaction)
             case .failed:
                 // 购买失败,处理错误
@@ -217,7 +217,7 @@ extension KMInAppPurchaseManager: SKPaymentTransactionObserver {
             case .restored:
                 // 恢复购买,进行本地二次验证
                 print("恢复购买,进行本地二次验证")
-                self.handleAction(state: .restoreSuccess)
+//                self.handleAction(state: .restoreSuccess)
                 validatePurchase(transaction: transaction)
             default:
                 break