|
@@ -103,7 +103,7 @@ class KMAccountInfoView: KMBaseXibView {
|
|
|
self.statusLabel.font = NSFont.SFProTextSemibold(16.0)
|
|
|
|
|
|
self.statusTimeLabel.textColor = NSColor(hex: "#616469")
|
|
|
- self.statusTimeLabel.font = NSFont.SFProTextRegular(12.0)
|
|
|
+ self.statusTimeLabel.font = NSFont.SFProTextRegular(10.0)
|
|
|
|
|
|
self.subscribeButton.contentTintColor = NSColor(hex: "#FFFFFF")
|
|
|
self.subscribeButton.backgroundColor(NSColor(hex: "#FF852E"))
|
|
@@ -152,19 +152,8 @@ class KMAccountInfoView: KMBaseXibView {
|
|
|
self.statusLabel.stringValue = NSLocalizedString("On Trial", comment: "")
|
|
|
}
|
|
|
|
|
|
-
|
|
|
let dateString = userInfo?.subscriptionInfoList[0].endDate ?? ""
|
|
|
-
|
|
|
- let dateFormatter = DateFormatter()
|
|
|
- dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss"
|
|
|
-
|
|
|
- let date = dateFormatter.date(from: dateString)
|
|
|
- let targetDateFormatter = DateFormatter()
|
|
|
- targetDateFormatter.dateFormat = "yyyy-MM-dd"
|
|
|
- let formattedDate = targetDateFormatter.string(from: date ?? NSDate() as Date)
|
|
|
- print(formattedDate) // 输出:2024-06-28
|
|
|
-
|
|
|
- self.statusTimeLabel.stringValue = "\(formattedDate) \nTrial expires"
|
|
|
+ self.statusTimeLabel.stringValue = "\(self.fetchDate(dateString: dateString)) \n\(NSLocalizedString("Trial expires", comment: ""))"
|
|
|
} else if purchaseState == .subscriptionExpired ||
|
|
|
purchaseState == .trialExpired {
|
|
|
self.statusContentView.isHidden = false
|
|
@@ -174,12 +163,21 @@ class KMAccountInfoView: KMBaseXibView {
|
|
|
self.statusLabel.stringValue = NSLocalizedString("Expired", comment: "")
|
|
|
self.statusLabel.textColor = NSColor(hex: "#F3465B")
|
|
|
|
|
|
+ let dateString = userInfo?.subscriptionInfoList[0].endDate ?? ""
|
|
|
+ self.statusTimeLabel.stringValue = "\(self.fetchDate(dateString: dateString)) \n\(NSLocalizedString("Trial expires", comment: ""))"
|
|
|
} else {
|
|
|
self.statusContentView.isHidden = true
|
|
|
// self.purchaseInfoContentView.isHidden = true
|
|
|
self.subscribeButtonContentView.isHidden = true
|
|
|
}
|
|
|
|
|
|
+ if self.userInfo != nil {
|
|
|
+ if userInfo?.subscriptionInfoList[0].payType == 1 {
|
|
|
+ let dateString = userInfo?.subscriptionInfoList[0].endDate ?? ""
|
|
|
+ self.statusTimeLabel.stringValue = "\(self.fetchDate(dateString: dateString))\n\(NSLocalizedString("Next subscription", comment: ""))"
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
self.updateLanguage()
|
|
|
}
|
|
|
|
|
@@ -198,8 +196,22 @@ class KMAccountInfoView: KMBaseXibView {
|
|
|
paragraphStyle.alignment = .right
|
|
|
self.statusTimeLabel.attributedStringValue = NSMutableAttributedString(string: NSLocalizedString(timeString, comment: ""), attributes: [NSAttributedString.Key.paragraphStyle: paragraphStyle])
|
|
|
|
|
|
- paragraphStyle.alignment = .left
|
|
|
- self.statusLabel.attributedStringValue = NSMutableAttributedString(string: NSLocalizedString(self.statusLabel.stringValue, comment: ""), attributes: [NSAttributedString.Key.paragraphStyle: paragraphStyle])
|
|
|
+ let paragraphStyle2 = NSMutableParagraphStyle()
|
|
|
+ paragraphStyle2.lineHeightMultiple = 1.32
|
|
|
+ paragraphStyle2.alignment = .left
|
|
|
+ self.statusLabel.attributedStringValue = NSMutableAttributedString(string: NSLocalizedString(self.statusLabel.stringValue, comment: ""), attributes: [NSAttributedString.Key.paragraphStyle: paragraphStyle2])
|
|
|
+ }
|
|
|
+
|
|
|
+ func fetchDate(dateString: String) -> String {
|
|
|
+ let dateFormatter = DateFormatter()
|
|
|
+ dateFormatter.dateFormat = "yyyy-MM-dd HH:mm:ss"
|
|
|
+
|
|
|
+ let date = dateFormatter.date(from: dateString)
|
|
|
+ let targetDateFormatter = DateFormatter()
|
|
|
+ targetDateFormatter.dateFormat = "yyyy-MM-dd"
|
|
|
+ let formattedDate = targetDateFormatter.string(from: date ?? NSDate() as Date)
|
|
|
+ print(formattedDate) // 输出:2024-06-28
|
|
|
+ return formattedDate
|
|
|
}
|
|
|
}
|
|
|
|