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
b55ff4e8
Commit
b55ff4e8
authored
Feb 27, 2024
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// 子女信息
parent
fb8c951c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
138 additions
and
54 deletions
+138
-54
YHChildBasicInfoVC.swift
...amilyMember(家庭成员信息表)/C/Child(子女)/YHChildBasicInfoVC.swift
+8
-1
YHChildInfoContainerVC.swift
...yMember(家庭成员信息表)/C/Child(子女)/YHChildInfoContainerVC.swift
+87
-47
YHChildPrimaryInfoVC.swift
...ilyMember(家庭成员信息表)/C/Child(子女)/YHChildPrimaryInfoVC.swift
+34
-1
YHSpouseInfoContainerVC.swift
...ember(家庭成员信息表)/C/Spouse(配偶)/YHSpouseInfoContainerVC.swift
+9
-5
No files found.
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/FamilyMember(家庭成员信息表)/C/Child(子女)/YHChildBasicInfoVC.swift
View file @
b55ff4e8
...
...
@@ -8,7 +8,7 @@
import
UIKit
class
YHChildBasicInfoVC
:
YHBaseViewController
{
class
YHChildBasicInfoVC
:
YHBaseViewController
,
YHFamilyMemberProtol
{
var
child
:
YHFamilyMember
?
weak
var
delegate
:
YHSpouseInfoVCProtocol
?
...
...
@@ -539,3 +539,10 @@ extension YHChildBasicInfoVC : UITableViewDelegate, UITableViewDataSource {
}
}
extension
YHChildBasicInfoVC
{
func
nextStep
()
->
Bool
{
return
true
}
}
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/FamilyMember(家庭成员信息表)/C/Child(子女)/YHChildInfoContainerVC.swift
View file @
b55ff4e8
...
...
@@ -22,21 +22,21 @@ class YHChildInfoContainerVC: YHBaseViewController, YHSpouseInfoVCProtocol {
var
child
:
YHFamilyMember
?
{
didSet
{
inital
InfoVC
.
child
=
child
primary
InfoVC
.
child
=
child
certificateVC
.
familyMember
=
child
basicInfoVC
.
child
=
child
}
}
var
current
Index
=
0
{
var
stepVCs
:[
YHFaimilyStepItem
]
=
[]
var
current
Step
=
0
{
didSet
{
currentIndex
%=
self
.
children
.
count
stepView
.
currentIndex
=
currentIndex
for
(
i
,
vc
)
in
self
.
children
.
enumerated
()
{
vc
.
view
.
isHidden
=
(
currentIndex
!=
i
)
if
currentIndex
==
i
{
}
let
index
=
getArrayIndexOfCurrentStep
()
if
let
index
=
index
{
stepView
.
currentIndex
=
index
}
for
vcItem
in
stepVCs
{
vcItem
.
vc
.
view
.
isHidden
=
(
vcItem
.
step
!=
currentStep
)
}
}
}
...
...
@@ -50,8 +50,8 @@ class YHChildInfoContainerVC: YHBaseViewController, YHSpouseInfoVCProtocol {
return
YHSaveAndSubmitView
.
createView
()
}()
let
inital
InfoVC
=
YHChildPrimaryInfoVC
()
let
uploadVC
=
UIViewController
()
let
primary
InfoVC
=
YHChildPrimaryInfoVC
()
let
uploadVC
=
YHCertificateUploadVC
()
let
certificateVC
=
YHCertificateInfoController
()
let
basicInfoVC
=
YHChildBasicInfoVC
()
...
...
@@ -62,15 +62,15 @@ class YHChildInfoContainerVC: YHBaseViewController, YHSpouseInfoVCProtocol {
func
createUI
()
{
guard
child
!=
nil
else
{
return
}
guard
let
child
=
child
else
{
return
}
inital
InfoVC
.
delegate
=
self
primary
InfoVC
.
delegate
=
self
certificateVC
.
delegate
=
self
basicInfoVC
.
delegate
=
self
updateStepView
()
current
Index
=
0
print
(
"step:
\(
child
.
step
)
"
)
current
Step
=
child
.
step
view
.
addSubview
(
stepView
)
view
.
addSubview
(
bottomView
)
...
...
@@ -78,7 +78,7 @@ class YHChildInfoContainerVC: YHBaseViewController, YHSpouseInfoVCProtocol {
bottomView
.
submitBlock
=
{
[
weak
self
]
in
guard
let
self
=
self
else
{
return
}
s
elf
.
didClickSubmitBtn
()
s
ubmit
()
}
bottomView
.
saveBlock
=
{
...
...
@@ -100,11 +100,6 @@ class YHChildInfoContainerVC: YHBaseViewController, YHSpouseInfoVCProtocol {
}
}
func
didClickSubmitBtn
()
{
currentIndex
+=
1
;
}
func
updateStepView
()
{
guard
let
child
=
child
else
{
return
}
...
...
@@ -114,42 +109,87 @@ class YHChildInfoContainerVC: YHBaseViewController, YHSpouseInfoVCProtocol {
vc
.
removeFromParent
()
}
print
(
self
.
children
)
if
child
.
isFollow
()
{
self
.
addChild
(
initalInfoVC
)
self
.
addChild
(
uploadVC
)
self
.
addChild
(
certificateVC
)
self
.
addChild
(
basicInfoVC
)
self
.
view
.
addSubview
(
basicInfoVC
.
view
)
self
.
view
.
addSubview
(
certificateVC
.
view
)
self
.
view
.
addSubview
(
uploadVC
.
view
)
self
.
view
.
addSubview
(
initalInfoVC
.
view
)
stepView
.
dataSource
=
[
"初始信息"
.
local
,
"证件上传"
.
local
,
"证件信息"
.
local
,
"基本信息"
.
local
]
stepView
.
block
=
{[
weak
self
]
(
index
)
in
guard
let
self
=
self
else
{
return
}
print
(
"follow:%d"
,
self
.
orderId
)
}
stepVCs
=
[
YHFaimilyStepItem
(
title
:
"初始信息"
.
local
,
vc
:
primaryInfoVC
,
step
:
0
),
YHFaimilyStepItem
(
title
:
"证件上传"
.
local
,
vc
:
uploadVC
,
step
:
1
),
YHFaimilyStepItem
(
title
:
"证件信息"
.
local
,
vc
:
certificateVC
,
step
:
2
),
YHFaimilyStepItem
(
title
:
"基本信息"
.
local
,
vc
:
basicInfoVC
,
step
:
3
)]
}
else
{
self
.
addChild
(
initalInfoVC
)
self
.
addChild
(
basicInfoVC
)
self
.
view
.
addSubview
(
basicInfoVC
.
view
)
self
.
view
.
addSubview
(
initalInfoVC
.
view
)
stepView
.
dataSource
=
[
"初始信息"
.
local
,
"基本信息"
.
local
]
stepView
.
block
=
{[
weak
self
]
(
index
)
in
guard
let
self
=
self
else
{
return
}
print
(
"follow:%d"
,
self
.
orderId
)
stepVCs
=
[
YHFaimilyStepItem
(
title
:
"初始信息"
.
local
,
vc
:
primaryInfoVC
,
step
:
0
),
YHFaimilyStepItem
(
title
:
"基本信息"
.
local
,
vc
:
basicInfoVC
,
step
:
3
)]
}
var
titles
:[
String
]
=
[]
for
vcItem
in
stepVCs
{
self
.
addChild
(
vcItem
.
vc
)
self
.
view
.
addSubview
(
vcItem
.
vc
.
view
)
titles
.
append
(
vcItem
.
title
)
}
stepView
.
dataSource
=
titles
stepView
.
block
=
{
[
weak
self
]
index
in
guard
let
self
=
self
else
{
return
}
if
let
targetStep
=
getStepForArrayIndex
(
index
)
{
currentStep
=
targetStep
}
print
(
"index:
\(
index
)
"
)
}
self
.
view
.
bringSubviewToFront
(
stepView
)
self
.
view
.
bringSubviewToFront
(
bottomView
)
}
func
submit
()
{
if
let
targetVC
=
getCurrentStepViewController
()
{
if
targetVC
.
nextStep
()
{
// 当前步骤已是最后一步
if
let
vc
=
stepVCs
.
last
,
vc
.
step
==
currentStep
{
YHHUD
.
flash
(
message
:
"已经是最后一步!"
)
return
}
if
let
cur
=
getArrayIndexOfCurrentStep
(),
let
item
=
stepVCs
[
safe
:
cur
+
1
]
{
currentStep
=
item
.
step
}
print
(
"currentIndex:
\(
currentStep
)
"
)
}
}
}
// 【WARNING!】步骤step和在数组中的下标有时候并不是一一对应
func
getArrayIndexOfCurrentStep
()
->
Int
?
{
for
(
i
,
item
)
in
stepVCs
.
enumerated
()
{
if
item
.
step
==
currentStep
{
return
i
}
}
return
nil
}
// 【WARNING!】步骤step和在数组中的下标有时候并不是一一对应
func
getStepForArrayIndex
(
_
index
:
Int
)
->
Int
?
{
if
let
targetVCItem
=
stepVCs
[
safe
:
index
]
{
return
targetVCItem
.
step
}
return
nil
}
func
getCurrentStepViewController
()
->
(
UIViewController
&
YHFamilyMemberProtol
)?
{
for
vcItem
in
stepVCs
{
if
vcItem
.
step
==
currentStep
{
return
vcItem
.
vc
}
}
return
nil
}
}
extension
YHChildInfoContainerVC
{
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/FamilyMember(家庭成员信息表)/C/Child(子女)/YHChildPrimaryInfoVC.swift
View file @
b55ff4e8
...
...
@@ -8,7 +8,7 @@
import
UIKit
class
YHChildPrimaryInfoVC
:
YHBaseViewController
{
class
YHChildPrimaryInfoVC
:
YHBaseViewController
,
YHFamilyMemberProtol
{
var
child
:
YHFamilyMember
?
weak
var
delegate
:
YHSpouseInfoVCProtocol
?
...
...
@@ -437,5 +437,38 @@ extension YHChildPrimaryInfoVC : UITableViewDelegate, UITableViewDataSource {
}
}
extension
YHChildPrimaryInfoVC
{
// 检查填写信息完整性
func
checkIntegrity
()
->
Bool
{
guard
let
child
=
child
else
{
return
false
}
if
!
child
.
isFollow
()
{
if
isEmptyString
(
child
.
birthday
)
{
return
false
}
return
true
}
if
isEmptyString
(
child
.
nationality
)
{
return
false
}
if
isEmptyString
(
child
.
address
?
.
country
)
{
return
false
}
if
isEmptyString
(
child
.
address
?
.
details
)
{
return
false
}
if
child
.
isBirthOverSeas
(),
isEmptyArray
(
child
.
address
?
.
area
)
{
return
false
}
return
true
}
func
nextStep
()
->
Bool
{
return
true
}
}
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/FamilyMember(家庭成员信息表)/C/Spouse(配偶)/YHSpouseInfoContainerVC.swift
View file @
b55ff4e8
...
...
@@ -50,7 +50,10 @@ class YHSpouseInfoContainerVC: YHBaseViewController, YHSpouseInfoVCProtocol {
var
currentStep
=
0
{
didSet
{
stepView
.
currentIndex
=
currentStep
let
index
=
getArrayIndexOfCurrentStep
()
if
let
index
=
index
{
stepView
.
currentIndex
=
index
}
for
vcItem
in
stepVCs
{
vcItem
.
vc
.
view
.
isHidden
=
(
vcItem
.
step
!=
currentStep
)
}
...
...
@@ -88,6 +91,8 @@ class YHSpouseInfoContainerVC: YHBaseViewController, YHSpouseInfoVCProtocol {
view
.
addSubview
(
bottomView
)
updateStepView
()
print
(
"step:
\(
spouse
.
step
)
"
)
currentStep
=
spouse
.
step
let
tap
=
UITapGestureRecognizer
(
target
:
self
,
action
:
#selector(
tap
)
)
tap
.
cancelsTouchesInView
=
false
...
...
@@ -148,10 +153,8 @@ class YHSpouseInfoContainerVC: YHBaseViewController, YHSpouseInfoVCProtocol {
self
.
view
.
addSubview
(
vcItem
.
vc
.
view
)
titles
.
append
(
vcItem
.
title
)
}
stepView
.
dataSource
=
titles
print
(
"step:
\(
spouse
.
step
)
"
)
currentStep
=
spouse
.
step
stepView
.
dataSource
=
titles
stepView
.
block
=
{
[
weak
self
]
index
in
...
...
@@ -161,7 +164,8 @@ class YHSpouseInfoContainerVC: YHBaseViewController, YHSpouseInfoVCProtocol {
}
print
(
"index:
\(
index
)
"
)
}
let
step
=
currentStep
currentStep
=
step
self
.
view
.
bringSubviewToFront
(
stepView
)
self
.
view
.
bringSubviewToFront
(
bottomView
)
...
...
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