Commit 6c68eb50 authored by pete谢兆麟's avatar pete谢兆麟

查看续签结果接口及逻辑

parent 8809d6f8
......@@ -266,6 +266,8 @@
045792132CBCFB8000EBD99B /* YHResignUploadTravelCardDetailModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045792122CBCFB8000EBD99B /* YHResignUploadTravelCardDetailModel.swift */; };
045792152CBD041F00EBD99B /* YHResignUploadTravelHKTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045792142CBD041F00EBD99B /* YHResignUploadTravelHKTableViewCell.swift */; };
045792172CBD046E00EBD99B /* YHResignUploadTravelPassportTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045792162CBD046E00EBD99B /* YHResignUploadTravelPassportTableViewCell.swift */; };
045792192CBE08BA00EBD99B /* YHLookResignResultViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045792182CBE08BA00EBD99B /* YHLookResignResultViewModel.swift */; };
0457921B2CBE0C3F00EBD99B /* YHLookResignResultModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0457921A2CBE0C3F00EBD99B /* YHLookResignResultModel.swift */; };
045A08C02C37ABF500BCBABA /* YHSegmentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045A08BF2C37ABF500BCBABA /* YHSegmentView.swift */; };
045A08C22C37EB8B00BCBABA /* YHMyFileListNoneCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045A08C12C37EB8B00BCBABA /* YHMyFileListNoneCell.swift */; };
045A7E672C2ACB1A008F995B /* YHLoginOneLeadView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 045A7E662C2ACB1A008F995B /* YHLoginOneLeadView.swift */; };
......@@ -1217,6 +1219,8 @@
045792122CBCFB8000EBD99B /* YHResignUploadTravelCardDetailModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHResignUploadTravelCardDetailModel.swift; sourceTree = "<group>"; };
045792142CBD041F00EBD99B /* YHResignUploadTravelHKTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHResignUploadTravelHKTableViewCell.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>"; };
0457921A2CBE0C3F00EBD99B /* YHLookResignResultModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHLookResignResultModel.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>"; };
045A7E662C2ACB1A008F995B /* YHLoginOneLeadView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHLoginOneLeadView.swift; sourceTree = "<group>"; };
......@@ -3931,6 +3935,7 @@
04CA2C172CBA0CC700F36DE7 /* M */ = {
isa = PBXGroup;
children = (
0457921A2CBE0C3F00EBD99B /* YHLookResignResultModel.swift */,
);
path = M;
sourceTree = "<group>";
......@@ -3954,6 +3959,7 @@
04CA2C1C2CBA0CC700F36DE7 /* VM */ = {
isa = PBXGroup;
children = (
045792182CBE08BA00EBD99B /* YHLookResignResultViewModel.swift */,
);
path = VM;
sourceTree = "<group>";
......@@ -5587,6 +5593,7 @@
044EE2462C93E22E00A2FE3A /* YHResignCertificateDetailHkViewController.swift in Sources */,
A5ACE94B2B4564F7002C94D2 /* YHHUDRotatingImageView.swift in Sources */,
A5ACE94F2B4564F7002C94D2 /* YhOverlayView.swift in Sources */,
0457921B2CBE0C3F00EBD99B /* YHLookResignResultModel.swift in Sources */,
045EEEB92B9F171A0022A143 /* YHWorkMessageSelectTableViewCell.swift in Sources */,
04FA8B302C0874CA00ABE43F /* YHOneKeyLoginViewModel.swift in Sources */,
04256E112C75BD2700A37BA4 /* YHVisaPaymentListModel.swift in Sources */,
......@@ -5647,6 +5654,7 @@
045EEECD2B9F171A0022A143 /* YHScoreDataModel.swift in Sources */,
044F39622CB8FF16007CA277 /* YHVisaRenewalPayContentCell.swift in Sources */,
04F2432F2C94704200DF2C74 /* YHPaddedLabel.swift in Sources */,
045792192CBE08BA00EBD99B /* YHLookResignResultViewModel.swift in Sources */,
A5ACE9342B4564F7002C94D2 /* YHAllApiName.swift in Sources */,
04AF82D62C25542D0028CE2A /* YHInterestTopicLayout.swift in Sources */,
04912F6E2CB6A64700CC3105 /* YHResignAppointSubmitTipsView.swift in Sources */,
......
......@@ -223,6 +223,8 @@ class YHServiceOrderListView: YHBaseViewController {
} else if type == 35 {
//查看续签结果
let vc = YHLookResignResultViewController()
vc.orderId = orderId
vc.batchId = stepId
UIViewController.current?.navigationController?.pushViewController(vc)
} else if type == 36 {
//续签补件
......
......@@ -14,8 +14,8 @@ class YHLookResignResultViewController: YHBaseViewController {
// 批次id
var batchId: Int = 0
var state = 2
lazy var viewModel: YHResignUploadDocListViewModel = {
let vm = YHResignUploadDocListViewModel()
lazy var viewModel: YHLookResignResultViewModel = {
let vm = YHLookResignResultViewModel()
return vm
}()
......@@ -72,27 +72,40 @@ class YHLookResignResultViewController: YHBaseViewController {
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
loadData()
}
@objc func clickNextBtn() {
if state == 1 {
let vc = YHResignUploadDocListViewController()
vc.orderId = orderId
vc.batchId = batchId
self.navigationController?.pushViewController(vc)
} else {
if privacyView.isAgree {
let vc = YHHKVisaRenewalPaymentVC(orderId: orderId, renewalId: batchId)
self.navigationController?.pushViewController(vc)
} else {
privacyView.alert()
}
}
}
}
private extension YHLookResignResultViewController {
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
// guard let self = self else { return }
// self.tableView.reloadData()
// }
// }
viewModel.getRenewalResult(batchId) {[weak self] success, error in
guard let self = self else { return }
if self.viewModel.dataModel.status == 1 || self.viewModel.dataModel.status == 2 {
state = 0
} else if self.viewModel.dataModel.status == 2 {
state = 1
} else {
state = 2
}
self.updateView()
self.tableView.reloadData()
}
}
......@@ -121,7 +134,9 @@ private extension YHLookResignResultViewController {
}
tableView.tableHeaderView = headView
}
func updateView() {
if state == 0 {
bottomView.isHidden = true
tableView.snp.remakeConstraints { make in
......@@ -155,6 +170,7 @@ private extension YHLookResignResultViewController {
make.right.equalTo(0)
}
}
headView.dataSource = self.viewModel.dataModel
}
func convertNumberToChineseText(_ number: Int) -> String {
......@@ -170,7 +186,7 @@ extension YHLookResignResultViewController: UITableViewDelegate, UITableViewData
func numberOfSections(in tableView: UITableView) -> Int {
if state == 0 {
return 3
return self.viewModel.dataModel.data.data.count
} else if state == 1 {
return 1
} else {
......@@ -183,7 +199,7 @@ extension YHLookResignResultViewController: UITableViewDelegate, UITableViewData
if section == 1 {
return 1
}
return 2
return self.viewModel.dataModel.data.data.count
}
return 1
}
......@@ -192,20 +208,27 @@ extension YHLookResignResultViewController: UITableViewDelegate, UITableViewData
if state == 0 {
let approveCell = tableView.dequeueReusableCell(withIdentifier: YHLookResignResultStateOneTableViewCell.cellReuseIdentifier, for: indexPath) as! YHLookResignResultStateOneTableViewCell
approveCell.title = "第" + convertNumberToChineseText(indexPath.section + 1) + "批"
approveCell.dataSource = self.viewModel.dataModel.data.data[indexPath.section]
return approveCell
} else if state == 1 {
let approveCell = tableView.dequeueReusableCell(withIdentifier: YHLookResignResultStateTwoTableViewCell.cellReuseIdentifier, for: indexPath) as! YHLookResignResultStateTwoTableViewCell
approveCell.dataSource = [1,2,3,4,5,6]
approveCell.state = state
let model = YHLookResignResultDataLettersModel()
model.result_file = ""
model.user = self.viewModel.dataModel.data.user
approveCell.dataSource = [model]
return approveCell
} else {
if indexPath.section == 0 {
let approveCell = tableView.dequeueReusableCell(withIdentifier: YHLookResignResultStateThreePeopleTableViewCell.cellReuseIdentifier, for: indexPath) as! YHLookResignResultStateThreePeopleTableViewCell
approveCell.title = "第" + convertNumberToChineseText(indexPath.section + 1) + "批"
approveCell.title = "第" + convertNumberToChineseText(indexPath.row + 1) + "批"
approveCell.dataSource = self.viewModel.dataModel.data.data[indexPath.row]
return approveCell
} else {
let approveCell = tableView.dequeueReusableCell(withIdentifier: YHLookResignResultStateThreeTableViewCell.cellReuseIdentifier, for: indexPath) as! YHLookResignResultStateThreeTableViewCell
approveCell.dataSource = [1,2,3,4,5,6]
approveCell.state = state
approveCell.dataSource = self.viewModel.dataModel.data.letters
return approveCell
}
}
......@@ -216,16 +239,18 @@ extension YHLookResignResultViewController: UITableViewDelegate, UITableViewData
return 140
}
if state == 1 {
// return 258
let number = (6 - 1) / 2
return CGFloat(208 + 116 * number)
return 258
// let number = (6 - 1) / 2
// return CGFloat(208 + 116 * number)
}
if indexPath.section == 0 {
return 126
}
// return 242
let number = (6 - 1) / 2
if self.viewModel.dataModel.data.letters.count == 1 {
return 242
}
let number = (self.viewModel.dataModel.data.letters.count - 1) / 2
return CGFloat(192 + 116 * number)
}
......@@ -253,3 +278,28 @@ extension YHLookResignResultViewController: UITableViewDelegate, UITableViewData
return view
}
}
extension YHLookResignResultViewController : UIScrollViewDelegate {
func scrollViewDidScroll(_ scrollView: UIScrollView) {
if scrollView.contentOffset.y > 0 {
var alpha = scrollView.contentOffset.y / (k_Height_NavigationtBarAndStatuBar)
if alpha > 1.0 {
alpha = 1.0
}
gk_navBarAlpha = alpha
gk_navBackgroundColor = .white
if state == 0 {
gk_navTitle = "续签审核中"
} else if state == 1 {
gk_navTitle = "续签待补件"
} else {
gk_navTitle = "续签已获批"
}
gk_backImage = UIImage(named: "back_icon")
} else {
gk_navBarAlpha = 0.0
gk_navTitle = ""
gk_backImage = UIImage(named: "back_icon")
}
}
}
//
// YHLookResignResultModel.swift
// galaxy
//
// Created by EDY on 2024/10/15.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import SmartCodable
class YHLookResignResultModel: SmartCodable {
var status: Int = 0 //续签状态: 1: 待递交 2:审核中 3:待补件 4:已获批
var statusText: String = ""
var mode: Int = 0 //续签状态: 1: 个人 2:家庭
var data: YHLookResignResultDataModel = YHLookResignResultDataModel()
required init() {
}
}
class YHLookResignResultDataModel: SmartCodable {
var data: [YHLookResignResultDataDataModel] = [] //人员
var user: String = "" //主申请人信息
var deadline: String = ""
var letters: [YHLookResignResultDataLettersModel] = []
var main: YHLookResignResultDataMainModel = YHLookResignResultDataMainModel()
required init() {
}
}
class YHLookResignResultDataDataModel: SmartCodable {
var number: Int = 0
var pay_deadline: String = ""
var result_date: String = ""
var users: [String] = []
var result_file: String = ""
required init() {
}
}
class YHLookResignResultDataLettersModel: SmartCodable {
var user: String = "" //人信息
var result_file: String = ""
required init() {
}
}
class YHLookResignResultDataMainModel: SmartCodable {
var pay_deadline: String = ""
var result_date: String = ""
required init() {
}
}
......@@ -28,6 +28,35 @@ class YHLookResignResultHeadView: UIView {
}
}
var dataSource: YHLookResignResultModel? {
didSet {
guard let dataSource = dataSource else { return }
if state == 0 {
let a = ASAttributedString.init("\(dataSource.data.user),您的【优秀人才入境计划】续签申请资料已递交至港府,且港府", .font(UIFont.PFSC_M(ofSize:14)), .foreground(UIColor.mainTextColor50))
let b = ASAttributedString.init("已确认递交申请", .font(UIFont.PFSC_M(ofSize:14)),.foreground(UIColor.brandMainColor))
let c = ASAttributedString.init(",入境处审核周期预计4-8周,请耐心等待获批结果", .font(UIFont.PFSC_M(ofSize:14)), .foreground(UIColor.mainTextColor50))
messageLabel.attributed.text = a+b+c
} else if state == 1 {
let a = ASAttributedString.init("\(dataSource.data.user),您的【优秀人才入境计划】续签申请已获得", .font(UIFont.PFSC_M(ofSize:14)), .foreground(UIColor.mainTextColor50))
let b = ASAttributedString.init("港府补件通知", .font(UIFont.PFSC_M(ofSize:14)),.foreground(UIColor.brandMainColor))
let c = ASAttributedString.init(",请您于\(dataSource.data.deadline)前根据补件信内容,补充资料递交至港府!", .font(UIFont.PFSC_M(ofSize:14)), .foreground(UIColor.mainTextColor50))
messageLabel.attributed.text = a+b+c
} else {
if dataSource.mode == 1 {
let a = ASAttributedString.init("\(dataSource.data.user),您申请的【优秀人才入境计划】续签申请在\(dataSource.data.main.pay_deadline)", .font(UIFont.PFSC_M(ofSize:14)), .foreground(UIColor.mainTextColor50))
let b = ASAttributedString.init("正式获批", .font(UIFont.PFSC_M(ofSize:14)),.foreground(UIColor.brandMainColor))
let c = ASAttributedString.init("!请在\(dataSource.data.main.result_date)前,赴港缴费领取新签证!", .font(UIFont.PFSC_M(ofSize:14)), .foreground(UIColor.mainTextColor50))
messageLabel.attributed.text = a+b+c
} else {
let a = ASAttributedString.init("\(dataSource.data.user),您与家人申请的【优秀人才入境计划】续签申请已", .font(UIFont.PFSC_M(ofSize:14)), .foreground(UIColor.mainTextColor50))
let b = ASAttributedString.init("正式获批", .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
}
}
}
}
override init(frame: CGRect) {
super.init(frame: frame)
setUpView()
......
......@@ -50,11 +50,7 @@ class YHLookResignResultPrivateView: UIView {
let a = ASAttributedString.init("已阅读并同意", .font(UIFont.PFSC_M(ofSize:13)), .foreground(UIColor.mainTextColor50))
let c = ASAttributedString.init("缴费须知", .font(UIFont.PFSC_M(ofSize:13)),.foreground(UIColor.brandMainColor), .action {
// 跳转引导
YHLookResignAlertView.show { [weak self] in
guard let self = self else { return }
self.agreeButton.isSelected = true
self.isAgree = self.agreeButton.isSelected
}
self.alert()
})
let e = ASAttributedString.init(",请勿在香港境外点击缴费链接", .font(UIFont.PFSC_M(ofSize:13)), .foreground(UIColor.mainTextColor50))
label.attributed.text = a+c+e
......@@ -77,4 +73,11 @@ class YHLookResignResultPrivateView: UIView {
isAgree = agreeButton.isSelected
}
func alert() {
YHLookResignAlertView.show { [weak self] in
guard let self = self else { return }
self.agreeButton.isSelected = true
self.isAgree = self.agreeButton.isSelected
}
}
}
......@@ -27,11 +27,17 @@ class YHLookResignResultStateOneTableViewCell: UITableViewCell {
titleLabel.text = title
}
}
var dataSource: [YHResignUploadDocModel]? {
var dataSource: YHLookResignResultDataDataModel? {
didSet {
updateAllViews()
}
}
lazy var previewFileTool:YHFilePreviewTool = {
let tool = YHFilePreviewTool(targetVC: UIViewController.current)
return tool
}()
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
......@@ -163,7 +169,31 @@ class YHLookResignResultStateOneTableViewCell: UITableViewCell {
}
func updateAllViews() {
guard let dataSource = dataSource else { return }
var names = ""
var i = 0
for item in dataSource.users {
if i == 0 {
names = names + item
} else {
names = names + "、" + item
}
i += 1
}
peopleValueLabel.text = names
if dataSource.result_file.count != 0 {
let a = ASAttributedString.init("递交凭证.pdf", .font(UIFont.PFSC_M(ofSize:14)), .foreground(UIColor.brandMainColor), .underline(.single), .action {
// 点击预览
let viewModel = YHBaseViewModel()
viewModel.getRealUsefulUrl(dataSource.result_file) { success in
self.previewFileTool.openXLSXRemoteFile(urlString: success, fileName:"")
}
})
docValueLabel.attributed.text = a
} else {
let a = ASAttributedString.init("待递交", .font(UIFont.PFSC_M(ofSize:14)), .foreground(UIColor(hex: 0xff8000)))
docValueLabel.attributed.text = a
}
}
}
......@@ -26,7 +26,7 @@ class YHLookResignResultStateThreePeopleTableViewCell: UITableViewCell {
titleLabel.text = title
}
}
var dataSource: [YHResignUploadDocModel]? {
var dataSource: YHLookResignResultDataDataModel? {
didSet {
updateAllViews()
}
......@@ -154,7 +154,7 @@ class YHLookResignResultStateThreePeopleTableViewCell: UITableViewCell {
make.right.equalTo(-16)
}
peopleValueLabel = {
docValueLabel = {
let label = UILabel()
label.textColor = UIColor.mainTextColor50
label.font = UIFont.PFSC_M(ofSize: 14)
......@@ -162,8 +162,8 @@ class YHLookResignResultStateThreePeopleTableViewCell: UITableViewCell {
label.textAlignment = .right
return label
}()
centerView.addSubview(peopleValueLabel)
peopleValueLabel.snp.makeConstraints { make in
centerView.addSubview(docValueLabel)
docValueLabel.snp.makeConstraints { make in
make.left.equalTo(16)
make.top.equalTo(84)
make.height.equalTo(20)
......@@ -173,7 +173,20 @@ class YHLookResignResultStateThreePeopleTableViewCell: UITableViewCell {
}
func updateAllViews() {
guard let dataSource = dataSource else { return }
var names = ": "
var i = 0
for item in dataSource.users {
if i == 0 {
names = names + item
} else {
names = names + "、" + item
}
i += 1
}
titleLabel.text = title + names
peopleValueLabel.text = dataSource.result_date
docValueLabel.text = dataSource.pay_deadline
}
}
......@@ -19,8 +19,8 @@ class YHLookResignResultStateThreeTableViewCell: UITableViewCell {
var flagImageView: UIImageView!
var flagLabel: UILabel!
var mainItemView: UIView!
var dataSource: [Int]? {
var state: Int = 0
var dataSource: [YHLookResignResultDataLettersModel]? {
didSet {
updateAllViews()
}
......@@ -115,6 +115,8 @@ class YHLookResignResultStateThreeTableViewCell: UITableViewCell {
mainItemView.removeSubviews()
if dataSource.count == 1 {
let view = YHLookResignResultItemView(frame: .zero)
view.state = state
view.dataSource = dataSource.first
mainItemView.addSubview(view)
view.snp.makeConstraints { make in
make.centerX.equalToSuperview()
......@@ -128,6 +130,8 @@ class YHLookResignResultStateThreeTableViewCell: UITableViewCell {
let y: Int = count / 2
let x: Int = count % 2
let view = YHLookResignResultItemView(frame: .zero)
view.state = state
view.dataSource = item
mainItemView.addSubview(view)
view.snp.makeConstraints { make in
if x == 0 {
......
......@@ -19,8 +19,8 @@ class YHLookResignResultStateTwoTableViewCell: UITableViewCell {
var flagImageView: UIImageView!
var flagLabel: UILabel!
var mainItemView: UIView!
var dataSource: [Int]? {
var state: Int = 0
var dataSource: [YHLookResignResultDataLettersModel]? {
didSet {
updateAllViews()
}
......@@ -117,6 +117,8 @@ class YHLookResignResultStateTwoTableViewCell: UITableViewCell {
mainItemView.removeSubviews()
if dataSource.count == 1 {
let view = YHLookResignResultItemView(frame: .zero)
view.state = state
view.dataSource = dataSource.first
mainItemView.addSubview(view)
view.snp.makeConstraints { make in
make.centerX.equalToSuperview()
......@@ -130,6 +132,8 @@ class YHLookResignResultStateTwoTableViewCell: UITableViewCell {
let y: Int = count / 2
let x: Int = count % 2
let view = YHLookResignResultItemView(frame: .zero)
view.state = state
view.dataSource = dataSource.first
mainItemView.addSubview(view)
view.snp.makeConstraints { make in
if x == 0 {
......@@ -148,12 +152,40 @@ class YHLookResignResultStateTwoTableViewCell: UITableViewCell {
}
class YHLookResignResultItemView: UIImageView {
var dataSource: YHLookResignResultDataLettersModel? {
didSet {
self.titleLabel.text = dataSource?.user
}
}
var state: Int? {
didSet {
if state == 0 {
self.image = UIImage(named: "look_resign_result_mail_two")
self.titleLabel.textColor = UIColor(hex: 0xb75e24).withAlphaComponent(0.6)
} else if state == 1 {
self.image = UIImage(named: "look_resign_result_mail_three")
self.titleLabel.textColor = UIColor(hex: 0xe97900)
} else {
self.image = UIImage(named: "look_resign_result_mail_four")
self.titleLabel.textColor = UIColor(hex: 0xb75e24)
}
}
}
var titleLabel: UILabel!
lazy var previewFileTool:YHFilePreviewTool = {
let tool = YHFilePreviewTool(targetVC: UIViewController.current)
return tool
}()
override init(frame: CGRect) {
super.init(frame:frame)
self.isUserInteractionEnabled = true
createUI()
let tap = UITapGestureRecognizer(target: self, action: #selector(handleTap))
tap.delegate = self
addGestureRecognizer(tap)
}
required init?(coder: NSCoder) {
......@@ -181,5 +213,21 @@ class YHLookResignResultItemView: UIImageView {
make.bottom.equalTo(self.snp.centerY)
}
}
@objc private func handleTap(_ sender: AnyObject?) {
let viewModel = YHBaseViewModel()
viewModel.getRealUsefulUrl(dataSource?.result_file ?? "") { success in
self.previewFileTool.openXLSXRemoteFile(urlString: success, fileName:"")
}
}
}
extension YHLookResignResultItemView: UIGestureRecognizerDelegate {
func gestureRecognizer(_ gestureRecognizer:UIGestureRecognizer, shouldReceive touch:UITouch) -> Bool {
if touch.view == self {
return true
}
return false
}
}
//
// YHLookResignResultViewModel.swift
// galaxy
//
// Created by EDY on 2024/10/15.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHLookResignResultViewModel: YHBaseViewModel {
var dataModel : YHLookResignResultModel = YHLookResignResultModel()
func getRenewalResult(_ id: Int, callBackBlock:@escaping (_ success: Bool,_ error:YHErrorModel?)->()) {
let params: [String: Any] = ["id": id]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.ResignResult.result
let _ = YHNetRequest.getRequest(url: strUrl,params: params) { [weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
printLog("model 是 ==> \(json)")
if json.code == 200 {
guard let dic = json.data?.peel as? [String : Any], let resultModel = YHLookResignResultModel.deserialize(from: dic) else {
let err = YHErrorModel(errorCode: YHErrorCode.dictParseError.rawValue, errorMsg: YHErrorCode.dictParseError.description())
callBackBlock(false, err)
return
}
self.dataModel = 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)
}
}
}
......@@ -44,10 +44,11 @@ class YHResignUploadTravelCardListViewController: YHBaseViewController {
button.setTitle("下一步,去查看续签总结", for: .disabled)
button.setTitleColor(UIColor.white, for: .normal)
button.setTitleColor(UIColor.white, for: .disabled)
button.setBackgroundColor(color: UIColor.brandMainColor, forState: .normal)
button.setBackgroundColor(color: UIColor.brandMainColor.withAlphaComponent(0.3), forState: .disabled)
button.layer.cornerRadius = kCornerRadius3
button.clipsToBounds = true
button.addTarget(self, action: #selector(clickNextBtn), for: .touchUpInside)
button.backgroundColor = UIColor.brandMainColor
return button
}()
......@@ -84,15 +85,13 @@ private extension YHResignUploadTravelCardListViewController {
func loadData() {
let params: [String : Any] = ["order_id": orderId]
YHHUD.show(.progress(message: "加载中..."))
// viewModel.getTravelDocsList(orderID: 132957, renewalId: 288, callBackBlock: {[weak self] success, error in
viewModel.getTravelDocsList(orderID: orderId, renewalId: batchId, callBackBlock: {[weak self] success, error in
YHHUD.hide()
guard let self = self else { return }
if success {
if self.viewModel.arrTravelDocs.is_report_redirect {
rewardBtn.isEnabled = true
} else {
rewardBtn.isEnabled = false
}
self.tableView.reloadData()
})
......@@ -131,7 +130,7 @@ private extension YHResignUploadTravelCardListViewController {
extension YHResignUploadTravelCardListViewController: UITableViewDelegate, UITableViewDataSource {
func numberOfSections(in tableView: UITableView) -> Int {
return viewModel.arrTravelDocs.count
return viewModel.arrTravelDocs.list.count
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
......@@ -140,7 +139,7 @@ extension YHResignUploadTravelCardListViewController: UITableViewDelegate, UITab
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let approveCell = tableView.dequeueReusableCell(withIdentifier: YHResignUploadTravelCardListTableViewCell.cellReuseIdentifier, for: indexPath) as! YHResignUploadTravelCardListTableViewCell
approveCell.dataModel = viewModel.arrTravelDocs[indexPath.section]
approveCell.dataModel = viewModel.arrTravelDocs.list[indexPath.section]
return approveCell
}
......@@ -149,7 +148,7 @@ extension YHResignUploadTravelCardListViewController: UITableViewDelegate, UITab
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let model = viewModel.arrTravelDocs[indexPath.section]
let model = viewModel.arrTravelDocs.list[indexPath.section]
if model.status == 2 {
return
} else {
......
......@@ -15,7 +15,7 @@ class YHResignUploadTravelHKViewController: YHBaseViewController {
let vm = YHResignUploadTravelCardDetailViewModel()
return vm
}()
var fatherData: YHResignUploadTravelCardListModel = YHResignUploadTravelCardListModel()
var fatherData: YHResignUploadTravelCardListDetailModel = YHResignUploadTravelCardListDetailModel()
//上个界面传递过来的数据对象
var dataModel : YHResignUploadTravelCardDetailModel = YHResignUploadTravelCardDetailModel()
var orderId: Int = 0
......
......@@ -16,7 +16,7 @@ class YHResignUploadTravelPassportViewController: YHBaseViewController {
return vm
}()
var fatherData: YHResignUploadTravelCardListModel = YHResignUploadTravelCardListModel()
var fatherData: YHResignUploadTravelCardListDetailModel = YHResignUploadTravelCardListDetailModel()
//上个界面传递过来的数据对象
var dataModel : YHResignUploadTravelCardDetailModel = YHResignUploadTravelCardDetailModel()
var orderId: Int = 0
......
......@@ -10,6 +10,15 @@ import UIKit
import SmartCodable
class YHResignUploadTravelCardListModel: SmartCodable {
var is_report_redirect: Bool = false
var list : [YHResignUploadTravelCardListDetailModel] = []
required init() {
}
}
class YHResignUploadTravelCardListDetailModel: SmartCodable {
var id : Int = -1//用户id
var name : String = ""//用户姓名
var type : String = ""//用户类型
......
......@@ -13,7 +13,7 @@ class YHResignUploadTravelCardListTableViewCell: UITableViewCell {
static let cellReuseIdentifier = "YHResignUploadTravelCardListTableViewCell"
static let cellH : CGFloat = 70
var dataModel : YHResignUploadTravelCardListModel? {
var dataModel : YHResignUploadTravelCardListDetailModel? {
didSet {
updataUI()
}
......
......@@ -11,7 +11,7 @@ import UIKit
class YHResignUploadTravelCardViewModel: YHBaseViewModel {
//列表信息
var arrTravelDocs : [YHResignUploadTravelCardListModel] = []
var arrTravelDocs : YHResignUploadTravelCardListModel = YHResignUploadTravelCardListModel()
//旅行证件嫌弃
var travelDetailModel : YHTravelDocsPreparationDetailModel?
......@@ -31,13 +31,13 @@ extension YHResignUploadTravelCardViewModel {
printLog("model 是 ==> \(json)")
if json.code == 200 {
guard let dic = json.data?.peel as? [Any],let list = [YHResignUploadTravelCardListModel].deserialize(from: dic) else {
guard let dic = json.data?.peel as? [String : Any], let resultModel = YHResignUploadTravelCardListModel.deserialize(from: dic) else {
let err = YHErrorModel(errorCode: YHErrorCode.dictParseError.rawValue, errorMsg: YHErrorCode.dictParseError.description())
self.arrTravelDocs = []
self.travelDetailModel = nil
callBackBlock(false, err)
return
}
self.arrTravelDocs = list
self.arrTravelDocs = resultModel
callBackBlock(true, nil)
} else {
......
......@@ -610,4 +610,10 @@ class YHAllApiName {
static let detail = "super-app/renewal/travel-cert-detail"
static let save = "super-app/renewal/travel-cert-save"
}
//续签结果查看
struct ResignResult {
static let result = "super-app/renewal/renewal-result"
}
}
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