INRecorderSetting.swift 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. //
  2. // INRecorderSetting.swift
  3. // Introduce
  4. //
  5. // Created by ak on 2022/1/24.
  6. // Copyright © 2022 BytesFlow. All rights reserved.
  7. // 功能:设置界面
  8. import Foundation
  9. import BFUIKit
  10. import BFCommonKit
  11. class INRecorderSetting:BFBaseViewController{
  12. var cUserProtocol:String = "https://weapppiccdn.yishihui.com/resources/agreements/shishuo/videoservice_\( BFLocalizedUtil.currentLanguage()).html"
  13. var cPrivacy:String = "https://weapppiccdn.yishihui.com/resources/agreements/shishuo/videoagreement_\( BFLocalizedUtil.currentLanguage()).html"
  14. lazy var tipsA: UILabel = {
  15. let tipsA = UILabel()
  16. tipsA.font = UIFont.systemFont(ofSize: 40, weight: .medium)
  17. tipsA.textColor = UIColor.hexColor(hexadecimal: "#929292")
  18. let infoDictionary = Bundle.main.infoDictionary
  19. let majorVersion :String = infoDictionary! ["CFBundleShortVersionString"] as! String//主程序版本号
  20. let buildVersion :String = infoDictionary! ["CFBundleVersion"] as! String//主程序版本号
  21. tipsA.text = "v\(majorVersion)"
  22. tipsA.lineBreakMode = .byWordWrapping
  23. tipsA.textAlignment = .center
  24. tipsA.numberOfLines = 0
  25. return tipsA
  26. }()
  27. lazy var bottomView:UIView = {
  28. let bottomView = UIView(frame:CGRect.init(x: 0, y: view.frame.height - cSafeAreaHeight - 20 - 30, width: view.frame.width, height: 30))
  29. let userProBtn = UIButton.init(type: .custom)
  30. userProBtn.setTitle("hone_privacy".BFLocale, for: .normal)
  31. userProBtn.tag = 1
  32. userProBtn.titleLabel?.font = UIFont.systemFont(ofSize: 13)
  33. userProBtn.setTitleColor(UIColor.hexColor(hexadecimal: "6E7F9A"), for: .normal)
  34. userProBtn.addTarget(self, action: #selector(protocolClick(sender:)), for: .touchUpInside)
  35. let lineLab = UILabel()
  36. lineLab.text = " | "
  37. lineLab.font = UIFont.systemFont(ofSize: 13)
  38. lineLab.textColor = UIColor.hexColor(hexadecimal: "6E7F9A")
  39. let priProBtn = UIButton.init(type: .custom)
  40. priProBtn.setTitle("hone_service".BFLocale, for: .normal)
  41. priProBtn.tag = 2
  42. priProBtn.titleLabel?.font = UIFont.systemFont(ofSize: 13)
  43. priProBtn.setTitleColor(UIColor.hexColor(hexadecimal: "6E7F9A"), for: .normal)
  44. priProBtn.addTarget(self, action: #selector(protocolClick(sender:)), for: .touchUpInside)
  45. bottomView.addSubview(userProBtn)
  46. bottomView.addSubview(lineLab)
  47. bottomView.addSubview(priProBtn)
  48. lineLab.snp.makeConstraints { make in
  49. make.center.equalToSuperview()
  50. }
  51. userProBtn.snp.makeConstraints { make in
  52. make.right.equalTo(lineLab.snp.left)
  53. make.centerY.equalToSuperview()
  54. }
  55. priProBtn.snp.makeConstraints { make in
  56. make.left.equalTo(lineLab.snp.right)
  57. make.centerY.equalToSuperview()
  58. }
  59. return bottomView
  60. }()
  61. override func viewWillAppear(_: Bool) {
  62. super.viewWillAppear(true)
  63. navigationController?.isNavigationBarHidden = true
  64. }
  65. override func viewDidLoad() {
  66. super.viewDidLoad()
  67. view.backgroundColor = UIColor.hexColor(hexadecimal: "#F2F2F2")
  68. view.addSubview(bottomView)
  69. view.addSubview(tipsA)
  70. tipsA.snp.remakeConstraints { make in
  71. make.width.equalTo(182)
  72. make.height.equalTo(160)
  73. make.centerX.equalToSuperview()
  74. make.top.equalToSuperview().offset(357)
  75. }
  76. leftButton(image: nil, imageName: nil, tintColor: UIColor.black)
  77. backButton?.isHidden = false
  78. showNavigation()
  79. navHeadImageView?.isHidden = false
  80. lineView?.isHidden = true
  81. navHeadImageView?.backgroundColor = .clear
  82. }
  83. @objc func protocolClick(sender:UIButton) {
  84. var link: String?
  85. if sender.tag == 1 {
  86. link = cUserProtocol
  87. } else {
  88. link = cPrivacy
  89. }
  90. if link != nil, (link?.count ?? 0) > 0 {
  91. let detail = BFBaseWebViewController()
  92. detail.baseUrl = link
  93. self.navigationController?.pushViewController(detail, animated: true)
  94. }
  95. }
  96. }