Browse Source

【会员系统】购买界面ui

wangshuai 3 months ago
parent
commit
30a523fd10

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

@@ -352,6 +352,31 @@ 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: "")
@@ -1101,6 +1126,9 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
                 wechatPayButton.isHidden = false
             }
             amountTextField1.stringValue = String(pdfCount)
+            
+            let viewHidden = pdfCount <= 1
+            firmLabel.isHidden = viewHidden
         }
         
         // 价格刷新

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

@@ -177,5 +177,5 @@
 "If you have purchased multiple PDF Reader Pro Permanent in volume, check them in Account Center -> Transfer Benefits. %@" = "如您购买了多个永久版会员,可在用户中心-赠送会员中查看,%@";
 "Check Benefit" = "立即查看";
 
-"If you need to manage seats in PDF Reader Pro, please purchase the %@." = "如需团队席位管理功能,请前往购买。";
+"If you need to manage seats in PDF Reader Pro, please purchase the %@." = "如需团队席位管理功能,请前往购买。%@";
 "enterprise version" = "企业版";

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

@@ -178,5 +178,5 @@
 "If you have purchased multiple PDF Reader Pro Permanent in volume, check them in Account Center -> Transfer Benefits. %@" = "若您購買了多位永久版會員,可在用戶中心-積分會員中查看,%@";
 "Check Benefit" = "立即查看";
 
-"If you need to manage seats in PDF Reader Pro, please purchase the %@." = "如需團隊席位管理功能,請前往購買。";
+"If you need to manage seats in PDF Reader Pro, please purchase the %@." = "如需團隊席位管理功能,請前往購買。%@";
 "enterprise version" = "企業版";

+ 3 - 0
PDF Office/PDF Master/MemberCenter/WindowsController/KMProductCompareWC.swift

@@ -1078,11 +1078,14 @@ class KMProductCompareWC: NSWindowController {
     }
     
     @IBAction func appstorePurchaseAction(_ sender: NSButton) {
+#if !VERSION_DMG
         addWaitingView(to: window?.contentView ?? NSView())
+#endif
         model.appstorePurchaseAction(sender.tag) { [weak self] success, msg in
             guard let self = self else { return }
 
         }
+        
     }
     
     // MARK: - InAppPurchaseManager Notification