|
@@ -113,9 +113,21 @@ class KMUserInfoViewController: NSViewController {
|
|
self.view.wantsLayer = true
|
|
self.view.wantsLayer = true
|
|
self.view.layer?.backgroundColor = .white
|
|
self.view.layer?.backgroundColor = .white
|
|
|
|
|
|
- bindViewModel()
|
|
|
|
|
|
+#if VERSION_FREE
|
|
|
|
+#if VERSION_DMG
|
|
|
|
+ // DMG
|
|
|
|
+ languageLocalized_DMG()
|
|
|
|
+ initializeUI_DMG()
|
|
|
|
+#else
|
|
|
|
+ // AppStore 免费版本
|
|
languageLocalized()
|
|
languageLocalized()
|
|
initializeUI()
|
|
initializeUI()
|
|
|
|
+#endif
|
|
|
|
+#else
|
|
|
|
+ // AppStore 付费版
|
|
|
|
+ languageLocalized()
|
|
|
|
+ initializeUI()
|
|
|
|
+#endif
|
|
|
|
|
|
NotificationCenter.default.addObserver(self, selector: #selector(changeEffectiveAppearance), name: NSNotification.Name(rawValue: "kEffectiveAppearance"), object: nil)
|
|
NotificationCenter.default.addObserver(self, selector: #selector(changeEffectiveAppearance), name: NSNotification.Name(rawValue: "kEffectiveAppearance"), object: nil)
|
|
}
|
|
}
|
|
@@ -127,7 +139,18 @@ class KMUserInfoViewController: NSViewController {
|
|
} else {
|
|
} else {
|
|
self.view.appearance = NSAppearance(named: .aqua)
|
|
self.view.appearance = NSAppearance(named: .aqua)
|
|
}
|
|
}
|
|
|
|
+#if VERSION_FREE
|
|
|
|
+#if VERSION_DMG
|
|
|
|
+ // DMG
|
|
|
|
+ initializeUI_DMG()
|
|
|
|
+#else
|
|
|
|
+ // AppStore 免费版本
|
|
initializeUI()
|
|
initializeUI()
|
|
|
|
+#endif
|
|
|
|
+#else
|
|
|
|
+ // AppStore 付费版
|
|
|
|
+ initializeUI()
|
|
|
|
+#endif
|
|
}
|
|
}
|
|
|
|
|
|
// MARK: Private Method
|
|
// MARK: Private Method
|
|
@@ -758,12 +781,423 @@ class KMUserInfoViewController: NSViewController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- // MARK: Bind Method
|
|
|
|
|
|
+ // MARK: Action Method
|
|
|
|
|
|
- func bindViewModel() -> Void {
|
|
|
|
|
|
+ private func languageLocalized_DMG() -> Void {
|
|
|
|
+ emailLabel.stringValue = KMMemberInfo.shared.userEmail
|
|
|
|
+ productLabel.stringValue = NSLocalizedString("Personal Account", tableName: "MemberCenterLocalizable", comment: "")
|
|
|
|
+ endDateLabel.stringValue = String(format: "%@ %@", KMMemberInfo.shared.vip_endDate,NSLocalizedString("expires", tableName: "MemberCenterLocalizable", comment: ""))
|
|
|
|
+ membershipLabel.stringValue = NSLocalizedString("Membership Benefits", tableName: "MemberCenterLocalizable", comment: "")
|
|
|
|
+ buyNow1Label.stringValue = NSLocalizedString("Upgrade Now", tableName: "MemberCenterLocalizable", comment: "")
|
|
|
|
+ accountLabel.stringValue = NSLocalizedString("Account Center", tableName: "MemberCenterLocalizable", comment: "")
|
|
|
|
+ signOutLabel.stringValue = NSLocalizedString("Sign out", tableName: "MemberCenterLocalizable", comment: "")
|
|
|
|
+ if KMMemberInfo.shared.validFlag == "5" {
|
|
|
|
+ closeAccountLabel.stringValue = NSLocalizedString("Undo Remove Account", tableName: "MemberCenterLocalizable", comment: "")
|
|
|
|
+ } else {
|
|
|
|
+ closeAccountLabel.stringValue = NSLocalizedString("Remove Account", tableName: "MemberCenterLocalizable", comment: "")
|
|
|
|
+ }
|
|
|
|
+ if KMMemberInfo.shared.vip_maxDeviceNum == 1 {
|
|
|
|
+ number4Label.stringValue = NSLocalizedString("device", tableName: "MemberCenterLocalizable", comment: "")
|
|
|
|
+ } else {
|
|
|
|
+ number4Label.stringValue = NSLocalizedString("devices", tableName: "MemberCenterLocalizable", comment: "")
|
|
|
|
+ }
|
|
|
|
+ number4_1Label.stringValue = String(KMMemberInfo.shared.vip_maxDeviceNum)
|
|
|
|
|
|
|
|
+ number5Label.stringValue = NSLocalizedString("Devices Access", tableName: "MemberCenterLocalizable", comment: "")
|
|
|
|
+ let platforms = viewModel.getPlatformsImages()
|
|
|
|
+ if platforms.count == 4 {
|
|
|
|
+ number3Label.stringValue = NSLocalizedString("All-platform Available", tableName: "MemberCenterLocalizable", comment: "")
|
|
|
|
+ } else {
|
|
|
|
+ number3Label.stringValue = NSLocalizedString("Platform", tableName: "MemberCenterLocalizable", comment: "")
|
|
|
|
+ }
|
|
|
|
+ if KMMemberInfo.shared.userScenarioType == .dmg_type5 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type6 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type7 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type28 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type29 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type30 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type43 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type44 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type45 { // 买断
|
|
|
|
+ lockedLabel.stringValue = NSLocalizedString("Permanent", tableName: "MemberCenterLocalizable", comment: "")
|
|
|
|
+ number2Label.stringValue = NSLocalizedString("Advanced Version", tableName: "MemberCenterLocalizable", comment: "")
|
|
|
|
+ buyNow1Label.stringValue = NSLocalizedString("Upgrade Now", tableName: "MemberCenterLocalizable", comment: "")
|
|
|
|
+ } else if KMMemberInfo.shared.userScenarioType == .dmg_type8 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type9 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type10 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type12 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type13 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type14 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type15 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type16 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type17 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type20 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type21 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type23 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type24 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type25 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type26 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type27 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type31 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type32 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type35 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type36 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type38 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type39 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type40 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type41 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type42 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type46 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type47 { // 订阅
|
|
|
|
+ lockedLabel.stringValue = NSLocalizedString("Subscription", tableName: "MemberCenterLocalizable", comment: "")
|
|
|
|
+ if KMMemberInfo.shared.userScenarioType == .dmg_type8 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type9 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type20 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type21 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type35 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type36 {
|
|
|
|
+ number2Label.stringValue = NSLocalizedString("Standard Version", tableName: "MemberCenterLocalizable", comment: "")
|
|
|
|
+ } else {
|
|
|
|
+ number2Label.stringValue = NSLocalizedString("Advanced Version", tableName: "MemberCenterLocalizable", comment: "")
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ } else { // 免费 & 到期
|
|
|
|
+ if KMMemberInfo.shared.userScenarioType == .dmg_type4 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type11 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type18 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type19 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type22 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type33 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type34 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type37 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type48 {
|
|
|
|
+ lockedLabel.stringValue = NSLocalizedString("Locked", tableName: "MemberCenterLocalizable", comment: "")
|
|
|
|
+ number1Label.stringValue = NSLocalizedString("150+", tableName: "MemberCenterLocalizable", comment: "")
|
|
|
|
+ number2Label.stringValue = NSLocalizedString("Benefits of Functions", tableName: "MemberCenterLocalizable", comment: "")
|
|
|
|
+ if KMMemberInfo.shared.userScenarioType == .dmg_type11 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type18 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type22 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type33 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type37 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type48 { // 到期
|
|
|
|
+ buyNow1Label.stringValue = NSLocalizedString("Buy Now", tableName: "MemberCenterLocalizable", comment: "")
|
|
|
|
+ } else { // 免费
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ if KMMemberInfo.shared.userScenarioType == .dmg_type4 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type19 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type34 {
|
|
|
|
+ buyNow1Label.stringValue = NSLocalizedString("Buy Now", tableName: "MemberCenterLocalizable", comment: "")
|
|
|
|
+ buyNow2Label.stringValue = NSLocalizedString("7-Day Free Trial", tableName: "MemberCenterLocalizable", comment: "")
|
|
|
|
+ } else if KMMemberInfo.shared.userScenarioType == .dmg_type11 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type22 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type37 {
|
|
|
|
+ buyNow1Label.stringValue = NSLocalizedString("Buy Now", tableName: "MemberCenterLocalizable", comment: "")
|
|
|
|
+ } else if KMMemberInfo.shared.userScenarioType == .dmg_type18 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type33 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type48 {
|
|
|
|
+ buyNow1Label.stringValue = NSLocalizedString("Renew now", tableName: "MemberCenterLocalizable", comment: "")
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
- // MARK: Action Method
|
|
|
|
|
|
+ private func initializeUI_DMG() -> Void {
|
|
|
|
+ self.view.wantsLayer = true
|
|
|
|
+ let isDarkModel = KMAdvertisementConfig.isDarkModel()
|
|
|
|
+ if isDarkModel {
|
|
|
|
+ self.view.layer?.backgroundColor = NSColor(hex: "0E1114").cgColor;
|
|
|
|
+ } else {
|
|
|
|
+ self.view.layer?.backgroundColor = NSColor(hex: "FFFFFF").cgColor;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ rightsBox.contentView = rightsView
|
|
|
|
+ buyBox.contentView = buyView1
|
|
|
|
+ userImageView.image = NSImage(named: "UserProfilePicture_Size")
|
|
|
|
+ emailLabel.textColor = NSColor(named: "0E1114")
|
|
|
|
+ emailLabel.font = NSFont.SFMediumFontWithSize(14)
|
|
|
|
+ productLabel.textColor = NSColor(named: "42464D_1")
|
|
|
|
+ productLabel.font = NSFont.SFProTextRegularFont(12)
|
|
|
|
+ endDateLabel.textColor = NSColor(named: "42464D_1")
|
|
|
|
+ endDateLabel.font = NSFont.SFProTextRegularFont(12)
|
|
|
|
+ spliLineImageView.isHidden = true
|
|
|
|
+ endDateLabel.isHidden = true
|
|
|
|
+ number1Label.font = NSFont.SFMediumFontWithSize(24)
|
|
|
|
+ number1Label.textColor = NSColor(hex: "0E1114")
|
|
|
|
+ number2Label.font = NSFont.SFProTextRegularFont(12)
|
|
|
|
+ number3Label.font = NSFont.SFProTextRegularFont(12)
|
|
|
|
+ number5Label.font = NSFont.SFProTextRegularFont(12)
|
|
|
|
+ membershipLabel.font = NSFont.SFMediumFontWithSize(16)
|
|
|
|
+ lockedLabel.font = NSFont.SFMediumFontWithSize(12)
|
|
|
|
+ lockedLabel.textColor = NSColor(hex: "42464D")
|
|
|
|
+ accountCenterBox.borderColor = NSColor(named: "3091FF") ?? .blue
|
|
|
|
+ accountCenterBox.fillColor = .clear
|
|
|
|
+ accountLabel.textColor = NSColor(named: "3091FF")
|
|
|
|
+ accountLabel.font = NSFont.SFProTextRegularFont(14)
|
|
|
|
+ accountImageView.image = NSImage(named: "AccountCenterImage")
|
|
|
|
+ signOutLabel.textColor = NSColor(named: "3091FF")
|
|
|
|
+ signOutLabel.font = NSFont.SFProTextRegularFont(14)
|
|
|
|
+ signOutImageView.image = NSImage(named: "SignOutImage")
|
|
|
|
+ closeAccountLabel.textColor = NSColor(named: "3091FF")
|
|
|
|
+ closeAccountLabel.font = NSFont.SFProTextRegularFont(14)
|
|
|
|
+ closeAccountImageView.image = NSImage(named: "CloseAccountImage")
|
|
|
|
+ buyNow1Label.font = NSFont.SFProTextRegularFont(14)
|
|
|
|
+ buyNow2Label.font = NSFont.SFProTextRegularFont(14)
|
|
|
|
+
|
|
|
|
+ let platforms = viewModel.getPlatformsImages()
|
|
|
|
+ if platforms.count == 4 {
|
|
|
|
+ iconBox.contentView = iconView1
|
|
|
|
+ icon1ImageView.image = platforms[0]
|
|
|
|
+ icon2ImageView.image = platforms[1]
|
|
|
|
+ icon3ImageView.image = platforms[2]
|
|
|
|
+ icon4ImageView.image = platforms[3]
|
|
|
|
+ } else if platforms.count == 3 {
|
|
|
|
+ iconBox.contentView = iconView2
|
|
|
|
+ icon5ImageView.image = platforms[0]
|
|
|
|
+ icon6ImageView.image = platforms[1]
|
|
|
|
+ icon7ImageView.image = platforms[2]
|
|
|
|
+ } else if platforms.count == 2 {
|
|
|
|
+ iconBox.contentView = iconView3
|
|
|
|
+ icon8ImageView.image = platforms[0]
|
|
|
|
+ icon9ImageView.image = platforms[1]
|
|
|
|
+ } else if platforms.count == 1 {
|
|
|
|
+ iconBox.contentView = iconView4
|
|
|
|
+ icon10ImageView.image = platforms[0]
|
|
|
|
+ }
|
|
|
|
+ buyNow1ImageView.image = NSImage(named: "ButtonBackgroundImage2")
|
|
|
|
+ buyNow2ImageView.image = NSImage(named: "ButtonBackgroundImage2")
|
|
|
|
|
|
|
|
+ if KMMemberInfo.shared.userScenarioType == .dmg_type5 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type6 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type7 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type28 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type29 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type30 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type43 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type44 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type45 { // 买断
|
|
|
|
+ centerBackgroud.image = NSImage(named: "ButtonBackgroundImage4")
|
|
|
|
+ lockedImageView.image = NSImage(named: "UpgradeImage2")
|
|
|
|
+ number1ImageView.isHidden = false
|
|
|
|
+ number1ImageView.image = NSImage(named: "UpgradeImage")
|
|
|
|
+ number1Label.isHidden = true
|
|
|
|
+ number2Label.textColor = NSColor(hex: "FFFFFF")
|
|
|
|
+ number3Label.textColor = NSColor(hex: "FFFFFF")
|
|
|
|
+ number4Label.textColor = NSColor(hex: "FFFFFF")
|
|
|
|
+ number4_1Label.textColor = NSColor(hex: "FFFFFF")
|
|
|
|
+ number5Label.textColor = NSColor(hex: "FFFFFF")
|
|
|
|
+ membershipLabel.textColor = NSColor(hex: "FFFFFF")
|
|
|
|
+ rightsBox.fillColor = NSColor(named: "FFFFFF_0.2") ?? .white
|
|
|
|
+ buyNow1Box.fillColor = NSColor(hex: "FFFFFF")
|
|
|
|
+ buyNow1ImageView.isHidden = true
|
|
|
|
+ buyNow2Box.isHidden = true
|
|
|
|
+ buyNow1BoxLeftConst.constant = (CGRectGetWidth(view.bounds) - CGRectGetWidth(buyNow1Box.frame))/2
|
|
|
|
+ arrow1ImageView.image = NSImage(named: "BuyNewArrowImage2")
|
|
|
|
+ buyNow1Label.textColor = NSColor(hex: "42464D")
|
|
|
|
+ } else if KMMemberInfo.shared.userScenarioType == .dmg_type8 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type9 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type10 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type12 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type13 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type14 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type15 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type16 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type17 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type20 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type21 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type23 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type24 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type25 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type26 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type27 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type31 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type32 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type35 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type36 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type38 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type39 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type40 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type41 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type42 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type46 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type47 { // 订阅
|
|
|
|
+ centerBackgroud.image = NSImage(named: "ButtonBackgroundImage5")
|
|
|
|
+ lockedImageView.image = NSImage(named: "UpgradeImage2")
|
|
|
|
+ number1ImageView.isHidden = false
|
|
|
|
+ number1ImageView.image = NSImage(named: "UpgradeImage")
|
|
|
|
+ number1Label.isHidden = true
|
|
|
|
+ number2Label.textColor = NSColor(hex: "FFFFFF")
|
|
|
|
+ number3Label.textColor = NSColor(hex: "FFFFFF")
|
|
|
|
+ number4Label.textColor = NSColor(hex: "FFFFFF")
|
|
|
|
+ number4_1Label.textColor = NSColor(hex: "FFFFFF")
|
|
|
|
+ number5Label.textColor = NSColor(hex: "FFFFFF")
|
|
|
|
+ membershipLabel.textColor = NSColor(hex: "FFFFFF")
|
|
|
|
+ if KMMemberInfo.shared.userScenarioType == .dmg_type13 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type15 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type9 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type17 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type25 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type27 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type21 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type32 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type40 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type42 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type36 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type47 {
|
|
|
|
+ if KMMemberInfo.shared.vip_endDate.count > 0 {
|
|
|
|
+ spliLineImageView.isHidden = false
|
|
|
|
+ endDateLabel.isHidden = false
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ rightsBox.fillColor = NSColor(named: "FFFFFF_0.2") ?? .white
|
|
|
|
+ buyNow1Box.fillColor = NSColor(hex: "FFFFFF")
|
|
|
|
+ buyNow1ImageView.isHidden = true
|
|
|
|
+ buyNow1Box.isHidden = true
|
|
|
|
+ buyNow2Box.isHidden = true
|
|
|
|
+ } else { // 免费 & 到期
|
|
|
|
+ if KMMemberInfo.shared.userScenarioType == .dmg_type4 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type11 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type18 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type19 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type22 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type33 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type34 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type37 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type48 {
|
|
|
|
+ centerBackgroud.image = NSImage(named: "ButtonBackgroundImage3")
|
|
|
|
+ lockedImageView.image = NSImage(named: "LockedImage")
|
|
|
|
+ number1ImageView.isHidden = true
|
|
|
|
+ number1Label.isHidden = false
|
|
|
|
+ number2Label.textColor = NSColor(hex:"42464D")
|
|
|
|
+ number3Label.textColor = NSColor(hex:"42464D")
|
|
|
|
+ number4Label.textColor = NSColor(hex: "42464D")
|
|
|
|
+ number4_1Label.textColor = NSColor(hex: "42464D")
|
|
|
|
+ number5Label.textColor = NSColor(hex: "42464D")
|
|
|
|
+ membershipLabel.textColor = NSColor(hex: "42464D")
|
|
|
|
+ rightsBox.fillColor = NSColor(named: "7094F6_0.1") ?? .white
|
|
|
|
+ buyNow1Box.fillColor = NSColor.clear
|
|
|
|
+ buyNow2Box.fillColor = NSColor.clear
|
|
|
|
+ buyNow1ImageView.isHidden = false
|
|
|
|
+ buyNow2ImageView.isHidden = false
|
|
|
|
+ arrow1ImageView.image = NSImage(named: "BuyNewArrowImage1")
|
|
|
|
+ arrow2ImageView.image = NSImage(named: "BuyNewArrowImage1")
|
|
|
|
+ buyNow1Label.textColor = NSColor(named: "FFFFFF")
|
|
|
|
+ buyNow1Label.textColor = NSColor(hex: "FFFFFF")
|
|
|
|
+ buyNow2Label.textColor = NSColor(hex: "FFFFFF")
|
|
|
|
+ if KMMemberInfo.shared.userScenarioType == .dmg_type11 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type18 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type22 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type33 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type37 ||
|
|
|
|
+ KMMemberInfo.shared.userScenarioType == .dmg_type48 { // 到期
|
|
|
|
+ if KMMemberInfo.shared.vip_endDate.count > 0 &&
|
|
|
|
+ KMMemberInfo.shared.vip_status == 2 {
|
|
|
|
+ spliLineImageView.isHidden = false
|
|
|
|
+ endDateLabel.isHidden = false
|
|
|
|
+ endDateLabel.textColor = NSColor(named: "FA1E5D")
|
|
|
|
+ }
|
|
|
|
+ spliLineImageView.isHidden = false
|
|
|
|
+ endDateLabel.isHidden = false
|
|
|
|
+ buyNow2Box.isHidden = true
|
|
|
|
+ buyNow1BoxLeftConst.constant = (CGRectGetWidth(view.bounds) - CGRectGetWidth(buyNow1Box.frame))/2
|
|
|
|
+ } else { // 免费
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ buyNow1Box.moveCallback = { [weak self](mouseEntered: Bool, mouseBox: KMBox) -> Void in
|
|
|
|
+ guard let self = self else { return }
|
|
|
|
+
|
|
|
|
+ if mouseEntered {
|
|
|
|
+ self.buyNow1ImageView.image = NSImage(named: "ButtonBackgroundImage2_Hov")
|
|
|
|
+ } else {
|
|
|
|
+ self.buyNow1ImageView.image = NSImage(named: "ButtonBackgroundImage2")
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ buyNow1Box.downCallback = { [weak self](downEntered: Bool, mouseBox: KMBox, event) -> Void in
|
|
|
|
+ guard let self = self else { return }
|
|
|
|
+ if KMMemberInfo.shared.userScenarioType == .lite_type1 {
|
|
|
|
+ // 免费版,免费账号跳转购买比较表
|
|
|
|
+ self.viewModel.skipCompare(.lite_Base)
|
|
|
|
+ } else {
|
|
|
|
+ // 其它情况根据账号状态跳转不同比较表
|
|
|
|
+ KMMemberInfo.shared.productCompareShow()
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ buyNow2Box.moveCallback = { [weak self](mouseEntered: Bool, mouseBox: KMBox) -> Void in
|
|
|
|
+ guard let self = self else { return }
|
|
|
|
+ if mouseEntered {
|
|
|
|
+ self.buyNow2ImageView.image = NSImage(named: "ButtonBackgroundImage2_Hov")
|
|
|
|
+ } else {
|
|
|
|
+ self.buyNow2ImageView.image = NSImage(named: "ButtonBackgroundImage2")
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ buyNow2Box.downCallback = { [weak self](downEntered: Bool, mouseBox: KMBox, event) -> Void in
|
|
|
|
+ guard let self = self else { return }
|
|
|
|
+ if KMMemberInfo.shared.userScenarioType == .lite_type1 {
|
|
|
|
+ self.viewModel.skipCompare(.trial)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ accountCenterBox.moveCallback = { [weak self](mouseEntered: Bool, mouseBox: KMBox) -> Void in
|
|
|
|
+ guard let self = self else { return }
|
|
|
|
+ if mouseEntered {
|
|
|
|
+ self.accountCenterBox.fillColor = NSColor(named: "F5FAFF") ?? .white
|
|
|
|
+ self.accountLabel.textColor = NSColor(named: "3091FF")
|
|
|
|
+ self.accountImageView.image = NSImage(named: "AccountCenterImage_Hov")
|
|
|
|
+ } else {
|
|
|
|
+ self.accountCenterBox.fillColor = .clear
|
|
|
|
+ self.accountLabel.textColor = NSColor(named: "3091FF")
|
|
|
|
+ self.accountImageView.image = NSImage(named: "AccountCenterImage")
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ accountCenterBox.downCallback = { [weak self](downEntered: Bool, mouseBox: KMBox, event) -> Void in
|
|
|
|
+ guard let self = self else { return }
|
|
|
|
+ self.viewModel.skipAccountCenter()
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ signOutBox.moveCallback = { [weak self](mouseEntered: Bool, mouseBox: KMBox) -> Void in
|
|
|
|
+ guard let self = self else { return }
|
|
|
|
+ if mouseEntered {
|
|
|
|
+ self.signOutLabel.textColor = NSColor(named: "3091FF")
|
|
|
|
+ self.signOutImageView.image = NSImage(named: "SignOutImage_Hov")
|
|
|
|
+ } else {
|
|
|
|
+ self.signOutLabel.textColor = NSColor(named: "3091FF")
|
|
|
|
+ self.signOutImageView.image = NSImage(named: "SignOutImage")
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ signOutBox.downCallback = { [weak self](downEntered: Bool, mouseBox: KMBox, event) -> Void in
|
|
|
|
+ guard let self = self else { return }
|
|
|
|
+ self.viewModel.signOutAction()
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ closeAccountBox.moveCallback = { [weak self](mouseEntered: Bool, mouseBox: KMBox) -> Void in
|
|
|
|
+ guard let self = self else { return }
|
|
|
|
+ if mouseEntered {
|
|
|
|
+ self.closeAccountLabel.textColor = NSColor(named: "3091FF")
|
|
|
|
+ self.closeAccountImageView.image = NSImage(named: "CloseAccountImage_hover")
|
|
|
|
+ } else {
|
|
|
|
+ self.closeAccountLabel.textColor = NSColor(named: "3091FF")
|
|
|
|
+ self.closeAccountImageView.image = NSImage(named: "CloseAccountImage")
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ closeAccountBox.downCallback = { [weak self](downEntered: Bool, mouseBox: KMBox, event) -> Void in
|
|
|
|
+ guard let self = self else { return }
|
|
|
|
+ self.viewModel.closeAccountAction()
|
|
|
|
+ }
|
|
|
|
+ //远程控制
|
|
|
|
+ if let userViewInfoContent = KMAdvertisementManager.manager.info.userViewInfoContent {
|
|
|
|
+
|
|
|
|
+ buyNow1BoxLeftConst.constant = 0
|
|
|
|
+ buyNow2Box.isHidden = false
|
|
|
|
+
|
|
|
|
+ if userViewInfoContent.content?.isEmpty == false {
|
|
|
|
+ buyNow2Box.isHidden = true
|
|
|
|
+ buyNow1BoxLeftConst.constant = (CGRectGetWidth(view.bounds) - CGRectGetWidth(buyNow1Box.frame))/2
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|