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

Merge commit 'ba294fdf' into xiezhaolin

parents 7ccc58bd ba294fdf
...@@ -8,6 +8,8 @@ ...@@ -8,6 +8,8 @@
import UIKit import UIKit
class YHSearchInfoCell: UITableViewCell { class YHSearchInfoCell: UITableViewCell {
static let cellReuseIdentifier = "YHSearchInfoCell" static let cellReuseIdentifier = "YHSearchInfoCell"
...@@ -39,7 +41,6 @@ class YHSearchInfoCell: UITableViewCell { ...@@ -39,7 +41,6 @@ class YHSearchInfoCell: UITableViewCell {
return label return label
}() }()
func setupUI() { func setupUI() {
contentView.backgroundColor = .white contentView.backgroundColor = .white
...@@ -59,4 +60,24 @@ class YHSearchInfoCell: UITableViewCell { ...@@ -59,4 +60,24 @@ class YHSearchInfoCell: UITableViewCell {
} }
} }
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 { ...@@ -36,7 +36,7 @@ class YHCertificateCategoryItem {
class YHCertificateListContainerVC: YHBaseViewController { class YHCertificateListContainerVC: YHBaseViewController {
static let segmentHeight = 53.0 static let segmentHeight = 49.0
var orderId : Int? var orderId : Int?
var filterDict : [String: String] = [:] var filterDict : [String: String] = [:]
...@@ -68,6 +68,12 @@ class YHCertificateListContainerVC: YHBaseViewController { ...@@ -68,6 +68,12 @@ class YHCertificateListContainerVC: YHBaseViewController {
YHCertificateCategoryItem(type: .finish)] YHCertificateCategoryItem(type: .finish)]
var itemVCs:[YHCertificateListVC] = [] var itemVCs:[YHCertificateListVC] = []
lazy var segmentContainerView: UIView = {
let view = UIView()
view.backgroundColor = .white
return view
}()
lazy var segmentedView : JXSegmentedView = { lazy var segmentedView : JXSegmentedView = {
let segview = JXSegmentedView(frame: CGRect(x: 0, y: k_Height_NavigationtBarAndStatuBar, width: KScreenWidth, height: Self.segmentHeight)) let segview = JXSegmentedView(frame: CGRect(x: 0, y: k_Height_NavigationtBarAndStatuBar, width: KScreenWidth, height: Self.segmentHeight))
segview.dataSource = segmentedDataSource segview.dataSource = segmentedDataSource
...@@ -75,6 +81,7 @@ class YHCertificateListContainerVC: YHBaseViewController { ...@@ -75,6 +81,7 @@ class YHCertificateListContainerVC: YHBaseViewController {
//配置指示器 //配置指示器
let indicator = JXSegmentedIndicatorLineView() let indicator = JXSegmentedIndicatorLineView()
indicator.indicatorWidth = 16 indicator.indicatorWidth = 16
indicator.indicatorHeight = 4.0
indicator.indicatorColor = .brandMainColor indicator.indicatorColor = .brandMainColor
segview.indicators = [indicator] segview.indicators = [indicator]
segview.backgroundColor = .clear segview.backgroundColor = .clear
...@@ -163,8 +170,9 @@ class YHCertificateListContainerVC: YHBaseViewController { ...@@ -163,8 +170,9 @@ class YHCertificateListContainerVC: YHBaseViewController {
itemVCs.append(vc) itemVCs.append(vc)
} }
view.addSubview(navBar) view.addSubview(navBar)
view.addSubview(segmentedView) view.addSubview(segmentContainerView)
view.addSubview(filterBtn) segmentContainerView.addSubview(segmentedView)
segmentContainerView.addSubview(filterBtn)
view.addSubview(listContainerView) view.addSubview(listContainerView)
navBar.snp.makeConstraints { make in navBar.snp.makeConstraints { make in
...@@ -172,21 +180,27 @@ class YHCertificateListContainerVC: YHBaseViewController { ...@@ -172,21 +180,27 @@ class YHCertificateListContainerVC: YHBaseViewController {
make.top.equalToSuperview().offset(k_Height_statusBar()) make.top.equalToSuperview().offset(k_Height_statusBar())
make.height.equalTo(k_Height_NavContentBar) 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 segmentedView.snp.makeConstraints { make in
make.left.equalToSuperview() make.top.left.equalToSuperview()
make.right.equalToSuperview().offset(-21-18) make.right.equalToSuperview().offset(-21-18)
make.top.equalToSuperview().offset(k_Height_NavigationtBarAndStatuBar)
make.height.equalTo(Self.segmentHeight) make.height.equalTo(Self.segmentHeight)
} }
filterBtn.snp.makeConstraints { make in filterBtn.snp.makeConstraints { make in
make.width.height.equalTo(YHCertificateFilterButton.width) make.width.height.equalTo(YHCertificateFilterButton.width)
make.centerY.equalTo(segmentedView.snp.centerY) make.centerY.equalToSuperview()
make.right.equalToSuperview().offset(-18) make.right.equalToSuperview().offset(-18)
} }
listContainerView.snp.makeConstraints { make in listContainerView.snp.makeConstraints { make in
make.left.right.equalToSuperview() make.left.right.equalToSuperview()
make.top.equalTo(segmentedView.snp.bottom) make.top.equalTo(segmentContainerView.snp.bottom)
make.bottom.equalToSuperview() make.bottom.equalToSuperview()
} }
} }
......
...@@ -283,7 +283,7 @@ extension YHCertificateUploadContentListVC: UITableViewDelegate, UITableViewData ...@@ -283,7 +283,7 @@ extension YHCertificateUploadContentListVC: UITableViewDelegate, UITableViewData
} else if editType == .delete { // 删除 } else if editType == .delete { // 删除
let msg = "您确定要删除文档\(contentItem.name)吗" let msg = "您确定要删除文档\(contentItem.name)?"
YHTwoOptionAlertView.showAlertView(message:msg) { sure in YHTwoOptionAlertView.showAlertView(message:msg) { sure in
if !sure { return } if !sure { return }
// 删除 // 删除
......
...@@ -66,7 +66,20 @@ class YHCertificateInfoCell: UITableViewCell { ...@@ -66,7 +66,20 @@ class YHCertificateInfoCell: UITableViewCell {
if !model.nameExtra.applicant.isEmpty { if !model.nameExtra.applicant.isEmpty {
ownerStr = model.nameExtra.applicant 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)) 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)) let mustTag: ASAttributedString = .init("*", .font(UIFont.PFSC_M(ofSize: 16)),.foreground(UIColor.failColor))
...@@ -155,7 +168,7 @@ class YHCertificateInfoCell: UITableViewCell { ...@@ -155,7 +168,7 @@ class YHCertificateInfoCell: UITableViewCell {
nameTextView.snp.makeConstraints { make in nameTextView.snp.makeConstraints { make in
make.left.equalToSuperview().offset(10) make.left.equalToSuperview().offset(10)
make.top.equalToSuperview().offset(4) 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 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