Bläddra i källkod

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

zenghong 1 vecka sedan
förälder
incheckning
5c5283c07e

+ 1 - 0
PDF Office/PDF Master/MemberCenter/Assets/en.lproj/MemberCenterLocalizable.strings

@@ -108,3 +108,4 @@
 "Monthly Plan" = "Monthly Plan";
 "Permanent" = "Permanent";
 "Subscription" = "Subscription";
+"expires" = "expires";

+ 1 - 1
PDF Office/PDF Master/MemberCenter/Assets/zh-Hans.lproj/MemberCenterLocalizable.strings

@@ -104,4 +104,4 @@
 "Monthly Plan" = "月订阅";
 "Permanent" = "永久使用";
 "Subscription" = "订阅";
-
+"expires" = "到期";

+ 1 - 0
PDF Office/PDF Master/MemberCenter/Assets/zh-Hant.lproj/MemberCenterLocalizable.strings

@@ -105,3 +105,4 @@
 "Monthly Plan" = "月訂閱";
 "Permanent" = "永久使用";
 "Subscription" = "订阅";
+"expires" = "到期";

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

@@ -578,7 +578,21 @@ class KMMemberCenterManager: NSObject {
             if let token = activeVIP_dict["id"] as? String { activeVIP_id = token }
             if let token = activeVIP_dict["userId"] as? String { activeVIP_userId = token }
             if let token = activeVIP_dict["status"] as? Int { activeVIP_status = token }
-            if let token = activeVIP_dict["endDate"] as? String { activeVIP_endDate = token }
+            if let token = activeVIP_dict["endDate"] as? String {
+                
+                // 创建一个日期格式化器
+                let dateFormatter = DateFormatter()
+                dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss"
+
+                // 将字符串转换为日期对象
+                if let date = dateFormatter.date(from: token) {
+                    // 创建一个新的日期格式化器,用于只显示天
+                    let dayFormatter = DateFormatter()
+                    dayFormatter.dateFormat = "yyyy-MM-dd"  // 只保留年月日部分
+                    
+                     activeVIP_endDate = dayFormatter.string(from: date)
+                }
+            }
             if let token = activeVIP_dict["payType"] as? Int { activeVIP_payType = token }
             if let token = activeVIP_dict["productName"] as? String { activeVIP_productName = token }
             if let token = activeVIP_dict["levels"] as? String { activeVIP_levels = token }

+ 2 - 1
PDF Office/PDF Master/MemberCenter/ViewController/KMUserInfoViewController.swift

@@ -142,7 +142,8 @@ class KMUserInfoViewController: NSViewController {
     private func languageLocalized() -> Void {
         emailLabel.stringValue = KMMemberInfo.shared.userEmail
         productLabel.stringValue = NSLocalizedString("Personal Account", tableName: "MemberCenterLocalizable", comment: "")
-        endDateLabel.stringValue = KMMemberInfo.shared.vip_endDate
+        endDateLabel.stringValue = String(format: "%@ %@", KMMemberInfo.shared.vip_endDate,NSLocalizedString("expires", tableName: "MemberCenterLocalizable", comment: ""))
+
         membershipLabel.stringValue = NSLocalizedString("Membership Benefits", tableName: "MemberCenterLocalizable", comment: "")
         buyNow3Label.stringValue = NSLocalizedString("Upgrade Now", tableName: "MemberCenterLocalizable", comment: "")
         accountLabel.stringValue = NSLocalizedString("Account Center", tableName: "MemberCenterLocalizable", comment: "")

+ 24 - 2
PDF Office/PDF Master/MemberCenter/ViewModel/KMUserInfoVCModel.swift

@@ -142,7 +142,7 @@ class KMUserInfoVCModel: ObservableObject {
                 }
             }
         } else {
-            if KMMemberInfo.shared.vip_status == 1 {
+            if KMMemberInfo.shared.vip_paymentModel == "1" && (KMMemberInfo.shared.vip_status == 1 || KMMemberInfo.shared.ai_status == 1) {
                 // 订阅用户提示退订
                 NotificationCenter.default.post(name: NSNotification.Name("CloseMenuNotification"), object: nil)
                 KMMemberPromptWC.shared.showWindow(nil)
@@ -275,7 +275,29 @@ class KMUserInfoVCModel: ObservableObject {
         let platformsArray = platforms
             .components(separatedBy: ",")
             .map { $0.trimmingCharacters(in: .whitespaces) }
-        return platformsArray
+        
+        
+        let containsMac = platforms.contains("mac")
+        let containsiOS = platforms.contains("ios")
+        let containsWin = platforms.contains("windows")
+        let containsAn = platforms.contains("android")
+        var newPlatforms:[String] = []
+        if(containsMac == true){
+            newPlatforms.append("mac")
+        }
+        
+        if(containsWin == true){
+            newPlatforms.append("windows")
+        }
+        
+        if(containsiOS == true){
+            newPlatforms.append("ios")
+        }
+        
+        if(containsAn == true){
+            newPlatforms.append("android")
+        }
+        return newPlatforms
     }
 
 }