|
@@ -882,7 +882,6 @@ class KMMemberCenterManager: NSObject {
|
|
|
for dict1 in result_Array {
|
|
|
var id = ""
|
|
|
var productName = ""
|
|
|
- var price = NSNumber(value: 0.0)
|
|
|
var maxDeviceNum = 0
|
|
|
var levels = ""
|
|
|
var platforms = ""
|
|
@@ -890,11 +889,17 @@ class KMMemberCenterManager: NSObject {
|
|
|
var paymentModel = 0
|
|
|
var cycle = 0
|
|
|
var code = ""
|
|
|
+
|
|
|
+ var price = NSNumber(value: 0.0)
|
|
|
+ var displayPrice = NSNumber(value: 0.0)
|
|
|
+ var upgradePrice = NSNumber(value: 0.0)
|
|
|
var cnyPrice = NSNumber(value: 0.0)
|
|
|
+ var displayCnyPrice = NSNumber(value: 0.0)
|
|
|
+
|
|
|
|
|
|
if let token = dict1["id"] { id = token as? String ?? id }
|
|
|
if let token = dict1["productName"] { productName = token as? String ?? productName }
|
|
|
- if let token = dict1["price"] { price = token as? NSNumber ?? price }
|
|
|
+
|
|
|
if let token = dict1["maxDeviceNum"] { maxDeviceNum = token as? Int ?? maxDeviceNum }
|
|
|
if let token = dict1["levels"] { levels = token as? String ?? levels }
|
|
|
if let token = dict1["platforms"] { platforms = token as? String ?? platforms }
|
|
@@ -902,9 +907,15 @@ class KMMemberCenterManager: NSObject {
|
|
|
if let token = dict1["paymentModel"] { paymentModel = token as? Int ?? paymentModel }
|
|
|
if let token = dict1["cycle"] { cycle = token as? Int ?? cycle }
|
|
|
if let token = dict1["code"] { code = token as? String ?? code }
|
|
|
+
|
|
|
+ if let token = dict1["price"] { price = token as? NSNumber ?? price }
|
|
|
+ if let token = dict1["displayPrice"] { displayPrice = token as? NSNumber ?? displayPrice }
|
|
|
+ if let token = dict1["upgradePrice"] { upgradePrice = token as? NSNumber ?? upgradePrice }
|
|
|
if let token = dict1["cnyPrice"] { cnyPrice = token as? NSNumber ?? cnyPrice }
|
|
|
+ if let token = dict1["displayCnyPrice"] { displayCnyPrice = token as? NSNumber ?? displayCnyPrice }
|
|
|
|
|
|
- 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)
|
|
|
+ let products = KMListingProductsModel(id: id, productName: productName, price: price, maxDeviceNum: maxDeviceNum, displayPrice: displayPrice, levels: levels, platforms: platforms, productLineId: productLineId, paymentModel: paymentModel, cycle: cycle, cnyPrice: cnyPrice, displayCnyPrice: displayCnyPrice, upgradePrice: upgradePrice, code: code)
|
|
|
+
|
|
|
results.append(products)
|
|
|
}
|
|
|
|
|
@@ -957,7 +968,6 @@ class KMMemberCenterManager: NSObject {
|
|
|
for dict1 in result_Array {
|
|
|
var id = ""
|
|
|
var productName = ""
|
|
|
- var price = NSNumber(value: 0.0)
|
|
|
var maxDeviceNum = 0
|
|
|
var levels = ""
|
|
|
var platforms = ""
|
|
@@ -965,19 +975,32 @@ class KMMemberCenterManager: NSObject {
|
|
|
var paymentModel = 0
|
|
|
var cycle = 0
|
|
|
var code = ""
|
|
|
+
|
|
|
+ var price = NSNumber(value: 0.0)
|
|
|
+ var displayPrice = NSNumber(value: 0.0)
|
|
|
+ var upgradePrice = NSNumber(value: 0.0)
|
|
|
var cnyPrice = NSNumber(value: 0.0)
|
|
|
+ var displayCnyPrice = NSNumber(value: 0.0)
|
|
|
+
|
|
|
+
|
|
|
if let token = dict1["id"] { id = token as? String ?? id }
|
|
|
- if let token = dict1["productName"] { productName = token as? String ?? productName}
|
|
|
+ if let token = dict1["productName"] { productName = token as? String ?? productName }
|
|
|
+
|
|
|
+ if let token = dict1["maxDeviceNum"] { maxDeviceNum = token as? Int ?? maxDeviceNum }
|
|
|
+ if let token = dict1["levels"] { levels = token as? String ?? levels }
|
|
|
+ if let token = dict1["platforms"] { platforms = token as? String ?? platforms }
|
|
|
+ if let token = dict1["productLineId"] { productLineId = token as? Int ?? productLineId }
|
|
|
+ if let token = dict1["paymentModel"] { paymentModel = token as? Int ?? paymentModel }
|
|
|
+ if let token = dict1["cycle"] { cycle = token as? Int ?? cycle }
|
|
|
+ if let token = dict1["code"] { code = token as? String ?? code }
|
|
|
+
|
|
|
if let token = dict1["price"] { price = token as? NSNumber ?? price }
|
|
|
- if let token = dict1["maxDeviceNum"] { maxDeviceNum = token as? Int ?? maxDeviceNum}
|
|
|
- if let token = dict1["levels"] { levels = token as? String ?? levels}
|
|
|
- if let token = dict1["platforms"] { platforms = token as? String ?? platforms}
|
|
|
- if let token = dict1["productLineId"] { productLineId = token as? Int ?? productLineId}
|
|
|
- if let token = dict1["paymentModel"] { paymentModel = token as? Int ?? paymentModel}
|
|
|
- if let token = dict1["cycle"] { cycle = token as? Int ?? cycle}
|
|
|
- if let token = dict1["code"] { code = token as? String ?? code}
|
|
|
- if let token = dict1["cnyPrice"] { cnyPrice = token as? NSNumber ?? cnyPrice}
|
|
|
- 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)
|
|
|
+ if let token = dict1["displayPrice"] { displayPrice = token as? NSNumber ?? displayPrice }
|
|
|
+ if let token = dict1["upgradePrice"] { upgradePrice = token as? NSNumber ?? upgradePrice }
|
|
|
+ if let token = dict1["cnyPrice"] { cnyPrice = token as? NSNumber ?? cnyPrice }
|
|
|
+ if let token = dict1["displayCnyPrice"] { displayCnyPrice = token as? NSNumber ?? displayCnyPrice }
|
|
|
+
|
|
|
+ let products = KMListingProductsModel(id: id, productName: productName, price: price, maxDeviceNum: maxDeviceNum, displayPrice: displayPrice, levels: levels, platforms: platforms, productLineId: productLineId, paymentModel: paymentModel, cycle: cycle, cnyPrice: cnyPrice, displayCnyPrice: displayCnyPrice, upgradePrice: upgradePrice, code: code)
|
|
|
results.append(products)
|
|
|
}
|
|
|
|
|
@@ -1087,38 +1110,47 @@ class KMMemberCenterManager: NSObject {
|
|
|
}
|
|
|
dic = (info as? NSDictionary) ?? [:]
|
|
|
}
|
|
|
- let code: Int = dic["code"] as? Int ?? 0
|
|
|
+ let requestCode: Int = dic["code"] as? Int ?? 0
|
|
|
let result: NSDictionary = dic["result"] as? NSDictionary ?? [:]
|
|
|
let message: String = dic["msg"] as? String ?? ""
|
|
|
|
|
|
var id = ""
|
|
|
var productName = ""
|
|
|
- var price = ""
|
|
|
var maxDeviceNum = 0
|
|
|
- var displayPrice = ""
|
|
|
var levels = ""
|
|
|
var platforms = ""
|
|
|
var productLineId = 0
|
|
|
var paymentModel = 0
|
|
|
var cycle = 0
|
|
|
- var cnyPrice = ""
|
|
|
- var displayCnyPrice = ""
|
|
|
- if let token = result["id"] { id = token as? String ?? id}
|
|
|
- if let token = result["productName"] { productName = token as? String ?? productName}
|
|
|
- if let token = result["price"] { price = token as? String ?? price}
|
|
|
- if let token = result["maxDeviceNum"] { maxDeviceNum = token as? Int ?? maxDeviceNum}
|
|
|
- if let token = result["displayPrice"] { displayPrice = token as? String ?? displayPrice}
|
|
|
- if let token = result["levels"] { levels = token as? String ?? levels}
|
|
|
- if let token = result["platforms"] { platforms = token as? String ?? platforms}
|
|
|
- if let token = result["productLineId"] { productLineId = token as? Int ?? productLineId}
|
|
|
- if let token = result["paymentModel"] { paymentModel = token as? Int ?? paymentModel}
|
|
|
- if let token = result["cycle"] { cycle = token as? Int ?? cycle}
|
|
|
- if let token = result["cnyPrice"] { cnyPrice = token as? String ?? cnyPrice}
|
|
|
- if let token = result["displayCnyPrice"] { displayCnyPrice = token as? String ?? displayCnyPrice}
|
|
|
+ var code = ""
|
|
|
+
|
|
|
+ var price = NSNumber(value: 0.0)
|
|
|
+ var displayPrice = NSNumber(value: 0.0)
|
|
|
+ var upgradePrice = NSNumber(value: 0.0)
|
|
|
+ var cnyPrice = NSNumber(value: 0.0)
|
|
|
+ var displayCnyPrice = NSNumber(value: 0.0)
|
|
|
+
|
|
|
+
|
|
|
+ if let token = dic["id"] { id = token as? String ?? id }
|
|
|
+ if let token = dic["productName"] { productName = token as? String ?? productName }
|
|
|
+
|
|
|
+ if let token = dic["maxDeviceNum"] { maxDeviceNum = token as? Int ?? maxDeviceNum }
|
|
|
+ if let token = dic["levels"] { levels = token as? String ?? levels }
|
|
|
+ if let token = dic["platforms"] { platforms = token as? String ?? platforms }
|
|
|
+ if let token = dic["productLineId"] { productLineId = token as? Int ?? productLineId }
|
|
|
+ if let token = dic["paymentModel"] { paymentModel = token as? Int ?? paymentModel }
|
|
|
+ if let token = dic["cycle"] { cycle = token as? Int ?? cycle }
|
|
|
+ if let token = dic["code"] { code = token as? String ?? code }
|
|
|
+
|
|
|
+ if let token = dic["price"] { price = token as? NSNumber ?? price }
|
|
|
+ if let token = dic["displayPrice"] { displayPrice = token as? NSNumber ?? displayPrice }
|
|
|
+ if let token = dic["upgradePrice"] { upgradePrice = token as? NSNumber ?? upgradePrice }
|
|
|
+ if let token = dic["cnyPrice"] { cnyPrice = token as? NSNumber ?? cnyPrice }
|
|
|
+ if let token = dic["displayCnyPrice"] { displayCnyPrice = token as? NSNumber ?? displayCnyPrice }
|
|
|
|
|
|
- let products = KMCheckCouponModel(id: id, productName: productName, price: price, maxDeviceNum: maxDeviceNum, displayPrice: displayPrice, levels: levels, platforms: platforms, productLineId: productLineId, paymentModel: paymentModel, cycle: cycle, cnyPrice: cnyPrice, displayCnyPrice: displayCnyPrice)
|
|
|
- let result1 = KMMemberProductResult(code: code, msg: message, checkCoupon: products)
|
|
|
- if code == 200 {
|
|
|
+ let products = KMCheckCouponModel(id: id, productName: productName, price: price, maxDeviceNum: maxDeviceNum, displayPrice: displayPrice, levels: levels, platforms: platforms, productLineId: productLineId, paymentModel: paymentModel, cycle: cycle, cnyPrice: cnyPrice, displayCnyPrice: displayCnyPrice, upgradePrice: upgradePrice, code: code)
|
|
|
+ let result1 = KMMemberProductResult(code: requestCode, msg: message, checkCoupon: products)
|
|
|
+ if requestCode == 200 {
|
|
|
complete(true, result1)
|
|
|
} else {
|
|
|
complete(false, result1)
|