QSLVipCommentCellView.swift 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. //
  2. // QSLVipCommentCellView.swift
  3. // QuickSearchLocation
  4. //
  5. // Created by Destiny on 2024/11/28.
  6. //
  7. import UIKit
  8. class QSLVipCommentCellView: UIView {
  9. lazy var avatarImageView: UIImageView = {
  10. let imageView = UIImageView()
  11. imageView.image = UIImage(named: "friends_cell_other_avatar")
  12. return imageView
  13. }()
  14. lazy var nameLabel: UILabel = {
  15. let label = UILabel()
  16. label.text("用户198****1259")
  17. label.mediumFont(15)
  18. label.textColor = QSLColor.Color_202020
  19. return label
  20. }()
  21. lazy var commentLabel: UILabel = {
  22. let label = UILabel()
  23. label.numberOfLines = 0
  24. label.text("上班没时间,远程遛娃,非常方便很好用。")
  25. label.font(15)
  26. label.textColor = .hexStringColor(hexString: "#404040")
  27. return label
  28. }()
  29. override init(frame: CGRect) {
  30. super.init(frame: frame)
  31. self.addSubview(avatarImageView)
  32. avatarImageView.snp.makeConstraints { make in
  33. make.size.equalTo(CGSize(width: 32.rpx, height: 32.rpx))
  34. make.left.equalTo(12.rpx)
  35. make.top.equalTo(0.rpx)
  36. }
  37. self.addSubview(nameLabel)
  38. nameLabel.snp.makeConstraints { make in
  39. make.left.equalTo(avatarImageView.snp.right).offset(8.rpx)
  40. make.centerY.equalTo(avatarImageView.snp.centerY)
  41. }
  42. self.addSubview(commentLabel)
  43. commentLabel.snp.makeConstraints { make in
  44. make.left.equalTo(avatarImageView.snp.right).offset(8.rpx)
  45. make.right.equalTo(-12.rpx)
  46. make.top.equalTo(nameLabel.snp.bottom).offset(8.rpx)
  47. }
  48. }
  49. required init?(coder: NSCoder) {
  50. fatalError("init(coder:) has not been implemented")
  51. }
  52. func config(name: String, comment: String) {
  53. self.nameLabel.text = name
  54. self.commentLabel.text = comment
  55. }
  56. }