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

获取公司名称

parent d24da1b5
......@@ -115,6 +115,10 @@
04E86E612B85CAEA00A35F4B /* YHWorkExampleModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E86E602B85CAEA00A35F4B /* YHWorkExampleModel.swift */; };
04E86E632B85EE9A00A35F4B /* YHWorkIntroductionViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E86E622B85EE9A00A35F4B /* YHWorkIntroductionViewModel.swift */; };
04E86E662B86EB6F00A35F4B /* YHLoginManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E86E652B86EB6F00A35F4B /* YHLoginManager.swift */; };
04E86E682B87175E00A35F4B /* YHWorkExperienceDetailModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E86E672B87175E00A35F4B /* YHWorkExperienceDetailModel.swift */; };
04E86E6A2B87352700A35F4B /* YHCompanySelectViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E86E692B87352600A35F4B /* YHCompanySelectViewController.swift */; };
04E86E6C2B87374600A35F4B /* YHCompanyModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E86E6B2B87374600A35F4B /* YHCompanyModel.swift */; };
04E86E6E2B87388100A35F4B /* YHCompanyViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E86E6D2B87388100A35F4B /* YHCompanyViewModel.swift */; };
6203A87EDC96313BBE789D9C /* Pods_galaxy.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 987C69D43AE8D85DC1930DCF /* Pods_galaxy.framework */; };
A50AB89B2B81E96E00C227DE /* YHOtherInfoFillModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A50AB89A2B81E96E00C227DE /* YHOtherInfoFillModel.swift */; };
A50AB89D2B81F1FB00C227DE /* YHOtherInfoFillViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = A50AB89C2B81F1FB00C227DE /* YHOtherInfoFillViewModel.swift */; };
......@@ -391,6 +395,10 @@
04E86E602B85CAEA00A35F4B /* YHWorkExampleModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHWorkExampleModel.swift; sourceTree = "<group>"; };
04E86E622B85EE9A00A35F4B /* YHWorkIntroductionViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHWorkIntroductionViewModel.swift; sourceTree = "<group>"; };
04E86E652B86EB6F00A35F4B /* YHLoginManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHLoginManager.swift; sourceTree = "<group>"; };
04E86E672B87175E00A35F4B /* YHWorkExperienceDetailModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHWorkExperienceDetailModel.swift; sourceTree = "<group>"; };
04E86E692B87352600A35F4B /* YHCompanySelectViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCompanySelectViewController.swift; sourceTree = "<group>"; };
04E86E6B2B87374600A35F4B /* YHCompanyModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCompanyModel.swift; sourceTree = "<group>"; };
04E86E6D2B87388100A35F4B /* YHCompanyViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCompanyViewModel.swift; sourceTree = "<group>"; };
58C2405158A4A6632D0E7460 /* Pods-galaxy.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-galaxy.debug.xcconfig"; path = "Target Support Files/Pods-galaxy/Pods-galaxy.debug.xcconfig"; sourceTree = "<group>"; };
987C69D43AE8D85DC1930DCF /* Pods_galaxy.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_galaxy.framework; sourceTree = BUILT_PRODUCTS_DIR; };
A50AB89A2B81E96E00C227DE /* YHOtherInfoFillModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHOtherInfoFillModel.swift; sourceTree = "<group>"; };
......@@ -836,6 +844,7 @@
04E86E242B81EA1000A35F4B /* YHWorkItemListViewModel.swift */,
04E86E372B83306800A35F4B /* YHWorkExperienceViewModel.swift */,
04E86E622B85EE9A00A35F4B /* YHWorkIntroductionViewModel.swift */,
04E86E6D2B87388100A35F4B /* YHCompanyViewModel.swift */,
);
path = ViewModel;
sourceTree = "<group>";
......@@ -844,8 +853,10 @@
isa = PBXGroup;
children = (
04E86E262B81EA1000A35F4B /* YHWorkItemListModel.swift */,
04E86E672B87175E00A35F4B /* YHWorkExperienceDetailModel.swift */,
04E86E392B83321600A35F4B /* YHWorkExperienceModel.swift */,
04E86E602B85CAEA00A35F4B /* YHWorkExampleModel.swift */,
04E86E6B2B87374600A35F4B /* YHCompanyModel.swift */,
);
path = Model;
sourceTree = "<group>";
......@@ -857,6 +868,7 @@
04E86E332B83268F00A35F4B /* YHWorkExperienceViewController.swift */,
04E86E562B848D5A00A35F4B /* YHWorkIntroductionViewController.swift */,
04E86E582B84AD6200A35F4B /* YHWorkExampleViewController.swift */,
04E86E692B87352600A35F4B /* YHCompanySelectViewController.swift */,
);
path = C;
sourceTree = "<group>";
......@@ -1844,6 +1856,7 @@
A5D6AB1D2B46AAFB001C10A5 /* YHHomePageViewModel.swift in Sources */,
A596C3A32B84D9100067BBB8 /* YHOtherSelecteItemView.swift in Sources */,
A5ACE9552B4564F7002C94D2 /* YHTabBarViewController.swift in Sources */,
04E86E6C2B87374600A35F4B /* YHCompanyModel.swift in Sources */,
A5167B332B6A3A2D0084C08F /* YHPersonInfoBaseViewController.swift in Sources */,
A5C5B3122B57B47D00A7C5D1 /* YHDavidCell0.swift in Sources */,
A5FD63FA2B68D95700D1D9DA /* YHPersonInfoIdentityCardModel.swift in Sources */,
......@@ -1858,6 +1871,7 @@
A5FD63C72B638CA000D1D9DA /* YHSubmintAllInfoSuccessTipView.swift in Sources */,
04E86E572B848D5A00A35F4B /* YHWorkIntroductionViewController.swift in Sources */,
04E86E5F2B84D07000A35F4B /* YHWorkExampleMessageTableViewCell.swift in Sources */,
04E86E682B87175E00A35F4B /* YHWorkExperienceDetailModel.swift in Sources */,
041B528F2B5E620E007EBCEB /* YHFormItemInputTextCell.swift in Sources */,
A5ACE9402B4564F7002C94D2 /* String+Extension.swift in Sources */,
A5ACE9482B4564F7002C94D2 /* YHHUDWariningView.swift in Sources */,
......@@ -1905,6 +1919,7 @@
0468D4792B68A08600CFB916 /* YHAddressViewController.swift in Sources */,
A5ACE9562B4564F7002C94D2 /* YHBouncesContentView.swift in Sources */,
042FBBCB2B65058000F9DE23 /* YHChildBasicInfoVC.swift in Sources */,
04E86E6A2B87352700A35F4B /* YHCompanySelectViewController.swift in Sources */,
04E86E452B8357EC00A35F4B /* YHItemModel.swift in Sources */,
A5ACE9302B4564F7002C94D2 /* Algorithm.swift in Sources */,
A5C5B32B2B57D17600A7C5D1 /* YHDavidCell5.swift in Sources */,
......@@ -1919,6 +1934,7 @@
A5FD63DA2B66060800D1D9DA /* YHScoreOptionsView.swift in Sources */,
A5ACE9372B4564F7002C94D2 /* YHBaseUrlManager.swift in Sources */,
A5ACE9352B4564F7002C94D2 /* YHNetRequest.swift in Sources */,
04E86E6E2B87388100A35F4B /* YHCompanyViewModel.swift in Sources */,
A5FD63CB2B63D6C300D1D9DA /* YHInformationFillTipsCell.swift in Sources */,
04C693712B735C6F004C1758 /* YHProfessionalQualificationVC.swift in Sources */,
04E86E492B8445F400A35F4B /* YHWorkActionView.swift in Sources */,
......
//
// YHCompanySelectViewController.swift
// galaxy
//
// Created by EDY on 2024/2/22.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHCompanySelectViewController: YHBaseViewController {
public var backLocationStringController: ((String) -> Void)?
var searchView: UITextField!
var sureButton: UIButton!
var tableView: UITableView!
var searchDataSource: [YHCompanyModelListModel]?
var viewModel: YHCompanyViewModel?
override func viewDidLoad() {
super.viewDidLoad()
gk_navTitle = "用人单位"
viewModel = YHCompanyViewModel()
setView()
getData()
}
func getData() {
tableView.reloadData()
}
func setView() {
view.backgroundColor = .white
searchView = {
let searchBar = UITextField()
searchBar.placeholder = "请输入用人单位全称"
searchBar.backgroundColor = UIColor(hex: 0xf8f9fb)
searchBar.keyboardType = .default
searchBar.delegate = self
searchBar.layer.cornerRadius = 21
searchBar.leftView = UIView(frame: CGRect(x: 0, y: 0, width: 16, height: 42))
searchBar.leftViewMode = .always
return searchBar
}()
view.addSubview(searchView)
searchView.snp.makeConstraints { make in
make.top.equalTo(k_Height_NavigationtBarAndStatuBar + 16)
make.height.equalTo(42)
make.left.equalTo(16)
make.right.equalTo(-16)
}
sureButton = {
let button = UIButton(type: .custom)
button.backgroundColor = UIColor(hex:0x2274ee)
button.titleLabel?.font = kBoldFont(size: 16)
button.contentHorizontalAlignment = .center
button.setTitle("保存", for: .normal)
button.setTitleColor( UIColor(hex:0xffffff), for: .normal)
button.layer.cornerRadius = 18
button.addTarget(self, action: #selector(submit), for: .touchUpInside)
return button
}()
view.addSubview(sureButton)
sureButton.snp.makeConstraints { make in
make.centerY.equalTo(searchView.snp.centerY)
make.height.equalTo(36)
make.width.equalTo(80)
make.right.equalTo(-16)
}
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: YHCompanyTableViewCell.self)
return tableView
}()
view.addSubview(tableView)
tableView.snp.makeConstraints { make in
make.top.equalTo(k_Height_NavigationtBarAndStatuBar + 78)
make.bottom.equalTo(-k_Height_safeAreaInsetsBottom() - 64)
make.left.right.equalTo(view)
}
}
@objc func submit() {
if let backLocationStringController = backLocationStringController {
backLocationStringController(searchView.text ?? "")
self.navigationController?.popViewController()
}
}
}
extension YHCompanySelectViewController: UITextFieldDelegate {
func textFieldDidChangeSelection(_ textField: UITextField) {
if textField.text == "" {
tableView.isHidden = true
} else {
viewModel?.requestCompany(textField.text ?? "") { [weak self] success, error in
guard let self = self else { return }
self.searchDataSource = success
self.tableView.isHidden = false
self.tableView.reloadData()
}
}
}
}
extension YHCompanySelectViewController: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return searchDataSource?.count ?? 0
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withClass: YHCompanyTableViewCell.self)
cell.titleLabel.text = searchDataSource?[indexPath.row].name
return cell
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 44
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let text = searchDataSource?[indexPath.row].name ?? ""
if let backLocationStringController = backLocationStringController {
backLocationStringController(text)
self.navigationController?.popViewController()
}
}
}
class YHCompanyTableViewCell: UITableViewCell {
var titleLabel: UILabel!
override func awakeFromNib() {
super.awakeFromNib()
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
selectionStyle = .none
setupUI()
}
func setupUI() {
titleLabel = {
let label = UILabel()
label.font = kFont(size: 13)
label.textColor = UIColor(hex:0x222222)
return label
}()
contentView.addSubview(titleLabel)
titleLabel.snp.makeConstraints { make in
make.left.equalTo(22)
make.centerY.equalToSuperview()
make.height.equalTo(20)
}
}
}
......@@ -111,6 +111,7 @@ extension YHWorkExperienceListViewController: UITableViewDelegate, UITableViewDa
cell.clickBlock = {[weak self] model in
guard let self = self else { return }
let vc = YHWorkExperienceViewController()
vc.workExperienceID = "\(model.id ?? 0)"
self.navigationController?.pushViewController(vc, animated: true)
}
cell.deleteBlock = {[weak self] model in
......@@ -124,6 +125,11 @@ extension YHWorkExperienceListViewController: UITableViewDelegate, UITableViewDa
guard let self = self else { return }
self.isMore = isMore
}
cell.newWorkBlock = {[weak self] in
guard let self = self else { return }
let vc = YHWorkExperienceViewController()
self.navigationController?.pushViewController(vc, animated: true)
}
return cell
}
......
......@@ -17,6 +17,8 @@ class YHWorkExperienceViewController: YHBaseViewController {
var baseDataSource: [YHSectionWorkExperienceModel]?
var introductionDataSource: [YHWorkItemListModel]?
var fileDataSource: [String]?
var workExperienceID: String?
override func viewDidLoad() {
super.viewDidLoad()
viewModel = YHWorkExperienceViewModel()
......@@ -29,6 +31,11 @@ class YHWorkExperienceViewController: YHBaseViewController {
func getData() {
viewModel.requestWorkExample { success, error in
}
viewModel.requestWorkDetail(workExperienceID ?? "") {[weak self] success, error in
guard let self = self else { return }
self.updateDataSource()
}
updateDataSource()
}
......@@ -161,7 +168,7 @@ extension YHWorkExperienceViewController: UITableViewDelegate, UITableViewDataSo
cell.dataSource = baseDataSource?[indexPath.row]
cell.workExperienceBlock = {[weak self] model in
guard let self = self else { return }
// self.viewModel.updateModel(model)
self.viewModel.updateModel(model)
self.updateDataSource()
}
return cell
......
//
// YHCompanyModel.swift
// galaxy
//
// Created by EDY on 2024/2/22.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
import SmartCodable
struct YHCompanyModel: SmartCodable {
var current_page: Int?
var first_page_url: String?
var from: Int?
var last_page: Int?
var last_page_url: String?
var next_page_url: String?
var path: String?
var prev_page_url: String?
var to: Int?
var total: Int?
var data: [YHCompanyModelListModel]?
}
struct YHCompanyModelListModel: SmartCodable {
var id: Int?
var name: String?
var customer_num: Int?
var is_del: Int?
var website_link: String?
var introduce: String?
}
//
// YHWorkExperienceDetailModel.swift
// galaxy
//
// Created by EDY on 2024/2/22.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import Foundation
import SmartCodable
struct YHWorkExperienceDetailModel: SmartCodable {
var id: Int?
var order_id: Int?
var company_name: String?
var is_famous_enterprise: Int?
var duty: String?
var entry_time: String?
var departure_time: String?
var industry: String?
var location: YHAddressModel?
var location_aboard: Int?
var professional_level: Int?
var professional_other: String?
var position: String?
var remark: String?
var old_id: Int?
var created_at: String?
var updated_at: String?
var is_show: Int?
var deleted_at: String?
var operator_name: String?
var operator_english_name: String?
var operator_id: Int?
var work_certificate: String?
var executives_certificate: String?
var is_executives: Int?
var wduty: String?
var highlights: String?
var file: [String]?
var not_need_upload_file: Int?
var company_member_total: Int?
var administrative_level: Int?
var company_manage_total: Int?
var top_manager_start_at: String?
var top_manager_end_at: String?
var master_of_important_project: Int?
var match_listing: Int?
var is_synthetic: Int?
var step: Int?
var create_from_appid: Int?
var update_from_appid: Int?
var international_work_experience: Int?
var turnover: Int?
var business_nature: String?
var company_website: String?
var company_introduce: String?
var business_remark: String?
var is_project_introduction: Int?
var customer_center_id: Int?
var projects: [String]?
}
......@@ -17,7 +17,6 @@ struct YHWorkModel: SmartCodable {
struct YHWorkItemListModel: SmartCodable {
var id: Int?
var order_id: Int?
var company_name: String?
......@@ -25,5 +24,4 @@ struct YHWorkItemListModel: SmartCodable {
var entry_time: String?
var departure_time: Bool?
var vacant_num: Int?
}
......@@ -316,7 +316,15 @@ class YHWorkExperienceItemView: UIView {
// }
// }
case .unit:
break
let vc = YHCompanySelectViewController()
vc.backLocationStringController = { (country) in
self.dataSource?.message = country
self.updateAllViews()
if let block = self.block {
block(self.dataSource ?? YHWorkExperienceModel())
}
}
UIViewController.current?.navigationController?.pushViewController(vc)
case .nature:
break
case .certificate:
......
......@@ -11,9 +11,11 @@ import UIKit
class YHWorkExperienceListTableViewCell: UITableViewCell {
typealias ExperienceListBlock = (_ model: YHWorkItemListModel) -> ()
typealias IsMoreBlock = (_ isMore: Bool) -> ()
typealias NewWorkBlock = () -> ()
var clickBlock: ExperienceListBlock?
var deleteBlock: ExperienceListBlock?
var isMoreBlock: IsMoreBlock?
var newWorkBlock: NewWorkBlock?
var centerView: UIView!
var titleLabel: UILabel!
var subTitleLabel: UILabel!
......@@ -141,6 +143,12 @@ class YHWorkExperienceListTableViewCell: UITableViewCell {
bottomView = {
let view = YHWorkItemAddView()
view.clickBlock = {[weak self] in
guard let self = self else { return }
if let block = self.newWorkBlock {
block()
}
}
return view
}()
centerView.addSubview(bottomView)
......
......@@ -108,6 +108,11 @@ class YHWorkExperienceTextItemView: UIView {
}
promptsLabel.text = dataSource.prompts
messageTextField.text = dataSource.message
if dataSource.message?.count != 0 {
promptsLabel.isHidden = true
} else {
promptsLabel.isHidden = false
}
}
}
......@@ -117,5 +122,10 @@ extension YHWorkExperienceTextItemView: UITextViewDelegate {
if let block = block {
block(dataSource ?? YHWorkExperienceModel())
}
if textView.text.count != 0 {
promptsLabel.isHidden = true
} else {
promptsLabel.isHidden = false
}
}
}
......@@ -62,12 +62,10 @@ class YHWorkFileItemView: UIView {
make.width.equalTo(28)
make.centerY.equalTo(titleLabel.snp.centerY)
}
}
func updateAllViews() {
guard let dataSource = dataSource else { return }
// titleLabel.text = dataSource.title
}
......
//
// YHCompanyViewModel.swift
// galaxy
//
// Created by EDY on 2024/2/22.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHCompanyViewModel: YHBaseViewModel {
override init() {
super.init()
}
func requestCompany(_ key: String, callBackBlock:@escaping (_ success: [YHCompanyModelListModel]?, _ error:YHErrorModel?)->()) {
let strUrl = YHBaseUrlManager.shared.curURL() + "frontend/workInfo/company-search?company=\(key)&page_size=20"
YHNetRequest.getRequest(url: strUrl) { [weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
guard let model = NetBaseModel.deserialize(dict: json) else {
let error : YHErrorModel = YHErrorModel(errorCode:YHErrorCode.dictParseError.rawValue,errorMsg: YHErrorCode.dictParseError.description())
callBackBlock([],error)
return
}
let dic = model.data?.peel
guard let result = YHCompanyModel.deserialize(dict: dic as? [AnyHashable : Any]) else {
callBackBlock([],nil)
return
}
callBackBlock(result.data, nil)
} failBlock: { err in
callBackBlock([],err)
}
}
}
......@@ -9,7 +9,7 @@
import UIKit
class YHWorkExperienceViewModel: YHBaseViewModel {
var mainModel: YHMainInformationModel = YHMainInformationModel()
var mainModel: YHWorkExperienceDetailModel = YHWorkExperienceDetailModel()
var exampleModels: [YHWorkExampleModel]?
override init() {
......@@ -17,114 +17,100 @@ class YHWorkExperienceViewModel: YHBaseViewModel {
}
func getBaseDataSource() -> [YHSectionWorkExperienceModel] {
let item = YHWorkExperienceModel(id: .id1, isNeed: true, title: "用人单位", isUserKeyBoard: false, prompts: "请输入", message: "", type: .unit)
let item1 = YHWorkExperienceModel(id: .id2, isNeed: true, title: "用人单位性质", isUserKeyBoard: false, prompts: "请输入", message: "", type: .nature)
let item2 = YHWorkExperienceModel(id: .id3, isNeed: false, title: "用人单位介绍", isUserKeyBoard: true, prompts: "如方便提供,请填写", message: "")
let item3 = YHWorkExperienceModel(id: .id4, isNeed: false, title: "用人单位官网", isUserKeyBoard: true, prompts: "如有,请输入官网链接", message: "")
let item4 = YHWorkExperienceModel(id: .id5, isNeed: true, title: "出生国家/地区", isUserKeyBoard: false, prompts: nil, message: "", type: .country)
let item = YHWorkExperienceModel(id: .id1, isNeed: true, title: "用人单位", isUserKeyBoard: false, prompts: "请输入", message: mainModel.company_name ?? "", type: .unit)
let item1 = YHWorkExperienceModel(id: .id2, isNeed: true, title: "用人单位性质", isUserKeyBoard: false, prompts: "请输入", message: mainModel.industry ?? "", type: .nature)
let item2 = YHWorkExperienceModel(id: .id3, isNeed: false, title: "用人单位介绍", isUserKeyBoard: true, prompts: "如方便提供,请填写", message: mainModel.company_introduce ?? "")
let item3 = YHWorkExperienceModel(id: .id4, isNeed: false, title: "用人单位官网", isUserKeyBoard: true, prompts: "如有,请输入官网链接", message: mainModel.company_website ?? "")
let item4 = YHWorkExperienceModel(id: .id5, isNeed: true, title: "出生国家/地区", isUserKeyBoard: false, prompts: nil, message: mainModel.location?.country ?? "", type: .country)
var string = ""
if let array = mainModel.birth_place?.area {
if let array = mainModel.location?.area {
for item in array {
string = string + item
}
}
let item5 = YHWorkExperienceModel(id: .id6, isNeed: true, title: "出生城市", isUserKeyBoard: false, prompts: "请选择", message: "", type: .address)
let item55 = YHWorkExperienceModel(id: .id7, isNeed: true, title: "出生城市", isUserKeyBoard: true, prompts: "请输入", message: "")
let item6 = YHWorkExperienceModel(id: .id8, isNeed: true, title: "职位", isUserKeyBoard: true, prompts: "请输入", message: "")
let item7 = YHWorkExperienceModel(id: .id9, isNeed: true, title: "入职年月", isUserKeyBoard: false, prompts: "请选择", message: "", type: .time)
let item8 = YHWorkExperienceModel(id: .id10, isNeed: true, title: "离职年月", isUserKeyBoard: false, prompts: "请选择", message: "", type: .time)
let item9 = YHWorkExperienceModel(id: .id11, isNeed: true, title: "工作证明文件", isUserKeyBoard: false, prompts: "请选择", message: "", type: .certificate)
let item10 = YHWorkExperienceModel(id: .id12, isNeed: false, title: "职责性质", isUserKeyBoard: false, prompts: "请选择", message: "")
let item11 = YHWorkExperienceModel(id: .id13, isNeed: false, title: "相关工作经验是否属于国际工作经验", isUserKeyBoard: false, prompts: "", message: "\(mainModel.has_hk_id ?? 0)", leftButtonString: "是", rightButtonString: "否")
let section = YHSectionWorkExperienceModel(title: "企业信息", models: [item, item1, item2, item3, item4, item5, item6, item7, item8, item9, item10, item11])
let item12 = YHWorkExperienceModel(id: .id14, isNeed: true, title: "企业人数规模", isUserKeyBoard: true, prompts: "请输入", message: "")
let item13 = YHWorkExperienceModel(id: .id15, isNeed: false, title: "行政架构层级", isUserKeyBoard: false, prompts: "请输入", message: "", type: .structure)
let item14 = YHWorkExperienceModel(id: .id16, isNeed: true, title: "下属管理人数", isUserKeyBoard: true, prompts: "请输入", message: "")
let item15 = YHWorkExperienceModel(id: .id17, isNeed: false, title: "公司营业额/港元 (近一年)", isUserKeyBoard: true, prompts: "请输入具体数字", message: "")
let item16 = YHWorkExperienceModel(id: .id18, isNeed: false, title: "公司业务性质/范畴/所属行业", isUserKeyBoard: true, prompts: "请输入,100字内", message: "")
let item17 = YHWorkExperienceModel(id: .id19, isNeed: true, title: "职位水平类别", isUserKeyBoard: false, prompts: "请选择", message: "", type: .level)
let item18 = YHWorkExperienceModel(id: .id20, isNeed: true, title: "高管证明文件", isUserKeyBoard: false, prompts: "请选择", message: "", type: .prove)
let item19 = YHWorkExperienceModel(id: .id21, isNeed: true, title: "高管在职开始时间", isUserKeyBoard: false, prompts: "请选择", message: "", type: .time)
let item20 = YHWorkExperienceModel(id: .id22, isNeed: true, title: "高管在职结束时间", isUserKeyBoard: false, prompts: "请选择", message: "", type: .time)
let section1 = YHSectionWorkExperienceModel(title: "企业规模", models: [item12, item13, item14, item15, item16, item17, item18, item19, item20])
let item5 = YHWorkExperienceModel(id: .id6, isNeed: true, title: "出生城市", isUserKeyBoard: false, prompts: "请选择", message: string, type: .address)
let item55 = YHWorkExperienceModel(id: .id7, isNeed: true, title: "出生城市", isUserKeyBoard: true, prompts: "请输入", message: mainModel.location?.foreign ?? "")
let item6 = YHWorkExperienceModel(id: .id8, isNeed: true, title: "职位", isUserKeyBoard: true, prompts: "请输入", message: mainModel.position ?? "")
let item7 = YHWorkExperienceModel(id: .id9, isNeed: true, title: "入职年月", isUserKeyBoard: false, prompts: "请选择", message: mainModel.entry_time ?? "", type: .time)
let item8 = YHWorkExperienceModel(id: .id10, isNeed: true, title: "离职年月", isUserKeyBoard: false, prompts: "请选择", message: mainModel.departure_time ?? "", type: .time)
let item9 = YHWorkExperienceModel(id: .id11, isNeed: true, title: "工作证明文件", isUserKeyBoard: false, prompts: "请选择", message: mainModel.work_certificate ?? "", type: .certificate)
let item10 = YHWorkExperienceModel(id: .id12, isNeed: false, title: "职责性质", isUserKeyBoard: false, prompts: "请选择", message: mainModel.duty ?? "")
let item11 = YHWorkExperienceModel(id: .id13, isNeed: false, title: "相关工作经验是否属于国际工作经验", isUserKeyBoard: false, prompts: "", message: "\(mainModel.international_work_experience ?? 0)", leftButtonString: "是", rightButtonString: "否")
let addressCountry = mainModel.location?.country ?? ""
var section = YHSectionWorkExperienceModel()
if addressCountry.contains("中国") {
section = YHSectionWorkExperienceModel(title: "企业信息", models: [item, item1, item2, item3, item4, item5, item6, item7, item8, item9, item10, item11])
} else {
section = YHSectionWorkExperienceModel(title: "企业信息", models: [item, item1, item2, item3, item4, item55, item6, item7, item8, item9, item10, item11])
}
let item12 = YHWorkExperienceModel(id: .id14, isNeed: true, title: "企业人数规模", isUserKeyBoard: true, prompts: "请输入", message: "\(mainModel.company_member_total ?? 0)")
let item13 = YHWorkExperienceModel(id: .id15, isNeed: false, title: "行政架构层级", isUserKeyBoard: false, prompts: "请输入", message: "\(mainModel.administrative_level ?? 0)", type: .structure)
let item14 = YHWorkExperienceModel(id: .id16, isNeed: true, title: "下属管理人数", isUserKeyBoard: true, prompts: "请输入", message: "\(mainModel.company_manage_total ?? 0)")
let item15 = YHWorkExperienceModel(id: .id17, isNeed: false, title: "公司营业额/港元 (近一年)", isUserKeyBoard: true, prompts: "请输入具体数字", message: "\(mainModel.turnover ?? 0)")
let item16 = YHWorkExperienceModel(id: .id18, isNeed: false, title: "公司业务性质/范畴/所属行业", isUserKeyBoard: true, prompts: "请输入,100字内", message: mainModel.business_nature ?? "")
let item17 = YHWorkExperienceModel(id: .id19, isNeed: true, title: "职位水平类别", isUserKeyBoard: false, prompts: "请选择", message: "\(mainModel.professional_level ?? 0)", type: .level)
let item18 = YHWorkExperienceModel(id: .id20, isNeed: true, title: "高管证明文件", isUserKeyBoard: false, prompts: "请选择", message: mainModel.executives_certificate ?? "", type: .prove)
let item19 = YHWorkExperienceModel(id: .id21, isNeed: true, title: "高管在职开始时间", isUserKeyBoard: false, prompts: "请选择", message: mainModel.top_manager_start_at ?? "", type: .time)
let item20 = YHWorkExperienceModel(id: .id22, isNeed: true, title: "高管在职结束时间", isUserKeyBoard: false, prompts: "请选择", message: mainModel.top_manager_end_at ?? "", type: .time)
var section1 = YHSectionWorkExperienceModel()
if mainModel.professional_level == 1 {
section1 = YHSectionWorkExperienceModel(title: "企业规模", models: [item12, item13, item14, item15, item16, item17, item18, item19, item20])
} else {
section1 = YHSectionWorkExperienceModel(title: "企业规模", models: [item12, item13, item14, item15, item16, item17])
}
return [section, section1]
}
func updateModel(_ item: YHItemModel) {
func updateModel(_ item: YHWorkExperienceModel) {
guard let type = item.id else { return }
switch type {
case .id1:
mainModel.nationality = item.message
case .id2:
mainModel.address?.country = item.message
case .id3:
mainModel.address?.area = item.value
case .id4:
mainModel.address?.details = item.message
case .id5:
mainModel.has_hk_id = item.value?.first?.int
case .id6:
printLog("1")
case .id7:
printLog("1")
case .id8:
mainModel.certificates?.cn_identity_card?.number = item.message
case .id9:
mainModel.certificates?.cn_identity_card?.issue_at = item.message
case .id10:
mainModel.certificates?.cn_identity_card?.issue_date_start_at = item.message
case .id11:
mainModel.certificates?.cn_identity_card?.issue_date_end_at = item.message
case .id12:
mainModel.certificates?.hk_macao_pass?.number = item.message
case .id13:
mainModel.certificates?.hk_macao_pass?.issue_at = item.message
case .id14:
mainModel.certificates?.hk_macao_pass?.issue_date_start_at = item.message
case .id15:
mainModel.certificates?.hk_macao_pass?.issue_date_end_at = item.message
case .id16:
mainModel.certificates?.passport?.passport_type = item.value?.first
case .id17:
mainModel.certificates?.passport?.number = item.message
case .id18:
mainModel.certificates?.passport?.issue_at = item.message
case .id19:
mainModel.certificates?.passport?.issue_date_start_at = item.message
case .id20:
mainModel.certificates?.passport?.issue_date_end_at = item.message
case .id21:
mainModel.username = item.message
case .id22:
mainModel.used_name = item.message
case .id23:
mainModel.surname = item.message
case .id24:
mainModel.birthday = item.message
case .id25:
mainModel.birth_place_aboard = item.value?.first?.int
case .id26:
mainModel.birth_place?.area = item.value
case .id27:
mainModel.sex = item.value?.first
case .id28:
mainModel.married = item.value?.first
case .id29:
mainModel.mobile = item.message
case .id30:
mainModel.email = item.message
case .id31:
mainModel.has_hk_id = item.value?.first?.int
case .id32:
mainModel.address?.foreign = item.message
case .id33:
mainModel.is_live_oversea_year = item.value?.first?.int
case .id34:
mainModel.birth_place?.foreign = item.message
case .id1: // 用人单位
mainModel.company_name = item.message
case .id2: // 用人单位性质
mainModel.industry = item.message
case .id3: // 用人单位介绍
mainModel.company_introduce = item.message
case .id4: // 用人单位官网
mainModel.company_website = item.message
case .id5: // 工作地区国家
mainModel.location?.country = item.message
case .id6: // 工作城市 国内
mainModel.location?.area = item.value
case .id7: // 工作城市国外
mainModel.location?.foreign = item.message
case .id8: // 职位
mainModel.position = item.message
case .id9: // 入职年月
mainModel.entry_time = item.message
case .id10: // 离职年月
mainModel.departure_time = item.message
case .id11: // 工作证明文件
mainModel.work_certificate = item.message
case .id12: // 职责性质
mainModel.duty = item.message
case .id13: // 是否国际工作经验
mainModel.international_work_experience = Int(item.value?.first ?? "0")
case .id14: // 企业人数规模
mainModel.company_member_total = Int(item.message ?? "0")
case .id15: // 行政架构层级
mainModel.administrative_level = Int(item.value?.first ?? "0")
case .id16: // 下属管理人数
mainModel.company_manage_total = Int(item.message ?? "0")
case .id17: // 公司营业额/港元
mainModel.turnover = Int(item.message ?? "0")
case .id18: // 公司性质/范畴/所属行业
mainModel.business_nature = item.message
case .id19: // 职位水平类型
mainModel.professional_level = Int(item.value?.first ?? "0")
case .id20: // 高管证明文件
mainModel.executives_certificate = item.message
case .id21: // 高管在职开始时间
mainModel.top_manager_start_at = item.message
case .id22: // 高管在职结束时间
mainModel.top_manager_end_at = item.message
}
}
......@@ -150,4 +136,27 @@ class YHWorkExperienceViewModel: YHBaseViewModel {
callBackBlock(false,err)
}
}
func requestWorkDetail(_ workId: String, callBackBlock:@escaping (_ success: Bool?, _ error:YHErrorModel?)->()) {
let strUrl = YHBaseUrlManager.shared.curURL() + "frontend/workInfo/detail?id=\(workId)"
let _ = YHNetRequest.getRequest(url: strUrl) { [weak self] json, code in
//1. json字符串 转 对象
guard let self = self else { return }
guard let model = NetBaseModel.deserialize(dict: json) else {
let error : YHErrorModel = YHErrorModel(errorCode:YHErrorCode.dictParseError.rawValue,errorMsg: YHErrorCode.dictParseError.description())
callBackBlock(false,error)
return
}
let dic = model.data?.peel
guard let result = YHWorkExperienceDetailModel.deserialize(dict: dic as? [AnyHashable : Any]) else {
callBackBlock(false,nil)
return
}
self.mainModel = result
callBackBlock(true, nil)
} failBlock: { err in
callBackBlock(false,err)
}
}
}
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