Commit 2c18f7ce authored by David黄金龙's avatar David黄金龙

上传过关证件

parent 1be88d79
...@@ -9,8 +9,6 @@ ...@@ -9,8 +9,6 @@
import UIKit import UIKit
class YHUploadCertificateVC: YHBaseViewController { class YHUploadCertificateVC: YHBaseViewController {
var items: [String] = ["1", "1"]
lazy var viewModel: YHUploadCertificateViewModel = { lazy var viewModel: YHUploadCertificateViewModel = {
let vm = YHUploadCertificateViewModel() let vm = YHUploadCertificateViewModel()
...@@ -71,7 +69,7 @@ class YHUploadCertificateVC: YHBaseViewController { ...@@ -71,7 +69,7 @@ class YHUploadCertificateVC: YHBaseViewController {
setupUI() setupUI()
orderId = 150661 //for test hjl // orderId = 150661 //for test hjl
loadData() loadData()
} }
} }
...@@ -149,48 +147,43 @@ extension YHUploadCertificateVC: UITableViewDelegate, UITableViewDataSource { ...@@ -149,48 +147,43 @@ extension YHUploadCertificateVC: UITableViewDelegate, UITableViewDataSource {
} }
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if 0 <= indexPath.section && indexPath.section < items.count { if indexPath.row == 0 {
if indexPath.row == 0 { let warningCell = tableView.dequeueReusableCell(withIdentifier: YHUploadCertificateTitleCell.cellReuseIdentifier, for: indexPath) as! YHUploadCertificateTitleCell
let warningCell = tableView.dequeueReusableCell(withIdentifier: YHUploadCertificateTitleCell.cellReuseIdentifier, for: indexPath) as! YHUploadCertificateTitleCell
var title = ""
var title = "" if indexPath.section == 0 {
if indexPath.section == 0 { title = "小白条"
title = "小白条"
} else {
title = "香港身份证"
}
warningCell.updateTitle(title)
return warningCell
} else { } else {
let approveCell = tableView.dequeueReusableCell(withIdentifier: YHUploadCertificateDetailCell.cellReuseIdentifier, for: indexPath) as! YHUploadCertificateDetailCell title = "香港身份证"
}
if let model = viewModel.uploadCertificateDataListModel { warningCell.updateTitle(title)
if indexPath.section == 0 { return warningCell
let tmp = model.small_whites[indexPath.row - 1] } else {
approveCell.dataModel = tmp let approveCell = tableView.dequeueReusableCell(withIdentifier: YHUploadCertificateDetailCell.cellReuseIdentifier, for: indexPath) as! YHUploadCertificateDetailCell
if indexPath.row == model.small_whites.count { if let model = viewModel.uploadCertificateDataListModel {
approveCell.isLastCell = true if indexPath.section == 0 {
} else { let tmp = model.small_whites[indexPath.row - 1]
approveCell.isLastCell = false approveCell.dataModel = tmp
}
} else if indexPath.section == 1 { if indexPath.row == model.small_whites.count {
let tmp = model.id_cards[indexPath.row - 1] approveCell.isLastCell = true
approveCell.dataModel = tmp } else {
approveCell.isLastCell = false
if indexPath.row == model.id_cards.count { }
approveCell.isLastCell = true } else if indexPath.section == 1 {
} else { let tmp = model.id_cards[indexPath.row - 1]
approveCell.isLastCell = false approveCell.dataModel = tmp
}
if indexPath.row == model.id_cards.count {
approveCell.isLastCell = true
} else {
approveCell.isLastCell = false
} }
} }
return approveCell
} }
return approveCell
} }
let approveCell = tableView.dequeueReusableCell(withIdentifier: "cell", for: indexPath)
return approveCell
} }
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
...@@ -201,14 +194,22 @@ extension YHUploadCertificateVC: UITableViewDelegate, UITableViewDataSource { ...@@ -201,14 +194,22 @@ extension YHUploadCertificateVC: UITableViewDelegate, UITableViewDataSource {
} }
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let vc = YHUploadCertificateDetailVC()
//
if 0 <= indexPath.section && indexPath.section < items.count { if let model = viewModel.uploadCertificateDataListModel {
var tmp : YHUploadCertificateModel?
if indexPath.section == 0 {
let vc = YHUploadCertificateDetailVC() tmp = model.small_whites[indexPath.row - 1]
vc.detailType = .SmallWhiteNote vc.detailType = .SmallWhiteNote
self.navigationController?.pushViewController(vc) } else if indexPath.section == 1 {
tmp = model.id_cards[indexPath.row - 1]
vc.detailType = .HongKongCard
}
if let tmp = tmp {
vc.dataModel = tmp
self.navigationController?.pushViewController(vc)
}
} }
} }
......
...@@ -99,5 +99,9 @@ extension YHUploadCertificateDateItem { ...@@ -99,5 +99,9 @@ extension YHUploadCertificateDateItem {
cardLabel.attributed.text = b cardLabel.attributed.text = b
} }
} }
func updateDate(date : String) {
dateTextField.text = date
}
} }
...@@ -130,9 +130,7 @@ private extension YHVisaPaymentVC { ...@@ -130,9 +130,7 @@ private extension YHVisaPaymentVC {
self.orderID = (id as? Int) ?? 0 self.orderID = (id as? Int) ?? 0
} }
} }
// orderID = 133874//for test hjl
view.addSubview(tableView) view.addSubview(tableView)
view.addSubview(bottomView) view.addSubview(bottomView)
bottomView.snp.makeConstraints { make in bottomView.snp.makeConstraints { make in
...@@ -155,6 +153,7 @@ private extension YHVisaPaymentVC { ...@@ -155,6 +153,7 @@ private extension YHVisaPaymentVC {
if self.viewModel.isAllMemberPay() { if self.viewModel.isAllMemberPay() {
//跳转 //跳转
let vc = YHUploadCertificateVC() let vc = YHUploadCertificateVC()
vc.orderId = orderID
self.navigationController?.push(vc, removeClass: YHVisaPaymentVC.self) self.navigationController?.push(vc, removeClass: YHVisaPaymentVC.self)
} else { } else {
postPaymentResult() postPaymentResult()
......
...@@ -39,6 +39,7 @@ private extension YHFileListBottomView { ...@@ -39,6 +39,7 @@ private extension YHFileListBottomView {
button.layer.cornerRadius = kCornerRadius3 button.layer.cornerRadius = kCornerRadius3
button.clipsToBounds = true button.clipsToBounds = true
button.addTarget(self, action: #selector(submit), for: .touchUpInside) button.addTarget(self, action: #selector(submit), for: .touchUpInside)
button.backgroundColor = UIColor.brandMainColor
return button return button
}() }()
addSubview(nextButton) addSubview(nextButton)
...@@ -49,14 +50,16 @@ private extension YHFileListBottomView { ...@@ -49,14 +50,16 @@ private extension YHFileListBottomView {
make.left.equalTo(kMargin) make.left.equalTo(kMargin)
} }
nextButton.layoutIfNeeded()
nextButton.addYinHeGradualLayer()
} }
@objc func save() {
block?(0)
}
@objc func submit() { @objc func submit() {
block?(1) block?(1)
} }
} }
extension YHFileListBottomView {
func updateBtnTitle(title : String) {
nextButton.setTitle(title, for: .normal)
}
}
...@@ -142,16 +142,6 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget { ...@@ -142,16 +142,6 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget {
vc.myDefaultNavItemIndex = 2 vc.myDefaultNavItemIndex = 2
self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
print("最近浏览") print("最近浏览")
// let view = YHRangeDatePickerSheetView.sheetView()
// view.block = { (startDate,endDate) in
// print("选择的日期是:")
// print(startDate)
// print(endDate)
// }
// view.show() //for test hjl
} }
return view return view
}() }()
......
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