Browse Source

【会员系统】- 整理用户中心+状态栏

dinglingui 3 months ago
parent
commit
bdd647b343

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

@@ -134,6 +134,8 @@ NSPopoverDelegate>
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(logoutSuccessNotification:) name:@"MemberCenterLogoutSuccess" object:nil];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(expandPersonalCenterNotification:) name:@"ExpandPersonalCenter" object:nil];
     [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(closeMenu:) name:@"CloseMenuNotification" object:nil];
+    
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(subscriptionLoadedNotification:) name:KMIAPSubscriptionLoadedNotification object:nil];
 }
 
 - (void)reloadData {
@@ -512,6 +514,10 @@ NSPopoverDelegate>
     }
 }
 
+- (void)subscriptionLoadedNotification:(NSNotification *)noti {
+    [self reloadData];
+}
+
 - (void)popOverCloseAction {
     if (self.stopPopOverHide == NO) {
         if (ActivityStatusTrialExpire == [VerificationManager manager].status ||

+ 16 - 15
PDF Office/PDF Master/MemberCenter/ViewController/KMUserInfoViewController.swift

@@ -461,12 +461,19 @@ class KMUserInfoViewController: NSViewController {
         closeAccountImageView.image = NSImage(named: "CloseAccountImage")
         
         var isNoOldSubscribed = false
+        var isTrialPeriod = false
 #if VERSION_FREE
 #if !VERSION_DMG
          isNoOldSubscribed = IAPProductsManager.default().allAccessPack6months_lite.isSubscribed == false && IAPProductsManager.default().allAccessPack12months_lite.isSubscribed == false
+        
+        if IAPProductsManager.default().fourDevicesAllAccessPackNew12months_lite.isTrialPeriod == true {
+            isTrialPeriod = true
+        }
+
 #endif
 #endif
         
+        
         if KMMemberInfo.shared.userScenarioType == .lite_type1 ||
            KMMemberInfo.shared.userScenarioType == .pro_type1 ||
            KMMemberInfo.shared.userScenarioType == .pro_type3 { //未试用
@@ -477,13 +484,11 @@ class KMUserInfoViewController: NSViewController {
             arrow2ImageView.image = NSImage(named: "BuyNewArrowImage1")
             buyNow1Label.textColor = NSColor(hex: "FFFFFF")
             buyNow2Label.textColor = NSColor(hex: "FFFFFF")
-#if !VERSION_DMG
-                if IAPProductsManager.default().fourDevicesAllAccessPackNew12months_lite.isTrialPeriod == true {
-                    buyNow2Box.isHidden = true
-                    buyNow1BoxLeftConst.constant = (CGRectGetWidth(view.bounds) - CGRectGetWidth(buyNow1Box.frame))/2
-                }
-#else
-#endif
+
+            if isTrialPeriod == true {
+                buyNow2Box.isHidden = true
+                buyNow1BoxLeftConst.constant = (CGRectGetWidth(view.bounds) - CGRectGetWidth(buyNow1Box.frame))/2
+            }
         } else if KMMemberInfo.shared.userScenarioType == .lite_type9 {
             buyBox.contentView = buyView1
             buyNow1ImageView.isHidden = false
@@ -492,14 +497,10 @@ class KMUserInfoViewController: NSViewController {
             arrow2ImageView.image = NSImage(named: "BuyNewArrowImage1")
             buyNow1Label.textColor = NSColor(hex: "FFFFFF")
             buyNow2Label.textColor = NSColor(hex: "FFFFFF")
-            if((KMMemberInfo.shared.vip_status == 0 && KMMemberInfo.shared.canTrail == true)) { //会员是否可试用
-#if !VERSION_DMG
-                if IAPProductsManager.default().fourDevicesAllAccessPackNew12months_lite.isTrialPeriod == true || !isNoOldSubscribed {//Appid未试用过或者之前未订阅
-                    buyNow2Box.isHidden = true
-                    buyNow1BoxLeftConst.constant = (CGRectGetWidth(view.bounds) - CGRectGetWidth(buyNow1Box.frame))/2
-                }
-#else
-#endif
+            if !(KMMemberInfo.shared.vip_status == 0 && KMMemberInfo.shared.canTrail == true) || !isNoOldSubscribed || isTrialPeriod { //会员试用过 + 没有订阅过老的 + appid试用过
+                buyNow2Box.isHidden = true
+                buyNow1BoxLeftConst.constant = (CGRectGetWidth(view.bounds) - CGRectGetWidth(buyNow1Box.frame))/2
+            
             }
         } else if KMMemberInfo.shared.userScenarioType == .lite_type11 { //试用过期
             if(!isNoOldSubscribed) {