Преглед изворни кода

【综合】购买完成后关闭比较表

tangchao пре 2 месеци
родитељ
комит
66beca107b

+ 27 - 2
PDF Office/PDF Master/Class/Purchase/DMG/Verification/KMVerificationMessageViewController.m

@@ -351,7 +351,7 @@ NSPopoverDelegate>
 #endif
     }
     KMUserScenarioType type = [KMMemberInfo shared].userScenarioType;
-
+    BOOL buttonHiddenFlag = false;
     if (type == KMUserScenarioTypeLite_type1 ||
         type == KMUserScenarioTypeLite_type3 ||
         type == KMUserScenarioTypeLite_type5 ||
@@ -365,7 +365,16 @@ NSPopoverDelegate>
 #if !VERSION_DMG
             if(KMMemberInfo.shared.isLogin == NO) {
 #if VERSION_FREE
-                self.button.title = [self _getAppStoreFreeVersionBuyNowTitle];
+                if (IAPProductsManager.defaultManager.isAvailableAllFunction) {
+                    if (IAPProductsManager.defaultManager.isAvailableAdvancedPDFToOffice) {
+                        self.button.title = @"";
+                        buttonHiddenFlag = true;
+                    } else {
+                        self.button.title = [NSString stringWithFormat:@" %@ ",NSLocalizedString(@"Upgrade", nil)];
+                    }
+                } else {
+                    self.button.title = [self _getAppStoreFreeVersionBuyNowTitle];
+                }
 #else
                 self.button.title = [NSString stringWithFormat:@" %@ ",NSLocalizedString(@"Upgrade", nil)];
 #endif
@@ -472,6 +481,15 @@ NSPopoverDelegate>
             }
         }
         
+#if VERSION_FREE
+#if !VERSION_DMG
+        if (buttonHiddenFlag) {
+            self.bgImg.hidden = YES;
+            self.button.hidden = YES;
+        }
+#endif
+#endif
+        
         buttonWidth = CGRectGetWidth(self.button.frame);
         NSRect btnRect = [self.button.attributedTitle boundingRectWithSize:CGSizeMake(MAXFLOAT, CGRectGetHeight(self.button.frame)) options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading];
 //        if (fabs(buttonWidth-btnRect.size.width)>50) {
@@ -764,6 +782,13 @@ NSPopoverDelegate>
 - (void)IAPPurchaseSuccess:(NSNotification *)notification {
     dispatch_async(dispatch_get_main_queue(), ^{
         [self reloadData];
+        
+#if VERSION_FREE
+#if VERSION_DMG
+#else
+        [[KMProductCompareWC shared] closeAction];
+#endif
+#endif
     });
 }