Commit 13877534 authored by Steven杜宇's avatar Steven杜宇

// 续签资料管理

parent 5ae31bc5
...@@ -12,6 +12,8 @@ import JXSegmentedView ...@@ -12,6 +12,8 @@ import JXSegmentedView
class YHResignMaterialUploadVC: YHBaseViewController { class YHResignMaterialUploadVC: YHBaseViewController {
var items:[[YHSupplementInfo]] = [] var items:[[YHSupplementInfo]] = []
// 列表是否是展开
var isUnfold = true
lazy var tableView: UITableView = { lazy var tableView: UITableView = {
let tableView = UITableView(frame:.zero, style:.grouped) let tableView = UITableView(frame:.zero, style:.grouped)
...@@ -21,17 +23,18 @@ class YHResignMaterialUploadVC: YHBaseViewController { ...@@ -21,17 +23,18 @@ class YHResignMaterialUploadVC: YHBaseViewController {
tableView.separatorStyle = .none tableView.separatorStyle = .none
tableView.delegate = self tableView.delegate = self
tableView.dataSource = self tableView.dataSource = self
tableView.backgroundColor = UIColor(hexString:"#F8F8F8") tableView.backgroundColor = UIColor(hexString:"#F8F9FB")
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell") tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell")
tableView.register(YHCertificateInfoCell.self, forCellReuseIdentifier: YHCertificateInfoCell.cellReuseIdentifier) tableView.register(YHResignMaterialCell.self, forCellReuseIdentifier: YHResignMaterialCell.cellReuseIdentifier)
tableView.backgroundView = emptyDataTipsView tableView.backgroundView = emptyDataTipsView
return tableView return tableView
}() }()
lazy var emptyDataTipsView: YHEmptyDataView = { lazy var emptyDataTipsView: YHEmptyDataView = {
let view = YHEmptyDataView.createView("没有找到相关资料哦~", kEmptyCommonBgName) let view = YHEmptyDataView.createView("没有找到相关资料哦~", kEmptyCommonBgName)
view.topMargin = 130 view.topMargin = 130
view.isHidden = false view.isHidden = true
return view return view
}() }()
...@@ -42,8 +45,34 @@ class YHResignMaterialUploadVC: YHBaseViewController { ...@@ -42,8 +45,34 @@ class YHResignMaterialUploadVC: YHBaseViewController {
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
self.view.backgroundColor = .white
self.gk_navigationBar.isHidden = true
createUI()
}
func createUI() {
view.addSubview(tableView)
tableView.snp.makeConstraints { make in
make.top.left.right.equalToSuperview()
make.height.equalTo(KScreenHeight - k_Height_NavigationtBarAndStatuBar - YHResinMaterialManageListVC.segmentHeight-4)
}
getData()
}
func getData() {
let arr1 = [YHSupplementInfo(checkStatus:1),
YHSupplementInfo(checkStatus:2),
YHSupplementInfo(checkStatus:3),
YHSupplementInfo(checkStatus:4),]
let arr2 = [YHSupplementInfo(checkStatus:1),
YHSupplementInfo(checkStatus:2),
YHSupplementInfo(checkStatus:3),
YHSupplementInfo(checkStatus:4),]
items.append(contentsOf: [arr1, arr2])
self.tableView.reloadData()
} }
} }
...@@ -112,7 +141,7 @@ extension YHResignMaterialUploadVC: UITableViewDelegate, UITableViewDataSource { ...@@ -112,7 +141,7 @@ extension YHResignMaterialUploadVC: UITableViewDelegate, UITableViewDataSource {
} }
private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat { private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat {
return 0.01 return section == 0 ? 56.0 : 52.0
} }
private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat { private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat {
...@@ -125,8 +154,31 @@ extension YHResignMaterialUploadVC: UITableViewDelegate, UITableViewDataSource { ...@@ -125,8 +154,31 @@ extension YHResignMaterialUploadVC: UITableViewDelegate, UITableViewDataSource {
} }
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let view = UIView()
let titleLabel = UILabel()
titleLabel.font = UIFont.PFSC_R(ofSize: 15)
titleLabel.textColor = .mainTextColor
titleLabel.text = section == 0 ? "工作资料" : "生活资料"
view.addSubview(titleLabel)
return UIView() let img = isUnfold ? "resign_material_list_unfold" : "resign_material_list_fold"
let arrowImgV = UIImageView(image: UIImage(named: img))
view.addSubview(arrowImgV)
titleLabel.snp.makeConstraints { make in
make.left.equalTo(16)
make.top.equalTo(section == 0 ? 20.0 : 16.0)
make.right.equalTo(arrowImgV.snp.left)
make.bottom.equalTo(-16)
}
arrowImgV.snp.makeConstraints { make in
make.width.height.equalTo(21.0)
make.right.equalTo(-16)
make.top.equalTo(titleLabel)
}
return view
} }
} }
......
...@@ -11,7 +11,7 @@ import JXSegmentedView ...@@ -11,7 +11,7 @@ import JXSegmentedView
class YHResinMaterialManageListVC: YHBaseViewController { class YHResinMaterialManageListVC: YHBaseViewController {
static let segmentHeight = 49.0 static let segmentHeight = 40.0
var titles = ["全部", "待上传(0)", "已驳回(0)", "审核中(0)", "已完成(0)"] var titles = ["全部", "待上传(0)", "已驳回(0)", "审核中(0)", "已完成(0)"]
var itemVCs:[YHResignMaterialUploadVC] = [] var itemVCs:[YHResignMaterialUploadVC] = []
...@@ -27,7 +27,8 @@ class YHResinMaterialManageListVC: YHBaseViewController { ...@@ -27,7 +27,8 @@ class YHResinMaterialManageListVC: YHBaseViewController {
//配置指示器 //配置指示器
let indicator = JXSegmentedIndicatorLineView() let indicator = JXSegmentedIndicatorLineView()
indicator.indicatorWidth = 16 indicator.indicatorWidth = 16
indicator.indicatorHeight = 4.0 indicator.indicatorHeight = 2.0
indicator.indicatorCornerRadius = 0.0
indicator.indicatorColor = .brandMainColor indicator.indicatorColor = .brandMainColor
segview.indicators = [indicator] segview.indicators = [indicator]
segview.backgroundColor = .clear segview.backgroundColor = .clear
...@@ -47,37 +48,40 @@ class YHResinMaterialManageListVC: YHBaseViewController { ...@@ -47,37 +48,40 @@ class YHResinMaterialManageListVC: YHBaseViewController {
dataSource.isTitleColorGradientEnabled = true dataSource.isTitleColorGradientEnabled = true
dataSource.titles = titles dataSource.titles = titles
dataSource.titleNormalFont = UIFont.PFSC_R(ofSize: 14) dataSource.titleNormalFont = UIFont.PFSC_R(ofSize: 14)
dataSource.titleNormalColor = .labelTextColor2 dataSource.titleNormalColor = .yhGreyColor
dataSource.titleSelectedFont = UIFont.PFSC_M(ofSize: 16) dataSource.titleSelectedFont = UIFont.PFSC_M(ofSize: 14)
dataSource.titleSelectedColor = UIColor(hexString: "#000000")! dataSource.titleSelectedColor = .mainTextColor
dataSource.isItemSpacingAverageEnabled = false dataSource.isItemSpacingAverageEnabled = false
dataSource.itemWidth = JXSegmentedViewAutomaticDimension dataSource.itemWidth = JXSegmentedViewAutomaticDimension
dataSource.itemSpacing = 24 dataSource.titleSelectedZoomScale = 1.0
dataSource.itemSpacing = 16
return dataSource return dataSource
}() }()
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
createUI()
} }
func setupUI() { func createUI() {
self.gk_navTitle = "续签资料管理"
self.view.backgroundColor = .white
view.addSubview(segmentContainerView) view.addSubview(segmentContainerView)
segmentContainerView.addSubview(segmentedView) segmentContainerView.addSubview(segmentedView)
view.addSubview(listContainerView) view.addSubview(listContainerView)
segmentContainerView.snp.makeConstraints { make in segmentContainerView.snp.makeConstraints { make in
make.left.right.equalToSuperview() make.left.equalToSuperview().offset(4.0)
make.right.equalToSuperview().offset(-4)
make.top.equalToSuperview().offset(k_Height_NavigationtBarAndStatuBar) make.top.equalToSuperview().offset(k_Height_NavigationtBarAndStatuBar)
make.height.equalTo(Self.segmentHeight+4) make.height.equalTo(Self.segmentHeight+4)
} }
segmentedView.snp.makeConstraints { make in segmentedView.snp.makeConstraints { make in
make.top.left.equalToSuperview() make.top.left.equalToSuperview()
make.right.equalToSuperview().offset(-21-18) make.right.equalToSuperview()
make.height.equalTo(Self.segmentHeight) make.height.equalTo(Self.segmentHeight)
} }
...@@ -99,8 +103,12 @@ extension YHResinMaterialManageListVC: JXSegmentedListContainerViewDataSource { ...@@ -99,8 +103,12 @@ extension YHResinMaterialManageListVC: JXSegmentedListContainerViewDataSource {
} }
func listContainerView(_ listContainerView: JXSegmentedListContainerView, initListAt index: Int) -> JXSegmentedListContainerViewListDelegate { func listContainerView(_ listContainerView: JXSegmentedListContainerView, initListAt index: Int) -> JXSegmentedListContainerViewListDelegate {
if 0 <= index, index < itemVCs.count {
return itemVCs[index] return itemVCs[index]
} }
return YHResignMaterialUploadVC()
}
} }
extension YHResinMaterialManageListVC: JXSegmentedViewDelegate { extension YHResinMaterialManageListVC: JXSegmentedViewDelegate {
......
...@@ -20,6 +20,8 @@ enum YHMaterialUploadStatus : Int { ...@@ -20,6 +20,8 @@ enum YHMaterialUploadStatus : Int {
case rejected = 2 case rejected = 2
// 待上传 // 待上传
case preUpload = 3 case preUpload = 3
// 未开始
case unStarted = 4
} }
class YHResignMaterialCell: UITableViewCell { class YHResignMaterialCell: UITableViewCell {
...@@ -70,11 +72,14 @@ class YHResignMaterialCell: UITableViewCell { ...@@ -70,11 +72,14 @@ class YHResignMaterialCell: UITableViewCell {
func updateModel(_ model: YHSupplementInfo) { func updateModel(_ model: YHSupplementInfo) {
self.model = model self.model = model
if let status = YHCertificateUploadStatus(rawValue: model.checkStatus) { if let status = YHMaterialUploadStatus(rawValue: model.checkStatus) {
var titleColor: UIColor = .labelTextColor2 var titleColor: UIColor = .labelTextColor2
var title = "" var title = ""
switch status { switch status {
case .unStarted:
titleColor = .mainTextColor(alpha: 0.5)
title = "未开始".local
case .preUpload: case .preUpload:
titleColor = .brandMainColor titleColor = .brandMainColor
title = "待上传".local title = "待上传".local
...@@ -82,63 +87,35 @@ class YHResignMaterialCell: UITableViewCell { ...@@ -82,63 +87,35 @@ class YHResignMaterialCell: UITableViewCell {
titleColor = .failColor titleColor = .failColor
title = "已驳回".local title = "已驳回".local
case .review: case .review:
titleColor = .warnColor titleColor = .init(hex: 0xFF8000)
title = "审核中".local title = "审核中".local
case .finish: case .finish:
titleColor = .labelTextColor2 titleColor = .init(hex: 0x3CC694)
title = "已完成".local title = "已完成".local
case .all: case .all:
titleColor = .labelTextColor2 titleColor = .labelTextColor2
} }
statusLabel.text = title statusLabel.text = title
statusLabel.textColor = titleColor statusLabel.textColor = titleColor
}
var infoStr = "" let img = UIImage(named: "family_info_status_arrow")?.withRenderingMode(.alwaysTemplate)
var typeStr = "无" self.rightArrowImgV.image = img
var ownerStr = "无" self.rightArrowImgV.tintColor = titleColor
if !model.typeName.isEmpty {
typeStr = model.typeName
}
if !model.nameExtra.applicant.isEmpty {
ownerStr = model.nameExtra.applicant
}
infoStr = "类型: \(typeStr)\n所属人: \(ownerStr)" }
let attributes: [NSAttributedString.Key: Any] = [
.font: UIFont.PFSC_R(ofSize:12),
.foregroundColor: UIColor.labelTextColor2
]
let attrString = NSMutableAttributedString(string: infoStr, attributes: attributes)
let paragraphStyle = NSMutableParagraphStyle()
paragraphStyle.lineSpacing = 4.0 // 设置行间距为 8 点
attrString.addAttribute(.paragraphStyle, value: paragraphStyle, range: NSRange(location: 0, length: infoStr.count))
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))
var name = model.name var name = "其他证明" //model.name
if !model.nameExtra.organization.isEmpty {
name += "(\(model.nameExtra.organization))"
}
let cerName: ASAttributedString = .init(string:name , .font(UIFont.PFSC_M(ofSize: 16)), .foreground(UIColor.mainTextColor)) let cerName: ASAttributedString = .init(string:name , .font(UIFont.PFSC_M(ofSize: 16)), .foreground(UIColor.mainTextColor))
var template: ASAttributedString = " \(.view(templateButton, .original(.center)))" var template: ASAttributedString = " \(.view(templateButton, .original(.center)))"
// 是否展示右边的模版按钮 // 是否展示右边的模版按钮
var showTemplateBtn = true var showTemplateBtn = true
if model.isNeedDealt {
templateButton.setTitle("银河代办", for: .normal)
template = " \(.view(templateButton, .original(.center)))"
} else {
templateButton.setTitle("资料模版", for: .normal)
template = " \(.view(templateButton, .original(.center)))"
if model.templateInfo.materialPath.isEmpty && model.templateInfo.guideFilePath.isEmpty && model.templateInfo.description.isEmpty { if model.templateInfo.materialPath.isEmpty && model.templateInfo.guideFilePath.isEmpty && model.templateInfo.description.isEmpty {
showTemplateBtn = false showTemplateBtn = false
} }
}
if model.isNeedSupplemnt() { if model.isNeedSupplemnt() {
result += mustTag result += mustTag
...@@ -174,35 +151,37 @@ class YHResignMaterialCell: UITableViewCell { ...@@ -174,35 +151,37 @@ class YHResignMaterialCell: UITableViewCell {
""" """
statusLabel = UILabel() statusLabel = UILabel()
statusLabel.textColor = UIColor.labelTextColor2 statusLabel.textColor = UIColor.mainTextColor(alpha: 0.5)
statusLabel.textAlignment = .left statusLabel.textAlignment = .left
statusLabel.font = UIFont.PFSC_R(ofSize:14) statusLabel.font = UIFont.PFSC_R(ofSize:14)
whiteView.addSubview(statusLabel) whiteView.addSubview(statusLabel)
rightArrowImgV = UIImageView(image: UIImage(named: "service_center_right_next_icon")) rightArrowImgV = UIImageView(image: UIImage(named: "family_info_status_arrow"))
whiteView.addSubview(rightArrowImgV) whiteView.addSubview(rightArrowImgV)
whiteView.snp.makeConstraints { make in whiteView.snp.makeConstraints { make in
make.left.equalToSuperview().offset(20) make.left.equalToSuperview().offset(16)
make.right.equalToSuperview().offset(-20) make.right.equalToSuperview().offset(-16)
make.top.bottom.equalToSuperview() make.top.equalToSuperview()
make.bottom.equalToSuperview().offset(-16)
} }
nameTextView.snp.makeConstraints { make in nameTextView.snp.makeConstraints { make in
make.left.equalToSuperview().offset(10) make.left.equalToSuperview().offset(20)
make.top.equalToSuperview().offset(4) make.top.equalToSuperview().offset(12)
make.right.equalTo(statusLabel.snp.left).offset(-26) make.right.equalTo(statusLabel.snp.left).offset(-14)
make.bottom.equalTo(-12)
} }
statusLabel.snp.makeConstraints { make in statusLabel.snp.makeConstraints { make in
make.right.equalTo(rightArrowImgV.snp.left).offset(-6) make.right.equalTo(rightArrowImgV.snp.left).offset(0)
make.size.equalTo(CGSize(width: 42, height: 20)) make.size.equalTo(CGSize(width: 42, height: 20))
make.centerY.equalToSuperview() make.centerY.equalToSuperview()
} }
rightArrowImgV.snp.makeConstraints { make in rightArrowImgV.snp.makeConstraints { make in
make.right.equalToSuperview().offset(-16) make.right.equalToSuperview().offset(-14)
make.size.equalTo(CGSize(width: 16, height: 16)) make.size.equalTo(CGSize(width: 20, height: 20))
make.centerY.equalToSuperview() make.centerY.equalToSuperview()
} }
} }
......
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "icon-展开@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "icon-展开@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "icon-展开@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "icon-展开@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
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