QSLFeedbackVC.swift 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. //
  2. // QSLFeedbackVC.swift
  3. // QuickSearchLocation
  4. //
  5. // Created by Destiny on 2025/10/23.
  6. //
  7. import UIKit
  8. import IQKeyboardManagerSwift
  9. class QSLFeedbackVC: QSLBaseController {
  10. override func viewWillAppear(_ animated:Bool) {
  11. //super.viewWillAppear(animated)
  12. self.navigationController?.setNavigationBarHidden(false, animated: animated)
  13. }
  14. override func viewDidLoad() {
  15. self.title = "意见反馈"
  16. super.viewDidLoad()
  17. self.setUI()
  18. }
  19. @objc func bottomButtonAction(){
  20. if(self.phoneTextField.text?.count ?? 0 > 300){
  21. QSLLoading.error(text: "字数超出300")
  22. return
  23. }
  24. if(self.phoneTextField.text?.count ?? 0 == 0){
  25. QSLLoading.error(text: "请先输入内容")
  26. return
  27. }
  28. QSLLoading.show()
  29. DispatchQueue.main.asyncAfter(deadline: .now() + 0.8) {
  30. QSLLoading.success(text: "提交成功")
  31. self.navigationController?.popViewController(animated: true)
  32. }
  33. }
  34. func setUI(){
  35. self.view.backgroundColor = .white
  36. self.view.addSubview(titleLabel)
  37. titleLabel.snp.makeConstraints { make in
  38. make.left.equalTo(20.rpx)
  39. make.top.equalTo(15.rpx)
  40. make.right.equalTo(-20.rpx)
  41. make.height.equalTo(20.rpx)
  42. }
  43. self.view.addSubview(phoneTextField)
  44. phoneTextField.snp.makeConstraints { make in
  45. make.left.equalTo(20.rpx)
  46. make.top.equalTo(titleLabel.snp.bottom).offset(15.rpx)
  47. make.right.equalTo(-20.rpx)
  48. make.height.equalTo(130.rpx)
  49. }
  50. self.view.addSubview(bottomButton)
  51. bottomButton.snp.makeConstraints { make in
  52. make.left.equalTo(28.rpx)
  53. make.right.equalTo(-28.rpx)
  54. make.height.equalTo(44.rpx)
  55. make.top.equalTo(phoneTextField.snp.bottom).offset(20.rpx)
  56. }
  57. }
  58. lazy var titleLabel: UILabel = {
  59. let label = UILabel()
  60. label.text("意见或建议:")
  61. label.mediumFont(16)
  62. label.textColor = QSLColor.Color_202020
  63. return label
  64. }()
  65. lazy var phoneTextField: IQTextView = {
  66. let textField = IQTextView()
  67. textField.backgroundColor = QSLColor.backGroundColor
  68. textField.textColor = QSLColor.Color_202020
  69. textField.font = UIFont.textF(14)
  70. let subcribeText = NSMutableAttributedString(string: "请详细描述您的问题")
  71. subcribeText.font(14)
  72. subcribeText.color(QSLColor.Color_888)
  73. textField.attributedPlaceholder = subcribeText
  74. return textField
  75. }()
  76. lazy var bottomButton: UIButton = {
  77. let btn = UIButton()
  78. btn.addRadius(radius: 22.rpx)
  79. btn.gradientBackgroundColor(color1: .hexStringColor(hexString: "#15CBA1"), color2: .hexStringColor(hexString: "#1FE0BA"), width: QSLConst.qsl_kScreenW - 32.rpx, height: 44.rpx, direction: .horizontal)
  80. btn.title("提交")
  81. btn.mediumFont(16)
  82. btn.textColor(.white)
  83. btn.setImageTitleLayout(.imgLeft, spacing: 0)
  84. btn.addTarget(self, action: #selector(bottomButtonAction), for: .touchUpInside)
  85. return btn
  86. }()
  87. }