2 次代碼提交 bfd281a41e ... bb601333d6

作者 SHA1 備註 提交日期
  dinglingui bb601333d6 【会员系统】提示语弹出两次问题 5 天之前
  dinglingui 495f1424a5 【会员系统】状态栏按钮长度显示问题 5 天之前

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

@@ -414,6 +414,12 @@ NSPopoverDelegate>
             }
         }
         
+        buttonWidth = CGRectGetMaxX(self.button.frame);
+        NSRect btnRect = [self.button.attributedTitle boundingRectWithSize:CGSizeMake(MAXFLOAT, CGRectGetHeight(self.button.frame)) options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading];
+        if (fabs(buttonWidth-btnRect.size.width)>50) {
+            buttonWidth = btnRect.size.width + 10;
+        }
+        
         self.button.frame = CGRectMake(totalWidth, kbottomGap, buttonWidth, self.view.frame.size.height -2 *kbottomGap);
         CGRect rect = self.button.frame;
         self.bgImg.frame = rect;

+ 2 - 9
PDF Office/PDF Master/MemberCenter/ViewModel/KMSignUpViewModel.swift

@@ -295,7 +295,7 @@ class KMSignUpViewModel: ObservableObject {
                 
                 self.timer?.cancel()
                 self.sendContent = NSLocalizedString("Resend", tableName: "MemberCenterLocalizable", comment: "")
-
+                
                 KMMemberInfo.shared.avatarImage = nil
             } else {
                 if(resultDict.code == 305) {
@@ -326,19 +326,12 @@ class KMSignUpViewModel: ObservableObject {
                     }
                 } else {
                     callback?(false)
-                    
                     print("错误信息:%@", msg as Any)
-                    DispatchQueue.main.async {
-                        let alert = NSAlert()
-                        alert.messageText = NSLocalizedString(msg!, comment: "")
-                        alert.addButton(withTitle: NSLocalizedString("OK", comment: ""))
-                        let response = alert.runModal()
+                    KMMemberCenterManager.showAlert(code: .init(rawValue: resultDict.code), message: resultDict.msg) { response, _ in
                         if response == .alertFirstButtonReturn {
                             if(resultDict.code == 317) {
                                 self.signUpState = .verificationCode
                                 self.countDown(type: .login, callback: nil)
-                            } else {
-                                KMMemberCenterManager.showAlert(code: .init(rawValue: resultDict.code), message: resultDict.msg, callback: nil)
                             }
                         }
                     }