Commit b8fdc8bd 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 bd7f47bc e89847cf
......@@ -54,6 +54,7 @@ class YHPrincipleApprovedResultVC: YHBaseViewController {
// 已发送邮件
self.mailVC.requestData()
self.mailVC.view.isHidden = false
return
}
// 未发送邮件
YHHUD.show(.progress(message:"加载中"))
......
......@@ -130,10 +130,11 @@ class YHPrincipleUploadListVC: YHBaseViewController {
// 赴港居留同意书
let agreementModel = self.viewModel.uploadDetailModel.file_data.agreement
if agreementModel.id > 0 {
agreementModel.customType = YHPrincipleAgreementType.agreement.rawValue
agreementModel.isMust = true
agreementModel.isNeedTemplate = true
self.items.append(agreementModel)
}
......@@ -141,7 +142,6 @@ class YHPrincipleUploadListVC: YHBaseViewController {
let opinionModel = self.viewModel.uploadDetailModel.file_data.opinion
if opinionModel.id > 0 {
opinionModel.customType = YHPrincipleAgreementType.opinion.rawValue
opinionModel.isMust = true
opinionModel.isNeedTemplate = true
self.items.append(opinionModel)
}
......@@ -150,11 +150,17 @@ class YHPrincipleUploadListVC: YHBaseViewController {
let otherModel = self.viewModel.uploadDetailModel.file_data.other
if otherModel.id > 0 {
otherModel.customType = YHPrincipleAgreementType.other.rawValue
otherModel.isMust = false
otherModel.isNeedTemplate = false
self.items.append(otherModel)
}
let isBottomUploadBtnHidden = !agreementModel.isCanUpload && !opinionModel.isCanUpload && !otherModel.isCanUpload
self.uploadBtn.isHidden = isBottomUploadBtnHidden
uploadBtn.snp.updateConstraints { make in
let bottomMargin = isBottomUploadBtnHidden ? 48 : -42
make.bottom.equalTo(bottomMargin)
}
// 已获得港府甄选名额
if !self.viewModel.envelopModel.name.isEmpty, !self.viewModel.envelopModel.url.isEmpty {
self.items.append(self.viewModel.envelopModel)
......@@ -178,6 +184,9 @@ class YHPrincipleUploadListVC: YHBaseViewController {
self.items.append(model3)
self.tableView.reloadData()
self.view.setNeedsLayout()
self.view.layoutIfNeeded()
}
}
......@@ -186,16 +195,23 @@ extension YHPrincipleUploadListVC {
func checkMustItems() -> Bool {
// 赴港居留同意书
let agreementModel = self.viewModel.uploadDetailModel.file_data.agreement
if agreementModel.content_url.count <= 0 {
if agreementModel.isMust, agreementModel.content_url.count <= 0 {
YHHUD.flash(message: "请上传必要文件赴港居留同意书")
return false
}
// 申请人意见访问
let opinionModel = self.viewModel.uploadDetailModel.file_data.opinion
if opinionModel.content_url.count <= 0 {
if opinionModel.isMust, opinionModel.content_url.count <= 0 {
YHHUD.flash(message: "请上传必要文件申请人意见访问")
return false
}
// 其他证明条件
let otherModel = self.viewModel.uploadDetailModel.file_data.opinion
if otherModel.isMust, otherModel.content_url.count <= 0 {
YHHUD.flash(message: "请上传必要文件其他证明条件")
return false
}
return true
}
......@@ -368,7 +384,7 @@ extension YHPrincipleUploadListVC: UITableViewDelegate, UITableViewDataSource {
let cell = tableView.dequeueReusableCell(withIdentifier: YHPrincipleUploadStatusCell.cellReuseIdentifier, for: indexPath) as! YHPrincipleUploadStatusCell
let model = m as! YHPrincipleAgreementModel
if isNeedShowSubmitCheckError, model.content_url.count <= 0 {
if isNeedShowSubmitCheckError, model.isMust == true, model.content_url.count <= 0 {
model.isShowRedTips = true
} else {
model.isShowRedTips = false
......@@ -402,6 +418,10 @@ extension YHPrincipleUploadListVC: UITableViewDelegate, UITableViewDataSource {
cell.uploadBtnClick = {
[weak self] selectModel in
guard let self = self else { return }
if model.content_url.count >= 10 {
YHHUD.flash(message: "最多长传10张照片或文件")
return
}
self.showSelectImageAndFileView(model)
}
// 点击模版
......
......@@ -95,9 +95,8 @@ extension YHPrincipleWaitResultViewController {
viewModel.getPrincipleWaitReviewResult(params: params) { success, error in
self.items.removeAll()
let waitResultModel = self.viewModel.waitResultModel
// 待补件和未获批准不显示实时入境处身份申请进度
if self.status != YHCustomerServiceStatus.principleSupplement.rawValue &&
self.status != YHCustomerServiceStatus.principleRejected.rawValue {
if self.status == YHCustomerServiceStatus.principleWaitResult.rawValue {
if waitResultModel.resultImageList.count > 0 {
// 实时入境处身份申请进度
let model1 = waitResultModel.copy()
model1.type = .photo
......@@ -105,6 +104,7 @@ extension YHPrincipleWaitResultViewController {
model1.isUnfold = true
self.items.append(model1)
}
}
// 入境处已认收受理
let model2 = waitResultModel.copy()
......
......@@ -195,13 +195,28 @@ class YHPrincipleAgreementModel: SmartCodable {
// 自定义属性
var customType: Int = YHPrincipleAgreementType.none.rawValue
var isMust: Bool = false // 是否必须
var isMust: Bool {// 是否必须 0:必须提供 1:无需提供
get {
return self.upload_requirement == 0
}
}
var isNeedTemplate: Bool = false
var isNeedUploadBtn: Bool {
// 待上传或已驳回状态才显示上传按钮 且最多上传10个
get {
return (self.check_status == YHPrincipleUploadStatus.preUpload.rawValue ||
self.check_status == YHPrincipleUploadStatus.rejected.rawValue) && self.content_url.count < 10
self.check_status == YHPrincipleUploadStatus.rejected.rawValue)
}
}
var isCanUpload: Bool {
get {
return (self.check_status == YHPrincipleUploadStatus.preUpload.rawValue ||
self.check_status == YHPrincipleUploadStatus.rejected.rawValue)
}
}
// 是否展示上传状态
var isNeedUploadStatus: Bool {
return self.check_status != YHPrincipleUploadStatus.preUpload.rawValue
......
......@@ -208,6 +208,8 @@ class YHPrincipleUploadStatusCell: UITableViewCell {
// 审核状态
if model.isNeedUploadStatus {
self.statusLabel.text = self.getUploadStatusText(status: model.check_status)
let width = model.check_status == YHPrincipleUploadStatus.mail.rawValue ? 58.0 : 38.0
self.statusLabel.frame = CGRect(x: 0, y: 0, width: width, height: 16)
self.statusLabel.textColor = self.getUploadTitleColor(status: model.check_status)
self.statusLabel.backgroundColor = self.getUploadBgColor(status: model.check_status)
let status: ASAttributedString = " \(.view(self.statusLabel, .original(.center)))"
......@@ -425,7 +427,11 @@ class YHPrincipleUploadStatusCell: UITableViewCell {
return ""
}
if type == YHPrincipleAgreementType.other.rawValue {
return "1.新公司在职证明(在申请期间更换了工作时必传)\n2.主申人的曾用名证明文件,例如户口本副本\n3.主申请人的中国无刑事罪行记录证明书副本(由公安局开具)"
var text = ""
if let remark = self.itemModel?.remark, !remark.isEmpty {
text = "\n"+remark
}
return "新公司在职证明(在申请期间更换了工作时必传)"+text
}
return ""
}
......@@ -438,7 +444,7 @@ class YHPrincipleUploadStatusCell: UITableViewCell {
return "请上传申请人意见访问"
}
if type == YHPrincipleAgreementType.other.rawValue {
return ""
return "请上传其他证明材料"
}
return ""
}
......
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