Commit fc4da478 authored by pete谢兆麟's avatar pete谢兆麟

Merge commit 'ba294fdf' into xiezhaolin

parents 7ccc58bd ba294fdf
......@@ -8,6 +8,8 @@
import UIKit
class YHSearchInfoCell: UITableViewCell {
static let cellReuseIdentifier = "YHSearchInfoCell"
......@@ -39,9 +41,8 @@ class YHSearchInfoCell: UITableViewCell {
return label
}()
func setupUI() {
contentView.backgroundColor = .white
contentView.addSubview(headImgView)
contentView.addSubview(titleLabel)
......@@ -58,5 +59,25 @@ class YHSearchInfoCell: UITableViewCell {
make.right.equalToSuperview().offset(-20)
}
}
func highlightText(in text: String, highlightString: String, highlightColor: UIColor) -> NSAttributedString {
let attributedString = NSMutableAttributedString(string: text)
// 创建一个属性字典,用于设置高亮样式
let highlightAttributes: [NSAttributedString.Key: Any] = [
.backgroundColor: highlightColor
]
// 查找并应用高亮样式到指定文字
let range = (text as NSString).range(of: highlightString)
attributedString.addAttributes(highlightAttributes, range: range)
return attributedString
}
func hopeless() {
}
}
......@@ -36,7 +36,7 @@ class YHCertificateCategoryItem {
class YHCertificateListContainerVC: YHBaseViewController {
static let segmentHeight = 53.0
static let segmentHeight = 49.0
var orderId : Int?
var filterDict : [String: String] = [:]
......@@ -68,6 +68,12 @@ class YHCertificateListContainerVC: YHBaseViewController {
YHCertificateCategoryItem(type: .finish)]
var itemVCs:[YHCertificateListVC] = []
lazy var segmentContainerView: UIView = {
let view = UIView()
view.backgroundColor = .white
return view
}()
lazy var segmentedView : JXSegmentedView = {
let segview = JXSegmentedView(frame: CGRect(x: 0, y: k_Height_NavigationtBarAndStatuBar, width: KScreenWidth, height: Self.segmentHeight))
segview.dataSource = segmentedDataSource
......@@ -75,6 +81,7 @@ class YHCertificateListContainerVC: YHBaseViewController {
//配置指示器
let indicator = JXSegmentedIndicatorLineView()
indicator.indicatorWidth = 16
indicator.indicatorHeight = 4.0
indicator.indicatorColor = .brandMainColor
segview.indicators = [indicator]
segview.backgroundColor = .clear
......@@ -163,8 +170,9 @@ class YHCertificateListContainerVC: YHBaseViewController {
itemVCs.append(vc)
}
view.addSubview(navBar)
view.addSubview(segmentedView)
view.addSubview(filterBtn)
view.addSubview(segmentContainerView)
segmentContainerView.addSubview(segmentedView)
segmentContainerView.addSubview(filterBtn)
view.addSubview(listContainerView)
navBar.snp.makeConstraints { make in
......@@ -172,21 +180,27 @@ class YHCertificateListContainerVC: YHBaseViewController {
make.top.equalToSuperview().offset(k_Height_statusBar())
make.height.equalTo(k_Height_NavContentBar)
}
segmentContainerView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalToSuperview().offset(k_Height_NavigationtBarAndStatuBar)
make.height.equalTo(Self.segmentHeight+4)
}
segmentedView.snp.makeConstraints { make in
make.left.equalToSuperview()
make.top.left.equalToSuperview()
make.right.equalToSuperview().offset(-21-18)
make.top.equalToSuperview().offset(k_Height_NavigationtBarAndStatuBar)
make.height.equalTo(Self.segmentHeight)
}
filterBtn.snp.makeConstraints { make in
make.width.height.equalTo(YHCertificateFilterButton.width)
make.centerY.equalTo(segmentedView.snp.centerY)
make.centerY.equalToSuperview()
make.right.equalToSuperview().offset(-18)
}
listContainerView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalTo(segmentedView.snp.bottom)
make.top.equalTo(segmentContainerView.snp.bottom)
make.bottom.equalToSuperview()
}
}
......
......@@ -283,7 +283,7 @@ extension YHCertificateUploadContentListVC: UITableViewDelegate, UITableViewData
} else if editType == .delete { // 删除
let msg = "您确定要删除文档\(contentItem.name)吗"
let msg = "您确定要删除文档\(contentItem.name)?"
YHTwoOptionAlertView.showAlertView(message:msg) { sure in
if !sure { return }
// 删除
......
......@@ -66,7 +66,20 @@ class YHCertificateInfoCell: UITableViewCell {
if !model.nameExtra.applicant.isEmpty {
ownerStr = model.nameExtra.applicant
}
infoLabel.text = "类型: \(typeStr) 所属人: \(ownerStr)"
infoStr = "类型: \(typeStr) | 所属人: \(ownerStr)"
let attributes: [NSAttributedString.Key: Any] = [
.font: UIFont.PFSC_R(ofSize:11),
.foregroundColor: UIColor.labelTextColor2
]
let attrString = NSMutableAttributedString(string: infoStr, attributes: attributes)
if let separatorRange = infoStr.range(of: String("|")) {
let range = NSRange(separatorRange, in: infoStr)
attrString.addAttribute(NSAttributedString.Key.foregroundColor, value: UIColor(hex: 0xF0F0F0), range: range)
}
infoLabel.attributedText = attrString
var result:ASAttributedString = .init(string:"", .font(UIFont.PFSC_M(ofSize: 16)), .foreground(UIColor.mainTextColor))
let mustTag: ASAttributedString = .init("*", .font(UIFont.PFSC_M(ofSize: 16)),.foreground(UIColor.failColor))
......@@ -155,7 +168,7 @@ class YHCertificateInfoCell: UITableViewCell {
nameTextView.snp.makeConstraints { make in
make.left.equalToSuperview().offset(10)
make.top.equalToSuperview().offset(4)
make.right.equalTo(statusLabel.snp.left).offset(-6)
make.right.equalTo(statusLabel.snp.left).offset(-26)
}
infoLabel.snp.makeConstraints { make in
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment