Commit df0e361f authored by pete谢兆麟's avatar pete谢兆麟

服务中心UI及接口逻辑 有问题就是后端问题

parent c603a8d1
......@@ -546,6 +546,11 @@
04CA2BF02CB7A74C00F36DE7 /* YHResignUploadTravelHKViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04CA2BEF2CB7A74C00F36DE7 /* YHResignUploadTravelHKViewController.swift */; };
04CA2BF22CB7AA7600F36DE7 /* YHResignUploadTravelPassportViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04CA2BF12CB7AA7600F36DE7 /* YHResignUploadTravelPassportViewController.swift */; };
04CA2BF42CB7B33500F36DE7 /* YHResignUploadTravelGuideView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04CA2BF32CB7B33500F36DE7 /* YHResignUploadTravelGuideView.swift */; };
04CA2BFB2CB7BAC600F36DE7 /* YHResignUploadDocListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04CA2BFA2CB7BAC600F36DE7 /* YHResignUploadDocListViewController.swift */; };
04CA2BFD2CB7C36D00F36DE7 /* YHResignUploadDocListCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04CA2BFC2CB7C36D00F36DE7 /* YHResignUploadDocListCell.swift */; };
04CA2BFF2CB7C9A000F36DE7 /* YHResignUploadSuccessDocListCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04CA2BFE2CB7C9A000F36DE7 /* YHResignUploadSuccessDocListCell.swift */; };
04CA2C012CB7CEDC00F36DE7 /* YHResignUploadDocDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04CA2C002CB7CEDC00F36DE7 /* YHResignUploadDocDetailViewController.swift */; };
04CA2C032CB7D3C200F36DE7 /* YHFileExplainReasonInputView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04CA2C022CB7D3C200F36DE7 /* YHFileExplainReasonInputView.swift */; };
04CC2EF02BC3DDB2000305DD /* YHServiceBannerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04CC2EEF2BC3DDB2000305DD /* YHServiceBannerView.swift */; };
04CCEDF72CA0FCB10026EA70 /* YHHKImmigrationRecordsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04CCEDF62CA0FCB10026EA70 /* YHHKImmigrationRecordsViewModel.swift */; };
04CCEDF92CA0FD5F0026EA70 /* YHHKImmigrationRecordsSummaryModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04CCEDF82CA0FD5F0026EA70 /* YHHKImmigrationRecordsSummaryModel.swift */; };
......@@ -1427,6 +1432,11 @@
04CA2BEF2CB7A74C00F36DE7 /* YHResignUploadTravelHKViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHResignUploadTravelHKViewController.swift; sourceTree = "<group>"; };
04CA2BF12CB7AA7600F36DE7 /* YHResignUploadTravelPassportViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHResignUploadTravelPassportViewController.swift; sourceTree = "<group>"; };
04CA2BF32CB7B33500F36DE7 /* YHResignUploadTravelGuideView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHResignUploadTravelGuideView.swift; sourceTree = "<group>"; };
04CA2BFA2CB7BAC600F36DE7 /* YHResignUploadDocListViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHResignUploadDocListViewController.swift; sourceTree = "<group>"; };
04CA2BFC2CB7C36D00F36DE7 /* YHResignUploadDocListCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHResignUploadDocListCell.swift; sourceTree = "<group>"; };
04CA2BFE2CB7C9A000F36DE7 /* YHResignUploadSuccessDocListCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHResignUploadSuccessDocListCell.swift; sourceTree = "<group>"; };
04CA2C002CB7CEDC00F36DE7 /* YHResignUploadDocDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHResignUploadDocDetailViewController.swift; sourceTree = "<group>"; };
04CA2C022CB7D3C200F36DE7 /* YHFileExplainReasonInputView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFileExplainReasonInputView.swift; sourceTree = "<group>"; };
04CC2EEF2BC3DDB2000305DD /* YHServiceBannerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHServiceBannerView.swift; sourceTree = "<group>"; };
04CCEDF62CA0FCB10026EA70 /* YHHKImmigrationRecordsViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHKImmigrationRecordsViewModel.swift; sourceTree = "<group>"; };
04CCEDF82CA0FD5F0026EA70 /* YHHKImmigrationRecordsSummaryModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHKImmigrationRecordsSummaryModel.swift; sourceTree = "<group>"; };
......@@ -2196,6 +2206,7 @@
0449EEE52C8EE99000A397FD /* Resign(续签) */ = {
isa = PBXGroup;
children = (
04CA2BF52CB7BA3700F36DE7 /* ResignUploadDoc(续签补件) */,
04CA2BE22CB7693500F36DE7 /* UploadTravelCrad(上传旅行证件) */,
04912F652CB6A56900CC3105 /* ResignHKAppoint(在港递交预约) */,
04912F562CB6675D00CC3105 /* ResignInfoConfirm(续签信息确认) */,
......@@ -3662,6 +3673,50 @@
path = M;
sourceTree = "<group>";
};
04CA2BF52CB7BA3700F36DE7 /* ResignUploadDoc(续签补件) */ = {
isa = PBXGroup;
children = (
04CA2BF92CB7BAA800F36DE7 /* VM */,
04CA2BF82CB7BAA100F36DE7 /* M */,
04CA2BF72CB7BA9D00F36DE7 /* C */,
04CA2BF62CB7BA9800F36DE7 /* V */,
);
path = "ResignUploadDoc(续签补件)";
sourceTree = "<group>";
};
04CA2BF62CB7BA9800F36DE7 /* V */ = {
isa = PBXGroup;
children = (
04CA2BFC2CB7C36D00F36DE7 /* YHResignUploadDocListCell.swift */,
04CA2BFE2CB7C9A000F36DE7 /* YHResignUploadSuccessDocListCell.swift */,
04CA2C022CB7D3C200F36DE7 /* YHFileExplainReasonInputView.swift */,
);
path = V;
sourceTree = "<group>";
};
04CA2BF72CB7BA9D00F36DE7 /* C */ = {
isa = PBXGroup;
children = (
04CA2BFA2CB7BAC600F36DE7 /* YHResignUploadDocListViewController.swift */,
04CA2C002CB7CEDC00F36DE7 /* YHResignUploadDocDetailViewController.swift */,
);
path = C;
sourceTree = "<group>";
};
04CA2BF82CB7BAA100F36DE7 /* M */ = {
isa = PBXGroup;
children = (
);
path = M;
sourceTree = "<group>";
};
04CA2BF92CB7BAA800F36DE7 /* VM */ = {
isa = PBXGroup;
children = (
);
path = VM;
sourceTree = "<group>";
};
04CCEDF52CA0FC850026EA70 /* VM */ = {
isa = PBXGroup;
children = (
......@@ -5111,6 +5166,7 @@
0430E6882C771B06000511E2 /* YHAdopterItemView.swift in Sources */,
045EEEB32B9F171A0022A143 /* YHWorkFileSyncTableViewCell.swift in Sources */,
045EEEF12B9F171A0022A143 /* YHChildInfoContainerVC.swift in Sources */,
04CA2BFD2CB7C36D00F36DE7 /* YHResignUploadDocListCell.swift in Sources */,
045EEF0B2B9F171A0022A143 /* YHBasicInfoFillViewController.swift in Sources */,
0430E6582C7434F2000511E2 /* YHAdopterNewPeopleViewController.swift in Sources */,
A582B2452BBA4CF9009D098C /* YHHKPlanDocModel.swift in Sources */,
......@@ -5136,6 +5192,7 @@
A598E9E22C7CB32D00F84739 /* YHTravelDocsPreparationListModel.swift in Sources */,
A598E9D72C7C9EF300F84739 /* YHTravelDocsPreparationListViewController.swift in Sources */,
A520124F2BABCE05008655EA /* YHFileListContentView.swift in Sources */,
04CA2BFF2CB7C9A000F36DE7 /* YHResignUploadSuccessDocListCell.swift in Sources */,
04CE1AE12C2AD91F001CB80A /* YHActivityDetailItemView.swift in Sources */,
A517A4E42BB6C4BB000DEECD /* YHDocumentUploadView.swift in Sources */,
045EEF042B9F171A0022A143 /* YHIdentityCardCell.swift in Sources */,
......@@ -5304,6 +5361,7 @@
A5FD45232C523DD300908AD9 /* YHJsApi.swift in Sources */,
04B360E32C60A346001EB053 /* YHPrinciplePhotoListCell.swift in Sources */,
044EE2512C955CDE00A2FE3A /* YHResignGuidelinesExampleViewController.swift in Sources */,
04CA2C032CB7D3C200F36DE7 /* YHFileExplainReasonInputView.swift in Sources */,
04213B292C48EF5300797900 /* YHHomeInformationViewController.swift in Sources */,
A5DF9C692C78BE6000CE48E6 /* YHUploadCertificateDetailModel.swift in Sources */,
044EE2442C92F48200A2FE3A /* YHResignCertificateEvisaTableViewCell.swift in Sources */,
......@@ -5572,6 +5630,7 @@
04CE1AE32C2AD91F001CB80A /* YHApplyActivityAlert.swift in Sources */,
A598E9E42C7EEFD300F84739 /* YHTravelDocsPreparationDetailModel.swift in Sources */,
04A7BD132BA42F4200BD35A2 /* YHMyDocumentsDetailViewController.swift in Sources */,
04CA2C012CB7CEDC00F36DE7 /* YHResignUploadDocDetailViewController.swift in Sources */,
04A671622BA058DE00C1FB91 /* YHCertificateEditSheetView.swift in Sources */,
04AD317D2C295AE800DF5655 /* YHUserInfoSettingViewModel.swift in Sources */,
045A08C22C37EB8B00BCBABA /* YHMyFileListNoneCell.swift in Sources */,
......@@ -5666,6 +5725,7 @@
0430E6822C75E068000511E2 /* YHAdopterCardOtherGuideView.swift in Sources */,
04174D742BCD5B74000BA46D /* IMAppKey.swift in Sources */,
A567E5B62BD7643D00D5D5A0 /* YHHomeBannerIndicatorView.swift in Sources */,
04CA2BFB2CB7BAC600F36DE7 /* YHResignUploadDocListViewController.swift in Sources */,
045EEEAD2B9F171A0022A143 /* YHWorkExperienceListTableViewCell.swift in Sources */,
049A48A82B49417300D0C641 /* YHAboutUsViewController.swift in Sources */,
047619E92BA9867100F45358 /* YHCountryHotView.swift in Sources */,
......
......@@ -194,6 +194,24 @@ class YHServiceOrderListView: YHBaseViewController {
//续签文书管理
let vc = YHResignDocumentManagementVC(orderId: orderId, id: stepId)
UIViewController.current?.navigationController?.pushViewController(vc)
} else if type == 33 {
//续签信息确认
} else if type == 34 {
//在港递交预约
} else if type == 35 {
//查看续签结果
} else if type == 36 {
//续签补件
} else if type == 37 {
//在港签证缴费
} else if type == 38 {
//上传旅行证件
}
}
}
......@@ -377,7 +395,7 @@ extension YHServiceOrderListView : UITableViewDelegate,UITableViewDataSource {
let arr = self.arrDataForSeviceCenterProgress
if 0 <= indexPath.row, indexPath.row < arr.count {
let model = arr[indexPath.row]
if model.type == 27 || model.type == 32 || model.type == 31 {
if model.type == 27 || model.type == 32 || model.type == 31 || model.type == 34 {
return 162
}
return 144
......
//
// YHResignUploadDocDetailViewController.swift
// galaxy
//
// Created by EDY on 2024/10/10.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import IQKeyboardManagerSwift
import AttributedString
class YHResignUploadDocDetailViewController: YHBaseViewController {
// 进入该页面以下三个参数必传
// 订单id
var orderId: Int = 0
// 批次id
var batchId: Int = 0
var materialId : Int = 0
var materialModel: YHMaterialModel = YHMaterialModel() {
didSet {
self.tableView.reloadData()
}
}
var templateModel: YHResignTemplateDetail = YHResignTemplateDetail()
var templateArr: [YHResignTemplateItemModel] = []
var categoryId: Int = 0
var supplementId: Int = 0
var viewModel: YHResignMaterialViewModel = YHResignMaterialViewModel()
var items:[YHMaterialModelItemModel] = []
var selectEditItem: YHMaterialModelItemModel?
lazy var previewFileTool:YHFilePreviewTool = {
let tool = YHFilePreviewTool(targetVC: self)
return tool
}()
var renameInputView: YHFileRenameInputView = {
let view = YHFileRenameInputView.inputView(defalutText: "请输入名称")
return view
}()
// var renameInputView: YHFileRenameInputView = {
// let view = YHFileRenameInputView.inputView(defalutText: "请输入名称")
// return view
// }()
lazy var blackMaskView: UIView = {
let view = UIView(frame:UIScreen.main.bounds)
view.backgroundColor = UIColor(hex: 0x0F1214, alpha: 0.5)
let tap = UITapGestureRecognizer(target: self, action: #selector(dismissed))
view.addGestureRecognizer(tap)
view.isHidden = true
return view
}()
lazy var tableView: UITableView = {
let tableView = UITableView(frame:.zero, style:.grouped)
if #available(iOS 11.0, *) {
tableView.contentInsetAdjustmentBehavior = .never
}
tableView.showsVerticalScrollIndicator = false
tableView.backgroundColor = .white
tableView.separatorStyle = .none
tableView.delegate = self
tableView.dataSource = self
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell")
tableView.register(YHResignMaterialNameCell.self, forCellReuseIdentifier: YHResignMaterialNameCell.cellReuseIdentifier)
tableView.register(YHCertificateTemplateCell.self, forCellReuseIdentifier: YHCertificateTemplateCell.cellReuseIdentifier)
return tableView
}()
lazy var uploadBtn:UIButton = {
let btn = UIButton()
btn.setTitle("继续上传".local, for: .normal)
btn.titleLabel?.font = UIFont.PFSC_M(ofSize: 16)
btn.setTitleColor(.white, for: .normal)
btn.backgroundColor = UIColor.brandMainColor
btn.layer.cornerRadius = kCornerRadius3
btn.addTarget(self, action: #selector(didClickUploadBtn), for: .touchUpInside)
btn.isHidden = true
return btn
}()
override func viewDidLoad() {
super.viewDidLoad()
self.view.backgroundColor = .white
self.gk_navTitle = "资料上传"
addKeyBoardNotify()
createUI()
requestMaterialDetail()
renameInputView.editBlock = {
[weak self] text in
guard let self = self else { return }
if let selectEditItem = selectEditItem, var text = text {
// 重命名
text = text + "." + selectEditItem.getFileSuffixName()
YHHUD.show(.progress(message: "重命名中..."))
selectEditItem.name = text
self.viewModel.updateMaterials(material: self.materialModel, addInfoArr: []) {
success, error in
YHHUD.hide()
if success {
YHHUD.flash(message: "重命名成功")
} else {
var msg = "重命名失败"
if let errorMsg = error?.errorMsg, !errorMsg.isEmpty {
msg = errorMsg
}
YHHUD.flash(message:msg)
}
self.requestMaterialDetail()
}
}
}
}
deinit {
removeNotify()
}
@objc func didClickUploadBtn() {
if items.count >= 99 {
YHHUD.flash(message: "已达上限\n最多上传99张图片或文件")
return
}
let sheetView = YHCertificateUploadSheetView.sheetView()
sheetView.maxSelectImageCount = 99-items.count
sheetView.tips = "支持的文件格式为jpg/jpeg、png、bmp、doc/docx、xls/xlsx、pdf,最多可上传99张图片或文件"
sheetView.fileTypes = [ "public.image",
"com.adobe.pdf",
"com.microsoft.word.doc",
"org.openxmlformats.wordprocessingml.document",
"org.openxmlformats.spreadsheetml.sheet",
"com.microsoft.excel.xls",]
sheetView.uploadFilesBlock = {
[weak self] fileUrl in
guard let self = self else { return }
print(fileUrl)
self.viewModel.uploadFilesWithMaterial(material:self.materialModel, fileUrl: fileUrl) {
[weak self] in
guard let self = self else { return }
self.requestMaterialDetail()
}
}
sheetView.uploadImageBlock = {
[weak self] targetImgArr in
guard let self = self else { return }
self.viewModel.uploadImageArr(targetImgArr, material: self.materialModel) {
[weak self] in
guard let self = self else { return }
self.requestMaterialDetail()
}
}
sheetView.show()
}
func createUI() {
view.addSubview(uploadBtn)
view.addSubview(tableView)
view.addSubview(blackMaskView)
view.addSubview(renameInputView)
tableView.snp.makeConstraints { make in
make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
make.left.right.bottom.equalToSuperview()
}
uploadBtn.snp.makeConstraints { make in
make.left.equalToSuperview().offset(16)
make.right.equalToSuperview().offset(-16)
make.height.equalTo(48.0)
make.bottom.equalToSuperview().offset(-8-k_Height_safeAreaInsetsBottom())
}
renameInputView.snp.makeConstraints { make in
make.left.right.equalTo(view)
make.height.equalTo(YHFileRenameInputView.height)
make.bottom.equalToSuperview().offset(YHFileRenameInputView.height)
}
}
}
extension YHResignUploadDocDetailViewController: UITableViewDelegate, UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return 2
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if section == 0 {
return templateArr.count
}
return items.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if indexPath.section == 0 {
let cell = tableView.dequeueReusableCell(withIdentifier: YHCertificateTemplateCell.cellReuseIdentifier, for: indexPath) as! YHCertificateTemplateCell
cell.update(bottomMargin: 15)
if 0 <= indexPath.row && indexPath.row < templateArr.count {
cell.templateModel = templateArr[indexPath.row]
}
return cell
}
let cell = tableView.dequeueReusableCell(withIdentifier: YHResignMaterialNameCell.cellReuseIdentifier, for: indexPath) as! YHResignMaterialNameCell
if 0 <= indexPath.row && indexPath.row < items.count {
let item = items[indexPath.row]
cell.updateModel(item)
cell.editBlock = {
[weak self] contentItem in
guard let self = self else { return }
selectEditItem = contentItem
var items = [YHCertificateEditItem(type:.rename, title:"重命名"),
YHCertificateEditItem(type:.preview, title:"预览"),
YHCertificateEditItem(type:.delete, title:"删除"),
YHCertificateEditItem(type:.cancel, title:"取消")]
if self.materialModel.status == YHMaterialStatus.completed.rawValue {
items = [YHCertificateEditItem(type:.preview, title:"预览"),
YHCertificateEditItem(type:.cancel, title:"取消")]
}
YHCertificateEditSheetView.sheetView(items:items) {
[weak self] editType in
guard let self = self else { return }
print("editType:\(editType.rawValue)")
if editType == .rename { // 重命名
IQKeyboardManager.shared.enable = false
var name = contentItem.getFileNameWithoutSuffix()
if name.count > 30 {
name = name[safe: ..<30]!
}
renameInputView.textField.text = name
renameInputView.textField.becomeFirstResponder()
} else if editType == .delete { // 删除
let msg = "您确定要删除文档\(contentItem.name)吗?"
YHTwoOptionAlertView.showAlertView(message:msg) { sure in
if !sure { return }
// 删除
YHHUD.show(.progress(message: "删除中..."))
var deleteIndex = -1
for (index, item) in self.materialModel.info.enumerated() {
if contentItem.url == item.url {
deleteIndex = index
break
}
}
if deleteIndex == -1 { // 没有找到对应资料文件
YHHUD.flash(message: "删除成功")
return
}
self.materialModel.info.remove(at: deleteIndex)
self.viewModel.updateMaterials(material: self.materialModel, addInfoArr: []) {
success, error in
YHHUD.hide()
if success {
YHHUD.flash(message: "删除成功")
} else {
var msg = "删除失败"
if let errorMsg = error?.errorMsg, !errorMsg.isEmpty {
msg = errorMsg
}
YHHUD.flash(message:msg)
}
self.requestMaterialDetail()
}
}
} else if editType == .preview { // 预览
print(contentItem.url)
self.viewModel.getPublicImageUrl(contentItem.url) { success, error in
if let success = success {
self.previewFileTool.openXLSXRemoteFile(urlString: success, fileName:contentItem.name)
}
}
}
}.show()
}
}
return cell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
if indexPath.section == 0 {
return 77.0
}
return UITableView.automaticDimension
}
private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat {
if section == 0 {
return UITableView.automaticDimension
}
return UITableView.automaticDimension
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let view = UIView()
if section == 0 { // 证件示例模板
let titlelabel = UILabel()
titlelabel.textColor = UIColor.mainTextColor
titlelabel.textAlignment = .left
titlelabel.font = UIFont.PFSC_M(ofSize:17)
titlelabel.text = "\(self.materialModel.getName())示例模板"
titlelabel.numberOfLines = 0
view.addSubview(titlelabel)
titlelabel.snp.makeConstraints { make in
make.top.equalToSuperview().offset(16)
make.left.equalToSuperview().offset(20)
make.right.equalToSuperview().offset(-20)
}
let tipsLabel = UILabel()
tipsLabel.textColor = UIColor.labelTextColor2
tipsLabel.textAlignment = .left
tipsLabel.font = UIFont.PFSC_R(ofSize:14)
tipsLabel.numberOfLines = 0
if !self.templateModel.remark.isEmpty {
tipsLabel.text = "注意事项:\(self.templateModel.remark)"
}
view.addSubview(tipsLabel)
tipsLabel.snp.makeConstraints { make in
make.top.equalTo(titlelabel.snp.bottom).offset(5)
make.left.equalToSuperview().offset(20)
make.right.equalToSuperview().offset(-20)
make.bottom.equalToSuperview().offset(-15)
}
return view
}
// 证件标题和状态
let titlelabel = UILabel()
titlelabel.textColor = UIColor.mainTextColor
titlelabel.textAlignment = .left
titlelabel.font = UIFont.PFSC_M(ofSize:17)
titlelabel.text = self.materialModel.getName()
titlelabel.numberOfLines = 0
view.addSubview(titlelabel)
let statusLabel = UILabel()
statusLabel.textAlignment = .center
statusLabel.font = UIFont.PFSC_M(ofSize:10)
statusLabel.layer.cornerRadius = kCornerRadius3
statusLabel.clipsToBounds = true
view.addSubview(statusLabel)
var text = ""
var textColor:UIColor = .clear
var bgColor:UIColor = .clear
if self.materialModel.status == YHMaterialStatus.review.rawValue {
text = "审核中".local
textColor = UIColor(hexString: "#FF9900")!
bgColor = UIColor(hexString: "#FF9900", transparency: 0.08)!
} else if self.materialModel.status == YHMaterialStatus.preUpload.rawValue {
text = "待上传".local
textColor = UIColor(hexString: "#2F7EF6")!
bgColor = UIColor(hexString: "#2F7EF6", transparency: 0.08)!
} else if self.materialModel.status == YHMaterialStatus.completed.rawValue {
text = "已完成".local
textColor = UIColor(hexString: "#49D2B1")!
bgColor = UIColor(hexString: "#49D2B1", transparency: 0.08)!
} else if self.materialModel.status == YHMaterialStatus.rejected.rawValue {
text = "已驳回".local
textColor = UIColor.failColor
bgColor = UIColor(hexString: "#F81D22", transparency: 0.08)!
}
statusLabel.text = text
statusLabel.textColor = textColor
statusLabel.backgroundColor = bgColor
let tipsLabel = UILabel()
tipsLabel.textColor = .labelTextColor2
tipsLabel.font = UIFont.PFSC_R(ofSize:14)
tipsLabel.textAlignment = .left
tipsLabel.numberOfLines = 0
tipsLabel.text = "支持的文件格式为jpg/jpeg、png、bmp、doc/docx、xls/xlsx、pdf,最多可上传99张图片或文件"
view.addSubview(tipsLabel)
titlelabel.snp.makeConstraints { make in
make.left.equalToSuperview().offset(20)
make.top.equalToSuperview()
}
statusLabel.snp.makeConstraints { make in
make.centerY.equalTo(titlelabel)
make.left.equalTo(titlelabel.snp.right).offset(4)
make.right.lessThanOrEqualTo(view).offset(-20)
make.height.equalTo(16)
make.width.equalTo(38)
}
tipsLabel.snp.remakeConstraints { make in
make.left.equalToSuperview().offset(20)
make.right.equalToSuperview().offset(-20)
make.top.equalTo(titlelabel.snp.bottom).offset(7)
make.bottom.equalToSuperview().offset(-15)
}
if self.materialModel.status != YHMaterialStatus.rejected.rawValue {
return view
}
if self.materialModel.audit_remark.isEmpty { // 无驳回理由
return view
}
// 有驳回理由
let rejectView = UIView()
view.addSubview(rejectView)
let warningImgV = UIImageView(image: UIImage(named: "my_cer_upload_warning"))
rejectView.addSubview(warningImgV)
let rejectTitleLabel = UILabel()
rejectTitleLabel.textColor = .failColor
rejectTitleLabel.font = UIFont.PFSC_R(ofSize:12)
rejectTitleLabel.textAlignment = .left
rejectTitleLabel.text = "驳回原因:"
rejectView.addSubview(rejectTitleLabel)
let rejectContentLabel = UILabel()
rejectContentLabel.textColor = .failColor
rejectContentLabel.font = UIFont.PFSC_R(ofSize:12)
rejectContentLabel.numberOfLines = 0
rejectContentLabel.textAlignment = .left
rejectContentLabel.text = self.materialModel.audit_remark
rejectView.addSubview(rejectContentLabel)
tipsLabel.snp.remakeConstraints { make in
make.left.equalToSuperview().offset(20)
make.right.equalToSuperview().offset(-20)
make.top.equalTo(titlelabel.snp.bottom).offset(7)
make.bottom.equalTo(rejectView.snp.top).offset(-20)
}
rejectView.snp.makeConstraints { make in
make.left.equalToSuperview().offset(20)
make.right.equalToSuperview().offset(-20)
make.bottom.equalToSuperview().offset(-12)
}
warningImgV.snp.makeConstraints { make in
make.width.height.equalTo(14)
make.left.top.equalTo(0)
}
rejectTitleLabel.snp.makeConstraints { make in
make.centerY.equalTo(warningImgV)
make.left.equalTo(warningImgV.snp.right).offset(4)
}
rejectContentLabel.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalTo(warningImgV.snp.bottom).offset(7)
make.bottom.equalToSuperview()
}
return view
}
private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat {
if section == 0 {
return 20.0
}
return 60.0
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
let view = UIView()
if section == 0 {
return view
}
let label = UILabel(frame: CGRect(x: 0, y: 20, width:KScreenWidth, height:20))
label.textColor = UIColor.labelTextColor2
label.textAlignment = .center
label.font = UIFont.PFSC_R(ofSize:12)
let tipsFont = UIFont.PFSC_R(ofSize: 12)
let a: ASAttributedString = .init("已上传", .font(tipsFont),.foreground(UIColor.labelTextColor2))
let b: ASAttributedString = .init(" \(items.count)/99 ", .font(UIFont.PFSC_M(ofSize: 12)), .foreground(UIColor.init(hexString:"#2F2F2F")!))
let c: ASAttributedString = .init("张图片或文件", .font(tipsFont), .foreground(UIColor.labelTextColor2))
label.attributed.text = a+b+c
view.addSubview(label)
label.snp.makeConstraints { make in
make.left.right.top.equalToSuperview()
make.bottom.equalToSuperview().offset(-20)
}
return view
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if indexPath.section == 0 { // 模板列表
if 0 <= indexPath.row && indexPath.row < templateArr.count {
let path = templateArr[indexPath.row]
print(path.fileUrl)
if !path.fileUrl.isEmpty {
self.previewFileTool.openXLSXRemoteFile(urlString:path.fileUrl, fileName:"预览")
}
}
} else if indexPath.section == 1 { // 证件列表
if 0 <= indexPath.row && indexPath.row < items.count {
let cer = items[indexPath.row]
if !cer.url.isEmpty {
print(cer.url)
self.viewModel.getPublicImageUrl(cer.url) { success, error in
if let success = success {
self.previewFileTool.openXLSXRemoteFile(urlString: success, fileName:cer.name)
}
}
}
}
}
}
@objc func dismissed() {
renameInputView.textField.resignFirstResponder()
}
}
extension YHResignUploadDocDetailViewController {
func addKeyBoardNotify() {
NotificationCenter.default.addObserver(self, selector: #selector(handleKeyboardNotification(_:)), name: UIResponder.keyboardWillShowNotification, object: nil)
NotificationCenter.default.addObserver(self, selector: #selector(handleKeyboardNotification(_:)), name: UIResponder.keyboardWillHideNotification, object: nil)
}
func removeNotify() {
NotificationCenter.default.removeObserver(self)
}
@objc func handleKeyboardNotification(_ notification: Notification) {
if notification.userInfo != nil {
guard let keyboardFrame = (notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as AnyObject).cgRectValue else {return }
let isKeyboardShow = notification.name == UIResponder.keyboardWillShowNotification
self.blackMaskView.isHidden = !isKeyboardShow
let bottomMargin = (isKeyboardShow ? -keyboardFrame.height : YHFileRenameInputView.height)
if !isKeyboardShow {
IQKeyboardManager.shared.enable = true
}
self.renameInputView.snp.updateConstraints { make in
make.bottom.equalToSuperview().offset(bottomMargin)
}
self.view.setNeedsLayout()
self.view.layoutIfNeeded()
}
}
}
extension YHResignUploadDocDetailViewController {
func requestMaterialDetail() {
YHHUD.show(.progress(message: "加载中..."))
viewModel.getMaterialDeal(orderId: orderId, id: batchId, materialId: materialId) {
[weak self] success, error in
YHHUD.hide()
guard let self = self else { return }
self.materialModel = self.viewModel.materialDeal
self.items = self.materialModel.info
if self.materialModel.status == YHMaterialStatus.completed.rawValue {
self.uploadBtn.isHidden = true
} else {
self.uploadBtn.isHidden = false
self.uploadBtn.alpha = (items.count >= 99 ? 0.5 : 1.0)
}
self.tableView.snp.remakeConstraints { make in
make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
make.left.right.equalToSuperview()
if self.materialModel.status == YHMaterialStatus.completed.rawValue {
make.bottom.equalToSuperview()
} else {
make.bottom.equalTo(self.uploadBtn.snp.top).offset(-34)
}
}
self.tableView.reloadData()
self.requestTemplate()
if let errorMsg = error?.errorMsg, errorMsg.count > 0 {
YHHUD.flash(message: errorMsg, duration:3)
}
}
}
func requestTemplate() {
viewModel.getTemplateInfo(templateId: self.materialModel.template_id) {
[weak self] success, error in
guard let self = self else { return }
self.templateModel = self.viewModel.templateDeail
self.templateArr = self.templateModel.file_url
self.tableView.reloadData()
}
}
}
//
// YHResignUploadDocListViewController.swift
// galaxy
//
// Created by EDY on 2024/10/10.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import AttributedString
class YHResignUploadDocListViewController: YHBaseViewController {
var orderId: Int = 0
lazy var viewModel: YHTravelDocsPreparationViewModel = {
let vm = YHTravelDocsPreparationViewModel()
return vm
}()
var bgImageView: UIImageView!
var titleLabel: UILabel!
var messageLabel: UILabel!
lazy var tableView: UITableView = {
let tableView = UITableView(frame:.zero, style:.grouped)
tableView.estimatedSectionHeaderHeight = 16.0
tableView.estimatedSectionFooterHeight = 0.01
tableView.contentInsetAdjustmentBehavior = .never
tableView.showsVerticalScrollIndicator = false
tableView.separatorStyle = .none
tableView.delegate = self
tableView.dataSource = self
tableView.backgroundColor = .clear
tableView.register(YHResignUploadDocListCell.self, forCellReuseIdentifier: YHResignUploadDocListCell.cellReuseIdentifier)
tableView.register(YHTravelDocsPreparationTipsCell.self, forCellReuseIdentifier: YHTravelDocsPreparationTipsCell.cellReuseIdentifier)
return tableView
}()
//我已知悉,确认
lazy var rewardBtn: UIButton = {
let button = UIButton(type: .custom)
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 15)
button.contentHorizontalAlignment = .center
button.setTitle("去查看港府续签结果结", for: .normal)
button.setTitleColor(UIColor.white, for: .normal)
button.setTitleColor(UIColor.white, for: .disabled)
button.layer.cornerRadius = kCornerRadius3
button.clipsToBounds = true
button.addTarget(self, action: #selector(clickNextBtn), for: .touchUpInside)
button.backgroundColor = UIColor.brandMainColor
return button
}()
lazy var bottomView: UIView = {
let view = UIView()
view.backgroundColor = .white
view.addSubview(self.rewardBtn)
self.rewardBtn.snp.makeConstraints { make in
make.top.equalToSuperview().offset(10)
make.left.equalTo(kMargin)
make.right.equalTo(-kMargin)
make.height.equalTo(44)
}
view.layer.zPosition = 10
return view
}()
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
loadData()
}
@objc func clickNextBtn() {
}
}
private extension YHResignUploadDocListViewController {
func loadData() {
let params: [String : Any] = ["order_id": orderId]
YHHUD.show(.progress(message: "加载中..."))
viewModel.getTravelDocsList(param: params){ success, error in
YHHUD.hide()
if success {
} else {
// let msg = error?.errorMsg ?? "获取数据出错"
// YHHUD.flash(message: msg)
// DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
// self.navigationController?.popViewController()
// }
}
self.tableView.reloadData()
}
}
func setupUI() {
gk_navTitle = "续签补件"
view.backgroundColor = UIColor.contentBkgColor
bgImageView = {
let imageView = UIImageView()
imageView.image = UIImage(named: "resign_upload_doc_head")
return imageView
}()
view.addSubview(bgImageView)
bgImageView.snp.makeConstraints { make in
make.left.right.top.equalToSuperview()
make.height.equalTo(375.fix)
}
titleLabel = {
let label = UILabel()
label.numberOfLines = 0
let a = ASAttributedString.init("您申请的【优才入境计划】续签,", .font(UIFont.PFSC_M(ofSize:17)), .foreground(UIColor.mainTextColor50))
let b = ASAttributedString.init("港澳通行证逗留(D)签注延期-办理指引", .font(UIFont.PFSC_M(ofSize:17)),.foreground(UIColor.yhOrangeColor))
label.attributed.text = a+b
return label
}()
view.addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.left.equalTo(20)
make.right.equalTo(-20)
make.height.equalTo(60)
make.top.equalTo(k_Height_NavigationtBarAndStatuBar + 24)
}
messageLabel = {
let label = UILabel()
label.numberOfLines = 0
let a = ASAttributedString.init("请您于", .font(UIFont.PFSC_M(ofSize:14)), .foreground(UIColor.mainTextColor50))
let b = ASAttributedString.init("2024年8月8日前", .font(UIFont.PFSC_M(ofSize:14)),.foreground(UIColor.brandMainColor))
let c = ASAttributedString.init("根据补件清单上传资料递交至港府;如无及时递交,可能导致身份失效!", .font(UIFont.PFSC_M(ofSize:14)), .foreground(UIColor.mainTextColor50))
label.attributed.text = a+b+c
return label
}()
view.addSubview(messageLabel)
messageLabel.snp.makeConstraints { make in
make.left.equalTo(20)
make.right.equalTo(-20)
make.height.equalTo(44)
make.top.equalTo(k_Height_NavigationtBarAndStatuBar + 84)
}
view.addSubview(bottomView)
bottomView.snp.makeConstraints { make in
make.left.equalToSuperview()
make.right.equalToSuperview()
make.height.equalTo(98)
make.bottom.equalToSuperview()
}
view.addSubview(tableView)
tableView.snp.makeConstraints { make in
make.left.equalToSuperview()
make.right.equalToSuperview()
make.top.equalTo(k_Height_NavigationtBarAndStatuBar + 160)
make.bottom.equalTo(-98)
}
}
}
extension YHResignUploadDocListViewController: UITableViewDelegate, UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return 2
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 1
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let approveCell = tableView.dequeueReusableCell(withIdentifier: YHResignUploadDocListCell.cellReuseIdentifier, for: indexPath) as! YHResignUploadDocListCell
return approveCell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return YHTravelDocsPreparationListCell.cellH
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
}
private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat {
return 16.0
}
private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat {
return 0.01
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
let view = UIView()
return view
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
let view = UIView()
return view
}
}
//
// YHFileExplainReasonInputView.swift
// galaxy
//
// Created by EDY on 2024/10/10.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHFileExplainReasonInputView: UIView {
static let height = 294.0
var maxWordsCount = 50
var editBlock:((String?)->Void)?
var dismissBlock:(()->())?
lazy var blackMaskView: UIView = {
let view = UIView(frame:UIScreen.main.bounds)
view.backgroundColor = UIColor(hex: 0x0F1214, alpha: 0.5)
let tap = UITapGestureRecognizer(target: self, action: #selector(dismiss))
view.addGestureRecognizer(tap)
return view
}()
lazy var whiteContentView: UIView = {
let view = UIView()
view.backgroundColor = .white
let tap = UITapGestureRecognizer(target: self, action: #selector(didWhiteContentViewTap))
view.addGestureRecognizer(tap)
return view
}()
lazy var titleLabel: UILabel = {
let label = UILabel()
label.textColor = UIColor.mainTextColor
label.textAlignment = .center
label.font = UIFont.PFSC_B(ofSize:17)
label.text = "文件重命名"
return label
}()
lazy var closeBtn: UIButton = {
let btn = UIButton()
btn.setImage(UIImage(named:"my_cer_sheet_close"), for: .normal)
btn.addTarget(self, action: #selector(dismiss), for: .touchUpInside)
return btn
}()
lazy var topLine:UIView = {
let view = UIView()
view.backgroundColor = .separatorColor
return view
}()
lazy var inputContentView: UIView = {
let view = UIView()
view.backgroundColor = .contentBkgColor
view.layer.cornerRadius = kCornerRadius6
view.clipsToBounds = true
return view
}()
lazy var textField: UITextView = {
let textField = UITextView()
textField.backgroundColor = .clear
textField.font = UIFont.PFSC_M(ofSize: 16)
textField.tintColor = UIColor.brandMainColor
textField.textColor = UIColor.mainTextColor
textField.delegate = self
textField.returnKeyType = .done
return textField
}()
lazy var cancelBtn:UIButton = {
let btn = UIButton()
btn.setTitle("取消", for: .normal)
btn.titleLabel?.font = UIFont.PFSC_M(ofSize: 14)
btn.setTitleColor(UIColor.mainTextColor, for: .normal)
btn.backgroundColor = .contentBkgColor
btn.layer.cornerRadius = kCornerRadius3
btn.addTarget(self, action: #selector(didClickCancelBtn), for: .touchUpInside)
return btn
}()
lazy var confirmBtn:UIButton = {
let btn = UIButton()
btn.setTitle("确定".local, for: .normal)
btn.titleLabel?.font = UIFont.PFSC_M(ofSize: 14)
btn.setTitleColor(.white, for: .normal)
btn.backgroundColor = UIColor.brandMainColor
btn.layer.cornerRadius = kCornerRadius3
btn.addTarget(self, action: #selector(didClickConfirmBtn), for: .touchUpInside)
return btn
}()
override init(frame: CGRect) {
super.init(frame:frame)
createUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
static func inputView(defalutText:String?,_ placeholde: String = "请输入文件名称", _ title: String = "文件重命名")-> YHFileExplainReasonInputView {
let view = YHFileExplainReasonInputView(frame:CGRect(x: 0, y: 0, width:KScreenWidth, height:Self.height))
view.textField.text = defalutText
view.titleLabel.text = title
return view
}
func createUI() {
self.addSubview(whiteContentView)
whiteContentView.addSubview(titleLabel)
whiteContentView.addSubview(closeBtn)
whiteContentView.addSubview(topLine)
whiteContentView.addSubview(inputContentView)
inputContentView.addSubview(textField)
whiteContentView.addSubview(cancelBtn)
whiteContentView.addSubview(confirmBtn)
let corner = UIRectCorner(rawValue: UIRectCorner.topLeft.rawValue | UIRectCorner.topRight.rawValue)
let path = UIBezierPath(roundedRect:bounds,byRoundingCorners: corner,cornerRadii:CGSizeMake(kCornerRadius6, kCornerRadius6));
let layer = CAShapeLayer();
layer.frame = whiteContentView.bounds;
layer.path = path.cgPath;
whiteContentView.layer.mask = layer;
whiteContentView.snp.makeConstraints { make in
make.left.right.top.bottom.equalToSuperview()
}
titleLabel.snp.makeConstraints { make in
make.left.right.top.equalToSuperview()
make.height.equalTo(52.0)
}
closeBtn.snp.makeConstraints { make in
make.width.height.equalTo(24.0)
make.right.equalToSuperview().offset(-20)
make.centerY.equalTo(titleLabel)
}
topLine.snp.makeConstraints { make in
make.left.equalToSuperview().offset(20)
make.right.equalToSuperview().offset(-20)
make.top.equalTo(titleLabel.snp.bottom)
make.height.equalTo(1)
}
inputContentView.snp.makeConstraints { make in
make.left.equalToSuperview().offset(20)
make.right.equalToSuperview().offset(-20)
make.top.equalTo(topLine.snp.bottom).offset(20)
make.height.equalTo(48)
}
textField.snp.makeConstraints { make in
make.left.equalToSuperview().offset(16)
make.right.equalToSuperview().offset(-16)
make.height.equalTo(20)
make.centerY.equalToSuperview()
}
cancelBtn.snp.makeConstraints { make in
make.left.equalToSuperview().offset(16)
make.right.equalTo(whiteContentView.snp.centerX).offset(-6)
make.top.equalTo(inputContentView.snp.bottom).offset(30)
make.height.equalTo(45)
}
confirmBtn.snp.makeConstraints { make in
make.right.equalToSuperview().offset(-16)
make.left.equalTo(whiteContentView.snp.centerX).offset(6)
make.top.equalTo(cancelBtn)
make.height.equalTo(45)
}
}
}
extension YHFileExplainReasonInputView {
@objc func dismiss() {
self.textField.resignFirstResponder()
UIApplication.shared.yhKeyWindow()?.endEditing(true)
self.dismissBlock?()
}
@objc func didWhiteContentViewTap() {
self.textField.becomeFirstResponder()
}
@objc func didClickCancelBtn() {
dismiss()
}
@objc func didClickConfirmBtn() {
if isEmptyString(textField.text) {
YHHUD.flash(message: "重命名不可为空")
return
}
if let editBlock = editBlock {
editBlock(textField.text)
}
dismiss()
}
}
extension YHFileExplainReasonInputView: UITextViewDelegate {
}
//
// YHResignUploadDocListCell.swift
// galaxy
//
// Created by EDY on 2024/10/10.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHResignUploadDocListCell: UITableViewCell {
static let cellReuseIdentifier = "YHResignUploadDocListCell"
typealias ExperienceListBlock = (_ model: YHAdopterDependentModel) -> ()
var clickBlock: ExperienceListBlock?
var centerView: UIView!
var titleLabel: UILabel!
var mainItemView: UIView!
var lineView: UIView!
var dataSource: [YHAdopterDependentModel]? {
didSet {
updateAllViews()
}
}
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
selectionStyle = .none
setupUI()
}
func setupUI() {
backgroundColor = .clear
centerView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = kCornerRadius6
return view
}()
contentView.addSubview(centerView)
centerView.snp.makeConstraints { make in
make.left.equalTo(16)
make.right.equalTo(-16)
make.top.equalTo(14)
make.bottom.equalTo(-7)
}
titleLabel = {
let label = UILabel()
label.font = UIFont.PFSC_M(ofSize: 17)
label.text = "新增受养人"
label.textColor = UIColor.mainTextColor
return label
}()
centerView.addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(23)
make.height.equalTo(24)
make.right.equalTo(-20)
}
lineView = {
let view = UIView()
view.backgroundColor = UIColor.separatorColor
return view
}()
centerView.addSubview(lineView)
lineView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalTo(62.5)
make.height.equalTo(0.5)
}
mainItemView = {
let view = UIView()
view.backgroundColor = .white
view.layer.cornerRadius = kCornerRadius6
return view
}()
centerView.addSubview(mainItemView)
mainItemView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.bottom.equalTo(-63)
make.top.equalTo(63)
}
}
func updateAllViews() {
mainItemView.removeSubviews()
guard let dataSource = dataSource else {
return
}
var total = 0
for i in 0 ..< dataSource.count {
if i != 0 {
let line = UIView()
line.backgroundColor = UIColor.separatorColor
mainItemView.addSubview(line)
line.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(total)
make.height.equalTo(0.5)
make.right.equalTo(-18)
}
}
total = total + 1
let itemView = YHResignUploadDocItemView()
itemView.clickBlock = {[weak self] model in
guard let self = self else { return }
if let block = self.clickBlock {
block(model)
}
}
let model = dataSource[i]
itemView.tag = 4000 + i
itemView.dataSource = dataSource[i]
mainItemView.addSubview(itemView)
itemView.snp.makeConstraints { make in
make.left.equalTo(18)
make.top.equalTo(total)
make.height.equalTo(51)
make.right.equalTo(-18)
}
total = total + 51
}
}
}
class YHResignUploadDocItemView: UIView {
typealias ItemBlock = (_ model: YHAdopterDependentModel) -> ()
var clickBlock: ItemBlock?
var deleteBlock: ItemBlock?
var titleLabel: UILabel!
var explainLabel: UILabel!
var nextStepImageView: UIImageView!
var centerButton: UIButton!
var dataSource: YHAdopterDependentModel? {
didSet {
updateAllViews()
}
}
override init(frame: CGRect) {
super.init(frame: frame)
backgroundColor = .white
setUpView()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func setUpView() {
titleLabel = {
let label = UILabel()
label.font = UIFont.PFSC_B(ofSize: 14)
label.textAlignment = .left
label.numberOfLines = 2
label.textColor = UIColor.mainTextColor
return label
}()
addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.left.top.bottom.equalToSuperview()
make.right.equalTo(-30)
}
explainLabel = {
let label = UILabel()
label.font = UIFont.PFSC_R(ofSize: 14)
label.textAlignment = .right
label.textColor = UIColor.labelTextColor2
return label
}()
addSubview(explainLabel)
explainLabel.snp.makeConstraints { make in
make.right.equalTo(-24)
make.left.equalToSuperview()
make.height.equalTo(20)
make.centerY.equalToSuperview()
}
nextStepImageView = {
let imageView = UIImageView()
imageView.image = UIImage(named: "form_right_arrow")
return imageView
}()
addSubview(nextStepImageView)
nextStepImageView.snp.makeConstraints { make in
make.right.equalToSuperview()
make.centerY.equalTo(explainLabel.snp.centerY)
make.height.width.equalTo(20)
}
centerButton = {
let button = UIButton(type: .custom)
button.addTarget(self, action: #selector(centerClick), for: .touchUpInside)
return button
}()
addSubview(centerButton)
centerButton.snp.makeConstraints { make in
make.right.top.bottom.equalToSuperview()
make.left.equalTo(112)
}
}
func updateAllViews() {
guard let dataSource = dataSource else { return }
var spouse = "子女"
if dataSource.is_spouse == 1 {
spouse = "配偶"
}
if dataSource.dep_name.count != 0 {
titleLabel.text = spouse + "(\(dataSource.dep_name))"
} else {
titleLabel.text = spouse
}
if dataSource.status == 0 {
explainLabel.text = "待上传"
explainLabel.textColor = UIColor.brandMainColor
nextStepImageView.image = UIImage(named: "service_adopter_income_start")
}
if dataSource.status == 1 {
explainLabel.text = "审核中"
explainLabel.textColor = UIColor(hex: 0xff8000)
nextStepImageView.image = UIImage(named: "service_adopter_income_wait")
}
if dataSource.status == 2 {
explainLabel.text = "已驳回"
explainLabel.textColor = UIColor.failColor
nextStepImageView.image = UIImage(named: "service_adopter_income_fail")
}
if dataSource.status == 3 {
explainLabel.text = "已完成"
explainLabel.textColor = UIColor(hex: 0x3cc694)
nextStepImageView.image = UIImage(named: "service_adopter_income_success")
}
}
func updateDocAllViews() {
guard let dataSource = dataSource else { return }
if dataSource.status == 0 {
explainLabel.text = "待确认"// “待签字”
explainLabel.textColor = UIColor.brandMainColor
nextStepImageView.image = UIImage(named: "service_adopter_income_start")
}
if dataSource.status == 1 {
explainLabel.text = "写作中"// 定稿中 审核中
explainLabel.textColor = UIColor(hex: 0xff8000)
nextStepImageView.image = UIImage(named: "service_adopter_income_wait")
}
if dataSource.status == 2 {
explainLabel.text = "已驳回"
explainLabel.textColor = UIColor.failColor
nextStepImageView.image = UIImage(named: "service_adopter_income_fail")
}
if dataSource.status == 3 {
explainLabel.text = "已完成"
explainLabel.textColor = UIColor(hex: 0x3cc694)
nextStepImageView.image = UIImage(named: "service_adopter_income_success")
}
}
@objc func centerClick() {
if let block = clickBlock {
block(self.dataSource ?? YHAdopterDependentModel())
}
}
}
//
// YHResignUploadSuccessDocListCell.swift
// galaxy
//
// Created by EDY on 2024/10/10.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHResignUploadSuccessDocListCell: UITableViewCell {
static let cellReuseIdentifier = "YHResignUploadSuccessDocListCell"
typealias ExperienceListBlock = (_ model: YHWorkExperienceFileModel, _ type: YHWorkFileClickType) -> ()
var experienceListBlock: ExperienceListBlock?
var mainItemView: UIView!
var dataSource: [YHWorkExperienceFileModel]?{
didSet {
updateAllViews()
}
}
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
selectionStyle = .none
setupUI()
}
func setupUI() {
backgroundColor = .clear
mainItemView = {
let view = UIView()
view.backgroundColor = .white
return view
}()
contentView.addSubview(mainItemView)
mainItemView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.bottom.equalToSuperview()
make.top.equalTo(16)
}
}
func updateAllViews() {
mainItemView.removeSubviews()
for i in 0 ..< (dataSource?.count ?? 0) {
let itemView = YHResignUploadFileItemView()
itemView.dataSource = dataSource?[i]
itemView.block = {[weak self] model, type in
guard let self = self else { return }
if let block = self.experienceListBlock {
block(model, type)
}
}
mainItemView.addSubview(itemView)
itemView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalTo(55 * i)
make.height.equalTo(55)
}
}
}
}
class YHResignUploadFileItemView: UIView {
typealias ItemBlock = (_ model: YHWorkExperienceFileModel, _ type: YHWorkFileClickType) -> ()
var block: ItemBlock?
var whiteView: UIButton!
var iconImgV: UIImageView!
var nameLabel: UILabel!
var timeLabel: UILabel!
var editBtn: UIButton!
var dataSource: YHWorkExperienceFileModel? {
didSet {
updateAllViews()
}
}
override init(frame: CGRect) {
super.init(frame: frame)
backgroundColor = .white
setUpView()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func setUpView() {
whiteView = UIButton()
whiteView.addTarget(self, action: #selector(itemClick), for: .touchUpInside)
addSubview(whiteView)
iconImgV = UIImageView(image:UIImage(named:"my_cer_type_jpg"))
whiteView.addSubview(iconImgV)
nameLabel = UILabel()
nameLabel.textColor = UIColor.mainTextColor
nameLabel.textAlignment = .left
nameLabel.numberOfLines = 0
nameLabel.font = UIFont.PFSC_M(ofSize:14)
whiteView.addSubview(nameLabel)
timeLabel = UILabel()
timeLabel.textColor = UIColor.labelTextColor2
timeLabel.textAlignment = .left
timeLabel.font = UIFont.PFSC_R(ofSize:11)
whiteView.addSubview(timeLabel)
editBtn = UIButton()
editBtn.setImage(UIImage(named:"my_cer_btn_edit"), for:.normal)
editBtn.setTitle("查看", for: .normal)
editBtn.setTitleColor(UIColor.mainTextColor, for: .normal)
editBtn.setBackgroundColor(color: UIColor(hex: 0xf4f6fa), forState: .normal)
editBtn.YH_clickEdgeInsets = UIEdgeInsets(top: 30, left: 30, bottom: 30, right: 30)
editBtn.addTarget(self, action: #selector(deleteClick), for: .touchUpInside)
editBtn.layer.cornerRadius = 10
whiteView.addSubview(editBtn)
whiteView.snp.makeConstraints { make in
make.left.equalTo(18)
make.right.equalTo(-18)
make.centerY.equalToSuperview()
make.height.equalTo(55)
}
iconImgV.snp.makeConstraints { make in
make.width.height.equalTo(31)
make.centerY.equalToSuperview()
make.left.equalToSuperview().offset(6)
}
nameLabel.snp.makeConstraints { make in
make.left.equalTo(iconImgV.snp.right).offset(18)
make.top.equalToSuperview().offset(7)
make.right.equalTo(editBtn.snp.left)
}
timeLabel.snp.makeConstraints { make in
make.left.right.equalTo(nameLabel)
make.top.equalTo(nameLabel.snp.bottom).offset(2)
make.bottom.equalToSuperview().offset(-7)
make.height.equalTo(20)
}
editBtn.snp.makeConstraints { make in
make.width.equalTo(38)
make.height.equalTo(20)
make.centerY.equalToSuperview()
make.right.equalToSuperview()
}
}
func updateAllViews() {
guard let dataSource = dataSource else { return }
nameLabel.text = dataSource.fileName
timeLabel.text = "上传于\(dataSource.uploadedAt)"
let suffix = dataSource.fileUrl.pathExtension.lowercased()
var iconImgName = ""
if suffix == "jpeg" {
iconImgName = "my_cer_type_jpg"
} else if suffix == "jpg" {
iconImgName = "my_cer_type_jpg"
} else if suffix == "png" {
iconImgName = "my_cer_type_png"
} else if suffix == "pdf" {
iconImgName = "my_cer_type_pdf"
} else if suffix == "doc" || suffix == "docx" {
iconImgName = "my_cer_type_word"
} else if suffix == "ppt" || suffix == "pptx" {
iconImgName = "my_cer_type_ppt"
} else if suffix == "bmp" {
iconImgName = "my_cer_type_bmp"
} else if suffix == "tiff" {
iconImgName = "my_cer_type_tiff"
} else if suffix == "xls" || suffix == "xlsx" {
iconImgName = "my_cer_type_excel"
}
iconImgV.image = UIImage(named: iconImgName)
}
@objc func itemClick() {
if let block = block, let dataSource = dataSource {
block(dataSource, .click)
}
}
@objc func deleteClick() {
if let block = block, let dataSource = dataSource {
block(dataSource, .click)
}
}
}
......@@ -67,8 +67,11 @@ extension YHResignUploadTravelCardFootViewController {
}
@objc func click() {
YHHUD.flash(message: "跳转链接")
let vc = YHH5WebViewVC()
vc.url = "https://www.ctshk.com/mep/zh/"
vc.isShowRightShareItemFlag = false
vc.isFullScreenFlag = false
UIViewController.current?.navigationController?.pushViewController(vc)
}
}
......
......@@ -67,17 +67,19 @@ class YHResignUploadTravelGuideView: UIView {
lazy var bkgImageV: UIImageView = {
let imageV = UIImageView()
imageV.image = UIImage(named: "official_approval_guideline")
imageV.image = UIImage(named: "resign_upload_guideline")
imageV.contentMode = .scaleToFill
imageV.isUserInteractionEnabled = true
imageV.clipsToBounds = true
return imageV
}()
lazy var bkgImageV2: UIImageView = {
let imageV = UIImageView()
imageV.image = UIImage(named: "official_approval_guideline_bkg")
imageV.image = UIImage(named: "resign_upload_guideline_bkg")
imageV.contentMode = .scaleToFill
imageV.clipsToBounds = true
imageV.isUserInteractionEnabled = true
return imageV
}()
......@@ -132,6 +134,17 @@ extension YHResignUploadTravelGuideView {
self.block?()
dismiss()
}
@objc func clicklinkBtn() {
// self.block?()
dismiss()
let vc = YHH5WebViewVC()
vc.url = "https://www.ctshk.com/mep/zh/"
vc.isShowRightShareItemFlag = false
vc.isFullScreenFlag = false
UIViewController.current?.navigationController?.pushViewController(vc)
}
}
private extension YHResignUploadTravelGuideView {
......@@ -199,7 +212,7 @@ private extension YHResignUploadTravelGuideView {
whiteContentView.addSubview(bkgImageV2)
bkgImageV2.snp.makeConstraints { make in
make.top.left.right.equalToSuperview()
make.height.equalTo(375)
make.height.equalTo(269.fix)
}
whiteContentView.addSubview(bottomView)
......@@ -216,18 +229,25 @@ private extension YHResignUploadTravelGuideView {
make.height.equalTo(whiteHeight-98 - 20)
}
if let tmpImage = UIImage(named:"official_approval_guideline") {
let scale = Double(tmpImage.size.height / tmpImage.size.width)
let imageH = scale * KScreenWidth
if let tmpImage = UIImage(named:"resign_upload_guideline") {
myScrollView.addSubview(bkgImageV)
bkgImageV.snp.makeConstraints { make in
make.top.left.equalToSuperview()
make.width.equalTo(KScreenWidth)
make.height.equalTo(imageH)
make.top.equalToSuperview()
make.centerX.equalToSuperview()
make.width.equalTo(336.fix)
make.height.equalTo(1356.fix)
}
myScrollView.contentSize = CGSize(width: KScreenWidth, height: 1356.fix)
let button = UIButton(type: .custom)
button.addTarget(self, action: #selector(clicklinkBtn), for: .touchUpInside)
myScrollView.addSubview(button)
button.snp.makeConstraints { make in
make.left.equalTo(44)
make.height.equalTo(40)
make.width.equalTo(255.fix)
make.top.equalTo(756.fix)
}
myScrollView.contentSize = CGSize(width: KScreenWidth, height: imageH)
}
let button = UIButton(type: .custom)
......
......@@ -170,6 +170,36 @@ extension YHServiceOrderProgressTableViewCell {
titleLabel.text = "续签文书管理"
messageLabel.text = "请确认您的续签文书内容并完成签字~"
}
if model.type == 33 {
titleLabel.text = "续签信息确认"
messageLabel.text = "请确认家庭续签信息是否有变更~"
}
if model.type == 34 {
titleLabel.text = "在港递交预约"
messageLabel.text = "请预约在港递交续签时间&确认在港时间~"
}
if model.type == 35 {
titleLabel.text = "查看续签结果"
messageLabel.text = "请查看递交凭证&续签结果~"
}
if model.type == 36 {
titleLabel.text = "续签补件"
messageLabel.text = "请尽快补件~"
}
if model.type == 37 {
titleLabel.text = "续签签证缴费"
messageLabel.text = "请根据指引缴费并领取新电子签证~"
}
if model.type == 38 {
titleLabel.text = "上传旅行证件"
messageLabel.text = "请上传&核对续签旅行证件~"
}
}
if model.status == 2 {
titleLabel.textColor = UIColor.mainTextColor
......@@ -386,6 +416,48 @@ extension YHServiceOrderProgressTableViewCell {
buttonLabel.text = "去确认"
messageLabel.textColor = UIColor.mainTextColor50
}
if model.type == 33 {
titleLabel.text = "续签信息确认"
messageLabel.text = "请确认家庭续签信息是否有变更~"
buttonLabel.text = "去查看"
messageLabel.textColor = UIColor.mainTextColor50
}
if model.type == 34 {
titleLabel.text = "在港递交预约"
messageLabel.text = "请预约在港递交续签时间&确认在港时间~"
buttonLabel.text = "去查看"
messageLabel.textColor = UIColor.mainTextColor50
}
if model.type == 35 {
titleLabel.text = "查看续签结果"
messageLabel.text = "请查看递交凭证&续签结果~"
buttonLabel.text = "去查看"
messageLabel.textColor = UIColor.mainTextColor50
}
if model.type == 36 {
titleLabel.text = "续签补件"
messageLabel.text = "请尽快补件~"
buttonLabel.text = "去查看"
messageLabel.textColor = UIColor.mainTextColor50
}
if model.type == 37 {
titleLabel.text = "续签签证缴费"
messageLabel.text = "请根据指引缴费并领取新电子签证~"
buttonLabel.text = "去查看"
messageLabel.textColor = UIColor.mainTextColor50
}
if model.type == 38 {
titleLabel.text = "上传旅行证件"
messageLabel.text = "请上传&核对续签旅行证件~"
buttonLabel.text = "去查看"
messageLabel.textColor = UIColor.mainTextColor50
}
}
if model.status == 3 {
titleLabel.textColor = UIColor.mainTextColor
......@@ -467,6 +539,43 @@ extension YHServiceOrderProgressTableViewCell {
messageLabel.text = "请确认您的续签文书内容并完成签字~"
buttonLabel.text = "已完成"
}
if model.type == 33 {
titleLabel.text = "续签信息确认"
messageLabel.text = "请确认家庭续签信息是否有变更~"
buttonLabel.text = "去查看"
}
if model.type == 34 {
titleLabel.text = "在港递交预约"
messageLabel.text = "请预约在港递交续签时间&确认在港时间~"
buttonLabel.text = "去查看"
}
if model.type == 35 {
titleLabel.text = "查看续签结果"
messageLabel.text = "请查看递交凭证&续签结果~"
buttonLabel.text = "去查看"
}
if model.type == 36 {
titleLabel.text = "续签补件"
messageLabel.text = "恭喜您,已完成补件~"
buttonLabel.text = "已完成"
}
if model.type == 37 {
titleLabel.text = "续签签证缴费"
messageLabel.text = "请根据指引缴费并领取新电子签证~"
buttonLabel.text = "去查看"
}
if model.type == 38 {
titleLabel.text = "上传旅行证件"
messageLabel.text = "请上传&核对续签旅行证件~"
buttonLabel.text = "去查看"
}
let b: ASAttributedString = .init(NSAttributedString(string: "\(model.percentage)"), .font(UIFont(name: "DINAlternate-Bold", size: 24)!),.foreground(UIColor.mainTextColor))
let bb: ASAttributedString = .init("%", .font(UIFont.PFSC_M(ofSize: 10)),.foreground(UIColor.mainTextColor.withAlphaComponent(0.3)))
progressLabel.attributed.text = b + bb
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "resign_upload_doc_head@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "resign_upload_doc_head@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "resign_upload_guideline@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "resign_upload_guideline@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "resign_upload_guideline_bkg@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "resign_upload_guideline_bkg@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