|
@@ -61,6 +61,31 @@ class KMProductModel: ObservableObject {
|
|
|
*/
|
|
|
@Published var isPurchaseSwitch: Bool = true
|
|
|
|
|
|
+ // MARK: DMG Public Property
|
|
|
+ /**
|
|
|
+ DMG 版本所有已经上架产品记录(暂时无教育优惠)
|
|
|
+ */
|
|
|
+ var dmgProductDatas: KMMemberProductResult?
|
|
|
+
|
|
|
+ // MARK: DMG Public Method
|
|
|
+ func getDMGProductDatas() -> Void {
|
|
|
+ if KMMemberCenterManager.manager.isConnectionAvailable() == false {
|
|
|
+ let alert = NSAlert()
|
|
|
+ alert.alertStyle = .critical
|
|
|
+ alert.messageText = NSLocalizedString("Error Information", comment: "")
|
|
|
+ alert.informativeText = NSLocalizedString("Please make sure your internet connection is available.", comment: "")
|
|
|
+ alert.addButton(withTitle: NSLocalizedString("OK", comment: ""))
|
|
|
+ alert.runModal()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ KMMemberCenterManager.manager.getListingProducts(isEducation: 0) { [weak self] success, result in
|
|
|
+ guard let productsArrays : KMMemberProductResult = result else { return }
|
|
|
+ self?.dmgProductDatas = productsArrays
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
// MARK: Public Method
|
|
|
|
|
|
/**
|