Commit 62d6ef60 authored by Steven杜宇's avatar Steven杜宇

// 原则批

parent 50149abb
......@@ -15,6 +15,8 @@ class YHPrincipleUploadListVC: YHBaseViewController {
var orderId: Int = 0
var items: [SmartCodable] = []
var isNeedShowError:Bool = false
let viewModel = YHPrincleViewModel()
lazy var tableView: UITableView = {
......@@ -173,8 +175,30 @@ class YHPrincipleUploadListVC: YHBaseViewController {
extension YHPrincipleUploadListVC {
func checkMustItems() -> Bool {
// 赴港居留同意书
let agreementModel = self.viewModel.uploadDetailModel.file_data.agreement
// 申请人意见访问
let opinionModel = self.viewModel.uploadDetailModel.file_data.opinion
if agreementModel.content_url.count <= 0 || opinionModel.content_url.count <= 0 {
return false
}
return true
}
@objc func didUploadBtnClicked() {
let isMustHave = self.checkMustItems()
if !isMustHave {
YHHUD.flash(message: "请上传必要文件")
isNeedShowError = true
self.tableView.reloadData()
return
}
isNeedShowError = false
var files:[YHPrincipleRequestModel] = []
// 赴港居留同意书
......@@ -210,7 +234,7 @@ extension YHPrincipleUploadListVC {
self.requestData()
return
}
var errMsg = error?.errorMsg ?? "上传失败"
let errMsg = error?.errorMsg ?? "上传失败"
YHHUD.flash(message: errMsg)
}
}
......@@ -321,6 +345,7 @@ extension YHPrincipleUploadListVC: UITableViewDelegate, UITableViewDataSource {
// 上传文件 cell
let cell = tableView.dequeueReusableCell(withIdentifier: YHPrincipleUploadStatusCell.cellReuseIdentifier, for: indexPath) as! YHPrincipleUploadStatusCell
let model = m as! YHPrincipleAgreementModel
model.isShowRedTips = isNeedShowError
cell.updateModel(model)
cell.expandClick = {
[weak self] isUnfold in
......
......@@ -200,7 +200,7 @@ class YHPrincipleAgreementModel: SmartCodable {
// 黑色或富文本
var tips1: String = ""
// 最底部红色提示语
var redTips: String = ""
var isShowRedTips: Bool = false
// 是否展开
var isUnfold: Bool = false
......
......@@ -127,7 +127,6 @@ class YHPrincipleUploadStatusCell: UITableViewCell {
label.numberOfLines = 0
label.font = UIFont.PFSC_R(ofSize: 12)
label.textColor = UIColor.failColor
label.text = "请上传《赴港居留同意书》"
return label
}()
......@@ -221,7 +220,8 @@ class YHPrincipleUploadStatusCell: UITableViewCell {
}
// 底部红色提示
redTipsLabel.text = self.getTips(type: model.customType)
redTipsLabel.text = self.getCheckTips(type: model.customType)
redTipsLabel.isHidden = !model.isShowRedTips
whiteView.snp.remakeConstraints { make in
make.top.equalTo(0)
......@@ -297,8 +297,8 @@ class YHPrincipleUploadStatusCell: UITableViewCell {
redTipsLabel.snp.remakeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-16)
make.top.equalTo(uploadBtn.snp.bottom).offset(model.redTips.isEmpty ? 0 : 16)
if model.redTips.isEmpty {
make.top.equalTo(uploadBtn.snp.bottom).offset(!model.isShowRedTips ? 0 : 16)
if !model.isShowRedTips {
make.height.equalTo(0)
}
make.bottom.equalTo(-16)
......
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