QSLFeedbackVC.swift 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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. }
  32. }
  33. func setUI(){
  34. self.view.backgroundColor = .white
  35. self.view.addSubview(titleLabel)
  36. titleLabel.snp.makeConstraints { make in
  37. make.left.equalTo(20.rpx)
  38. make.top.equalTo(15.rpx)
  39. make.right.equalTo(-20.rpx)
  40. make.height.equalTo(20.rpx)
  41. }
  42. self.view.addSubview(phoneTextField)
  43. phoneTextField.snp.makeConstraints { make in
  44. make.left.equalTo(20.rpx)
  45. make.top.equalTo(titleLabel.snp.bottom).offset(15.rpx)
  46. make.right.equalTo(-20.rpx)
  47. make.height.equalTo(130.rpx)
  48. }
  49. self.view.addSubview(bottomButton)
  50. bottomButton.snp.makeConstraints { make in
  51. make.left.equalTo(28.rpx)
  52. make.right.equalTo(-28.rpx)
  53. make.height.equalTo(44.rpx)
  54. make.top.equalTo(phoneTextField.snp.bottom).offset(20.rpx)
  55. }
  56. }
  57. lazy var titleLabel: UILabel = {
  58. let label = UILabel()
  59. label.text("意见或建议:")
  60. label.mediumFont(16)
  61. label.textColor = QSLColor.Color_202020
  62. return label
  63. }()
  64. lazy var phoneTextField: IQTextView = {
  65. let textField = IQTextView()
  66. textField.backgroundColor = QSLColor.backGroundColor
  67. textField.textColor = QSLColor.Color_202020
  68. textField.font = UIFont.textF(14)
  69. let subcribeText = NSMutableAttributedString(string: "请详细描述您的问题")
  70. subcribeText.font(14)
  71. subcribeText.color(QSLColor.Color_888)
  72. textField.attributedPlaceholder = subcribeText
  73. return textField
  74. }()
  75. lazy var bottomButton: UIButton = {
  76. let btn = UIButton()
  77. btn.addRadius(radius: 22.rpx)
  78. btn.gradientBackgroundColor(color1: .hexStringColor(hexString: "#15CBA1"), color2: .hexStringColor(hexString: "#1FE0BA"), width: QSLConst.qsl_kScreenW - 32.rpx, height: 44.rpx, direction: .horizontal)
  79. btn.title("提交")
  80. btn.mediumFont(16)
  81. btn.textColor(.white)
  82. btn.setImageTitleLayout(.imgLeft, spacing: 0)
  83. btn.addTarget(self, action: #selector(bottomButtonAction), for: .touchUpInside)
  84. return btn
  85. }()
  86. }