Commit 258fa7c7 authored by David黄金龙's avatar David黄金龙

Merge branch 'develop' of http://gitlab.galaxy-immi.com/mobile-group/galaxy-iOS into develop

* 'develop' of http://gitlab.galaxy-immi.com/mobile-group/galaxy-iOS:
  // 扩大长期按钮点击范围
  // 我的证件
parents 2f42bcdc de7f5437
...@@ -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)
...@@ -95,8 +116,13 @@ class YHMaterialListViewController: YHBaseViewController { ...@@ -95,8 +116,13 @@ class YHMaterialListViewController: YHBaseViewController {
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,23 +43,32 @@ class YHCertificateInfoCell: UITableViewCell { ...@@ -43,23 +43,32 @@ class YHCertificateInfoCell: UITableViewCell {
setupUI() setupUI()
} }
func update() { func updateModel(_ model: YHSupplementInfo) {
if let status = YHCertificateUploadStatus(rawValue: model.checkStatus) {
var titleColor: UIColor = .labelTextColor2 var titleColor: UIColor = .labelTextColor2
var title = ""
switch status { switch status {
case .preUpload: case .preUpload:
titleColor = .brandMainColor titleColor = .brandMainColor
title = "待上传".local
case .rejected: case .rejected:
titleColor = .failColor titleColor = .failColor
case .review, .finish: title = "已驳回".local
case .review:
titleColor = .labelTextColor2
title = "审核中".local
case .finish:
titleColor = .labelTextColor2 titleColor = .labelTextColor2
case .unknown: title = "已通过".local
case .all:
titleColor = .labelTextColor2 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 {
nameTextView.attributed.text = """ nameTextView.attributed.text = """
...@@ -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
// 已完成 // 已完成
......
...@@ -235,7 +235,8 @@ extension YHCertificateInfoController : UITableViewDelegate, UITableViewDataSour ...@@ -235,7 +235,8 @@ extension YHCertificateInfoController : UITableViewDelegate, UITableViewDataSour
[weak self] isLongTime in [weak self] isLongTime in
guard let self = self else { return } guard let self = self else { return }
if title.type == .chinaIdCardInfo { if title.type == .chinaIdCardInfo {
self.familyMember?.certificates.cnIdentityCard.issueDateEndAt = (isLongTime ? YHCNIdentityCard.longTime : "") guard let familyMember = familyMember else { return }
familyMember.certificates.cnIdentityCard.issueDateEndAt = (isLongTime ? YHCNIdentityCard.longTime : familyMember.certificates.cnIdentityCard.lastIssueDateEndAt)
loadInfo() loadInfo()
save() save()
} }
......
...@@ -1070,7 +1070,14 @@ class YHCNIdentityCard: SmartCodable { ...@@ -1070,7 +1070,14 @@ class YHCNIdentityCard: SmartCodable {
var number: String = "" var number: String = ""
var issueAt: String = "" var issueAt: String = ""
var issueDateStartAt: String = "" var issueDateStartAt: String = ""
var issueDateEndAt: String = "" var issueDateEndAt: String = "" {
didSet {
if !issueDateEndAt.isEmpty && issueDateEndAt != Self.longTime {
lastIssueDateEndAt = issueDateEndAt
}
}
}
var lastIssueDateEndAt: String = ""
var imgFront: String = "" var imgFront: String = ""
var imgBack: String = "" var imgBack: String = ""
var passPortType: Int = 0 var passPortType: Int = 0
......
...@@ -15,7 +15,7 @@ class YHFormItemExpireDateCell: UITableViewCell { ...@@ -15,7 +15,7 @@ class YHFormItemExpireDateCell: UITableViewCell {
private let horizonalGap = 18.0 private let horizonalGap = 18.0
private let detailColor = UIColor.mainTextColor private let detailColor = UIColor.mainTextColor
private let placeHolderColor = UIColor.placeHolderColor private let placeHolderColor = UIColor.placeHolderColor
let longTimeBtnWidth = 40.0 let longTimeBtnWidth = 44.0
// 是否必填 如必填title会展示红色* // 是否必填 如必填title会展示红色*
var isMust = false var isMust = false
var placeHolder:String? = "请选择" var placeHolder:String? = "请选择"
...@@ -91,6 +91,12 @@ class YHFormItemExpireDateCell: UITableViewCell { ...@@ -91,6 +91,12 @@ class YHFormItemExpireDateCell: UITableViewCell {
btn.iconInLeft(spacing: 6) btn.iconInLeft(spacing: 6)
btn.setImage(UIImage(named: "form_square_unselect"), for: .normal) btn.setImage(UIImage(named: "form_square_unselect"), for: .normal)
btn.setImage(UIImage(named: "form_square_select"), for: .selected) btn.setImage(UIImage(named: "form_square_select"), for: .selected)
return btn
}()
// 增大点击区域
lazy var longAreaBtn: UIButton = {
let btn = UIButton()
btn.addTarget(self, action: #selector(didClickLongTimeBtn), for: .touchUpInside) btn.addTarget(self, action: #selector(didClickLongTimeBtn), for: .touchUpInside)
return btn return btn
}() }()
...@@ -130,6 +136,7 @@ class YHFormItemExpireDateCell: UITableViewCell { ...@@ -130,6 +136,7 @@ class YHFormItemExpireDateCell: UITableViewCell {
contentView.addSubview(titleLabel) contentView.addSubview(titleLabel)
contentView.addSubview(detailLabel) contentView.addSubview(detailLabel)
contentView.addSubview(longTimeBtn) contentView.addSubview(longTimeBtn)
contentView.addSubview(longAreaBtn)
contentView.addSubview(tipsLabel) contentView.addSubview(tipsLabel)
contentView.addSubview(topLine) contentView.addSubview(topLine)
...@@ -151,6 +158,11 @@ class YHFormItemExpireDateCell: UITableViewCell { ...@@ -151,6 +158,11 @@ class YHFormItemExpireDateCell: UITableViewCell {
make.centerY.equalTo(titleLabel) make.centerY.equalTo(titleLabel)
} }
longAreaBtn.snp.makeConstraints { make in
make.center.equalTo(longTimeBtn.snp.center)
make.size.equalTo(CGSizeMake(longTimeBtnWidth+20, 40))
}
topLine.snp.makeConstraints { make in topLine.snp.makeConstraints { make in
make.left.equalToSuperview().offset(horizonalGap) make.left.equalToSuperview().offset(horizonalGap)
make.right.equalToSuperview().offset(-horizonalGap) make.right.equalToSuperview().offset(-horizonalGap)
......
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