Commit 5e77c565 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 90833d4b 135056ff
......@@ -272,7 +272,6 @@
0468D4362B57752F00CFB916 /* YHUserModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D4352B57752F00CFB916 /* YHUserModel.swift */; };
0468D43A2B579EAC00CFB916 /* YHLoginViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D4392B579EAC00CFB916 /* YHLoginViewModel.swift */; };
0472CBA82C5A11640096F48F /* YHPrincipleUploadListVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0472CB9C2C5A11640096F48F /* YHPrincipleUploadListVC.swift */; };
0472CBA92C5A11640096F48F /* YHPrincleGroupModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0472CB9E2C5A11640096F48F /* YHPrincleGroupModel.swift */; };
0472CBAC2C5A11640096F48F /* YHPrincleViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0472CBA32C5A11640096F48F /* YHPrincleViewModel.swift */; };
0472E25C2C521E64008EAB6E /* YHHomeIdentityListVC.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0472E25B2C521E64008EAB6E /* YHHomeIdentityListVC.swift */; };
0472E25E2C534723008EAB6E /* YHLifeDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0472E25D2C534723008EAB6E /* YHLifeDetailViewController.swift */; };
......@@ -926,7 +925,6 @@
046AB7772BD674170086C6F1 /* galaxyDebug.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = galaxyDebug.entitlements; sourceTree = "<group>"; };
046AB7782BD674170086C6F1 /* galaxyTestEnv.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = galaxyTestEnv.entitlements; sourceTree = "<group>"; };
0472CB9C2C5A11640096F48F /* YHPrincipleUploadListVC.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHPrincipleUploadListVC.swift; sourceTree = "<group>"; };
0472CB9E2C5A11640096F48F /* YHPrincleGroupModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHPrincleGroupModel.swift; sourceTree = "<group>"; };
0472CBA32C5A11640096F48F /* YHPrincleViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHPrincleViewModel.swift; sourceTree = "<group>"; };
0472E25B2C521E64008EAB6E /* YHHomeIdentityListVC.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHomeIdentityListVC.swift; sourceTree = "<group>"; };
0472E25D2C534723008EAB6E /* YHLifeDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHLifeDetailViewController.swift; sourceTree = "<group>"; };
......@@ -2224,7 +2222,6 @@
0472CB9F2C5A11640096F48F /* M */ = {
isa = PBXGroup;
children = (
0472CB9E2C5A11640096F48F /* YHPrincleGroupModel.swift */,
04B360F02C635A33001EB053 /* YHPrincipleWaitResultModel.swift */,
04B360F62C646B4F001EB053 /* YHPrincipleEnvelopeModel.swift */,
0485DFD32C649A2500B50293 /* YHPrincipleUploadModel.swift */,
......@@ -3694,7 +3691,6 @@
045EEF0C2B9F171A0022A143 /* YHBasicInfoFillBottomView.swift in Sources */,
0485DFD62C64E70200B50293 /* YHPrincipleApprovedWaitSubmitVC.swift in Sources */,
A5ACE93D2B4564F7002C94D2 /* UIButton+Extension.swift in Sources */,
0472CBA92C5A11640096F48F /* YHPrincleGroupModel.swift in Sources */,
04213B232C48B7F700797900 /* YHIdentityTabBar.swift in Sources */,
04F5F86C2C1A9B52004A463C /* YHOtherServiceListViewController.swift in Sources */,
04CC2EF02BC3DDB2000305DD /* YHServiceBannerView.swift in Sources */,
......
......@@ -123,6 +123,9 @@ extension YHOrderDetailViewController: UITableViewDelegate, UITableViewDataSourc
cell.dataSource = dataSource[indexPath.row]
if indexPath.row > 0 {
cell.otherTypeView.isHidden = false
} else {
cell.otherTypeView.isHidden = false
cell.otherTypeView.image = UIImage(named: "service_my_order")
}
cell.cellBlock = {[weak self] model in
guard let self = self else { return }
......
......@@ -15,7 +15,7 @@ class YHPrincipleUploadListVC: YHBaseViewController {
var orderId: Int = 0
var items: [SmartCodable] = []
var isNeedShowError:Bool = false
var isNeedShowSubmitCheckError:Bool = false
let viewModel = YHPrincleViewModel()
......@@ -178,10 +178,14 @@ extension YHPrincipleUploadListVC {
func checkMustItems() -> Bool {
// 赴港居留同意书
let agreementModel = self.viewModel.uploadDetailModel.file_data.agreement
if agreementModel.content_url.count <= 0 {
YHHUD.flash(message: "请上传必要文件赴港居留同意书")
return false
}
// 申请人意见访问
let opinionModel = self.viewModel.uploadDetailModel.file_data.opinion
if agreementModel.content_url.count <= 0 || opinionModel.content_url.count <= 0 {
if opinionModel.content_url.count <= 0 {
YHHUD.flash(message: "请上传必要文件申请人意见访问")
return false
}
return true
......@@ -191,13 +195,12 @@ extension YHPrincipleUploadListVC {
let isMustHave = self.checkMustItems()
if !isMustHave {
YHHUD.flash(message: "请上传必要文件")
isNeedShowError = true
isNeedShowSubmitCheckError = true
self.tableView.reloadData()
return
}
isNeedShowError = false
isNeedShowSubmitCheckError = false
var files:[YHPrincipleRequestModel] = []
......@@ -223,7 +226,6 @@ extension YHPrincipleUploadListVC {
opinion.file_url = opinionModel.content_url
files.append(opinion)
// 其他证明条件
let otherModel = self.viewModel.uploadDetailModel.file_data.other
let other = YHPrincipleRequestModel()
......@@ -307,18 +309,6 @@ extension YHPrincipleUploadListVC {
}
}.show()
}
func showUploadSheetView(supplementId: Int, completion:(()->())?) {
let sheetView = YHCertificateUploadSheetView.sheetView()
sheetView.maxSelectImageCount = 9
sheetView.uploadImageBlock = {
[weak self] targetImgArr in
guard let self = self else { return }
}
sheetView.show()
}
}
extension YHPrincipleUploadListVC: UITableViewDelegate, UITableViewDataSource {
......@@ -339,6 +329,7 @@ extension YHPrincipleUploadListVC: UITableViewDelegate, UITableViewDataSource {
let cell = tableView.dequeueReusableCell(withIdentifier: YHPrincipleProfileListCell.cellReuseIdentifier, for: indexPath) as! YHPrincipleProfileListCell
let model = m as! YHPrincipleWaitResultModel
cell.updateModel(model)
// 点击展开
cell.expandClick = {
[weak self] isUnfold in
guard let self = self else { return }
......@@ -353,6 +344,7 @@ extension YHPrincipleUploadListVC: UITableViewDelegate, UITableViewDataSource {
let cell = tableView.dequeueReusableCell(withIdentifier: YHPrincipleEnvelopeCell.cellReuseIdentifier, for: indexPath) as! YHPrincipleEnvelopeCell
let model = m as! YHPrincipleEnvelopeModel
cell.updateModel(model)
// 点击展开
cell.expandClick = {
[weak self] isUnfold in
guard let self = self else { return }
......@@ -367,12 +359,13 @@ extension YHPrincipleUploadListVC: UITableViewDelegate, UITableViewDataSource {
let cell = tableView.dequeueReusableCell(withIdentifier: YHPrincipleUploadStatusCell.cellReuseIdentifier, for: indexPath) as! YHPrincipleUploadStatusCell
let model = m as! YHPrincipleAgreementModel
if isNeedShowError, model.content_url.count <= 0 {
if isNeedShowSubmitCheckError, model.content_url.count <= 0 {
model.isShowRedTips = true
} else {
model.isShowRedTips = false
}
cell.updateModel(model)
// 点击展开
cell.expandClick = {
[weak self] isUnfold in
guard let self = self else { return }
......@@ -528,7 +521,9 @@ extension YHPrincipleUploadListVC: UITableViewDelegate, UITableViewDataSource {
func showSelectImageAndFileView(_ model: YHPrincipleAgreementModel) {
let sheetView = YHCertificateUploadSheetView.sheetView()
sheetView.maxSelectImageCount = 9
sheetView.tips = "支持的文件格式为jpg/jpeg、png、doc/docx、ppt/pptx、pdf, xls/xlsx,最多可上传10张图片或文件"
sheetView.imageMaxCount = 10
sheetView.maxSelectImageCount = 10-model.content_url.count
sheetView.fileTypes = [ "public.image",
"com.adobe.pdf",
"com.microsoft.word.doc",
......
......@@ -187,8 +187,9 @@ class YHPrincipleAgreementModel: SmartCodable {
var isMust: Bool = false // 是否必须
var isNeedTemplate: Bool = false
var isNeedUploadBtn: Bool {
return self.check_status == YHPrincipleUploadStatus.preUpload.rawValue ||
self.check_status == YHPrincipleUploadStatus.rejected.rawValue
// 待上传或已驳回状态才显示上传按钮 且最多上传10个
return (self.check_status == YHPrincipleUploadStatus.preUpload.rawValue ||
self.check_status == YHPrincipleUploadStatus.rejected.rawValue) && self.content_url.count < 10
}
// 是否展示上传状态
var isNeedUploadStatus: Bool {
......
//
// YHPrincleModel.swift
// galaxy
//
// Created by edy on 2024/4/26.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import AttributedString
class YHPrincleGroupModel: NSObject {
var title: String = ""
var subTitle: String = ""
var fileList:[String] = []
var isExpand:Bool = false
var isNeedTemplate: Bool = true
var isNeedUploadBtn: Bool = true
var tips: String = ""
// "1.新公司在职证明(在申请期间更换了工作时必传)\n2.主申人的曾用名证明文件,例如户口本副本\n3.主申请人的中国无刑事罪行记录证明书副本(由公安局开具)"
var tips1: ASAttributedString = YHPrincleGroupModel.getTips()
var redTips: String = "驳回原因:你的证件不合格不合格不合格不合格不合格。"
static func getTips() -> ASAttributedString {
let a: ASAttributedString = .init("请【下载模板】,填写信息,贵单位", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor.mainTextColor))
let b: ASAttributedString = .init("签字盖章", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor.init(hex: 0x3570DC)))
let c: ASAttributedString = .init("后,拍照or扫描上传", .font(UIFont.PFSC_R(ofSize: 12)),.foreground(UIColor.mainTextColor))
return a + b + c
}
}
......@@ -300,7 +300,7 @@ class YHPrincipleProfileListCell: UITableViewCell {
let strSize = text.boundingRect(with: size, options: [.usesLineFragmentOrigin], attributes: dic, context:nil).size
var height = CGSizeMake(strSize.width, ceil(strSize.height)).height
if height < 20.0 {
var height = 20
height = 20
}
return ceil(height)
}
......
......@@ -220,7 +220,7 @@ class YHPrincipleUploadStatusCell: UITableViewCell {
// 红色已驳回原因
let reason = "驳回原因: " + model.audit_content
rejectReasonLabel.text = reason
rejectReasonLabel.isHidden = model.audit_content.isEmpty
rejectReasonLabel.isHidden = model.audit_content.isEmpty || model.check_status != YHPrincipleUploadStatus.rejected.rawValue
// 灰色提示
model.tips = self.getTips(type: model.customType)
......@@ -274,7 +274,7 @@ class YHPrincipleUploadStatusCell: UITableViewCell {
make.top.equalTo(lineView.snp.bottom).offset(model.audit_content.isEmpty ? 0 : 16)
make.left.equalTo(16)
make.right.equalTo(-16)
if model.audit_content.isEmpty {
if model.audit_content.isEmpty || model.check_status != YHPrincipleUploadStatus.rejected.rawValue{
make.height.equalTo(0)
}
}
......
......@@ -42,16 +42,20 @@ enum YHCertificateUploadType: Int {
class YHCertificateUploadSheetView: UIView {
private var _maxSelectImageCount: Int = 9
// 决定最终图片选择数量最大值 赋值时先赋值 imageMaxCount 后赋值 maxSelectImageCount
var imageMaxCount: Int = 9
var tips = "支持的文件格式为jpg/jpeg、png、doc/docx、pptx、pdf,最多可上传99张图片或文件"
// 外部根据业务在0~imageMaxCount之间变动
var maxSelectImageCount = 9 {
didSet {
if maxSelectImageCount >= 9 {
_maxSelectImageCount = 9
} else if 0 < maxSelectImageCount && maxSelectImageCount < 9 {
_maxSelectImageCount = maxSelectImageCount
if maxSelectImageCount >= imageMaxCount {
} else if 0 < maxSelectImageCount && maxSelectImageCount < imageMaxCount {
imageMaxCount = maxSelectImageCount
} else {
_maxSelectImageCount = 0
imageMaxCount = 0
}
}
}
......@@ -244,6 +248,7 @@ class YHCertificateUploadSheetView: UIView {
extension YHCertificateUploadSheetView {
func show() {
self.tableView.reloadData()
UIApplication.shared.yhKeyWindow()?.addSubview(self)
}
......@@ -407,7 +412,7 @@ extension YHCertificateUploadSheetView: (UIImagePickerControllerDelegate & UINav
var configuration = PHPickerConfiguration()
// 设置最大选择数量
configuration.selectionLimit = _maxSelectImageCount
configuration.selectionLimit = imageMaxCount
// 设置选择器的过滤条件 只显示图片
configuration.filter = .images
let picker = PHPickerViewController(configuration: configuration)
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "service_my_order@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "service_my_order@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
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