Kaynağa Gözat

【综合】7天免费试用流程补充

tangchao 6 gün önce
ebeveyn
işleme
e2d2ad5ff9

+ 11 - 2
PDF Office/PDF Master/Class/Purchase/DMG/KMPurchaseEmbeddedWindowController.swift

@@ -553,8 +553,17 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
         let insting = Float(showSinglePriceString())
         listPrice = Float(String(format: "%.2f", Float((insting ?? 0) * Float(pdfCount)))) ?? 0  //单价*购买个数
         
-        if _product_code == "advanced-annual-subscription-trail"       ||
-            _product_code == "advanced-annual-subscription-blackFive"   ||
+        if _product_code == KMAdvancedAnnualSubscriptionTrailCodeKey_DMG {
+            var tipsString = NSLocalizedString("7-day free trial, then auto-renew at %@/year", tableName: "MemberCenterLocalizable", comment: "")
+            let value = String(format: "%@ %.2f", abbreviation, insting ?? 0)
+            let fullString = String(format: tipsString, value)
+            
+            prmiumLabel.stringValue = fullString
+            original1 = Float(showOrgPriceString()) ?? 0
+            discount1 = Float(showOrgShowPriceString()) ?? 0
+            paySum = discount1
+            discount = listPrice - paySum
+        } else if _product_code == "advanced-annual-subscription-blackFive"   ||
             _product_code == "advanced-permanent-blackFive"   ||
             _product_code == KMAISubscriptionYearTrailCodeKey_DMG {
             // 全平台高级版年订阅             99.9 美金,带免费试用

+ 2 - 0
PDF Office/PDF Master/MemberCenter/Assets/en.lproj/MemberCenterLocalizable.strings

@@ -196,3 +196,5 @@
 "%.2f/Permanent Plan" = "%.2f/Permanent Plan";
 "%.2f/monthly, auto-renewal" = "%.2f/monthly, auto-renewal";
 "%.2f/half a year, auto-renewal" = "%.2f/half a year, auto-renewal";
+
+"7-day free trial, then auto-renew at %@/year" = "7-day free trial, then auto-renew at %@/year";

+ 2 - 0
PDF Office/PDF Master/MemberCenter/Assets/zh-Hans.lproj/MemberCenterLocalizable.strings

@@ -191,3 +191,5 @@
 "%.2f/half a year, auto-renewal" = "%.2f/半年,自动续费";
 "%.2f/monthly, auto-renewal" = "%.2f/月,自动续费";
 "%.2f/Permanent Plan" = "%.2f/永久版";
+
+"7-day free trial, then auto-renew at %@/year" = "前7天免费试用,到期按%@/年自动续费";

+ 2 - 0
PDF Office/PDF Master/MemberCenter/Assets/zh-Hant.lproj/MemberCenterLocalizable.strings

@@ -192,3 +192,5 @@
 "%.2f/half a year, auto-renewal" = "%.2f/半年,自動續費";
 "%.2f/monthly, auto-renewal" = "%.2f/月, 自動續費";
 "%.2f/Permanent Plan" = "%.2f/永久版";
+
+"7-day free trial, then auto-renew at %@/year" = "前7天免費試用, 到期按%@/年自動續費";

+ 14 - 0
PDF Office/PDF Master/MemberCenter/View/KMSignUpView.swift

@@ -502,6 +502,20 @@ class KMSignUpView: KMBaseXibView {
         window?.showWaitingView()
         viewModel.signUpAction { [weak self] result, _ in
             self?.window?.hideWaitingView()
+            
+#if VERSION_DMG
+            if result == true {
+                if KMDataManager.ud_bool(forKey: KMAdvancedAnnualTrailKey) {
+                    DispatchQueue.main.async {
+                        let winC = KMPurchaseEmbeddedWindowController.currentCode(KMAdvancedAnnualSubscriptionTrailCodeKey_DMG)
+                        winC.showWindow(nil)
+                        winC.window?.center()
+                    }
+                    
+                    KMDataManager.ud_set(false, forKey: KMAdvancedAnnualTrailKey)
+                }
+            }
+#endif
         }
     }
     

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

@@ -8,6 +8,9 @@
 
 import Cocoa
 
+// 7天免费试用 高级版
+let KMAdvancedAnnualTrailKey                = "KMAdvancedAnnualTrailKey"
+
 class KMOpenDMGPopupBootWC: NSWindowController {
     
     @IBOutlet weak var titleLabel: NSTextField!
@@ -100,6 +103,9 @@ class KMOpenDMGPopupBootWC: NSWindowController {
         freeBox.downCallback = { [weak self](downEntered: Bool, mouseBox: KMBox, event) -> Void in
             guard let self = self else { return }
             if downEntered {
+                // 存储标识
+                KMDataManager.ud_set(true, forKey: KMAdvancedAnnualTrailKey)
+                
                 self.viewModel.getVipFree()
                 self.window?.close()
             }