Browse Source

【会员系统】自测内容调整

wanjun 4 months ago
parent
commit
0af5f9b2f1
18 changed files with 296 additions and 299 deletions
  1. 3 1
      PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/AIConfigWindowController.xib
  2. 1 11
      PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/AINewConfigWindowController.swift
  3. 1 1
      PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/AINewConfigWindowController.xib
  4. 20 20
      PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/Views/AIInfoInputView/AIInfoInputView.xib
  5. 2 1
      PDF Office/PDF Master/Class/AIInfo/AIInfoConfig.swift
  6. 3 3
      PDF Office/PDF Master/Class/AIInfo/AIPurchaseWindowController/AIPurchaseWindowController.xib
  7. 1 1
      PDF Office/PDF Master/Class/AIInfo/AITranslateTipWindowController/AITranslateTipWindowController.xib
  8. 19 55
      PDF Office/PDF Master/Class/AIInfo/AIUserInfoController/AIUserInfoController.swift
  9. 21 118
      PDF Office/PDF Master/Class/AIInfo/AIUserInfoController/AIUserInfoController.xib
  10. 31 31
      PDF Office/PDF Master/Class/AIInfo/KMAIRequestServerManager.swift
  11. 5 0
      PDF Office/PDF Master/Class/Purchase/DMG/Verification/KMVerificationMessageViewController.m
  12. 2 4
      PDF Office/PDF Master/MemberCenter/Model/KMMemberCenterManager.swift
  13. 54 22
      PDF Office/PDF Master/MemberCenter/Model/KMMemberInfo.swift
  14. 76 21
      PDF Office/PDF Master/MemberCenter/ViewController/KMUserInfoViewController.swift
  15. 3 3
      PDF Office/PDF Master/MemberCenter/ViewController/KMUserInfoViewController.xib
  16. 52 5
      PDF Office/PDF Master/MemberCenter/ViewModel/KMUserInfoVCModel.swift
  17. 1 1
      PDF Office/PDF Master/MemberCenter/WindowsController/KMCloseVerificationWC.xib
  18. 1 1
      PDF Office/PDF Master/MemberCenter/WindowsController/KMLoginWindowsController.swift

+ 3 - 1
PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/AIConfigWindowController.xib

@@ -58,7 +58,7 @@
             <windowStyleMask key="styleMask" titled="YES" fullSizeContentView="YES"/>
             <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
             <rect key="contentRect" x="196" y="240" width="795" height="551"/>
-            <rect key="screenRect" x="0.0" y="0.0" width="1920" height="1055"/>
+            <rect key="screenRect" x="0.0" y="0.0" width="1800" height="1125"/>
             <view key="contentView" id="se5-gp-TjO">
                 <rect key="frame" x="0.0" y="0.0" width="795" height="551"/>
                 <autoresizingMask key="autoresizingMask"/>
@@ -310,6 +310,7 @@
                                                                 <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                                                                 <size key="minSize" width="348" height="276"/>
                                                                 <size key="maxSize" width="348" height="10000000"/>
+                                                                <color key="insertionPointColor" name="textInsertionPointColor" catalog="System" colorSpace="catalog"/>
                                                             </textView>
                                                         </subviews>
                                                     </clipView>
@@ -498,6 +499,7 @@
                                                                 <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                                                                 <size key="minSize" width="350" height="324"/>
                                                                 <size key="maxSize" width="355" height="10000000"/>
+                                                                <color key="insertionPointColor" name="textInsertionPointColor" catalog="System" colorSpace="catalog"/>
                                                             </textView>
                                                         </subviews>
                                                     </clipView>

+ 1 - 11
PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/AINewConfigWindowController.swift

