Commit 255d709e authored by Steven杜宇's avatar Steven杜宇

// 原则批

parent aac95372
......@@ -357,6 +357,8 @@
04B360EB2C60E88C001EB053 /* YHPrincipleCongratulationAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B360EA2C60E88C001EB053 /* YHPrincipleCongratulationAlertView.swift */; };
04B360ED2C61F157001EB053 /* YHPrincipleEnvelopeCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B360EC2C61F157001EB053 /* YHPrincipleEnvelopeCell.swift */; };
04B360EF2C620975001EB053 /* YHPrincipleUploadStatusCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B360EE2C620975001EB053 /* YHPrincipleUploadStatusCell.swift */; };
04B360F12C635A33001EB053 /* YHPrincipleWaitResultModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B360F02C635A33001EB053 /* YHPrincipleWaitResultModel.swift */; };
04B360F32C636525001EB053 /* YHPrincipleWaitResultViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B360F22C636525001EB053 /* YHPrincipleWaitResultViewController.swift */; };
04B9EE5A2C06CC3100A4018D /* YHCodeSueecssViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B9EE582C06CC3100A4018D /* YHCodeSueecssViewController.swift */; };
04B9EE5B2C06CC3100A4018D /* YHOtherLoginViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04B9EE592C06CC3100A4018D /* YHOtherLoginViewController.swift */; };
04C693622B723AB8004C1758 /* YHMySettingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04C693612B723AB8004C1758 /* YHMySettingViewController.swift */; };
......@@ -996,6 +998,8 @@
04B360EA2C60E88C001EB053 /* YHPrincipleCongratulationAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPrincipleCongratulationAlertView.swift; sourceTree = "<group>"; };
04B360EC2C61F157001EB053 /* YHPrincipleEnvelopeCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPrincipleEnvelopeCell.swift; sourceTree = "<group>"; };
04B360EE2C620975001EB053 /* YHPrincipleUploadStatusCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPrincipleUploadStatusCell.swift; sourceTree = "<group>"; };
04B360F02C635A33001EB053 /* YHPrincipleWaitResultModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPrincipleWaitResultModel.swift; sourceTree = "<group>"; };
04B360F22C636525001EB053 /* YHPrincipleWaitResultViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPrincipleWaitResultViewController.swift; sourceTree = "<group>"; };
04B9EE582C06CC3100A4018D /* YHCodeSueecssViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHCodeSueecssViewController.swift; sourceTree = "<group>"; };
04B9EE592C06CC3100A4018D /* YHOtherLoginViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = YHOtherLoginViewController.swift; sourceTree = "<group>"; };
04C693612B723AB8004C1758 /* YHMySettingViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMySettingViewController.swift; sourceTree = "<group>"; };
......@@ -2185,6 +2189,7 @@
children = (
0472CB9B2C5A11640096F48F /* YHPrincipleCongratulationVC.swift */,
0472CB9C2C5A11640096F48F /* YHPrincipleReviewListVC.swift */,
04B360F22C636525001EB053 /* YHPrincipleWaitResultViewController.swift */,
);
path = C;
sourceTree = "<group>";
......@@ -2193,6 +2198,7 @@
isa = PBXGroup;
children = (
0472CB9E2C5A11640096F48F /* YHPrincleGroupModel.swift */,
04B360F02C635A33001EB053 /* YHPrincipleWaitResultModel.swift */,
);
path = M;
sourceTree = "<group>";
......@@ -3702,6 +3708,7 @@
A59B43CF2C4B5AD100B28379 /* YHShareViewOnTablebarView.swift in Sources */,
A5ACE94A2B4564F7002C94D2 /* YHHUDProgressView.swift in Sources */,
04A271232BABFF3200652B1B /* YHCertificateUploadTypeCell.swift in Sources */,
04B360F32C636525001EB053 /* YHPrincipleWaitResultViewController.swift in Sources */,
A582B2412BB95998009D098C /* YHHKPlanTipsCell.swift in Sources */,
A5D0012C2BABC84A001F003C /* YHFileListBottomView.swift in Sources */,
04E41DE82BD240570077EAE3 /* YHOrderDetailViewController.swift in Sources */,
......@@ -3861,6 +3868,7 @@
045EEEBA2B9F171A0022A143 /* YHWorkResponsibilitiesTableViewCell.swift in Sources */,
047AA3ED2C4A70F6009C4554 /* YHHeadView.swift in Sources */,
04AD317F2C295C0300DF5655 /* YHChangeHeadModel.swift in Sources */,
04B360F12C635A33001EB053 /* YHPrincipleWaitResultModel.swift in Sources */,
A5ACE9552B4564F7002C94D2 /* YHTabBarViewController.swift in Sources */,
045EEF0A2B9F171A0022A143 /* YHBasicInfoSessionModel.swift in Sources */,
045EEF022B9F171A0022A143 /* YHFormItemDegreeInfoCell.swift in Sources */,
......
......@@ -210,6 +210,8 @@ extension YHServiceOrderListView : UITableViewDelegate,UITableViewDataSource {
navigationController?.pushViewController(vc)
} else if model.type == 11 {
//正在等待原则批结果
} else if model.type == 12 {
//正在进行原则批补件~
} else if model.type == 13 {
......
......@@ -10,7 +10,10 @@ import UIKit
class YHPrincipleReviewListVC: YHBaseViewController {
var items: [YHPrincleGroupModel] = []
var orderId: Int = 0
var status: Int = 0
var items: [YHPrincipleWaitResultModel] = []
let viewModel = YHPrincleViewModel()
lazy var tableView: UITableView = {
let tableView = UITableView(frame:.zero, style:.grouped)
tableView.contentInsetAdjustmentBehavior = .never
......@@ -22,8 +25,8 @@ class YHPrincipleReviewListVC: YHBaseViewController {
tableView.dataSource = self
tableView.backgroundColor = .clear
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell")
tableView.register(YHPrinciplePhotoCollectCell.self, forCellReuseIdentifier: YHPrinciplePhotoCollectCell.cellReuseIdentifier)
tableView.register(YHPrincipleUnapprovedCell.self, forCellReuseIdentifier: YHPrincipleUnapprovedCell.cellReuseIdentifier)
tableView.register(YHPrincipleUploadStatusCell.self, forCellReuseIdentifier: YHPrincipleUploadStatusCell.cellReuseIdentifier)
return tableView
}()
......@@ -45,22 +48,8 @@ class YHPrincipleReviewListVC: YHBaseViewController {
self.gk_navTitle = "原则批"
gk_navigationBar.backgroundColor = .clear
createUI()
items.removeAll()
let m1 = YHPrincleGroupModel()
m1.fileList = ["新公司在职证明.pdf",
"主申人的曾用名证明文件.pdf"]
let m2 = YHPrincleGroupModel()
m2.fileList = ["新公司在职证明.pdf",
"主申人的曾用名证明文件.pdf",
"无刑事罪行记录证明.pdf",
"新公司在职证明.pdf",
"主申人的曾用名证明文件.pdf",
"无刑事罪行记录证明.pdf"]
items.append(contentsOf: [m1, m2])
self.tableView.reloadData()
}
func createUI() {
......@@ -77,6 +66,11 @@ class YHPrincipleReviewListVC: YHBaseViewController {
}
}
extension YHPrincipleReviewListVC {
}
extension YHPrincipleReviewListVC: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
......@@ -88,7 +82,7 @@ extension YHPrincipleReviewListVC: UITableViewDelegate, UITableViewDataSource {
// YHPrinciplePhotoCell
// YHPrincipleUnapprovedCell
if indexPath.row%2 == 0 {
// if indexPath.row%2 == 0 {
let cell = tableView.dequeueReusableCell(withIdentifier: YHPrincipleUnapprovedCell.cellReuseIdentifier, for: indexPath) as! YHPrincipleUnapprovedCell
if 0 <= indexPath.row && indexPath.row < items.count {
......@@ -97,25 +91,25 @@ extension YHPrincipleReviewListVC: UITableViewDelegate, UITableViewDataSource {
cell.expandClick = {
[weak self] isExpand in
guard let self = self else { return }
model.isExpand = isExpand
model.isUnfold = isExpand
self.tableView.reloadData()
}
}
return cell
}
// return cell
// }
let cell = tableView.dequeueReusableCell(withIdentifier: YHPrincipleUploadStatusCell.cellReuseIdentifier, for: indexPath) as! YHPrincipleUploadStatusCell
if 0 <= indexPath.row && indexPath.row < items.count {
let model = items[indexPath.row]
cell.updateModel(model)
cell.expandClick = {
[weak self] isExpand in
guard let self = self else { return }
model.isExpand = isExpand
self.tableView.reloadData()
}
}
// let cell = tableView.dequeueReusableCell(withIdentifier: YHPrincipleUploadStatusCell.cellReuseIdentifier, for: indexPath) as! YHPrincipleUploadStatusCell
//
// if 0 <= indexPath.row && indexPath.row < items.count {
// let model = items[indexPath.row]
// cell.updateModel(model)
// cell.expandClick = {
// [weak self] isExpand in
// guard let self = self else { return }
// model.isUnfold = isExpand
// self.tableView.reloadData()
// }
// }
return cell
}
......
//
// YHPrincipleWaitResultViewController.swift
// galaxy
//
// Created by edy on 2024/8/7.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHPrincipleWaitResultViewController: YHBaseViewController {
var orderId: Int = 0
var status: Int = 0
var items: [YHPrincipleWaitResultModel] = []
let viewModel = YHPrincleViewModel()
lazy var tableView: UITableView = {
let tableView = UITableView(frame:.zero, style:.grouped)
tableView.contentInsetAdjustmentBehavior = .never
tableView.estimatedSectionHeaderHeight = 24.0
tableView.estimatedSectionFooterHeight = 1.0
tableView.showsVerticalScrollIndicator = false
tableView.separatorStyle = .none
tableView.delegate = self
tableView.dataSource = self
tableView.backgroundColor = .clear
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell")
tableView.register(YHPrincipleUnapprovedCell.self, forCellReuseIdentifier: YHPrincipleUnapprovedCell.cellReuseIdentifier)
tableView.register(YHPrinciplePhotoListCell.self, forCellReuseIdentifier: YHPrinciplePhotoListCell.cellReuseIdentifier)
return tableView
}()
lazy var bgView:UIView = {
let view = UIView()
view.backgroundColor = UIColor.init(hex: 0xF8F8F8)
let imgView = UIImageView(image: UIImage(named: "principle_detail_head_bg"))
view.addSubview(imgView)
imgView.snp.makeConstraints { make in
make.left.right.top.equalToSuperview()
make.height.equalTo(imgView.snp.width)
}
return view
}()
override func viewDidLoad() {
super.viewDidLoad()
self.view.backgroundColor = .white
self.gk_navTitle = "原则批"
gk_navigationBar.backgroundColor = .clear
createUI()
getPrincipleWaitResult()
}
func createUI() {
view.addSubview(bgView)
view.addSubview(tableView)
bgView.snp.makeConstraints { make in
make.top.left.right.equalToSuperview()
make.bottom.equalToSuperview()
}
tableView.snp.makeConstraints { make in
make.top.equalToSuperview().offset(k_Height_NavigationtBarAndStatuBar)
make.left.right.bottom.equalToSuperview()
}
}
}
extension YHPrincipleWaitResultViewController {
func getPrincipleWaitResult() {
let params: [String : Any] = ["order_id" : orderId,
"search_type" : 1]
viewModel.getPrincipleWaitReviewResult(params: params) { success, error in
if let waitResultModel = self.viewModel.waitResultModel {
self.items.removeAll()
if waitResultModel.resultImageList.count > 0 {
// 实时入境处身份申请进度
let model1 = waitResultModel.copy()
model1.type = .photo
model1.title = "实时入境处身份申请进度"
model1.isUnfold = true
self.items.append(model1)
}
// 入境处已认收受理
let model2 = waitResultModel.copy()
model2.type = .entry
model2.title = "入境处已认收受理"
model2.subTitle = "申请确认通知书:(来自香港入境处)"
model2.isUnfold = false
self.items.append(model2)
// 入境处已认收受理
let model3 = waitResultModel.copy()
model3.type = .profile
model3.title = "申请资料已递交港府留档"
model3.subTitle = "档案号:"
model3.isUnfold = false
self.items.append(model3)
self.tableView.reloadData()
}
}
}
}
extension YHPrincipleWaitResultViewController: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return items.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
if 0 <= indexPath.row && indexPath.row < items.count {
let model = items[indexPath.row]
if model.type == .photo {
let cell = tableView.dequeueReusableCell(withIdentifier: YHPrinciplePhotoListCell.cellReuseIdentifier, for: indexPath) as! YHPrinciplePhotoListCell
cell.updateModel(model)
cell.expandClick = {
[weak self] isUnfold in
guard let self = self else { return }
model.isUnfold = isUnfold
self.tableView.reloadData()
}
return cell
}
}
let cell = tableView.dequeueReusableCell(withIdentifier: YHPrincipleUnapprovedCell.cellReuseIdentifier, for: indexPath) as! YHPrincipleUnapprovedCell
if 0 <= indexPath.row && indexPath.row < items.count {
let model = items[indexPath.row]
if model.type == .profile || model.type == .entry {
cell.updateModel(model)
cell.expandClick = {
[weak self] isUnfold in
guard let self = self else { return }
model.isUnfold = isUnfold
self.tableView.reloadData()
}
}
}
return cell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return UITableView.automaticDimension
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if 0 <= indexPath.section && indexPath.section < items.count {
#if DEBUG
if true {
let vc = YHPrincipleCongratulationVC()
self.navigationController?.pushViewController(vc)
return
}
#endif
}
}
private func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> CGFloat {
return 24.0
}
private func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> CGFloat {
return 1.0
}
func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
return UIView()
}
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
return UIView()
}
}
//
// YHPrincipleWaitResultModel.swift
// galaxy
//
// Created by edy on 2024/8/7.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import SmartCodable
enum YHPrincipleWaitItemType: Int {
case none = 0
case photo = 1 // 实时入境处身份申请进度
case entry = 2 // 入境处已认收受理
case profile = 3 // 申请资料已递交港府留档
}
class YHPrincipleWaitResultModel: SmartCodable {
var lastQueryAt: String = ""
var queryCount: Int = 0
var fileNumberList: [YHFileNumberList] = []
var resultImageList: [YHResultImageList] = []
var applicant: YHApplicant = YHApplicant()
var applicationFileNumberAttachment: String = ""
// 自定义属性
var isUnfold = false // 是否展开
var type: YHPrincipleWaitItemType = .none
var title: String = ""
var subTitle: String = ""
enum CodingKeys: String, CodingKey {
case lastQueryAt = "last_query_at"
case queryCount = "query_count"
case fileNumberList = "file_number_list"
case resultImageList = "result_image_list"
case applicant
case applicationFileNumberAttachment = "application_file_number_attachment"
}
required init() {
}
init(lastQueryAt: String, queryCount: Int, fileNumberList: [YHFileNumberList], resultImageList: [YHResultImageList], applicant: YHApplicant, applicationFileNumberAttachment: String) {
self.lastQueryAt = lastQueryAt
self.queryCount = queryCount
self.fileNumberList = fileNumberList
self.resultImageList = resultImageList
self.applicant = applicant
self.applicationFileNumberAttachment = applicationFileNumberAttachment
}
func copy() -> YHPrincipleWaitResultModel {
return YHPrincipleWaitResultModel(lastQueryAt: lastQueryAt,
queryCount: queryCount,
fileNumberList: fileNumberList,
resultImageList: resultImageList,
applicant: applicant,
applicationFileNumberAttachment: applicationFileNumberAttachment)
}
}
// MARK: - Applicant
class YHApplicant: SmartCodable {
var id: Int = 0
var sex: Int = 0
var userName: String = ""
enum CodingKeys: String, CodingKey {
case id, sex
case userName = "user_name"
}
required init() {
}
}
// MARK: - FileNumberList
class YHFileNumberList: SmartCodable {
var applicationName: String = ""
var fileNumber: String = ""
enum CodingKeys: String, CodingKey {
case applicationName = "application_name"
case fileNumber = "file_number"
}
required init() {
}
}
class YHResultImageList: SmartCodable {
var applicationName: String = ""
var logNumber: Int = 0
var fileNumber: String = ""
var image: String = ""
enum CodingKeys: String, CodingKey {
case applicationName = "application_name"
case logNumber = "log_number"
case fileNumber = "file_number"
case image
}
required init() {
}
}
......@@ -11,6 +11,8 @@ import AttributedString
class YHPrincleGroupModel: NSObject {
var title: String = ""
var subTitle: String = ""
var fileList:[String] = []
var isExpand:Bool = false
var isNeedTemplate: Bool = true
......
......@@ -38,6 +38,12 @@ class YHPrinciplePhotoCollectCell: UICollectionViewCell {
fatalError("init(coder:) has not been implemented")
}
func updateModel(_ model: YHResultImageList) {
titleLabel.text = model.applicationName
imgView.sd_setImage(with: URL(string: model.image))
}
var isSinglePhoto: Bool = false {
didSet {
let imgHeight = isSinglePhoto ? 170.0 : 80.0
......
......@@ -10,9 +10,9 @@ import UIKit
class YHPrinciplePhotoListCell: UITableViewCell {
static let cellReuseIdentifier = "YHPrinciplePhotoCell"
var itemModel:YHPrincleGroupModel?
var items: [String] = []
static let cellReuseIdentifier = "YHPrinciplePhotoListCell"
var itemModel:YHPrincipleWaitResultModel?
var items: [YHResultImageList] = []
var expandClick:((Bool)->())?
lazy var iconImgView:UIImageView = {
......@@ -79,20 +79,21 @@ class YHPrinciplePhotoListCell: UITableViewCell {
@objc func didExpandBtnClicked() {
guard let model = itemModel else { return }
expandClick?(!model.isExpand)
expandClick?(!model.isUnfold)
}
func updateModel(_ model:YHPrincleGroupModel) {
func updateModel(_ model:YHPrincipleWaitResultModel) {
itemModel = model
items.removeAll()
items.append(contentsOf: model.fileList)
whiteView.isHidden = !model.isExpand
let imgName = model.isExpand ? "custom_service_expand_1" : "custom_service_expand_0"
items.append(contentsOf: model.resultImageList)
whiteView.isHidden = !model.isUnfold
let imgName = model.isUnfold ? "custom_service_expand_1" : "custom_service_expand_0"
expandBtn.setImage(UIImage(named: imgName), for: .normal)
expandBtn.isHidden = items.count <= 0
timeLabel.text = "最新更新时间:\(model.lastQueryAt)\n已累计为您查询\(model.queryCount)次"
if !model.isExpand || items.count <= 0 {
if !model.isUnfold || items.count <= 0 {
whiteView.removeSubviews()
whiteView.snp.remakeConstraints { make in
make.top.equalTo(titleLabel.snp.bottom).offset(0.0)
......@@ -211,6 +212,10 @@ extension YHPrinciplePhotoListCell: UICollectionViewDelegateFlowLayout, UICollec
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: YHPrinciplePhotoCollectCell.cellReuseIdentifier, for: indexPath) as! YHPrinciplePhotoCollectCell
cell.isSinglePhoto = items.count == 1
if 0 <= indexPath.item, indexPath.item < items.count {
let model = items[indexPath.item]
cell.updateModel(model)
}
return cell
}
......
......@@ -8,6 +8,18 @@
import UIKit
class YHPrincipleFileModel {
var url: String = ""
var name: String = ""
var btnTitle: String = ""
init(url: String = "", name: String = "", btnTitle: String = "") {
self.url = url
self.name = name
self.btnTitle = btnTitle
}
}
class YHPrincipleUnapprovedItemView: UIView {
static let viewH: CGFloat = 20.0
......@@ -24,20 +36,23 @@ class YHPrincipleUnapprovedItemView: UIView {
let label = UILabel()
label.font = UIFont.PFSC_R(ofSize: 14)
label.textColor = UIColor.mainTextColor(alpha: 0.7)
label.text = "郑洁 QMEN-1207930-23(C)"
label.textAlignment = .left
return label
}()
lazy var rightBtn:UIButton = {
let btn = UIButton()
btn.setTitle("复制", for: .normal)
btn.titleLabel?.font = UIFont.PFSC_R(ofSize: 11)
btn.setTitleColor(UIColor.mainTextColor, for: .normal)
btn.backgroundColor = UIColor(hex: 0xF4F6FA)
btn.layer.cornerRadius = 10.0
return btn
}()
func updateModel(_ model: YHPrincipleFileModel) {
titleLabel.text = model.name
rightBtn.setTitle(model.btnTitle, for: .normal)
}
override init(frame: CGRect) {
super.init(frame: frame)
......@@ -76,15 +91,14 @@ class YHPrincipleUnapprovedItemView: UIView {
class YHPrincipleUnapprovedCell: UITableViewCell {
static let cellReuseIdentifier = "YHPrincipleUnapprovedCell"
var itemModel:YHPrincleGroupModel?
var items: [String] = []
var itemModel:YHPrincipleWaitResultModel?
var items: [YHPrincipleFileModel] = []
var expandClick:((Bool)->())?
lazy var titleLabel: UILabel = {
let label = UILabel()
label.font = UIFont.PFSC_R(ofSize: 15)
label.textColor = UIColor.mainTextColor
label.text = "申请资料已递交港府留档"
return label
}()
......@@ -92,7 +106,6 @@ class YHPrincipleUnapprovedCell: UITableViewCell {
let label = UILabel()
label.font = UIFont.PFSC_M(ofSize: 14)
label.textColor = UIColor.mainTextColor
label.text = "档案号:"
return label
}()
......@@ -116,17 +129,31 @@ class YHPrincipleUnapprovedCell: UITableViewCell {
return btn
}()
func updateModel(_ model:YHPrincleGroupModel) {
func updateModel(_ model:YHPrincipleWaitResultModel) {
itemModel = model
items.removeAll()
items.append(contentsOf: model.fileList)
whiteView.isHidden = !model.isExpand
let imgName = model.isExpand ? "custom_service_expand_1" : "custom_service_expand_0"
if model.type == .entry {
let url = model.applicationFileNumberAttachment
let name = url
let m = YHPrincipleFileModel(url:url, name:name, btnTitle: "查看")
items.append(m)
} else if model.type == .profile {
for file in model.fileNumberList {
let name = file.applicationName + " " + file.fileNumber
let m = YHPrincipleFileModel(name:name, btnTitle: "复制")
items.append(m)
}
}
titleLabel.text = model.title
listTitleLabel.text = model.subTitle
whiteView.isHidden = !model.isUnfold
let imgName = model.isUnfold ? "custom_service_expand_1" : "custom_service_expand_0"
expandBtn.setImage(UIImage(named: imgName), for: .normal)
expandBtn.isHidden = items.count <= 0
if !model.isExpand || items.count <= 0 {
if !model.isUnfold || items.count <= 0 {
whiteView.removeSubviews()
whiteView.snp.remakeConstraints { make in
make.top.equalTo(titleLabel.snp.bottom).offset(0.0)
......@@ -156,8 +183,9 @@ class YHPrincipleUnapprovedCell: UITableViewCell {
}
var lastItemView: UIView = listTitleLabel
for (index, title) in items.enumerated() {
for (index, model) in items.enumerated() {
let itemView = YHPrincipleUnapprovedItemView(frame: .zero)
itemView.updateModel(model)
whiteView.addSubview(itemView)
itemView.snp.makeConstraints { make in
make.left.right.equalTo(0)
......@@ -186,7 +214,7 @@ class YHPrincipleUnapprovedCell: UITableViewCell {
@objc func didExpandBtnClicked() {
guard let model = itemModel else { return }
expandClick?(!model.isExpand)
expandClick?(!model.isUnfold)
}
func setupUI() {
......
......@@ -9,5 +9,75 @@
import UIKit
class YHPrincleViewModel: NSObject {
var waitResultModel: YHPrincipleWaitResultModel?
func getPrincipleWaitReviewResult(params:[String : Any], callback:((_ success: Bool,_ error:YHErrorModel?)->())?) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Principle.getProfileList
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 {
let dic = json.data
guard let resultModel = YHPrincipleWaitResultModel.deserialize(dict: dic as? [AnyHashable : Any]) else {
let err = YHErrorModel(errorCode: YHErrorCode.dictParseError.rawValue, errorMsg: YHErrorCode.dictParseError.description())
self.waitResultModel = self.getTestModel()
callback?(false, err)
return
}
self.waitResultModel = resultModel
self.waitResultModel = self.getTestModel()
callback?(true, nil)
} else {
let err = YHErrorModel(errorCode: Int32(json.code), errorMsg: json.msg.isEmpty ? "" : json.msg)
self.waitResultModel = self.getTestModel()
callback?(false, err)
}
} failBlock: { err in
self.waitResultModel = self.getTestModel()
callback?(false, err)
}
}
func getTestModel() -> YHPrincipleWaitResultModel {
var files: [YHFileNumberList] = []
let m = YHFileNumberList()
m.applicationName = "杜宇"
m.fileNumber = "23412-AVAVS-SADFAS"
let m2 = YHFileNumberList()
m2.applicationName = "宇"
m2.fileNumber = "23412-AVAVS-SADFAS"
files.append(m)
files.append(m2)
var imgs: [YHResultImageList] = []
let n = YHResultImageList()
n.applicationName = "嘟嘟"
let n1 = YHResultImageList()
n1.applicationName = "嘟嘟"
let n2 = YHResultImageList()
n2.applicationName = "嘟嘟"
imgs.append(n)
imgs.append(n1)
imgs.append(n2)
let applicant = YHApplicant()
applicant.userName = "哈哈哈"
let model = YHPrincipleWaitResultModel(lastQueryAt: "2024-12-01 23:34:12",
queryCount: 40,
fileNumberList: files,
resultImageList: imgs,
applicant: applicant,
applicationFileNumberAttachment: "你要死啊")
return model
}
}
......@@ -340,7 +340,8 @@ extension YHMyViewController : UITableViewDelegate, UITableViewDataSource {
// YHPrincipleCongratulationAlertView.alertView().show()
let vc = YHPrincipleReviewListVC()
let vc = YHPrincipleWaitResultViewController()
vc.orderId = 123456
self.navigationController?.pushViewController(vc)
return
}
......
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