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
0f8fc1ca
Commit
0f8fc1ca
authored
Feb 07, 2024
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// 专业资格
parent
a3b0d04a
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
636 additions
and
2 deletions
+636
-2
project.pbxproj
galaxy/galaxy.xcodeproj/project.pbxproj
+8
-0
YHFamilyInitialInfo.swift
...ess(流程)/FamilyMember(家庭成员信息表)/M/YHFamilyInitialInfo.swift
+59
-2
YHEducationDetailVC.swift
...)/ServiceProcess(流程)/学历专业资格填写/C/YHEducationDetailVC.swift
+297
-0
YHEducationalQualificationVC.swift
...Process(流程)/学历专业资格填写/C/YHEducationalQualificationVC.swift
+3
-0
YHProfessionalQualificationVC.swift
...rocess(流程)/学历专业资格填写/C/YHProfessionalQualificationVC.swift
+269
-0
No files found.
galaxy/galaxy.xcodeproj/project.pbxproj
View file @
0f8fc1ca
...
...
@@ -76,6 +76,8 @@
04C693642B723B56004C1758
/* YHMySettingCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04C693632B723B56004C1758
/* YHMySettingCell.swift */
;
};
04C693692B73191A004C1758
/* YHEducationalQualificationVC.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04C693682B73191A004C1758
/* YHEducationalQualificationVC.swift */
;
};
04C6936B2B7329E7004C1758
/* YHEducationInfoCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04C6936A2B7329E7004C1758
/* YHEducationInfoCell.swift */
;
};
04C6936F2B7350E7004C1758
/* YHEducationDetailVC.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04C6936E2B7350E7004C1758
/* YHEducationDetailVC.swift */
;
};
04C693712B735C6F004C1758
/* YHProfessionalQualificationVC.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04C693702B735C6F004C1758
/* YHProfessionalQualificationVC.swift */
;
};
04C8F4832B7216D800ADF59B
/* YHUserInfoHeaderView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04C8F4822B7216D800ADF59B
/* YHUserInfoHeaderView.swift */
;
};
04E86E092B707ACE00A35F4B
/* YHPhoneLoginViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04E86E082B707ACE00A35F4B
/* YHPhoneLoginViewController.swift */
;
};
04E86E0B2B70C13300A35F4B
/* YHCodeSueecssViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04E86E0A2B70C13300A35F4B
/* YHCodeSueecssViewController.swift */
;
};
...
...
@@ -310,6 +312,8 @@
04C693632B723B56004C1758
/* YHMySettingCell.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHMySettingCell.swift
;
sourceTree
=
"<group>"
;
};
04C693682B73191A004C1758
/* YHEducationalQualificationVC.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHEducationalQualificationVC.swift
;
sourceTree
=
"<group>"
;
};
04C6936A2B7329E7004C1758
/* YHEducationInfoCell.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHEducationInfoCell.swift
;
sourceTree
=
"<group>"
;
};
04C6936E2B7350E7004C1758
/* YHEducationDetailVC.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHEducationDetailVC.swift
;
sourceTree
=
"<group>"
;
};
04C693702B735C6F004C1758
/* YHProfessionalQualificationVC.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHProfessionalQualificationVC.swift
;
sourceTree
=
"<group>"
;
};
04C8F4822B7216D800ADF59B
/* YHUserInfoHeaderView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHUserInfoHeaderView.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>"
;
};
...
...
@@ -685,6 +689,8 @@
isa
=
PBXGroup
;
children
=
(
04C693682B73191A004C1758
/* YHEducationalQualificationVC.swift */
,
04C693702B735C6F004C1758
/* YHProfessionalQualificationVC.swift */
,
04C6936E2B7350E7004C1758
/* YHEducationDetailVC.swift */
,
);
path
=
C
;
sourceTree
=
"<group>"
;
...
...
@@ -1579,6 +1585,7 @@
04C693692B73191A004C1758
/* YHEducationalQualificationVC.swift in Sources */
,
0468D44D2B62643700CFB916
/* YHMainInformationTableViewCell.swift in Sources */
,
A5ACE92E2B4564F7002C94D2
/* YHValidateCodeInputView.swift in Sources */
,
04C6936F2B7350E7004C1758
/* YHEducationDetailVC.swift in Sources */
,
A5ACE94E2B4564F7002C94D2
/* AlignedCollectionViewFlowLayout.swift in Sources */
,
A5ACE93B2B4564F7002C94D2
/* UIFont+Extension.swift in Sources */
,
04C693642B723B56004C1758
/* YHMySettingCell.swift in Sources */
,
...
...
@@ -1682,6 +1689,7 @@
A5ACE9372B4564F7002C94D2
/* YHBaseUrlManager.swift in Sources */
,
A5ACE9352B4564F7002C94D2
/* YHNetRequest.swift in Sources */
,
A5FD63CB2B63D6C300D1D9DA
/* YHInformationFillTipsCell.swift in Sources */
,
04C693712B735C6F004C1758
/* YHProfessionalQualificationVC.swift in Sources */
,
A5ACE9272B4564F7002C94D2
/* YHLoginViewController.swift in Sources */
,
);
runOnlyForDeploymentPostprocessing
=
0
;
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/FamilyMember(家庭成员信息表)/M/YHFamilyInitialInfo.swift
View file @
0f8fc1ca
...
...
@@ -170,8 +170,35 @@ enum YHFormDetailItemType:Int {
// 学历信息相关
case
educationInfo
// 学校全称
case
universityFullName
// 授课形式
case
educationStyle
// 入学年月
case
educationTime
// 毕业年月
case
graduateTime
// 专业
case
educationMajor
// 学位
case
educationDegree
// 学位类型
case
degreeType
// 上课国家/地区
case
educationCountry
// 上课城市
case
educationCity
// 资格证书名称
case
qualificationCertificateName
// 颁授机构全称
case
conferAgencyFullName
// 颁授年份
case
conferTime
// 颁授国家/地区
case
conferCountry
// 颁授城市
case
conferCity
}
//添加item
...
...
@@ -454,6 +481,36 @@ class YHFormDetailItem : YHFormItemProtocol {
case
.
educationInfo
:
return
""
.
local
case
.
universityFullName
:
return
"学校全称"
.
local
case
.
educationStyle
:
return
"授课形式"
.
local
case
.
educationTime
:
return
"入学年月"
.
local
case
.
graduateTime
:
return
"毕业年月"
.
local
case
.
educationMajor
:
return
"专业"
.
local
case
.
educationDegree
:
return
"学位"
.
local
case
.
degreeType
:
return
"学位类型"
.
local
case
.
educationCountry
:
return
"上课国家/地区"
.
local
case
.
educationCity
:
return
"上课城市"
.
local
case
.
qualificationCertificateName
:
return
"资格证书名称"
.
local
case
.
conferAgencyFullName
:
return
"颁授机构全称"
.
local
case
.
conferTime
:
return
"颁授年份"
.
local
case
.
conferCountry
:
return
"颁授国家/地区"
.
local
case
.
conferCity
:
return
"颁授城市"
.
local
}
}
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/学历专业资格填写/C/YHEducationDetailVC.swift
0 → 100644
View file @
0f8fc1ca
//
// YHEducationDetailVC.swift
// galaxy
//
// Created by edy on 2024/2/7.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import
UIKit
class
YHEducationDetailVC
:
YHBaseViewController
{
let
familyRequest
:
YHFamilyRequestViewModel
=
YHFamilyRequestViewModel
()
var
familyMemberInfo
:
YHFamilyMemberGroupInfo
?
var
isChildsEditMode
:
YHFormTitleItemEditType
=
.
none
var
isBrothersEditMode
:
YHFormTitleItemEditType
=
.
none
var
items
:[[
YHFormItemProtocol
]]
=
[]
lazy
var
tableView
:
UITableView
=
{
let
tableView
=
UITableView
(
frame
:
.
zero
,
style
:
.
plain
)
if
#available(iOS 11.0, *)
{
tableView
.
contentInsetAdjustmentBehavior
=
.
never
}
tableView
.
showsVerticalScrollIndicator
=
false
tableView
.
backgroundColor
=
.
clear
tableView
.
separatorStyle
=
.
none
tableView
.
delegate
=
self
tableView
.
dataSource
=
self
tableView
.
register
(
UITableViewCell
.
self
,
forCellReuseIdentifier
:
"UITableViewCell"
)
tableView
.
register
(
YHFormItemTitleCell
.
self
,
forCellReuseIdentifier
:
YHFormItemTitleCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHFormItemAddCell
.
self
,
forCellReuseIdentifier
:
YHFormItemAddCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHFormItemInputTextCell
.
self
,
forCellReuseIdentifier
:
YHFormItemInputTextCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHFormItemSelectSheetCell
.
self
,
forCellReuseIdentifier
:
YHFormItemSelectSheetCell
.
cellReuseIdentifier
)
return
tableView
}()
var
bottomView
:
YHSaveAndSubmitView
=
{
let
view
=
YHSaveAndSubmitView
.
createView
()
return
view
}()
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
self
.
gk_navTitle
=
"学历X"
.
local
view
.
backgroundColor
=
UIColor
(
hexString
:
"#F8F8F8"
)
createUI
()
}
override
func
viewWillAppear
(
_
animated
:
Bool
)
{
super
.
viewWillAppear
(
animated
)
}
func
createUI
()
{
view
.
addSubview
(
tableView
);
view
.
addSubview
(
bottomView
)
bottomView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
right
.
equalToSuperview
()
make
.
bottom
.
equalToSuperview
()
.
offset
(
-
k_Height_safeAreaInsetsBottom
())
make
.
height
.
equalTo
(
YHSaveAndSubmitView
.
height
)
}
tableView
.
snp
.
makeConstraints
{
make
in
make
.
top
.
equalToSuperview
()
.
offset
(
k_Height_NavigationtBarAndStatuBar
)
make
.
bottom
.
equalTo
(
bottomView
.
snp
.
top
)
make
.
left
.
equalToSuperview
()
.
offset
(
16
)
make
.
right
.
equalToSuperview
()
.
offset
(
-
16
)
}
loadInfo
()
}
func
loadInfo
()
{
items
.
removeAll
()
let
title0
=
YHFormTitleItem
(
type
:
.
mainApplicantEducation
)
let
item00
=
YHFormDetailItem
(
type
:
.
universityFullName
)
item00
.
placeHolder
=
"请输入学校全称,例:清华,需填全称“清华大学"
.
local
let
item01
=
YHFormDetailItem
(
type
:
.
educationStyle
)
item01
.
placeHolder
=
"请选择授课形式"
.
local
let
item02
=
YHFormDetailItem
(
type
:
.
educationTime
)
item02
.
placeHolder
=
"请选择年月"
.
local
let
item03
=
YHFormDetailItem
(
type
:
.
graduateTime
)
item03
.
placeHolder
=
"请选择年月"
.
local
let
item04
=
YHFormDetailItem
(
type
:
.
educationMajor
)
item04
.
placeHolder
=
"请输入专业"
.
local
let
item05
=
YHFormDetailItem
(
type
:
.
educationDegree
)
item05
.
placeHolder
=
"请选择学位"
.
local
let
item06
=
YHFormDetailItem
(
type
:
.
degreeType
)
item06
.
placeHolder
=
"请输入学位类型,如管理学"
.
local
let
item07
=
YHFormDetailItem
(
type
:
.
educationCountry
)
item07
.
placeHolder
=
"请输入国家及地区"
.
local
let
item08
=
YHFormDetailItem
(
type
:
.
educationCity
)
item08
.
placeHolder
=
"请选择城市"
.
local
let
arr0
:[
YHFormItemProtocol
]
=
[
title0
,
item00
,
item01
,
item02
,
item03
,
item04
,
item05
,
item06
,
item07
,
item08
]
items
.
append
(
arr0
)
self
.
tableView
.
reloadData
()
}
}
extension
YHEducationDetailVC
:
UITableViewDelegate
,
UITableViewDataSource
{
func
numberOfSections
(
in
tableView
:
UITableView
)
->
Int
{
return
items
.
count
}
func
tableView
(
_
tableView
:
UITableView
,
numberOfRowsInSection
section
:
Int
)
->
Int
{
if
section
>=
items
.
count
{
return
0
}
let
arr
=
items
[
section
]
return
arr
.
count
}
func
tableView
(
_
tableView
:
UITableView
,
cellForRowAt
indexPath
:
IndexPath
)
->
UITableViewCell
{
if
indexPath
.
section
>=
items
.
count
{
return
createDefaultCell
(
indexPath
)
}
let
arr
:[
YHFormItemProtocol
]
=
items
[
indexPath
.
section
]
if
indexPath
.
row
>=
arr
.
count
{
return
createDefaultCell
(
indexPath
)
}
let
item
:
YHFormItemProtocol
=
arr
[
indexPath
.
row
]
if
item
is
YHFormTitleItem
{
// 是标题
let
formItem
=
item
as!
YHFormTitleItem
// 配偶父母子女兄妹title
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHFormItemTitleCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHFormItemTitleCell
cell
.
titleLabel
.
text
=
formItem
.
getTitle
()
cell
.
subTitleLabel
.
text
=
formItem
.
getSubTitle
()
return
cell
}
if
item
is
YHFormDetailItem
{
let
detailItem
=
item
as!
YHFormDetailItem
let
cellType
=
getCellType
(
detailItem
)
if
cellType
==
.
inputText
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHFormItemInputTextCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHFormItemInputTextCell
cell
.
placeHolder
=
detailItem
.
placeHolder
cell
.
isMust
=
detailItem
.
isNeed
cell
.
title
=
detailItem
.
getTitle
()
return
cell
}
else
if
cellType
==
.
selectSheet
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHFormItemSelectSheetCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHFormItemSelectSheetCell
cell
.
placeHolder
=
detailItem
.
placeHolder
cell
.
isMust
=
detailItem
.
isNeed
cell
.
title
=
detailItem
.
getTitle
()
cell
.
detail
=
""
return
cell
}
}
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"UITableViewCell"
,
for
:
indexPath
)
return
cell
}
func
tableView
(
_
tableView
:
UITableView
,
willDisplay
cell
:
UITableViewCell
,
forRowAt
indexPath
:
IndexPath
)
{
if
indexPath
.
section
>=
items
.
count
{
return
}
let
arr
:[
YHFormItemProtocol
]
=
items
[
indexPath
.
section
]
if
indexPath
.
row
>=
arr
.
count
{
return
}
createCorner
(
cell
:
cell
,
arr
:
arr
,
indexPath
:
indexPath
)
}
func
tableView
(
_
tableView
:
UITableView
,
heightForRowAt
indexPath
:
IndexPath
)
->
CGFloat
{
let
arr
=
items
[
indexPath
.
section
]
let
item
:
YHFormItemProtocol
=
arr
[
indexPath
.
row
]
if
item
is
YHFormTitleItem
{
// 是标题
return
52.0
}
return
UITableView
.
automaticDimension
}
func
tableView
(
_
tableView
:
UITableView
,
viewForFooterInSection
section
:
Int
)
->
UIView
?
{
return
UIView
()
}
private
func
tableView
(
_
tableView
:
UITableView
,
viewForFooterInSection
section
:
Int
)
->
CGFloat
{
return
14.0
}
func
tableView
(
_
tableView
:
UITableView
,
didSelectRowAt
indexPath
:
IndexPath
)
{
let
vc
=
YHProfessionalQualificationVC
()
self
.
navigationController
?
.
pushViewController
(
vc
)
return
/*
let arr = items[indexPath.section]
let item:YHFormItemProtocol = arr[indexPath.row]
// 标题
if item is YHFormTitleItem {
return
}
if item is YHFormDetailItem {
let detailItem = item as! YHFormDetailItem
if detailItem.type == .educationStyle { // 授课形式
YHFormPickerView.show(type: .edution, selectType: .education(.fullTime)) {
[weak self] selectType in
guard let self = self else { return }
}
} else if detailItem.type == .educationTime || detailItem.type == .graduateTime { // 入学及毕业年月
YHDatePickView.show(type: .yyyymm) {
[weak self] date in
guard let self = self else { return }
}
} else if detailItem.type == .educationDegree { // 学位
YHFormPickerView.show(type: .degree, selectType: .degree(.bachelor)) {
[weak self] selectType in
guard let self = self else { return }
}
} else if detailItem.type == .educationCountry { // 上课国家/地区
let vc = YHSelectCountryViewController()
vc.backLocationStringController = {
[weak self] country in
guard let self = self else { return }
}
self.navigationController?.pushViewController(vc)
} else if detailItem.type == .educationCity { // 上课城市
let vc = YHAddressViewController()
vc.backLocationStringController = {
[weak self] (string1, string2, string3, string4) in
guard let self = self else { return }
}
self.present(vc, animated: true)
}
}
*/
}
func
createDefaultCell
(
_
indexPath
:
IndexPath
)
->
UITableViewCell
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"UITableViewCell"
,
for
:
indexPath
)
return
cell
}
func
createCorner
(
cell
:
UITableViewCell
,
arr
:
Array
<
Any
>
,
indexPath
:
IndexPath
)
{
// 设置每块section圆角
if
(
indexPath
.
row
==
0
)
{
let
corner
=
UIRectCorner
(
rawValue
:
UIRectCorner
.
topLeft
.
rawValue
|
UIRectCorner
.
topRight
.
rawValue
)
cell
.
createCorner
(
CGSizeMake
(
12.0
,
12.0
),
corner
)
}
else
if
(
indexPath
.
row
==
arr
.
count
-
1
)
{
let
corner
=
UIRectCorner
(
rawValue
:
UIRectCorner
.
bottomLeft
.
rawValue
|
UIRectCorner
.
bottomRight
.
rawValue
)
cell
.
createCorner
(
CGSizeMake
(
12.0
,
12.0
),
corner
)
}
else
{
cell
.
layer
.
mask
=
nil
}
}
func
getCellType
(
_
item
:
Any
)
->
HKFormItemCellType
{
if
item
is
YHFormTitleItem
{
return
.
title
}
if
item
is
YHFormDetailItem
{
let
detailItem
=
item
as!
YHFormDetailItem
if
detailItem
.
type
==
.
universityFullName
||
detailItem
.
type
==
.
degreeType
||
detailItem
.
type
==
.
educationMajor
{
return
.
inputText
}
if
detailItem
.
type
==
.
educationStyle
||
detailItem
.
type
==
.
educationTime
||
detailItem
.
type
==
.
graduateTime
||
detailItem
.
type
==
.
educationDegree
||
detailItem
.
type
==
.
educationCountry
||
detailItem
.
type
==
.
educationCity
{
return
.
selectSheet
}
}
return
.
defaultType
}
}
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/学历专业资格填写/C/YHEducationalQualificationVC.swift
View file @
0f8fc1ca
...
...
@@ -183,6 +183,9 @@ extension YHEducationalQualificationVC : UITableViewDelegate, UITableViewDataSou
if
item
is
YHFormTitleItem
{
return
}
let
vc
=
YHEducationDetailVC
()
self
.
navigationController
?
.
pushViewController
(
vc
)
}
func
createDefaultCell
(
_
indexPath
:
IndexPath
)
->
UITableViewCell
{
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/学历专业资格填写/C/YHProfessionalQualificationVC.swift
0 → 100644
View file @
0f8fc1ca
//
// YHProfessionalQualificationVC.swift
// galaxy
//
// Created by edy on 2024/2/7.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import
UIKit
class
YHProfessionalQualificationVC
:
YHBaseViewController
{
let
familyRequest
:
YHFamilyRequestViewModel
=
YHFamilyRequestViewModel
()
var
familyMemberInfo
:
YHFamilyMemberGroupInfo
?
var
isChildsEditMode
:
YHFormTitleItemEditType
=
.
none
var
isBrothersEditMode
:
YHFormTitleItemEditType
=
.
none
var
items
:[[
YHFormItemProtocol
]]
=
[]
lazy
var
tableView
:
UITableView
=
{
let
tableView
=
UITableView
(
frame
:
.
zero
,
style
:
.
plain
)
if
#available(iOS 11.0, *)
{
tableView
.
contentInsetAdjustmentBehavior
=
.
never
}
tableView
.
showsVerticalScrollIndicator
=
false
tableView
.
backgroundColor
=
.
clear
tableView
.
separatorStyle
=
.
none
tableView
.
delegate
=
self
tableView
.
dataSource
=
self
tableView
.
register
(
UITableViewCell
.
self
,
forCellReuseIdentifier
:
"UITableViewCell"
)
tableView
.
register
(
YHFormItemTitleCell
.
self
,
forCellReuseIdentifier
:
YHFormItemTitleCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHFormItemAddCell
.
self
,
forCellReuseIdentifier
:
YHFormItemAddCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHFormItemInputTextCell
.
self
,
forCellReuseIdentifier
:
YHFormItemInputTextCell
.
cellReuseIdentifier
)
tableView
.
register
(
YHFormItemSelectSheetCell
.
self
,
forCellReuseIdentifier
:
YHFormItemSelectSheetCell
.
cellReuseIdentifier
)
return
tableView
}()
var
bottomView
:
YHSaveAndSubmitView
=
{
let
view
=
YHSaveAndSubmitView
.
createView
()
return
view
}()
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
self
.
gk_navTitle
=
"学历X"
.
local
view
.
backgroundColor
=
UIColor
(
hexString
:
"#F8F8F8"
)
createUI
()
}
override
func
viewWillAppear
(
_
animated
:
Bool
)
{
super
.
viewWillAppear
(
animated
)
}
func
createUI
()
{
view
.
addSubview
(
tableView
);
view
.
addSubview
(
bottomView
)
bottomView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
right
.
equalToSuperview
()
make
.
bottom
.
equalToSuperview
()
.
offset
(
-
k_Height_safeAreaInsetsBottom
())
make
.
height
.
equalTo
(
YHSaveAndSubmitView
.
height
)
}
tableView
.
snp
.
makeConstraints
{
make
in
make
.
top
.
equalToSuperview
()
.
offset
(
k_Height_NavigationtBarAndStatuBar
)
make
.
bottom
.
equalTo
(
bottomView
.
snp
.
top
)
make
.
left
.
equalToSuperview
()
.
offset
(
16
)
make
.
right
.
equalToSuperview
()
.
offset
(
-
16
)
}
loadInfo
()
}
func
loadInfo
()
{
items
.
removeAll
()
let
title0
=
YHFormTitleItem
(
type
:
.
mainApplicantEducation
)
let
item00
=
YHFormDetailItem
(
type
:
.
qualificationCertificateName
)
item00
.
placeHolder
=
"请输入资格证书名称"
.
local
let
item01
=
YHFormDetailItem
(
type
:
.
conferAgencyFullName
)
item01
.
placeHolder
=
"请输入颁授机构全称"
.
local
let
item02
=
YHFormDetailItem
(
type
:
.
conferTime
)
item02
.
placeHolder
=
"请选择颁授年份"
.
local
let
item03
=
YHFormDetailItem
(
type
:
.
conferCountry
)
item03
.
placeHolder
=
"请选择颁授国家/地区"
.
local
let
item04
=
YHFormDetailItem
(
type
:
.
conferCity
)
item04
.
placeHolder
=
"请选择颁授城市"
.
local
let
arr0
:[
YHFormItemProtocol
]
=
[
title0
,
item00
,
item01
,
item02
,
item03
,
item04
]
items
.
append
(
arr0
)
self
.
tableView
.
reloadData
()
}
}
extension
YHProfessionalQualificationVC
:
UITableViewDelegate
,
UITableViewDataSource
{
func
numberOfSections
(
in
tableView
:
UITableView
)
->
Int
{
return
items
.
count
}
func
tableView
(
_
tableView
:
UITableView
,
numberOfRowsInSection
section
:
Int
)
->
Int
{
if
section
>=
items
.
count
{
return
0
}
let
arr
=
items
[
section
]
return
arr
.
count
}
func
tableView
(
_
tableView
:
UITableView
,
cellForRowAt
indexPath
:
IndexPath
)
->
UITableViewCell
{
if
indexPath
.
section
>=
items
.
count
{
return
createDefaultCell
(
indexPath
)
}
let
arr
:[
YHFormItemProtocol
]
=
items
[
indexPath
.
section
]
if
indexPath
.
row
>=
arr
.
count
{
return
createDefaultCell
(
indexPath
)
}
let
item
:
YHFormItemProtocol
=
arr
[
indexPath
.
row
]
if
item
is
YHFormTitleItem
{
// 是标题
let
formItem
=
item
as!
YHFormTitleItem
// 配偶父母子女兄妹title
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHFormItemTitleCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHFormItemTitleCell
cell
.
titleLabel
.
text
=
formItem
.
getTitle
()
cell
.
subTitleLabel
.
text
=
formItem
.
getSubTitle
()
return
cell
}
if
item
is
YHFormDetailItem
{
let
detailItem
=
item
as!
YHFormDetailItem
let
cellType
=
getCellType
(
detailItem
)
if
cellType
==
.
inputText
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHFormItemInputTextCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHFormItemInputTextCell
cell
.
placeHolder
=
detailItem
.
placeHolder
cell
.
isMust
=
detailItem
.
isNeed
cell
.
title
=
detailItem
.
getTitle
()
return
cell
}
else
if
cellType
==
.
selectSheet
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHFormItemSelectSheetCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHFormItemSelectSheetCell
cell
.
placeHolder
=
detailItem
.
placeHolder
cell
.
isMust
=
detailItem
.
isNeed
cell
.
title
=
detailItem
.
getTitle
()
cell
.
detail
=
""
return
cell
}
}
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"UITableViewCell"
,
for
:
indexPath
)
return
cell
}
func
tableView
(
_
tableView
:
UITableView
,
willDisplay
cell
:
UITableViewCell
,
forRowAt
indexPath
:
IndexPath
)
{
if
indexPath
.
section
>=
items
.
count
{
return
}
let
arr
:[
YHFormItemProtocol
]
=
items
[
indexPath
.
section
]
if
indexPath
.
row
>=
arr
.
count
{
return
}
createCorner
(
cell
:
cell
,
arr
:
arr
,
indexPath
:
indexPath
)
}
func
tableView
(
_
tableView
:
UITableView
,
heightForRowAt
indexPath
:
IndexPath
)
->
CGFloat
{
let
arr
=
items
[
indexPath
.
section
]
let
item
:
YHFormItemProtocol
=
arr
[
indexPath
.
row
]
if
item
is
YHFormTitleItem
{
// 是标题
return
52.0
}
return
UITableView
.
automaticDimension
}
func
tableView
(
_
tableView
:
UITableView
,
viewForFooterInSection
section
:
Int
)
->
UIView
?
{
return
UIView
()
}
private
func
tableView
(
_
tableView
:
UITableView
,
viewForFooterInSection
section
:
Int
)
->
CGFloat
{
return
14.0
}
func
tableView
(
_
tableView
:
UITableView
,
didSelectRowAt
indexPath
:
IndexPath
)
{
let
arr
=
items
[
indexPath
.
section
]
let
item
:
YHFormItemProtocol
=
arr
[
indexPath
.
row
]
// 标题
if
item
is
YHFormTitleItem
{
return
}
if
item
is
YHFormDetailItem
{
let
detailItem
=
item
as!
YHFormDetailItem
if
detailItem
.
type
==
.
conferTime
{
// 授权年份
YHDatePickView
.
show
(
type
:
.
yyyy
)
{
[
weak
self
]
date
in
guard
let
self
=
self
else
{
return
}
}
}
else
if
detailItem
.
type
==
.
conferCountry
{
// 授权国家/地区
let
vc
=
YHSelectCountryViewController
()
vc
.
backLocationStringController
=
{
[
weak
self
]
country
in
guard
let
self
=
self
else
{
return
}
}
self
.
navigationController
?
.
pushViewController
(
vc
)
}
else
if
detailItem
.
type
==
.
conferCity
{
// 授权城市
let
vc
=
YHAddressViewController
()
vc
.
backLocationStringController
=
{
[
weak
self
]
(
string1
,
string2
,
string3
,
string4
)
in
guard
let
self
=
self
else
{
return
}
}
self
.
present
(
vc
,
animated
:
true
)
}
}
}
func
createDefaultCell
(
_
indexPath
:
IndexPath
)
->
UITableViewCell
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
"UITableViewCell"
,
for
:
indexPath
)
return
cell
}
func
createCorner
(
cell
:
UITableViewCell
,
arr
:
Array
<
Any
>
,
indexPath
:
IndexPath
)
{
// 设置每块section圆角
if
(
indexPath
.
row
==
0
)
{
let
corner
=
UIRectCorner
(
rawValue
:
UIRectCorner
.
topLeft
.
rawValue
|
UIRectCorner
.
topRight
.
rawValue
)
cell
.
createCorner
(
CGSizeMake
(
12.0
,
12.0
),
corner
)
}
else
if
(
indexPath
.
row
==
arr
.
count
-
1
)
{
let
corner
=
UIRectCorner
(
rawValue
:
UIRectCorner
.
bottomLeft
.
rawValue
|
UIRectCorner
.
bottomRight
.
rawValue
)
cell
.
createCorner
(
CGSizeMake
(
12.0
,
12.0
),
corner
)
}
else
{
cell
.
layer
.
mask
=
nil
}
}
func
getCellType
(
_
item
:
Any
)
->
HKFormItemCellType
{
if
item
is
YHFormTitleItem
{
return
.
title
}
if
item
is
YHFormDetailItem
{
let
detailItem
=
item
as!
YHFormDetailItem
if
detailItem
.
type
==
.
conferAgencyFullName
||
detailItem
.
type
==
.
qualificationCertificateName
{
return
.
inputText
}
if
detailItem
.
type
==
.
conferTime
||
detailItem
.
type
==
.
conferCountry
||
detailItem
.
type
==
.
conferCity
{
return
.
selectSheet
}
}
return
.
defaultType
}
}
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