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

续签补件部分接口逻辑 未通

parent 55cad985
...@@ -559,6 +559,8 @@ ...@@ -559,6 +559,8 @@
04CA2BFF2CB7C9A000F36DE7 /* YHResignUploadSuccessDocListCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04CA2BFE2CB7C9A000F36DE7 /* YHResignUploadSuccessDocListCell.swift */; }; 04CA2BFF2CB7C9A000F36DE7 /* YHResignUploadSuccessDocListCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04CA2BFE2CB7C9A000F36DE7 /* YHResignUploadSuccessDocListCell.swift */; };
04CA2C012CB7CEDC00F36DE7 /* YHResignUploadDocDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04CA2C002CB7CEDC00F36DE7 /* YHResignUploadDocDetailViewController.swift */; }; 04CA2C012CB7CEDC00F36DE7 /* YHResignUploadDocDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04CA2C002CB7CEDC00F36DE7 /* YHResignUploadDocDetailViewController.swift */; };
04CA2C032CB7D3C200F36DE7 /* YHFileExplainReasonInputView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04CA2C022CB7D3C200F36DE7 /* YHFileExplainReasonInputView.swift */; }; 04CA2C032CB7D3C200F36DE7 /* YHFileExplainReasonInputView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04CA2C022CB7D3C200F36DE7 /* YHFileExplainReasonInputView.swift */; };
04CA2C052CB8F75700F36DE7 /* YHResignUploadDocListViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04CA2C042CB8F75700F36DE7 /* YHResignUploadDocListViewModel.swift */; };
04CA2C072CB8F9C800F36DE7 /* YHResignUploadDocListProgressModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04CA2C062CB8F9C800F36DE7 /* YHResignUploadDocListProgressModel.swift */; };
04CC2EF02BC3DDB2000305DD /* YHServiceBannerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04CC2EEF2BC3DDB2000305DD /* YHServiceBannerView.swift */; }; 04CC2EF02BC3DDB2000305DD /* YHServiceBannerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04CC2EEF2BC3DDB2000305DD /* YHServiceBannerView.swift */; };
04CCEDF72CA0FCB10026EA70 /* YHHKImmigrationRecordsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04CCEDF62CA0FCB10026EA70 /* YHHKImmigrationRecordsViewModel.swift */; }; 04CCEDF72CA0FCB10026EA70 /* YHHKImmigrationRecordsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04CCEDF62CA0FCB10026EA70 /* YHHKImmigrationRecordsViewModel.swift */; };
04CCEDF92CA0FD5F0026EA70 /* YHHKImmigrationRecordsSummaryModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04CCEDF82CA0FD5F0026EA70 /* YHHKImmigrationRecordsSummaryModel.swift */; }; 04CCEDF92CA0FD5F0026EA70 /* YHHKImmigrationRecordsSummaryModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04CCEDF82CA0FD5F0026EA70 /* YHHKImmigrationRecordsSummaryModel.swift */; };
...@@ -1456,6 +1458,8 @@ ...@@ -1456,6 +1458,8 @@
04CA2BFE2CB7C9A000F36DE7 /* YHResignUploadSuccessDocListCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHResignUploadSuccessDocListCell.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>"; }; 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>"; }; 04CA2C022CB7D3C200F36DE7 /* YHFileExplainReasonInputView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFileExplainReasonInputView.swift; sourceTree = "<group>"; };
04CA2C042CB8F75700F36DE7 /* YHResignUploadDocListViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHResignUploadDocListViewModel.swift; sourceTree = "<group>"; };
04CA2C062CB8F9C800F36DE7 /* YHResignUploadDocListProgressModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHResignUploadDocListProgressModel.swift; sourceTree = "<group>"; };
04CC2EEF2BC3DDB2000305DD /* YHServiceBannerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHServiceBannerView.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>"; }; 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>"; }; 04CCEDF82CA0FD5F0026EA70 /* YHHKImmigrationRecordsSummaryModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHHKImmigrationRecordsSummaryModel.swift; sourceTree = "<group>"; };
...@@ -3739,6 +3743,7 @@ ...@@ -3739,6 +3743,7 @@
04CA2BF82CB7BAA100F36DE7 /* M */ = { 04CA2BF82CB7BAA100F36DE7 /* M */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
04CA2C062CB8F9C800F36DE7 /* YHResignUploadDocListProgressModel.swift */,
); );
path = M; path = M;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -3746,6 +3751,7 @@ ...@@ -3746,6 +3751,7 @@
04CA2BF92CB7BAA800F36DE7 /* VM */ = { 04CA2BF92CB7BAA800F36DE7 /* VM */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
04CA2C042CB8F75700F36DE7 /* YHResignUploadDocListViewModel.swift */,
); );
path = VM; path = VM;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -5280,6 +5286,7 @@ ...@@ -5280,6 +5286,7 @@
0418922A2C91CB2500B9FB94 /* YHResignDocumentStatus.swift in Sources */, 0418922A2C91CB2500B9FB94 /* YHResignDocumentStatus.swift in Sources */,
04256DE42C72E3FA00A37BA4 /* YHInfoItemOptionView.swift in Sources */, 04256DE42C72E3FA00A37BA4 /* YHInfoItemOptionView.swift in Sources */,
04256DF22C734E7E00A37BA4 /* YHGrabFileCell.swift in Sources */, 04256DF22C734E7E00A37BA4 /* YHGrabFileCell.swift in Sources */,
04CA2C052CB8F75700F36DE7 /* YHResignUploadDocListViewModel.swift in Sources */,
A5ACE9512B4564F7002C94D2 /* YhConstant.swift in Sources */, A5ACE9512B4564F7002C94D2 /* YhConstant.swift in Sources */,
04FD85662C2124AF00BEF9C5 /* YHNameCardViewController.swift in Sources */, 04FD85662C2124AF00BEF9C5 /* YHNameCardViewController.swift in Sources */,
0430E63B2C6DA106000511E2 /* CGFloat+Extention.swift in Sources */, 0430E63B2C6DA106000511E2 /* CGFloat+Extention.swift in Sources */,
...@@ -5301,6 +5308,7 @@ ...@@ -5301,6 +5308,7 @@
04B360F32C636525001EB053 /* YHPrincipleWaitResultViewController.swift in Sources */, 04B360F32C636525001EB053 /* YHPrincipleWaitResultViewController.swift in Sources */,
04358E0A2C7835B000811928 /* YHMakeCertificatePlaceModel.swift in Sources */, 04358E0A2C7835B000811928 /* YHMakeCertificatePlaceModel.swift in Sources */,
A582B2412BB95998009D098C /* YHHKPlanTipsCell.swift in Sources */, A582B2412BB95998009D098C /* YHHKPlanTipsCell.swift in Sources */,
04CA2C072CB8F9C800F36DE7 /* YHResignUploadDocListProgressModel.swift in Sources */,
04F243552C9C435A00DF2C74 /* YHHKRecordsInfoItemCell.swift in Sources */, 04F243552C9C435A00DF2C74 /* YHHKRecordsInfoItemCell.swift in Sources */,
A5D0012C2BABC84A001F003C /* YHFileListBottomView.swift in Sources */, A5D0012C2BABC84A001F003C /* YHFileListBottomView.swift in Sources */,
0485DFDC2C670C7200B50293 /* YHPrincipleSendMailView.swift in Sources */, 0485DFDC2C670C7200B50293 /* YHPrincipleSendMailView.swift in Sources */,
......
...@@ -199,13 +199,16 @@ class YHServiceOrderListView: YHBaseViewController { ...@@ -199,13 +199,16 @@ class YHServiceOrderListView: YHBaseViewController {
} else if type == 34 { } else if type == 34 {
//在港递交预约 //在港递交预约
} else if type == 35 { } else if type == 35 {
//查看续签结果 //查看续签结果
} else if type == 36 { } else if type == 36 {
//续签补件 //续签补件
let vc = YHResignUploadDocListViewController()
vc.orderId = orderId
vc.batchId = stepId
UIViewController.current?.navigationController?.pushViewController(vc)
} else if type == 37 { } else if type == 37 {
//在港签证缴费 //在港签证缴费
...@@ -416,6 +419,7 @@ extension YHServiceOrderListView : UITableViewDelegate,UITableViewDataSource { ...@@ -416,6 +419,7 @@ extension YHServiceOrderListView : UITableViewDelegate,UITableViewDataSource {
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let model = self.arrDataForSeviceCenterProgress[indexPath.row] let model = self.arrDataForSeviceCenterProgress[indexPath.row]
if model.status == 1 || model.status == 4 { if model.status == 1 || model.status == 4 {
YHServiceOrderListView.jumpToMessageController(type: model.type, orderId: orderID, stepID)
return return
} else { } else {
YHServiceOrderListView.jumpToMessageController(type: model.type, orderId: orderID, stepID) YHServiceOrderListView.jumpToMessageController(type: model.type, orderId: orderID, stepID)
......
...@@ -11,8 +11,10 @@ import AttributedString ...@@ -11,8 +11,10 @@ import AttributedString
class YHResignUploadDocListViewController: YHBaseViewController { class YHResignUploadDocListViewController: YHBaseViewController {
var orderId: Int = 0 var orderId: Int = 0
lazy var viewModel: YHTravelDocsPreparationViewModel = { // 批次id
let vm = YHTravelDocsPreparationViewModel() var batchId: Int = 0
lazy var viewModel: YHResignUploadDocListViewModel = {
let vm = YHResignUploadDocListViewModel()
return vm return vm
}() }()
...@@ -85,21 +87,14 @@ class YHResignUploadDocListViewController: YHBaseViewController { ...@@ -85,21 +87,14 @@ class YHResignUploadDocListViewController: YHBaseViewController {
private extension YHResignUploadDocListViewController { private extension YHResignUploadDocListViewController {
func loadData() { func loadData() {
let params: [String : Any] = ["order_id": orderId] viewModel.getUploadDocProgress(orderID: orderId, stepID: batchId) {[weak self] success, err in
YHHUD.show(.progress(message: "加载中...")) guard let self = self else { return }
viewModel.getTravelDocsList(param: params){ success, error in viewModel.getUploadDocList(orderID: orderId, stepID: batchId) {[weak self] success, err in
YHHUD.hide() guard let self = self else { return }
if success { self.tableView.reloadData()
} else {
// let msg = error?.errorMsg ?? "获取数据出错"
// YHHUD.flash(message: msg)
// DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) {
// self.navigationController?.popViewController()
// }
} }
self.tableView.reloadData()
} }
} }
func setupUI() { func setupUI() {
...@@ -180,6 +175,22 @@ extension YHResignUploadDocListViewController: UITableViewDelegate, UITableViewD ...@@ -180,6 +175,22 @@ extension YHResignUploadDocListViewController: UITableViewDelegate, UITableViewD
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
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
if indexPath.section == 0 {
approveCell.title = "资料上传"
approveCell.dataSource = self.viewModel.mainModel.upload_list
} else {
approveCell.title = "文书确认"
approveCell.dataSource = self.viewModel.mainModel.doc_list
}
approveCell.clickBlock = { [weak self] model, section in
guard let self = self else { return }
if section == 0 {
// 跳转文件上传
} else {
// 跳转列表
}
}
return approveCell return approveCell
} }
......
//
// YHResignUploadDocListProgressModel.swift
// galaxy
//
// Created by EDY on 2024/10/11.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import SmartCodable
class YHResignUploadDocListProgressModel: SmartCodable {
var progress : Int = -1 //电子签证有效期
var is_need_supplement : Bool = true
required init() {
}
}
class YHResignUploadDocListModel: SmartCodable {
var supplement_voucher_url : String = ""
var supplement_deadline : String = ""
var upload_list : [YHResignUploadDocModel] = []
var doc_list : [YHResignUploadDocModel] = []
required init() {
}
}
class YHResignUploadDocModel: SmartCodable {
var name : String = ""
var status : Int = 0
var id : Int = 0
required init() {
}
}
...@@ -11,13 +11,19 @@ import UIKit ...@@ -11,13 +11,19 @@ import UIKit
class YHResignUploadDocListCell: UITableViewCell { class YHResignUploadDocListCell: UITableViewCell {
static let cellReuseIdentifier = "YHResignUploadDocListCell" static let cellReuseIdentifier = "YHResignUploadDocListCell"
typealias ExperienceListBlock = (_ model: YHAdopterDependentModel) -> () typealias ExperienceListBlock = (_ model: YHResignUploadDocModel, _ section: Int) -> ()
var clickBlock: ExperienceListBlock? var clickBlock: ExperienceListBlock?
var centerView: UIView! var centerView: UIView!
var titleLabel: UILabel! var titleLabel: UILabel!
var mainItemView: UIView! var mainItemView: UIView!
var lineView: UIView! var lineView: UIView!
var dataSource: [YHAdopterDependentModel]? { var title: String = "" {
didSet {
titleLabel.text = title
}
}
var section : Int = 0
var dataSource: [YHResignUploadDocModel]? {
didSet { didSet {
updateAllViews() updateAllViews()
} }
...@@ -123,13 +129,17 @@ class YHResignUploadDocListCell: UITableViewCell { ...@@ -123,13 +129,17 @@ class YHResignUploadDocListCell: UITableViewCell {
itemView.clickBlock = {[weak self] model in itemView.clickBlock = {[weak self] model in
guard let self = self else { return } guard let self = self else { return }
if let block = self.clickBlock { if let block = self.clickBlock {
block(model) block(model, self.section)
} }
} }
let model = dataSource[i] let model = dataSource[i]
itemView.tag = 4000 + i itemView.tag = 4000 + i
itemView.dataSource = dataSource[i] if section == 0 {
itemView.dataSource = dataSource[i]
} else {
itemView.docDataSource = dataSource[i]
}
mainItemView.addSubview(itemView) mainItemView.addSubview(itemView)
itemView.snp.makeConstraints { make in itemView.snp.makeConstraints { make in
make.left.equalTo(18) make.left.equalTo(18)
...@@ -145,7 +155,7 @@ class YHResignUploadDocListCell: UITableViewCell { ...@@ -145,7 +155,7 @@ class YHResignUploadDocListCell: UITableViewCell {
class YHResignUploadDocItemView: UIView { class YHResignUploadDocItemView: UIView {
typealias ItemBlock = (_ model: YHAdopterDependentModel) -> () typealias ItemBlock = (_ model: YHResignUploadDocModel) -> ()
var clickBlock: ItemBlock? var clickBlock: ItemBlock?
var deleteBlock: ItemBlock? var deleteBlock: ItemBlock?
var titleLabel: UILabel! var titleLabel: UILabel!
...@@ -153,11 +163,16 @@ class YHResignUploadDocItemView: UIView { ...@@ -153,11 +163,16 @@ class YHResignUploadDocItemView: UIView {
var nextStepImageView: UIImageView! var nextStepImageView: UIImageView!
var centerButton: UIButton! var centerButton: UIButton!
var dataSource: YHAdopterDependentModel? { var dataSource: YHResignUploadDocModel? {
didSet { didSet {
updateAllViews() updateAllViews()
} }
} }
var docDataSource: YHResignUploadDocModel? {
didSet {
updateDocAllViews()
}
}
override init(frame: CGRect) { override init(frame: CGRect) {
super.init(frame: frame) super.init(frame: frame)
backgroundColor = .white backgroundColor = .white
...@@ -224,21 +239,13 @@ class YHResignUploadDocItemView: UIView { ...@@ -224,21 +239,13 @@ class YHResignUploadDocItemView: UIView {
func updateAllViews() { func updateAllViews() {
guard let dataSource = dataSource else { return } guard let dataSource = dataSource else { return }
var spouse = "子女" titleLabel.text = dataSource.name
if dataSource.is_spouse == 1 { if dataSource.status == 3 {
spouse = "配偶"
}
if dataSource.dep_name.count != 0 {
titleLabel.text = spouse + "(\(dataSource.dep_name))"
} else {
titleLabel.text = spouse
}
if dataSource.status == 0 {
explainLabel.text = "待上传" explainLabel.text = "待上传"
explainLabel.textColor = UIColor.brandMainColor explainLabel.textColor = UIColor.brandMainColor
nextStepImageView.image = UIImage(named: "service_adopter_income_start") nextStepImageView.image = UIImage(named: "service_adopter_income_start")
} }
if dataSource.status == 1 { if dataSource.status == 0 {
explainLabel.text = "审核中" explainLabel.text = "审核中"
explainLabel.textColor = UIColor(hex: 0xff8000) explainLabel.textColor = UIColor(hex: 0xff8000)
nextStepImageView.image = UIImage(named: "service_adopter_income_wait") nextStepImageView.image = UIImage(named: "service_adopter_income_wait")
...@@ -248,32 +255,46 @@ class YHResignUploadDocItemView: UIView { ...@@ -248,32 +255,46 @@ class YHResignUploadDocItemView: UIView {
explainLabel.textColor = UIColor.failColor explainLabel.textColor = UIColor.failColor
nextStepImageView.image = UIImage(named: "service_adopter_income_fail") nextStepImageView.image = UIImage(named: "service_adopter_income_fail")
} }
if dataSource.status == 3 { if dataSource.status == 1 {
explainLabel.text = "已完成" explainLabel.text = "已完成"
explainLabel.textColor = UIColor(hex: 0x3cc694) explainLabel.textColor = UIColor(hex: 0x3cc694)
nextStepImageView.image = UIImage(named: "service_adopter_income_success") nextStepImageView.image = UIImage(named: "service_adopter_income_success")
} }
} }
func updateDocAllViews() { func updateDocAllViews() {
guard let dataSource = dataSource else { return } guard let dataSource = dataSource else { return }
if dataSource.status == 0 { titleLabel.text = dataSource.name
explainLabel.text = "待确认"// “待签字” if dataSource.status == 1 {
explainLabel.textColor = UIColor.brandMainColor explainLabel.textColor = UIColor.brandMainColor
nextStepImageView.image = UIImage(named: "service_adopter_income_start") nextStepImageView.image = UIImage(named: "service_adopter_income_start")
} }
if dataSource.status == 1 { if dataSource.status == 4 {
explainLabel.text = "写作中"// 定稿中 审核中 explainLabel.text = "待签字"
explainLabel.textColor = UIColor.brandMainColor
nextStepImageView.image = UIImage(named: "service_adopter_income_start")
}
if dataSource.status == 0 {
explainLabel.text = "写作中"//
explainLabel.textColor = UIColor(hex: 0xff8000) explainLabel.textColor = UIColor(hex: 0xff8000)
nextStepImageView.image = UIImage(named: "service_adopter_income_wait") nextStepImageView.image = UIImage(named: "service_adopter_income_wait")
} }
if dataSource.status == 2 { if dataSource.status == 2 {
explainLabel.text = "定稿中"// 定稿中 审核中
explainLabel.textColor = UIColor(hex: 0xff8000)
nextStepImageView.image = UIImage(named: "service_adopter_income_wait")
}
if dataSource.status == 3 {
explainLabel.text = "审核中"// 定稿中 审核中
explainLabel.textColor = UIColor(hex: 0xff8000)
nextStepImageView.image = UIImage(named: "service_adopter_income_wait")
}
if dataSource.status == 6 {
explainLabel.text = "已驳回" explainLabel.text = "已驳回"
explainLabel.textColor = UIColor.failColor explainLabel.textColor = UIColor.failColor
nextStepImageView.image = UIImage(named: "service_adopter_income_fail") nextStepImageView.image = UIImage(named: "service_adopter_income_fail")
} }
if dataSource.status == 3 { if dataSource.status == 5 {
explainLabel.text = "已完成" explainLabel.text = "已完成"
explainLabel.textColor = UIColor(hex: 0x3cc694) explainLabel.textColor = UIColor(hex: 0x3cc694)
nextStepImageView.image = UIImage(named: "service_adopter_income_success") nextStepImageView.image = UIImage(named: "service_adopter_income_success")
...@@ -284,7 +305,7 @@ class YHResignUploadDocItemView: UIView { ...@@ -284,7 +305,7 @@ class YHResignUploadDocItemView: UIView {
@objc func centerClick() { @objc func centerClick() {
if let block = clickBlock { if let block = clickBlock {
block(self.dataSource ?? YHAdopterDependentModel()) block(self.dataSource ?? YHResignUploadDocModel())
} }
} }
......
//
// YHResignUploadDocListViewModel.swift
// galaxy
//
// Created by EDY on 2024/10/11.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHResignUploadDocListViewModel: YHBaseViewModel {
var progressModel : YHResignUploadDocListProgressModel = YHResignUploadDocListProgressModel()
//列表信息
var mainModel : YHResignUploadDocListModel = YHResignUploadDocListModel()
}
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?)->()) {
let params: [String : Any] = ["order_id": orderID, "renewal_id": stepID]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.ResignUploadDoc.list
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 = YHResignUploadDocListModel.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)
}
}
}
...@@ -563,4 +563,11 @@ class YHAllApiName { ...@@ -563,4 +563,11 @@ class YHAllApiName {
// 在港记录-家庭成员列表 // 在港记录-家庭成员列表
static let stayInHKRecordFamilyMembers = "super-app/stay-in-hk-record/family-members" static let stayInHKRecordFamilyMembers = "super-app/stay-in-hk-record/family-members"
} }
//续签段 - 10续签补件
struct ResignUploadDoc {
static let progress = "super-app/renewal/supplement/progress"
static let list = "super-app/renewal/supplement/list"
}
} }
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