|
@@ -173,7 +173,13 @@ class KMProductModel: ObservableObject {
|
|
|
guard let productModels = dmgProductDatas?.listingProducts else { return "" }
|
|
|
for model in productModels {
|
|
|
if model.code == productCode {
|
|
|
- return String(format: "%.2f", Float(model.priceString ?? "0") ?? 0)
|
|
|
+ if model.upgradePriceString?.isEmpty == false {
|
|
|
+ return String(format: "%.2f", Float(model.upgradePriceString ?? "0") ?? 0)
|
|
|
+ } else if model.displayPriceString?.isEmpty == false {
|
|
|
+ return String(format: "%.2f", Float(model.displayPriceString ?? "0") ?? 0)
|
|
|
+ } else {
|
|
|
+ return String(format: "%.2f", Float(model.priceString ?? "0") ?? 0)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
return ""
|
|
@@ -185,7 +191,13 @@ class KMProductModel: ObservableObject {
|
|
|
guard let productModels = dmgProductDatas?.listingProducts else { return "" }
|
|
|
for model in productModels {
|
|
|
if model.code == productCode {
|
|
|
- return String(format: "%.2f", Float(model.cnyPriceString ?? "0") ?? 0)
|
|
|
+ if model.cnyUpgradePriceString?.isEmpty == false {
|
|
|
+ return String(format: "%.2f", Float(model.cnyUpgradePriceString ?? "0") ?? 0)
|
|
|
+ } else if model.displayCnyPriceString?.isEmpty == false {
|
|
|
+ return String(format: "%.2f", Float(model.displayCnyPriceString ?? "0") ?? 0)
|
|
|
+ } else {
|
|
|
+ return String(format: "%.2f", Float(model.cnyPriceString ?? "0") ?? 0)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
return ""
|