Преглед на файлове

【综合】合并代码

tangchao преди 6 месеца
родител
ревизия
ec10e5f8c9

+ 52 - 5
PDF Office/PDF Master/Class/Purchase/DMG/KMPurchaseEmbeddedWindowController.swift

@@ -56,6 +56,7 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
     @IBOutlet weak var discountPriceLabel3: NSTextField! // 折扣
     @IBOutlet weak var extendedButton1: NSButton!
     
+    @IBOutlet weak var couponView: NSView!
     @IBOutlet weak var couponButton: NSButton!
     @IBOutlet weak var couponBox: NSBox!
     @IBOutlet weak var coupomTextField: NSTextField!
@@ -762,9 +763,6 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
         paySumLabel1.stringValue = String(format: "%@ %@", abbreviation, String(format: "%.2f", paySum))
         
         if self.discountScale == "" && self.discountAmount == "" {
-            if lastPriceLabel1.stringValue != paySumLabel1.stringValue {
-                couponButton.isHidden = true
-            }
             refreshApplyButton(isReveal: true)
         } else {
             refreshApplyButton(isReveal: false)
@@ -772,8 +770,10 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
         
         if discount == 0 {
             discountView.isHidden = true
+            couponView.isHidden = false
         } else {
             discountView.isHidden = false
+            couponView.isHidden = true
         }
         discountLayoutConstraint.constant = discountView.isHidden ? -CGRectGetHeight(discountView.bounds) : 8
     }
@@ -1003,6 +1003,20 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
                             self.refreshCouponError(isReveal: true)
                         }
                     } else {
+                        if dataInfo.keys.contains("limit_product_code") {
+                            if let limit_product_code = dataInfo["limit_product_code"] {
+                                if let limitCode = limit_product_code as? String {
+                                    if limitCode.count > 0 {
+                                        if self.productID != limitCode {
+                                            self.couponClearButton.isHidden = false
+                                            self.coupomErrorLabel.stringValue = NSLocalizedString("The coupon code is invalid. Please try again.", comment: "")
+                                            self.refreshCouponError(isReveal: true)
+                                            return
+                                        }
+                                    }
+                                }
+                            }
+                        }
                         if dataInfo["discount"] is NSNull && dataInfo["price"] is NSNull {
                             self.coupomErrorLabel.stringValue = NSLocalizedString("The coupon code is invalid. Please try again.", comment: "")
                             self.refreshCouponError(isReveal: true)
@@ -1129,7 +1143,15 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
         }
         self._buyProduct(productID, count: pdfCount, discountId: couponCode, payment: paymentMethod, license: licenseCode, email: emailTextField.stringValue) { [weak self] info, err in
             guard let self = self else { return }
-            if err != nil {return}
+            if err != nil {
+                let alert = NSAlert()
+                alert.alertStyle = .critical
+                alert.messageText = NSLocalizedString("Please check if the information is wrong or the network is error.", comment: "")
+                alert.addButton(withTitle: NSLocalizedString("Yes", comment: ""))
+                alert.runModal()
+                
+                return
+            }
             if let dataInfo = info {
                 self.orderID = dataInfo["trade_no"] as! String
                 let page_pay_url = dataInfo["page_pay_url"] as! String
@@ -1144,6 +1166,11 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
                 }
             } else {
                 // 数据错误
+                let alert = NSAlert()
+                alert.alertStyle = .critical
+                alert.messageText = NSLocalizedString("Please check if the information is wrong or the network is error.", comment: "")
+                alert.addButton(withTitle: NSLocalizedString("Yes", comment: ""))
+                alert.runModal()
             }
         }
     }
