Procházet zdrojové kódy

【轻会员】订阅期会员,注销账户时,流程过长,应该在用户点击Cancelation按钮时就提示用户订阅期内不能注销账户 且 提示语显示不全 修复

lizhe před 1 rokem
rodič
revize
e4971cda79

+ 15 - 15
PDF Office/PDF Master.xcodeproj/xcuserdata/lizhe.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -3365,8 +3365,8 @@
             filePath = "PDF Master/Class/KMLightMember/Controller/VerificationCode/View/KMVerificationCodeView.swift"
             startingColumnNumber = "9223372036854775807"
             endingColumnNumber = "9223372036854775807"
-            startingLineNumber = "451"
-            endingLineNumber = "451"
+            startingLineNumber = "452"
+            endingLineNumber = "452"
             landmarkName = "controlTextDidEndEditing(_:)"
             landmarkType = "7">
             <Locations>
@@ -4015,7 +4015,7 @@
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "175"
             endingLineNumber = "175"
-            landmarkName = "control(_:textView:doCommandBy:)"
+            landmarkName = "controlTextDidEndEditing(_:)"
             landmarkType = "7">
             <Locations>
                <Location
@@ -4108,7 +4108,7 @@
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "167"
             endingLineNumber = "167"
-            landmarkName = "controlTextDidEndEditing(_:)"
+            landmarkName = "mouseDown(with:)"
             landmarkType = "7">
             <Locations>
                <Location
@@ -4156,7 +4156,7 @@
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "1699"
             endingLineNumber = "1699"
-            landmarkName = "pdfListViewMenuValidate(_:menuItem:isTakesEffect:)"
+            landmarkName = "pdfListViewKeyDownIsContinue(_:theEvent:)"
             landmarkType = "7">
             <Locations>
                <Location
@@ -4828,7 +4828,7 @@
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "1511"
             endingLineNumber = "1511"
-            landmarkName = "pdfViewEditingAddImageArea(_:add:add:)"
+            landmarkName = "pdfViewEditingAreaDidChanged(_:)"
             landmarkType = "7">
             <Locations>
                <Location
@@ -5740,7 +5740,7 @@
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "1947"
             endingLineNumber = "1947"
-            landmarkName = "toolbarViewController(_:zoomModel:)"
+            landmarkName = "displaySecondaryPDFView(withUrl:)"
             landmarkType = "7">
             <Locations>
                <Location
@@ -5923,7 +5923,7 @@
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "1993"
             endingLineNumber = "1993"
-            landmarkName = "changePDFViewZoomInAction()"
+            landmarkName = "receivedFileUrl(_:)"
             landmarkType = "7">
             <Locations>
                <Location
@@ -6136,7 +6136,7 @@
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "1510"
             endingLineNumber = "1510"
-            landmarkName = "shareFlatten(sender:)"
+            landmarkName = "shareDocument(sender:limit:)"
             landmarkType = "7">
             <Locations>
                <Location
@@ -6880,7 +6880,7 @@
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "1540"
             endingLineNumber = "1540"
-            landmarkName = "pdfViewEditingAddImageArea(_:add:add:)"
+            landmarkName = "pdfViewEditingCropBoundsDidChanged(_:editing:)"
             landmarkType = "7">
             <Locations>
                <Location
@@ -8243,8 +8243,8 @@
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "149"
             endingLineNumber = "149"
-            landmarkName = "KMRequestServerManager"
-            landmarkType = "21">
+            landmarkName = "unknown"
+            landmarkType = "0">
             <Locations>
                <Location
                   uuid = "20202BB1-7EB7-47BE-9341-E744CD3EF036 - 530710908b523878"
@@ -8699,7 +8699,7 @@
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "1303"
             endingLineNumber = "1303"
-            landmarkName = "CEditPDFToolModeChangeStateUnkownNotification(_:)"
+            landmarkName = "documentDidUnlockNotification(_:)"
             landmarkType = "7">
             <Locations>
                <Location
@@ -9407,7 +9407,7 @@
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "771"
             endingLineNumber = "771"
