|
@@ -143,6 +143,13 @@ class KMProductCompareWC: NSWindowController {
|
|
|
private var model = KMProductModel.shared
|
|
|
private var cancellables = Set<AnyCancellable>()
|
|
|
|
|
|
+ private var subscribeType_: KMSubscribeWaterMarkType?
|
|
|
+ var subscribeType: KMSubscribeWaterMarkType? {
|
|
|
+ get {
|
|
|
+ return subscribeType_
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
var orientation: Bool = false // 是否定向跳转
|
|
|
var orientationType: KMCompareTableType = .trial // 定向跳转比较表
|
|
|
|
|
@@ -333,6 +340,7 @@ class KMProductCompareWC: NSWindowController {
|
|
|
@objc override func showWindow(_ sender: Any?) {
|
|
|
super.showWindow(sender)
|
|
|
|
|
|
+ subscribeType_ = nil
|
|
|
_trackComparisonEvent(params: ["Exposure" : "ComparisonTable_Exposure"])
|
|
|
|
|
|
alertingCodeForRefreshUserInfo_ = nil
|
|
@@ -359,6 +367,12 @@ class KMProductCompareWC: NSWindowController {
|
|
|
|
|
|
comparativeStatementHead()
|
|
|
}
|
|
|
+
|
|
|
+ func openWindow(type: KMSubscribeWaterMarkType) {
|
|
|
+ showWindow(nil)
|
|
|
+
|
|
|
+ subscribeType_ = type
|
|
|
+ }
|
|
|
|
|
|
// MARK: - Private Methods
|
|
|
|
|
@@ -1180,7 +1194,7 @@ class KMProductCompareWC: NSWindowController {
|
|
|
#else
|
|
|
// AppStore 免费版本
|
|
|
|
|
|
- if model.checkSubscriptionOffer(for: IAPProductsManager.default().fourDevicesAllAccessPackNew12months_lite.product) == .freeTrial {
|
|
|
+ if let product = IAPProductsManager.default().fourDevicesAllAccessPackNew12months_lite.product, model.checkSubscriptionOffer(for: product) == .freeTrial {
|
|
|
|
|
|
}
|
|
|
#endif
|
|
@@ -1201,6 +1215,12 @@ class KMProductCompareWC: NSWindowController {
|
|
|
// MARK: Button Actions
|
|
|
|
|
|
@IBAction func buttonItemClicked_Subscribe(_ sender: Any) {
|
|
|
+ if KMIsAppStoreFreeVersion() && subscribeType != nil && KMMemberInfo.shared.isLogin == false { // AppStore 免费版 + 付费功能进入 + 未登陆,跳转登陆
|
|
|
+ KMLoginWindowsController.shared.newOpenWindow(type: subscribeType) { success in
|
|
|
+
|
|
|
+ }
|
|
|
+ return
|
|
|
+ }
|
|
|
if KMMemberInfo.shared.validFlag == "5" {
|
|
|
KMMemberPromptWC.shared.showWindow(nil)
|
|
|
KMMemberPromptWC.shared.tipType = .signouting
|
|
@@ -1320,10 +1340,15 @@ class KMProductCompareWC: NSWindowController {
|
|
|
#if !VERSION_DMG
|
|
|
addWaitingView(to: window?.contentView ?? NSView())
|
|
|
#endif
|
|
|
- model.appstorePurchaseAction(sender.tag) { [weak self] success, msg in
|
|
|
- guard let self = self else { return }
|
|
|
-
|
|
|
- }
|
|
|
+ if KMIsAppStoreFreeVersion() && subscribeType != nil && KMMemberInfo.shared.isLogin == false { // AppStore 免费版 + 付费功能进入 + 未登陆,跳转登陆
|
|
|
+ KMLoginWindowsController.shared.newOpenWindow(type: subscribeType) { success in
|
|
|
+
|
|
|
+ }
|
|
|
+ return
|
|
|
+ }
|
|
|
+ model.appstorePurchaseAction(sender.tag) { [weak self] success, msg in
|
|
|
+ guard let self = self else { return }
|
|
|
+ }
|
|
|
#if VERSION_DMG
|
|
|
close()
|
|
|
#endif
|