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

续签补件 伪逻辑

parent 9717c59d
...@@ -269,6 +269,9 @@ ...@@ -269,6 +269,9 @@
045792172CBD046E00EBD99B /* YHResignUploadTravelPassportTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045792162CBD046E00EBD99B /* YHResignUploadTravelPassportTableViewCell.swift */; }; 045792172CBD046E00EBD99B /* YHResignUploadTravelPassportTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045792162CBD046E00EBD99B /* YHResignUploadTravelPassportTableViewCell.swift */; };
045792192CBE08BA00EBD99B /* YHLookResignResultViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045792182CBE08BA00EBD99B /* YHLookResignResultViewModel.swift */; }; 045792192CBE08BA00EBD99B /* YHLookResignResultViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045792182CBE08BA00EBD99B /* YHLookResignResultViewModel.swift */; };
0457921B2CBE0C3F00EBD99B /* YHLookResignResultModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0457921A2CBE0C3F00EBD99B /* YHLookResignResultModel.swift */; }; 0457921B2CBE0C3F00EBD99B /* YHLookResignResultModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0457921A2CBE0C3F00EBD99B /* YHLookResignResultModel.swift */; };
0457921D2CBF626000EBD99B /* YHResignUploadDetailViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0457921C2CBF626000EBD99B /* YHResignUploadDetailViewModel.swift */; };
0457921F2CBF62F300EBD99B /* YHResignUploadDetailModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0457921E2CBF62F300EBD99B /* YHResignUploadDetailModel.swift */; };
045792212CBF8B3900EBD99B /* YHResignUploadDetailFileNameCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045792202CBF8B3900EBD99B /* YHResignUploadDetailFileNameCell.swift */; };
045A08C02C37ABF500BCBABA /* YHSegmentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045A08BF2C37ABF500BCBABA /* YHSegmentView.swift */; }; 045A08C02C37ABF500BCBABA /* YHSegmentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045A08BF2C37ABF500BCBABA /* YHSegmentView.swift */; };
045A08C22C37EB8B00BCBABA /* YHMyFileListNoneCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045A08C12C37EB8B00BCBABA /* YHMyFileListNoneCell.swift */; }; 045A08C22C37EB8B00BCBABA /* YHMyFileListNoneCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045A08C12C37EB8B00BCBABA /* YHMyFileListNoneCell.swift */; };
045A7E672C2ACB1A008F995B /* YHLoginOneLeadView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045A7E662C2ACB1A008F995B /* YHLoginOneLeadView.swift */; }; 045A7E672C2ACB1A008F995B /* YHLoginOneLeadView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045A7E662C2ACB1A008F995B /* YHLoginOneLeadView.swift */; };
...@@ -1223,6 +1226,9 @@ ...@@ -1223,6 +1226,9 @@
045792162CBD046E00EBD99B /* YHResignUploadTravelPassportTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHResignUploadTravelPassportTableViewCell.swift; sourceTree = "<group>"; }; 045792162CBD046E00EBD99B /* YHResignUploadTravelPassportTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHResignUploadTravelPassportTableViewCell.swift; sourceTree = "<group>"; };
045792182CBE08BA00EBD99B /* YHLookResignResultViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHLookResignResultViewModel.swift; sourceTree = "<group>"; }; 045792182CBE08BA00EBD99B /* YHLookResignResultViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHLookResignResultViewModel.swift; sourceTree = "<group>"; };
0457921A2CBE0C3F00EBD99B /* YHLookResignResultModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHLookResignResultModel.swift; sourceTree = "<group>"; }; 0457921A2CBE0C3F00EBD99B /* YHLookResignResultModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHLookResignResultModel.swift; sourceTree = "<group>"; };
0457921C2CBF626000EBD99B /* YHResignUploadDetailViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHResignUploadDetailViewModel.swift; sourceTree = "<group>"; };
0457921E2CBF62F300EBD99B /* YHResignUploadDetailModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHResignUploadDetailModel.swift; sourceTree = "<group>"; };
045792202CBF8B3900EBD99B /* YHResignUploadDetailFileNameCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHResignUploadDetailFileNameCell.swift; sourceTree = "<group>"; };
045A08BF2C37ABF500BCBABA /* YHSegmentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSegmentView.swift; sourceTree = "<group>"; }; 045A08BF2C37ABF500BCBABA /* YHSegmentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSegmentView.swift; sourceTree = "<group>"; };
045A08C12C37EB8B00BCBABA /* YHMyFileListNoneCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMyFileListNoneCell.swift; sourceTree = "<group>"; }; 045A08C12C37EB8B00BCBABA /* YHMyFileListNoneCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMyFileListNoneCell.swift; sourceTree = "<group>"; };
045A7E662C2ACB1A008F995B /* YHLoginOneLeadView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHLoginOneLeadView.swift; sourceTree = "<group>"; }; 045A7E662C2ACB1A008F995B /* YHLoginOneLeadView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHLoginOneLeadView.swift; sourceTree = "<group>"; };
...@@ -3898,6 +3904,7 @@ ...@@ -3898,6 +3904,7 @@
04CA2BFC2CB7C36D00F36DE7 /* YHResignUploadDocListCell.swift */, 04CA2BFC2CB7C36D00F36DE7 /* YHResignUploadDocListCell.swift */,
04CA2BFE2CB7C9A000F36DE7 /* YHResignUploadSuccessDocListCell.swift */, 04CA2BFE2CB7C9A000F36DE7 /* YHResignUploadSuccessDocListCell.swift */,
04CA2C022CB7D3C200F36DE7 /* YHFileExplainReasonInputView.swift */, 04CA2C022CB7D3C200F36DE7 /* YHFileExplainReasonInputView.swift */,
045792202CBF8B3900EBD99B /* YHResignUploadDetailFileNameCell.swift */,
); );
path = V; path = V;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -3915,6 +3922,7 @@ ...@@ -3915,6 +3922,7 @@
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
04CA2C062CB8F9C800F36DE7 /* YHResignUploadDocListProgressModel.swift */, 04CA2C062CB8F9C800F36DE7 /* YHResignUploadDocListProgressModel.swift */,
0457921E2CBF62F300EBD99B /* YHResignUploadDetailModel.swift */,
); );
path = M; path = M;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -3923,6 +3931,7 @@ ...@@ -3923,6 +3931,7 @@
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
04CA2C042CB8F75700F36DE7 /* YHResignUploadDocListViewModel.swift */, 04CA2C042CB8F75700F36DE7 /* YHResignUploadDocListViewModel.swift */,
0457921C2CBF626000EBD99B /* YHResignUploadDetailViewModel.swift */,
); );
path = VM; path = VM;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -5460,6 +5469,7 @@ ...@@ -5460,6 +5469,7 @@
044D0BFC2C21635B00C5CF5E /* YHInformationAuthorizationStepOneViewController.swift in Sources */, 044D0BFC2C21635B00C5CF5E /* YHInformationAuthorizationStepOneViewController.swift in Sources */,
045EEEBF2B9F171A0022A143 /* YHWorkFileItemView.swift in Sources */, 045EEEBF2B9F171A0022A143 /* YHWorkFileItemView.swift in Sources */,
04AF58C42B4FC51C0066011A /* YHLocalizable.swift in Sources */, 04AF58C42B4FC51C0066011A /* YHLocalizable.swift in Sources */,
0457921F2CBF62F300EBD99B /* YHResignUploadDetailModel.swift in Sources */,
04F4A5282CB8D4270026D469 /* YHResignAppointScheduleListViewController.swift in Sources */, 04F4A5282CB8D4270026D469 /* YHResignAppointScheduleListViewController.swift in Sources */,
A598E9E22C7CB32D00F84739 /* YHTravelDocsPreparationListModel.swift in Sources */, A598E9E22C7CB32D00F84739 /* YHTravelDocsPreparationListModel.swift in Sources */,
A598E9D72C7C9EF300F84739 /* YHTravelDocsPreparationListViewController.swift in Sources */, A598E9D72C7C9EF300F84739 /* YHTravelDocsPreparationListViewController.swift in Sources */,
...@@ -5963,6 +5973,7 @@ ...@@ -5963,6 +5973,7 @@
04CE1AD12C2AD91F001CB80A /* YHActivityTravelModel.swift in Sources */, 04CE1AD12C2AD91F001CB80A /* YHActivityTravelModel.swift in Sources */,
044D0C202C22D37500C5CF5E /* YHEditHonorViewController.swift in Sources */, 044D0C202C22D37500C5CF5E /* YHEditHonorViewController.swift in Sources */,
04256DEC2C732F6900A37BA4 /* YHGrabingNumberListView.swift in Sources */, 04256DEC2C732F6900A37BA4 /* YHGrabingNumberListView.swift in Sources */,
0457921D2CBF626000EBD99B /* YHResignUploadDetailViewModel.swift in Sources */,
045EEEAC2B9F171A0022A143 /* YHWorkExperienceTableViewCell.swift in Sources */, 045EEEAC2B9F171A0022A143 /* YHWorkExperienceTableViewCell.swift in Sources */,
A5765B2A2C77268C002CD3C1 /* YHRangeDatePickerSheetView.swift in Sources */, A5765B2A2C77268C002CD3C1 /* YHRangeDatePickerSheetView.swift in Sources */,
A5ACE93C2B4564F7002C94D2 /* UIColor+Extension.swift in Sources */, A5ACE93C2B4564F7002C94D2 /* UIColor+Extension.swift in Sources */,
...@@ -6026,6 +6037,7 @@ ...@@ -6026,6 +6037,7 @@
A5FD63C12B62616D00D1D9DA /* YHInformationPerfectModel.swift in Sources */, A5FD63C12B62616D00D1D9DA /* YHInformationPerfectModel.swift in Sources */,
044F395C2CB8D58A007CA277 /* YHVisaRenewalPayInfoBaseCell.swift in Sources */, 044F395C2CB8D58A007CA277 /* YHVisaRenewalPayInfoBaseCell.swift in Sources */,
A567E5A62BD7643D00D5D5A0 /* YHHomeSearchView.swift in Sources */, A567E5A62BD7643D00D5D5A0 /* YHHomeSearchView.swift in Sources */,
045792212CBF8B3900EBD99B /* YHResignUploadDetailFileNameCell.swift in Sources */,
045EEE912B9F171A0022A143 /* YHPreviewInfoCertificatePictureItemView.swift in Sources */, 045EEE912B9F171A0022A143 /* YHPreviewInfoCertificatePictureItemView.swift in Sources */,
04358E082C77657000811928 /* YHReAppointViewController.swift in Sources */, 04358E082C77657000811928 /* YHReAppointViewController.swift in Sources */,
044867B62BA1A03800DFAD4A /* YHCertificateFilterItemCell.swift in Sources */, 044867B62BA1A03800DFAD4A /* YHCertificateFilterItemCell.swift in Sources */,
......
...@@ -33,10 +33,7 @@ class YHResignUploadDocListViewController: YHBaseViewController { ...@@ -33,10 +33,7 @@ class YHResignUploadDocListViewController: YHBaseViewController {
tableView.dataSource = self tableView.dataSource = self
tableView.backgroundColor = .clear tableView.backgroundColor = .clear
tableView.register(YHResignUploadDocListCell.self, forCellReuseIdentifier: YHResignUploadDocListCell.cellReuseIdentifier) tableView.register(YHResignUploadDocListCell.self, forCellReuseIdentifier: YHResignUploadDocListCell.cellReuseIdentifier)
tableView.register(YHResignUploadSuccessDocListCell.self, forCellReuseIdentifier: YHResignUploadSuccessDocListCell.cellReuseIdentifier)
tableView.register(YHTravelDocsPreparationTipsCell.self, forCellReuseIdentifier: YHTravelDocsPreparationTipsCell.cellReuseIdentifier)
return tableView return tableView
}() }()
...@@ -87,14 +84,30 @@ class YHResignUploadDocListViewController: YHBaseViewController { ...@@ -87,14 +84,30 @@ class YHResignUploadDocListViewController: YHBaseViewController {
private extension YHResignUploadDocListViewController { private extension YHResignUploadDocListViewController {
func loadData() { func loadData() {
viewModel.getUploadDocProgress(orderID: orderId, stepID: batchId) {[weak self] success, err in
guard let self = self else { return }
viewModel.getUploadDocList(orderID: orderId, stepID: batchId) {[weak self] success, err in viewModel.getUploadDocList(orderID: orderId, stepID: batchId) {[weak self] success, err in
guard let self = self else { return } guard let self = self else { return }
self.tableView.reloadData() if self.viewModel.mainModel.supplement_voucher_url.count == 0 {
self.bottomView.isHidden = true
let a = ASAttributedString.init("请您于", .font(UIFont.PFSC_M(ofSize:14)), .foreground(UIColor.mainTextColor50))
let b = ASAttributedString.init("\(self.viewModel.mainModel.supplement_deadline)前", .font(UIFont.PFSC_M(ofSize:14)),.foreground(UIColor.brandMainColor))
let c = ASAttributedString.init("根据补件清单上传资料递交至港府;如无及时递交,可能导致身份失效!", .font(UIFont.PFSC_M(ofSize:14)), .foreground(UIColor.mainTextColor50))
messageLabel.attributed.text = a+b+c
} else {
let a = ASAttributedString.init("您申请的【优才入境计划】续签,", .font(UIFont.PFSC_M(ofSize:17)), .foreground(UIColor.mainTextColor50))
let b = ASAttributedString.init("补件资料已递交至港府!", .font(UIFont.PFSC_M(ofSize:17)),.foreground(UIColor.yhOrangeColor))
let c = ASAttributedString.init("请耐心等待港府审批~", .font(UIFont.PFSC_M(ofSize:17)), .foreground(UIColor.mainTextColor50))
titleLabel.attributed.text = a+b+c
self.bottomView.isHidden = false
self.messageLabel.isHidden = true
tableView.snp.remakeConstraints { make in
make.left.equalToSuperview()
make.right.equalToSuperview()
make.top.equalTo(k_Height_NavigationtBarAndStatuBar + 100)
make.bottom.equalTo(-98)
} }
} }
self.tableView.reloadData()
}
} }
func setupUI() { func setupUI() {
...@@ -155,9 +168,8 @@ private extension YHResignUploadDocListViewController { ...@@ -155,9 +168,8 @@ private extension YHResignUploadDocListViewController {
view.addSubview(tableView) view.addSubview(tableView)
tableView.snp.makeConstraints { make in tableView.snp.makeConstraints { make in
make.left.equalToSuperview() make.left.equalToSuperview()
make.right.equalToSuperview() make.bottom.right.equalToSuperview()
make.top.equalTo(k_Height_NavigationtBarAndStatuBar + 160) make.top.equalTo(k_Height_NavigationtBarAndStatuBar + 160)
make.bottom.equalTo(-98)
} }
} }
} }
...@@ -166,14 +178,18 @@ private extension YHResignUploadDocListViewController { ...@@ -166,14 +178,18 @@ private extension YHResignUploadDocListViewController {
extension YHResignUploadDocListViewController: UITableViewDelegate, UITableViewDataSource { extension YHResignUploadDocListViewController: UITableViewDelegate, UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int { func numberOfSections(in tableView: UITableView) -> Int {
if self.viewModel.mainModel.supplement_voucher_url.count == 0 {
return 2 return 2
} }
return 1
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 1 return 1
} }
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if self.viewModel.mainModel.supplement_voucher_url.count == 0 {
let approveCell = tableView.dequeueReusableCell(withIdentifier: YHResignUploadDocListCell.cellReuseIdentifier, for: indexPath) as! YHResignUploadDocListCell let approveCell = tableView.dequeueReusableCell(withIdentifier: YHResignUploadDocListCell.cellReuseIdentifier, for: indexPath) as! YHResignUploadDocListCell
approveCell.section = indexPath.section approveCell.section = indexPath.section
if indexPath.section == 0 { if indexPath.section == 0 {
...@@ -187,15 +203,33 @@ extension YHResignUploadDocListViewController: UITableViewDelegate, UITableViewD ...@@ -187,15 +203,33 @@ extension YHResignUploadDocListViewController: UITableViewDelegate, UITableViewD
guard let self = self else { return } guard let self = self else { return }
if section == 0 { if section == 0 {
// 跳转文件上传 // 跳转文件上传
let vc = YHResignUploadDocDetailViewController()
vc.id = model.id
self.navigationController?.pushViewController(vc)
} else { } else {
// 跳转列表 // 跳转列表
let vc = YHResignDocumentManagementVC(orderId: orderId, id: batchId)
self.navigationController?.pushViewController(vc)
} }
} }
return approveCell return approveCell
} else {
let approveCell = tableView.dequeueReusableCell(withIdentifier: YHResignUploadSuccessDocListCell.cellReuseIdentifier, for: indexPath) as! YHResignUploadSuccessDocListCell
approveCell.dataSource = [self.viewModel.mainModel.supplement_voucher_url]
return approveCell
} }
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return YHTravelDocsPreparationListCell.cellH if self.viewModel.mainModel.supplement_voucher_url.count == 0 {
if indexPath.section == 0 {
return CGFloat(52 * (self.viewModel.mainModel.upload_list.count + 1))
} else {
return CGFloat(52 * (self.viewModel.mainModel.doc_list.count + 1))
}
}
return 67
} }
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
......
//
// YHResignUploadDetailModel.swift
// galaxy
//
// Created by EDY on 2024/10/16.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import SmartCodable
class YHResignUploadDetailModel: SmartCodable {
var is_required : Bool = false //是否必需
var name : String = "" //文书名称
var status : Int = 0 //状态 0:审核中;1:已完成;2:已驳回;3:待上传
var description : String = ""
var template_list : [YHResignUploadDetailTemplateListModel] = []
var file_list : [YHResignUploadDetailFileListModel] = []
required init() {
}
}
class YHResignUploadDetailTemplateListModel: SmartCodable {
var name : String = ""
var url : String = ""
required init() {
}
}
class YHResignUploadDetailFileListModel: SmartCodable {
var name : String = ""
var url : String = ""
var uploadedAt : String = ""
required init() {
}
// 获取文件后缀名 eg:123.pdf -> pdf
func getFileSuffixName() -> String {
let res1 = url.pathExtension.lowercased()
if !res1.isEmpty {
return res1
}
let res2 = name.pathExtension.lowercased()
if !res2.isEmpty {
return res2
}
return ""
}
func getFileNameWithoutSuffix() -> String {
if name.isEmpty {
return name
}
if !name.contains(".") {
return name
}
if !name.pathExtension.isEmpty {
let fileName = (name as NSString).deletingPathExtension
return fileName
}
return ""
}
}
...@@ -9,15 +9,6 @@ ...@@ -9,15 +9,6 @@
import UIKit import UIKit
import SmartCodable import SmartCodable
class YHResignUploadDocListProgressModel: SmartCodable {
var progress : Int = -1 //电子签证有效期
var is_need_supplement : Bool = true
required init() {
}
}
class YHResignUploadDocListModel: SmartCodable { class YHResignUploadDocListModel: SmartCodable {
var supplement_voucher_url : String = "" var supplement_voucher_url : String = ""
var supplement_deadline : String = "" var supplement_deadline : String = ""
......
//
// YHResignUploadDetailFileNameCell.swift
// galaxy
//
// Created by EDY on 2024/10/16.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHResignUploadDetailFileNameCell: UITableViewCell {
static let cellReuseIdentifier = "YHResignUploadDetailFileNameCell"
var editBlock:((YHResignUploadDetailFileListModel)->())?
var whiteView: UIView!
var iconImgV: UIImageView!
var nameLabel: UILabel!
var timeLabel: UILabel!
var editBtn: UIButton!
var contentItem: YHResignUploadDetailFileListModel!
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setupUI()
}
func updateModel(_ model: YHResignUploadDetailFileListModel) {
contentItem = model
nameLabel.text = model.name
timeLabel.text = "上传于\(model.uploadedAt)"
let suffix = model.getFileSuffixName()
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 didEditBtnClicked() {
if let editBlock = editBlock {
editBlock(contentItem)
}
}
func setupUI() {
self.selectionStyle = .none
contentView.backgroundColor = .white
whiteView = UIView()
contentView.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.YH_clickEdgeInsets = UIEdgeInsets(top: 30, left: 30, bottom: 30, right: 30)
editBtn.addTarget(self, action: #selector(didEditBtnClicked), for: .touchUpInside)
whiteView.addSubview(editBtn)
whiteView.snp.makeConstraints { make in
make.left.equalToSuperview().offset(20)
make.right.equalToSuperview()
make.top.equalToSuperview()
make.bottom.equalToSuperview()
}
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.height.equalTo(16)
make.centerY.equalToSuperview()
make.right.equalToSuperview().offset(-20-6)
}
}
}
...@@ -61,8 +61,7 @@ class YHResignUploadDocListCell: UITableViewCell { ...@@ -61,8 +61,7 @@ class YHResignUploadDocListCell: UITableViewCell {
centerView.snp.makeConstraints { make in centerView.snp.makeConstraints { make in
make.left.equalTo(16) make.left.equalTo(16)
make.right.equalTo(-16) make.right.equalTo(-16)
make.top.equalTo(14) make.top.bottom.equalToSuperview()
make.bottom.equalTo(-7)
} }
titleLabel = { titleLabel = {
...@@ -75,7 +74,7 @@ class YHResignUploadDocListCell: UITableViewCell { ...@@ -75,7 +74,7 @@ class YHResignUploadDocListCell: UITableViewCell {
centerView.addSubview(titleLabel) centerView.addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in titleLabel.snp.makeConstraints { make in
make.left.equalTo(18) make.left.equalTo(18)
make.top.equalTo(23) make.top.equalTo(16)
make.height.equalTo(24) make.height.equalTo(24)
make.right.equalTo(-20) make.right.equalTo(-20)
} }
...@@ -88,7 +87,7 @@ class YHResignUploadDocListCell: UITableViewCell { ...@@ -88,7 +87,7 @@ class YHResignUploadDocListCell: UITableViewCell {
centerView.addSubview(lineView) centerView.addSubview(lineView)
lineView.snp.makeConstraints { make in lineView.snp.makeConstraints { make in
make.left.right.equalToSuperview() make.left.right.equalToSuperview()
make.top.equalTo(62.5) make.top.equalTo(51.5)
make.height.equalTo(0.5) make.height.equalTo(0.5)
} }
...@@ -100,9 +99,8 @@ class YHResignUploadDocListCell: UITableViewCell { ...@@ -100,9 +99,8 @@ class YHResignUploadDocListCell: UITableViewCell {
}() }()
centerView.addSubview(mainItemView) centerView.addSubview(mainItemView)
mainItemView.snp.makeConstraints { make in mainItemView.snp.makeConstraints { make in
make.left.right.equalToSuperview() make.bottom.left.right.equalToSuperview()
make.bottom.equalTo(-63) make.top.equalTo(52)
make.top.equalTo(63)
} }
} }
...@@ -132,8 +130,6 @@ class YHResignUploadDocListCell: UITableViewCell { ...@@ -132,8 +130,6 @@ class YHResignUploadDocListCell: UITableViewCell {
block(model, self.section) block(model, self.section)
} }
} }
let model = dataSource[i]
itemView.tag = 4000 + i itemView.tag = 4000 + i
if section == 0 { if section == 0 {
itemView.dataSource = dataSource[i] itemView.dataSource = dataSource[i]
...@@ -195,7 +191,7 @@ class YHResignUploadDocItemView: UIView { ...@@ -195,7 +191,7 @@ class YHResignUploadDocItemView: UIView {
addSubview(titleLabel) addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in titleLabel.snp.makeConstraints { make in
make.left.top.bottom.equalToSuperview() make.left.top.bottom.equalToSuperview()
make.right.equalTo(-30) make.right.equalTo(-50)
} }
explainLabel = { explainLabel = {
...@@ -263,7 +259,7 @@ class YHResignUploadDocItemView: UIView { ...@@ -263,7 +259,7 @@ class YHResignUploadDocItemView: UIView {
} }
func updateDocAllViews() { func updateDocAllViews() {
guard let dataSource = dataSource else { return } guard let dataSource = docDataSource else { return }
titleLabel.text = dataSource.name titleLabel.text = dataSource.name
if dataSource.status == 1 { if dataSource.status == 1 {
explainLabel.textColor = UIColor.brandMainColor explainLabel.textColor = UIColor.brandMainColor
......
...@@ -11,10 +11,12 @@ import UIKit ...@@ -11,10 +11,12 @@ import UIKit
class YHResignUploadSuccessDocListCell: UITableViewCell { class YHResignUploadSuccessDocListCell: UITableViewCell {
static let cellReuseIdentifier = "YHResignUploadSuccessDocListCell" static let cellReuseIdentifier = "YHResignUploadSuccessDocListCell"
typealias ExperienceListBlock = (_ model: YHWorkExperienceFileModel, _ type: YHWorkFileClickType) -> () lazy var previewFileTool:YHFilePreviewTool = {
var experienceListBlock: ExperienceListBlock? let tool = YHFilePreviewTool(targetVC: UIViewController.current)
return tool
}()
var mainItemView: UIView! var mainItemView: UIView!
var dataSource: [YHWorkExperienceFileModel]?{ var dataSource: [String]?{
didSet { didSet {
updateAllViews() updateAllViews()
} }
...@@ -49,9 +51,10 @@ class YHResignUploadSuccessDocListCell: UITableViewCell { ...@@ -49,9 +51,10 @@ class YHResignUploadSuccessDocListCell: UITableViewCell {
}() }()
contentView.addSubview(mainItemView) contentView.addSubview(mainItemView)
mainItemView.snp.makeConstraints { make in mainItemView.snp.makeConstraints { make in
make.left.right.equalToSuperview() make.top.equalToSuperview()
make.bottom.equalToSuperview() make.bottom.equalToSuperview()
make.top.equalTo(16) make.left.equalTo(16)
make.right.equalTo(-16)
} }
} }
...@@ -60,31 +63,36 @@ class YHResignUploadSuccessDocListCell: UITableViewCell { ...@@ -60,31 +63,36 @@ class YHResignUploadSuccessDocListCell: UITableViewCell {
for i in 0 ..< (dataSource?.count ?? 0) { for i in 0 ..< (dataSource?.count ?? 0) {
let itemView = YHResignUploadFileItemView() let itemView = YHResignUploadFileItemView()
itemView.dataSource = dataSource?[i] itemView.dataSource = dataSource?[i]
itemView.block = {[weak self] model, type in itemView.block = {[weak self] model in
guard let self = self else { return } guard let self = self else { return }
if let block = self.experienceListBlock { let viewModel = YHBaseViewModel()
block(model, type) viewModel.getPublicImageUrl(model) { success, error in
if let success = success {
self.previewFileTool.openXLSXRemoteFile(urlString: success, fileName:"")
} else {
YHHUD.flash(message: "链接不可用")
}
} }
} }
mainItemView.addSubview(itemView) mainItemView.addSubview(itemView)
itemView.snp.makeConstraints { make in itemView.snp.makeConstraints { make in
make.left.right.equalToSuperview() make.left.right.equalToSuperview()
make.top.equalTo(55 * i) make.top.equalTo(67 * i)
make.height.equalTo(55) make.height.equalTo(67)
} }
} }
} }
} }
class YHResignUploadFileItemView: UIView { class YHResignUploadFileItemView: UIView {
typealias ItemBlock = (_ model: YHWorkExperienceFileModel, _ type: YHWorkFileClickType) -> () typealias ItemBlock = (_ model: String) -> ()
var block: ItemBlock? var block: ItemBlock?
var whiteView: UIButton! var whiteView: UIButton!
var iconImgV: UIImageView! var iconImgV: UIImageView!
var nameLabel: UILabel! var nameLabel: UILabel!
var timeLabel: UILabel! var timeLabel: UILabel!
var editBtn: UIButton! var editBtn: UIButton!
var dataSource: YHWorkExperienceFileModel? { var dataSource: String? {
didSet { didSet {
updateAllViews() updateAllViews()
} }
...@@ -114,19 +122,12 @@ class YHResignUploadFileItemView: UIView { ...@@ -114,19 +122,12 @@ class YHResignUploadFileItemView: UIView {
nameLabel.font = UIFont.PFSC_M(ofSize:14) nameLabel.font = UIFont.PFSC_M(ofSize:14)
whiteView.addSubview(nameLabel) 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 = UIButton()
editBtn.setImage(UIImage(named:"my_cer_btn_edit"), for:.normal)
editBtn.setTitle("查看", for: .normal) editBtn.setTitle("查看", for: .normal)
editBtn.setTitleColor(UIColor.mainTextColor, for: .normal) editBtn.setTitleColor(UIColor.mainTextColor, for: .normal)
editBtn.titleLabel?.font = UIFont.PFSC_M(ofSize: 11)
editBtn.setBackgroundColor(color: UIColor(hex: 0xf4f6fa), forState: .normal) editBtn.setBackgroundColor(color: UIColor(hex: 0xf4f6fa), forState: .normal)
editBtn.YH_clickEdgeInsets = UIEdgeInsets(top: 30, left: 30, bottom: 30, right: 30) editBtn.YH_clickEdgeInsets = UIEdgeInsets(top: 30, left: 30, bottom: 30, right: 30)
editBtn.addTarget(self, action: #selector(deleteClick), for: .touchUpInside)
editBtn.layer.cornerRadius = 10 editBtn.layer.cornerRadius = 10
whiteView.addSubview(editBtn) whiteView.addSubview(editBtn)
...@@ -134,7 +135,7 @@ class YHResignUploadFileItemView: UIView { ...@@ -134,7 +135,7 @@ class YHResignUploadFileItemView: UIView {
make.left.equalTo(18) make.left.equalTo(18)
make.right.equalTo(-18) make.right.equalTo(-18)
make.centerY.equalToSuperview() make.centerY.equalToSuperview()
make.height.equalTo(55) make.height.equalTo(67)
} }
iconImgV.snp.makeConstraints { make in iconImgV.snp.makeConstraints { make in
...@@ -145,17 +146,10 @@ class YHResignUploadFileItemView: UIView { ...@@ -145,17 +146,10 @@ class YHResignUploadFileItemView: UIView {
nameLabel.snp.makeConstraints { make in nameLabel.snp.makeConstraints { make in
make.left.equalTo(iconImgV.snp.right).offset(18) make.left.equalTo(iconImgV.snp.right).offset(18)
make.top.equalToSuperview().offset(7) make.centerY.equalToSuperview()
make.right.equalTo(editBtn.snp.left) 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 editBtn.snp.makeConstraints { make in
make.width.equalTo(38) make.width.equalTo(38)
make.height.equalTo(20) make.height.equalTo(20)
...@@ -167,9 +161,7 @@ class YHResignUploadFileItemView: UIView { ...@@ -167,9 +161,7 @@ class YHResignUploadFileItemView: UIView {
func updateAllViews() { func updateAllViews() {
guard let dataSource = dataSource else { return } guard let dataSource = dataSource else { return }
nameLabel.text = dataSource.fileName let suffix = dataSource.pathExtension.lowercased()
timeLabel.text = "上传于\(dataSource.uploadedAt)"
let suffix = dataSource.fileUrl.pathExtension.lowercased()
var iconImgName = "" var iconImgName = ""
if suffix == "jpeg" { if suffix == "jpeg" {
...@@ -196,19 +188,14 @@ class YHResignUploadFileItemView: UIView { ...@@ -196,19 +188,14 @@ class YHResignUploadFileItemView: UIView {
} else if suffix == "xls" || suffix == "xlsx" { } else if suffix == "xls" || suffix == "xlsx" {
iconImgName = "my_cer_type_excel" iconImgName = "my_cer_type_excel"
} }
nameLabel.text = "补件递交凭证." + suffix
iconImgV.image = UIImage(named: iconImgName) iconImgV.image = UIImage(named: iconImgName)
} }
@objc func itemClick() { @objc func itemClick() {
if let block = block, let dataSource = dataSource { if let block = block, let dataSource = dataSource {
block(dataSource, .click) block(dataSource)
} }
} }
@objc func deleteClick() {
if let block = block, let dataSource = dataSource {
block(dataSource, .click)
}
}
} }
//
// YHResignUploadDetailViewModel.swift
// galaxy
//
// Created by EDY on 2024/10/16.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHResignUploadDetailViewModel: YHBaseViewModel {
//列表信息
var mainModel : YHResignUploadDetailModel = YHResignUploadDetailModel()
}
extension YHResignUploadDetailViewModel {
func getUploadDocDetail(id: Int, callBackBlock:@escaping (_ success: Bool,_ err:YHErrorModel?)->()) {
let params: [String : Any] = ["id": id]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.ResignUploadDoc.detail
let _ = YHNetRequest.getRequest(url: strUrl, params:params) { [weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
if json.code == 200 {
guard let dic = json.data?.peel as? [String : Any], let resultModel = YHResignUploadDetailModel.deserialize(from: dic) else {
let err = YHErrorModel(errorCode: YHErrorCode.dictParseError.rawValue, errorMsg: YHErrorCode.dictParseError.description())
callBackBlock(false, err)
return
}
self.mainModel = resultModel
callBackBlock(true, nil)
} else {
let err = YHErrorModel(errorCode: Int32(json.code), errorMsg: json.msg.isEmpty ? "" : json.msg)
callBackBlock(false,err)
}
} failBlock: { err in
callBackBlock(false,err)
}
}
}
...@@ -9,37 +9,12 @@ ...@@ -9,37 +9,12 @@
import UIKit import UIKit
class YHResignUploadDocListViewModel: YHBaseViewModel { class YHResignUploadDocListViewModel: YHBaseViewModel {
var progressModel : YHResignUploadDocListProgressModel = YHResignUploadDocListProgressModel()
//列表信息 //列表信息
var mainModel : YHResignUploadDocListModel = YHResignUploadDocListModel() var mainModel : YHResignUploadDocListModel = YHResignUploadDocListModel()
} }
extension YHResignUploadDocListViewModel { extension YHResignUploadDocListViewModel {
func getUploadDocProgress(orderID: Int, stepID: Int, callBackBlock:@escaping (_ success: Bool,_ err:YHErrorModel?)->()) {
let params: [String : Any] = ["order_id": orderID, "renewal_id": stepID]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.ResignUploadDoc.progress
let _ = YHNetRequest.getRequest(url: strUrl, params:params) { [weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
if json.code == 200 {
guard let dic = json.data?.peel as? [String : Any], let resultModel = YHResignUploadDocListProgressModel.deserialize(from: dic) else {
let err = YHErrorModel(errorCode: YHErrorCode.dictParseError.rawValue, errorMsg: YHErrorCode.dictParseError.description())
callBackBlock(false, err)
return
}
self.progressModel = resultModel
callBackBlock(true, nil)
} else {
let err = YHErrorModel(errorCode: Int32(json.code), errorMsg: json.msg.isEmpty ? "" : json.msg)
callBackBlock(false,err)
}
} failBlock: { err in
callBackBlock(false,err)
}
}
func getUploadDocList(orderID: Int, stepID: Int, callBackBlock:@escaping (_ success: Bool,_ err:YHErrorModel?)->()) { func getUploadDocList(orderID: Int, stepID: Int, callBackBlock:@escaping (_ success: Bool,_ err:YHErrorModel?)->()) {
let params: [String : Any] = ["order_id": orderID, "renewal_id": stepID] let params: [String : Any] = ["order_id": orderID, "renewal_id": stepID]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.ResignUploadDoc.list let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.ResignUploadDoc.list
......
...@@ -77,7 +77,15 @@ class YHResignUploadTravelCardListViewController: YHBaseViewController { ...@@ -77,7 +77,15 @@ class YHResignUploadTravelCardListViewController: YHBaseViewController {
} }
@objc func clickNextBtn() { @objc func clickNextBtn() {
if let param = YHLoginManager.shared.userModel?.token, param.count>5 {
var url = YHBaseUrlManager.shared.curH5URL() + "superAppBridge.html#/report/program"
url = url + "?param=" + YHLoginManager.shared.h5Token + "&batchID=\(batchId)" + "&order_id=\(orderId)"
let vc = YHH5WebViewVC()
vc.navTitle = "我的续签方案"
vc.url = url
vc.isSupportWebviewInterBackFlag = true
self.navigationController?.pushViewController(vc)
}
} }
} }
......
...@@ -597,7 +597,7 @@ class YHAllApiName { ...@@ -597,7 +597,7 @@ class YHAllApiName {
struct ResignUploadDoc { struct ResignUploadDoc {
static let progress = "super-app/renewal/supplement/progress" static let progress = "super-app/renewal/supplement/progress"
static let list = "super-app/renewal/supplement/list" static let list = "super-app/renewal/supplement/list"
static let detail = "super-app/renewal/supplement/upload/detail"
} }
// 续签-电子签证缴费 // 续签-电子签证缴费
struct ResignVisa { struct ResignVisa {
......
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