Browse Source

【会员系统】修复DMG开启比较表崩溃

wanjun 1 week ago
parent
commit
4b3acb0b48

+ 11 - 11
PDF Office/PDF Master/MemberCenter/Model/KMMemberCenterManager.swift

@@ -867,17 +867,17 @@ class KMMemberCenterManager: NSObject {
                 var cycle = 0
                 var code = ""
                 var cnyPrice = ""
-                if let token = dict1["id"] { id = token as! String }
-                if let token = dict1["productName"] { productName = token as! String }
-                if let token = dict1["price"] { price = token as! String }
-                if let token = dict1["maxDeviceNum"] { maxDeviceNum = token as! Int }
-                if let token = dict1["levels"] { levels = token as! String }
-                if let token = dict1["platforms"] { platforms = token as! String }
-                if let token = dict1["productLineId"] { productLineId = token as! Int }
-                if let token = dict1["paymentModel"] { paymentModel = token as! Int }
-                if let token = dict1["cycle"] { cycle = token as! Int }
-                if let token = dict1["code"] { code = token as! String }
-                if let token = dict1["cnyPrice"] { cnyPrice = token as! String }
+                if let token = dict1["id"] as? String { id = token }
+                if let token = dict1["productName"] as? String { productName = token }
+                if let token = dict1["price"] as? Double { price = String(format: "%.2f", token) }
+                if let token = dict1["maxDeviceNum"] as? Int { maxDeviceNum = token }
+                if let token = dict1["levels"] as? String { levels = token }
+                if let token = dict1["platforms"] as? String { platforms = token }
+                if let token = dict1["productLineId"] as? Int { productLineId = token }
+                if let token = dict1["paymentModel"] as? Int { paymentModel = token }
+                if let token = dict1["cycle"] as? Int { cycle = token }
+                if let token = dict1["code"] as? String { code = token }
+                if let token = dict1["cnyPrice"] as? String { cnyPrice = token }
                 let products = KMListingProductsModel(id: id, productName: productName, price: price, maxDeviceNum: maxDeviceNum, levels: levels, platforms: platforms, productLineId: productLineId, paymentModel: paymentModel, cycle: cycle, code: code, cnyPrice: cnyPrice)
                 results.append(products)
             }

File diff suppressed because it is too large
+ 20 - 14
PDF Office/PDF Master/MemberCenter/WindowsController/KMProductCompareWC.swift