Browse Source

【会员】DMG 信息界面显示订单信息逻辑调整

lizhe 1 year ago
parent
commit
df17ec9b23

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

@@ -176,7 +176,7 @@ class KMAccountInfoWindowController: NSWindowController {
                     state == .trial {
             self.accountViewHeightConstraint.constant = 411 - 60
 #if VERSION_DMG
-            if self.accountInfoView.userInfo?.subscriptionInfoList[0].payType == 1 {
+            if KMLightMemberManager.manager.info.subscriptionInfoList[0].payType == 1 {
                 self.accountViewHeightConstraint.constant = 483 - 52 - 20
             } else {
                 self.accountViewHeightConstraint.constant = 483

+ 7 - 4
PDF Office/PDF Master/Class/KMLightMember/Controller/AccountInfo/View/KMAccountInfoView.swift

@@ -131,7 +131,7 @@ class KMAccountInfoView: KMBaseXibView {
             self.accountLabel.stringValue = userInfo!.email
             self.imageViewButton.title = userInfo?.email.substring(to: 1) ?? ""
             
-            if userInfo?.subscriptionInfoList[0].payType == 1 {
+            if KMLightMemberManager.manager.info.subscriptionInfoList[0].payType == 1 {
                 self.tagContentView.isHidden = false
             } else {
                 self.tagContentView.isHidden = true
@@ -145,7 +145,6 @@ class KMAccountInfoView: KMBaseXibView {
         self.purchaseInfoContentView.isHidden = KMLightMemberManager.manager.existOrderInfo() ? false:true
         self.subscribeButtonContentView.isHidden = true
         self.statusContentView.isHidden = true
-        self.purchaseInfoContentView.isHidden = true
         self.subscriptionInfoContentViewHeightConstraint.constant = 74
         self.subscriptionInfoContentViewTopConstraint.constant = 20
         self.lineViewTopConttraint.constant = 16
@@ -163,11 +162,13 @@ class KMAccountInfoView: KMBaseXibView {
             self.statusContentView.isHidden = false
 #if VERSION_DMG
             self.purchaseInfoContentView.isHidden = false
-            if userInfo?.subscriptionInfoList[0].payType == 1 {
+            if KMLightMemberManager.manager.info.subscriptionInfoList[0].payType == 1 {
                 self.subscribeButtonContentView.isHidden = true
             } else {
                 self.subscribeButtonContentView.isHidden = false
             }
+#else
+            self.purchaseInfoContentView.isHidden = true
 #endif
             self.statusLabel.stringValue = NSLocalizedString("On Subscription", comment: "")
             if purchaseState == .trial {
@@ -183,6 +184,8 @@ class KMAccountInfoView: KMBaseXibView {
             
 #if VERSION_DMG
             self.purchaseInfoContentView.isHidden = false
+#else
+            self.purchaseInfoContentView.isHidden = true
 #endif
             self.statusLabel.stringValue = NSLocalizedString("Expired", comment: "")
             self.statusLabel.textColor = NSColor(hex: "#F3465B")
@@ -192,7 +195,7 @@ class KMAccountInfoView: KMBaseXibView {
         }
         
         if self.userInfo != nil {
-            if userInfo?.subscriptionInfoList[0].payType == 1 {
+            if KMLightMemberManager.manager.info.subscriptionInfoList[0].payType == 1 {
                 let dateString = userInfo?.subscriptionInfoList[0].endDate ?? ""
                 self.statusTimeLabel.stringValue = "\(self.fetchDate(dateString: dateString))\n\(NSLocalizedString("Subscription renewal date", comment: ""))"
             }

+ 4 - 4
PDF Office/PDF Master/Class/KMLightMember/Model/KMLightMemberUserInfo.swift

@@ -167,11 +167,11 @@ extension KMLightMemberUserInfo {
                 array.append(item)
             }
         }
-        if subscriptionList.count > 1 {
+//        if subscriptionList.count > 1 {
             result.existOrderInfo = true
-        } else {
-            result.existOrderInfo = false
-        }
+//        } else {
+//            result.existOrderInfo = false
+//        }
         result.subscriptionInfoList = array
         return result
     }