Browse Source

【DMG】补充领取AI

tangchao 3 months ago
parent
commit
0c3ed8793f

+ 0 - 30
PDF Office/PDF Master/Class/Purchase/DMG/KMPurchaseEmbeddedWindowController.swift

@@ -352,31 +352,6 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
         
         addbox.fillColor =  NSColor(named: "0E1114 1") ?? .white
         removebox.fillColor =  NSColor(named: "0E1114 1") ?? .white
-        
-        firmLabel.isEditable = false
-        firmLabel.isSelectable = true
-        firmLabel.allowsEditingTextAttributes = true
-        firmLabel.textColor = NSColor.black
-        firmLabel.font = NSFont.SFProTextRegularFont(14.0)
-        let firmString = NSLocalizedString("If you need to manage seats in PDF Reader Pro, please purchase the %@.", tableName: "MemberCenterLocalizable", comment: "")
-        let enterpriseStr = NSLocalizedString("enterprise version", tableName: "MemberCenterLocalizable", comment: "")
-        let fireFullString = String(format: firmString, enterpriseStr)
-        let firmLinkColor = NSColor(named: "4982E6") ?? NSColor.blue
-        let attri = NSMutableAttributedString(string: fireFullString, attributes: [.foregroundColor : firmLinkColor, .font : NSFont.SFProTextRegularFont(14.0)])
-        // 定义链接的范围
-        let enterpriseRange = (fireFullString as NSString).range(of: enterpriseStr)
-        let firmFont = NSFont.SFProTextRegularFont(14.0) // 与普通文本相同的字体
-        attri.addAttributes([
-            .foregroundColor: NSColor(named: "0E1114") ?? NSColor.black as Any,
-            .font: firmFont
-        ], range: (fireFullString as NSString).range(of: enterpriseStr))
-        attri.addAttributes([
-            .foregroundColor: firmLinkColor,
-            .link: NSLocalizedString("https://www.pdfreaderpro.com/store/lynxpdfeditor", comment: ""),
-            .font: firmFont
-        ], range: enterpriseRange)
-        firmLabel.attributedStringValue = attri
-        firmLabel.isHidden = true
 
         textbox.fillColor = NSColor(named: "0E1114 2") ?? .white
         yourOrderLabel.stringValue = NSLocalizedString("Your Order", comment: "")
@@ -1126,9 +1101,6 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
                 wechatPayButton.isHidden = false
             }
             amountTextField1.stringValue = String(pdfCount)
-            
-            let viewHidden = pdfCount <= 1
-            firmLabel.isHidden = viewHidden
         }
         
         // 价格刷新
@@ -1994,7 +1966,6 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
                 self.scanLabel.stringValue = NSLocalizedString("Scan QR Code with Alipay", comment: "")
                 self.payTypeImageView.image = NSImage(named: "EmbeddedPayment28")
             }
-
             let img = self.convertBase64StringToNSImage(base64String: urlPath)
             self.qrCodeImageView.image = img
             
