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

// 续签资料管理

parent 5ae31bc5
......@@ -12,7 +12,9 @@ import JXSegmentedView
class YHResignMaterialUploadVC: YHBaseViewController {
var items:[[YHSupplementInfo]] = []
// 列表是否是展开
var isUnfold = true
lazy var tableView: UITableView = {
let tableView = UITableView(frame:.zero, style:.grouped)
tableView.estimatedSectionHeaderHeight = 14.0
......@@ -21,17 +23,18 @@ class YHResignMaterialUploadVC: YHBaseViewController {
tableView.separatorStyle = .none
tableView.delegate = self
tableView.dataSource = self
tableView.backgroundColor = UIColor(hexString:"#F8F8F8")
tableView.backgroundColor = UIColor(hexString:"#F8F9FB")
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell")
tableView.register(YHCertificateInfoCell.self, forCellReuseIdentifier: YHCertificateInfoCell.cellReuseIdentifier)
tableView.register(YHResignMaterialCell.self, forCellReuseIdentifier: YHResignMaterialCell.cellReuseIdentifier)
tableView.backgroundView = emptyDataTipsView
return tableView
}()
lazy var emptyDataTipsView: YHEmptyDataView = {
let view = YHEmptyDataView.createView("没有找到相关资料哦~", kEmptyCommonBgName)
view.topMargin = 130
view.isHidden = false
view.isHidden = true
return view
}()
......@@ -42,8 +45,34 @@ class YHResignMaterialUploadVC: YHBaseViewController {
override func 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 {
}
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 {
......@@ -125,8 +154,31 @@ extension YHResignMaterialUploadVC: UITableViewDelegate, UITableViewDataSource {
}
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
class YHResinMaterialManageListVC: YHBaseViewController {
static let segmentHeight = 49.0
static let segmentHeight = 40.0
var titles = ["全部", "待上传(0)", "已驳回(0)", "审核中(0)", "已完成(0)"]
var itemVCs:[YHResignMaterialUploadVC] = []
......@@ -27,7 +27,8 @@ class YHResinMaterialManageListVC: YHBaseViewController {
//配置指示器
let indicator = JXSegmentedIndicatorLineView()
indicator.indicatorWidth = 16
indicator.indicatorHeight = 4.0
indicator.indicatorHeight = 2.0
indicator.indicatorCornerRadius = 0.0
indicator.indicatorColor = .brandMainColor
segview.indicators = [indicator]
segview.backgroundColor = .clear
......@@ -47,37 +48,40 @@ class YHResinMaterialManageListVC: YHBaseViewController {
dataSource.isTitleColorGradientEnabled = true
dataSource.titles = titles
dataSource.titleNormalFont = UIFont.PFSC_R(ofSize: 14)
dataSource.titleNormalColor = .labelTextColor2
dataSource.titleSelectedFont = UIFont.PFSC_M(ofSize: 16)
dataSource.titleSelectedColor = UIColor(hexString: "#000000")!
dataSource.titleNormalColor = .yhGreyColor
dataSource.titleSelectedFont = UIFont.PFSC_M(ofSize: 14)
dataSource.titleSelectedColor = .mainTextColor
dataSource.isItemSpacingAverageEnabled = false
dataSource.itemWidth = JXSegmentedViewAutomaticDimension
dataSource.itemSpacing = 24
dataSource.titleSelectedZoomScale = 1.0
dataSource.itemSpacing = 16
return dataSource
}()
override func viewDidLoad() {
super.viewDidLoad()
createUI()
}
func setupUI() {
func createUI() {
self.gk_navTitle = "续签资料管理"
self.view.backgroundColor = .white
view.addSubview(segmentContainerView)
segmentContainerView.addSubview(segmentedView)
view.addSubview(listContainerView)
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.height.equalTo(Self.segmentHeight+4)
}
segmentedView.snp.makeConstraints { make in
make.top.left.equalToSuperview()
make.right.equalToSuperview().offset(-21-18)
make.right.equalToSuperview()
make.height.equalTo(Self.segmentHeight)
}
......@@ -99,7 +103,11 @@ extension YHResinMaterialManageListVC: JXSegmentedListContainerViewDataSource {
}
func listContainerView(_ listContainerView: JXSegmentedListContainerView, initListAt index: Int) -> JXSegmentedListContainerViewListDelegate {
return itemVCs[index]
if 0 <= index, index < itemVCs.count {
return itemVCs[index]
}
return YHResignMaterialUploadVC()
}
}
......
......@@ -20,6 +20,8 @@ enum YHMaterialUploadStatus : Int {
case rejected = 2
// 待上传
case preUpload = 3
// 未开始
case unStarted = 4
}
class YHResignMaterialCell: UITableViewCell {
......@@ -70,11 +72,14 @@ class YHResignMaterialCell: UITableViewCell {
func updateModel(_ model: YHSupplementInfo) {
self.model = model
if let status = YHCertificateUploadStatus(rawValue: model.checkStatus) {
if let status = YHMaterialUploadStatus(rawValue: model.checkStatus) {
var titleColor: UIColor = .labelTextColor2
var title = ""
switch status {
case .unStarted:
titleColor = .mainTextColor(alpha: 0.5)
title = "未开始".local
case .preUpload:
titleColor = .brandMainColor
title = "待上传".local
......@@ -82,62 +87,34 @@ class YHResignMaterialCell: UITableViewCell {
titleColor = .failColor
title = "已驳回".local
case .review:
titleColor = .warnColor
titleColor = .init(hex: 0xFF8000)
title = "审核中".local
case .finish:
titleColor = .labelTextColor2
titleColor = .init(hex: 0x3CC694)
title = "已完成".local
case .all:
titleColor = .labelTextColor2
}
statusLabel.text = title
statusLabel.textColor = titleColor
let img = UIImage(named: "family_info_status_arrow")?.withRenderingMode(.alwaysTemplate)
self.rightArrowImgV.image = img
self.rightArrowImgV.tintColor = titleColor
}
var infoStr = ""
var typeStr = "无"
var ownerStr = "无"
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))
let mustTag: ASAttributedString = .init("*", .font(UIFont.PFSC_M(ofSize: 16)),.foreground(UIColor.failColor))
var name = model.name
if !model.nameExtra.organization.isEmpty {
name += "(\(model.nameExtra.organization))"
}
var name = "其他证明" //model.name
let cerName: ASAttributedString = .init(string:name , .font(UIFont.PFSC_M(ofSize: 16)), .foreground(UIColor.mainTextColor))
var template: ASAttributedString = " \(.view(templateButton, .original(.center)))"
// 是否展示右边的模版按钮
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 {
showTemplateBtn = false
}
if model.templateInfo.materialPath.isEmpty && model.templateInfo.guideFilePath.isEmpty && model.templateInfo.description.isEmpty {
showTemplateBtn = false
}
if model.isNeedSupplemnt() {
......@@ -174,35 +151,37 @@ class YHResignMaterialCell: UITableViewCell {
"""
statusLabel = UILabel()
statusLabel.textColor = UIColor.labelTextColor2
statusLabel.textColor = UIColor.mainTextColor(alpha: 0.5)
statusLabel.textAlignment = .left
statusLabel.font = UIFont.PFSC_R(ofSize:14)
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.snp.makeConstraints { make in
make.left.equalToSuperview().offset(20)
make.right.equalToSuperview().offset(-20)
make.top.bottom.equalToSuperview()
make.left.equalToSuperview().offset(16)
make.right.equalToSuperview().offset(-16)
make.top.equalToSuperview()
make.bottom.equalToSuperview().offset(-16)
}
nameTextView.snp.makeConstraints { make in
make.left.equalToSuperview().offset(10)
make.top.equalToSuperview().offset(4)
make.right.equalTo(statusLabel.snp.left).offset(-26)
make.left.equalToSuperview().offset(20)
make.top.equalToSuperview().offset(12)
make.right.equalTo(statusLabel.snp.left).offset(-14)
make.bottom.equalTo(-12)
}
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.centerY.equalToSuperview()
}
rightArrowImgV.snp.makeConstraints { make in
make.right.equalToSuperview().offset(-16)
make.size.equalTo(CGSize(width: 16, height: 16))
make.right.equalToSuperview().offset(-14)
make.size.equalTo(CGSize(width: 20, height: 20))
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