Commit 5879beb5 authored by Steven杜宇's avatar Steven杜宇

// 证件列表

parent 35a5fa05
......@@ -200,6 +200,9 @@
0468D43A2B579EAC00CFB916 /* YHLoginViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D4392B579EAC00CFB916 /* YHLoginViewModel.swift */; };
047294E82B988A19008E0B84 /* YHNewWebViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 047294E72B988A19008E0B84 /* YHNewWebViewController.swift */; };
04754A952B96FF3D00F8ADCA /* UITextField+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04754A942B96FF3D00F8ADCA /* UITextField+Extension.swift */; };
0477E1782BA41B1300436346 /* YHCertificateViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0477E1772BA41B1300436346 /* YHCertificateViewModel.swift */; };
0477E17A2BA41C7E00436346 /* YHCertificateModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0477E1792BA41C7E00436346 /* YHCertificateModel.swift */; };
0477E17C2BA4238400436346 /* YHMaterialListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0477E17B2BA4238400436346 /* YHMaterialListViewController.swift */; };
04808C062B4686510056D53C /* ATAuthSDK.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 04808C042B4686510056D53C /* ATAuthSDK.bundle */; };
04808C082B4686C10056D53C /* ATAuthSDK_D.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 04808C032B4686510056D53C /* ATAuthSDK_D.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
0480976B2BA15269000B9DCA /* YHCertificateInfoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0480976A2BA15269000B9DCA /* YHCertificateInfoCell.swift */; };
......@@ -545,6 +548,9 @@
0468D4392B579EAC00CFB916 /* YHLoginViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHLoginViewModel.swift; sourceTree = "<group>"; };
047294E72B988A19008E0B84 /* YHNewWebViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHNewWebViewController.swift; sourceTree = "<group>"; };
04754A942B96FF3D00F8ADCA /* UITextField+Extension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UITextField+Extension.swift"; sourceTree = "<group>"; };
0477E1772BA41B1300436346 /* YHCertificateViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateViewModel.swift; sourceTree = "<group>"; };
0477E1792BA41C7E00436346 /* YHCertificateModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateModel.swift; sourceTree = "<group>"; };
0477E17B2BA4238400436346 /* YHMaterialListViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHMaterialListViewController.swift; sourceTree = "<group>"; };
04808C032B4686510056D53C /* ATAuthSDK_D.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = ATAuthSDK_D.framework; sourceTree = "<group>"; };
04808C042B4686510056D53C /* ATAuthSDK.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = ATAuthSDK.bundle; sourceTree = "<group>"; };
0480976A2BA15269000B9DCA /* YHCertificateInfoCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCertificateInfoCell.swift; sourceTree = "<group>"; };
......@@ -1321,6 +1327,15 @@
path = VM;
sourceTree = "<group>";
};
0477E1762BA41AF100436346 /* M */ = {
isa = PBXGroup;
children = (
0477E1772BA41B1300436346 /* YHCertificateViewModel.swift */,
0477E1792BA41C7E00436346 /* YHCertificateModel.swift */,
);
path = M;
sourceTree = "<group>";
};
04808C022B4686510056D53C /* Frameworks */ = {
isa = PBXGroup;
children = (
......@@ -1333,6 +1348,7 @@
04A671562B9F18C800C1FB91 /* MyCertificates(我的证书) */ = {
isa = PBXGroup;
children = (
0477E1762BA41AF100436346 /* M */,
04A6715A2B9FE9A300C1FB91 /* C */,
04A671572B9F18C800C1FB91 /* V */,
);
......@@ -1360,6 +1376,7 @@
children = (
04A6715B2B9FE9EA00C1FB91 /* YHUploadContentVC.swift */,
0480976C2BA158A1000B9DCA /* YHCertificateResourceUploadVC.swift */,
0477E17B2BA4238400436346 /* YHMaterialListViewController.swift */,
);
path = C;
sourceTree = "<group>";
......@@ -2104,6 +2121,7 @@
A5ACE94F2B4564F7002C94D2 /* YhOverlayView.swift in Sources */,
045EEEB92B9F171A0022A143 /* YHWorkMessageSelectTableViewCell.swift in Sources */,
A53026902B4E6F2700F35102 /* YHHomeCustomCell.swift in Sources */,
0477E1782BA41B1300436346 /* YHCertificateViewModel.swift in Sources */,
A5ACE92E2B4564F7002C94D2 /* YHValidateCodeInputView.swift in Sources */,
045EEED82B9F171A0022A143 /* YHQuestionInfo.swift in Sources */,
A5ACE94E2B4564F7002C94D2 /* AlignedCollectionViewFlowLayout.swift in Sources */,
......@@ -2186,6 +2204,7 @@
045EEED12B9F171A0022A143 /* YHScorePersonInfoCell.swift in Sources */,
045EEF0D2B9F171A0022A143 /* YHBasicInfoFillCell.swift in Sources */,
045EEEEC2B9F171A0022A143 /* YHBrotherInfoVC.swift in Sources */,
0477E17A2BA41C7E00436346 /* YHCertificateModel.swift in Sources */,
045EEF242B9F171A0022A143 /* YHStepView.swift in Sources */,
A5ACE9482B4564F7002C94D2 /* YHHUDWariningView.swift in Sources */,
045EEF0F2B9F171A0022A143 /* YHSelectCountryViewModel.swift in Sources */,
......@@ -2199,6 +2218,7 @@
045EEE7F2B9F171A0022A143 /* YHWorkExpInfoPreviewModel.swift in Sources */,
045EEEE72B9F171A0022A143 /* YHMySignatureListTableViewCell.swift in Sources */,
A5C382CC2B5EA11800C5E65C /* YHContractCell.swift in Sources */,
0477E17C2BA4238400436346 /* YHMaterialListViewController.swift in Sources */,
04C8F4832B7216D800ADF59B /* YHUserInfoHeaderView.swift in Sources */,
045EEEAF2B9F171A0022A143 /* YHWorkExperienceTextItemView.swift in Sources */,
A5ACE9492B4564F7002C94D2 /* YHHUDSuccessView.swift in Sources */,
......
......@@ -7,6 +7,7 @@
//
import UIKit
import JXSegmentedView
class YHCertificateResourceUploadVC: YHBaseViewController {
......@@ -31,45 +32,20 @@ class YHCertificateResourceUploadVC: YHBaseViewController {
return tableView
}()
lazy var searchView:UIView = {
let view = UIView()
view.backgroundColor = .white
view.addSubview(searchBar)
searchBar.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.left.equalToSuperview().offset(16)
make.size.equalTo(CGSize(width: KScreenWidth-32.0, height:YHCertificateSearchBar.height))
}
return view
}()
lazy var searchBar: YHCertificateSearchBar = {
let bar = YHCertificateSearchBar(frame:CGRect(x: 0, y: 0, width:KScreenWidth-32, height:YHCertificateSearchBar.height))
return bar
}()
override func viewDidLoad() {
super.viewDidLoad()
self.view.backgroundColor = .white
self.gk_navTitle = "资料上传"
self.gk_navigationBar.backgroundColor = .white
self.gk_navigationBar.isHidden = true
createUI()
}
func createUI() {
view.addSubview(tableView)
view.addSubview(searchView)
tableView.snp.makeConstraints { make in
make.top.equalTo(k_Height_NavigationtBarAndStatuBar)
make.left.right.equalTo(view)
make.bottom.equalToSuperview().offset(-k_Height_safeAreaInsetsBottom())
}
searchView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalToSuperview().offset(k_Height_NavigationtBarAndStatuBar)
make.height.equalTo(YHCertificateSearchBar.height+32)
make.top.left.right.equalToSuperview()
make.height.equalTo(KScreenHeight - k_Height_NavigationtBarAndStatuBar - YHMaterialListViewController.segmentHeight - k_Height_safeAreaInsetsBottom())
}
}
}
......@@ -123,3 +99,10 @@ extension YHCertificateResourceUploadVC: UITableViewDelegate, UITableViewDataSou
return UIView()
}
}
// MARK: - JXSegmentedListContainerViewListDelegate
extension YHCertificateResourceUploadVC: JXSegmentedListContainerViewListDelegate {
func listView() -> UIView {
return view
}
}
//
// YHMaterialListViewController.swift
// galaxy
//
// Created by edy on 2024/3/15.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import JXSegmentedView
class YHCertificateCategoryItem {
var type : YHCertificateUploadStatus = .unknown
var title : String = ""
}
class YHMaterialListViewController: YHBaseViewController {
static let segmentHeight = 53.0
let categoryItems = ["全部".local, "待上传".local, "已驳回".local, "审核中".local, "已通过".local]
var itemVCs:[YHCertificateResourceUploadVC] = []
lazy var segmentedView : JXSegmentedView = {
let segview = JXSegmentedView(frame: CGRect(x: 0, y: k_Height_NavigationtBarAndStatuBar, width: KScreenWidth, height: Self.segmentHeight))
segview.dataSource = segmentedDataSource
segview.delegate = self
//配置指示器
let indicator = JXSegmentedIndicatorLineView()
indicator.indicatorWidth = 16
indicator.indicatorColor = .brandMainColor
segview.indicators = [indicator]
segview.backgroundColor = .white
return segview
}()
lazy var segmentedDataSource: JXSegmentedBaseDataSource = {
let dataSource = JXSegmentedTitleDataSource()
dataSource.isTitleColorGradientEnabled = true
dataSource.titles = categoryItems
dataSource.titleNormalFont = UIFont.PFSC_R(ofSize: 14)
dataSource.titleNormalColor = .labelTextColor2
dataSource.titleSelectedFont = UIFont.PFSC_M(ofSize: 16)
dataSource.titleSelectedColor = .brandMainColor
dataSource.isItemSpacingAverageEnabled = false
dataSource.itemWidth = JXSegmentedViewAutomaticDimension
dataSource.itemSpacing = 24
return dataSource
}()
//分类title 所对应的VC
lazy var listContainerView: JXSegmentedListContainerView! = {
return JXSegmentedListContainerView(dataSource: self, type: .scrollView)
}()
lazy var searchView:UIView = {
let view = UIView()
view.backgroundColor = .white
view.addSubview(searchBar)
searchBar.snp.makeConstraints { make in
make.centerY.equalToSuperview()
make.left.equalToSuperview().offset(16)
make.size.equalTo(CGSize(width: KScreenWidth-32.0, height:YHCertificateSearchBar.height))
}
return view
}()
lazy var searchBar: YHCertificateSearchBar = {
let bar = YHCertificateSearchBar(frame:CGRect(x: 0, y: 0, width:KScreenWidth-32, height:YHCertificateSearchBar.height))
return bar
}()
override func viewDidLoad() {
super.viewDidLoad()
self.gk_navTitle = "资料上传".local
for _ in categoryItems {
let vc = YHCertificateResourceUploadVC()
itemVCs.append(vc)
}
view.addSubview(segmentedView)
view.addSubview(listContainerView)
segmentedView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalToSuperview().offset(k_Height_NavigationtBarAndStatuBar)
make.height.equalTo(Self.segmentHeight)
}
listContainerView.snp.makeConstraints { make in
make.left.right.equalToSuperview()
make.top.equalTo(segmentedView.snp.bottom)
make.bottom.equalToSuperview()
}
}
}
extension YHMaterialListViewController: JXSegmentedViewDelegate {
func segmentedView(_ segmentedView: JXSegmentedView, didSelectedItemAt index: Int) {
NotificationCenter.default.post(name: Notification.Name(rawValue: "scrollViewDidEndDragging"), object: nil)
}
/// 正在滚动中的回调
///
/// - Parameters:
/// - segmentedView: JXSegmentedView
/// - leftIndex: 正在滚动中,相对位置处于左边的index
/// - rightIndex: 正在滚动中,相对位置处于右边的index
/// - percent: 从左往右计算的百分比
func segmentedView(_ segmentedView: JXSegmentedView, scrollingFrom leftIndex: Int, to rightIndex: Int, percent: CGFloat) {
NotificationCenter.default.post(name: Notification.Name(rawValue: "scrollViewWillBeginDragging"), object: nil)
}
}
extension YHMaterialListViewController: JXSegmentedListContainerViewDataSource {
func numberOfLists(in listContainerView: JXSegmentedListContainerView) -> Int {
if let titleDataSource = segmentedView.dataSource as? JXSegmentedBaseDataSource {
return titleDataSource.dataSource.count
}
return 0
}
func listContainerView(_ listContainerView: JXSegmentedListContainerView, initListAt index: Int) -> JXSegmentedListContainerViewListDelegate {
return itemVCs[index]
}
}
//
// YHCertificateModel.swift
// galaxy
//
// Created by edy on 2024/3/15.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import SmartCodable
class YHUploadCertificateInfo: SmartCodable {
var categoryData: YHCategoryData = YHCategoryData()
var supplementList: [YHSupplementInfo] = []
enum CodingKeys: String, CodingKey {
case categoryData = "category_data"
case supplementList = "YHSupplementInfo"
}
required init() {
}
init(categoryData: YHCategoryData, supplementList: [YHSupplementInfo]) {
self.categoryData = categoryData
self.supplementList = supplementList
}
}
// MARK: - YHCategoryData
class YHCategoryData: SmartCodable {
var applicantName: String = ""
var categoryId: Int = 0
var checkStatus: Int = 0
enum CodingKeys: String, CodingKey {
case applicantName = "applicant_name"
case categoryId = "category_id"
case checkStatus = "check_status"
}
required init() {
}
init(applicantName: String = "", categoryId: Int = 0, checkStatus: Int = 0) {
self.applicantName = applicantName
self.categoryId = categoryId
self.checkStatus = checkStatus
}
}
// MARK: - YHSupplementList
class YHSupplementInfo: SmartCodable {
var id: Int = 0
var name: String = ""
var typeName: String = ""
var checkStatus: Int = 0
var templateCateName: String = ""
var templateCateShortName: String = ""
var templateCateShortColor: String = ""
var applicantName: String = ""
var nameExtra: YHNameExtra = YHNameExtra()
var templateInfo: YHTemplateInfo = YHTemplateInfo()
var contentUrl: [YHContentUrl] = []
enum CodingKeys: String, CodingKey {
case id = "id"
case name = "name"
case typeName = "type_name"
case checkStatus = "check_status"
case templateCateName = "template_cate_name"
case templateCateShortName = "template_cate_short_name"
case templateCateShortColor = "template_cate_short_color"
case applicantName = "applicant_name"
case nameExtra = "name_extra"
case templateInfo = "template_info"
case contentUrl = "content_url"
}
required init() {
}
init(id: Int = 0, name: String = "", typeName: String = "", checkStatus: Int = 0, templateCateName: String = "", templateCateShortName: String = "", templateCateShortColor: String = "", applicantName: String = "", nameExtra: YHNameExtra = YHNameExtra(), templateInfo: YHTemplateInfo = YHTemplateInfo(), contentUrl: [YHContentUrl] = []) {
self.id = id
self.name = name
self.typeName = typeName
self.checkStatus = checkStatus
self.templateCateName = templateCateName
self.templateCateShortName = templateCateShortName
self.templateCateShortColor = templateCateShortColor
self.applicantName = applicantName
self.nameExtra = nameExtra
self.templateInfo = templateInfo
self.contentUrl = contentUrl
}
}
// MARK: - YHContentUrl
class YHContentUrl: SmartCodable {
var url: String = ""
var name: String = ""
var type: Int = 0
var recognitionType: Int = 0
var suffix: String = ""
var updatedAt: String = ""
enum CodingKeys: String, CodingKey {
case url = "url"
case name = "name"
case type = "type"
case recognitionType = "recognition_type"
case suffix = "suffix"
case updatedAt = "updated_at"
}
required init() {
}
init(url: String = "", name: String = "", type: Int = 0, recognitionType: Int = 0, suffix: String = "", updatedAt: String = "") {
self.url = url
self.name = name
self.type = type
self.recognitionType = recognitionType
self.suffix = suffix
self.updatedAt = updatedAt
}
}
// MARK: - YHNameExtra
class YHNameExtra: SmartCodable {
var applicant: String = ""
var userName: String = ""
var organization: String = ""
enum CodingKeys: String, CodingKey {
case applicant = "applicant"
case userName = "userName"
case organization = "organization"
}
required init() {
}
init(applicant: String = "", userName: String = "", organization: String = "") {
self.applicant = applicant
self.userName = userName
self.organization = organization
}
}
// MARK: - YHTemplateInfo
class YHTemplateInfo: SmartCodable {
var id: Int = 0
var name: String = ""
var description: String = ""
var materialPath: [YHMaterialPath] = []
required init() {
}
enum CodingKeys: String, CodingKey {
case id = "id"
case name = "name"
case description = "description"
case materialPath = "material_path"
}
init(id: Int = 0, name: String = "", description: String = "", materialPath: [YHMaterialPath] = []) {
self.id = id
self.name = name
self.description = description
self.materialPath = materialPath
}
}
// MARK: - YHMaterialPath
class YHMaterialPath: SmartCodable {
var name: String = ""
var url: String = ""
enum CodingKeys: String, CodingKey {
case name = "name"
case url = "url"
}
required init() {
}
init(name: String = "", url: String = "") {
self.name = name
self.url = url
}
}
//
// YHCertificateViewModel.swift
// galaxy
//
// Created by edy on 2024/3/15.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHCertificateViewModel: NSObject {
func getUploadCertificateList(isSilient:Bool = false, callBack:@escaping (_ listInfo: YHUploadCertificateInfo?, _ error:YHErrorModel?)->()) {
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Family.familyInfoApi
if !isSilient {
YHHUD.show(.progress(message: "数据加载中..."))
}
let params = ["id": 0]
let _ = YHNetRequest.getRequest(url: strUrl, params:params) { json, code in
if !isSilient {
YHHUD.hide()
}
printLog("model 是 ==> \(json)")
let dic = json.data
if code == NetWorkCode.success.rawValue {
guard let result = YHUploadCertificateInfo.deserialize(dict: dic as? Dictionary ) else {
callBack(nil, YHErrorModel(errorCode:Int32(json.code), errorMsg:"解析失败".local))
return
}
callBack(result, nil)
} else {
let error : YHErrorModel = YHErrorModel(errorCode:Int32(json.code), errorMsg: json.msg)
callBack(nil, error)
}
} failBlock: { err in
callBack(nil, err)
}
}
}
......@@ -9,10 +9,20 @@
import UIKit
import AttributedString
enum YHCertificateUploadStatus : Int {
case unknown = 0
case preUpload = 1
case review = 2
case rejected = 3
case finish = 4
}
class YHCertificateInfoCell: UITableViewCell {
static let cellReuseIdentifier = "YHCertificateNameCell"
var status : YHCertificateUploadStatus = .unknown
var whiteView: UIView!
var nameTextView: UITextView!
var infoLabel: UILabel!
......@@ -40,6 +50,21 @@ class YHCertificateInfoCell: UITableViewCell {
setupUI()
}
func update() {
var titleColor: UIColor = .labelTextColor2
switch status {
case .preUpload:
titleColor = .brandMainColor
case .rejected:
titleColor = .failColor
case .review, .finish:
titleColor = .labelTextColor2
case .unknown:
titleColor = .labelTextColor2
}
}
func setupUI() {
self.selectionStyle = .none
......
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