|
@@ -35,11 +35,22 @@ import Cocoa
|
|
|
case lite_old
|
|
|
}
|
|
|
|
|
|
+// 当前注销状态
|
|
|
+@objc enum KMCurrentLogoutStatus : Int {
|
|
|
+ case null = 0 //
|
|
|
+ case prompt_unsubscribe
|
|
|
+ case prompt_signout
|
|
|
+ case closeAccount
|
|
|
+ case closeVerification
|
|
|
+ case closeApply
|
|
|
+}
|
|
|
+
|
|
|
@objcMembers class KMMemberInfo: NSObject {
|
|
|
|
|
|
static let shared = KMMemberInfo()
|
|
|
|
|
|
var isLogin: Bool = false
|
|
|
+ var currentLogoutStatus: KMCurrentLogoutStatus = .null
|
|
|
|
|
|
/**
|
|
|
登录
|
|
@@ -250,7 +261,7 @@ import Cocoa
|
|
|
}
|
|
|
#else
|
|
|
// AppStore 免费版本
|
|
|
- if IAPProductsManager.default().allAccessPack6months_lite.isSubscribed == true ||
|
|
|
+ if IAPProductsManager.default().allAccessPack6months_lite.isSubscribed == true ||
|
|
|
IAPProductsManager.default().allAccessPackNew6months_lite.isSubscribed == true ||
|
|
|
IAPProductsManager.default().allAccessPack12months_lite.isSubscribed == true ||
|
|
|
IAPProductsManager.default().allAccessProduct.isSubscribed == true {
|
|
@@ -262,7 +273,8 @@ import Cocoa
|
|
|
return .lite_type10
|
|
|
} else if KMMemberInfo.shared.vip_status == 4 {
|
|
|
return .lite_type11
|
|
|
- } else if(KMMemberInfo.shared.vip_status == 1) {
|
|
|
+ } else if(KMMemberInfo.shared.vip_status == 1 && KMMemberInfo.shared.vip_paymentModel == "1") {
|
|
|
+ // 订阅中
|
|
|
return .lite_type12
|
|
|
}
|
|
|
if KMMemberInfo.shared.vip_paymentModel == "1" && KMMemberInfo.shared.vip_payType == 0 {
|
|
@@ -333,7 +345,19 @@ import Cocoa
|
|
|
if IAPProductsManager.default().isAvailableAllFunction() == true {
|
|
|
return true
|
|
|
} else {
|
|
|
- if userScenarioType == .lite_type2 || userScenarioType == .lite_type4 || userScenarioType == .lite_type5 || userScenarioType == .lite_type6 {
|
|
|
+ let platforms = KMMemberInfo.shared.vip_platforms
|
|
|
+ let platformsArray = platforms
|
|
|
+ .components(separatedBy: ",")
|
|
|
+ .map { $0.trimmingCharacters(in: .whitespaces) }
|
|
|
+
|
|
|
+ if userScenarioType == .lite_type5 ||
|
|
|
+ userScenarioType == .lite_type4 {
|
|
|
+ if(platformsArray.contains("mac")) {
|
|
|
+ return true
|
|
|
+ }
|
|
|
+
|
|
|
+ } else if userScenarioType == .lite_type2 ||
|
|
|
+ userScenarioType == .lite_type6 {
|
|
|
return true
|
|
|
}
|
|
|
return false
|
|
@@ -369,14 +393,24 @@ import Cocoa
|
|
|
if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
|
|
|
return true
|
|
|
} else {
|
|
|
- if userScenarioType == .lite_type4 ||
|
|
|
- userScenarioType == .lite_type5 ||
|
|
|
- userScenarioType == .lite_type6 ||
|
|
|
- userScenarioType == .lite_type12 {
|
|
|
+ let platforms = KMMemberInfo.shared.vip_platforms
|
|
|
+ let platformsArray = platforms
|
|
|
+ .components(separatedBy: ",")
|
|
|
+ .map { $0.trimmingCharacters(in: .whitespaces) }
|
|
|
+
|
|
|
+ if(userScenarioType == .lite_type2) {
|
|
|
return true
|
|
|
- } else {
|
|
|
- return false
|
|
|
+ } else if userScenarioType == .lite_type5 ||
|
|
|
+ userScenarioType == .lite_type4 {
|
|
|
+ if(platformsArray.contains("mac")) { //购买了
|
|
|
+ return true
|
|
|
+ }
|
|
|
+ } else if userScenarioType == .lite_type6 || userScenarioType == .lite_type12 {
|
|
|
+ if KMMemberInfo.shared.vip_levels == "3" { //高级版本支持转档功能
|
|
|
+ return true
|
|
|
+ }
|
|
|
}
|
|
|
+ return false
|
|
|
}
|
|
|
} else {
|
|
|
if IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
|
|
@@ -444,6 +478,7 @@ import Cocoa
|
|
|
return false
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
|
|
|
// MARK: Public Method
|
|
|
|