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

// 我的证件

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