@@ -2093,7 +2064,6 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
                     let requestDic: NSDictionary = dic["result"] as? NSDictionary ?? [:]
                     let status:String = requestDic["status"]  as? String ?? ""
                     if(status.uppercased() == "COMPLETED") {
-                        KMPurchaseSuccessWindowController.shared.showWindow(nil)
                         NotificationCenter.default.post(name: NSNotification.Name(rawValue: "KMIAPSubscriptionLoadedNotification"), object: nil)
                         self.stopPolling()
                         

+ 10 - 0
PDF Office/PDF Master/Class/Purchase/IAPProductsManager.h

@@ -15,6 +15,16 @@ extern NSString * const KMIAPProductRestoreFailedNotification;
 extern NSString * const KMIAPProductRestoreFinishedNotification;
 extern NSString * const KMIAPSubscriptionLoadedNotification;
 
+extern NSString * const KMStandardAnnualSubscriptionCodeKey; // "productName": "PDF Reader Pro Standard - Annual Plan"
+extern NSString * const KMAdvancedAnnualSubscriptionCodeKey; //"productName": "PDF Reader Pro Advanced - Annual Plan"
+extern NSString * const KMAdvancedPermanentCodeKey; // "productName": "PDF Reader Pro Permanent"
+
+extern NSString * const KMAISubscriptionYearTrailCodeKey;               // 0元试用AI 年订阅 产品Code
+extern NSString * const KMAISubscriptionMonthCodeKey;                   // 0元试用AI 月订阅 产品Code
+
+extern NSString * const KMAdvancedPermanentBlackFiveCodeKey; // "productName": "PDF Reader Pro Permanent"
+extern NSString * const KMAdvancedAnnualSubscriptionBlackFiveCodeKey; //"productName": "PDF Reader Pro Advanced - Annual Plan"
+
 @class SKProduct;
 
 @interface IAPProduct : NSObject

+ 12 - 0
PDF Office/PDF Master/Class/Purchase/IAPProductsManager.m

@@ -48,6 +48,16 @@ NSString * const KMStandardAddDevicesAllAccessPack_12Months_Pro = @"com.pdfreade
 NSString * const KMAdvancedAddDevicesAllAccessPack12Months_Pro = @"com.pdfreaderpro.mac.advanced_add_devices_all_access_pack_advanced_annual.001"; // 产品名称:advanced_add_devices_all_access_pack_12months(多设备包订阅)
 NSString * const KMAdvancedAdd2DevicesAllAccessPack12Months_Pro = @"com.pdfreaderpro.mac.advanced_add_2_devices_all_access_pack_advanced_annual.001"; // 产品名称:advanced_add_2_devices_all_access_pack_12months(多设备包订阅)
 
+NSString * const KMStandardAnnualSubscriptionCodeKey                    = @"standard-annual-subscription"; // "productName": "PDF Reader Pro Standard - Annual Plan"
+NSString * const KMAdvancedAnnualSubscriptionCodeKey                    = @"advanced-annual-subscription"; //"productName": "PDF Reader Pro Advanced - Annual Plan"
+NSString * const KMAdvancedPermanentCodeKey                             = @"advanced-permanent"; // "productName": "PDF Reader Pro Permanent"
+
+NSString * const KMAISubscriptionYearTrailCodeKey                       = @"ai-subscription-year-trail"; // 0元试用AI 年订阅 产品Code
+NSString * const KMAISubscriptionMonthCodeKey                           = @"ai-subscription-month"; // 0元试用AI 月订阅 产品Code
+
+NSString * const KMAdvancedPermanentBlackFiveCodeKey                    = @"advanced-permanent-blackFive"; // "productName": "PDF Reader Pro Permanent"
+NSString * const KMAdvancedAnnualSubscriptionBlackFiveCodeKey           = @"advanced-annual-subscription-blackFive"; //"productName": "PDF Reader Pro Advanced - Annual Plan"
+
 //NSString * const KMNewMonthLicenseProductIdentifier = @"com.pdftechnologies.pdfreader.mac.yearly.002.Test";
 NSString * const KMAllLicenseProductIdentifier = @"com.pdfreaderpro.mac_free.member.all_access_pack_permanent_license.001";
 NSString * const KMPDFToOfficeLicenseProductIdentifier = @"com.pdfreaderpro.mac.member.pdf_to_office_pack_permanent_license.001";
@@ -365,11 +375,13 @@ NSString * const KMIAPSubscriptionLoadedNotification = @"KMIAPSubscriptionLoaded
         self.DMGPDFReaderProPermanent.isOffers = isOffers;
 
         self.DMGPDFReaderProAI_Annual = [[[IAPProduct alloc] init] autorelease];
+        self.DMGPDFReaderProAI_Annual.productIdentifier = KMAISubscriptionYearTrailCodeKey;
         self.DMGPDFReaderProAI_Annual.priceNumber = @(125.99);
         self.DMGPDFReaderProAI_Annual.offersPriceNumber = @(125.99);
         self.DMGPDFReaderProAI_Annual.isOffers = isOffers;
 
         self.DMGPDFReaderProAI_Monthly = [[[IAPProduct alloc] init] autorelease];
+        self.DMGPDFReaderProAI_Monthly.productIdentifier = KMAISubscriptionMonthCodeKey;
         self.DMGPDFReaderProAI_Monthly.priceNumber = @(14.99);
         self.DMGPDFReaderProAI_Monthly.offersPriceNumber = @(14.99);
         self.DMGPDFReaderProAI_Monthly.isOffers = isOffers;

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

@@ -103,11 +103,17 @@ class KMFreeGetAIWC: NSWindowController {
             guard let self = self else { return }
             
         }
+        
         aitoolsBox.downCallback = { [weak self](downEntered: Bool, mouseBox: KMBox, event) -> Void in
             guard let self = self else { return }
 #if VERSION_FREE
 #if VERSION_DMG
     // DMG
+#if VERSION_DMG
+            let embeddedWC = KMPurchaseEmbeddedWindowController.currentCode(KMAISubscriptionYearTrailCodeKey)
+            embeddedWC.showWindow(nil)
+            embeddedWC.window?.center()
+#endif
 #else
             self.window?.showWaitingView()