Commit 694fb443 authored by Steven杜宇's avatar Steven杜宇

// 学历

parent 0e6ea474
......@@ -33,6 +33,7 @@
0411CF162D1C0D0C00644D35 /* YHGCSignatureAddTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0411CF152D1C0D0C00644D35 /* YHGCSignatureAddTableViewCell.swift */; };
0411CF182D1D502D00644D35 /* YHlifeCollectionReusableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0411CF172D1D502D00644D35 /* YHlifeCollectionReusableView.swift */; };
0411CF1A2D22960900644D35 /* YHGCWorkExperienceListReasonTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0411CF192D22960900644D35 /* YHGCWorkExperienceListReasonTableViewCell.swift */; };
041938712D2B722D00C7A52A /* YHGCCollegeSearchViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041938702D2B722D00C7A52A /* YHGCCollegeSearchViewController.swift */; };
04307B662D1942F500ED8E8D /* YHDynamicSheetPickerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307B652D1942F500ED8E8D /* YHDynamicSheetPickerView.swift */; };
04307B682D19911800ED8E8D /* YHIncomeInfoEditCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307B672D19911800ED8E8D /* YHIncomeInfoEditCell.swift */; };
04307B6A2D1A4C6500ED8E8D /* YHIncomeInfoSelectCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04307B692D1A4C6500ED8E8D /* YHIncomeInfoSelectCell.swift */; };
......@@ -1250,6 +1251,7 @@
0411CF152D1C0D0C00644D35 /* YHGCSignatureAddTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCSignatureAddTableViewCell.swift; sourceTree = "<group>"; };
0411CF172D1D502D00644D35 /* YHlifeCollectionReusableView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHlifeCollectionReusableView.swift; sourceTree = "<group>"; };
0411CF192D22960900644D35 /* YHGCWorkExperienceListReasonTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCWorkExperienceListReasonTableViewCell.swift; sourceTree = "<group>"; };
041938702D2B722D00C7A52A /* YHGCCollegeSearchViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHGCCollegeSearchViewController.swift; sourceTree = "<group>"; };
04307B652D1942F500ED8E8D /* YHDynamicSheetPickerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHDynamicSheetPickerView.swift; sourceTree = "<group>"; };
04307B672D19911800ED8E8D /* YHIncomeInfoEditCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHIncomeInfoEditCell.swift; sourceTree = "<group>"; };
04307B692D1A4C6500ED8E8D /* YHIncomeInfoSelectCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHIncomeInfoSelectCell.swift; sourceTree = "<group>"; };
......@@ -6412,6 +6414,7 @@
children = (
04AE203A2D13C01B00891D24 /* YHGCEducationInfoListVC.swift */,
04AE203C2D13C14900891D24 /* YHGCEducationDetailVC.swift */,
041938702D2B722D00C7A52A /* YHGCCollegeSearchViewController.swift */,
04AE203E2D13C36500891D24 /* YHGCQualificationDetailVC.swift */,
);
path = C;
......@@ -7240,6 +7243,7 @@
045C11462D12CA5F00BD2DC0 /* YHSearchInfoHistoryView.swift in Sources */,
045C11472D12CA5F00BD2DC0 /* YHAdopterItemView.swift in Sources */,
045C11482D12CA5F00BD2DC0 /* YHHomeInfoClassifyModel.swift in Sources */,
041938712D2B722D00C7A52A /* YHGCCollegeSearchViewController.swift in Sources */,
045C11492D12CA5F00BD2DC0 /* YHOrderDetailViewController.swift in Sources */,
045C114A2D12CA5F00BD2DC0 /* YHAdopterCardModel.swift in Sources */,
045C114B2D12CA5F00BD2DC0 /* YHDocumentMessageTableViewCell.swift in Sources */,
......
......@@ -99,7 +99,7 @@ class YHCollegeSearchViewController: YHBaseViewController {
let param:[String:Any] = ["order_id": orderId,
"name":searchCollegeName ?? "",
"page":1,
"page_size":15,
"page_size":100,
]
self.educationRequest.searchCollegeInfoList(params: param) {
[weak self] success, error in
......
......@@ -245,6 +245,21 @@ class YHCollegeInfo: SmartCodable {
return enName
}
func getFullCollegeName() -> String {
var result = ""
if !zhName.isEmpty {
result += zhName
}
if !enName.isEmpty {
if !result.isEmpty {
result += "/"
}
result += enName
}
return result
}
required init() {
}
......
//
// YHGCCollegeSearchViewController.swift
// galaxy
//
// Created by Dufet on 2025/1/6.
// Copyright © 2025 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHGCCollegeSearchViewController: YHBaseViewController {
var orderId:Int = 0
var searchCollegeName:String?
var selectBlock:((String?, Int)->Void)?
var colleges:[YHCollegeInfo] = []
var isShowSureButton: Bool = true
let educationRequest:YHEducationRequestViewModel = YHEducationRequestViewModel()
lazy var searchBar: YHCollegeSearchBar = {
let bar = YHCollegeSearchBar.createBar()
return bar
}()
lazy var tableView: UITableView = {
let tableView = UITableView(frame:.zero, style:.plain)
if #available(iOS 11.0, *) {
tableView.contentInsetAdjustmentBehavior = .never
}
tableView.showsVerticalScrollIndicator = false
tableView.backgroundColor = .white
tableView.separatorStyle = .none
tableView.delegate = self
tableView.dataSource = self
tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell")
tableView.register(YHCollegeNameCell.self, forCellReuseIdentifier: YHCollegeNameCell.cellReuseIdentifier)
tableView.backgroundView = emptyDataTipsView
return tableView
}()
lazy var emptyDataTipsView: YHEmptyDataView = {
let view = YHEmptyDataView.createView("无搜索结果", kEmptySearchBgName)
view.topMargin = 130
view.isHidden = true
return view
}()
override func viewDidLoad() {
super.viewDidLoad()
createUI()
if searchCollegeName != nil {
searchCollege()
}
}
func createUI() {
self.view.backgroundColor = .white
self.gk_navTitle = "学校名称".local
view.addSubview(tableView)
view.addSubview(searchBar)
searchBar.confirmBtn.isHidden = !isShowSureButton
if let searchCollegeName = searchCollegeName {
searchBar.textField.text = searchCollegeName
}
searchBar.textChange = {
[weak self] text in
guard let self = self else { return }
searchCollegeName = text
self.searchCollege()
}
searchBar.confirmBlock = {
[weak self] in
guard let self = self else { return }
if let selectBlock = selectBlock {
selectBlock(searchBar.textField.text, 0)
self.navigationController?.popViewController(animated: true)
}
}
searchBar.snp.makeConstraints { make in
make.left.equalToSuperview().offset(16)
make.right.equalToSuperview().offset(-16)
make.height.equalTo(YHCollegeSearchBar.height)
make.top.equalToSuperview().offset(k_Height_NavigationtBarAndStatuBar+16)
}
tableView.snp.makeConstraints { make in
make.top.equalTo(searchBar.snp.bottom).offset(8)
make.left.right.bottom.equalToSuperview()
}
}
func searchCollege() {
let param:[String:Any] = ["order_id": orderId,
"name":searchCollegeName ?? "",
"page":1,
"page_size":100,
]
self.educationRequest.searchCollegeInfoList(params: param) {
[weak self] success, error in
guard let self = self else { return }
if success {
if let list = self.educationRequest.collegeList {
colleges = list
} else {
colleges = []
}
emptyDataTipsView.isHidden = colleges.count > 0
}
self.tableView.reloadData()
}
}
}
extension YHGCCollegeSearchViewController: UITableViewDelegate, UITableViewDataSource {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return colleges.count
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return UITableView.automaticDimension
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: YHCollegeNameCell.cellReuseIdentifier, for: indexPath) as! YHCollegeNameCell
if indexPath.row < colleges.count {
let college:YHCollegeInfo = colleges[indexPath.row]
var name = ""
if !isEmptyString(college.zhName) {
name += college.zhName
}
if !isEmptyString(college.zhName) && !isEmptyString(college.enName) {
name += "/"
}
if !isEmptyString(college.enName) {
name += college.enName
}
cell.titleLabel.text = name
}
return cell
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if let selectBlock = selectBlock {
if indexPath.row < colleges.count {
let college:YHCollegeInfo = colleges[indexPath.row]
selectBlock(college.getFullCollegeName(), college.id)
self.navigationController?.popViewController(animated: true)
}
}
}
}
......@@ -344,7 +344,7 @@ extension YHGCEducationDetailVC : UITableViewDelegate, UITableViewDataSource {
return
}
let vc = YHCollegeSearchViewController()
let vc = YHGCCollegeSearchViewController()
vc.isShowSureButton = false
vc.orderId = self.orderId
vc.searchCollegeName = detailInfo.college
......
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