|
@@ -173,7 +173,7 @@ class KMProductModel: ObservableObject {
|
|
guard let productModels = dmgProductDatas?.listingProducts else { return "" }
|
|
guard let productModels = dmgProductDatas?.listingProducts else { return "" }
|
|
for model in productModels {
|
|
for model in productModels {
|
|
if model.code == productCode {
|
|
if model.code == productCode {
|
|
- return model.price.stringValue
|
|
|
|
|
|
+ return String(format: "%.2f", model.price.doubleValue)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return ""
|
|
return ""
|
|
@@ -185,7 +185,7 @@ class KMProductModel: ObservableObject {
|
|
guard let productModels = dmgProductDatas?.listingProducts else { return "" }
|
|
guard let productModels = dmgProductDatas?.listingProducts else { return "" }
|
|
for model in productModels {
|
|
for model in productModels {
|
|
if model.code == productCode {
|
|
if model.code == productCode {
|
|
- return model.cnyPrice.stringValue
|
|
|
|
|
|
+ return String(format: "%.2f", model.cnyPrice.doubleValue)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return ""
|
|
return ""
|
|
@@ -197,7 +197,7 @@ class KMProductModel: ObservableObject {
|
|
guard let productModels = dmgProductDatas?.listingProducts else { return "" }
|
|
guard let productModels = dmgProductDatas?.listingProducts else { return "" }
|
|
for model in productModels {
|
|
for model in productModels {
|
|
if model.code == productCode {
|
|
if model.code == productCode {
|
|
- return model.displayPrice.stringValue
|
|
|
|
|
|
+ return String(format: "%.2f", model.displayPrice.doubleValue)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return ""
|
|
return ""
|
|
@@ -209,7 +209,7 @@ class KMProductModel: ObservableObject {
|
|
guard let productModels = dmgProductDatas?.listingProducts else { return "" }
|
|
guard let productModels = dmgProductDatas?.listingProducts else { return "" }
|
|
for model in productModels {
|
|
for model in productModels {
|
|
if model.code == productCode {
|
|
if model.code == productCode {
|
|
- return model.displayCnyPrice.stringValue
|
|
|
|
|
|
+ return String(format: "%.2f", model.displayCnyPrice.doubleValue)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return ""
|
|
return ""
|
|
@@ -431,9 +431,17 @@ class KMProductModel: ObservableObject {
|
|
if type == .pdfReaderProStandard_dmg {
|
|
if type == .pdfReaderProStandard_dmg {
|
|
return getDMGPrice(productCode: "standard-annual-subscription")
|
|
return getDMGPrice(productCode: "standard-annual-subscription")
|
|
} else if type == .pdfReaderProAdvanced_dmg {
|
|
} else if type == .pdfReaderProAdvanced_dmg {
|
|
- return getDMGPrice(productCode: "advanced-annual-subscription")
|
|
|
|
|
|
+ if isBlackFive {
|
|
|
|
+ return getDMGPrice(productCode: "advanced-annual-subscription-blackFive")
|
|
|
|
+ } else {
|
|
|
|
+ return getDMGPrice(productCode: "advanced-annual-subscription")
|
|
|
|
+ }
|
|
} else if type == .pdfReaderProPermanent_dmg {
|
|
} else if type == .pdfReaderProPermanent_dmg {
|
|
- return getDMGPrice(productCode: "advanced-permanent")
|
|
|
|
|
|
+ if isBlackFive {
|
|
|
|
+ return getDMGPrice(productCode: "advanced-permanent-blackFive")
|
|
|
|
+ } else {
|
|
|
|
+ return getDMGPrice(productCode: "advanced-permanent")
|
|
|
|
+ }
|
|
} else if type == .pdfReaderProAIAnnual_dmg {
|
|
} else if type == .pdfReaderProAIAnnual_dmg {
|
|
return getDMGPrice(productCode: "ai-subscription-year-trail")
|
|
return getDMGPrice(productCode: "ai-subscription-year-trail")
|
|
} else if type == .pdfReaderProAIMonthly_dmg {
|
|
} else if type == .pdfReaderProAIMonthly_dmg {
|
|
@@ -441,9 +449,7 @@ class KMProductModel: ObservableObject {
|
|
} else if type == .pdfToOffice_dmg {
|
|
} else if type == .pdfToOffice_dmg {
|
|
return getDMGPrice(productCode: "PDF to Office")
|
|
return getDMGPrice(productCode: "PDF to Office")
|
|
} else if type == .add2Device_dmg {
|
|
} else if type == .add2Device_dmg {
|
|
- return getDMGPrice(productCode: "Add 2-Device · Advanced Annual")
|
|
|
|
} else if type == .add3Device_dmg {
|
|
} else if type == .add3Device_dmg {
|
|
- return getDMGPrice(productCode: "Add 3-Device · Advanced Annual")
|
|
|
|
}
|
|
}
|
|
#else
|
|
#else
|
|
// AppStore 免费版本
|
|
// AppStore 免费版本
|
|
@@ -546,9 +552,17 @@ class KMProductModel: ObservableObject {
|
|
if tag == 1 {
|
|
if tag == 1 {
|
|
code = "standard-annual-subscription"
|
|
code = "standard-annual-subscription"
|
|
} else if tag == 3 {
|
|
} else if tag == 3 {
|
|
- code = "advanced-permanent"
|
|
|
|
|
|
+ if isBlackFive {
|
|
|
|
+ code = "advanced-permanent-blackFive"
|
|
|
|
+ } else {
|
|
|
|
+ code = "advanced-permanent"
|
|
|
|
+ }
|
|
} else {
|
|
} else {
|
|
- code = "advanced-annual-subscription"
|
|
|
|
|
|
+ if isBlackFive {
|
|
|
|
+ code = "advanced-annual-subscription-blackFive"
|
|
|
|
+ } else {
|
|
|
|
+ code = "advanced-annual-subscription"
|
|
|
|
+ }
|
|
}
|
|
}
|
|
#if VERSION_DMG
|
|
#if VERSION_DMG
|
|
let embeddedWC = KMPurchaseEmbeddedWindowController.currentCode(code)
|
|
let embeddedWC = KMPurchaseEmbeddedWindowController.currentCode(code)
|
|
@@ -557,13 +571,13 @@ class KMProductModel: ObservableObject {
|
|
#endif
|
|
#endif
|
|
} else if state == .dmg_Upgrades1 {
|
|
} else if state == .dmg_Upgrades1 {
|
|
#if VERSION_DMG
|
|
#if VERSION_DMG
|
|
- let embeddedWC = KMPurchaseEmbeddedWindowController.currentCode("Add 2-Device · Advanced Annual")
|
|
|
|
|
|
+ let embeddedWC = KMPurchaseEmbeddedWindowController.currentCode("advanced-annual-subscription")
|
|
embeddedWC.showWindow(nil)
|
|
embeddedWC.showWindow(nil)
|
|
embeddedWC.window?.center()
|
|
embeddedWC.window?.center()
|
|
#endif
|
|
#endif
|
|
} else if state == .dmg_Upgrades2 {
|
|
} else if state == .dmg_Upgrades2 {
|
|
#if VERSION_DMG
|
|
#if VERSION_DMG
|
|
- let embeddedWC = KMPurchaseEmbeddedWindowController.currentCode("Add 3-Device · Advanced Annual")
|
|
|
|
|
|
+ let embeddedWC = KMPurchaseEmbeddedWindowController.currentCode("advanced-annual-subscription")
|
|
embeddedWC.showWindow(nil)
|
|
embeddedWC.showWindow(nil)
|
|
embeddedWC.window?.center()
|
|
embeddedWC.window?.center()
|
|
#endif
|
|
#endif
|
|
@@ -986,4 +1000,16 @@ class KMProductModel: ObservableObject {
|
|
]
|
|
]
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ 是否黑五活动期
|
|
|
|
+ */
|
|
|
|
+ var isBlackFive: Bool {
|
|
|
|
+ if let loginContent = KMAdvertisementManager.manager.info.topRightInfoContent {
|
|
|
|
+ if loginContent.content?.isEmpty == false {
|
|
|
|
+ return true
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return false
|
|
|
|
+ }
|
|
}
|
|
}
|