Commit 3ea7080e authored by Steven杜宇's avatar Steven杜宇

// 旅行

parent 079cd346
...@@ -252,7 +252,12 @@ class YHTravelDocsPreparationDetailVC: YHBaseViewController { ...@@ -252,7 +252,12 @@ class YHTravelDocsPreparationDetailVC: YHBaseViewController {
if !item.cerDetailModel.isValidCer() { if !item.cerDetailModel.isValidCer() {
hasError = true hasError = true
item.cerDetailModel.isNeedCheckCer = true item.cerDetailModel.isNeedCheckCer = true
item.cerDetailModel.checkTips = "有效期不足,请核查文件" if item.cerDetailModel.type == 2, item.cerDetailModel.china_travel_latest_validate_date.isEmpty {
// 这个情况直接弹toast
} else {
item.cerDetailModel.checkTips = "有效期不足,请核查文件"
}
} }
} }
} }
...@@ -380,10 +385,14 @@ extension YHTravelDocsPreparationDetailVC: UITableViewDelegate, UITableViewDataS ...@@ -380,10 +385,14 @@ extension YHTravelDocsPreparationDetailVC: UITableViewDelegate, UITableViewDataS
let item = sectionItems[indexPath.section] let item = sectionItems[indexPath.section]
cell.updateModel(item.cerDetailModel) cell.updateModel(item.cerDetailModel)
cell.updateBlock = { cell.updateBlock = {
[weak self] in [weak self] needCheck in
guard let self = self else { return } guard let self = self else { return }
if !self.isDisableEdit { if !self.isDisableEdit {
self.checkInfo() _ = self.checkInfo()
} else {
if needCheck {
_ = self.checkInfo()
}
} }
self.tableView.reloadData() self.tableView.reloadData()
} }
......
...@@ -43,7 +43,7 @@ class YHTravelCertificateUploadCell: UITableViewCell { ...@@ -43,7 +43,7 @@ class YHTravelCertificateUploadCell: UITableViewCell {
var dataModel: YHTravelDocsPreparationDetailItemModel = YHTravelDocsPreparationDetailItemModel() var dataModel: YHTravelDocsPreparationDetailItemModel = YHTravelDocsPreparationDetailItemModel()
let viewModel: YHBaseViewModel = YHBaseViewModel() let viewModel: YHBaseViewModel = YHBaseViewModel()
var updateBlock: (()->())? var updateBlock: ((_ needCheck:Bool)->())?
// type :Int 证件类型 1-护照 2-中国旅行证 3-港澳通行证 4-存款证明 5-其他 // type :Int 证件类型 1-护照 2-中国旅行证 3-港澳通行证 4-存款证明 5-其他
var templateClick: ((_ type:Int)->())? var templateClick: ((_ type:Int)->())?
...@@ -102,6 +102,18 @@ class YHTravelCertificateUploadCell: UITableViewCell { ...@@ -102,6 +102,18 @@ class YHTravelCertificateUploadCell: UITableViewCell {
return label return label
}() }()
lazy var warmTipsLabel: UILabel = {
let label = UILabel()
label.numberOfLines = 0
label.font = UIFont.PFSC_R(ofSize: 12)
label.textColor = UIColor.failColor
let a: ASAttributedString = .init("温馨提示:", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor.mainTextColor50))
let b: ASAttributedString = .init("具体根据当地出入境规定办理并提交相关证件,如有疑问,可联系银河客服经理咨询", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor.brandMainColor))
label.attributed.text = a+b
return label
}()
lazy var certificateFrontView: YHCardUploadView = { lazy var certificateFrontView: YHCardUploadView = {
let view = YHCardUploadView(frame: .zero) let view = YHCardUploadView(frame: .zero)
view.remakeUploadViewConstraints() view.remakeUploadViewConstraints()
...@@ -117,7 +129,7 @@ class YHTravelCertificateUploadCell: UITableViewCell { ...@@ -117,7 +129,7 @@ class YHTravelCertificateUploadCell: UITableViewCell {
} else { } else {
self.dataModel.img_front = url self.dataModel.img_front = url
self.dataModel.img_back = url self.dataModel.img_back = url
self.updateBlock?() self.updateBlock?(false)
} }
} }
view.deleteBlock = { view.deleteBlock = {
...@@ -134,7 +146,7 @@ class YHTravelCertificateUploadCell: UITableViewCell { ...@@ -134,7 +146,7 @@ class YHTravelCertificateUploadCell: UITableViewCell {
self.dataModel.img_back = "" self.dataModel.img_back = ""
} }
self.dataModel.status = 0 self.dataModel.status = 0
self.updateBlock?() self.updateBlock?(false)
} }
return view return view
}() }()
...@@ -155,7 +167,7 @@ class YHTravelCertificateUploadCell: UITableViewCell { ...@@ -155,7 +167,7 @@ class YHTravelCertificateUploadCell: UITableViewCell {
} else { } else {
self.dataModel.img_front = url self.dataModel.img_front = url
self.dataModel.img_back = url self.dataModel.img_back = url
self.updateBlock?() self.updateBlock?(false)
} }
} }
view.deleteBlock = { view.deleteBlock = {
...@@ -174,7 +186,7 @@ class YHTravelCertificateUploadCell: UITableViewCell { ...@@ -174,7 +186,7 @@ class YHTravelCertificateUploadCell: UITableViewCell {
self.dataModel.img_back = "" self.dataModel.img_back = ""
} }
self.dataModel.status = 0 self.dataModel.status = 0
self.updateBlock?() self.updateBlock?(false)
} }
return view return view
}() }()
...@@ -219,7 +231,7 @@ class YHTravelCertificateUploadCell: UITableViewCell { ...@@ -219,7 +231,7 @@ class YHTravelCertificateUploadCell: UITableViewCell {
} else if item.id == .deadDate { } else if item.id == .deadDate {
self.dataModel.issue_end = time self.dataModel.issue_end = time
} }
self.updateBlock?() self.updateBlock?(false)
} }
} else if item.id == .kind { } else if item.id == .kind {
...@@ -308,10 +320,27 @@ class YHTravelCertificateUploadCell: UITableViewCell { ...@@ -308,10 +320,27 @@ class YHTravelCertificateUploadCell: UITableViewCell {
model.isNeedShowRejectReason = (model.status == 2) model.isNeedShowRejectReason = (model.status == 2)
let isShowReason = (model.isNeedShowRejectReason && !model.remark.isEmpty) let isShowReason = (model.isNeedShowRejectReason && !model.remark.isEmpty)
rejectReasonLabel.text = isShowReason ? "被驳回原因:" + model.remark : "" rejectReasonLabel.text = isShowReason ? "被驳回原因:" + model.remark : ""
// 只有中国居留许可签证才显示温馨提示
let isShowWarmTips = (model.type == 2)
warmTipsLabel.isHidden = !isShowWarmTips
warmTipsLabel.snp.remakeConstraints { make in
make.left.equalTo(18)
make.right.equalTo(-18)
make.top.equalTo(lineView.snp.bottom).offset(isShowWarmTips ? 18.0 : 0)
if !isShowWarmTips {
make.height.equalTo(0)
}
}
var rejectTop = 18.0
if isShowReason {
rejectTop = 8.0
}
rejectReasonLabel.snp.remakeConstraints { make in rejectReasonLabel.snp.remakeConstraints { make in
make.left.equalTo(18) make.left.equalTo(18)
make.right.equalTo(-18) make.right.equalTo(-18)
make.top.equalTo(lineView.snp.bottom).offset(isShowReason ? 18 : 0) make.top.equalTo(warmTipsLabel.snp.bottom).offset(isShowReason ? rejectTop : 0)
make.bottom.equalTo(certificateFrontView.snp.top).offset(-18) make.bottom.equalTo(certificateFrontView.snp.top).offset(-18)
if !isShowReason { if !isShowReason {
make.height.equalTo(0) make.height.equalTo(0)
...@@ -385,6 +414,7 @@ class YHTravelCertificateUploadCell: UITableViewCell { ...@@ -385,6 +414,7 @@ class YHTravelCertificateUploadCell: UITableViewCell {
whiteConentView.addSubview(rejectReasonLabel) whiteConentView.addSubview(rejectReasonLabel)
whiteConentView.addSubview(certificateFrontView) whiteConentView.addSubview(certificateFrontView)
whiteConentView.addSubview(certificateBackView) whiteConentView.addSubview(certificateBackView)
whiteConentView.addSubview(warmTipsLabel)
whiteConentView.addSubview(unvalidLabel) whiteConentView.addSubview(unvalidLabel)
whiteConentView.addSubview(selectPanelContentView) whiteConentView.addSubview(selectPanelContentView)
...@@ -408,6 +438,13 @@ class YHTravelCertificateUploadCell: UITableViewCell { ...@@ -408,6 +438,13 @@ class YHTravelCertificateUploadCell: UITableViewCell {
make.height.equalTo(0.5) make.height.equalTo(0.5)
} }
warmTipsLabel.snp.makeConstraints { make in
make.left.equalTo(18)
make.right.equalTo(-18)
make.top.equalTo(lineView.snp.bottom).offset(18)
make.height.equalTo(0)
}
rejectReasonLabel.snp.makeConstraints { make in rejectReasonLabel.snp.makeConstraints { make in
make.left.equalTo(18) make.left.equalTo(18)
make.right.equalTo(-18) make.right.equalTo(-18)
...@@ -468,9 +505,9 @@ extension YHTravelCertificateUploadCell { ...@@ -468,9 +505,9 @@ extension YHTravelCertificateUploadCell {
if success, let result = result { if success, let result = result {
self.dataModel.issue_start = result.term_begins self.dataModel.issue_start = result.term_begins
self.dataModel.issue_end = result.end_of_term self.dataModel.issue_end = result.end_of_term
self.updateBlock?() self.updateBlock?(true)
} else { } else {
self.updateBlock?() self.updateBlock?(true)
} }
} }
...@@ -481,9 +518,9 @@ extension YHTravelCertificateUploadCell { ...@@ -481,9 +518,9 @@ extension YHTravelCertificateUploadCell {
if success, let result = result { if success, let result = result {
self.dataModel.issue_start = result.term_begins self.dataModel.issue_start = result.term_begins
self.dataModel.issue_end = result.end_of_term self.dataModel.issue_end = result.end_of_term
self.updateBlock?() self.updateBlock?(true)
} else { } else {
self.updateBlock?() self.updateBlock?(true)
} }
} }
} }
......
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