Browse Source

【会员系统】更新数目或者优惠卷二维码数据

wangshuai 3 tháng trước cách đây
mục cha
commit
9b1944c352

+ 24 - 1
PDF Office/PDF Master/Class/Purchase/DMG/KMPurchaseEmbeddedWindowController.swift

@@ -700,7 +700,10 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
                 self?.product_Info.displayCnyPriceString = nil
                 self?.product_Info.individualPriceString = batchProductPrice.price
                 self?.product_Info.individualCnyPriceString = batchProductPrice.cnyPrice
-
+                
+                if self?._paymentMethod == .alipay || self?._paymentMethod == .wxpay {
+                    self?.updatePrice()
+                }
                 self?.priceRefresh(productsModel: self?.product_Info ?? KMListingProductsModel())
             }
         } else {
@@ -782,6 +785,10 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
                     self?.product_Info.individualCnyPriceString = couponModel.cnyPriceString
                     self?.product_Info.verifyofferCode = self?.coupomTextField.stringValue ?? ""
                     
+                    if self?._paymentMethod == .alipay || self?._paymentMethod == .wxpay {
+                        self?.updatePrice()
+                    }
+                    
                     self?.priceRefresh(productsModel: self?._product_Info ?? KMListingProductsModel())
                 }else {
                     let alert = NSAlert()
@@ -1161,6 +1168,22 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
         }
     }
     
+    private func updatePrice() {
+        if _paymentMethod == .wxpay {
+            wechatPayButton.image = NSImage(named: "EmbeddedPayment22")
+            wechatPayButton2.image = NSImage(named: "EmbeddedPayment22")
+            payBox.contentView = weChatPayView
+            weChatBox.fillColor = NSColor(named: "KMPurchaseBoxColor") ?? NSColor.blue
+            payBoxHeight.constant = 92.0
+        } else if _paymentMethod == .alipay {
+            alipayButton.image = NSImage(named: "EmbeddedPayment24")
+            payBox.contentView = weChatPayView
+            weChatBox.fillColor = NSColor(named: "KMPurchaseBoxColor") ?? NSColor.blue
+            payBoxHeight.constant = 92.0
+        }
+    }
+
+    
     func isSubscribeCode()-> Bool {//是否是订阅
         if(product_code == "standard-annual-subscription" ||
            product_code == "advanced-annual-subscription-blackFive" ||