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

我的签字详情接口调试

parent cf92146c
......@@ -104,6 +104,9 @@
04C8F4832B7216D800ADF59B /* YHUserInfoHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04C8F4822B7216D800ADF59B /* YHUserInfoHeaderView.swift */; };
04D5C5662B8ED92600190021 /* YHBaseModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04D5C5652B8ED92600190021 /* YHBaseModel.swift */; };
04E58C6F2B9B16CE00C36131 /* YHMySignatureListTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E58C6E2B9B16CE00C36131 /* YHMySignatureListTableViewCell.swift */; };
04E58C712B9EDE4A00C36131 /* YHMySignatureDetailViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E58C702B9EDE4A00C36131 /* YHMySignatureDetailViewController.swift */; };
04E58C732B9EEEBF00C36131 /* YHMySignatureDetailViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E58C722B9EEEBF00C36131 /* YHMySignatureDetailViewModel.swift */; };
04E58C752B9EEF1E00C36131 /* YHMySignatureDetailModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E58C742B9EEF1E00C36131 /* YHMySignatureDetailModel.swift */; };
04E86E092B707ACE00A35F4B /* YHPhoneLoginViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E86E082B707ACE00A35F4B /* YHPhoneLoginViewController.swift */; };
04E86E0B2B70C13300A35F4B /* YHCodeSueecssViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E86E0A2B70C13300A35F4B /* YHCodeSueecssViewController.swift */; };
04E86E0D2B70D51D00A35F4B /* YHWebViewViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E86E0C2B70D51D00A35F4B /* YHWebViewViewController.swift */; };
......@@ -430,6 +433,9 @@
04C8F4822B7216D800ADF59B /* YHUserInfoHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHUserInfoHeaderView.swift; sourceTree = "<group>"; };
04D5C5652B8ED92600190021 /* YHBaseModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHBaseModel.swift; sourceTree = "<group>"; };
04E58C6E2B9B16CE00C36131 /* YHMySignatureListTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMySignatureListTableViewCell.swift; sourceTree = "<group>"; };
04E58C702B9EDE4A00C36131 /* YHMySignatureDetailViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMySignatureDetailViewController.swift; sourceTree = "<group>"; };
04E58C722B9EEEBF00C36131 /* YHMySignatureDetailViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMySignatureDetailViewModel.swift; sourceTree = "<group>"; };
04E58C742B9EEF1E00C36131 /* YHMySignatureDetailModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMySignatureDetailModel.swift; sourceTree = "<group>"; };
04E86E082B707ACE00A35F4B /* YHPhoneLoginViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPhoneLoginViewController.swift; sourceTree = "<group>"; };
04E86E0A2B70C13300A35F4B /* YHCodeSueecssViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCodeSueecssViewController.swift; sourceTree = "<group>"; };
04E86E0C2B70D51D00A35F4B /* YHWebViewViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHWebViewViewController.swift; sourceTree = "<group>"; };
......@@ -851,6 +857,7 @@
isa = PBXGroup;
children = (
047294F42B9B0C49008E0B84 /* YHMySignatureListViewController.swift */,
04E58C702B9EDE4A00C36131 /* YHMySignatureDetailViewController.swift */,
);
path = C;
sourceTree = "<group>";
......@@ -875,6 +882,7 @@
isa = PBXGroup;
children = (
047295032B9B139D008E0B84 /* YHMySignatureListModel.swift */,
04E58C742B9EEF1E00C36131 /* YHMySignatureDetailModel.swift */,
);
path = Model;
sourceTree = "<group>";
......@@ -883,6 +891,7 @@
isa = PBXGroup;
children = (
047295062B9B13A9008E0B84 /* YHMySignatureListViewModel.swift */,
04E58C722B9EEEBF00C36131 /* YHMySignatureDetailViewModel.swift */,
);
path = VM;
sourceTree = "<group>";
......@@ -1954,6 +1963,7 @@
0413A6D82B8C76290006D154 /* YHCertificateUploadVC.swift in Sources */,
A5ACE93A2B4564F7002C94D2 /* NSAttributedString+Extension.swift in Sources */,
04E86E662B86EB6F00A35F4B /* YHLoginManager.swift in Sources */,
04E58C712B9EDE4A00C36131 /* YHMySignatureDetailViewController.swift in Sources */,
A554A5002B95FB9100EA5973 /* YHMainInfoPreviewModel.swift in Sources */,
042F888B2B8477C6008B60BD /* YHEducationInfo.swift in Sources */,
04AF58C42B4FC51C0066011A /* YHLocalizable.swift in Sources */,
......@@ -2089,6 +2099,7 @@
A5C5B3122B57B47D00A7C5D1 /* YHDavidCell0.swift in Sources */,
A5FD63FA2B68D95700D1D9DA /* YHPersonInfoIdentityCardModel.swift in Sources */,
A50AB89B2B81E96E00C227DE /* YHOtherInfoFillModel.swift in Sources */,
04E58C732B9EEEBF00C36131 /* YHMySignatureDetailViewModel.swift in Sources */,
A56D2D612B62020C009C83A8 /* YHContractMainItemStatusCell.swift in Sources */,
0468D43A2B579EAC00CFB916 /* YHLoginViewModel.swift in Sources */,
A5234E282B6E2EED00A33433 /* YHBasicInfoFillViewController.swift in Sources */,
......@@ -2142,6 +2153,7 @@
04E86E512B847D1B00A35F4B /* YHWorkMessageSelectTableViewCell.swift in Sources */,
A5ACE9572B4564F7002C94D2 /* YHBasicContentView.swift in Sources */,
04B0239C2B91F3EF00B83629 /* YHIdentityCardCell.swift in Sources */,
04E58C752B9EEF1E00C36131 /* YHMySignatureDetailModel.swift in Sources */,
04E86E3E2B834FC100A35F4B /* YHWorkExperienceTextItemView.swift in Sources */,
042FBBC92B64DC8900F9DE23 /* YHFormItemExpireDateCell.swift in Sources */,
A5234E2E2B6E43EA00A33433 /* YHBasicInfoFillView.swift in Sources */,
......
//
// YHMySignatureDetailViewController.swift
// galaxy
//
// Created by EDY on 2024/3/11.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHMySignatureDetailViewController: YHBaseViewController {
var bottomView: UIView!
var bottomButton: UIButton!
var tableView: UITableView!
var dataSource: [YHWorkItemListModel]?
var viewModel: YHMySignatureDetailViewModel?
var id: Int = 0
override func viewDidLoad() {
super.viewDidLoad()
viewModel = YHMySignatureDetailViewModel()
gk_navTitle = "我的签字"
setView()
getData()
// Do any additional setup after loading the view.
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
getData()
}
func getData() {
viewModel?.requestSignatureDetail("\(id)", callBackBlock: {[weak self] success, error in
guard let self = self else { return }
self.tableView.reloadData()
})
}
func updateDataSource() {
self.tableView.reloadData()
}
func setView() {
tableView = {
let tableView = UITableView(frame:.zero, style:.plain)
if #available(iOS 11.0, *) {
tableView.contentInsetAdjustmentBehavior = .never
}
tableView.backgroundColor = .clear
tableView.separatorStyle = .none
tableView.delegate = self
tableView.dataSource = self
tableView.register(cellWithClass: YHMySignatureListTableViewCell.self)
return tableView
}()
view.addSubview(tableView)
tableView.snp.makeConstraints { make in
make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
make.bottom.equalTo(-k_Height_safeAreaInsetsBottom() - 64)
make.left.right.bottom.equalTo(view)
}
bottomView = {
let bottom = UIView()
bottom.backgroundColor = .white
return bottom
}()
view.addSubview(bottomView)
bottomView.snp.makeConstraints { make in
make.left.right.bottom.equalToSuperview()
make.height.equalTo(k_Height_safeAreaInsetsBottom() + 64)
}
bottomButton = {
let button = UIButton(type: .custom)
// button.backgroundColor = UIColor(hex:0x2274ee)
button.titleLabel?.font = UIFont.PFSC_M(ofSize: 16)
button.contentHorizontalAlignment = .center
button.setTitle("提交", for: .normal)
button.setTitleColor( UIColor(hex:0xffffff), for: .normal)
button.layer.cornerRadius = kCornerRadius6
button.clipsToBounds = true
button.addTarget(self, action: #selector(submit), for: .touchUpInside)
return button
}()
bottomView.addSubview(bottomButton)
bottomButton.snp.makeConstraints { make in
make.right.equalTo(-16)
make.top.equalTo(8)
make.height.equalTo(48)
make.left.equalTo(16)
}
bottomButton.layoutIfNeeded()
bottomButton.addYinHeGradualLayer()
}
@objc func submit() {
}
}
extension YHMySignatureDetailViewController: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 1
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withClass: YHMySignatureListTableViewCell.self)
cell.backgroundColor = .clear
cell.contentView.backgroundColor = .clear
return cell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return CGFloat(82)
}
}
......@@ -14,9 +14,7 @@ class YHMySignatureListViewController: YHBaseViewController {
var tableView: UITableView!
var dataSource: [YHWorkItemListModel]?
var viewModel: YHMySignatureListViewModel?
var isMore: Bool = false
var orderId: Int = 0
var showPrompt: Bool = false
override func viewDidLoad() {
super.viewDidLoad()
viewModel = YHMySignatureListViewModel()
......@@ -34,6 +32,7 @@ class YHMySignatureListViewController: YHBaseViewController {
func getData() {
viewModel?.requestSignatureList("\(orderId)", callBackBlock: {[weak self] success, error in
guard let self = self else { return }
self.tableView.reloadData()
})
}
......@@ -104,11 +103,12 @@ class YHMySignatureListViewController: YHBaseViewController {
extension YHMySignatureListViewController: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 1
return viewModel?.mainModel?.list.count ?? 0
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withClass: YHMySignatureListTableViewCell.self)
cell.dataSource = viewModel?.mainModel?.list[indexPath.row]
cell.backgroundColor = .clear
cell.contentView.backgroundColor = .clear
return cell
......@@ -117,5 +117,12 @@ extension YHMySignatureListViewController: UITableViewDelegate, UITableViewDataS
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return CGFloat(82)
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let model = viewModel?.mainModel?.list[indexPath.row]
let vc = YHMySignatureDetailViewController()
vc.id = model?.id ?? 0
self.navigationController?.pushViewController(vc)
}
}
//
// YHMySignatureDetailModel.swift
// galaxy
//
// Created by EDY on 2024/3/11.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHMySignatureDetailModel: YHBaseModel {
var id: Int = 0
var order_id: Int = 0
var doc_type: Int = 0
var doc_send: String = ""
var doc_type_name: String = ""
var doc_return: [String] = []
var doc_return_manual: [String] = []
var is_upload: Int = 0
var is_show_button: Bool = false
var status: Int = 0
}
......@@ -12,6 +12,11 @@ class YHMySignatureListTableViewCell: UITableViewCell {
var centerView: UIView!
var titleLabel: UILabel!
var subTitleLabel: UILabel!
var dataSource: YHMySignatureModel? {
didSet {
updateAllViews()
}
}
override func awakeFromNib() {
super.awakeFromNib()
......@@ -53,7 +58,6 @@ class YHMySignatureListTableViewCell: UITableViewCell {
titleLabel = {
let label = UILabel()
label.font = UIFont.PFSC_M(ofSize: 17)
label.text = "主申请人工作经历"
label.textColor = UIColor.mainTextColor
return label
}()
......@@ -67,7 +71,6 @@ class YHMySignatureListTableViewCell: UITableViewCell {
subTitleLabel = {
let label = UILabel()
label.font = UIFont.PFSC_R(ofSize: 12)
label.text = "(从最近一份全职工作开始,直至毕业后的第一份工作)"
label.textColor = UIColor.labelTextColor2
label.textAlignment = .right
return label
......@@ -82,7 +85,9 @@ class YHMySignatureListTableViewCell: UITableViewCell {
}
func updateAllViews() {
guard let dataSource = dataSource else { return }
titleLabel.text = dataSource.doc_name
subTitleLabel.text = "\(dataSource.doc_type)"
}
}
//
// YHMySignatureDetailViewModel.swift
// galaxy
//
// Created by EDY on 2024/3/11.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHMySignatureDetailViewModel: YHBaseViewModel {
var mainModel: YHMySignatureDetailModel?
override init() {
super.init()
}
func requestSignatureDetail(_ id: String, callBackBlock:@escaping (_ success: Bool?, _ error: YHErrorModel?)->()) {
// let params: [String : Any] = ["order_id": orderId]
let params: [String : Any] = ["id": id]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Signature.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 {
let dic = json.data
guard let result = YHMySignatureDetailModel.deserialize(from: dic as? Dictionary) else {
callBackBlock(false,nil)
return
}
self.mainModel = result
callBackBlock(true, nil)
} else {
let error : YHErrorModel = YHErrorModel(errorCode:Int32(json.code), errorMsg: json.msg)
callBackBlock(false, error)
}
} failBlock: { err in
callBackBlock(false, err)
}
}
}
......@@ -10,25 +10,26 @@ import UIKit
class YHMySignatureListViewModel: YHBaseViewModel {
var mainModel: [YHWorkItemListModel]?
var mainModel: YHMySignatureListModel?
override init() {
super.init()
}
func requestSignatureList(_ orderId: String, callBackBlock:@escaping (_ success: Bool?, _ error: YHErrorModel?)->()) {
let params: [String : Any] = ["order_id": orderId]
// let params: [String : Any] = ["order_id": orderId]
let params: [String : Any] = ["order_id": 134154]
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Signature.list
let _ = YHNetRequest.postRequest(url: strUrl, params: params) { [weak self] json, code in
let _ = YHNetRequest.getRequest(url: strUrl, params: params) { [weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
if json.code == 200 {
let dic = json.data
guard let result = YHWorkModel.deserialize(from: dic as? Dictionary) else {
guard let result = YHMySignatureListModel.deserialize(from: dic as? Dictionary) else {
callBackBlock(false,nil)
return
}
self.mainModel = result.list
self.mainModel = result
callBackBlock(true, nil)
} else {
let error : YHErrorModel = YHErrorModel(errorCode:Int32(json.code), errorMsg: json.msg)
......
......@@ -179,7 +179,8 @@ class YHAllApiName {
struct Signature {
// 签字列表
static let list = "/infoflow/my-sign/list"
static let list = "infoflow/my-sign/list"
// 签字详情
static let detail = "infoflow/my-sign/detail"
}
}
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