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

// 我的证件

parent 65a89b11
...@@ -35,7 +35,7 @@ class YHFileListViewController: YHBaseViewController { ...@@ -35,7 +35,7 @@ class YHFileListViewController: YHBaseViewController {
view.backgroundColor = .red view.backgroundColor = .red
return view
}() }()
......
...@@ -14,8 +14,10 @@ import IQKeyboardManagerSwift ...@@ -14,8 +14,10 @@ import IQKeyboardManagerSwift
class YHCertificateResourceUploadVC: YHBaseViewController { class YHCertificateResourceUploadVC: YHBaseViewController {
var orderId : Int? var orderId : Int?
var status: YHCertificateUploadStatus = .all
var items:[YHSupplementInfo] = [] var items:[YHSupplementInfo] = []
var viewModel: YHCertificateViewModel = YHCertificateViewModel() var viewModel: YHCertificateViewModel = YHCertificateViewModel()
var categoryInfo: YHCategoryData = YHCategoryData()
lazy var tableView: UITableView = { lazy var tableView: UITableView = {
...@@ -114,8 +116,8 @@ extension YHCertificateResourceUploadVC { ...@@ -114,8 +116,8 @@ extension YHCertificateResourceUploadVC {
let params = [ let params = [
"order_id" : orderId ?? 0, "order_id" : orderId ?? 0,
"node": "1", "node": "1",
"state": "1", "state": String(status.rawValue),
"category_id": "20", "category_id": categoryInfo.categoryId,
"status_all": "", "status_all": "",
"keywork": "", "keywork": "",
"template_cate_id": "", "template_cate_id": "",
......
...@@ -10,9 +10,25 @@ import UIKit ...@@ -10,9 +10,25 @@ import UIKit
import JXSegmentedView import JXSegmentedView
class YHCertificateCategoryItem { class YHCertificateCategoryItem {
var type : YHCertificateUploadStatus = .unknown var type : YHCertificateUploadStatus = .all
var title : String = "" var title : String {
switch type {
case .all:
return "全部".local
case .review:
return "审核中".local
case .rejected:
return "已驳回".local
case .preUpload:
return "待上传".local
case .finish:
return "已通过".local
}
}
init(type: YHCertificateUploadStatus) {
self.type = type
}
} }
class YHMaterialListViewController: YHBaseViewController { class YHMaterialListViewController: YHBaseViewController {
...@@ -20,7 +36,7 @@ class YHMaterialListViewController: YHBaseViewController { ...@@ -20,7 +36,7 @@ class YHMaterialListViewController: YHBaseViewController {
static let segmentHeight = 53.0 static let segmentHeight = 53.0
var orderId : Int? var orderId : Int?
var categoryInfo: YHCategoryData = YHCategoryData()
lazy var navBar: YHCustomNavigationBar = { lazy var navBar: YHCustomNavigationBar = {
let bar = YHCustomNavigationBar.navBar() let bar = YHCustomNavigationBar.navBar()
bar.title = "资料上传".local bar.title = "资料上传".local
...@@ -39,7 +55,12 @@ class YHMaterialListViewController: YHBaseViewController { ...@@ -39,7 +55,12 @@ class YHMaterialListViewController: YHBaseViewController {
return bar return bar
}() }()
let categoryItems = ["全部".local, "待上传".local, "已驳回".local, "审核中".local, "已通过".local] var titles = ["全部".local, "待上传".local, "已驳回".local, "审核中".local, "已通过".local]
let categoryItems = [ YHCertificateCategoryItem(type: .all),
YHCertificateCategoryItem(type: .preUpload),
YHCertificateCategoryItem(type: .rejected),
YHCertificateCategoryItem(type: .review),
YHCertificateCategoryItem(type: .finish)]
var itemVCs:[YHCertificateResourceUploadVC] = [] var itemVCs:[YHCertificateResourceUploadVC] = []
lazy var segmentedView : JXSegmentedView = { lazy var segmentedView : JXSegmentedView = {
...@@ -59,7 +80,7 @@ class YHMaterialListViewController: YHBaseViewController { ...@@ -59,7 +80,7 @@ class YHMaterialListViewController: YHBaseViewController {
lazy var segmentedDataSource: JXSegmentedBaseDataSource = { lazy var segmentedDataSource: JXSegmentedBaseDataSource = {
let dataSource = JXSegmentedTitleDataSource() let dataSource = JXSegmentedTitleDataSource()
dataSource.isTitleColorGradientEnabled = true dataSource.isTitleColorGradientEnabled = true
dataSource.titles = categoryItems dataSource.titles = titles
dataSource.titleNormalFont = UIFont.PFSC_R(ofSize: 14) dataSource.titleNormalFont = UIFont.PFSC_R(ofSize: 14)
dataSource.titleNormalColor = .labelTextColor2 dataSource.titleNormalColor = .labelTextColor2
dataSource.titleSelectedFont = UIFont.PFSC_M(ofSize: 16) dataSource.titleSelectedFont = UIFont.PFSC_M(ofSize: 16)
...@@ -94,9 +115,14 @@ class YHMaterialListViewController: YHBaseViewController { ...@@ -94,9 +115,14 @@ class YHMaterialListViewController: YHBaseViewController {
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
self.gk_navigationBar.isHidden = true self.gk_navigationBar.isHidden = true
for _ in categoryItems { titles.removeAll()
for item in categoryItems {
titles.append(item.title)
let vc = YHCertificateResourceUploadVC() let vc = YHCertificateResourceUploadVC()
vc.orderId = orderId
vc.status = item.type
vc.categoryInfo = categoryInfo
itemVCs.append(vc) itemVCs.append(vc)
} }
view.addSubview(navBar) view.addSubview(navBar)
......
...@@ -164,8 +164,13 @@ extension YHMineCertificateEntryViewController : UITableViewDelegate,UITableView ...@@ -164,8 +164,13 @@ extension YHMineCertificateEntryViewController : UITableViewDelegate,UITableView
tableView.deselectRow(at: indexPath, animated: true) tableView.deselectRow(at: indexPath, animated: true)
printLog("点击了 tableView Cell \(indexPath.section)") printLog("点击了 tableView Cell \(indexPath.section)")
guard let model = certificateReqVM.certificateEntryModel else { return }
let vc = YHMaterialListViewController() let vc = YHMaterialListViewController()
vc.orderId = orderId vc.orderId = orderId
if indexPath.section < model.category_data.count {
vc.categoryInfo = model.category_data[indexPath.section]
}
self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
......
...@@ -15,7 +15,7 @@ class YHCertificateInfoCell: UITableViewCell { ...@@ -15,7 +15,7 @@ class YHCertificateInfoCell: UITableViewCell {
static let cellReuseIdentifier = "YHCertificateNameCell" static let cellReuseIdentifier = "YHCertificateNameCell"
var status : YHCertificateUploadStatus = .unknown var status : YHCertificateUploadStatus = .preUpload
var whiteView: UIView! var whiteView: UIView!
var nameTextView: UITextView! var nameTextView: UITextView!
var infoLabel: UILabel! var infoLabel: UILabel!
...@@ -43,22 +43,31 @@ class YHCertificateInfoCell: UITableViewCell { ...@@ -43,22 +43,31 @@ class YHCertificateInfoCell: UITableViewCell {
setupUI() setupUI()
} }
func update() { func updateModel(_ model: YHSupplementInfo) {
var titleColor: UIColor = .labelTextColor2 if let status = YHCertificateUploadStatus(rawValue: model.checkStatus) {
switch status {
case .preUpload: var titleColor: UIColor = .labelTextColor2
titleColor = .brandMainColor var title = ""
case .rejected: switch status {
titleColor = .failColor case .preUpload:
case .review, .finish: titleColor = .brandMainColor
titleColor = .labelTextColor2 title = "待上传".local
case .unknown: case .rejected:
titleColor = .labelTextColor2 titleColor = .failColor
title = "已驳回".local
case .review:
titleColor = .labelTextColor2
title = "审核中".local
case .finish:
titleColor = .labelTextColor2
title = "已通过".local
case .all:
titleColor = .labelTextColor2
}
statusBtn.setTitleColor(titleColor, for:.normal)
statusBtn.setTitle(title, for: .normal)
} }
}
func updateModel(_ model: YHSupplementInfo) {
if model.templateInfo.materialPath.isEmpty { if model.templateInfo.materialPath.isEmpty {
...@@ -113,7 +122,7 @@ class YHCertificateInfoCell: UITableViewCell { ...@@ -113,7 +122,7 @@ class YHCertificateInfoCell: UITableViewCell {
statusBtn.imageEdgeInsets = UIEdgeInsets(top: 0, left: titleWidth, bottom: 0, right: -titleWidth) statusBtn.imageEdgeInsets = UIEdgeInsets(top: 0, left: titleWidth, bottom: 0, right: -titleWidth)
statusBtn.setImage(UIImage(named:"my_cer_arrow_right"), for:.normal) statusBtn.setImage(UIImage(named:"my_cer_arrow_right"), for:.normal)
statusBtn.setTitle("待上传", for:.normal) statusBtn.setTitle("待上传", for:.normal)
statusBtn.setTitleColor(.blue, for:.normal) statusBtn.setTitleColor(.labelTextColor2, for:.normal)
whiteView.addSubview(statusBtn) whiteView.addSubview(statusBtn)
whiteView.snp.makeConstraints { make in whiteView.snp.makeConstraints { make in
......
...@@ -20,8 +20,8 @@ enum YHCertificateCategoryId: Int { ...@@ -20,8 +20,8 @@ enum YHCertificateCategoryId: Int {
} }
enum YHCertificateUploadStatus : Int { enum YHCertificateUploadStatus : Int {
// 未知 // 全部
case unknown = -1 case all = -1
// 审核中 // 审核中
case review = 0 case review = 0
// 已完成 // 已完成
......
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