Browse Source

【会员】用户信息页面订阅相关数据完善

lizhe 1 year ago
parent
commit
0b23b88aaa

+ 17 - 0
PDF Office/PDF Master/Class/KMLightMember/Controller/AccountInfo/KMAccountInfoWindowController.swift

@@ -14,6 +14,7 @@ typealias KMAccountInfoWindowControllerCancellationAction = (_ controller: KMAcc
 class KMAccountInfoWindowController: NSWindowController {
 
     @IBOutlet weak var accountInfoView: KMAccountInfoView!
+    @IBOutlet weak var accountViewHeightConstraint: NSLayoutConstraint!
     
     var inputType: DataNavigationViewButtonActionType?
     var cancellAtionAction: KMAccountInfoWindowControllerCancellationAction?
@@ -50,6 +51,8 @@ class KMAccountInfoWindowController: NSWindowController {
                     accountInfoMainWindow = nil
                 }
             }
+            
+            
             window.beginSheet(controller.window!)
             accountInfoController = controller
             accountInfoMainWindow = window
@@ -125,9 +128,23 @@ class KMAccountInfoWindowController: NSWindowController {
                 
             }
         }
+        
+        self.accountInfoView.purchaseInfoAction = { view in
+            NSWorkspace.shared.open(URL(string: "https://www.pdfreaderpro.com/store")!)
+        }
     }
     
     func reloadData() {
+        let state = KMLightMemberManager.manager.purchaseState
+        if state == .unknow {
+            self.accountViewHeightConstraint.constant = 274
+        } else if state == .subscription {
+            self.accountViewHeightConstraint.constant = 411
+        } else if state == .unknow {
+            self.accountViewHeightConstraint.constant = 483
+        }
+        self.accountInfoView.purchaseState = state
+        
         KMRequestServerManager.manager.getUserInfo { [weak self] success, data, error, isLocal in
             if success {
                 self?.accountInfoView.userInfo = data

+ 9 - 4
PDF Office/PDF Master/Class/KMLightMember/Controller/AccountInfo/KMAccountInfoWindowController.xib

@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21701" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
+        <deployment identifier="macosx"/>
         <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21701"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
@@ -8,6 +9,7 @@
         <customObject id="-2" userLabel="File's Owner" customClass="KMAccountInfoWindowController" customModule="PDF_Master" customModuleProvider="target">
             <connections>
                 <outlet property="accountInfoView" destination="lEJ-0F-5yu" id="Psb-5b-4hM"/>
+                <outlet property="accountViewHeightConstraint" destination="AGy-5K-Lb1" id="cbn-uG-fE2"/>
                 <outlet property="window" destination="F0z-JX-Cv5" id="gIp-Ho-8D9"/>
             </connections>
         </customObject>
@@ -16,19 +18,22 @@
         <window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="default" id="F0z-JX-Cv5">
             <windowStyleMask key="styleMask" titled="YES"/>
             <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
-            <rect key="contentRect" x="196" y="240" width="310" height="348"/>
+            <rect key="contentRect" x="196" y="240" width="348" height="483"/>
             <rect key="screenRect" x="0.0" y="0.0" width="2560" height="1415"/>
             <view key="contentView" id="se5-gp-TjO">
-                <rect key="frame" x="0.0" y="0.0" width="310" height="348"/>
+                <rect key="frame" x="0.0" y="0.0" width="348" height="483"/>
                 <autoresizingMask key="autoresizingMask"/>
                 <subviews>
                     <customView translatesAutoresizingMaskIntoConstraints="NO" id="lEJ-0F-5yu" customClass="KMAccountInfoView" customModule="PDF_Master" customModuleProvider="target">
-                        <rect key="frame" x="0.0" y="0.0" width="310" height="348"/>
+                        <rect key="frame" x="0.0" y="0.0" width="348" height="483"/>
+                        <constraints>
+                            <constraint firstAttribute="height" constant="483" id="AGy-5K-Lb1"/>
+                        </constraints>
                     </customView>
                 </subviews>
                 <constraints>
-                    <constraint firstAttribute="bottom" secondItem="lEJ-0F-5yu" secondAttribute="bottom" id="1ps-ps-gW1"/>
                     <constraint firstAttribute="trailing" secondItem="lEJ-0F-5yu" secondAttribute="trailing" id="6oc-Np-dZU"/>
+                    <constraint firstAttribute="bottom" secondItem="lEJ-0F-5yu" secondAttribute="bottom" id="CoK-Qd-hsm"/>
                     <constraint firstItem="lEJ-0F-5yu" firstAttribute="leading" secondItem="se5-gp-TjO" secondAttribute="leading" id="tjC-Lj-h6K"/>
                     <constraint firstItem="lEJ-0F-5yu" firstAttribute="top" secondItem="se5-gp-TjO" secondAttribute="top" id="wOC-QS-0nj"/>
                 </constraints>

+ 77 - 20
PDF Office/PDF Master/Class/KMLightMember/Controller/AccountInfo/View/KMAccountInfoView.swift

@@ -10,6 +10,7 @@ import Cocoa
 typealias KMAccountInfoViewCloseAction = (_ view: KMAccountInfoView) -> Void
 typealias KMAccountInfoViewCancellationAction = (_ view: KMAccountInfoView) -> Void
 typealias KMAccountInfoViewLogOutAction = (_ view: KMAccountInfoView) -> Void
+typealias KMAccountInfoViewPurchaseInfoAction = (_ view: KMAccountInfoView) -> Void
 
 class KMAccountInfoView: KMBaseXibView {
     @IBOutlet weak var titleLabel: NSTextField!
@@ -20,14 +21,23 @@ class KMAccountInfoView: KMBaseXibView {
     @IBOutlet weak var imageViewButton: NSButton!
     @IBOutlet weak var accountDescribeLabel: NSTextField!
     @IBOutlet weak var accountLabel: NSTextField!
-    @IBOutlet weak var logOutView: NSView!
     @IBOutlet weak var closeBox: KMBox!
+    @IBOutlet weak var statusTitleLabel: NSTextField!
+    @IBOutlet weak var statusLabel: NSTextField!
+    @IBOutlet weak var tagLabel: NSTextField!
+    @IBOutlet weak var statusTimeLabel: NSTextField!
+    @IBOutlet weak var purchaseInfoButton: NSButton!
+    @IBOutlet weak var lineView: NSView!
+    @IBOutlet weak var subscribeButton: NSButton!
+    @IBOutlet weak var statusContentView: NSView!
+    @IBOutlet weak var purchaseInfoContentView: NSView!
+    @IBOutlet weak var subscribeButtonContentView: NSView!
     
-    var logOutButton: KMDesignButton!
     
     var closeAction: KMAccountInfoViewCloseAction?
     var cancellationAction: KMAccountInfoViewCancellationAction?
     var logOutAction: KMAccountInfoViewLogOutAction?
+    var purchaseInfoAction: KMAccountInfoViewPurchaseInfoAction?
 
     var userInfo: KMLightMemberUserInfo? {
         didSet {
@@ -35,6 +45,12 @@ class KMAccountInfoView: KMBaseXibView {
         }
     }
     
+    var purchaseState: KMPurchaseManagerState = .unknow {
+        didSet {
+            self.reloadData()
+        }
+    }
+    
     override func draw(_ dirtyRect: NSRect) {
         super.draw(dirtyRect)
 
@@ -73,16 +89,31 @@ class KMAccountInfoView: KMBaseXibView {
         self.infoContentView.backgroundColor(NSColor(hex: "#F7F8FA"))
         self.infoContentView.border(NSColor(hex: "#F7F8FA"), 0, 6)
         
-        self.updateMoreButtonState(select: false)
+        self.purchaseInfoButton.font = NSFont.SFProTextRegular(14)
+        self.purchaseInfoButton.contentTintColor = NSColor(hex: "#1770F4")
+        
+
+        self.statusTitleLabel.textColor = NSColor(hex: "#616469")
+        self.statusTitleLabel.font = NSFont.SFProTextRegular(12.0)
+
+        self.statusLabel.textColor = NSColor(hex: "#252629")
+        self.statusLabel.font = NSFont.SFProTextSemibold(16.0)
         
-        logOutButton = KMDesignButton(withType: .Text)
-        self.logOutView.addSubview(logOutButton.view)
-        self.logOutButton.stringValue = NSLocalizedString("Log Out", comment: "")
-        logOutButton.view.frame = self.logOutView.bounds
-        logOutButton.view.autoresizingMask = [.width, .height]
-        logOutButton.target = self
-        logOutButton.action = #selector(logOutButtonAction)
-        logOutButton.button(type: .Sec, size: .m)
+        self.statusTimeLabel.textColor = NSColor(hex: "#616469")
+        self.statusTimeLabel.font = NSFont.SFProTextRegular(12.0)
+        
+        self.subscribeButton.contentTintColor = NSColor(hex: "#FFFFFF")
+        self.subscribeButton.backgroundColor(NSColor(hex: "#FF852E"))
+        self.subscribeButton.font = NSFont.SFProTextRegular(16)
+        self.subscribeButton.border(NSColor.clear, 0, 20)
+        
+        self.tagLabel.font = NSFont.SFProTextRegular(12)
+        self.tagLabel.textColor = NSColor(hex: "#252629")
+        self.tagLabel.backgroundColor(NSColor(hex: "#F7F8FA"))
+        self.tagLabel.border(NSColor(hex: "#DFE1E5"), 1, 4)
+        
+        self.lineView.backgroundColor(NSColor(hex: "#ECECEC"))
+        self.updateMoreButtonState(select: false)
     }
     
     override func reloadData() {
@@ -92,6 +123,20 @@ class KMAccountInfoView: KMBaseXibView {
             self.accountLabel.stringValue = userInfo!.email
             self.imageViewButton.title = userInfo?.email.substring(to: 1) ?? ""
         }
+        
+        if purchaseState == .unknow {
+            self.statusContentView.isHidden = true
+            self.purchaseInfoContentView.isHidden = true
+            self.subscribeButtonContentView.isHidden = true
+        } else if purchaseState == .subscription {
+            self.statusContentView.isHidden = false
+            self.purchaseInfoContentView.isHidden = false
+            self.subscribeButtonContentView.isHidden = true
+        } else {
+            self.statusContentView.isHidden = false
+            self.purchaseInfoContentView.isHidden = false
+            self.subscribeButtonContentView.isHidden = false
+        }
     }
     
     override func updateLanguage() {
@@ -101,7 +146,13 @@ class KMAccountInfoView: KMBaseXibView {
         
         self.titleLabel.stringValue = NSLocalizedString("Account Information", comment: "")
         
-        self.logOutButton.stringValue = NSLocalizedString("Log Out", comment: "")
+//        self.logOutButton.stringValue = NSLocalizedString("Log Out", comment: "")
+        
+        let timeString = NSLocalizedString("2023/01/25\nTrial expires", comment: "")
+        let paragraphStyle = NSMutableParagraphStyle()
+        paragraphStyle.lineHeightMultiple = 1.32
+        paragraphStyle.alignment = .right
+        self.statusTimeLabel.attributedStringValue = NSMutableAttributedString(string: NSLocalizedString(timeString, comment: ""), attributes: [NSAttributedString.Key.paragraphStyle: paragraphStyle])
     }
 }
 
@@ -128,7 +179,7 @@ extension KMAccountInfoView: KMAccountInfoViewAction {
     
     @IBAction func moreButtonAction(_ sender: NSButton) {
         self.updateMoreButtonState(select: true)
-        let vc: KMHomePopViewController = KMHomePopViewController().initWithPopViewDataArr([NSLocalizedString("Cancellation", comment: "")])
+        let vc: KMHomePopViewController = KMHomePopViewController().initWithPopViewDataArr([NSLocalizedString("Log out", comment: ""), NSLocalizedString("Cancellation", comment: "")])
         let createFilePopover: NSPopover = NSPopover.init()
         createFilePopover.contentViewController = vc
         createFilePopover.delegate = self
@@ -140,17 +191,23 @@ extension KMAccountInfoView: KMAccountInfoViewAction {
 //        vc.customBoxWidthLayoutConstraint.constant = sender.frame.width
         vc.downCallback = { [unowned self] (downEntered: Bool, count: String) -> Void in
             if downEntered {
-                createFilePopover.close()
-                
-                guard let callBack = self.cancellationAction else { return }
-                
-                callBack(self)
+                if count == "Cancellation" {
+                    createFilePopover.close()
+                    
+                    guard let callBack = self.cancellationAction else { return }
+                    
+                    callBack(self)
+                } else if count == "Log out" {
+                    guard let callBack = logOutAction else { return }
+                    
+                    callBack(self)
+                }
             }
         }
     }
     
-    @IBAction func logOutButtonAction(_ sender: Any) {
-        guard let callBack = logOutAction else { return }
+    @IBAction func purchaseButtonAction(_ sender: Any) {
+        guard let callBack = purchaseInfoAction else { return }
         
         callBack(self)
     }

+ 154 - 25
PDF Office/PDF Master/Class/KMLightMember/Controller/AccountInfo/View/KMAccountInfoView.xib

@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21701" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
+        <deployment identifier="macosx"/>
         <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21701"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
@@ -13,19 +14,28 @@
                 <outlet property="closeButton" destination="Amy-OB-Mza" id="9R5-gn-vVI"/>
                 <outlet property="imageViewButton" destination="8gX-ju-NH5" id="zaq-tO-ADt"/>
                 <outlet property="infoContentView" destination="FM4-aP-xFU" id="UOr-fX-6Zg"/>
-                <outlet property="logOutView" destination="OhA-Fv-hq1" id="A6P-Zg-2R8"/>
+                <outlet property="lineView" destination="WMg-Cr-JJr" id="qD5-Ls-DrK"/>
                 <outlet property="moreButton" destination="t75-lC-90r" id="xu0-vh-wtQ"/>
+                <outlet property="purchaseInfoButton" destination="5PX-6O-xK8" id="nmu-lh-qmx"/>
+                <outlet property="purchaseInfoContentView" destination="ftd-cD-kBx" id="wju-0o-2fa"/>
+                <outlet property="statusContentView" destination="9AV-k7-nob" id="q6D-7t-UXt"/>
+                <outlet property="statusLabel" destination="xqM-Bi-zV4" id="KSF-S7-R3G"/>
+                <outlet property="statusTimeLabel" destination="hNa-H6-poH" id="b5k-1e-jIY"/>
+                <outlet property="statusTitleLabel" destination="QSv-Q9-wi2" id="pcQ-1L-Zjt"/>
+                <outlet property="subscribeButton" destination="6uz-0m-698" id="Dlq-ns-XT2"/>
+                <outlet property="subscribeButtonContentView" destination="l6v-gx-NaZ" id="LUP-wd-tnT"/>
+                <outlet property="tagLabel" destination="RfD-v6-uJu" id="N9T-ta-Ccs"/>
                 <outlet property="titleLabel" destination="wzN-5h-FkM" id="e2e-2a-3Lx"/>
             </connections>
         </customObject>
         <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
         <customObject id="-3" userLabel="Application" customClass="NSObject"/>
         <customView id="c22-O7-iKe">
-            <rect key="frame" x="0.0" y="0.0" width="310" height="348"/>
+            <rect key="frame" x="0.0" y="0.0" width="348" height="483"/>
             <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
             <subviews>
                 <box boxType="custom" borderWidth="0.0" cornerRadius="4" translatesAutoresizingMaskIntoConstraints="NO" id="fOd-XX-43K" customClass="KMBox" customModule="PDF_Master" customModuleProvider="target">
-                    <rect key="frame" x="8" y="328" width="12" height="12"/>
+                    <rect key="frame" x="8" y="461" width="12" height="12"/>
                     <view key="contentView" id="Qwz-rh-8Tv">
                         <rect key="frame" x="0.0" y="0.0" width="12" height="12"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
@@ -36,7 +46,7 @@
                     </constraints>
                 </box>
                 <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Amy-OB-Mza">
-                    <rect key="frame" x="8" y="328" width="12" height="12"/>
+                    <rect key="frame" x="8" y="461" width="12" height="12"/>
                     <constraints>
                         <constraint firstAttribute="width" constant="12" id="JMt-xb-LqK"/>
                         <constraint firstAttribute="height" constant="12" id="c7Q-qR-TGj"/>
@@ -50,18 +60,21 @@
                     </connections>
                 </button>
                 <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="wzN-5h-FkM">
-                    <rect key="frame" x="53" y="281" width="205" height="27"/>
+                    <rect key="frame" x="83" y="415" width="182" height="28"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="28" id="hwe-Db-IjI"/>
+                    </constraints>
                     <textFieldCell key="cell" lineBreakMode="clipping" title="Account Information" id="MI1-Oq-p89">
-                        <font key="font" metaFont="system" size="23"/>
+                        <font key="font" metaFont="system" size="20"/>
                         <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
                         <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                     </textFieldCell>
                 </textField>
                 <customView translatesAutoresizingMaskIntoConstraints="NO" id="FM4-aP-xFU">
-                    <rect key="frame" x="24" y="99" width="262" height="150"/>
+                    <rect key="frame" x="24" y="241" width="300" height="158"/>
                     <subviews>
                         <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="t75-lC-90r">
-                            <rect key="frame" x="230" y="118" width="24" height="24"/>
+                            <rect key="frame" x="268" y="126" width="24" height="24"/>
                             <constraints>
                                 <constraint firstAttribute="width" constant="24" id="fan-42-fAl"/>
                                 <constraint firstAttribute="height" constant="24" id="hFQ-nv-2SB"/>
@@ -75,7 +88,7 @@
                             </connections>
                         </button>
                         <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="8gX-ju-NH5">
-                            <rect key="frame" x="107" y="86" width="48" height="48"/>
+                            <rect key="frame" x="126" y="86" width="48" height="48"/>
                             <constraints>
                                 <constraint firstAttribute="height" constant="48" id="4Re-q3-7cZ"/>
                                 <constraint firstAttribute="width" constant="48" id="Ssr-id-8TX"/>
@@ -86,7 +99,7 @@
                             </buttonCell>
                         </button>
                         <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="xZx-LL-ESd">
-                            <rect key="frame" x="83" y="53" width="96" height="17"/>
+                            <rect key="frame" x="102" y="53" width="96" height="17"/>
                             <textFieldCell key="cell" lineBreakMode="clipping" title="Email Address" id="XBY-1W-x0h">
                                 <font key="font" metaFont="system" size="14"/>
                                 <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
@@ -94,8 +107,8 @@
                             </textFieldCell>
                         </textField>
                         <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="RBL-0P-CFH">
-                            <rect key="frame" x="129" y="16" width="4" height="17"/>
-                            <textFieldCell key="cell" lineBreakMode="clipping" id="jfQ-Wh-ayi">
+                            <rect key="frame" x="60" y="20" width="181" height="17"/>
+                            <textFieldCell key="cell" lineBreakMode="clipping" title="pdfoffice@kdanmobile.com" id="jfQ-Wh-ayi">
                                 <font key="font" metaFont="system" size="14"/>
                                 <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
                                 <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
@@ -103,39 +116,155 @@
                         </textField>
                     </subviews>
                     <constraints>
-                        <constraint firstAttribute="height" constant="150" id="0lq-B5-Tez"/>
+                        <constraint firstAttribute="height" constant="158" id="0lq-B5-Tez"/>
                         <constraint firstItem="xZx-LL-ESd" firstAttribute="top" secondItem="8gX-ju-NH5" secondAttribute="bottom" constant="16" id="ERt-u6-VYw"/>
                         <constraint firstItem="RBL-0P-CFH" firstAttribute="centerX" secondItem="FM4-aP-xFU" secondAttribute="centerX" id="RZg-yb-gjj"/>
-                        <constraint firstItem="8gX-ju-NH5" firstAttribute="top" secondItem="FM4-aP-xFU" secondAttribute="top" constant="16" id="VSC-8e-MWQ"/>
-                        <constraint firstAttribute="bottom" secondItem="RBL-0P-CFH" secondAttribute="bottom" constant="16" id="ajF-YF-BFf"/>
+                        <constraint firstItem="8gX-ju-NH5" firstAttribute="top" secondItem="FM4-aP-xFU" secondAttribute="top" constant="24" id="VSC-8e-MWQ"/>
+                        <constraint firstAttribute="bottom" secondItem="RBL-0P-CFH" secondAttribute="bottom" constant="20" id="ajF-YF-BFf"/>
                         <constraint firstItem="8gX-ju-NH5" firstAttribute="centerX" secondItem="FM4-aP-xFU" secondAttribute="centerX" id="g0Q-JS-crg"/>
                         <constraint firstItem="xZx-LL-ESd" firstAttribute="centerX" secondItem="FM4-aP-xFU" secondAttribute="centerX" id="gqp-ht-R0Y"/>
                         <constraint firstItem="t75-lC-90r" firstAttribute="top" secondItem="FM4-aP-xFU" secondAttribute="top" constant="8" id="nbD-nU-ucy"/>
                         <constraint firstAttribute="trailing" secondItem="t75-lC-90r" secondAttribute="trailing" constant="8" id="oRO-91-kmx"/>
                     </constraints>
                 </customView>
-                <customView translatesAutoresizingMaskIntoConstraints="NO" id="OhA-Fv-hq1">
-                    <rect key="frame" x="55" y="32" width="200" height="32"/>
+                <customView translatesAutoresizingMaskIntoConstraints="NO" id="ftd-cD-kBx">
+                    <rect key="frame" x="24" y="100" width="300" height="22"/>
+                    <subviews>
+                        <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="5PX-6O-xK8">
+                            <rect key="frame" x="0.0" y="0.0" width="169" height="22"/>
+                            <buttonCell key="cell" type="square" title="Purchase and Payment Info" bezelStyle="shadowlessSquare" alignment="center" imageScaling="proportionallyDown" inset="2" id="cYo-gl-9pO">
+                                <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                <font key="font" metaFont="system"/>
+                            </buttonCell>
+                            <connections>
+                                <action selector="purchaseButtonAction:" target="-2" id="KvK-9w-bTt"/>
+                            </connections>
+                        </button>
+                    </subviews>
+                    <constraints>
+                        <constraint firstItem="5PX-6O-xK8" firstAttribute="leading" secondItem="ftd-cD-kBx" secondAttribute="leading" id="0HA-BH-wlA"/>
+                        <constraint firstAttribute="bottom" secondItem="5PX-6O-xK8" secondAttribute="bottom" id="3gG-4L-shl"/>
+                        <constraint firstItem="5PX-6O-xK8" firstAttribute="top" secondItem="ftd-cD-kBx" secondAttribute="top" id="Jmf-r0-526"/>
+                        <constraint firstAttribute="height" constant="22" id="Jxy-9d-amZ"/>
+                    </constraints>
+                </customView>
+                <customView translatesAutoresizingMaskIntoConstraints="NO" id="l6v-gx-NaZ">
+                    <rect key="frame" x="24" y="28" width="300" height="40"/>
+                    <subviews>
+                        <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="6uz-0m-698">
+                            <rect key="frame" x="50" y="0.0" width="200" height="40"/>
+                            <constraints>
+                                <constraint firstAttribute="height" constant="40" id="Mpa-mF-kKW"/>
+                                <constraint firstAttribute="width" constant="200" id="aft-Eg-IK7"/>
+                            </constraints>
+                            <buttonCell key="cell" type="square" title="Subscribe" bezelStyle="shadowlessSquare" alignment="center" imageScaling="proportionallyDown" inset="2" id="iF3-pV-hyc">
+                                <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                                <font key="font" metaFont="system"/>
+                            </buttonCell>
+                        </button>
+                    </subviews>
+                    <constraints>
+                        <constraint firstItem="6uz-0m-698" firstAttribute="centerY" secondItem="l6v-gx-NaZ" secondAttribute="centerY" id="257-3D-YoF"/>
+                        <constraint firstItem="6uz-0m-698" firstAttribute="centerX" secondItem="l6v-gx-NaZ" secondAttribute="centerX" id="l8x-EU-8W2"/>
+                        <constraint firstAttribute="height" constant="40" id="yMx-ST-IO5"/>
+                    </constraints>
+                </customView>
+                <customView translatesAutoresizingMaskIntoConstraints="NO" id="WMg-Cr-JJr">
+                    <rect key="frame" x="24" y="130" width="300" height="1"/>
+                    <constraints>
+                        <constraint firstAttribute="height" constant="1" id="0iA-OZ-Odp"/>
+                    </constraints>
+                </customView>
+                <customView translatesAutoresizingMaskIntoConstraints="NO" id="9AV-k7-nob">
+                    <rect key="frame" x="24" y="147" width="300" height="74"/>
+                    <subviews>
+                        <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="QSv-Q9-wi2">
+                            <rect key="frame" x="-2" y="58" width="93" height="16"/>
+                            <textFieldCell key="cell" lineBreakMode="clipping" title="Current Status" id="SA6-LW-oSg">
+                                <font key="font" usesAppearanceFont="YES"/>
+                                <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                            </textFieldCell>
+                        </textField>
+                        <customView translatesAutoresizingMaskIntoConstraints="NO" id="1pg-8T-wNz">
+                            <rect key="frame" x="0.0" y="0.0" width="300" height="50"/>
+                            <subviews>
+                                <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="xqM-Bi-zV4">
+                                    <rect key="frame" x="-2" y="17" width="51" height="16"/>
+                                    <textFieldCell key="cell" lineBreakMode="clipping" title="On Trial" id="crp-kV-aMk">
+                                        <font key="font" usesAppearanceFont="YES"/>
+                                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                    </textFieldCell>
+                                </textField>
+                                <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="hNa-H6-poH">
+                                    <rect key="frame" x="225" y="9" width="77" height="32"/>
+                                    <textFieldCell key="cell" lineBreakMode="clipping" id="bqx-Sm-ykO">
+                                        <font key="font" usesAppearanceFont="YES"/>
+                                        <string key="title">2023/01/25
+Trial expires</string>
+                                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                    </textFieldCell>
+                                </textField>
+                                <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="RfD-v6-uJu">
+                                    <rect key="frame" x="53" y="15" width="100" height="20"/>
+                                    <constraints>
+                                        <constraint firstAttribute="height" constant="20" id="9to-P6-EJO"/>
+                                    </constraints>
+                                    <textFieldCell key="cell" lineBreakMode="clipping" title="  Auto-renewal  " id="KeK-ki-I4m">
+                                        <font key="font" metaFont="system"/>
+                                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                                    </textFieldCell>
+                                </textField>
+                            </subviews>
+                            <constraints>
+                                <constraint firstItem="xqM-Bi-zV4" firstAttribute="centerY" secondItem="1pg-8T-wNz" secondAttribute="centerY" id="1Uu-r0-Q04"/>
+                                <constraint firstItem="xqM-Bi-zV4" firstAttribute="leading" secondItem="1pg-8T-wNz" secondAttribute="leading" id="F3R-oN-U5B"/>
+                                <constraint firstItem="RfD-v6-uJu" firstAttribute="leading" secondItem="xqM-Bi-zV4" secondAttribute="trailing" constant="8" id="Gpr-kE-1dD"/>
+                                <constraint firstItem="hNa-H6-poH" firstAttribute="centerY" secondItem="1pg-8T-wNz" secondAttribute="centerY" id="WLL-Zz-HhA"/>
+                                <constraint firstItem="RfD-v6-uJu" firstAttribute="centerY" secondItem="xqM-Bi-zV4" secondAttribute="centerY" id="j3J-NY-obP"/>
+                                <constraint firstAttribute="trailing" secondItem="hNa-H6-poH" secondAttribute="trailing" id="jGS-Qa-jZA"/>
+                            </constraints>
+                        </customView>
+                    </subviews>
                     <constraints>
-                        <constraint firstAttribute="width" constant="200" id="KES-n4-M1X"/>
-                        <constraint firstAttribute="height" constant="32" id="uQK-O8-zyM"/>
+                        <constraint firstItem="QSv-Q9-wi2" firstAttribute="leading" secondItem="9AV-k7-nob" secondAttribute="leading" id="0Gz-5s-KmR"/>
+                        <constraint firstItem="1pg-8T-wNz" firstAttribute="leading" secondItem="9AV-k7-nob" secondAttribute="leading" id="H0g-jS-eT5"/>
+                        <constraint firstAttribute="height" constant="74" id="Wjw-0L-dSz"/>
+                        <constraint firstItem="1pg-8T-wNz" firstAttribute="top" secondItem="QSv-Q9-wi2" secondAttribute="bottom" constant="8" id="eoz-w9-hTi"/>
+                        <constraint firstAttribute="trailing" secondItem="1pg-8T-wNz" secondAttribute="trailing" id="fOK-4o-iPs"/>
+                        <constraint firstAttribute="bottom" secondItem="1pg-8T-wNz" secondAttribute="bottom" id="sGh-ug-YvR"/>
+                        <constraint firstItem="QSv-Q9-wi2" firstAttribute="top" secondItem="9AV-k7-nob" secondAttribute="top" id="ut7-vG-uwU"/>
                     </constraints>
                 </customView>
             </subviews>
             <constraints>
-                <constraint firstAttribute="bottom" secondItem="OhA-Fv-hq1" secondAttribute="bottom" constant="32" id="9H3-3w-RYM"/>
+                <constraint firstAttribute="trailing" secondItem="l6v-gx-NaZ" secondAttribute="trailing" constant="24" id="67o-Fl-jBi"/>
                 <constraint firstItem="wzN-5h-FkM" firstAttribute="top" secondItem="c22-O7-iKe" secondAttribute="top" constant="40" id="P6g-Wv-Jeq"/>
-                <constraint firstItem="Amy-OB-Mza" firstAttribute="top" secondItem="c22-O7-iKe" secondAttribute="top" constant="8" id="Sws-1x-SeB"/>
-                <constraint firstItem="OhA-Fv-hq1" firstAttribute="centerX" secondItem="c22-O7-iKe" secondAttribute="centerX" id="UPP-YF-r9l"/>
+                <constraint firstItem="WMg-Cr-JJr" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" constant="24" id="QcH-kl-ozy"/>
+                <constraint firstItem="l6v-gx-NaZ" firstAttribute="top" secondItem="ftd-cD-kBx" secondAttribute="bottom" constant="32" id="SV6-WZ-pQo"/>
+                <constraint firstItem="Amy-OB-Mza" firstAttribute="top" secondItem="c22-O7-iKe" secondAttribute="top" constant="10" id="Sws-1x-SeB"/>
                 <constraint firstItem="FM4-aP-xFU" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" constant="24" id="Ulr-Yh-Bjz"/>
                 <constraint firstItem="fOd-XX-43K" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" constant="8" id="Y25-7v-CD2"/>
                 <constraint firstAttribute="trailing" secondItem="FM4-aP-xFU" secondAttribute="trailing" constant="24" id="YCA-vu-F7q"/>
-                <constraint firstItem="fOd-XX-43K" firstAttribute="top" secondItem="c22-O7-iKe" secondAttribute="top" constant="8" id="cgn-Ff-hUb"/>
-                <constraint firstItem="FM4-aP-xFU" firstAttribute="top" secondItem="wzN-5h-FkM" secondAttribute="bottom" constant="32" id="fX1-Dm-2Fw"/>
+                <constraint firstItem="9AV-k7-nob" firstAttribute="top" secondItem="FM4-aP-xFU" secondAttribute="bottom" constant="20" id="a4h-ok-qKR"/>
+                <constraint firstItem="WMg-Cr-JJr" firstAttribute="top" secondItem="9AV-k7-nob" secondAttribute="bottom" constant="16" id="bqD-h1-usB"/>
+                <constraint firstItem="fOd-XX-43K" firstAttribute="top" secondItem="c22-O7-iKe" secondAttribute="top" constant="10" id="cgn-Ff-hUb"/>
+                <constraint firstAttribute="trailing" secondItem="ftd-cD-kBx" secondAttribute="trailing" constant="24" id="dgo-ts-hpg"/>
+                <constraint firstItem="9AV-k7-nob" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" constant="24" id="eEC-5I-s11"/>
+                <constraint firstAttribute="trailing" secondItem="9AV-k7-nob" secondAttribute="trailing" constant="24" id="fuE-Zj-fwG"/>
+                <constraint firstItem="FM4-aP-xFU" firstAttribute="top" secondItem="wzN-5h-FkM" secondAttribute="bottom" constant="16" id="hU4-Uz-s5G"/>
+                <constraint firstItem="ftd-cD-kBx" firstAttribute="top" secondItem="WMg-Cr-JJr" secondAttribute="bottom" constant="8" id="inP-k0-adN"/>
+                <constraint firstItem="l6v-gx-NaZ" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" constant="24" id="kIo-BU-E5u"/>
+                <constraint firstItem="ftd-cD-kBx" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" constant="24" id="knm-gJ-U7h"/>
                 <constraint firstItem="Amy-OB-Mza" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" constant="8" id="tep-pD-Lcj"/>
+                <constraint firstAttribute="trailing" secondItem="WMg-Cr-JJr" secondAttribute="trailing" constant="24" id="uay-Qa-HfL"/>
                 <constraint firstItem="wzN-5h-FkM" firstAttribute="centerX" secondItem="c22-O7-iKe" secondAttribute="centerX" id="vvq-pC-WW8"/>
+                <constraint firstItem="WMg-Cr-JJr" firstAttribute="centerX" secondItem="c22-O7-iKe" secondAttribute="centerX" id="yft-jJ-E3y"/>
             </constraints>
-            <point key="canvasLocation" x="145" y="208"/>
+            <point key="canvasLocation" x="18" y="225.5"/>
         </customView>
     </objects>
     <resources>

+ 2 - 0
PDF Office/PDF Master/Class/KMLightMember/Controller/SubscriptionView/SubscribeSuccess/KMSubscribeSuccessWindowController.xib

@@ -19,6 +19,8 @@
             <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
             <rect key="contentRect" x="196" y="240" width="326" height="346"/>
             <rect key="screenRect" x="0.0" y="0.0" width="2560" height="1415"/>
+            <value key="minSize" type="size" width="326" height="346"/>
+            <value key="maxSize" type="size" width="326" height="346"/>
             <view key="contentView" id="se5-gp-TjO">
                 <rect key="frame" x="0.0" y="0.0" width="326" height="346"/>
                 <autoresizingMask key="autoresizingMask"/>

+ 2 - 0
PDF Office/PDF Master/Class/KMLightMember/Controller/SubscriptionView/WaterMark/KMSubscribeWaterMarkWindowController.xib

@@ -19,6 +19,8 @@
             <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
             <rect key="contentRect" x="196" y="240" width="448" height="511"/>
             <rect key="screenRect" x="0.0" y="0.0" width="2560" height="1415"/>
+            <value key="minSize" type="size" width="448" height="511"/>
+            <value key="maxSize" type="size" width="448" height="511"/>
             <view key="contentView" id="se5-gp-TjO">
                 <rect key="frame" x="0.0" y="0.0" width="448" height="511"/>
                 <autoresizingMask key="autoresizingMask"/>

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

@@ -73,45 +73,6 @@ class KMInAppPurchaseManager: NSObject {
     
     override init() {
         super.init()
-        
-//        if let receiptURL = Bundle.main.appStoreReceiptURL,
-//           let receiptData = try? Data(contentsOf: receiptURL) {
-//            // 定义 Keychain 查询字典
-//            var query: [String: Any] = [
-//                kSecClass as String: kSecClassGenericPassword,
-//                kSecAttrLabel as String: receiptDataLabel,
-//                kSecAttrAccessGroup as String: keychainAccessGroup,
-//                kSecValueData as String: receiptData
-//            ]
-//
-//            // 删除已存在的同名数据
-//            SecItemDelete(query as CFDictionary)
-//
-//            // 将数据存储到 Keychain
-//            let status = SecItemAdd(query as CFDictionary, nil)
-//            if status != errSecSuccess {
-//                // 存储失败处理
-//                // ...
-//            }
-//        }
-        
-//        // 定义 Keychain 查询字典
-//        var query: [String: Any] = [
-//            kSecClass as String: kSecClassGenericPassword,
-//            kSecAttrLabel as String: receiptDataLabel,
-//            kSecAttrAccessGroup as String: keychainAccessGroup,
-//            kSecReturnData as String: true,
-//            kSecMatchLimit as String: kSecMatchLimitOne
-//        ]
-//
-//        // 检索数据
-//        var result: AnyObject?
-//        let status = SecItemCopyMatching(query as CFDictionary, &result)
-//        if status == errSecSuccess, let receiptData = result as? Data {
-//            // 使用检索到的应用收据进行相应的操作
-//            // ...
-//        }
-//
         // 注册购买交易观察者
         SKPaymentQueue.default().add(self)
     }
@@ -388,44 +349,3 @@ extension KMInAppPurchaseManager: SKPaymentTransactionObserver {
         return receipt
     }
 }
-
-/***
- {
-"expires_date" = "2023-06-27 09:28:20 Etc/GMT";
-"expires_date_ms" = 1687858100000;
-"expires_date_pst" = "2023-06-27 02:28:20 America/Los_Angeles";
-"in_app_ownership_type" = PURCHASED;
-"is_in_intro_offer_period" = false;
-"is_trial_period" = false;
-"original_purchase_date" = "2023-06-27 07:27:22 Etc/GMT";
-"original_purchase_date_ms" = 1687850842000;
-"original_purchase_date_pst" = "2023-06-27 00:27:22 America/Los_Angeles";
-"original_transaction_id" = 2000000357748210;
-"product_id" = "com.pdftechnologies.pdfreader.mac.yearly.001";
-"purchase_date" = "2023-06-27 08:28:20 Etc/GMT";
-"purchase_date_ms" = 1687854500000;
-"purchase_date_pst" = "2023-06-27 01:28:20 America/Los_Angeles";
-quantity = 1;
-"transaction_id" = 2000000357808638;
-"web_order_line_item_id" = 2000000030580071;
-},
- {
-"expires_date" = "2023-06-27 08:27:11 Etc/GMT";
-"expires_date_ms" = 1687854431000;
-"expires_date_pst" = "2023-06-27 01:27:11 America/Los_Angeles";
-"in_app_ownership_type" = PURCHASED;
-"is_in_intro_offer_period" = true;
-"is_trial_period" = false;
-"original_purchase_date" = "2023-06-27 07:27:22 Etc/GMT";
-"original_purchase_date_ms" = 1687850842000;
-"original_purchase_date_pst" = "2023-06-27 00:27:22 America/Los_Angeles";
-"original_transaction_id" = 2000000357748210;
-"product_id" = "com.pdftechnologies.pdfreader.mac.yearly.001";
-"purchase_date" = "2023-06-27 07:27:11 Etc/GMT";
-"purchase_date_ms" = 1687850831000;
-"purchase_date_pst" = "2023-06-27 00:27:11 America/Los_Angeles";
-quantity = 1;
-"transaction_id" = 2000000357748210;
-"web_order_line_item_id" = 2000000030580070;
-}
- */

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

@@ -1115,7 +1115,7 @@ import Cocoa
             // Login & Logout
             if KMLightMemberManager.manager.isLogin() {
                 
-            } else {
+            } else if NSApp.mainWindow != nil {
                 var email: String = UserDefaults.standard.value(forKey: "kLoginEmail") as? String ?? ""
                 if email.count == 0 {
                     KMLoginWindowController.show(window: NSApp.mainWindow!, .Batch, .register)