3
0

2 Коммиты d77eb164c0 ... 5c5283c07e

Автор SHA1 Сообщение Дата
  zenghong 5c5283c07e Merge branch 'develop_PDFReaderPro_V4.7.0' of git.kdan.cc:Mac_PDF/PDF_Office into develop_PDFReaderPro_V4.7.0 1 неделя назад
  zenghong a1a79b27e5 【会员系统】DMG 购买订单价格随支付方式修改 1 неделя назад

+ 60 - 12
PDF Office/PDF Master/Class/Purchase/DMG/KMPurchaseEmbeddedWindowController.swift

@@ -712,8 +712,16 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
         var discount1: Float = 0.0
         var original1: Float = 0.0
         var abbreviation = "USD"
-        if NSLocalizedString("USD", comment: "") == "CNY" {
-            abbreviation = "CNY"
+        
+        if self.paymentMethod == .wxpay {
+            if NSLocalizedString("USD", comment: "") == "CNY" {
+                abbreviation = "CNY"
+            }
+        }
+        if self.paymentMethod == .alipay {
+            if NSLocalizedString("USD", comment: "") == "CNY" {
+                abbreviation = "CNY"
+            }
         }
         
         if _dmgProductType == .advanced_annual_subscription_trail       ||
@@ -745,9 +753,20 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
             }
             var fullString = String(format: tipsString, product_Info.price)
             let preferredLanguage = Locale.preferredLanguages.first ?? "en"
+            
             if preferredLanguage.hasPrefix("zh-Hans") || preferredLanguage.hasPrefix("zh-Hant") {
                 fullString = String(format: tipsString, product_Info.cnyPrice)
             }
+            if self.paymentMethod == .wxpay {
+                if preferredLanguage.hasPrefix("zh-Hans") || preferredLanguage.hasPrefix("zh-Hant") {
+                    fullString = String(format: tipsString, product_Info.cnyPrice)
+                }
+            }
+            if self.paymentMethod == .alipay {
+                if preferredLanguage.hasPrefix("zh-Hans") || preferredLanguage.hasPrefix("zh-Hant") {
+                    fullString = String(format: tipsString, product_Info.cnyPrice)
+                }
+            }
             
             prmiumLabel.stringValue = String(format: "%@ %@", abbreviation, fullString)
             
@@ -799,9 +818,18 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
             
             discount1 = product_Info.price.floatValue //优惠价格拿原价
             original1 = product_Info.price.floatValue
-            if preferredLanguage.hasPrefix("zh-Hans") || preferredLanguage.hasPrefix("zh-Hant") {
-                discount1 = product_Info.cnyPrice.floatValue  //优惠价格拿原价
-                original1 = product_Info.cnyPrice.floatValue
+            
+            if self.paymentMethod == .wxpay {
+                if preferredLanguage.hasPrefix("zh-Hans") || preferredLanguage.hasPrefix("zh-Hant") {
+                    discount1 = product_Info.cnyPrice.floatValue  //优惠价格拿原价
+                    original1 = product_Info.cnyPrice.floatValue
+                }
+            }
+            if self.paymentMethod == .alipay {
+                if preferredLanguage.hasPrefix("zh-Hans") || preferredLanguage.hasPrefix("zh-Hant") {
+                    discount1 = product_Info.cnyPrice.floatValue  //优惠价格拿原价
+                    original1 = product_Info.cnyPrice.floatValue
+                }
             }
             
             listPrice = original1 * Float(amountTextField1.stringValue)!
@@ -832,8 +860,15 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
             }
             var fullString = String(format: tipsString, product_Info.price)
             let preferredLanguage = Locale.preferredLanguages.first ?? "en"
-            if preferredLanguage.hasPrefix("zh-Hans") || preferredLanguage.hasPrefix("zh-Hant") {
-                fullString = String(format: tipsString, product_Info.cnyPrice)
+            if self.paymentMethod == .wxpay {
+                if preferredLanguage.hasPrefix("zh-Hans") || preferredLanguage.hasPrefix("zh-Hant") {
+                    fullString = String(format: tipsString, product_Info.cnyPrice)
+                }
+            }
+            if self.paymentMethod == .alipay {
+                if preferredLanguage.hasPrefix("zh-Hans") || preferredLanguage.hasPrefix("zh-Hant") {
+                    fullString = String(format: tipsString, product_Info.cnyPrice)
+                }
             }
             
             prmiumLabel.stringValue = String(format: "%@ %@", abbreviation, fullString)
@@ -843,12 +878,23 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
                 discount1 = product_Info.displayPrice.floatValue //优惠价格拿更新后的批量价格
             }
             original1 = product_Info.price.floatValue
-            if preferredLanguage.hasPrefix("zh-Hans") || preferredLanguage.hasPrefix("zh-Hant") {
-                discount1 = product_Info.cnyPrice.floatValue  //优惠价格拿原价
-                if pdfCount > 1 , isBatchProductPriceGetFinsed {
-                    discount1 = product_Info.displayCnyPrice.floatValue //优惠价格拿更新后的批量价格
+            if self.paymentMethod == .wxpay {
+                if preferredLanguage.hasPrefix("zh-Hans") || preferredLanguage.hasPrefix("zh-Hant") {
+                    discount1 = product_Info.cnyPrice.floatValue  //优惠价格拿原价
+                    if pdfCount > 1 , isBatchProductPriceGetFinsed {
+                        discount1 = product_Info.displayCnyPrice.floatValue //优惠价格拿更新后的批量价格
+                    }
+                    original1 = product_Info.cnyPrice.floatValue
+                }
+            }
+            if self.paymentMethod == .alipay {
+                if preferredLanguage.hasPrefix("zh-Hans") || preferredLanguage.hasPrefix("zh-Hant") {
+                    discount1 = product_Info.cnyPrice.floatValue  //优惠价格拿原价
+                    if pdfCount > 1 , isBatchProductPriceGetFinsed {
+                        discount1 = product_Info.displayCnyPrice.floatValue //优惠价格拿更新后的批量价格
+                    }
+                    original1 = product_Info.cnyPrice.floatValue
                 }
-                original1 = product_Info.cnyPrice.floatValue
             }
             
             listPrice = original1 * Float(amountTextField1.stringValue)!
@@ -1343,6 +1389,8 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
         emailErrorLabel(isReveal: false)
         confirmPayment(isConfirm: false)
         paymentMethod = KMPaymentType(rawValue: uint32(sender.tag)) ?? .paypal
+        // 价格刷新
+        priceRefresh(productsModel: _product_Info)
     }
     
     @IBAction func couponButtonAction(_ sender: NSButton) {