Browse Source

【会员系统】注销账号时购买时弹出对应提示

wangshuai 5 days ago
parent
commit
e6f597fe88

+ 17 - 12
PDF Office/PDF Master/Class/Purchase/Appstore/KMPurchaseCompareWindowController.m

@@ -1110,21 +1110,26 @@ static NSString *const KMPurchaseCompareCellIdentifier       = @"KMPurchaseCompa
 #pragma mark - Button Actions
 
 - (IBAction)buttonItemClicked_Subscribe:(id)sender {
-    if (self.isPurchaseSwitch) {
-        [[IAPProductsManager defaultManager] makeSubProduct:[IAPProductsManager defaultManager].allAccessPack12months_lite discount:[self isCancelAutoRenew]];
-        
+    if KMMemberInfo.shared.isLogin && KMMemberInfo.shared.validFlag == "5" {
+        KMMemberPromptWC.shared.showWindow(nil)
+        KMMemberPromptWC.shared.tipType = .signouting
     } else {
-        [[IAPProductsManager defaultManager] makeSubProduct:[IAPProductsManager defaultManager].allAccessPackNew6months_lite discount:[self isCancelAutoRenew]];
-    }
-    [self addWaingView:self.window.contentView];
-    [[FMTrackEventManager defaultManager] trackEventWithEvent:@"PUW" withProperties:@{@"PUW_Btn":@"PUW_Btn_Upgrade_6Mon"}];
-
-    if ([self isShowSale]) {
-        self.kEventTag = 1;
         if (self.isPurchaseSwitch) {
-            [self trackEvent_freeWithEventName:@"PromotionalOffer" params:@{@"PUW_Btn" : @"PUW_7OffUpgrade_12Mon"} platform:KMAnalyticsPlatformAppCenter];
+            [[IAPProductsManager defaultManager] makeSubProduct:[IAPProductsManager defaultManager].allAccessPack12months_lite discount:[self isCancelAutoRenew]];
+            
         } else {
-            [self trackEvent_freeWithEventName:@"PromotionalOffer" params:@{@"PUW_Btn" : @"PUW_7OffUpgrade_6Mon"} platform:KMAnalyticsPlatformAppCenter];
+            [[IAPProductsManager defaultManager] makeSubProduct:[IAPProductsManager defaultManager].allAccessPackNew6months_lite discount:[self isCancelAutoRenew]];
+        }
+        [self addWaingView:self.window.contentView];
+        [[FMTrackEventManager defaultManager] trackEventWithEvent:@"PUW" withProperties:@{@"PUW_Btn":@"PUW_Btn_Upgrade_6Mon"}];
+        
+        if ([self isShowSale]) {
+            self.kEventTag = 1;
+            if (self.isPurchaseSwitch) {
+                [self trackEvent_freeWithEventName:@"PromotionalOffer" params:@{@"PUW_Btn" : @"PUW_7OffUpgrade_12Mon"} platform:KMAnalyticsPlatformAppCenter];
+            } else {
+                [self trackEvent_freeWithEventName:@"PromotionalOffer" params:@{@"PUW_Btn" : @"PUW_7OffUpgrade_6Mon"} platform:KMAnalyticsPlatformAppCenter];
+            }
         }
     }
 }

+ 9 - 4
PDF Office/PDF Master/MemberCenter/ViewModel/KMUserInfoVCModel.swift

@@ -307,10 +307,15 @@ class KMUserInfoVCModel: ObservableObject {
      @abstract 购买全平台年订阅;
      */
     func buyFullPlatformSubscription(_ type: memberEquityType) -> Void {
-        if type == .advancedSixMonthPlan {
-            IAPProductsManager.default().makeSubProduct(IAPProductsManager.default().fourDevicesAllAccessPackNew6Months_lite, discount: IAPProductsManager.default().isCancelAutoRenew())
-        } else if type == .advancedYearMonthPlan {
-            IAPProductsManager.default().makeSubProduct(IAPProductsManager.default().fourDevicesAllAccessPackNew12months_lite, discount: IAPProductsManager.default().isCancelAutoRenew())
+        if KMMemberInfo.shared.isLogin && KMMemberInfo.shared.validFlag == "5" {
+            KMMemberPromptWC.shared.showWindow(nil)
+            KMMemberPromptWC.shared.tipType = .signouting
+        } else {
+            if type == .advancedSixMonthPlan {
+                IAPProductsManager.default().makeSubProduct(IAPProductsManager.default().fourDevicesAllAccessPackNew6Months_lite, discount: IAPProductsManager.default().isCancelAutoRenew())
+            } else if type == .advancedYearMonthPlan {
+                IAPProductsManager.default().makeSubProduct(IAPProductsManager.default().fourDevicesAllAccessPackNew12months_lite, discount: IAPProductsManager.default().isCancelAutoRenew())
+            }
         }
     }
     

+ 15 - 6
PDF Office/PDF Master/MemberCenter/WindowsController/KMFreeGetAIWC.swift

@@ -130,15 +130,24 @@ class KMFreeGetAIWC: NSWindowController {
             embeddedWC.window?.center()
 #endif
 #else
-            self.window?.showWaitingView()
-
-    // AppStore 免费版本
-            IAPProductsManager.default().makeSubProduct(IAPProductsManager.default().aiAllAccessPack12month_lite, discount: IAPProductsManager.default().isCancelAutoRenew())
+            if KMMemberInfo.shared.isLogin && KMMemberInfo.shared.validFlag == "5" {
+                KMMemberPromptWC.shared.showWindow(nil)
+                KMMemberPromptWC.shared.tipType = .signouting
+            } else {
+                self.window?.showWaitingView()
+                // AppStore 免费版本
+                IAPProductsManager.default().makeSubProduct(IAPProductsManager.default().aiAllAccessPack12month_lite, discount: IAPProductsManager.default().isCancelAutoRenew())
+            }
 #endif
 #else
     // AppStore 付费版
-            self.window?.showWaitingView()
-            IAPProductsManager.default().makeSubProduct(IAPProductsManager.default().aiAllAccessPack12month_pro, discount: IAPProductsManager.default().isCancelAutoRenew())
+            if KMMemberInfo.shared.isLogin && KMMemberInfo.shared.validFlag == "5" {
+                KMMemberPromptWC.shared.showWindow(nil)
+                KMMemberPromptWC.shared.tipType = .signouting
+            } else {
+                self.window?.showWaitingView()
+                IAPProductsManager.default().makeSubProduct(IAPProductsManager.default().aiAllAccessPack12month_pro, discount: IAPProductsManager.default().isCancelAutoRenew())
+            }
 #endif
 
         }