Commit 486ba6aa authored by Steven杜宇's avatar Steven杜宇

// UI走查

parent 14086d14
...@@ -215,6 +215,7 @@ ...@@ -215,6 +215,7 @@
048097712BA18D66000B9DCA /* YHCertificateSearchBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048097702BA18D66000B9DCA /* YHCertificateSearchBar.swift */; }; 048097712BA18D66000B9DCA /* YHCertificateSearchBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 048097702BA18D66000B9DCA /* YHCertificateSearchBar.swift */; };
0493B3DC2BA7EFE600AF9393 /* YHCertificateSearchViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0493B3DB2BA7EFE600AF9393 /* YHCertificateSearchViewController.swift */; }; 0493B3DC2BA7EFE600AF9393 /* YHCertificateSearchViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0493B3DB2BA7EFE600AF9393 /* YHCertificateSearchViewController.swift */; };
0493B3DE2BA80C2300AF9393 /* YHCertificateFilterButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0493B3DD2BA80C2300AF9393 /* YHCertificateFilterButton.swift */; }; 0493B3DE2BA80C2300AF9393 /* YHCertificateFilterButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0493B3DD2BA80C2300AF9393 /* YHCertificateFilterButton.swift */; };
049537852BA9B28500AF7E59 /* YHCertificateTemplateCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 049537842BA9B28500AF7E59 /* YHCertificateTemplateCell.swift */; };
049A48A82B49417300D0C641 /* YHAboutUsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 049A48A72B49417300D0C641 /* YHAboutUsViewController.swift */; }; 049A48A82B49417300D0C641 /* YHAboutUsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 049A48A72B49417300D0C641 /* YHAboutUsViewController.swift */; };
049A48AA2B49536000D0C641 /* YHAboutUsAdvantageCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 049A48A92B49536000D0C641 /* YHAboutUsAdvantageCell.swift */; }; 049A48AA2B49536000D0C641 /* YHAboutUsAdvantageCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 049A48A92B49536000D0C641 /* YHAboutUsAdvantageCell.swift */; };
04A671592B9F18C800C1FB91 /* YHCertificateUploadSheetView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04A671582B9F18C800C1FB91 /* YHCertificateUploadSheetView.swift */; }; 04A671592B9F18C800C1FB91 /* YHCertificateUploadSheetView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04A671582B9F18C800C1FB91 /* YHCertificateUploadSheetView.swift */; };
...@@ -588,6 +589,7 @@ ...@@ -588,6 +589,7 @@
048097702BA18D66000B9DCA /* YHCertificateSearchBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateSearchBar.swift; sourceTree = "<group>"; }; 048097702BA18D66000B9DCA /* YHCertificateSearchBar.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateSearchBar.swift; sourceTree = "<group>"; };
0493B3DB2BA7EFE600AF9393 /* YHCertificateSearchViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateSearchViewController.swift; sourceTree = "<group>"; }; 0493B3DB2BA7EFE600AF9393 /* YHCertificateSearchViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateSearchViewController.swift; sourceTree = "<group>"; };
0493B3DD2BA80C2300AF9393 /* YHCertificateFilterButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateFilterButton.swift; sourceTree = "<group>"; }; 0493B3DD2BA80C2300AF9393 /* YHCertificateFilterButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateFilterButton.swift; sourceTree = "<group>"; };
049537842BA9B28500AF7E59 /* YHCertificateTemplateCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateTemplateCell.swift; sourceTree = "<group>"; };
049A48A72B49417300D0C641 /* YHAboutUsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAboutUsViewController.swift; sourceTree = "<group>"; }; 049A48A72B49417300D0C641 /* YHAboutUsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAboutUsViewController.swift; sourceTree = "<group>"; };
049A48A92B49536000D0C641 /* YHAboutUsAdvantageCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAboutUsAdvantageCell.swift; sourceTree = "<group>"; }; 049A48A92B49536000D0C641 /* YHAboutUsAdvantageCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHAboutUsAdvantageCell.swift; sourceTree = "<group>"; };
04A671582B9F18C800C1FB91 /* YHCertificateUploadSheetView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHCertificateUploadSheetView.swift; sourceTree = "<group>"; }; 04A671582B9F18C800C1FB91 /* YHCertificateUploadSheetView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHCertificateUploadSheetView.swift; sourceTree = "<group>"; };
...@@ -1441,6 +1443,7 @@ ...@@ -1441,6 +1443,7 @@
04A6715D2B9FFCA700C1FB91 /* YHCertificateNameCell.swift */, 04A6715D2B9FFCA700C1FB91 /* YHCertificateNameCell.swift */,
0480976A2BA15269000B9DCA /* YHCertificateInfoCell.swift */, 0480976A2BA15269000B9DCA /* YHCertificateInfoCell.swift */,
044867B52BA1A03800DFAD4A /* YHCertificateFilterItemCell.swift */, 044867B52BA1A03800DFAD4A /* YHCertificateFilterItemCell.swift */,
049537842BA9B28500AF7E59 /* YHCertificateTemplateCell.swift */,
0477E17D2BA4362A00436346 /* YHCustomNavigationBar.swift */, 0477E17D2BA4362A00436346 /* YHCustomNavigationBar.swift */,
A592FE902BA6CC010062FACA /* YHCertificateEntryHeadView.swift */, A592FE902BA6CC010062FACA /* YHCertificateEntryHeadView.swift */,
A592FE922BA6CFFC0062FACA /* YHCertificateEntryBottomView.swift */, A592FE922BA6CFFC0062FACA /* YHCertificateEntryBottomView.swift */,
...@@ -2435,6 +2438,7 @@ ...@@ -2435,6 +2438,7 @@
045EEE912B9F171A0022A143 /* YHPreviewInfoCertificatePictureItemView.swift in Sources */, 045EEE912B9F171A0022A143 /* YHPreviewInfoCertificatePictureItemView.swift in Sources */,
044867B62BA1A03800DFAD4A /* YHCertificateFilterItemCell.swift in Sources */, 044867B62BA1A03800DFAD4A /* YHCertificateFilterItemCell.swift in Sources */,
045EEEE62B9F171A0022A143 /* YHMySignatureListViewController.swift in Sources */, 045EEEE62B9F171A0022A143 /* YHMySignatureListViewController.swift in Sources */,
049537852BA9B28500AF7E59 /* YHCertificateTemplateCell.swift in Sources */,
A5C5B3292B57CCBE00A7C5D1 /* YHDavidCell4.swift in Sources */, A5C5B3292B57CCBE00A7C5D1 /* YHDavidCell4.swift in Sources */,
045EEEE12B9F171A0022A143 /* YHMySignatureListViewModel.swift in Sources */, 045EEEE12B9F171A0022A143 /* YHMySignatureListViewModel.swift in Sources */,
04A7BD152BA4361700BD35A2 /* YHMyDocumentDetailModel.swift in Sources */, 04A7BD152BA4361700BD35A2 /* YHMyDocumentDetailModel.swift in Sources */,
......
...@@ -10,6 +10,7 @@ import UIKit ...@@ -10,6 +10,7 @@ import UIKit
import JXSegmentedView import JXSegmentedView
import UniformTypeIdentifiers import UniformTypeIdentifiers
import IQKeyboardManagerSwift import IQKeyboardManagerSwift
import SwifterSwift
class YHCertificateResourceUploadVC: YHBaseViewController { class YHCertificateResourceUploadVC: YHBaseViewController {
...@@ -43,7 +44,7 @@ class YHCertificateResourceUploadVC: YHBaseViewController { ...@@ -43,7 +44,7 @@ class YHCertificateResourceUploadVC: YHBaseViewController {
self.view.backgroundColor = .white self.view.backgroundColor = .white
self.gk_navigationBar.isHidden = true self.gk_navigationBar.isHidden = true
createUI() createUI()
requestList() requestList(status: status)
} }
func createUI() { func createUI() {
...@@ -111,17 +112,28 @@ extension YHCertificateResourceUploadVC: JXSegmentedListContainerViewListDelegat ...@@ -111,17 +112,28 @@ extension YHCertificateResourceUploadVC: JXSegmentedListContainerViewListDelegat
extension YHCertificateResourceUploadVC { extension YHCertificateResourceUploadVC {
func requestList() { func requestList(status: YHCertificateUploadStatus, extra:[String:Any] = [:]) {
let params = [ /*
"order_id" : orderId ?? 0, // 状态
"node": "1", "status_all": "",
"state": String(status.rawValue), // 类型
"category_id": categoryInfo.categoryId, "template_cate_id": "",
"status_all": "", // 搜索
"keywork": "", "keywork": "",
"template_cate_id": "", */
"supplement_ids": []] as [String: Any]
var params:[String:Any] = [
"order_id" : orderId ?? 0,
"node": "1",
"state": "1",
"category_id": categoryInfo.categoryId,
"supplement_ids": []]
if !extra.isEmpty {
params += extra
}
print(params)
// state: 3:待上传 2:已驳回 1:已通过 0:审核中 // state: 3:待上传 2:已驳回 1:已通过 0:审核中
viewModel.getCertificateList(params: params) { viewModel.getCertificateList(params: params) {
...@@ -131,9 +143,19 @@ extension YHCertificateResourceUploadVC { ...@@ -131,9 +143,19 @@ extension YHCertificateResourceUploadVC {
items.removeAll() items.removeAll()
if let listInfo = listInfo { if let listInfo = listInfo {
let arr = listInfo.supplementList let arr = listInfo.supplementList
items.append(contentsOf: arr) var results: [YHSupplementInfo] = []
self.tableView.reloadData() if status == .all {
results.append(contentsOf:arr)
} else {
for item in arr {
if item.checkStatus == status.rawValue {
results.append(item)
}
}
}
items.append(contentsOf: results)
} }
self.tableView.reloadData()
if let errorMsg = error?.errorMsg, errorMsg.count > 0 { if let errorMsg = error?.errorMsg, errorMsg.count > 0 {
YHHUD.flash(message: errorMsg, duration:3) YHHUD.flash(message: errorMsg, duration:3)
......
...@@ -10,8 +10,10 @@ import UIKit ...@@ -10,8 +10,10 @@ import UIKit
class YHCertificateSearchViewController: YHBaseViewController { class YHCertificateSearchViewController: YHBaseViewController {
var items:[String] = ["1", "2", "2", "2", "2", "2", "2", "2"] var items:[YHSupplementInfo] = []
var viewModel: YHCertificateViewModel = YHCertificateViewModel() var viewModel: YHCertificateViewModel = YHCertificateViewModel()
var orderId : Int?
var categoryInfo: YHCategoryData = YHCategoryData()
lazy var tableView: UITableView = { lazy var tableView: UITableView = {
...@@ -29,6 +31,7 @@ class YHCertificateSearchViewController: YHBaseViewController { ...@@ -29,6 +31,7 @@ class YHCertificateSearchViewController: YHBaseViewController {
tableView.backgroundColor = UIColor(hexString:"#F8F8F8") tableView.backgroundColor = UIColor(hexString:"#F8F8F8")
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell") tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell")
tableView.register(YHCertificateInfoCell.self, forCellReuseIdentifier: YHCertificateInfoCell.cellReuseIdentifier) tableView.register(YHCertificateInfoCell.self, forCellReuseIdentifier: YHCertificateInfoCell.cellReuseIdentifier)
tableView.backgroundView = emptyDataTipsView
return tableView return tableView
}() }()
...@@ -46,9 +49,43 @@ class YHCertificateSearchViewController: YHBaseViewController { ...@@ -46,9 +49,43 @@ class YHCertificateSearchViewController: YHBaseViewController {
lazy var searchBar: YHCertificateSearchBar = { lazy var searchBar: YHCertificateSearchBar = {
let bar = YHCertificateSearchBar(frame:CGRect(x: 0, y: 0, width:KScreenWidth-32, height:YHCertificateSearchBar.height)) let bar = YHCertificateSearchBar(frame:CGRect(x: 0, y: 0, width:KScreenWidth-32, height:YHCertificateSearchBar.height))
bar.searchBlock = {
[weak self] text in
guard let self = self else { return }
requestList(keyWord: text)
}
return bar return bar
}() }()
lazy var emptyDataTipsView:UIView = {
let view = UIView(frame: CGRect(x: 0, y: 0, width: KScreenWidth, height: 124))
view.isHidden = false
let imgView = UIImageView(image: UIImage(named: "service_center_no_data"))
imgView.contentMode = .scaleAspectFill
view.addSubview(imgView)
let label = UILabel()
label.textColor = UIColor.labelTextColor2
label.font = UIFont.PFSC_R(ofSize: 14)
label.textAlignment = .center
label.text = "没有找到相关资料哦~".local
view.addSubview(label)
imgView.snp.makeConstraints { make in
make.top.equalToSuperview().offset(130)
make.width.height.equalTo(92)
make.centerX.equalTo(view)
}
label.snp.makeConstraints { make in
make.top.equalTo(imgView.snp.bottom).offset(12)
make.centerX.equalTo(view)
}
return view
}()
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
self.view.backgroundColor = .white self.view.backgroundColor = .white
...@@ -76,7 +113,7 @@ extension YHCertificateSearchViewController: UITableViewDelegate, UITableViewDat ...@@ -76,7 +113,7 @@ extension YHCertificateSearchViewController: UITableViewDelegate, UITableViewDat
func numberOfSections(in tableView: UITableView) -> Int { func numberOfSections(in tableView: UITableView) -> Int {
return items.count return items.count
} }
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 1 return 1
} }
...@@ -84,7 +121,8 @@ extension YHCertificateSearchViewController: UITableViewDelegate, UITableViewDat ...@@ -84,7 +121,8 @@ extension YHCertificateSearchViewController: UITableViewDelegate, UITableViewDat
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let item = items[indexPath.section] let item = items[indexPath.section]
let cell = tableView.dequeueReusableCell(withIdentifier: YHCertificateInfoCell.cellReuseIdentifier, for: indexPath) let cell = tableView.dequeueReusableCell(withIdentifier: YHCertificateInfoCell.cellReuseIdentifier, for: indexPath) as! YHCertificateInfoCell
cell.updateModel(item)
return cell return cell
} }
...@@ -92,6 +130,12 @@ extension YHCertificateSearchViewController: UITableViewDelegate, UITableViewDat ...@@ -92,6 +130,12 @@ extension YHCertificateSearchViewController: UITableViewDelegate, UITableViewDat
return UITableView.automaticDimension return UITableView.automaticDimension
} }
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let vc = YHUploadContentVC()
self.navigationController?.pushViewController(vc)
}
private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat { private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat {
return 14.0 return 14.0
} }
...@@ -109,8 +153,47 @@ extension YHCertificateSearchViewController: UITableViewDelegate, UITableViewDat ...@@ -109,8 +153,47 @@ extension YHCertificateSearchViewController: UITableViewDelegate, UITableViewDat
return UIView() return UIView()
} }
}
extension YHCertificateSearchViewController {
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { func requestList(keyWord:String?) {
/*
// 状态
"status_all": "",
// 类型
"template_cate_id": "",
// 搜索
"keywork": "",
*/
let keywords = keyWord ?? ""
let params:[String:Any] = [
"node": "1",
"state": "1",
"supplement_ids": [],
"order_id" : orderId ?? 0,
"category_id": categoryInfo.categoryId,
"keywork": keywords]
print(params)
// state: 3:待上传 2:已驳回 1:已通过 0:审核中
viewModel.getCertificateList(params: params) {
[weak self] listInfo, error in
guard let self = self else { return }
items.removeAll()
if let listInfo = listInfo {
let arr = listInfo.supplementList
items.append(contentsOf: arr)
}
emptyDataTipsView.isHidden = items.count > 0
self.tableView.reloadData()
if let errorMsg = error?.errorMsg, errorMsg.count > 0 {
YHHUD.flash(message: errorMsg, duration:3)
}
}
} }
} }
...@@ -50,6 +50,8 @@ class YHMaterialListViewController: YHBaseViewController { ...@@ -50,6 +50,8 @@ class YHMaterialListViewController: YHBaseViewController {
[weak self] in [weak self] in
guard let self = self else { return } guard let self = self else { return }
let vc = YHCertificateSearchViewController() let vc = YHCertificateSearchViewController()
vc.orderId = orderId
vc.categoryInfo = categoryInfo
self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
} }
return bar return bar
...@@ -108,7 +110,14 @@ class YHMaterialListViewController: YHBaseViewController { ...@@ -108,7 +110,14 @@ class YHMaterialListViewController: YHBaseViewController {
lazy var filterSheetView: YHCertificateFilterView = { lazy var filterSheetView: YHCertificateFilterView = {
let view = YHCertificateFilterView.sheetView let view = YHCertificateFilterView.sheetView
// view. view.confirmBlock = {
[weak self] dict in
guard let self = self else { return }
self.segmentedView.selectItemAt(index: 0)
if let vc = itemVCs.first {
vc.requestList(status:vc.status, extra:dict)
}
}
return view return view
}() }()
......
...@@ -14,7 +14,7 @@ class YHUploadContentVC: YHBaseViewController { ...@@ -14,7 +14,7 @@ class YHUploadContentVC: YHBaseViewController {
var orderId : Int? var orderId : Int?
var viewModel: YHCertificateViewModel = YHCertificateViewModel() var viewModel: YHCertificateViewModel = YHCertificateViewModel()
var items:[YHContentUrl] = [] var items:[Int] = [1,2,3,4,5]
var renameInputView: YHFileRenameInputView = { var renameInputView: YHFileRenameInputView = {
let view = YHFileRenameInputView.inputView(defalutText:"请输入名称", editBlock: { let view = YHFileRenameInputView.inputView(defalutText:"请输入名称", editBlock: {
...@@ -41,74 +41,19 @@ class YHUploadContentVC: YHBaseViewController { ...@@ -41,74 +41,19 @@ class YHUploadContentVC: YHBaseViewController {
tableView.contentInsetAdjustmentBehavior = .never tableView.contentInsetAdjustmentBehavior = .never
} }
tableView.showsVerticalScrollIndicator = false tableView.showsVerticalScrollIndicator = false
tableView.estimatedSectionHeaderHeight = 1.0
tableView.estimatedSectionFooterHeight = 1.0
tableView.backgroundColor = .white tableView.backgroundColor = .white
tableView.separatorStyle = .none tableView.separatorStyle = .none
tableView.delegate = self tableView.delegate = self
tableView.dataSource = self tableView.dataSource = self
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell") tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell")
tableView.register(YHCertificateNameCell.self, forCellReuseIdentifier: YHCertificateNameCell.cellReuseIdentifier) tableView.register(YHCertificateNameCell.self, forCellReuseIdentifier: YHCertificateNameCell.cellReuseIdentifier)
let size = headView.systemLayoutSizeFitting(UIView.layoutFittingCompressedSize) tableView.register(YHCertificateTemplateCell.self, forCellReuseIdentifier: YHCertificateTemplateCell.cellReuseIdentifier)
let rect = CGRect(x: 0, y: 0, width: 0, height: size.height)
headView.frame = rect
tableView.tableHeaderView = headView
return tableView return tableView
}() }()
lazy var headView:UIView = {
let view = UIView()
view.addSubview(templateTitleLabel)
view.addSubview(tipsLabel)
view.addSubview(templateView)
templateTitleLabel.snp.makeConstraints { make in
make.left.equalToSuperview().offset(20)
make.right.equalToSuperview().offset(-20)
make.top.equalToSuperview().offset(16)
make.height.equalTo(24.0)
}
tipsLabel.snp.makeConstraints { make in
make.left.equalToSuperview().offset(20)
make.right.equalToSuperview().offset(-20)
make.top.equalTo(templateTitleLabel.snp.bottom).offset(5)
make.height.equalTo(44)
}
templateView.snp.makeConstraints { make in
make.left.equalToSuperview().offset(20)
make.right.equalToSuperview().offset(-20)
make.top.equalTo(tipsLabel.snp.bottom).offset(15)
make.height.equalTo(62.0)
make.bottom.equalToSuperview().offset(-34)
}
return view
}()
lazy var tipsLabel: UILabel = {
let label = UILabel()
label.textColor = UIColor.labelTextColor2
label.textAlignment = .left
label.font = UIFont.PFSC_R(ofSize:12)
label.numberOfLines = 0
label.text = "注意事项:这里是上传应该注意的事项这里是上传应该注意的事项这里是上传应该注意的事项。"
return label
}()
lazy var templateTitleLabel: UILabel = {
let label = UILabel()
label.textColor = UIColor.mainTextColor
label.textAlignment = .left
label.font = UIFont.PFSC_M(ofSize:17)
label.text = "身份证示例模版"
return label
}()
lazy var templateView: YHCertificateSampleTemplateView = {
let view = YHCertificateSampleTemplateView(frame:CGRectZero)
// let tap = UITapGestureRecognizer(target:self, action:#selector(action(_:)))
// view.addGestureRecognizer(tap)
return view
}()
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
...@@ -142,35 +87,58 @@ class YHUploadContentVC: YHBaseViewController { ...@@ -142,35 +87,58 @@ class YHUploadContentVC: YHBaseViewController {
extension YHUploadContentVC: UITableViewDelegate, UITableViewDataSource { extension YHUploadContentVC: UITableViewDelegate, UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return 2
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if section == 0 {
return 1
}
return items.count return items.count
} }
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let item = items[indexPath.row] if indexPath.section == 0 {
let cell = tableView.dequeueReusableCell(withIdentifier: YHCertificateTemplateCell.cellReuseIdentifier, for: indexPath) as! YHCertificateTemplateCell
return cell
}
let cell = tableView.dequeueReusableCell(withIdentifier: YHCertificateNameCell.cellReuseIdentifier, for: indexPath) as! YHCertificateNameCell let cell = tableView.dequeueReusableCell(withIdentifier: YHCertificateNameCell.cellReuseIdentifier, for: indexPath) as! YHCertificateNameCell
if 0 <= indexPath.row && indexPath.row < items.count {
let item = items[indexPath.row]
}
return cell return cell
} }
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if indexPath.section == 0 {
return UITableView.automaticDimension
}
return 55.0 return 55.0
} }
private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat { private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat {
return 24.0 if section == 0 {
return 1.0
}
return UITableView.automaticDimension
} }
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? { func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let view = UIView() let view = UIView()
if section == 0 {
let label = UILabel() return view
label.textColor = UIColor.mainTextColor }
label.textAlignment = .left
label.font = UIFont.PFSC_M(ofSize:17) let titlelabel = UILabel()
label.text = "身份证件" titlelabel.textColor = UIColor.mainTextColor
view.addSubview(label) titlelabel.textAlignment = .left
titlelabel.font = UIFont.PFSC_M(ofSize:17)
titlelabel.text = "身份证件"
view.addSubview(titlelabel)
let statusLabel = UILabel() let statusLabel = UILabel()
statusLabel.textColor = .warnColor statusLabel.textColor = .warnColor
...@@ -180,29 +148,49 @@ extension YHUploadContentVC: UITableViewDelegate, UITableViewDataSource { ...@@ -180,29 +148,49 @@ extension YHUploadContentVC: UITableViewDelegate, UITableViewDataSource {
statusLabel.text = "审核中" statusLabel.text = "审核中"
view.addSubview(statusLabel) view.addSubview(statusLabel)
label.snp.makeConstraints { make in let tipsLabel = UILabel()
tipsLabel.textColor = .warnColor
tipsLabel.font = UIFont.PFSC_R(ofSize:12)
tipsLabel.textAlignment = .left
tipsLabel.numberOfLines = 0
tipsLabel.text = "被驳回原因被驳回原因被驳回原因被驳回原因被驳回原因被驳回原因被驳回原因被驳回原因被驳回原因被驳回原因被驳回原因被驳回原因被驳回原因被驳回原因"
view.addSubview(tipsLabel)
titlelabel.snp.makeConstraints { make in
make.left.equalToSuperview().offset(20) make.left.equalToSuperview().offset(20)
make.height.equalTo(24.0) make.height.equalTo(24.0)
make.centerY.equalToSuperview() make.top.equalToSuperview()
} }
statusLabel.snp.makeConstraints { make in statusLabel.snp.makeConstraints { make in
make.centerY.equalToSuperview() make.centerY.equalTo(titlelabel)
make.left.equalTo(label.snp.right).offset(4) make.left.equalTo(titlelabel.snp.right).offset(4)
make.height.equalTo(16) make.height.equalTo(16)
make.width.equalTo(38) make.width.equalTo(38)
} }
tipsLabel.snp.makeConstraints { make in
make.left.equalToSuperview().offset(20)
make.right.equalToSuperview().offset(-20)
make.top.equalTo(titlelabel.snp.bottom).offset(3)
make.bottom.equalToSuperview().offset(-15)
}
return view return view
} }
private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat { private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat {
if section == 0 {
return 1.0
}
return 60.0 return 60.0
} }
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? { func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
let view = UIView() let view = UIView()
if section == 0 {
return view
}
let label = UILabel(frame: CGRect(x: 0, y: 20, width:KScreenWidth, height:20)) let label = UILabel(frame: CGRect(x: 0, y: 20, width:KScreenWidth, height:20))
label.textColor = UIColor.labelTextColor2 label.textColor = UIColor.labelTextColor2
...@@ -288,25 +276,25 @@ extension YHUploadContentVC { ...@@ -288,25 +276,25 @@ extension YHUploadContentVC {
"template_cate_id": "", "template_cate_id": "",
"supplement_ids": []] as [String: Any] "supplement_ids": []] as [String: Any]
// state: 3:待上传 2:已驳回 1:已通过 0:审核中 // state: 3:待上传 2:已驳回 1:已通过 0:审核中
viewModel.getCertificateList(params: params) { // viewModel.getCertificateList(params: params) {
//
[weak self] listInfo, error in // [weak self] listInfo, error in
guard let self = self else { return } // guard let self = self else { return }
//
items.removeAll() // items.removeAll()
if let listInfo = listInfo { // if let listInfo = listInfo {
let arr = listInfo.supplementList // let arr = listInfo.supplementList
if let info = arr.first { // if let info = arr.first {
let arr = info.contentUrl // let arr = info.contentUrl
items.append(contentsOf: arr) // items.append(contentsOf: arr)
} // }
self.tableView.reloadData() // self.tableView.reloadData()
} // }
//
if let errorMsg = error?.errorMsg, errorMsg.count > 0 { // if let errorMsg = error?.errorMsg, errorMsg.count > 0 {
YHHUD.flash(message: errorMsg, duration:3) // YHHUD.flash(message: errorMsg, duration:3)
} // }
} // }
} }
} }
...@@ -9,14 +9,16 @@ ...@@ -9,14 +9,16 @@
import UIKit import UIKit
enum YHCertificateFilterType: Int { enum YHCertificateFilterType: Int {
case certificate = 1 // 类型
case degree = 2 case certificate = 0
case employmentProof = 3 case degree = 1
case other = 4 case employmentProof = 2
case preUpload = 5 case other = 3
case rejected = 6 // 状态
case review = 7 case preUpload = 4
case pass = 8 case rejected = 5
case review = 6
case finish = 7
} }
...@@ -34,7 +36,21 @@ class YHCertificateFilterItem { ...@@ -34,7 +36,21 @@ class YHCertificateFilterItem {
var type: YHCertificateFilterType var type: YHCertificateFilterType
var title: String var title: String
var isSelected: Bool = false var isSelected: Bool = false
var tag:Int {
if type.rawValue < 4 {
return type.rawValue
}
if type == .preUpload {
return YHCertificateUploadStatus.preUpload.rawValue
} else if type == .rejected {
return YHCertificateUploadStatus.rejected.rawValue
} else if type == .review {
return YHCertificateUploadStatus.review.rawValue
} else if type == .finish {
return YHCertificateUploadStatus.finish.rawValue
}
return -1
}
init(type: YHCertificateFilterType, title: String) { init(type: YHCertificateFilterType, title: String) {
self.type = type self.type = type
self.title = title self.title = title
...@@ -49,6 +65,7 @@ class YHCertificateFilterView: UIView { ...@@ -49,6 +65,7 @@ class YHCertificateFilterView: UIView {
static let itemHeight = 36.0 static let itemHeight = 36.0
static let sheetView = YHCertificateFilterView(frame:UIScreen.main.bounds) static let sheetView = YHCertificateFilterView(frame:UIScreen.main.bounds)
var confirmBlock:(([String : Any])->())?
var items:[YHCertificateFilterSectionInfo] = [ var items:[YHCertificateFilterSectionInfo] = [
YHCertificateFilterSectionInfo(title: "类型".local, items: [YHCertificateFilterItem(type: .certificate, title: "证件"), YHCertificateFilterSectionInfo(title: "类型".local, items: [YHCertificateFilterItem(type: .certificate, title: "证件"),
...@@ -59,7 +76,7 @@ class YHCertificateFilterView: UIView { ...@@ -59,7 +76,7 @@ class YHCertificateFilterView: UIView {
YHCertificateFilterSectionInfo(title: "状态".local, items: [YHCertificateFilterItem(type: .preUpload, title: "待上传"), YHCertificateFilterSectionInfo(title: "状态".local, items: [YHCertificateFilterItem(type: .preUpload, title: "待上传"),
YHCertificateFilterItem(type: .rejected, title: "已驳回"), YHCertificateFilterItem(type: .rejected, title: "已驳回"),
YHCertificateFilterItem(type: .review, title: "审核中"), YHCertificateFilterItem(type: .review, title: "审核中"),
YHCertificateFilterItem(type: .pass, title: "已通过"), YHCertificateFilterItem(type: .finish, title: "已通过"),
])] ])]
lazy var collectionView: UICollectionView = { lazy var collectionView: UICollectionView = {
...@@ -253,6 +270,29 @@ extension YHCertificateFilterView { ...@@ -253,6 +270,29 @@ extension YHCertificateFilterView {
@objc func didClickConfirmBtn() { @objc func didClickConfirmBtn() {
var statusValues:[String] = []
var typeValues:[String] = []
for sectionInfo in items {
for item in sectionInfo.items {
if item.isSelected {
if sectionInfo.title == "类型".local {
typeValues.append("\(item.tag)")
} else if sectionInfo.title == "状态".local {
statusValues.append("\(item.tag)")
}
}
}
}
let statusStr = statusValues.joined(separator: ",")
let typeStr = typeValues.joined(separator: ",")
let dict:[String : Any] = [ "status_all": statusStr,
"template_cate_id": typeStr]
print(dict)
if let confirmBlock = confirmBlock {
confirmBlock(dict)
}
dismiss()
} }
@objc func didClickResetBtn() { @objc func didClickResetBtn() {
......
...@@ -14,7 +14,7 @@ class YHCertificateSearchBar: UIView { ...@@ -14,7 +14,7 @@ class YHCertificateSearchBar: UIView {
static let cancelBtnHeight = height-8.0 static let cancelBtnHeight = height-8.0
var textChange:((String?)->Void)? var textChange:((String?)->Void)?
var cancelBlock:(()->Void)? var searchBlock:((String?)->Void)?
var placeHolder:String? { var placeHolder:String? {
didSet { didSet {
if let placeholder = placeHolder { if let placeholder = placeHolder {
...@@ -42,14 +42,14 @@ class YHCertificateSearchBar: UIView { ...@@ -42,14 +42,14 @@ class YHCertificateSearchBar: UIView {
return textField return textField
}() }()
lazy var cancelBtn: UIButton = { lazy var searchBtn: UIButton = {
let btn = UIButton() let btn = UIButton()
btn.setTitle("取消".local, for: .normal) btn.setTitle("搜索".local, for: .normal)
btn.titleLabel?.font = UIFont.PFSC_M(ofSize: 12) btn.titleLabel?.font = UIFont.PFSC_M(ofSize: 12)
btn.setTitleColor(.white, for: .normal) btn.setTitleColor(.white, for: .normal)
btn.backgroundColor = UIColor(hexString: "#3D88F8") btn.backgroundColor = UIColor(hexString: "#3D88F8")
btn.layer.cornerRadius = Self.cancelBtnHeight/2.0 btn.layer.cornerRadius = Self.cancelBtnHeight/2.0
btn.addTarget(self, action: #selector(cancelBtnClicked), for: .touchUpInside) btn.addTarget(self, action: #selector(searchBtnClicked), for: .touchUpInside)
return btn return btn
}() }()
...@@ -67,9 +67,9 @@ class YHCertificateSearchBar: UIView { ...@@ -67,9 +67,9 @@ class YHCertificateSearchBar: UIView {
return view return view
} }
@objc func cancelBtnClicked() { @objc func searchBtnClicked() {
if let cancelBlock = cancelBlock { if let searchBlock = searchBlock {
cancelBlock() searchBlock(textField.text)
} }
} }
...@@ -78,7 +78,7 @@ class YHCertificateSearchBar: UIView { ...@@ -78,7 +78,7 @@ class YHCertificateSearchBar: UIView {
self.backgroundColor = .white self.backgroundColor = .white
contentView.addSubview(textField) contentView.addSubview(textField)
contentView.addSubview(cancelBtn) contentView.addSubview(searchBtn)
self.addSubview(contentView) self.addSubview(contentView)
contentView.snp.makeConstraints { make in contentView.snp.makeConstraints { make in
...@@ -87,11 +87,11 @@ class YHCertificateSearchBar: UIView { ...@@ -87,11 +87,11 @@ class YHCertificateSearchBar: UIView {
textField.snp.makeConstraints { make in textField.snp.makeConstraints { make in
make.left.equalToSuperview().offset(Self.height/2.0) make.left.equalToSuperview().offset(Self.height/2.0)
make.right.equalTo(cancelBtn.snp.left).offset(-4) make.right.equalTo(searchBtn.snp.left).offset(-4)
make.centerY.equalToSuperview() make.centerY.equalToSuperview()
} }
cancelBtn.snp.makeConstraints { make in searchBtn.snp.makeConstraints { make in
make.size.equalTo(CGSize(width: 66, height: Self.height-8.0)) make.size.equalTo(CGSize(width: 66, height: Self.height-8.0))
make.centerY.equalToSuperview() make.centerY.equalToSuperview()
make.right.equalToSuperview().offset(-4) make.right.equalToSuperview().offset(-4)
......
//
// YHCertificateTemplateCell.swift
// galaxy
//
// Created by edy on 2024/3/19.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHCertificateTemplateCell: UITableViewCell {
static let cellReuseIdentifier = "YHCertificateTemplateCell"
lazy var tipsLabel: UILabel = {
let label = UILabel()
label.textColor = UIColor.labelTextColor2
label.textAlignment = .left
label.font = UIFont.PFSC_R(ofSize:12)
label.numberOfLines = 0
label.text = "注意事项:这里是上传应该注意的事项这里是上传应该注意的事项这里是上传应该注意的事项。"
return label
}()
lazy var templateTitleLabel: UILabel = {
let label = UILabel()
label.textColor = UIColor.mainTextColor
label.textAlignment = .left
label.font = UIFont.PFSC_M(ofSize:17)
label.text = "身份证示例模版"
return label
}()
lazy var templateView: YHCertificateSampleTemplateView = {
let view = YHCertificateSampleTemplateView(frame:CGRectZero)
// let tap = UITapGestureRecognizer(target:self, action:#selector(action(_:)))
// view.addGestureRecognizer(tap)
return view
}()
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
createUI()
}
func createUI() {
contentView.addSubview(templateTitleLabel)
contentView.addSubview(tipsLabel)
contentView.addSubview(templateView)
templateTitleLabel.snp.makeConstraints { make in
make.left.equalToSuperview().offset(20)
make.right.equalToSuperview().offset(-20)
make.top.equalToSuperview().offset(16)
make.height.equalTo(24.0)
}
tipsLabel.snp.makeConstraints { make in
make.left.equalToSuperview().offset(20)
make.right.equalToSuperview().offset(-20)
make.top.equalTo(templateTitleLabel.snp.bottom).offset(5)
}
templateView.snp.makeConstraints { make in
make.left.equalToSuperview().offset(20)
make.right.equalToSuperview().offset(-20)
make.top.equalTo(tipsLabel.snp.bottom).offset(15)
make.height.equalTo(62.0)
make.bottom.equalToSuperview().offset(-34)
}
}
}
...@@ -328,7 +328,13 @@ extension YHEducationDetailVC : UITableViewDelegate, UITableViewDataSource { ...@@ -328,7 +328,13 @@ extension YHEducationDetailVC : UITableViewDelegate, UITableViewDataSource {
} else if detailItem.type == .educationTime || detailItem.type == .graduateTime { // 入学及毕业年月 } else if detailItem.type == .educationTime || detailItem.type == .graduateTime { // 入学及毕业年月
YHDatePickView.show(type: .yyyymm) { var title = ""
if detailItem.type == .educationTime {
title = "选择入学日期"
} else if detailItem.type == .graduateTime {
title = "选择毕业日期"
}
YHDatePickView.show(type: .yyyymm, title: title) {
[weak self] dateStr in [weak self] dateStr in
guard let self = self else { return } guard let self = self else { return }
......
...@@ -288,7 +288,7 @@ extension YHQualificationDetailVC : UITableViewDelegate, UITableViewDataSource { ...@@ -288,7 +288,7 @@ extension YHQualificationDetailVC : UITableViewDelegate, UITableViewDataSource {
} else if detailItem.type == .conferTime { // 授权年份 } else if detailItem.type == .conferTime { // 授权年份
YHDatePickView.show(type: .yyyy) { YHDatePickView.show(type: .yyyy, title:"选择授权年份".local) {
[weak self] dateStr in [weak self] dateStr in
guard let self = self else { return } guard let self = self else { return }
......
...@@ -331,13 +331,20 @@ extension YHCertificateInfoController : UITableViewDelegate, UITableViewDataSour ...@@ -331,13 +331,20 @@ extension YHCertificateInfoController : UITableViewDelegate, UITableViewDataSour
} }
if item is YHFormDetailItem { if item is YHFormDetailItem {
let detailItem = item as! YHFormDetailItem let detailItem = item as! YHFormDetailItem
let title = arr[0] as! YHFormTitleItem let titleItem = arr[0] as! YHFormTitleItem
if detailItem.type == .certificateValidDate || if detailItem.type == .certificateValidDate ||
detailItem.type == .certificateSignDate { // 届满日期 签发日期 detailItem.type == .certificateSignDate { // 届满日期 签发日期
var title = ""
if detailItem.type == .certificateValidDate {
title = "选择届满日期"
} else if detailItem.type == .certificateSignDate {
title = "选择签发日期"
}
self.view?.endEditing(true) self.view?.endEditing(true)
YHDatePickView.show(type: .yyyymmdd) { YHDatePickView.show(type: .yyyymmdd, title: title) {
[weak self] dateStr in [weak self] dateStr in
print(dateStr) print(dateStr)
...@@ -346,13 +353,13 @@ extension YHCertificateInfoController : UITableViewDelegate, UITableViewDataSour ...@@ -346,13 +353,13 @@ extension YHCertificateInfoController : UITableViewDelegate, UITableViewDataSour
guard let familyMember = self.familyMember else { return } guard let familyMember = self.familyMember else { return }
var certificate = familyMember.certificates.cnIdentityCard var certificate = familyMember.certificates.cnIdentityCard
if title.type == .chinaIdCardInfo { if titleItem.type == .chinaIdCardInfo {
certificate = familyMember.certificates.cnIdentityCard certificate = familyMember.certificates.cnIdentityCard
} else if title.type == .hkAndMacaoPassport { } else if titleItem.type == .hkAndMacaoPassport {
certificate = familyMember.certificates.hkMacaoPass certificate = familyMember.certificates.hkMacaoPass
} else if title.type == .passPortOrTravelInfo { } else if titleItem.type == .passPortOrTravelInfo {
certificate = familyMember.certificates.passport certificate = familyMember.certificates.passport
} }
......
...@@ -412,7 +412,7 @@ extension YHBrotherInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -412,7 +412,7 @@ extension YHBrotherInfoVC : UITableViewDelegate, UITableViewDataSource {
let detailItem = item as! YHFormDetailItem let detailItem = item as! YHFormDetailItem
if detailItem.type == .birthday { // 出生日期 if detailItem.type == .birthday { // 出生日期
YHDatePickView.show(type: .yyyymmdd) { [weak self] dateStr in YHDatePickView.show(type: .yyyymmdd, title:"出生日期".local) { [weak self] dateStr in
guard let self = self else { return } guard let self = self else { return }
if detailItem.type == .birthday { if detailItem.type == .birthday {
......
...@@ -456,7 +456,7 @@ extension YHParentInfoVC : UITableViewDelegate, UITableViewDataSource { ...@@ -456,7 +456,7 @@ extension YHParentInfoVC : UITableViewDelegate, UITableViewDataSource {
let detailItem = item as! YHFormDetailItem let detailItem = item as! YHFormDetailItem
if detailItem.type == .birthday { // 出生日期 if detailItem.type == .birthday { // 出生日期
YHDatePickView.show(type: .yyyymmdd) { [weak self] dateStr in YHDatePickView.show(type: .yyyymmdd, title:"出生日期".local) { [weak self] dateStr in
guard let self = self else { return } guard let self = self else { return }
if detailItem.type == .birthday { if detailItem.type == .birthday {
......
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