QSLContactFailCell.swift 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. //
  2. // QSLContactFailCell.swift
  3. // QuickSearchLocation
  4. //
  5. // Created by Destiny on 2024/12/12.
  6. //
  7. import UIKit
  8. class QSLContactFailCell: UITableViewCell {
  9. lazy var failIcon: UIImageView = {
  10. let imageView = UIImageView()
  11. imageView.image = UIImage(named: "contact_fail_icon")
  12. return imageView
  13. }()
  14. lazy var contentLabel: UILabel = {
  15. let label = UILabel()
  16. label.text("【儿子】138 8888 8888")
  17. label.font(14)
  18. label.textColor = .hexStringColor(hexString: "#404040")
  19. return label
  20. }()
  21. override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
  22. super.init(style: style, reuseIdentifier: reuseIdentifier)
  23. self.backgroundColor = QSLColor.backGroundColor
  24. self.addSubview(failIcon)
  25. failIcon.snp.makeConstraints { make in
  26. make.size.equalTo(CGSize(width: 16.rpx, height: 16.rpx))
  27. make.centerY.equalToSuperview()
  28. make.left.equalTo(60.rpx)
  29. }
  30. self.addSubview(contentLabel)
  31. contentLabel.snp.makeConstraints { make in
  32. make.centerY.equalToSuperview()
  33. make.left.equalTo(failIcon.snp.right).offset(5.rpx)
  34. }
  35. }
  36. required init?(coder: NSCoder) {
  37. fatalError("init(coder:) has not been implemented")
  38. }
  39. func config(phone: String) {
  40. self.contentLabel.text("【用户】\(phone)")
  41. }
  42. }