Procházet zdrojové kódy

Merge branch 'develop_PDFReaderPro_V4.7.0' of git.kdan.cc:Mac_PDF/PDF_Office into develop_PDFReaderPro_V4.7.0

niehaoyu před 1 týdnem
rodič
revize
483fb130aa

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

@@ -360,6 +360,9 @@ NSPopoverDelegate>
             totalWidth+=CGRectGetWidth(self.officeButton.bounds);
             totalWidth+=4;
         }
+#else
+        self.officeButton.hidden = YES;
+        self.officeImg.hidden = YES;
 #endif
  
         if (KMAdvertisementManager.manager.info.topRightInfoContent != nil) {
@@ -409,6 +412,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;

+ 6 - 1
PDF Office/PDF Master/MemberCenter/Model/KMMemberCenterManager.swift

@@ -442,6 +442,7 @@ class KMMemberCenterManager: NSObject {
                 var uniqueSn = ""
                 var deviceName = ""
                 var id = ""
+                var model = ""
 
                 if let token = dict["device_id"] {
                     device_id = token as? String ?? ""
@@ -456,11 +457,15 @@ class KMMemberCenterManager: NSObject {
                     deviceName = token as? String ?? ""
                 }
                 
+                if let token = dict["model"] {
+                    model = token as? String ?? ""
+                }
+                
                 if let token = dict["id"] {
                     id = token as? String ?? ""
                 }
                 
-                let list = KMMemberDeviceList(deviceId: device_id, productId: productId, uniqueSn: uniqueSn, appId: "", deviceName: deviceName)
+                let list = KMMemberDeviceList(deviceId: device_id, productId: productId, uniqueSn: uniqueSn, appId: "", device_model:model, deviceName: deviceName)
                 list.id = id
                 deviceLists.append(list)
             }

+ 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)
                             }
                         }
                     }

+ 5 - 4
PDF Office/PDF Master/MemberCenter/WindowsController/KMMemberCenterWindowController.swift

@@ -150,14 +150,15 @@ class KMMemberCenterWindowController: NSWindowController {
         
         for i in 0 ..< deviceList_Result.count {
             let device = deviceList_Result[i]
+            let name = String(format: "%@(%@)",device.deviceName ?? "PDF Reader Pro User for ",device.device_model ?? " Device Name")
             if i == 0 {
-                device1Label.stringValue = device.deviceName ?? "PDF Reader Pro User"
+                device1Label.stringValue = name
             } else if i == 1 {
-                device2Label.stringValue = device.deviceName ?? "PDF Reader Pro User"
+                device2Label.stringValue = name
             }  else if i == 2 {
-                device3Label.stringValue = device.deviceName ?? "PDF Reader Pro User"
+                device3Label.stringValue = name
             } else if i == 3 {
-                device4Label.stringValue = device.deviceName ?? "PDF Reader Pro User"
+                device4Label.stringValue = name
             }
         }
         let maxDeviceNum = memberCenterdeviceResult.maxDeviceNum ?? 1