@@ -291,17 +291,7 @@ protocol AIConfigWindowDelegate: AnyObject {
     }
     
     func chooseAIFunctionWithType(_ aiConfigType: AIConfigType) -> Void {
-//        if AIInfoManager.default().aiInfo.infoDict.keys.count == 0 {
-//#if VERSION_DMG
-//            KMProductCompareWC.shared.orientation = false
-//            KMProductCompareWC.shared.showWindow(nil)
-//#else
-//            AIPurchaseWindowController.currentWC().showWindow(nil)
-//#endif
-//            return;
-//        }
-        if KMMemberInfo.shared.isPermitAI == false {
-            KMMemberInfo.shared.aiSubscription()
+        if KMMemberInfo.shared.aiSubscription() == false {
             return
         }
         

+ 1 - 1
PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/AINewConfigWindowController.xib

@@ -18,7 +18,7 @@
             <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES" fullSizeContentView="YES"/>
             <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
             <rect key="contentRect" x="196" y="240" width="276" height="739"/>
-            <rect key="screenRect" x="0.0" y="0.0" width="1512" height="944"/>
+            <rect key="screenRect" x="0.0" y="0.0" width="1800" height="1125"/>
             <value key="minSize" type="size" width="276" height="739"/>
             <value key="maxSize" type="size" width="276" height="2739"/>
             <view key="contentView" id="se5-gp-TjO">

+ 20 - 20
PDF Office/PDF Master/Class/AIInfo/AIConfigWindowController/Views/AIInfoInputView/AIInfoInputView.xib

@@ -1,8 +1,8 @@
 <?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">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22505" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
         <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22505"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <objects>
@@ -22,7 +22,7 @@
                             <customView translatesAutoresizingMaskIntoConstraints="NO" id="6CO-V7-P4Z">
                                 <rect key="frame" x="0.0" y="0.0" width="238" height="245"/>
                                 <subviews>
-                                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="sz6-fP-Bdb">
+                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="sz6-fP-Bdb">
                                         <rect key="frame" x="6" y="221" width="124" height="16"/>
                                         <textFieldCell key="cell" lineBreakMode="clipping" title="选择需要使用的工具" id="dJu-ok-6Gz">
                                             <font key="font" usesAppearanceFont="YES"/>
@@ -42,7 +42,7 @@
                                     <customView translatesAutoresizingMaskIntoConstraints="NO" id="y7L-XQ-ePy">
                                         <rect key="frame" x="0.0" y="221" width="238" height="24"/>
                                         <subviews>
-                                            <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="2Wj-F1-dBg">
+                                            <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="2Wj-F1-dBg">
                                                 <rect key="frame" x="6" y="4" width="37" height="16"/>
                                                 <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="LAJ-dW-gv1">
                                                     <font key="font" usesAppearanceFont="YES"/>
@@ -59,14 +59,14 @@
                                             </button>
                                             <button translatesAutoresizingMaskIntoConstraints="NO" id="0vw-Pt-XuK">
                                                 <rect key="frame" x="214" y="4" width="16" height="16"/>
-                                                <constraints>
-                                                    <constraint firstAttribute="height" constant="16" id="HeR-Wc-V1d"/>
-                                                    <constraint firstAttribute="width" constant="16" id="XlK-Gq-dro"/>
-                                                </constraints>
                                                 <buttonCell key="cell" type="bevel" bezelStyle="rounded" image="aiTextClose" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="y9h-U2-9FO">
                                                     <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                                     <font key="font" metaFont="system"/>
                                                 </buttonCell>
+                                                <constraints>
+                                                    <constraint firstAttribute="height" constant="16" id="HeR-Wc-V1d"/>
+                                                    <constraint firstAttribute="width" constant="16" id="XlK-Gq-dro"/>
+                                                </constraints>
                                                 <connections>
                                                     <action selector="clearInputStringAction:" target="c22-O7-iKe" id="jab-YX-zEd"/>
                                                 </connections>
@@ -85,7 +85,7 @@
                                     <customView translatesAutoresizingMaskIntoConstraints="NO" id="Tld-qg-AAs">
                                         <rect key="frame" x="0.0" y="32" width="238" height="185"/>
                                         <subviews>
-                                            <textField hidden="YES" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="dSN-RY-s4T">
+                                            <textField hidden="YES" focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="dSN-RY-s4T">
                                                 <rect key="frame" x="10" y="155" width="228" height="32"/>
                                                 <constraints>
                                                     <constraint firstAttribute="width" constant="224" id="6s5-gx-pwz"/>
@@ -139,7 +139,7 @@
                                                         </constraints>
                                                         <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="axesIndependently" image="ic_else_alert" id="Dh6-Iw-zHM"/>
                                                     </imageView>
-                                                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="gTS-09-xht">
+                                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="gTS-09-xht">
                                                         <rect key="frame" x="24" y="8" width="194" height="16"/>
                                                         <constraints>
                                                             <constraint firstAttribute="width" constant="190" id="0MZ-vx-2fb"/>
@@ -191,7 +191,7 @@
                                                     <customView translatesAutoresizingMaskIntoConstraints="NO" id="z3M-0o-bfB">
                                                         <rect key="frame" x="0.0" y="0.0" width="61" height="20"/>
                                                         <subviews>
-                                                            <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsExpansionToolTips="YES" translatesAutoresizingMaskIntoConstraints="NO" id="awg-zk-OOg">
+                                                            <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsExpansionToolTips="YES" translatesAutoresizingMaskIntoConstraints="NO" id="awg-zk-OOg">
                                                                 <rect key="frame" x="6" y="2" width="37" height="16"/>
                                                                 <textFieldCell key="cell" lineBreakMode="truncatingTail" title="Label" id="dZ8-fk-3O1">
                                                                     <font key="font" usesAppearanceFont="YES"/>
@@ -244,7 +244,7 @@
                                                     <customView translatesAutoresizingMaskIntoConstraints="NO" id="Ek7-fa-Yrv">
                                                         <rect key="frame" x="87" y="0.0" width="61" height="20"/>
                                                         <subviews>
-                                                            <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsExpansionToolTips="YES" translatesAutoresizingMaskIntoConstraints="NO" id="afk-d4-8cf">
+                                                            <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsExpansionToolTips="YES" translatesAutoresizingMaskIntoConstraints="NO" id="afk-d4-8cf">
                                                                 <rect key="frame" x="6" y="2" width="37" height="16"/>
                                                                 <textFieldCell key="cell" lineBreakMode="truncatingTail" title="Label" id="ls7-Pa-Kn8">
                                                                     <font key="font" usesAppearanceFont="YES"/>
@@ -308,7 +308,7 @@
                                                         </constraints>
                                                         <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyUpOrDown" image="ic_propertybar_file_pdf" id="9yq-c5-Xp9"/>
                                                     </imageView>
-                                                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsExpansionToolTips="YES" translatesAutoresizingMaskIntoConstraints="NO" id="POe-MA-3Cr">
+                                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsExpansionToolTips="YES" translatesAutoresizingMaskIntoConstraints="NO" id="POe-MA-3Cr">
                                                         <rect key="frame" x="42" y="30" width="172" height="16"/>
                                                         <constraints>
                                                             <constraint firstAttribute="width" constant="168" id="fnM-KA-hiY"/>
@@ -319,7 +319,7 @@
                                                             <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                                                         </textFieldCell>
                                                     </textField>
-                                                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="D1d-zo-pBW">
+                                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="D1d-zo-pBW">
                                                         <rect key="frame" x="42" y="10" width="37" height="16"/>
                                                         <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="AUp-s3-0NI">
                                                             <font key="font" metaFont="system"/>
@@ -327,7 +327,7 @@
                                                             <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                                                         </textFieldCell>
                                                     </textField>
-                                                    <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="l6f-Zr-7WC">
+                                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="l6f-Zr-7WC">
                                                         <rect key="frame" x="83" y="10" width="37" height="16"/>
                                                         <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="pq1-Ar-zaK">
                                                             <font key="font" metaFont="system"/>
@@ -351,14 +351,14 @@
                                             </customView>
                                             <button translatesAutoresizingMaskIntoConstraints="NO" id="Vj8-am-8Gm">
                                                 <rect key="frame" x="218" y="140" width="20" height="20"/>
-                                                <constraints>
-                                                    <constraint firstAttribute="height" constant="20" id="Phs-Z3-91k"/>
-                                                    <constraint firstAttribute="width" constant="20" id="QDu-7B-heo"/>
-                                                </constraints>
                                                 <buttonCell key="cell" type="bevel" bezelStyle="rounded" image="aiPDF_Clear" imagePosition="only" alignment="center" imageScaling="proportionallyDown" inset="2" id="V8Q-CY-OqW">
                                                     <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
                                                     <font key="font" metaFont="system"/>
                                                 </buttonCell>
+                                                <constraints>
+                                                    <constraint firstAttribute="height" constant="20" id="Phs-Z3-91k"/>
+                                                    <constraint firstAttribute="width" constant="20" id="QDu-7B-heo"/>
+                                                </constraints>
                                                 <connections>
                                                     <action selector="removeChooseFile:" target="c22-O7-iKe" id="enL-rL-Sz0"/>
                                                 </connections>
@@ -389,7 +389,7 @@
                                     <customView translatesAutoresizingMaskIntoConstraints="NO" id="rB9-d1-Cdg">
                                         <rect key="frame" x="0.0" y="0.0" width="238" height="32"/>
                                         <subviews>
-                                            <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="x8R-lQ-xRW">
+                                            <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="x8R-lQ-xRW">
                                                 <rect key="frame" x="10" y="8" width="49" height="16"/>
                                                 <textFieldCell key="cell" lineBreakMode="clipping" title="0/2000" id="Geq-53-8fy">
                                                     <font key="font" metaFont="system"/>

+ 2 - 1
PDF Office/PDF Master/Class/AIInfo/AIInfoConfig.swift

@@ -43,11 +43,12 @@ class AIInfoConfig: NSObject {
     var aiActionURL: String {
         get {
 //            #if DEBUG
-            return kVerificationServer
+//            return kVerificationServer
 //            #else
 //            //正式服务器
 //            return "https://store.pdfreaderpro.com"
 //            #endif
+            return "http://139.196.160.101:8081"
         }
     }
 }

+ 3 - 3
PDF Office/PDF Master/Class/AIInfo/AIPurchaseWindowController/AIPurchaseWindowController.xib

@@ -1,8 +1,8 @@
 <?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">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="22505" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
     <dependencies>
         <deployment identifier="macosx"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22505"/>
         <capability name="Named colors" minToolsVersion="9.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
@@ -28,7 +28,7 @@
         <window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" titlebarAppearsTransparent="YES" titleVisibility="hidden" id="F0z-JX-Cv5">
             <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES" fullSizeContentView="YES"/>
             <rect key="contentRect" x="196" y="240" width="490" height="530"/>
-            <rect key="screenRect" x="0.0" y="0.0" width="1440" height="875"/>
+            <rect key="screenRect" x="0.0" y="0.0" width="1800" height="1125"/>
             <view key="contentView" id="se5-gp-TjO">
                 <rect key="frame" x="0.0" y="0.0" width="490" height="530"/>
                 <autoresizingMask key="autoresizingMask"/>

+ 1 - 1
PDF Office/PDF Master/Class/AIInfo/AITranslateTipWindowController/AITranslateTipWindowController.xib

@@ -27,7 +27,7 @@
             <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
             <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
             <rect key="contentRect" x="196" y="240" width="438" height="140"/>
-            <rect key="screenRect" x="0.0" y="0.0" width="1920" height="1055"/>
+            <rect key="screenRect" x="0.0" y="0.0" width="1800" height="1125"/>
             <view key="contentView" id="se5-gp-TjO">
                 <rect key="frame" x="0.0" y="0.0" width="438" height="140"/>
                 <autoresizingMask key="autoresizingMask"/>

+ 19 - 55
PDF Office/PDF Master/Class/AIInfo/AIUserInfoController/AIUserInfoController.swift

@@ -25,19 +25,13 @@ import Cocoa
     
     @IBOutlet weak var creditsContendBox: NSBox!
     @IBOutlet weak var creditsInfoBox: KMBox!
-    @IBOutlet weak var creditsTitleLabel: NSTextField!
     @IBOutlet weak var validCreditLabel: NSTextField!
-    @IBOutlet weak var totalCreditLabel: NSTextField!
-    @IBOutlet weak var alreadCreditBox: NSBox!
-    @IBOutlet weak var alreadyCreditLabel: NSTextField!
-    @IBOutlet weak var timeDescriptionInfoLabel: NSTextField!
-    @IBOutlet weak var dateInfoLabel: NSTextField!
     @IBOutlet weak var creditsBuyNowBox: KMBox!
     @IBOutlet weak var creditsBuyNowLabel: NSTextField!
     @IBOutlet weak var creditsRestoreBtn: HyperLinkButton!
     @IBOutlet weak var creditBuyNowBtn: KMButton!
-    @IBOutlet weak var creditTipBtn: KMButton!
     @IBOutlet weak var showAIRobotBtn: NSButton!
+    @IBOutlet weak var remainLabel: NSTextField!
     
     var popOver: NSPopover!
     
@@ -68,8 +62,6 @@ import Cocoa
         self.titleLabel.stringValue = NSLocalizedString("AI Tools Title", comment: "")
         self.whatNewlabel.stringValue = NSLocalizedString("What‘s New", comment: "") + " →"
         
-        self.creditsTitleLabel.stringValue = NSLocalizedString("Available credits this month", comment: "")
-        self.alreadyCreditLabel.stringValue = NSLocalizedString("Credits to be unlocked: ", comment: "")
         self.creditsBuyNowLabel.stringValue = NSLocalizedString("Buy Now", comment: "")
         
         self.emptyContendBox.isHidden = true
@@ -100,25 +92,6 @@ import Cocoa
         
         self.updateCreditsViewInfo()
         
-        self.creditTipBtn.mouseMoveCallback = {[unowned self] mouseEntered in
-            if mouseEntered {
-                let tipString = NSLocalizedString("Each use of the AI tools costs 1 or more credits.", comment: "")
-          
-                let popViewController = KMToolbarItemPopViewController.init()
-                if self.popOver == nil {
-                    self.popOver = NSPopover.init()
-                }
-                self.popOver.contentViewController = popViewController
-                self.popOver.animates = false
-                self.popOver.behavior = .semitransient
-                self.popOver.contentSize = (popViewController.view.frame.size)
-                popViewController.updateWithHelpTip(helpTip: tipString)
-                self.popOver.show(relativeTo: self.creditTipBtn.frame, of: self.creditTipBtn.superview!, preferredEdge: .maxY)
-            } else {
-                self.popOver.close()
-            }
-        }
-        
         self.emptyTipButton.mouseMoveCallback = {[unowned self] mouseEntered in
             if mouseEntered {
                 let tipString = NSLocalizedString("Each use of the AI tools costs 1 or more credits.", comment: "")
@@ -156,6 +129,11 @@ import Cocoa
         self.emptyBuyNowBox.wantsLayer = true
         self.emptyBuyNowBox.layer?.cornerRadius = 20
         self.emptyBuyNowBox.layer?.masksToBounds = true
+        if KMMemberInfo.shared.ai_status == 1 {
+            self.emptyBuyNowBox.isHidden = true
+        } else {
+            self.emptyBuyNowBox.isHidden = false
+        }
         
         self.emptyBuyNowBtn.wantsLayer = true
         self.emptyBuyNowBtn.layer?.backgroundColor = NSColor.clear.cgColor
@@ -205,12 +183,8 @@ import Cocoa
         
         if KMAppearance.isDarkMode() {
             self.creditsInfoBox.fillColor = NSColor(red: 0, green: 0, blue: 0, alpha: 0.4)
-            self.creditsTitleLabel.textColor = NSColor.white
-            self.alreadCreditBox.fillColor = NSColor(red: 155/255, green: 83/255, blue: 1, alpha: 0.3)
         } else {
             self.creditsInfoBox.fillColor = NSColor(red: 249/255, green: 247/255, blue: 250/255, alpha: 1)
-            self.creditsTitleLabel.textColor = KMAppearance.KMColor_Layout_H0()
-            self.alreadCreditBox.fillColor = NSColor(red: 155/255, green: 83/255, blue: 1, alpha: 0.1)
         }
         
         self.creditsRestoreBtn.title = NSLocalizedString("Enter AI License", comment: "")
@@ -225,24 +199,11 @@ import Cocoa
                 self?.creditBuyNowBtn.layer?.backgroundColor = NSColor.clear.cgColor
             }
         }
-            
-        self.creditsTitleLabel.font = NSFont.SFProTextSemiboldFont(14)
-        
         self.validCreditLabel.font = NSFont.UbuntuBoldFontWithSize(32)
-        self.validCreditLabel.textColor = NSColor(red: 166/255, green: 102/255, blue: 1, alpha: 1)
-        self.totalCreditLabel.font = NSFont.UbuntuMediumFontWithSize(20)
-        self.totalCreditLabel.textColor = KMAppearance.KMColor_Layout_H2()
-        
-        self.alreadCreditBox.borderWidth = 0
-        self.alreadyCreditLabel.font = NSFont.SFProTextRegularFont(13)
-        self.alreadyCreditLabel.textColor = KMAppearance.KMColor_Layout_H1()
-        
-        self.timeDescriptionInfoLabel.textColor = KMAppearance.KMColor_Status_Err()
-        self.timeDescriptionInfoLabel.font = NSFont.SFProTextRegularFont(13)
-        
-        self.dateInfoLabel.textColor = KMAppearance.KMColor_Layout_H2()
-        self.dateInfoLabel.font = NSFont.SFProTextRegularFont(12)
-        
+        self.validCreditLabel.textColor = .blue
+        self.remainLabel.font = NSFont.UbuntuBoldFontWithSize(20)
+        self.remainLabel.textColor = .black
+
         self.creditsRestoreBtn.font = NSFont.SFProTextRegularFont(14)
         self.creditsBuyNowBox.fillColor = NSColor.clear
         self.creditsBuyNowBox.wantsLayer = true
@@ -276,19 +237,14 @@ import Cocoa
         if aiInfo.infoDict.keys.count == 0 {
             return
         }
-        self.validCreditLabel.stringValue = String(format: "%d", aiInfo.totalToken-aiInfo.usedTimes)
-        self.totalCreditLabel.stringValue = "/" + String(format: "%d", aiInfo.totalToken)
-        
-        self.alreadyCreditLabel.stringValue = NSLocalizedString("Credits to be unlocked: ", comment: "") + String(format: "%d", aiInfo.pre_creditToken)
+        self.validCreditLabel.stringValue = String(format: "%d", aiInfo.totalToken-aiInfo.usedTimes + Int32(KMMemberInfo.shared.aiPoint))
         
         let leftDays = String(format: "%ld", aiInfo.remainingDays)
-        self.timeDescriptionInfoLabel.stringValue = String(format: NSLocalizedString("%@ days left on subscription", comment: ""), leftDays)
         
         let dateFormatter = DateFormatter.init()
         dateFormatter.dateFormat = "yyyy.MM.dd"
         let startDateStr = dateFormatter.string(from: aiInfo.startDate)
         let endDateStr = dateFormatter.string(from: aiInfo.endDate)
-        self.dateInfoLabel.stringValue = startDateStr + " - " + endDateStr
         
         self.emptyContendBox.isHidden = true
         self.emptyShowAIBtn.isHidden = true
@@ -324,6 +280,14 @@ import Cocoa
         guard let callBack = self.purchaseHandle else {
             return
         }
+        if KMMemberInfo.shared.isLogin {
+            KMLoginWindowsController.shared.openWindow() { success in
+                if success {
+                    callBack(self)
+                }
+            }
+            return
+        }
         
         let newStatus: Bool = KMCloudServer.isConnectionAvailable()
         if !newStatus {

+ 21 - 118
PDF Office/PDF Master/Class/AIInfo/AIUserInfoController/AIUserInfoController.xib

@@ -8,18 +8,13 @@
     <objects>
         <customObject id="-2" userLabel="File's Owner" customClass="AIUserInfoController" customModule="PDF_Reader_Pro" customModuleProvider="target">
             <connections>
-                <outlet property="alreadCreditBox" destination="wL8-6H-Mln" id="B6C-z9-vOk"/>
-                <outlet property="alreadyCreditLabel" destination="hIB-Pj-wes" id="7Wh-43-bF9"/>
                 <outlet property="contendBox" destination="akw-x7-mRX" id="6Oq-Dr-0is"/>
                 <outlet property="creditBuyNowBtn" destination="hpn-rW-lvk" id="2hn-Oh-eND"/>
-                <outlet property="creditTipBtn" destination="KZA-Yp-MhB" id="xqD-in-37v"/>
                 <outlet property="creditsBuyNowBox" destination="3ww-dO-Gu1" id="kzF-yB-kG5"/>
                 <outlet property="creditsBuyNowLabel" destination="8uq-YH-AiO" id="lyc-pL-Man"/>
                 <outlet property="creditsContendBox" destination="cRO-N6-ubp" id="SNv-MM-M8C"/>
                 <outlet property="creditsInfoBox" destination="mXw-IG-R8O" id="RhP-4S-LBY"/>
                 <outlet property="creditsRestoreBtn" destination="wbW-uf-Ro8" id="aLM-ax-1Gi"/>
-                <outlet property="creditsTitleLabel" destination="YdG-Tk-l0v" id="qI0-OA-lxO"/>
-                <outlet property="dateInfoLabel" destination="Zbs-pI-MoH" id="nq3-wI-nNZ"/>
                 <outlet property="emptyBuyNowBox" destination="snp-Q1-6ab" id="fg5-08-YCs"/>
                 <outlet property="emptyBuyNowBtn" destination="xzZ-jv-ubi" id="4eH-f6-98P"/>
                 <outlet property="emptyBuyNowLabel" destination="48H-5O-CmE" id="OWg-qN-1Tn"/>
@@ -28,10 +23,9 @@
                 <outlet property="emptyShowAIBtn" destination="XLU-ab-HmG" id="nmr-Py-H1V"/>
                 <outlet property="emptyTipButton" destination="uJ1-HE-KIh" id="dbE-HW-Tvg"/>
                 <outlet property="emptyTitleLabel" destination="8m3-0H-Jn2" id="lad-b4-DEX"/>
+                <outlet property="remainLabel" destination="5Ie-gP-WAM" id="Rcu-Fs-KwZ"/>
                 <outlet property="showAIRobotBtn" destination="1oj-bO-SIV" id="nZg-bQ-PI7"/>
-                <outlet property="timeDescriptionInfoLabel" destination="s7r-9O-yQi" id="0uc-fz-Gpu"/>
                 <outlet property="titleLabel" destination="xGE-Qj-Kve" id="JCg-2L-25z"/>
-                <outlet property="totalCreditLabel" destination="DHJ-4U-157" id="fcK-vm-PZs"/>
                 <outlet property="validCreditLabel" destination="8Ut-gB-hN2" id="HGH-Ax-i27"/>
                 <outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
                 <outlet property="whatNewlabel" destination="dmF-GY-xqk" id="vjx-pq-HF9"/>
@@ -224,132 +218,42 @@
                                                 <rect key="frame" x="0.0" y="0.0" width="360" height="178"/>
                                                 <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                                                 <subviews>
-                                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="YdG-Tk-l0v">
-                                                        <rect key="frame" x="130" y="137" width="101" height="17"/>
-                                                        <textFieldCell key="cell" lineBreakMode="clipping" title="available credit" id="PVf-Mg-fDX">
-                                                            <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"/>
-                                                        </textFieldCell>
-                                                    </textField>
-                                                    <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="3no-nh-cQE">
-                                                        <rect key="frame" x="233" y="138" width="16" height="16"/>
-                                                        <constraints>
-                                                            <constraint firstAttribute="width" constant="16" id="XWU-mS-QDn"/>
-                                                            <constraint firstAttribute="height" constant="16" id="nfu-nO-EdR"/>
-                                                        </constraints>
-                                                        <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="aiInfoIcon" id="4G3-ba-ndv"/>
-                                                    </imageView>
-                                                    <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="KZA-Yp-MhB" customClass="KMButton" customModule="PDF_Reader_Pro" customModuleProvider="target">
-                                                        <rect key="frame" x="233" y="138" width="16" height="16"/>
-                                                        <buttonCell key="cell" type="bevel" bezelStyle="rounded" alignment="center" imageScaling="proportionallyDown" inset="2" id="tg2-1W-zFB">
-                                                            <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
-                                                            <font key="font" metaFont="system"/>
-                                                        </buttonCell>
-                                                    </button>
-                                                    <customView translatesAutoresizingMaskIntoConstraints="NO" id="tLy-1k-P2i">
-                                                        <rect key="frame" x="144" y="89" width="72" height="48"/>
+                                                    <customView translatesAutoresizingMaskIntoConstraints="NO" id="6ch-H6-iib">
+                                                        <rect key="frame" x="116" y="52" width="129" height="75"/>
                                                         <subviews>
-                                                            <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="8Ut-gB-hN2">
-                                                                <rect key="frame" x="-2" y="5" width="46" height="38"/>
-                                                                <textFieldCell key="cell" lineBreakMode="clipping" title="50" id="XHY-3k-AmS">
-                                                                    <font key="font" metaFont="systemBold" size="32"/>
+                                                            <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="5Ie-gP-WAM">
+                                                                <rect key="frame" x="-2" y="50" width="133" height="25"/>
+                                                                <textFieldCell key="cell" lineBreakMode="clipping" title="剩余可用点数" id="oab-W0-WEg">
+                                                                    <font key="font" metaFont="systemBold" size="21"/>
                                                                     <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
                                                                     <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                                                                 </textFieldCell>
                                                             </textField>
-                                                            <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="DHJ-4U-157">
-                                                                <rect key="frame" x="40" y="12" width="34" height="24"/>
-                                                                <textFieldCell key="cell" lineBreakMode="clipping" title="/50" id="U9f-eJ-r2m">
-                                                                    <font key="font" metaFont="system" size="20"/>
+                                                            <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="8Ut-gB-hN2">
+                                                                <rect key="frame" x="-2" y="0.0" width="133" height="38"/>
+                                                                <textFieldCell key="cell" lineBreakMode="clipping" alignment="center" title="50" id="XHY-3k-AmS">
+                                                                    <font key="font" metaFont="systemBold" size="32"/>
                                                                     <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
                                                                     <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
                                                                 </textFieldCell>
                                                             </textField>
                                                         </subviews>
                                                         <constraints>
-                                                            <constraint firstItem="8Ut-gB-hN2" firstAttribute="leading" secondItem="tLy-1k-P2i" secondAttribute="leading" id="8FQ-DX-N3S"/>
-                                                            <constraint firstAttribute="height" constant="48" id="AJ2-dI-OyW"/>
-                                                            <constraint firstItem="DHJ-4U-157" firstAttribute="centerY" secondItem="tLy-1k-P2i" secondAttribute="centerY" id="bVQ-BJ-3uX"/>
-                                                            <constraint firstItem="DHJ-4U-157" firstAttribute="leading" secondItem="8Ut-gB-hN2" secondAttribute="trailing" id="eKP-eb-WPT"/>
-                                                            <constraint firstItem="8Ut-gB-hN2" firstAttribute="centerY" secondItem="tLy-1k-P2i" secondAttribute="centerY" id="tpw-1a-Fwf"/>
-                                                            <constraint firstAttribute="trailing" secondItem="DHJ-4U-157" secondAttribute="trailing" id="ykL-ce-SQ5"/>
+                                                            <constraint firstAttribute="trailing" secondItem="5Ie-gP-WAM" secondAttribute="trailing" id="3DI-p4-Wb9"/>
+                                                            <constraint firstItem="5Ie-gP-WAM" firstAttribute="leading" secondItem="6ch-H6-iib" secondAttribute="leading" id="FRb-zh-L5M"/>
+                                                            <constraint firstItem="8Ut-gB-hN2" firstAttribute="top" secondItem="5Ie-gP-WAM" secondAttribute="bottom" constant="12" id="P0Z-yy-R5f"/>
+                                                            <constraint firstItem="5Ie-gP-WAM" firstAttribute="top" secondItem="6ch-H6-iib" secondAttribute="top" id="T0b-H0-ZKt"/>
+                                                            <constraint firstItem="8Ut-gB-hN2" firstAttribute="leading" secondItem="6ch-H6-iib" secondAttribute="leading" id="aKX-6o-gac"/>
+                                                            <constraint firstAttribute="bottom" secondItem="8Ut-gB-hN2" secondAttribute="bottom" id="eq3-op-oDz"/>
+                                                            <constraint firstAttribute="trailing" secondItem="8Ut-gB-hN2" secondAttribute="trailing" id="jLV-x5-2uW"/>
                                                         </constraints>
                                                     </customView>
-                                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="s7r-9O-yQi">
-                                                        <rect key="frame" x="68" y="73" width="224" height="16"/>
-                                                        <textFieldCell key="cell" lineBreakMode="clipping" title="30 days left before the subscription." id="DmZ-Bv-4Ki">
-                                                            <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>
-                                                    <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="doF-hX-U7U">
-                                                        <rect key="frame" x="99" y="56" width="12" height="12"/>
-                                                        <constraints>
-                                                            <constraint firstAttribute="height" constant="12" id="G5B-3Y-NOf"/>
-                                                            <constraint firstAttribute="width" constant="12" id="XuW-DN-Unx"/>
-                                                        </constraints>
-                                                        <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="AItime" id="Mxf-cB-HpL"/>
-                                                    </imageView>
-                                                    <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Zbs-pI-MoH">
-                                                        <rect key="frame" x="113" y="55" width="155" height="16"/>
-                                                        <textFieldCell key="cell" lineBreakMode="clipping" title="2024.01.20 - 2024.02.20" id="s1i-rh-7sB">
-                                                            <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>
-                                                    <box boxType="custom" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="wL8-6H-Mln">
-                                                        <rect key="frame" x="0.0" y="0.0" width="360" height="24"/>
-                                                        <view key="contentView" id="ndM-ZU-LBf">
-                                                            <rect key="frame" x="1" y="1" width="358" height="22"/>
-                                                            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                                                            <subviews>
-                                                                <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="hIB-Pj-wes">
-                                                                    <rect key="frame" x="125" y="3" width="109" height="16"/>
-                                                                    <textFieldCell key="cell" lineBreakMode="clipping" title="Total credits: 100" id="tiG-j0-XJN">
-                                                                        <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>
-                                                            </subviews>
-                                                            <constraints>
-                                                                <constraint firstItem="hIB-Pj-wes" firstAttribute="centerX" secondItem="ndM-ZU-LBf" secondAttribute="centerX" id="Nro-nY-4su"/>
-                                                                <constraint firstItem="hIB-Pj-wes" firstAttribute="centerY" secondItem="ndM-ZU-LBf" secondAttribute="centerY" id="jw2-V3-f79"/>
-                                                            </constraints>
-                                                        </view>
-                                                        <constraints>
-                                                            <constraint firstAttribute="height" constant="24" id="Skt-Vg-3kw"/>
-                                                        </constraints>
-                                                    </box>
                                                 </subviews>
-                                                <constraints>
-                                                    <constraint firstItem="Zbs-pI-MoH" firstAttribute="leading" secondItem="doF-hX-U7U" secondAttribute="trailing" constant="4" id="0Ss-nd-CcE"/>
-                                                    <constraint firstItem="3no-nh-cQE" firstAttribute="bottom" secondItem="KZA-Yp-MhB" secondAttribute="bottom" id="2Nb-WB-tZ2"/>
-                                                    <constraint firstAttribute="trailing" secondItem="wL8-6H-Mln" secondAttribute="trailing" id="9xm-vc-YWO"/>
-                                                    <constraint firstItem="wL8-6H-Mln" firstAttribute="leading" secondItem="xxJ-j6-3lD" secondAttribute="leading" id="B2X-4l-6ce"/>
-                                                    <constraint firstItem="3no-nh-cQE" firstAttribute="leading" secondItem="YdG-Tk-l0v" secondAttribute="trailing" constant="4" id="BT1-8b-a1w"/>
-                                                    <constraint firstItem="YdG-Tk-l0v" firstAttribute="centerX" secondItem="xxJ-j6-3lD" secondAttribute="centerX" id="C9o-Uv-tdz"/>
-                                                    <constraint firstItem="3no-nh-cQE" firstAttribute="leading" secondItem="KZA-Yp-MhB" secondAttribute="leading" id="Cbz-nl-R7z"/>
-                                                    <constraint firstItem="s7r-9O-yQi" firstAttribute="top" secondItem="tLy-1k-P2i" secondAttribute="bottom" id="DON-us-8yp"/>
-                                                    <constraint firstItem="Zbs-pI-MoH" firstAttribute="centerX" secondItem="xxJ-j6-3lD" secondAttribute="centerX" constant="10" id="KNx-K1-AIu"/>
-                                                    <constraint firstItem="wL8-6H-Mln" firstAttribute="centerX" secondItem="xxJ-j6-3lD" secondAttribute="centerX" id="Lxq-u0-Jyj"/>
-                                                    <constraint firstItem="s7r-9O-yQi" firstAttribute="centerX" secondItem="xxJ-j6-3lD" secondAttribute="centerX" id="R4O-o5-IMd"/>
-                                                    <constraint firstItem="tLy-1k-P2i" firstAttribute="top" secondItem="YdG-Tk-l0v" secondAttribute="bottom" id="U6j-Tg-ZBV"/>
-                                                    <constraint firstItem="3no-nh-cQE" firstAttribute="top" secondItem="KZA-Yp-MhB" secondAttribute="top" id="Vd5-ND-Xhr"/>
-                                                    <constraint firstItem="Zbs-pI-MoH" firstAttribute="centerY" secondItem="doF-hX-U7U" secondAttribute="centerY" constant="-1" id="aEc-GT-Mk8"/>
-                                                    <constraint firstAttribute="bottom" secondItem="wL8-6H-Mln" secondAttribute="bottom" id="dIg-Yh-ccd"/>
-                                                    <constraint firstItem="YdG-Tk-l0v" firstAttribute="top" secondItem="xxJ-j6-3lD" secondAttribute="top" constant="24" id="iKS-ve-G3n"/>
-                                                    <constraint firstItem="tLy-1k-P2i" firstAttribute="centerX" secondItem="xxJ-j6-3lD" secondAttribute="centerX" id="kA3-ke-FXk"/>
-                                                    <constraint firstItem="Zbs-pI-MoH" firstAttribute="top" secondItem="s7r-9O-yQi" secondAttribute="bottom" constant="2" id="nzZ-hR-XdD"/>
-                                                    <constraint firstItem="3no-nh-cQE" firstAttribute="trailing" secondItem="KZA-Yp-MhB" secondAttribute="trailing" id="wUc-wh-HId"/>
-                                                    <constraint firstItem="3no-nh-cQE" firstAttribute="centerY" secondItem="YdG-Tk-l0v" secondAttribute="centerY" id="wbw-kY-05Z"/>
-                                                </constraints>
                                             </view>
                                             <constraints>
                                                 <constraint firstAttribute="height" constant="178" id="0pD-T0-Tbz"/>
+                                                <constraint firstItem="6ch-H6-iib" firstAttribute="centerX" secondItem="mXw-IG-R8O" secondAttribute="centerX" id="3nv-XP-ddB"/>
+                                                <constraint firstItem="6ch-H6-iib" firstAttribute="centerY" secondItem="mXw-IG-R8O" secondAttribute="centerY" id="FCi-sf-XdU"/>
                                                 <constraint firstAttribute="width" constant="360" id="ix4-MV-gpm"/>
                                             </constraints>
                                             <color key="fillColor" red="1" green="0.36862745099999999" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
@@ -366,7 +270,7 @@
                                                         <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="axesIndependently" image="AICreditIcon" id="I0p-5s-QZA"/>
                                                     </imageView>
                                                     <customView translatesAutoresizingMaskIntoConstraints="NO" id="4On-El-gaN">
-                                                        <rect key="frame" x="17" y="6" width="85" height="24"/>
+                                                        <rect key="frame" x="27" y="6" width="85" height="24"/>
                                                         <subviews>
                                                             <textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="8uq-YH-AiO">
                                                                 <rect key="frame" x="22" y="4" width="65" height="16"/>
@@ -493,7 +397,6 @@
     </objects>
     <resources>
         <image name="AICreditIcon" width="103" height="20"/>
-        <image name="AItime" width="12" height="12"/>
         <image name="aiIconA" width="16" height="16"/>
         <image name="aiInfoIcon" width="16" height="16"/>
         <image name="creditEmptyIcon" width="112" height="112"/>

+ 31 - 31
PDF Office/PDF Master/Class/AIInfo/KMAIRequestServerManager.swift

@@ -236,8 +236,12 @@ class ResultWrapper: NSObject {
      @param complete 上传完成回调
      */
     private func aiTranslationFileUpload(file: String, complete: @escaping KMRequestServerComplete) {
+        let token: String = KMMemberInfo.shared.access_token
+        if token == "" {
+            return
+        }
         let infoDictionary = Bundle .main.infoDictionary!
-        let urlString = AIInfoConfig().aiActionURL + "/api/AI/uploadTranslate"
+        let urlString = AIInfoConfig().aiActionURL + "/member-system-website/v1/translate/fileUpload"
         let fileData = FileManager.default.contents(atPath: file)
         let params: [String: Any] = ["file": fileData,
                                      "uuid": uuid(),
@@ -249,6 +253,7 @@ class ResultWrapper: NSObject {
             try? formData.appendPart(withFileURL: fileURL, name: "file", fileName: fileURL.lastPathComponent, mimeType: "application/octet-stream")
         } requestSerializer: { requestSerializer in
             requestSerializer.setValue("Apifox/1.0.0 (https://www.apifox.cn)", forHTTPHeaderField: "User-Agent")
+            requestSerializer.setValue("Bearer " + token, forHTTPHeaderField: "Authorization")
         } completion: { task, responseObject, error in
             if responseObject != nil {
                 let data: NSDictionary = responseObject!["data"] as? NSDictionary ?? [:]
@@ -299,9 +304,12 @@ class ResultWrapper: NSObject {
      @param to 结束语言
      */
     func aiTranslationFileTranslateHandle(fileKey: String, from: String, to: String, complete: @escaping KMRequestServerComplete) {
-        
+        let token: String = KMMemberInfo.shared.access_token
+        if token == "" {
+            return
+        }
         let infoDictionary = Bundle .main.infoDictionary!
-        let urlString = AIInfoConfig().aiActionURL + "/api/AI/fileTranslate"
+        let urlString = AIInfoConfig().aiActionURL + "/member-system-website/v1/translate/fileTranslateHandle"
 
         let paraDict = ["fileKey": fileKey,
                         "from": languageAbbreviation(from),
@@ -315,6 +323,7 @@ class ResultWrapper: NSObject {
         var request = URLRequest(url: URL(string: urlString)!,timeoutInterval: Double.infinity)
         request.addValue("Apifox/1.0.0 (https://www.apifox.cn)", forHTTPHeaderField: "User-Agent")
         request.addValue("application/json", forHTTPHeaderField: "Content-Type")
+        request.addValue("Bearer " + token, forHTTPHeaderField: "Authorization")
 
         request.httpMethod = "POST"
         request.httpBody = postData
@@ -370,9 +379,12 @@ class ResultWrapper: NSObject {
      @param to 结束语言
      */
     private func aiTranslationTextTrans(q: String, from: String, to: String, complete: @escaping KMRequestServerComplete) {
-        
+        let token: String = KMMemberInfo.shared.access_token
+        if token == "" {
+            return
+        }
         let infoDictionary = Bundle .main.infoDictionary!
-        let urlString = AIInfoConfig().aiActionURL + "/api/AI/textTranslate"
+        let urlString = AIInfoConfig().aiActionURL + "/member-system-website/v1/translate/textTrans"
         
         var escapedString = q
         escapedString = String(data: escapedString.data(using: .utf8)!, encoding: .utf8)!
@@ -387,6 +399,7 @@ class ResultWrapper: NSObject {
         var request = URLRequest(url: URL(string: urlString)!,timeoutInterval: Double.infinity)
         request.addValue("Apifox/1.0.0 (https://www.apifox.cn)", forHTTPHeaderField: "User-Agent")
         request.addValue("application/json", forHTTPHeaderField: "Content-Type")
+        request.addValue("Bearer " + token, forHTTPHeaderField: "Authorization")
 
         request.httpMethod = "POST"
         request.httpBody = postData
@@ -421,10 +434,13 @@ class ResultWrapper: NSObject {
      @param state  类型
      */
     private func aiRewriting(content: String, state: KMAIRewritingState, complete: @escaping KMRequestServerComplete) {
-        
-        var urlString = AIInfoConfig().aiActionURL + "/api/AI/rewrite"
+        let token: String = KMMemberInfo.shared.access_token
+        if token == "" {
+            return
+        }
+        var urlString = AIInfoConfig().aiActionURL + "/member-system-website/api/rewrite"
         if state == .correctTypos {
-            urlString = AIInfoConfig().aiActionURL + "/api/AI/correctTypos"
+            urlString = AIInfoConfig().aiActionURL + "/member-system-website/api/correct-typos"
         }
         let params: [String: Any] = ["content": content,
                                      "uuid": uuid(),
@@ -435,29 +451,19 @@ class ResultWrapper: NSObject {
             
         } requestSerializer: { requestSerializer in
             requestSerializer.setValue("Apifox/1.0.0 (https://www.apifox.cn)", forHTTPHeaderField: "User-Agent")
+            requestSerializer.setValue("Bearer " + token, forHTTPHeaderField: "Authorization")
         } completion: { task, responseObject, error in
             if responseObject != nil {
                 let data: NSDictionary = responseObject!["data"] as? NSDictionary ?? [:]
                 let code: String = responseObject!["code"] as? String ?? "06005"
                 let message: String = responseObject!["message"] as? String ?? "unknown error"
                 let error = NSError(domain: message, code: Int(code)!)
-//                let result = ResultWrapper(success: true, result: data, message: message, code: Int(code)!, error: error, state: state)
-//                if result.code == 200 {
-//                    result.success = true
-//                    complete(result)
-//                } else {
-//                    result.success = false
-//                    complete(result)
-//                }
                 if Int(code)! == 200 {
                     complete(ResultWrapper(success: true, content: data["content"] as! String))
                 } else {
                     complete(ResultWrapper(success: false, content: message))
                 }
             } else {
-//                let error = NSError(domain: "unknown error", code: 404)
-//                let result = ResultWrapper(success: false, result: [:], message: "unknown error", code: 404, error: error, state: state)
-//                complete(result)
                 complete(ResultWrapper(success: false, content: "unknown error"))
             }
         }
@@ -468,9 +474,12 @@ class ResultWrapper: NSObject {
      @param file  文件路径
      */
     private func extractSummaryFile(file: String, complete: @escaping KMRequestServerComplete) {
-        
+        let token: String = KMMemberInfo.shared.access_token
+        if token == "" {
+            return
+        }
         let infoDictionary = Bundle .main.infoDictionary!
-        let urlString = AIInfoConfig().aiActionURL + "/api/AI/extractSummaryFile"
+        let urlString = AIInfoConfig().aiActionURL + "/member-system-website/api/extract-file-summary"
         let fileData = FileManager.default.contents(atPath: file)
         let params: [String: Any] = ["file": fileData,
                                      "uuid": uuid(),
@@ -481,20 +490,13 @@ class ResultWrapper: NSObject {
             try? formData.appendPart(withFileURL: fileURL, name: "file", fileName: fileURL.lastPathComponent, mimeType: "application/octet-stream")
         } requestSerializer: { requestSerializer in
             requestSerializer.setValue("Apifox/1.0.0 (https://www.apifox.cn)", forHTTPHeaderField: "User-Agent")
+            requestSerializer.setValue("Bearer " + token, forHTTPHeaderField: "Authorization")
         } completion: { task, responseObject, error in
             if responseObject != nil {
                 let data: NSDictionary = responseObject!["data"] as? NSDictionary ?? [:]
                 let code: Int = responseObject!["code"] as? Int ?? 06005
                 let message: String = responseObject!["message"] as? String ?? "unknown error"
                 let error = NSError(domain: message, code: code)
-//                let result = ResultWrapper(success: true, result: data, message: message, code: Int(code)!, error: error, state: .extractSummaryFile)
-//                if result.code == 200 {
-//                    result.success = true
-//                    complete(result)
-//                } else {
-//                    result.success = false
-//                    complete(result)
-//                }
                 if code == 200 {
                     complete(ResultWrapper(success: true, content: data["summary"] as! String))
                 } else {
@@ -502,8 +504,6 @@ class ResultWrapper: NSObject {
                 }
             } else {
                 let error = NSError(domain: "unknown error", code: 404)
-//                let result = ResultWrapper(success: false, result: [:], message: "unknown error", code: 404, error: error, state: .extractSummaryFile)
-//                complete(result)
                 complete(ResultWrapper(success: false, content: "unknown error"))
             }
         }

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

@@ -501,6 +501,11 @@ NSPopoverDelegate>
         self.userButton.frame = CGRectMake(totalWidth, 0, userImageWidth, userImageWidth);
         totalWidth += userImageWidth;
         totalWidth += 8;
+    } else {
+        self.userButton.hidden = NO;
+        self.userButton.frame = CGRectMake(totalWidth, 0, userImageWidth, userImageWidth);
+        totalWidth += userImageWidth;
+        totalWidth += 8;
     }
     if (self.view.superview) {
         self.view.frame = CGRectMake(MAX(0, CGRectGetWidth(self.view.superview.frame)-totalWidth - 8), (CGRectGetHeight(self.view.superview.frame)-CGRectGetHeight(self.view.frame))/2., totalWidth, self.view.frame.size.height);

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

@@ -709,10 +709,8 @@ class KMMemberCenterManager: NSObject {
             return
         }
         
-        let urlString = configuration.activityBaseURL() + "/member-system-sso/user/logOffForUser"
-        let params: [String: Any] = ["code": code,
-                                     "appId": "1"]
-        KMRequestServer.requestServer.request(urlString: urlString, method: .post, params: params) { requestSerializer in
+        let urlString = String(format: "%@/member-system-sso/user/logOffForUser?code=%@&appId=1", configuration.activityBaseURL(), code)
+        KMRequestServer.requestServer.request(urlString: urlString, method: .post, params: nil) { requestSerializer in
             requestSerializer.setValue("Bearer " + token, forHTTPHeaderField: "Authorization")
         } completion: { [weak self] (task, responseObject, error) in
             var dic: NSDictionary = [:]

+ 54 - 22
PDF Office/PDF Master/MemberCenter/Model/KMMemberInfo.swift

@@ -211,6 +211,14 @@ import Cocoa
     var userScenarioType: KMUserScenarioType {
         get {
             let oldAIPoints = AIInfoManager.default().aiInfo.totalToken - AIInfoManager.default().aiInfo.usedTimes // 旧版AI点数
+            
+            let dateFormatter = DateFormatter()
+            dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss"
+            var startTime = Date()
+            if KMMemberInfo.shared.vip_endDate.count > 0 {
+                startTime = dateFormatter.date(from: KMMemberInfo.shared.vip_endDate)!
+            }
+            let currentTime = Date()
 #if VERSION_FREE
 #if VERSION_DMG
     // DMG
@@ -223,40 +231,37 @@ import Cocoa
     // AppStore 免费版本
             if KMMemberInfo.shared.isLogin {
                 if KMMemberInfo.shared.canTrail &&
+                    KMMemberInfo.shared.vip_levels == "1" &&
                     KMMemberInfo.shared.ai_productName == "" &&
                     !IAPProductsManager.default().isAvailableAllFunction() &&
                     !AIInfoManager.default().aiInfoValid {
-                    /** 1、临时邮箱已注册成新账户,未试用过,也未订阅AI;2、APP中已登录该账户;3、未升级APP前,未订阅高级功能也未购买AI点数 */
+                    /** 1、未试用过,也未订阅AI;2、APP中已登录该账户;3、未升级APP前,未订阅高级功能也未购买AI点数 */
                     return .lite_type5  // 已登录(未试用过的免费用户+未订阅AI) -  无订阅+无AI旧剩余点数
-                } else if KMMemberInfo.shared.vip_status == 3 &&
+                } else if KMMemberInfo.shared.vip_status == 4 &&
+                            KMMemberInfo.shared.vip_levels == "1" &&
+                            KMMemberInfo.shared.ai_productName == "" &&
                             !IAPProductsManager.default().isAvailableAllFunction() &&
                             oldAIPoints > 0 {
-                    /** 1、临时邮箱已注册成新账户,试用中试用到期且未付费;2、APP中已登录该账户;3、未升级APP前,未订阅高级功能,有AI旧剩余点数 */
+                    /** 1、试用中试用到期且未付费;2、APP中已登录该账户;3、未升级APP前,未订阅高级功能,有AI旧剩余点数 */
                     return .lite_type6  // 已登录(试用到期且未付费用户+未订阅AI) -  无旧订阅+有AI旧剩余点数
-                } else if KMMemberInfo.shared.vip_levels == "3" &&
-                            KMMemberInfo.shared.vip_paymentModel == "2" &&
-                            KMMemberInfo.shared.vip_maxDeviceNum == 2 {
-                    /** 1、临时邮箱已注册成新账户,已付费Mac&Windows双平台高级版永久版;2、APP中已登录该账户;3、未升级APP前,未订阅高级功能也未购买AI点数 */
+                } else if KMMemberInfo.shared.vip_paymentModel == "2" &&
+                            KMMemberInfo.shared.ai_productName != "" {
+                    /** 1、已付费Mac&Windows双平台高级版永久版;2、APP中已登录该账户;3、未升级APP前,未订阅高级功能也未购买AI点数 */
                     return .lite_type7  // 已登录(新的买断会员+有订阅AI) -  无旧订阅+无AI旧剩余点数
-                } else if KMMemberInfo.shared.vip_status == 3 &&
+                } else if KMMemberInfo.shared.vip_status == 1 &&
                             KMMemberInfo.shared.vip_payType == 1 {
-                    /** 1、临时邮箱已注册成新账户,试用高级版年订阅并自动订阅中;2、APP中已登录该账户;3、未升级APP前,未订阅高级功能,但有购买AI,有剩余点数 */
+                    /** 1、试用高级版年订阅并自动订阅中;2、APP中已登录该账户;3、未升级APP前,未订阅高级功能,但有购买AI,有剩余点数 */
                     return .lite_type8  // 已登录(自动订阅中 + 订阅AI) -  无旧订阅+有AI旧剩余点数
-                } else if KMMemberInfo.shared.vip_levels == "2" &&
-                            KMMemberInfo.shared.vip_cycle == 4 &&
+                } else if KMMemberInfo.shared.vip_status == 1 &&
                             KMMemberInfo.shared.vip_paymentModel == "1" &&
                             KMMemberInfo.shared.vip_payType == 0 {
-                    /** 1、临时邮箱已注册成新账户,已付费标准版年订阅并取消续订;2、APP中已登录该账户;3、未升级APP前,未订阅高级功能也未购买AI点数 */
+                    /** 1、已付费标准版年订阅并取消续订;2、APP中已登录该账户;3、未升级APP前,未订阅高级功能也未购买AI点数 */
                     return .lite_type9  // 已登录(订阅中但取消续订用户) -  无旧订阅+无AI旧剩余点数
-                } else if KMMemberInfo.shared.vip_levels == "2" &&
-                            KMMemberInfo.shared.vip_paymentModel == "2" &&
-                            KMMemberInfo.shared.vip_cycle == 4 &&
-                            KMMemberInfo.shared.vip_status == 2 {
-                    /** 1、临时邮箱已注册成新账户,已订阅标准版年订阅过期;2、APP中已登录该账户;3、未升级APP前,未订阅高级功能也未购买AI点数 */
+                } else if KMMemberInfo.shared.vip_status == 2 {
+                    /** 1、已订阅标准版年订阅过期;2、APP中已登录该账户;3、未升级APP前,未订阅高级功能也未购买AI点数 */
                     return .lite_type10 // 已登录(订阅过期用户) -  无旧订阅+无AI旧剩余点数
-                } else if KMMemberInfo.shared.vip_status == 4 &&
-                            KMMemberInfo.shared.vip_levels == "1" {
-                    /** 1、临时邮箱已注册成新账户,已试用高级版年订阅并取消续订,当前试用过期;2、APP中已登录该账户;3、未升级APP前,未订阅高级功能也未购买AI点数 */
+                } else if KMMemberInfo.shared.vip_status == 4 {
+                    /** 1、已试用高级版年订阅并取消续订,当前试用过期;2、APP中已登录该账户;3、未升级APP前,未订阅高级功能也未购买AI点数 */
                     return .lite_type11 // 已登录(试用过期用户) -  无旧订阅+无AI旧剩余点数
                 }
             } else {
@@ -276,6 +281,14 @@ import Cocoa
             }
 #endif
 #else
+            // 未登录 - 标准版+无AI
+            // 未登录 - 高级版(有购买转档包)+有AI序列码
+            // 已登录(未试用过的免费用户+未订阅AI) -  标准版+无AI旧剩余点数
+            // 已登录(新的买断会员+有订阅AI) -  高级版(有升级转档包)+无AI旧剩余点数
+            // 已登录(全平台高级版年订阅自动订阅中 + 订阅AI) -  无旧订阅+有AI旧剩余点数
+            // 已登录(全平台标准版年订阅订阅中但取消续订用户) -  标准版+无AI旧剩余点数
+            // 已登录(订阅过期用户) -  高级版+无AI旧剩余点数
+
     // AppStore 付费版
             if KMMemberInfo.shared.isLogin {
                 
@@ -395,7 +408,26 @@ import Cocoa
         }
     }
     
-    func aiSubscription() -> Void {
-        
+    func aiSubscription() -> Bool {
+        let oldAIPoints = AIInfoManager.default().aiInfo.totalToken - AIInfoManager.default().aiInfo.usedTimes // 旧版AI点数
+        if oldAIPoints > 0 {
+            return true
+        } else {
+            if KMMemberInfo.shared.isLogin {
+                if KMMemberInfo.shared.aiPoint > 0 {
+                    return true
+                } else {
+                    AIPurchaseWindowController.currentWC().showWindow(nil)
+                    return false
+                }
+            } else {
+                KMLoginWindowsController.shared.openWindow() { success in
+                    if success {
+                        AIPurchaseWindowController.currentWC().showWindow(nil)
+                    }
+                }
+                return false
+            }
+        }
     }
 }

+ 76 - 21
PDF Office/PDF Master/MemberCenter/ViewController/KMUserInfoViewController.swift

@@ -95,9 +95,6 @@ class KMUserInfoViewController: NSViewController {
         emailLabel.stringValue = KMMemberInfo.shared.userEmail
         productLabel.stringValue = NSLocalizedString("PDF Reader Pro Account", tableName: "MemberCenterLocalizable", comment: "")
         membershipLabel.stringValue = NSLocalizedString("Membership Benefits", tableName: "MemberCenterLocalizable", comment: "")
-        lockedLabel.stringValue = NSLocalizedString("Locked", tableName: "MemberCenterLocalizable", comment: "")
-        buyNow1Label.stringValue = NSLocalizedString("Buy Now", tableName: "MemberCenterLocalizable", comment: "")
-        buyNow2Label.stringValue = NSLocalizedString("Buy Now", tableName: "MemberCenterLocalizable", comment: "")
         buyNow3Label.stringValue = NSLocalizedString("Upgrade", tableName: "MemberCenterLocalizable", comment: "")
         accountLabel.stringValue = NSLocalizedString("Account Center", tableName: "MemberCenterLocalizable", comment: "")
         signOutLabel.stringValue = NSLocalizedString("Sign out", tableName: "MemberCenterLocalizable", comment: "")
@@ -106,30 +103,56 @@ class KMUserInfoViewController: NSViewController {
         } else {
             closeAccountLabel.stringValue = NSLocalizedString("Close account", tableName: "MemberCenterLocalizable", comment: "")
         }
+        number4Label.stringValue = NSLocalizedString("4 devices", tableName: "MemberCenterLocalizable", comment: "")
+
+        if KMMemberInfo.shared.vip_maxDeviceNum == 1 {
+            number4Label.stringValue = String.localizedStringWithFormat(NSLocalizedString("%d device", tableName: "MemberCenterLocalizable", comment: ""), KMMemberInfo.shared.vip_maxDeviceNum)
+        } else {
+            number4Label.stringValue = String.localizedStringWithFormat(NSLocalizedString("%d devices", tableName: "MemberCenterLocalizable", comment: ""), KMMemberInfo.shared.vip_maxDeviceNum)
+        }
+        if KMMemberInfo.shared.vip_levels == "2" {
+            number2Label.stringValue = NSLocalizedString("Standard Version", tableName: "MemberCenterLocalizable", comment: "")
+        } else if KMMemberInfo.shared.vip_levels == "3" {
+            number2Label.stringValue = NSLocalizedString("Advanced Version", tableName: "MemberCenterLocalizable", comment: "")
+        } else {
+            number2Label.stringValue = NSLocalizedString("Benefits of functions", tableName: "MemberCenterLocalizable", comment: "")
+        }
+        if KMMemberInfo.shared.vip_paymentModel == "2" {
+            lockedLabel.stringValue = NSLocalizedString("Permanent Plan", tableName: "MemberCenterLocalizable", comment: "")
+        } else if KMMemberInfo.shared.vip_paymentModel == "1" {
+            lockedLabel.stringValue = NSLocalizedString("Annual Plan", tableName: "MemberCenterLocalizable", comment: "")
+        } else {
+            lockedLabel.stringValue = NSLocalizedString("Locked", tableName: "MemberCenterLocalizable", comment: "")
+        }
         if userState == .unPay_UnTrial {
             number1Label.stringValue = NSLocalizedString("150+", tableName: "MemberCenterLocalizable", comment: "")
-            number2Label.stringValue = NSLocalizedString("Benefits of functions", tableName: "MemberCenterLocalizable", comment: "")
             number3Label.stringValue = NSLocalizedString("All-platform available", tableName: "MemberCenterLocalizable", comment: "")
-            number4Label.stringValue = NSLocalizedString("4 devices", tableName: "MemberCenterLocalizable", comment: "")
             number5Label.stringValue = NSLocalizedString("Devices Access", tableName: "MemberCenterLocalizable", comment: "")
+            buyNow1Label.stringValue = NSLocalizedString("开通会员", tableName: "MemberCenterLocalizable", comment: "")
+            buyNow2Label.stringValue = NSLocalizedString("立即试用", tableName: "MemberCenterLocalizable", comment: "")
+        } else if userState == .unPay_UnTrial_old {
+            number1Label.stringValue = NSLocalizedString("", tableName: "MemberCenterLocalizable", comment: "")
+            number3Label.stringValue = NSLocalizedString("Platform", tableName: "MemberCenterLocalizable", comment: "")
+            number5Label.stringValue = NSLocalizedString("Devices Access", tableName: "MemberCenterLocalizable", comment: "")
+            buyNow1Label.stringValue = NSLocalizedString("Upgrade", tableName: "MemberCenterLocalizable", comment: "")
         } else if userState == .permanentAccount {
             number1Label.stringValue = NSLocalizedString("", tableName: "MemberCenterLocalizable", comment: "")
-            number2Label.stringValue = NSLocalizedString("Advanced Version", tableName: "MemberCenterLocalizable", comment: "")
             number3Label.stringValue = NSLocalizedString("Platform", tableName: "MemberCenterLocalizable", comment: "")
-            number4Label.stringValue = NSLocalizedString("2 devices", tableName: "MemberCenterLocalizable", comment: "")
             number5Label.stringValue = NSLocalizedString("Devices Access", tableName: "MemberCenterLocalizable", comment: "")
+            buyNow1Label.stringValue = NSLocalizedString("Upgrade", tableName: "MemberCenterLocalizable", comment: "")
+        } else if userState == .subscribe {
+            number1Label.stringValue = NSLocalizedString("", tableName: "MemberCenterLocalizable", comment: "")
+            number3Label.stringValue = NSLocalizedString("Platform", tableName: "MemberCenterLocalizable", comment: "")
+            number5Label.stringValue = NSLocalizedString("Devices Access", tableName: "MemberCenterLocalizable", comment: "")
+            buyNow1Label.stringValue = NSLocalizedString("Upgrade", tableName: "MemberCenterLocalizable", comment: "")
         } else if userState == .unAutomatic_RemainValid {
             number1Label.stringValue = NSLocalizedString("", tableName: "MemberCenterLocalizable", comment: "")
-            number2Label.stringValue = NSLocalizedString("Standard Version", tableName: "MemberCenterLocalizable", comment: "")
             number3Label.stringValue = NSLocalizedString("Platform", tableName: "MemberCenterLocalizable", comment: "")
-            number4Label.stringValue = NSLocalizedString("4 devices", tableName: "MemberCenterLocalizable", comment: "")
             number5Label.stringValue = NSLocalizedString("Devices Access", tableName: "MemberCenterLocalizable", comment: "")
             buyNow3Label.stringValue = NSLocalizedString("Renew now", tableName: "MemberCenterLocalizable", comment: "")
         } else if userState == .expired {
             number1Label.stringValue = NSLocalizedString("150+", tableName: "MemberCenterLocalizable", comment: "")
-            number2Label.stringValue = NSLocalizedString("Benefits of functions", tableName: "MemberCenterLocalizable", comment: "")
             number3Label.stringValue = NSLocalizedString("All-platform available", tableName: "MemberCenterLocalizable", comment: "")
-            number4Label.stringValue = NSLocalizedString("4 devices", tableName: "MemberCenterLocalizable", comment: "")
             number5Label.stringValue = NSLocalizedString("Devices Access", tableName: "MemberCenterLocalizable", comment: "")
             buyNow2Label.stringValue = NSLocalizedString("Renew now", tableName: "MemberCenterLocalizable", comment: "")
         }
@@ -167,7 +190,6 @@ class KMUserInfoViewController: NSViewController {
         buyNow2ImageView.image = NSImage(named: "BuyNewArrowImage1")
         buyNow3Label.textColor = NSColor(named: "000000")
         buyNow3Label.font = NSFont.SFProTextRegularFont(14)
-        buyNow3ImageView.image = NSImage(named: "BuyNewArrowImage2")
         accountCenterBox.borderColor = NSColor(named: "3091FF") ?? .blue
         accountCenterBox.fillColor = .clear
         accountLabel.textColor = NSColor(named: "065CBC")
@@ -189,6 +211,17 @@ class KMUserInfoViewController: NSViewController {
             buyBox.contentView = buyView1
             buyNow1ImageView.isHidden = false
             buyNow2ImageView.isHidden = false
+            arrow1ImageView.image = NSImage(named: "BuyNewArrowImage1")
+            arrow2ImageView.image = NSImage(named: "BuyNewArrowImage1")
+        } else if userState == .unPay_UnTrial_old {
+            lockedImageView.image = NSImage(named: "UpgradeImage2")
+            centerBackgroud.image = NSImage(named: "ButtonBackgroundImage3")
+            rightsBox.fillColor = NSColor(named: "7094F6_0.1") ?? .white
+            number1ImageView.isHidden = true
+            number1Label.isHidden = false
+            buyBox.contentView = buyView2
+            buyNow1ImageView.isHidden = false
+            buyNow2ImageView.isHidden = false
         } else if userState == .permanentAccount {
             lockedImageView.image = NSImage(named: "UpgradeImage2")
             centerBackgroud.image = NSImage(named: "ButtonBackgroundImage4")
@@ -196,24 +229,32 @@ class KMUserInfoViewController: NSViewController {
             number1ImageView.isHidden = false
             number1Label.isHidden = true
             buyBox.contentView = buyView2
-            buyNow3ImageView.isHidden = true
-        } else if userState == .unAutomatic_RemainValid {
+            arrow3ImageView.image = NSImage(named: "BuyNewArrowImage1")
+        } else if userState == .subscribe {
             lockedImageView.image = NSImage(named: "UpgradeImage2")
-            centerBackgroud.image = NSImage(named: "ButtonBackgroundImage5")
+            centerBackgroud.image = NSImage(named: "ButtonBackgroundImage4")
             rightsBox.fillColor = NSColor(named: "FFFFFF_0.2") ?? .white
             number1ImageView.isHidden = false
             number1Label.isHidden = true
             buyBox.contentView = buyView2
+            buyNow3Box.fillColor = .white
             buyNow3ImageView.isHidden = true
+            arrow3ImageView.image = NSImage(named: "BuyNewArrowImage2")
+        }else if userState == .unAutomatic_RemainValid {
+            lockedImageView.image = NSImage(named: "UpgradeImage2")
+            centerBackgroud.image = NSImage(named: "ButtonBackgroundImage5")
+            rightsBox.fillColor = NSColor(named: "FFFFFF_0.2") ?? .white
+            number1ImageView.isHidden = false
+            number1Label.isHidden = true
+            buyBox.isHidden = true
         } else if userState == .expired {
             lockedImageView.image = NSImage(named: "LockedImage")
             centerBackgroud.image = NSImage(named: "ButtonBackgroundImage3")
             rightsBox.fillColor = NSColor(named: "7094F6_0.1") ?? .white
             number1ImageView.isHidden = true
             number1Label.isHidden = false
-            buyBox.contentView = buyView1
-            buyNow1ImageView.isHidden = true
-            buyNow2ImageView.isHidden = false
+            buyBox.contentView = buyView2
+            buyNow3ImageView.isHidden = true
         }
         let platforms = viewModel.getPlatformsImages()
         if platforms.count == 4 {
@@ -246,7 +287,11 @@ class KMUserInfoViewController: NSViewController {
         }
         buyNow1Box.downCallback = { [weak self](downEntered: Bool, mouseBox: KMBox, event) -> Void in
             guard let self = self else { return }
-
+            if self.userState == .unPay_UnTrial {
+                self.viewModel.skipCompare(.lite_Base)
+            } else if self.userState == .unPay_UnTrial_old {
+                self.viewModel.skipCompare(.lite_MacWindows)
+            }
         }
         
         buyNow2Box.moveCallback =  { [weak self](mouseEntered: Bool, mouseBox: KMBox) -> Void in
@@ -259,7 +304,9 @@ class KMUserInfoViewController: NSViewController {
         }
         buyNow2Box.downCallback = { [weak self](downEntered: Bool, mouseBox: KMBox, event) -> Void in
             guard let self = self else { return }
-
+            if self.userState == .unPay_UnTrial {
+                self.viewModel.skipCompare(.trial)
+            }
         }
         
         buyNow3Box.moveCallback =  { [weak self](mouseEntered: Bool, mouseBox: KMBox) -> Void in
@@ -267,7 +314,15 @@ class KMUserInfoViewController: NSViewController {
         }
         buyNow3Box.downCallback = { [weak self](downEntered: Bool, mouseBox: KMBox, event) -> Void in
             guard let self = self else { return }
-
+            if self.userState == .permanentAccount {
+                self.viewModel.skipCompare(.lite_MacWindows)
+            } else if self.userState == .subscribe {
+                self.viewModel.skipCompare(.lite_MacWindows)
+            } else if self.userState == .unAutomatic_RemainValid {
+                self.viewModel.skipCompare(.lite_Base)
+            } else if self.userState == .expired {
+                self.viewModel.skipCompare(.lite_Base)
+            }
         }
         
         accountCenterBox.moveCallback =  { [weak self](mouseEntered: Bool, mouseBox: KMBox) -> Void in

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

@@ -417,7 +417,7 @@
                 <customView translatesAutoresizingMaskIntoConstraints="NO" id="ifF-hz-xZ3">
                     <rect key="frame" x="98" y="0.0" width="178" height="39"/>
                     <subviews>
-                        <box boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="ASn-b5-7AK" customClass="KMBox" customModule="PDF_Reader_Pro" customModuleProvider="target">
+                        <box boxType="custom" borderWidth="0.0" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="ASn-b5-7AK" customClass="KMBox" customModule="PDF_Reader_Pro" customModuleProvider="target">
                             <rect key="frame" x="0.0" y="0.0" width="77" height="39"/>
                             <view key="contentView" id="ZXo-Sc-FgD">
                                 <rect key="frame" x="0.0" y="0.0" width="77" height="39"/>
@@ -459,7 +459,7 @@
                                 <constraint firstItem="6va-5C-3xj" firstAttribute="centerY" secondItem="ASn-b5-7AK" secondAttribute="centerY" id="bzG-iD-k3x"/>
                             </constraints>
                         </box>
-                        <box boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="DYW-qh-I2i" customClass="KMBox" customModule="PDF_Reader_Pro" customModuleProvider="target">
+                        <box boxType="custom" borderWidth="0.0" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="DYW-qh-I2i" customClass="KMBox" customModule="PDF_Reader_Pro" customModuleProvider="target">
                             <rect key="frame" x="101" y="0.0" width="77" height="39"/>
                             <view key="contentView" id="Mxw-Dr-xL2">
                                 <rect key="frame" x="0.0" y="0.0" width="77" height="39"/>
@@ -525,7 +525,7 @@
             <rect key="frame" x="0.0" y="0.0" width="374" height="39"/>
             <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
             <subviews>
-                <box boxType="custom" borderWidth="0.0" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="AGm-Dz-UgL" customClass="KMBox" customModule="PDF_Reader_Pro" customModuleProvider="target">
+                <box boxType="custom" borderWidth="0.0" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="AGm-Dz-UgL" customClass="KMBox" customModule="PDF_Reader_Pro" customModuleProvider="target">
                     <rect key="frame" x="149" y="0.0" width="77" height="39"/>
                     <view key="contentView" id="Mmy-vo-I4w">
                         <rect key="frame" x="0.0" y="0.0" width="77" height="39"/>

+ 52 - 5
PDF Office/PDF Master/MemberCenter/ViewModel/KMUserInfoVCModel.swift

@@ -10,11 +10,18 @@ import Combine
 
 @objc enum KMUserState : Int {
     case unPay_UnTrial = 0      // 未付费且未试用
-    case permanentAccount       // 永久账户用户
+    case unPay_UnTrial_old      // 未付费且未试用 但本机有权益
+    case permanentAccount       // 永久账户用户 买断
+    case subscribe              // 自动订阅中
     case unAutomatic_RemainValid// 取消自动续费,但仍在有效期内
     case expired                // 已到期用户
 }
 
+@objc enum memberEquityType : Int {
+    case advancedSixMonthPlan = 0      // 高级版半年订阅
+    case advancedYearMonthPlan      // 高级版年订阅
+}
+
 typealias UserInfoComplete = (_ success: Bool,_ msg: String) -> Void
 
 @objcMembers
@@ -45,7 +52,28 @@ class KMUserInfoVCModel: ObservableObject {
      @param
      */
     func refreshUserState() -> KMUserState {
-        
+        let dateFormatter = DateFormatter()
+        dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss"
+        var startTime = Date()
+        if KMMemberInfo.shared.vip_endDate.count > 0 {
+            startTime = dateFormatter.date(from: KMMemberInfo.shared.vip_endDate)!
+        }
+        let currentTime = Date()
+
+        if KMMemberInfo.shared.canTrail && KMMemberInfo.shared.vip_levels == "1" {
+            if IAPProductsManager.default().isAvailableAllFunction() {
+                return .unPay_UnTrial_old
+            }
+            return .unPay_UnTrial
+        } else if KMMemberInfo.shared.vip_paymentModel == "2" {
+            return .permanentAccount
+        } else if KMMemberInfo.shared.vip_status == 1 && KMMemberInfo.shared.vip_payType == 1 {
+            return .subscribe
+        } else if (currentTime >= startTime) && (KMMemberInfo.shared.vip_payType == 0) {
+            return .unAutomatic_RemainValid
+        } else if (currentTime < startTime) && (KMMemberInfo.shared.vip_status == 2) {
+            return .expired
+        }
         return .unPay_UnTrial
     }
     
@@ -202,6 +230,26 @@ class KMUserInfoVCModel: ObservableObject {
         }
     }
     
+    /**
+     @abstract 跳转比较表;
+     */
+    func skipCompare(_ type: KMCompareTableType) -> Void {
+        KMProductCompareWC.shared.orientation = true
+        KMProductCompareWC.shared.orientationType = type
+        KMProductCompareWC.shared.showWindow(nil)
+    }
+    
+    /**
+     @abstract 购买全平台年订阅;
+     */
+    func buyFullPlatformSubscription(_ type: memberEquityType) -> Void {
+        if type == .advancedSixMonthPlan {
+            IAPProductsManager.default().makeSubProduct(IAPProductsManager.default().advancedSixMonthPlan_lite, discount: IAPProductsManager.default().isCancelAutoRenew())
+        } else if type == .advancedYearMonthPlan {
+            IAPProductsManager.default().makeSubProduct(IAPProductsManager.default().advancedAnnualPlan_lite, discount: IAPProductsManager.default().isCancelAutoRenew())
+        }
+    }
+    
     // MARK: Private Method
     
     /**
@@ -209,8 +257,7 @@ class KMUserInfoVCModel: ObservableObject {
      @param
      */
     private func maxDeviceNum() -> Int {
-        return 4
-//        return 0
+        return KMMemberInfo.shared.vip_maxDeviceNum
     }
     
     /**
@@ -218,7 +265,7 @@ class KMUserInfoVCModel: ObservableObject {
      @param
      */
     private func userPlatforms() -> [String] {
-        let platforms = "android, ios, mac, windows"
+        let platforms = KMMemberInfo.shared.vip_platforms
         let platformsArray = platforms
             .components(separatedBy: ",")
             .map { $0.trimmingCharacters(in: .whitespaces) }

+ 1 - 1
PDF Office/PDF Master/MemberCenter/WindowsController/KMCloseVerificationWC.xib

@@ -26,7 +26,7 @@
         <window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="F0z-JX-Cv5">
             <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
             <rect key="contentRect" x="196" y="240" width="358" height="312"/>
-            <rect key="screenRect" x="0.0" y="0.0" width="2560" height="1415"/>
+            <rect key="screenRect" x="0.0" y="0.0" width="1800" height="1125"/>
             <value key="minSize" type="size" width="358" height="312"/>
             <value key="maxSize" type="size" width="358" height="312"/>
             <view key="contentView" id="se5-gp-TjO">

+ 1 - 1
PDF Office/PDF Master/MemberCenter/WindowsController/KMLoginWindowsController.swift

@@ -44,7 +44,7 @@ class KMLoginWindowsController: NSWindowController {
     
     private func initializeUI() -> Void {
         if memberInfo.isLogin {
-            
+            window?.close()
         } else {
             leftImageView.image = NSImage(named: "WelcomePDFReaderPro1")