// // QSLVipMostGoodCell.swift // QuickSearchLocation // // Created by Destiny on 2025/5/28. // import UIKit class QSLVipMostGoodCell: UIView { struct UX { static let mainViewHeight = 71.0.rpx static let mainViewWidth = QSLConst.qsl_kScreenW - 36.0.rpx } var goodModel: QSLGoodModel? lazy var bgView: UIView = { let view = UIView() view.backgroundColor = .hexStringColor(hexString: "#EEEEEE") view.addRadius(radius: 12) return view }() lazy var mostTagIcon: UIImageView = { let imageView = UIImageView() imageView.image = UIImage(named: "vip_goods_most_tag") return imageView }() lazy var mainView: UIView = { let view = UIView(frame: CGRect(x: 0, y: 0, width: UX.mainViewWidth, height: UX.mainViewHeight)) view.addFourCorner(topLeft: 11, topRight: 11, bottomLeft: 0, bottomRight: 0) view.backgroundColor = .white return view }() lazy var priceLabel: UILabel = { let label = UILabel() label.textAlignment = .center // label.addRadius(radius: 12.rpx) // label.backgroundColor = .hexStringColor(hexString: "#F6F6F6") label.text("¥128") label.mediumFont(24) label.textColor = .hexStringColor(hexString: "#F12A1D") label.setSpecificTextColorFont("¥", color: .hexStringColor(hexString: "#F12A1D"), font: UIFont.systemFont(ofSize: 14, weight: .medium)) return label }() lazy var originPriceLabel: UILabel = { let label = UILabel() label.text("¥299") label.font(13) label.textColor = .hexStringColor(hexString: "#A7A7A7") label.centerLineText(lineValue: 1, underlineColor: .hexStringColor(hexString: "#A7A7A7")) return label }() lazy var titleLabel: UILabel = { let label = UILabel() label.text("周度会员") label.boldFont(14) label.textColor = .hexStringColor(hexString: "#404040") return label }() lazy var describeLabel: UILabel = { let label = UILabel() label.text("96%用户首选") label.boldFont(9) label.textColor = .hexStringColor(hexString: "#11BD96") return label }() lazy var processBgView: UIView = { let view = UIView() view.backgroundColor = .hexStringColor(hexString: "#BAFFF1") view.addRadius(radius: 2.5.rpx) return view }() lazy var processView: UIView = { let view = UIView() view.backgroundColor = .hexStringColor(hexString: "#15CBA1") view.addRadius(radius: 2.5.rpx) return view }() lazy var recommendIcon: UIImageView = { let icon = UIImageView() icon.image = UIImage(named: "vip_recommend_tag") return icon }() lazy var dailyLabel: UILabel = { let label = UILabel() let text = "仅需¥9.2/天,时刻守护Ta的安全" label.text(text) label.font(11) label.textColor = .hexStringColor(hexString: "#818181") label.setSpecificTextColorFont("¥", color: .hexStringColor(hexString: "#818181"), font: UIFont.systemFont(ofSize: 11, weight: .heavy)) if let yuanIndex = text.firstIndex(of: "¥"), let slashIndex = text.firstIndex(of: "/") { // 创建从¥后面一个字符到/前面一个字符的range let contentRange = text.index(after: yuanIndex)..