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

上传过关证件

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