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
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
// 已完成
......
......@@ -235,7 +235,8 @@ extension YHCertificateInfoController : UITableViewDelegate, UITableViewDataSour
[weak self] isLongTime in
guard let self = self else { return }
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()
save()
}
......
......@@ -1070,7 +1070,14 @@ class YHCNIdentityCard: SmartCodable {
var number: String = ""
var issueAt: 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 imgBack: String = ""
var passPortType: Int = 0
......
......@@ -15,7 +15,7 @@ class YHFormItemExpireDateCell: UITableViewCell {
private let horizonalGap = 18.0
private let detailColor = UIColor.mainTextColor
private let placeHolderColor = UIColor.placeHolderColor
let longTimeBtnWidth = 40.0
let longTimeBtnWidth = 44.0
// 是否必填 如必填title会展示红色*
var isMust = false
var placeHolder:String? = "请选择"
......@@ -91,6 +91,12 @@ class YHFormItemExpireDateCell: UITableViewCell {
btn.iconInLeft(spacing: 6)
btn.setImage(UIImage(named: "form_square_unselect"), for: .normal)
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)
return btn
}()
......@@ -130,6 +136,7 @@ class YHFormItemExpireDateCell: UITableViewCell {
contentView.addSubview(titleLabel)
contentView.addSubview(detailLabel)
contentView.addSubview(longTimeBtn)
contentView.addSubview(longAreaBtn)
contentView.addSubview(tipsLabel)
contentView.addSubview(topLine)
......@@ -151,6 +158,11 @@ class YHFormItemExpireDateCell: UITableViewCell {
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
make.left.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