|
@@ -145,19 +145,47 @@ class KMProductModel: ObservableObject {
|
|
|
return IAPProductsManager.default().advancedAdd2DevicesAllAccessPack12months_lite.price()
|
|
|
}
|
|
|
} else if type == .aiAllAccessPack1month_pro {
|
|
|
-
|
|
|
+ if let product = IAPProductsManager.default().aiAllAccessPack1month_pro, product.isOffers {
|
|
|
+ return product.offersPrice()
|
|
|
+ } else {
|
|
|
+ return IAPProductsManager.default().aiAllAccessPack1month_pro.price()
|
|
|
+ }
|
|
|
} else if type == .aiAllAccessPack12month_pro {
|
|
|
-
|
|
|
+ if let product = IAPProductsManager.default().aiAllAccessPack12month_pro, product.isOffers {
|
|
|
+ return product.offersPrice()
|
|
|
+ } else {
|
|
|
+ return IAPProductsManager.default().aiAllAccessPack12month_pro.price()
|
|
|
+ }
|
|
|
} else if type == .pdfToOfficePackPermanent_pro {
|
|
|
-
|
|
|
+ if let product = IAPProductsManager.default().pdfToOfficePackPermanent_pro, product.isOffers {
|
|
|
+ return product.offersPrice()
|
|
|
+ } else {
|
|
|
+ return IAPProductsManager.default().pdfToOfficePackPermanent_pro.price()
|
|
|
+ }
|
|
|
} else if type == .fourDevicesAllAccessPack12months_pro {
|
|
|
-
|
|
|
+ if let product = IAPProductsManager.default().fourDevicesAllAccessPack12months_pro, product.isOffers {
|
|
|
+ return product.offersPrice()
|
|
|
+ } else {
|
|
|
+ return IAPProductsManager.default().fourDevicesAllAccessPack12months_pro.price()
|
|
|
+ }
|
|
|
} else if type == .standardAddDevicesAllAccessPack12months_pro {
|
|
|
-
|
|
|
+ if let product = IAPProductsManager.default().standardAddDevicesAllAccessPack12months_pro, product.isOffers {
|
|
|
+ return product.offersPrice()
|
|
|
+ } else {
|
|
|
+ return IAPProductsManager.default().standardAddDevicesAllAccessPack12months_pro.price()
|
|
|
+ }
|
|
|
} else if type == .advancedAddDevicesAllAccessPack12months_pro {
|
|
|
-
|
|
|
+ if let product = IAPProductsManager.default().advancedAddDevicesAllAccessPack12months_pro, product.isOffers {
|
|
|
+ return product.offersPrice()
|
|
|
+ } else {
|
|
|
+ return IAPProductsManager.default().advancedAddDevicesAllAccessPack12months_pro.price()
|
|
|
+ }
|
|
|
} else if type == .advancedAdd2DevicesAllAccessPack12months_pro {
|
|
|
-
|
|
|
+ if let product = IAPProductsManager.default().advancedAdd2DevicesAllAccessPack12months_pro, product.isOffers {
|
|
|
+ return product.offersPrice()
|
|
|
+ } else {
|
|
|
+ return IAPProductsManager.default().advancedAdd2DevicesAllAccessPack12months_pro.price()
|
|
|
+ }
|
|
|
}
|
|
|
return ""
|
|
|
}
|
|
@@ -178,12 +206,32 @@ class KMProductModel: ObservableObject {
|
|
|
}
|
|
|
} else if state == .lite_MacWindows {
|
|
|
if tag == 2 {
|
|
|
- membershipPurchase(.fourDevicesAllAccessPackNew12months_lite)
|
|
|
+ let platforms = KMMemberInfo.shared.vip_platforms
|
|
|
+ let platformsArray = platforms
|
|
|
+ .components(separatedBy: ",")
|
|
|
+ .map { $0.trimmingCharacters(in: .whitespaces) }
|
|
|
+ if platformsArray.count == 1 {
|
|
|
+ membershipPurchase(.advancedAddDevicesAllAccessPack12months_lite)
|
|
|
+ } else if platformsArray.count == 2 {
|
|
|
+ membershipPurchase(.advancedAdd2DevicesAllAccessPack12months_lite)
|
|
|
+ } else {
|
|
|
+ membershipPurchase(.advancedAdd2DevicesAllAccessPack12months_lite)
|
|
|
+ }
|
|
|
}
|
|
|
} else if state == .pro_Base {
|
|
|
-
|
|
|
+ if KMMemberInfo.shared.userScenarioType == .pro_type3 {
|
|
|
+ if tag == 2 {
|
|
|
+ membershipPurchase(.standardAddDevicesAllAccessPack12months_pro)
|
|
|
+ } else if tag == 3 {
|
|
|
+ membershipPurchase(.pdfToOfficePackPermanent_pro)
|
|
|
+ }
|
|
|
+ }
|
|
|
} else if state == .pro_Advanced {
|
|
|
-
|
|
|
+ if KMMemberInfo.shared.userScenarioType == .pro_type1 {
|
|
|
+ membershipPurchase(.advancedAddDevicesAllAccessPack12months_pro)
|
|
|
+ } else if KMMemberInfo.shared.userScenarioType == .pro_type4 {
|
|
|
+ membershipPurchase(.advancedAddDevicesAllAccessPack12months_pro)
|
|
|
+ }
|
|
|
} else {
|
|
|
if tag == 2 {
|
|
|
membershipPurchase(.fourDevicesAllAccessPackNew12months_lite)
|
|
@@ -234,19 +282,19 @@ class KMProductModel: ObservableObject {
|
|
|
} else if type == .advancedAdd2DevicesAllAccessPack12months_lite {
|
|
|
IAPProductsManager.default().makeSubProduct(IAPProductsManager.default().advancedAdd2DevicesAllAccessPack12months_lite, discount: isCancelAutoRenew)
|
|
|
} else if type == .aiAllAccessPack1month_pro {
|
|
|
-
|
|
|
+ IAPProductsManager.default().makeSubProduct(IAPProductsManager.default().aiAllAccessPack1month_pro, discount: isCancelAutoRenew)
|
|
|
} else if type == .aiAllAccessPack12month_pro {
|
|
|
-
|
|
|
+ IAPProductsManager.default().makeSubProduct(IAPProductsManager.default().aiAllAccessPack12month_pro, discount: isCancelAutoRenew)
|
|
|
} else if type == .pdfToOfficePackPermanent_pro {
|
|
|
-
|
|
|
+ IAPProductsManager.default().makeSubProduct(IAPProductsManager.default().pdfToOfficePackPermanent_pro, discount: isCancelAutoRenew)
|
|
|
} else if type == .fourDevicesAllAccessPack12months_pro {
|
|
|
-
|
|
|
+ IAPProductsManager.default().makeSubProduct(IAPProductsManager.default().fourDevicesAllAccessPack12months_pro, discount: isCancelAutoRenew)
|
|
|
} else if type == .standardAddDevicesAllAccessPack12months_pro {
|
|
|
-
|
|
|
+ IAPProductsManager.default().makeSubProduct(IAPProductsManager.default().standardAddDevicesAllAccessPack12months_pro, discount: isCancelAutoRenew)
|
|
|
} else if type == .advancedAddDevicesAllAccessPack12months_pro {
|
|
|
-
|
|
|
+ IAPProductsManager.default().makeSubProduct(IAPProductsManager.default().advancedAddDevicesAllAccessPack12months_pro, discount: isCancelAutoRenew)
|
|
|
} else if type == .advancedAdd2DevicesAllAccessPack12months_pro {
|
|
|
-
|
|
|
+ IAPProductsManager.default().makeSubProduct(IAPProductsManager.default().advancedAdd2DevicesAllAccessPack12months_pro, discount: isCancelAutoRenew)
|
|
|
}
|
|
|
}
|
|
|
|