Bladeren bron

【会员系统 】DMG结算界面初始化调整

zenghong 5 dagen geleden
bovenliggende
commit
2de46b952f

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

@@ -255,6 +255,18 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
         }
      }
     
+    @objc static func currentCode(_ productCode: String) -> KMPurchaseEmbeddedWindowController {
+        if currentWindowController != nil {
+            currentWindowController.product_code = productCode
+            return currentWindowController
+        } else {
+            let configWC: KMPurchaseEmbeddedWindowController = KMPurchaseEmbeddedWindowController.init(windowNibName: "KMPurchaseEmbeddedWindowController")
+            currentWindowController = configWC;
+            currentWindowController.product_code = productCode
+            return currentWindowController
+        }
+     }
+    
     @objc static func currentFirstTrialWC(_ productId: String) -> KMPurchaseEmbeddedWindowController {
         if currentWindowController != nil {
             currentWindowController.productID = productId
@@ -1795,7 +1807,7 @@ class KMPurchaseEmbeddedWindowController: NSWindowController {
                             if product.code == self?.product_code {
                                 self?.product_Info = product;
                                 //更新价格
-                                self.updateProduct_Info()
+                                self?.updateProduct_Info()
                                 break
                             }
                         }

+ 1 - 1
PDF Office/PDF Master/MemberCenter/WindowsController/KMProductCompareWC.swift

@@ -1066,7 +1066,7 @@ class KMProductCompareWC: NSWindowController {
             }
         }
         
-        let embeddedWC = KMPurchaseEmbeddedWindowController.currentWC(product ?? KMListingProductsModel())
+        let embeddedWC = KMPurchaseEmbeddedWindowController.currentCode(product?.code ?? "")
         embeddedWC.showWindow(nil)
         embeddedWC.window?.center()
 #else