@@ -1606,6 +1633,13 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
 
     @objc private func performTask() {
         guard pollCount < maxPolls else {
+            timer?.invalidate()
+            timer = nil
+            DispatchQueue.main.async { [weak self] in
+                guard let self = self else { return }
+                self.embeddedPaymentPopWC?.close()
+                self.embeddedPaymentPopWC = nil
+            }
             return
         }
         
@@ -1620,7 +1654,20 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
         timer?.invalidate()
         timer = nil
         print("Polling task completed.")
-        if !AIInfoManager.default().aiInfoValid {
+        if productID == "com.brother.pdfreaderpro.ai.product_1" ||
+            productID == "com.brother.pdfreaderpro.mac.product_1+com.brother.pdfreaderpro.ai.product_1" ||
+            productID == "com.brother.pdfreaderpro.mac.product_3+com.brother.pdfreaderpro.ai.product_1" ||
+            productID == "com.brother.pdfreaderpro.cross.platform.product_3+com.brother.pdfreaderpro.ai.product_1"{
+            if !AIInfoManager.default().aiInfoValid {
+                if self.embeddedPaymentPopWC != nil {
+                    DispatchQueue.main.async { [weak self] in
+                        guard let self = self else { return }
+                        self.embeddedPaymentPopWC?.close()
+                        self.embeddedPaymentPopWC = nil
+                    }
+                }
+            }
+        } else {
             if self.embeddedPaymentPopWC != nil {
                 DispatchQueue.main.async { [weak self] in
                     guard let self = self else { return }

+ 3 - 5
PDF Office/PDF Master/Class/Purchase/DMG/KMPurchaseEmbeddedWindowController.xib

@@ -34,6 +34,7 @@
                 <outlet property="couponBox" destination="ECb-Ab-7Fq" id="h7u-Fk-i1A"/>
                 <outlet property="couponButton" destination="16N-22-eUq" id="ufx-sv-rRp"/>
                 <outlet property="couponClearButton" destination="3y5-gc-zaR" id="vEZ-gi-ihQ"/>
+                <outlet property="couponView" destination="o5K-ag-Vbf" id="eVy-hs-cjQ"/>
                 <outlet property="discountLabel" destination="zuM-1n-klX" id="t9g-Ms-UQK"/>
                 <outlet property="discountLabel1" destination="n83-tW-ibP" id="9tA-NM-reb"/>
                 <outlet property="discountLayoutConstraint" destination="c55-3v-q3H" id="X98-LV-mYs"/>
@@ -145,17 +146,15 @@
                                                     </textField>
                                                 </subviews>
                                                 <constraints>
-                                                    <constraint firstItem="D4J-Se-9AB" firstAttribute="top" secondItem="hQ9-hE-7SE" secondAttribute="top" constant="2" id="7aV-Ot-vTx"/>
                                                     <constraint firstAttribute="bottom" secondItem="D4J-Se-9AB" secondAttribute="bottom" constant="2" id="OtY-Cy-YeS"/>
                                                     <constraint firstItem="D4J-Se-9AB" firstAttribute="centerY" secondItem="hQ9-hE-7SE" secondAttribute="centerY" id="TBD-GV-YFs"/>
-                                                    <constraint firstItem="D4J-Se-9AB" firstAttribute="top" secondItem="hQ9-hE-7SE" secondAttribute="top" constant="2" id="U0K-IA-VLi"/>
                                                     <constraint firstAttribute="bottom" secondItem="D4J-Se-9AB" secondAttribute="bottom" constant="2" id="cCQ-Co-b3S"/>
                                                     <constraint firstItem="D4J-Se-9AB" firstAttribute="leading" secondItem="hQ9-hE-7SE" secondAttribute="leading" id="kC9-ph-ha2"/>
                                                     <constraint firstAttribute="trailing" secondItem="D4J-Se-9AB" secondAttribute="trailing" id="s8e-kx-aIL"/>
                                                 </constraints>
                                             </customView>
                                             <customView translatesAutoresizingMaskIntoConstraints="NO" id="pJQ-if-sS8">
-                                                <rect key="frame" x="380" y="8" width="216" height="44"/>
+                                                <rect key="frame" x="380" y="6" width="216" height="44"/>
                                                 <subviews>
                                                     <button translatesAutoresizingMaskIntoConstraints="NO" id="yf6-a4-ZeM">
                                                         <rect key="frame" x="0.0" y="0.0" width="72" height="44"/>
@@ -205,8 +204,7 @@
                                         </subviews>
                                         <constraints>
                                             <constraint firstItem="hQ9-hE-7SE" firstAttribute="top" secondItem="v5U-lN-3Ak" secondAttribute="top" id="7QW-6W-poI"/>
-                                            <constraint firstItem="pJQ-if-sS8" firstAttribute="top" secondItem="hQ9-hE-7SE" secondAttribute="bottom" constant="8" id="fto-PR-14K"/>
-                                            <constraint firstAttribute="bottom" secondItem="pJQ-if-sS8" secondAttribute="bottom" constant="8" id="hs0-Si-Cdr"/>
+                                            <constraint firstAttribute="bottom" secondItem="pJQ-if-sS8" secondAttribute="bottom" constant="6" id="hs0-Si-Cdr"/>
                                         </constraints>
                                     </view>
                                     <constraints>

+ 6 - 0
PDF Office/PDF Master/Strings/ar.lproj/Localizable.strings

@@ -4698,4 +4698,10 @@
 "Scan QR Code with WeChat" = "افتح WeChat وامسح رمز الاستجابة السريعة ضوئيًا";
 "The coupon code has expired." = "لقد انتهت صلاحية القسيمة الخاصة بك.";
 "The coupon code has been used, please change your coupon code." = "لقد تم استخدام قسيمتك، يرجى تغيير رمز القسيمة.";
+
 "New Feature" = "New";
+
+//"By submitting this order, I agree to the %@ and %@ for subscription products" = "من خلال تقديم هذا الطلب، أوافق على%@ سياسة الخصوصية %@وشروط الخدمة لمنتجات الاشتراك";
+//"Are you a student or a professor? %@ / Want a volume purchase? Please %@." = "هل أنت طالب أو أستاذ؟ %@  احصل على عرض خاص  هل تريد شراء كميات كبيرة؟ %@  يرجى الاتصال بنا.";
+//"Get Special Offer" = "يرجى الاتصال بنا.";
+//"Contact Us" = "احصل على عرض خاص";

+ 7 - 0
PDF Office/PDF Master/Strings/de.lproj/Localizable.strings

@@ -3063,4 +3063,11 @@
 "Scan QR Code with WeChat" = "Öffnen Sie WeChat und scannen Sie den QR-Code";
 "The coupon code has expired." = "Ihr Gutschein ist abgelaufen.";
 "The coupon code has been used, please change your coupon code." = "Ihr Gutschein wurde verwendet. Bitte ändern Sie den Gutscheincode.";
+
 "New Feature" = "New";
+
+"By submitting this order, I agree to the %@ and %@ for subscription products" = "Mit dem Absenden dieser Bestellung stimme ich den Datenschutzbestimmungen %@ und Nutzungsbedingungen %@ für Abonnementprodukte zu";
+"Are you a student or a professor? %@ / Want a volume purchase? Please %@." = "Sind Sie Student oder Professor? %@ / Möchten Sie einen Mengenkauf? %@";
+"Get Special Offer" = "Erhalten Sie ein Sonderangebot";
+"Contact Us" = "Bitte kontaktieren Sie uns.";
+

+ 7 - 4
PDF Office/PDF Master/Strings/en.lproj/Localizable.strings

@@ -4213,13 +4213,9 @@
 "Please enter right license code. How to Retrieve License." = "Please enter right license code. How to Retrieve License.";
 "Input license code previously activated the app" = "Input license code previously activated the app";
 "By submitting this order, I agree to the Privacy Policy and Terms of Service for subscription products" = "By submitting this order, I agree to the Privacy Policy and Terms of Service for subscription products";
-"By submitting this order, I agree to the %@ and %@ for subscription products" = "By submitting this order, I agree to the %@ and %@ for subscription products";
 "Continue to Pay" = "Continue to Pay";
 "1 license code to activate 2 PCs. (Mac and Windows)" = "1 license code to activate 2 PCs. (Mac and Windows)";
 "Pay sum" = "Pay sum";
-"Are you a student or a professor? %@ / Want a volume purchase? Please %@." = "Are you a student or a professor? %@ / Want a volume purchase? Please %@.";
-"Get Special Offer" = "Get Special Offer";
-"Contact Us" = "Contact Us";
 "Applied" = "Applied";
 "Please enter a coupon code." = "Please enter a coupon code.";
 "Please enter your email for license receiving." = "Please enter your email for license receiving.";
@@ -4232,4 +4228,11 @@
 "The coupon code has been used, please change your coupon code." = "The coupon code has been used, please change your coupon code.";
 "Purchased" = "Purchased";
 "Successfully" = "Successfully";
+
 "New Feature" = "New";
+
+"By submitting this order, I agree to the %@ and %@ for subscription products" = "By submitting this order, I agree to the %@ and %@ for subscription products";
+"Are you a student or a professor? %@ / Want a volume purchase? Please %@." = "Are you a student or a professor? %@ / Want a volume purchase? Please %@.";
+"Get Special Offer" = "Get Special Offer";
+"Contact Us" = "Contact Us";
+

+ 7 - 0
PDF Office/PDF Master/Strings/es.lproj/Localizable.strings

@@ -3145,4 +3145,11 @@
 "Scan QR Code with WeChat" = "Abra WeChat y escanee el código QR";
 "The coupon code has expired." = "Tu cupón ha caducado.";
 "The coupon code has been used, please change your coupon code." = "Su cupón ha sido utilizado, cambie el código del cupón.";
+
 "New Feature" = "New";
+
+"By submitting this order, I agree to the %@ and %@ for subscription products" = "Al enviar este pedido, acepto la Política de privacidad %@ y los Términos de servicio para productos %@ de suscripción.";
+"Are you a student or a professor? %@ / Want a volume purchase? Please %@." = "¿Eres estudiante o profesor? %@ / ¿Quiere una compra por volumen? %@";
+"Get Special Offer" = "Obtenga una oferta especial";
+"Contact Us" = "Por favor contáctenos.";
+

+ 5 - 0
PDF Office/PDF Master/Strings/fr.lproj/Localizable.strings

@@ -3027,5 +3027,10 @@
 "Scan QR Code with WeChat" = "Ouvrez WeChat et scannez le code QR";
 "The coupon code has expired." = "Votre coupon a expiré.";
 "The coupon code has been used, please change your coupon code." = "Votre coupon a été utilisé, veuillez modifier le code promo.";
+
 "New Feature" = "New";
 
+"By submitting this order, I agree to the %@ and %@ for subscription products" = "En soumettant cette commande, j'accepte la politique de confidentialité %@ et les conditions d'utilisation %@ des produits par abonnement.";
+"Are you a student or a professor? %@ / Want a volume purchase? Please %@." = "Êtes-vous étudiant ou professeur? %@ / Vous souhaitez un achat en volume ? %@";
+"Get Special Offer" = "Obtenez une offre spéciale";
+"Contact Us" = "Veuillez nous contacter.";

+ 7 - 0
PDF Office/PDF Master/Strings/it.lproj/Localizable.strings

@@ -2941,4 +2941,11 @@
 "Scan QR Code with WeChat" = "Scansiona il codice QR con WeChat";
 "The coupon code has expired." = "Il codice coupon è scaduto.";
 "The coupon code has been used, please change your coupon code." = "Il codice coupon è stato utilizzato, modifica il codice coupon.";
+
 "New Feature" = "New";
+
+"By submitting this order, I agree to the %@ and %@ for subscription products" = "Inviando questo ordine, accetto l'Informativa sulla privacy %@ e i Termini di servizio %@ per i prodotti in abbonamento";
+"Are you a student or a professor? %@ / Want a volume purchase? Please %@." = "Sei uno studente o un professore? %@ / Desideri un acquisto a volume? %@";
+"Get Special Offer" = "Ottieni un'offerta speciale";
+"Contact Us" = "Per favore Contattaci.";
+

+ 7 - 0
PDF Office/PDF Master/Strings/ja.lproj/Localizable.strings

@@ -3220,4 +3220,11 @@
 "Scan QR Code with WeChat" = "WeChatでQRコードをスキャン";
 "The coupon code has expired." = "クーポンコードの有効期限が切れました。";
 "The coupon code has been used, please change your coupon code." = "クーポンコードは使用されていますので、クーポンコードを変更してください。";
+
 "New Feature" = "New";
+
+"By submitting this order, I agree to the %@ and %@ for subscription products" = "この注文を送信することにより、サブスクリプション製品のプライバシー ポリシー %@ とサービス利用規約 %@ に同意します";
+"Are you a student or a professor? %@ / Want a volume purchase? Please %@." = "あなたは学生ですか、それとも教授ですか?特別オファーを入手 %@ / 大量購入したいですか?お問い合わせください %@";
+"Get Special Offer" = "特別オファーを入手";
+"Contact Us" = "お問い合わせください.";
+

+ 7 - 0
PDF Office/PDF Master/Strings/nl.lproj/Localizable.strings

@@ -3100,4 +3100,11 @@
 "%@ for the first 6-month subscription" = "%@ voor het eerste abonnement van zes maanden";
 
 "Experience Now" = "Ervaar nu";
+
 "New Feature" = "New";
+
+"By submitting this order, I agree to the %@ and %@ for subscription products" = "Door deze bestelling te plaatsen, ga ik akkoord met %@ en de %@ voor abonnementsproducten";
+"Are you a student or a professor? %@ / Want a volume purchase? Please %@." = "Ben je student of hoogleraar? %@ / Wilt u een volumeaankoop? %@";
+"Get Special Offer" = "Ontvang een speciale aanbieding";
+"Contact Us" = "Neem contact met ons op.";
+

+ 7 - 0
PDF Office/PDF Master/Strings/pl.lproj/Localizable.strings

@@ -3157,4 +3157,11 @@
 "Scan QR Code with WeChat" = "Otwórz WeChat i zeskanuj kod QR";
 "The coupon code has expired." = "Twój kupon wygasł.";
 "The coupon code has been used, please change your coupon code." = "Twój kupon został wykorzystany. Zmień kod kuponu.";
+
 "New Feature" = "New";
+
+"By submitting this order, I agree to the %@ and %@ for subscription products" = "Przesyłając to zamówienie, wyrażam zgodę na Politykę prywatności %@ i Warunki korzystania z usług %@ produktów subskrypcyjnych";
+"Are you a student or a professor? %@ / Want a volume purchase? Please %@." = "Jesteś studentem lub profesorem? %@ / Chcesz dokonać zakupu zbiorczego? %@";
+"Get Special Offer" = "Skorzystaj z oferty specjalnej";
+"Contact Us" = "Skontaktuj się z nami.";
+

+ 6 - 0
PDF Office/PDF Master/Strings/pt.lproj/Localizable.strings

@@ -4619,4 +4619,10 @@
 "Scan QR Code with WeChat" = "Abra o WeChat e escaneie o código QR";
 "The coupon code has expired." = "Seu cupom expirou.";
 "The coupon code has been used, please change your coupon code." = "Seu cupom foi utilizado, altere o código do cupom.";
+
 "New Feature" = "New";
+
+"By submitting this order, I agree to the %@ and %@ for subscription products" = "Ao enviar este pedido, concordo com a Política de Privacidade %@ e os Termos de Serviço %@ para produtos de assinatura";
+"Are you a student or a professor? %@ / Want a volume purchase? Please %@." = "Você é aluno ou professor? %@ / Quer uma compra por volume? %@";
+"Get Special Offer" = "Obtenha oferta especial";
+"Contact Us" = "Entre em contato conosco.";

+ 7 - 0
PDF Office/PDF Master/Strings/ru.lproj/Localizable.strings

@@ -3091,4 +3091,11 @@
 "Scan QR Code with WeChat" = "Откройте WeChat и отсканируйте QR-код.";
 "The coupon code has expired." = "Срок действия вашего купона истек.";
 "The coupon code has been used, please change your coupon code." = "Ваш купон использован, измените код купона.";
+
 "New Feature" = "New";
+
+"By submitting this order, I agree to the %@ and %@ for subscription products" = "Отправляя этот заказ, я соглашаюсь с Политикой конфиденциальности %@ и Условиями обслуживания продуктов %@ по подписке.";
+"Are you a student or a professor? %@ / Want a volume purchase? Please %@." = "Вы студент или профессор? %@ / Хотите оптовую закупку? %@";
+"Get Special Offer" = "Получите специальное предложение";
+"Contact Us" = "Пожалуйста, свяжитесь с нами.";
+

+ 7 - 4
PDF Office/PDF Master/Strings/zh-Hans.lproj/Localizable.strings

@@ -4114,14 +4114,10 @@
 "The coupon code is invalid. Please try again." = "优惠劵代码无效、请重试。";
 "Please enter right license code. How to Retrieve License." = "请输入正确的许可证代码。如何检索许可证。";
 "Input license code previously activated the app" = "输入先前激活应用程序的许可证代码。";
-"By submitting this order, I agree to the %@ and %@ for subscription products" = "通过提交此订单,我同意订阅产品的%@和%@";
 "Continue to Pay" = "继续支付";
 "1 license code to activate 2 PCs. (Mac and Windows)" = "一个序列码可激活两台桌机设备(Mac和Windows)";
 "Pay sum" = "支付金额";
 "Are you a student or a professor? Get Special Offer / Want a volume purchase? Please Contact Us." = "点击此处申请教育折扣。申请批量采购折扣请联系我们。";
-"Are you a student or a professor? %@ / Want a volume purchase? Please %@." = "点击此处%@。申请批量采购折扣请%@。";
-"Get Special Offer" = "申请教育折扣";
-"Contact Us" = "联系我们";
 "Applied" = "已应用";
 "Please enter a coupon code." = "请输入优惠券码。";
 "Please enter your email for license receiving." = "请输入邮箱,用于接收序列码。";
@@ -4134,4 +4130,11 @@
 "The coupon code has been used, please change your coupon code." = "您的优惠券已被使用,请更换优惠券码。";
 "Purchased" = "购买";
 "Successfully" = "成功";
+
 "New Feature" = "新功能";
+
+"By submitting this order, I agree to the %@ and %@ for subscription products" = "通过提交此订单,我同意订阅产品的%@和%@";
+"Are you a student or a professor? %@ / Want a volume purchase? Please %@." = "点击此处%@。申请批量采购折扣请%@。";
+"Get Special Offer" = "申请教育折扣";
+"Contact Us" = "联系我们";
+

+ 6 - 3
PDF Office/PDF Master/Strings/zh-Hant.lproj/Localizable.strings

@@ -4245,12 +4245,9 @@
 "The coupon code is invalid. Please try again." = "優惠劵代碼無效、請重試。";
 "Please enter right license code. How to Retrieve License." = "請輸入正確的許可證代碼。";
 "Input license code previously activated the app" = "輸入先前啟動應用程式的許可證代碼。";
-"By submitting this order, I agree to the %@ and %@ for subscription products" = "提交此訂單,我同意訂閱產品的%@和%@";
 "Continue to Pay" = "繼續支付";
 "1 license code to activate 2 PCs. (Mac and Windows)" = "一個序號可啟動突變桌機設備(Mac和Windows)";
 "Pay sum" = "支付金額";
-"Are you a student or a professor? %@ / Want a volume purchase? Please %@." = "點擊此處%@。申請批量採購折扣%@。";
-"Get Special Offer" = "獲得特別優惠";
 "Contact Us" = "聯絡我們";
 "Applied" = "已申請";
 "Please enter a coupon code." = "請輸入優惠券碼。";
@@ -4264,4 +4261,10 @@
 "The coupon code has been used, please change your coupon code." = "您的優惠券已被使用,請更換優惠券碼。";
 "Purchased" = "購買";
 "Successfully" = "成功";
+
 "New Feature" = "新功能";
+
+"By submitting this order, I agree to the %@ and %@ for subscription products" = "提交此訂單,我同意訂閱產品的%@和%@";
+"Are you a student or a professor? %@ / Want a volume purchase? Please %@." = "點擊此處%@。申請批量採購折扣%@。";
+"Get Special Offer" = "獲得特別優惠";
+"Contact Us" = "聯絡我們";