AccountMoreBenefitsController.swift 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. //
  2. // AccountMoreBenefitsController.swift
  3. // PDF Reader Pro
  4. //
  5. // Created by User-Tangchao on 2024/10/30.
  6. //
  7. import Cocoa
  8. class AccountMoreBenefitsController: NSViewController {
  9. @IBOutlet weak var headerBox: NSBox!
  10. @IBOutlet weak var contentBox: NSBox!
  11. @IBOutlet weak var backButton: NSButton!
  12. @IBOutlet weak var headerBottomLine: NSView!
  13. var rightDatas: [String] = []
  14. var datas: [ProductListModel] = []
  15. var itemClick: KMCommonClickBlock?
  16. private var benefitsC_: AccountBenefitsController?
  17. convenience init() {
  18. self.init(nibName: "AccountMoreBenefitsController", bundle: nil)
  19. }
  20. override func viewDidLoad() {
  21. super.viewDidLoad()
  22. // Do view setup here.
  23. self.headerBox.borderWidth = 0
  24. self.contentBox.borderWidth = 0
  25. self.backButton.title = "< " + NSLocalizedString("Back", comment: "")
  26. self.backButton.setTitleColor(KMAppearance.themeColor())
  27. self.headerBottomLine.wantsLayer = true
  28. self.headerBottomLine.layer?.backgroundColor = NSColor(hex: "#EBEFF4").cgColor
  29. self.backButton.target = self
  30. self.backButton.action = #selector(buttonAction)
  31. self.showBenefit()
  32. }
  33. func showBenefit() {
  34. let vc = AccountBenefitsController()
  35. vc.rightDatas = self.rightDatas
  36. vc.datas = self.datas
  37. self.benefitsC_ = vc
  38. self.contentBox.contentView = vc.view
  39. }
  40. @objc func buttonAction() {
  41. self.itemClick?(1)
  42. }
  43. }