-            landmarkName = "aiRewriting(content:version:state:complete:)"
+            landmarkName = "aiTranslationTextTrans(q:from:to:version:complete:)"
             landmarkType = "7">
             <Locations>
                <Location
@@ -9705,7 +9705,7 @@
             endingColumnNumber = "9223372036854775807"
             startingLineNumber = "505"
             endingLineNumber = "505"
-            landmarkName = "parseVerification(applePayProductId:orderId:receipt:complete:)"
+            landmarkName = "parseVerification(applePayProductId:orderId:receipt:restore:complete:)"
             landmarkType = "7">
             <Locations>
                <Location

+ 27 - 16
PDF Office/PDF Master/Class/KMLightMember/Controller/AccountInfo/KMAccountInfoWindowController.swift

@@ -109,23 +109,34 @@ class KMAccountInfoWindowController: NSWindowController {
         self.accountInfoView.cancellationAction = { [unowned self] view in
             print("注销")
             
-            let alert = NSAlert()
-            alert.messageText = NSLocalizedString("Are you sure you want to cancel?", comment: "")
-            alert.informativeText = NSLocalizedString("Cancellation cannot be withdrawn, it will be completed within 3 working days, until then your account will be frozen and cannot be logged in, are you sure you want to delete your account?", comment: "")
-            alert.addButton(withTitle: NSLocalizedString("No", comment: ""))
-            alert.addButton(withTitle: NSLocalizedString("Yes", comment: ""))
-            alert.beginSheetModal(for: view.window!) { [unowned self] result in
-                if (result == .alertFirstButtonReturn) { /// 取消
-                    return
-                } else if result == .alertSecondButtonReturn {
-                    guard let callBack = cancellAtionAction else { return }
-//                    accountInfoMainWindow?.endSheet(view.window!)
-//                    view.window?.close()
-//                    accountInfoController = nil
-//                    accountInfoMainWindow = nil
-                    callBack(self)
+            if KMLightMemberManager.manager.purchaseState == .subscription ||
+                KMLightMemberManager.manager.purchaseState == .trial {
+                let alert = NSAlert()
+                alert.messageText = NSLocalizedString("Are you sure you want to cancel?", comment: "")
+                alert.informativeText = NSLocalizedString("You are still in the subscription and cannot cancel account. Please click Cancel Account after the subscription period ends.", comment: "")
+                alert.addButton(withTitle: NSLocalizedString("OK", comment: ""))
+                alert.beginSheetModal(for: view.window!) { [unowned self] result in
+
+                }
+            } else {
+                let alert = NSAlert()
+                alert.messageText = NSLocalizedString("Are you sure you want to cancel?", comment: "")
+                alert.informativeText = NSLocalizedString("Cancellation cannot be withdrawn, it will be completed within 3 working days, until then your account will be frozen and cannot be logged in, are you sure you want to delete your account?", comment: "")
+                alert.addButton(withTitle: NSLocalizedString("No", comment: ""))
+                alert.addButton(withTitle: NSLocalizedString("Yes", comment: ""))
+                alert.beginSheetModal(for: view.window!) { [unowned self] result in
+                    if (result == .alertFirstButtonReturn) { /// 取消
+                        return
+                    } else if result == .alertSecondButtonReturn {
+                        guard let callBack = cancellAtionAction else { return }
+    //                    accountInfoMainWindow?.endSheet(view.window!)
+    //                    view.window?.close()
+    //                    accountInfoController = nil
+    //                    accountInfoMainWindow = nil
+                        callBack(self)
+                    }
+                    
                 }
-                
             }
         }
         

+ 4 - 4
PDF Office/PDF Master/Class/KMLightMember/Controller/VerificationCode/KMVerficationCodeWindowController.xib

@@ -18,17 +18,17 @@
         <window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="default" id="F0z-JX-Cv5">
             <windowStyleMask key="styleMask" titled="YES"/>
             <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
-            <rect key="contentRect" x="196" y="240" width="326" height="420"/>
+            <rect key="contentRect" x="196" y="240" width="404" height="420"/>
             <rect key="screenRect" x="0.0" y="0.0" width="2560" height="1415"/>
             <view key="contentView" id="se5-gp-TjO">
-                <rect key="frame" x="0.0" y="0.0" width="326" height="420"/>
+                <rect key="frame" x="0.0" y="0.0" width="404" height="420"/>
                 <autoresizingMask key="autoresizingMask"/>
                 <subviews>
                     <customView translatesAutoresizingMaskIntoConstraints="NO" id="ksJ-GD-QC6" customClass="KMVerificationCodeView" customModule="PDF_Master" customModuleProvider="target">
-                        <rect key="frame" x="0.0" y="0.0" width="326" height="420"/>
+                        <rect key="frame" x="0.0" y="0.0" width="404" height="420"/>
                     </customView>
                     <customView hidden="YES" translatesAutoresizingMaskIntoConstraints="NO" id="UNI-Yj-LyJ" customClass="KMLightNoNetworkView" customModule="PDF_Master" customModuleProvider="target">
-                        <rect key="frame" x="0.0" y="0.0" width="326" height="400"/>
+                        <rect key="frame" x="0.0" y="0.0" width="404" height="400"/>
                     </customView>
                 </subviews>
                 <constraints>

+ 10 - 0
PDF Office/PDF Master/Class/KMLightMember/Controller/VerificationCode/View/KMLightMemberAlertView.swift

@@ -54,6 +54,16 @@ class KMLightMemberAlertView: KMBaseXibView {
         self.callMethodWithDelay()
     }
     
+    func fetchAlertHeight() -> CGFloat {
+        let string: NSString = self.titleLabel.stringValue as NSString
+        
+        let paragraphStyle = NSMutableParagraphStyle()
+//        paragraphStyle.lineHeightMultiple = 1.32
+        paragraphStyle.alignment = .left
+        let size: NSSize = string.boundingRect(with: NSSize(width: 356, height: 100), options: NSString.DrawingOptions(rawValue: 3), attributes: [NSAttributedString.Key.font : NSFont.SFProTextRegular(14), NSAttributedString.Key.paragraphStyle : paragraphStyle]).size
+        return size.height + 32
+    }
+    
     func callMethodWithDelay() {
         // 取消之前的计时器
         timer?.cancel()

+ 4 - 4
PDF Office/PDF Master/Class/KMLightMember/Controller/VerificationCode/View/KMLightMemberAlertView.xib

@@ -15,11 +15,11 @@
         <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
         <customObject id="-3" userLabel="Application" customClass="NSObject"/>
         <customView id="c22-O7-iKe">
-            <rect key="frame" x="0.0" y="0.0" width="326" height="57"/>
+            <rect key="frame" x="0.0" y="0.0" width="404" height="57"/>
             <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
             <subviews>
                 <customView translatesAutoresizingMaskIntoConstraints="NO" id="q25-bk-4KL">
-                    <rect key="frame" x="0.0" y="0.0" width="326" height="57"/>
+                    <rect key="frame" x="0.0" y="0.0" width="404" height="57"/>
                     <subviews>
                         <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="QLO-ls-cZz">
                             <rect key="frame" x="8" y="21" width="16" height="16"/>
@@ -29,9 +29,9 @@
                             </buttonCell>
                         </button>
                         <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="5Vu-nI-SlI">
-                            <rect key="frame" x="30" y="21" width="290" height="16"/>
+                            <rect key="frame" x="30" y="21" width="356" height="16"/>
                             <constraints>
-                                <constraint firstAttribute="width" constant="286" id="x8P-X1-tYq"/>
+                                <constraint firstAttribute="width" constant="352" id="x8P-X1-tYq"/>
                             </constraints>
                             <textFieldCell key="cell" title="The verification code is wrong" id="wp8-bj-JcP">
                                 <font key="font" metaFont="system"/>

+ 1 - 0
PDF Office/PDF Master/Class/KMLightMember/Controller/VerificationCode/View/KMVerificationCodeView.swift

@@ -409,6 +409,7 @@ extension KMVerificationCodeView: KMVerificationCodeViewAction {
     func showAlert(result: Result?) {
         if result != nil {
             self.alertView.result = result!
+            self.alertHeightConstraint.constant = self.alertView.fetchAlertHeight()
             
             if result?.code != 0 && result?.code != 200 {
                 self.textFieldAlert()