Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
galaxy-iOS
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mobile-group
galaxy-iOS
Commits
14cd018e
Commit
14cd018e
authored
Feb 28, 2024
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// 搜索学校
parent
39f0dcb5
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
126 additions
and
5 deletions
+126
-5
YHCollegeSearchViewController.swift
...ification(学历专业资格填写)/C/YHCollegeSearchViewController.swift
+52
-4
YHEducationDetailVC.swift
...ation&Qualification(学历专业资格填写)/C/YHEducationDetailVC.swift
+1
-0
YHEducationInfo.swift
...Education&Qualification(学历专业资格填写)/M/YHEducationInfo.swift
+36
-0
YHEducationRequestViewModel.swift
...alification(学历专业资格填写)/M/YHEducationRequestViewModel.swift
+29
-0
YHCollegeNameCell.swift
...ucation&Qualification(学历专业资格填写)/V/YHCollegeNameCell.swift
+4
-1
YHAllApiName.swift
galaxy/galaxy/Classes/Tools/NetWork/YHAllApiName.swift
+4
-0
No files found.
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/Education&Qualification(学历专业资格填写)/C/YHCollegeSearchViewController.swift
View file @
14cd018e
...
...
@@ -10,9 +10,11 @@ import UIKit
class
YHCollegeSearchViewController
:
YHBaseViewController
{
var
orderId
:
Int
=
0
var
searchCollegeName
:
String
?
var
selectBlock
:((
String
?)
->
Void
)?
var
colleges
:[
Any
]
=
[]
var
colleges
:[
YHCollegeInfo
]
=
[]
let
educationRequest
:
YHEducationRequestViewModel
=
YHEducationRequestViewModel
()
lazy
var
searchBar
:
YHSearchBar
=
{
let
bar
=
YHSearchBar
.
createBar
()
...
...
@@ -39,6 +41,7 @@ class YHCollegeSearchViewController: YHBaseViewController {
lazy
var
emptyDataTipsView
:
UIView
=
{
let
view
=
UIView
(
frame
:
CGRect
(
x
:
0
,
y
:
0
,
width
:
KScreenWidth
,
height
:
124
))
view
.
isHidden
=
true
let
imgView
=
UIImageView
(
image
:
UIImage
(
named
:
"service_center_no_data"
))
imgView
.
contentMode
=
.
scaleAspectFill
...
...
@@ -67,6 +70,9 @@ class YHCollegeSearchViewController: YHBaseViewController {
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
createUI
()
if
searchCollegeName
!=
nil
{
searchCollege
()
}
}
func
createUI
()
{
...
...
@@ -83,6 +89,8 @@ class YHCollegeSearchViewController: YHBaseViewController {
searchBar
.
textChange
=
{
[
weak
self
]
text
in
guard
let
self
=
self
else
{
return
}
searchCollegeName
=
text
searchCollege
()
}
searchBar
.
confirmBlock
=
{
[
weak
self
]
in
...
...
@@ -105,6 +113,28 @@ class YHCollegeSearchViewController: YHBaseViewController {
make
.
left
.
right
.
bottom
.
equalToSuperview
()
}
}
func
searchCollege
()
{
let
param
:[
String
:
Any
]
=
[
"order_id"
:
orderId
,
"name"
:
searchCollegeName
??
""
,
"page"
:
1
,
"page_size"
:
15
,
]
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
YHCollegeSearchViewController
:
UITableViewDelegate
,
UITableViewDataSource
{
...
...
@@ -114,19 +144,37 @@ extension YHCollegeSearchViewController: UITableViewDelegate, UITableViewDataSou
}
func
tableView
(
_
tableView
:
UITableView
,
heightForRowAt
indexPath
:
IndexPath
)
->
CGFloat
{
return
36.0
return
UITableView
.
automaticDimension
}
func
tableView
(
_
tableView
:
UITableView
,
cellForRowAt
indexPath
:
IndexPath
)
->
UITableViewCell
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHCollegeNameCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHCollegeNameCell
cell
.
titleLabel
.
text
=
"XXXXXXXXX"
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
{
selectBlock
(
""
)
if
indexPath
.
row
<
colleges
.
count
{
let
college
:
YHCollegeInfo
=
colleges
[
indexPath
.
row
]
selectBlock
(
college
.
getCollegeName
())
self
.
navigationController
?
.
popViewController
(
animated
:
true
)
}
}
}
}
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/Education&Qualification(学历专业资格填写)/C/YHEducationDetailVC.swift
View file @
14cd018e
...
...
@@ -299,6 +299,7 @@ extension YHEducationDetailVC : UITableViewDelegate, UITableViewDataSource {
if
detailItem
.
type
==
.
universityFullName
{
// 选择大学名称
let
vc
=
YHCollegeSearchViewController
()
vc
.
orderId
=
self
.
orderId
vc
.
searchCollegeName
=
detailInfo
.
college
vc
.
selectBlock
=
{
[
weak
self
]
text
in
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/Education&Qualification(学历专业资格填写)/M/YHEducationInfo.swift
View file @
14cd018e
...
...
@@ -162,5 +162,41 @@ class YHQualificationDetailInfo: SmartCodable {
}
}
class
YHCollegeInfo
:
SmartCodable
{
var
id
:
Int
=
0
var
zhName
:
String
=
""
var
enName
:
String
=
""
// 0-未知,1-中文主校,2-英文主校
var
mainNameType
:
Int
=
0
var
schoolType
:
Int
=
0
var
assoProduct
:
[
Int
]
=
[]
var
color
:
String
=
""
enum
CodingKeys
:
String
,
CodingKey
{
case
id
=
"id"
case
zhName
=
"zh_name"
case
enName
=
"en_name"
case
mainNameType
=
"main_name_type"
case
schoolType
=
"school_type"
case
assoProduct
=
"asso_product"
case
color
=
"color"
}
func
getCollegeName
()
->
String
{
if
mainNameType
==
1
{
return
zhName
}
else
if
mainNameType
==
2
{
return
enName
}
return
""
}
required
init
()
{
}
}
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/Education&Qualification(学历专业资格填写)/M/YHEducationRequestViewModel.swift
View file @
14cd018e
...
...
@@ -15,6 +15,8 @@ class YHEducationRequestViewModel {
var
educationDetailInfo
:
YHEducationDetailInfo
?
// 专业详情信息
var
qualificationDetailInfo
:
YHQualificationDetailInfo
?
// 搜索学校数组
var
collegeList
:
[
YHCollegeInfo
]?
// 请求学历和专业证书信息列表
func
requestEducationInfoList
(
params
:[
String
:
Any
],
callBackBlock
:
@escaping
(
_
success
:
Bool
,
_
error
:
YHErrorModel
?)
->
())
{
...
...
@@ -215,5 +217,32 @@ class YHEducationRequestViewModel {
}
}
// 搜索学校
func
searchCollegeInfoList
(
params
:[
String
:
Any
],
callBackBlock
:
@escaping
(
_
success
:
Bool
,
_
error
:
YHErrorModel
?)
->
())
{
YHHUD
.
show
(
.
progress
(
message
:
"数据加载中..."
))
let
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
YHAllApiName
.
Education
.
searchCollegeNameApi
let
_
=
YHNetRequest
.
getRequest
(
url
:
strUrl
,
params
:
params
)
{[
weak
self
]
json
,
code
in
YHHUD
.
hide
()
guard
let
self
=
self
else
{
return
}
printLog
(
"model 是 ==>
\(
json
)
"
)
let
dic
=
json
.
data
as?
[
AnyHashable
:
Any
]
guard
let
dic
=
dic
,
let
list
=
dic
[
"list"
]
as?
[[
String
:
Any
]],
let
results
=
[
YHCollegeInfo
]
.
deserialize
(
array
:
list
)
as?
[
YHCollegeInfo
]
else
{
callBackBlock
(
false
,
nil
)
return
}
collegeList
=
results
callBackBlock
(
true
,
nil
)
}
failBlock
:
{
err
in
callBackBlock
(
false
,
err
)
}
}
}
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/Education&Qualification(学历专业资格填写)/V/YHCollegeNameCell.swift
View file @
14cd018e
...
...
@@ -16,6 +16,7 @@ class YHCollegeNameCell: UITableViewCell {
let
label
=
UILabel
()
label
.
textColor
=
.
mainTextColor
label
.
textAlignment
=
.
left
label
.
numberOfLines
=
0
label
.
font
=
UIFont
.
PFSC_B
(
ofSize
:
14
)
return
label
}()
...
...
@@ -37,7 +38,9 @@ class YHCollegeNameCell: UITableViewCell {
titleLabel
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalToSuperview
()
.
offset
(
21
)
make
.
right
.
equalToSuperview
()
.
offset
(
-
21
)
make
.
top
.
bottom
.
equalToSuperview
()
make
.
top
.
equalToSuperview
()
.
offset
(
8
)
make
.
bottom
.
equalToSuperview
()
.
offset
(
-
8
)
}
}
...
...
galaxy/galaxy/Classes/Tools/NetWork/YHAllApiName.swift
View file @
14cd018e
...
...
@@ -51,6 +51,7 @@ class YHAllApiName {
// 删除家庭成员信息
static
let
familyMemberDeleteApi
=
"frontend/order/information/family/delete"
}
struct
Education
{
...
...
@@ -72,6 +73,9 @@ class YHAllApiName {
// static let saveAllEduAndQuaInfoApi = "frontend/education/save_all"
static
let
saveAllEduAndQuaInfoApi
=
"infoflow/submitEducert"
// 搜索大学名称
static
let
searchCollegeNameApi
=
"infoflow/getSchools"
}
struct
Qualification
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment