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
8878007e
Commit
8878007e
authored
Mar 05, 2024
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// 城市选择器
parent
34134a0f
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
109 additions
and
7 deletions
+109
-7
YHChildBasicInfoVC.swift
...amilyMember(家庭成员信息表)/C/Child(子女)/YHChildBasicInfoVC.swift
+8
-1
YHChildPrimaryInfoVC.swift
...ilyMember(家庭成员信息表)/C/Child(子女)/YHChildPrimaryInfoVC.swift
+27
-2
YHSpouseBasicInfoVC.swift
...ilyMember(家庭成员信息表)/C/Spouse(配偶)/YHSpouseBasicInfoVC.swift
+8
-1
YHSpousePrimaryInfoVC.swift
...yMember(家庭成员信息表)/C/Spouse(配偶)/YHSpousePrimaryInfoVC.swift
+8
-1
YHBrotherInfoVC.swift
...Process(流程)/FamilyMember(家庭成员信息表)/C/YHBrotherInfoVC.swift
+8
-1
YHParentInfoVC.swift
...eProcess(流程)/FamilyMember(家庭成员信息表)/C/YHParentInfoVC.swift
+8
-1
YHFamilyInitialInfo.swift
...ess(流程)/FamilyMember(家庭成员信息表)/M/YHFamilyInitialInfo.swift
+35
-0
YHFormItemDoubleChoiceCell.swift
.../FamilyMember(家庭成员信息表)/V/YHFormItemDoubleChoiceCell.swift
+7
-0
No files found.
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/FamilyMember(家庭成员信息表)/C/Child(子女)/YHChildBasicInfoVC.swift
View file @
8878007e
...
...
@@ -455,7 +455,14 @@ extension YHChildBasicInfoVC : UITableViewDelegate, UITableViewDataSource {
[
weak
self
]
(
string1
,
string2
,
string3
,
string4
)
in
guard
let
self
=
self
else
{
return
}
print
(
"
\(
string1
)\n\(
string2
)\n\(
string3
)\n\(
string4
)
"
)
self
.
child
?
.
birthPlace
.
area
=
[
string2
,
string3
]
var
citys
:[
String
]
=
[]
if
!
isEmptyString
(
string2
)
{
citys
.
append
(
string2
)
}
if
!
isEmptyString
(
string3
)
{
citys
.
append
(
string3
)
}
self
.
child
?
.
birthPlace
.
area
=
citys
self
.
loadInfo
()
save
()
}
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/FamilyMember(家庭成员信息表)/C/Child(子女)/YHChildPrimaryInfoVC.swift
View file @
8878007e
...
...
@@ -13,6 +13,8 @@ class YHChildPrimaryInfoVC: YHBaseViewController, YHFamilyMemberProtol {
var
child
:
YHFamilyMember
?
weak
var
delegate
:
YHSpouseInfoVCProtocol
?
var
isNeedShowError
=
false
// 是否随行能编辑
var
isFollowCanEdit
=
true
lazy
var
items
:[[
YHFormItemProtocol
]]
=
[[
YHFormItemProtocol
]]()
...
...
@@ -54,6 +56,7 @@ class YHChildPrimaryInfoVC: YHBaseViewController, YHFamilyMemberProtol {
items
.
removeAll
()
isFollowCanEdit
=
!
child
.
is18YearsOld
()
// 随行
let
title0
=
YHFormTitleItem
(
type
:
.
accompany
)
let
item00
=
YHFormDetailItem
(
type
:
.
ownCustody
,
value
:
String
(
child
.
isOwnCustody
()))
...
...
@@ -205,15 +208,23 @@ extension YHChildPrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
if
cellType
==
.
twoChoice
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHFormItemDoubleChoiceCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHFormItemDoubleChoiceCell
cell
.
isMust
=
detailItem
.
isNeed
cell
.
title
=
detailItem
.
getTitle
()
cell
.
isCanEdit
=
true
var
select
=
false
if
let
value
=
detailItem
.
value
{
select
=
Bool
(
value
)
!
}
if
detailItem
.
type
==
.
isAccompanyToHK
,
let
child
=
child
,
child
.
is18YearsOld
()
{
// 是否随行至香港
// 年满18岁不能随性
select
=
false
cell
.
isCanEdit
=
isFollowCanEdit
}
let
answers
=
[
YHFormChoiceItem
(
title
:
"是"
.
local
,
isSelect
:
select
),
YHFormChoiceItem
(
title
:
"否"
.
local
,
isSelect
:
!
select
)]
cell
.
answerArr
=
answers
...
...
@@ -363,23 +374,37 @@ extension YHChildPrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
[
weak
self
]
(
string1
,
string2
,
string3
,
string4
)
in
guard
let
self
=
self
else
{
return
}
print
(
"
\(
string1
)\n\(
string2
)\n\(
string3
)\n\(
string4
)
"
)
self
.
child
?
.
address
.
area
=
[
string2
,
string3
]
var
citys
:[
String
]
=
[]
if
!
isEmptyString
(
string2
)
{
citys
.
append
(
string2
)
}
if
!
isEmptyString
(
string3
)
{
citys
.
append
(
string3
)
}
self
.
child
?
.
address
.
area
=
citys
self
.
loadInfo
()
}
self
.
present
(
vc
,
animated
:
true
)
}
else
if
detailItem
.
type
==
.
birthday
{
// 出生日期
// 子女选择年满18岁则【是否随行至香港】默认选择否,不可修改
// 如果未年满18岁则【是否随行至香港】可选择【是/否】,可修改
YHDatePickView
.
show
(
type
:
.
yyyymmdd
)
{
[
weak
self
]
date
in
guard
let
self
=
self
else
{
return
}
if
detailItem
.
type
==
.
birthday
{
self
.
child
?
.
birthday
=
date
guard
let
child
=
child
else
{
return
}
child
.
birthday
=
date
isFollowCanEdit
=
!
child
.
is18YearsOld
()
}
self
.
loadInfo
()
}
}
}
}
func
createCorner
(
cell
:
UITableViewCell
,
arr
:
Array
<
Any
>
,
indexPath
:
IndexPath
)
{
// 复用时需清理
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/FamilyMember(家庭成员信息表)/C/Spouse(配偶)/YHSpouseBasicInfoVC.swift
View file @
8878007e
...
...
@@ -643,7 +643,14 @@ extension YHSpouseBasicInfoVC : UITableViewDelegate, UITableViewDataSource {
[
weak
self
]
(
string1
,
string2
,
string3
,
string4
)
in
guard
let
self
=
self
else
{
return
}
print
(
"
\(
string1
)\n\(
string2
)\n\(
string3
)\n\(
string4
)
"
)
self
.
spouse
?
.
birthPlace
.
area
=
[
string2
,
string3
]
var
citys
:[
String
]
=
[]
if
!
isEmptyString
(
string2
)
{
citys
.
append
(
string2
)
}
if
!
isEmptyString
(
string3
)
{
citys
.
append
(
string3
)
}
self
.
spouse
?
.
birthPlace
.
area
=
citys
loadInfo
()
save
()
}
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/FamilyMember(家庭成员信息表)/C/Spouse(配偶)/YHSpousePrimaryInfoVC.swift
View file @
8878007e
...
...
@@ -326,7 +326,14 @@ extension YHSpousePrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
[
weak
self
]
(
string1
,
string2
,
string3
,
string4
)
in
guard
let
self
=
self
else
{
return
}
print
(
"
\(
string1
)\n\(
string2
)\n\(
string3
)\n\(
string4
)
"
)
self
.
spouse
?
.
address
.
area
=
[
string2
,
string3
]
var
citys
:[
String
]
=
[]
if
!
isEmptyString
(
string2
)
{
citys
.
append
(
string2
)
}
if
!
isEmptyString
(
string3
)
{
citys
.
append
(
string3
)
}
self
.
spouse
?
.
address
.
area
=
citys
self
.
loadInfo
()
save
()
}
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/FamilyMember(家庭成员信息表)/C/YHBrotherInfoVC.swift
View file @
8878007e
...
...
@@ -418,7 +418,14 @@ extension YHBrotherInfoVC : UITableViewDelegate, UITableViewDataSource {
[
weak
self
]
(
string1
,
string2
,
string3
,
string4
)
in
guard
let
self
=
self
else
{
return
}
print
(
"
\(
string1
)\n\(
string2
)\n\(
string3
)\n\(
string4
)
"
)
self
.
brotherInfo
?
.
birthPlace
.
area
=
[
string2
,
string3
]
var
citys
:[
String
]
=
[]
if
!
isEmptyString
(
string2
)
{
citys
.
append
(
string2
)
}
if
!
isEmptyString
(
string3
)
{
citys
.
append
(
string3
)
}
self
.
brotherInfo
?
.
birthPlace
.
area
=
citys
self
.
loadInfo
()
saveInfoSilent
()
}
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/FamilyMember(家庭成员信息表)/C/YHParentInfoVC.swift
View file @
8878007e
...
...
@@ -463,7 +463,14 @@ extension YHParentInfoVC : UITableViewDelegate, UITableViewDataSource {
[
weak
self
]
(
string1
,
string2
,
string3
,
string4
)
in
guard
let
self
=
self
else
{
return
}
print
(
"
\(
string1
)\n\(
string2
)\n\(
string3
)\n\(
string4
)
"
)
self
.
parentInfo
?
.
birthPlace
.
area
=
[
string2
,
string3
]
var
citys
:[
String
]
=
[]
if
!
isEmptyString
(
string2
)
{
citys
.
append
(
string2
)
}
if
!
isEmptyString
(
string3
)
{
citys
.
append
(
string3
)
}
self
.
parentInfo
?
.
birthPlace
.
area
=
citys
self
.
loadInfo
()
saveInfoSilent
()
}
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/FamilyMember(家庭成员信息表)/M/YHFamilyInitialInfo.swift
View file @
8878007e
...
...
@@ -1123,6 +1123,41 @@ class YHFamilyMember: SmartCodable, YHFormItemProtocol {
self
.
childStepchild
.
has
=
(
val
?
"Y"
:
"N"
)
}
// 根据生日推算年龄
func
getAge
(
birthday
:
String
)
->
Int
{
let
arr
=
birthday
.
components
(
separatedBy
:
YHDatePickView
.
separator
)
if
arr
.
count
==
3
{
let
year
=
Int
(
arr
[
0
])
??
0
let
month
=
Int
(
arr
[
1
])
??
0
let
day
=
Int
(
arr
[
2
])
??
0
let
now
=
Date
()
let
formatter
=
DateFormatter
()
formatter
.
dateFormat
=
"yyyy-MM-dd"
let
current
=
formatter
.
string
(
from
:
now
)
let
curArr
=
current
.
components
(
separatedBy
:
"-"
)
if
curArr
.
count
==
3
{
let
cyear
=
Int
(
curArr
[
0
])
??
0
let
cmonth
=
Int
(
curArr
[
1
])
??
0
let
cday
=
Int
(
curArr
[
2
])
??
0
var
age
=
cyear
-
year
if
cmonth
<
month
{
age
-=
1
}
else
if
cmonth
==
month
&&
cday
<
day
{
age
-=
1
}
return
age
}
}
return
0
}
func
is18YearsOld
()
->
Bool
{
let
age
=
getAge
(
birthday
:
birthday
)
return
age
>=
18
}
var
relationType
:
YHFamilyMemberType
{
get
{
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/FamilyMember(家庭成员信息表)/V/YHFormItemDoubleChoiceCell.swift
View file @
8878007e
...
...
@@ -38,6 +38,13 @@ class YHFormItemDoubleChoiceCell: UITableViewCell {
// 是否必须字段
var
isMust
:
Bool
=
false
var
answerBlock
:(([
YHFormChoiceItem
],
Int
)
->
Void
)?
// 是否能点击两个按钮
var
isCanEdit
:
Bool
=
true
{
didSet
{
answer1Btn
.
isUserInteractionEnabled
=
isCanEdit
answer2Btn
.
isUserInteractionEnabled
=
isCanEdit
}
}
var
title
:
String
?
{
didSet
{
...
...
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