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
e955cc36
Commit
e955cc36
authored
Nov 25, 2024
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// 个人信息预览
parent
3814513c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
231 additions
and
133 deletions
+231
-133
YHPreviewViewModel.swift
...的信息流程)/PersonInfoList(个人信息预览)/VM/YHPreviewViewModel.swift
+231
-133
No files found.
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/QMAS(优才)/ServiceProcess(我的信息流程)/PersonInfoList(个人信息预览)/VM/YHPreviewViewModel.swift
View file @
e955cc36
...
...
@@ -8,6 +8,13 @@
import
UIKit
enum
YHCerPhotoInfoType
:
Int
{
case
none
=
0
case
idCard
=
1
case
hkPassPort
=
2
case
passPort
=
3
}
class
YHPreviewViewModel
:
YHBaseViewModel
{
//工作经验
var
workExpInfoPreviewModel
:
YHWorkExpInfoPreviewModel
?
...
...
@@ -504,12 +511,12 @@ private extension YHPreviewViewModel {
var
title
=
""
if
let
item
=
model
.
school_address
{
if
item
.
country
.
contains
(
"中国"
)
{
title
=
"
国内
"
title
=
""
if
item
.
area
.
count
>
1
{
title
=
title
+
item
.
area
[
0
]
+
"/"
+
item
.
area
[
1
]
}
}
else
{
title
=
"国外 "
+
item
.
country
+
"-"
+
item
.
foreign
title
=
item
.
country
+
"-"
+
item
.
foreign
}
}
else
{
title
=
"--"
...
...
@@ -1300,13 +1307,10 @@ private extension YHPreviewViewModel {
let
tmp12
=
YHPreviewQuestionAndAnswerModel
(
question
:
"是否在海外居住满1年及以上:"
,
answer
:
title
)
arr
.
append
(
tmp12
)
}
let
tmp133
=
YHPreviewQuestionAndAnswerModel
(
question
:
"详细地址:"
,
answer
:
address
.
defaultStringIfEmpty
())
arr
.
append
(
tmp133
)
let
tmp13
=
YHPreviewQuestionAndAnswerModel
(
question
:
"目前是否在港:"
,
answer
:
model
.
hkIdentity
.
isEmpty
==
false
?
"是"
:
"否"
)
arr
.
append
(
tmp13
)
let
isHKIdCardHandled
=
model
.
isHaveHKIdentityCard
()
let
isHKIdCardHandledString
=
isHKIdCardHandled
?
"是"
:
"否"
let
tmp14
=
YHPreviewQuestionAndAnswerModel
(
question
:
"是否办理过香港身份证:"
,
answer
:
isHKIdCardHandledString
)
...
...
@@ -1365,12 +1369,14 @@ private extension YHPreviewViewModel {
}
}
if
model
.
isFollow
()
{
//1.跟随 证件信息
do
{
var
arr
=
[
YHPersonInfoCellModel1
]()
//港澳通行证
if
model
.
isHandled
==
1
{
// 证件信息显示逻辑
var
cerInfoArr
=
[
YHPersonInfoCellModel1
]()
let
a
=
showCerInfoLogic
(
familyMember
:
model
,
mainApplicantInfo
:
mainApplicant
)
let
isNeedShowHK
=
a
.
showHK
let
isNeedShowPassport
=
a
.
showPassport
if
isNeedShowHK
{
var
str
=
model
.
certificates
.
hkMacaoPass
.
number
let
tmp4
=
YHPreviewQuestionAndAnswerModel
(
question
:
"旅行社证件号码:"
,
answer
:
str
.
defaultStringIfEmpty
())
...
...
@@ -1390,16 +1396,13 @@ private extension YHPreviewViewModel {
}
let
tmp7
=
YHPreviewQuestionAndAnswerModel
(
question
:
"届满日期:"
,
answer
:
str
.
defaultStringIfEmpty
())
let
model1
=
YHPersonInfoCellModel1
(
cellTitle
:
"港澳通行证"
,
cellData
:
[
tmp4
,
tmp5
,
tmp6
,
tmp7
])
a
rr
.
append
(
model1
)
cerInfoA
rr
.
append
(
model1
)
}
if
model
.
nationality
!=
"中国-China"
{
if
isNeedShowPassport
{
//护照及其他旅行证件
var
str
=
YHConstantArrayData
.
getShowNameBy
(
indexStr
:
String
(
model
.
certificates
.
passport
.
passPortType
),
type
:
.
idType
)
let
tmp8
=
YHPreviewQuestionAndAnswerModel
(
question
:
"证件类别:"
,
answer
:
str
)
str
=
model
.
certificates
.
passport
.
number
var
str
=
model
.
certificates
.
passport
.
number
let
tmp9
=
YHPreviewQuestionAndAnswerModel
(
question
:
"证件号码:"
,
answer
:
str
.
defaultStringIfEmpty
())
str
=
model
.
certificates
.
passport
.
issueAt
...
...
@@ -1417,33 +1420,39 @@ private extension YHPreviewViewModel {
}
}
let
tmp12
=
YHPreviewQuestionAndAnswerModel
(
question
:
"届满日期:"
,
answer
:
str
.
defaultStringIfEmpty
())
let
model2
=
YHPersonInfoCellModel1
(
cellTitle
:
"护照及其他旅行证件"
,
cellData
:
[
tmp8
,
tmp9
,
tmp10
,
tmp11
,
tmp12
])
a
rr
.
append
(
model2
)
let
model2
=
YHPersonInfoCellModel1
(
cellTitle
:
"护照及其他旅行证件"
,
cellData
:
[
tmp9
,
tmp10
,
tmp11
,
tmp12
])
cerInfoA
rr
.
append
(
model2
)
}
let
model3
=
YHPreviewInfoSessionModel
(
cellType
:
.
idCardInfoType
,
cellTitle
:
"证件信息"
,
cellData1
:
a
rr
)
let
model3
=
YHPreviewInfoSessionModel
(
cellType
:
.
idCardInfoType
,
cellTitle
:
"证件信息"
,
cellData1
:
cerInfoA
rr
)
arrTemp
.
append
(
model3
)
}
//2.跟随 证件照
do
{
//证件照片
// 证件照片显示逻辑
let
cerPhotoArr
=
showCerPhotoLogic
(
familyMember
:
model
,
mainApplicantInfo
:
mainApplicant
)
var
photoArr
=
[
YHPersonInfoCellModel2
]()
for
cerType
in
cerPhotoArr
{
if
cerType
==
.
idCard
{
let
front
=
model
.
certificates
.
cnIdentityCard
.
imgFront
let
back
=
model
.
certificates
.
cnIdentityCard
.
imgBack
let
model1
=
YHPersonInfoCellModel2
(
cellTitle
:
"中国身份证"
,
frontUrl
:
front
,
backUrl
:
back
,
idType
:
1
)
var
arr
=
[
model1
]
photoArr
.
append
(
model1
)
if
model
.
isHandled
==
1
{
}
else
if
cerType
==
.
hkPassPort
{
let
front
=
model
.
certificates
.
hkMacaoPass
.
imgFront
let
back
=
model
.
certificates
.
hkMacaoPass
.
imgBack
let
model2
=
YHPersonInfoCellModel2
(
cellTitle
:
"港澳通行证"
,
frontUrl
:
front
,
backUrl
:
back
,
idType
:
2
)
arr
.
append
(
model2
)
}
photoArr
.
append
(
model2
)
let
model4
=
YHPreviewInfoSessionModel
(
cellType
:
.
idPictureType
,
cellTitle
:
"证件照片"
,
cellData2
:
arr
)
arrTemp
.
append
(
model4
)
}
else
if
cerType
==
.
passPort
{
let
front
=
model
.
certificates
.
passport
.
imgFront
let
back
=
model
.
certificates
.
passport
.
imgBack
let
model3
=
YHPersonInfoCellModel2
(
cellTitle
:
"护照"
,
frontUrl
:
front
,
backUrl
:
back
,
idType
:
3
)
photoArr
.
append
(
model3
)
}
}
let
model4
=
YHPreviewInfoSessionModel
(
cellType
:
.
idPictureType
,
cellTitle
:
"证件照片"
,
cellData2
:
photoArr
)
arrTemp
.
append
(
model4
)
arrDataForSpouse
=
arrTemp
}
...
...
@@ -1489,12 +1498,12 @@ private extension YHPreviewViewModel {
}
do
{
//子女信息
var
arr
=
[
YHPreviewQuestionAndAnswerModel
]()
let
tmp0
=
YHPreviewQuestionAndAnswerModel
(
question
:
"子女姓名:"
,
answer
:
model
.
subsetName
)
let
tmp1
=
YHPreviewQuestionAndAnswerModel
(
question
:
"曾用名:"
,
answer
:
model
.
usedName
.
defaultStringIfEmpty
())
let
tmp2
=
YHPreviewQuestionAndAnswerModel
(
question
:
"婚前姓氏:"
,
answer
:
model
.
surname
.
defaultStringIfEmpty
())
let
sexStr
=
YHConstantArrayData
.
getShowNameBy
(
indexStr
:
String
(
model
.
sex
),
type
:
.
sex
)
let
tmp22
=
YHPreviewQuestionAndAnswerModel
(
question
:
"性别:"
,
answer
:
sexStr
)
let
tmp3
=
YHPreviewQuestionAndAnswerModel
(
question
:
"出生日期:"
,
answer
:
model
.
birthday
)
var
city
=
""
if
model
.
birthPlaceAboard
==
0
{
...
...
@@ -1512,28 +1521,6 @@ private extension YHPreviewViewModel {
let
tmp5
=
YHPreviewQuestionAndAnswerModel
(
question
:
"婚姻状况:"
,
answer
:
model
.
married
)
let
tmp55
=
YHPreviewQuestionAndAnswerModel
(
question
:
"职业:"
,
answer
:
model
.
occupation
)
var
arr
=
[
tmp0
,
tmp1
,
tmp2
,
tmp22
,
tmp3
,
tmp4
,
tmp5
,
tmp55
]
if
model
.
occupation
.
contains
(
"在职"
)
{
let
tmp5
=
YHPreviewQuestionAndAnswerModel
(
question
:
"职业名称:"
,
answer
:
model
.
occupationName
)
arr
.
append
(
tmp5
)
}
// let tmp7 = YHPreviewQuestionAndAnswerModel(question: "是否拥有学位:", answer: model.hasDegree == "1" ? "有学位" : "无学位")
// arr.append(tmp7)
//
// if model.hasDegree == "1" {
// for(index,item) in model.hasDegreeJson.enumerated() {
//
// let addationIndex = model.hasDegreeJson.count > 1 ? String(index + 1) : ""
// let title = "学位证" + addationIndex + ":"
// let tmp8 = YHPreviewQuestionAndAnswerModel(question: title, answer: item.degree)
// arr.append(tmp8)
// let tmp9 = YHPreviewQuestionAndAnswerModel(question: "学位证颁发地区:", answer: item.address)
// arr.append(tmp9)
// }
// }
let
tmp10
=
YHPreviewQuestionAndAnswerModel
(
question
:
"是否和主申请人同住:"
,
answer
:
model
.
nows
==
1
?
"是"
:
"否"
)
arr
.
append
(
tmp10
)
...
...
@@ -1567,21 +1554,17 @@ private extension YHPreviewViewModel {
arr
.
append
(
tmp12
)
}
if
true
{
let
title
=
model
.
isPreviousMarriageChild
()
?
"是"
:
"否"
let
tmp12
=
YHPreviewQuestionAndAnswerModel
(
question
:
"是否为前次婚姻的子女"
,
answer
:
title
)
arr
.
append
(
tmp12
)
}
if
model
.
nows
==
0
{
let
tmp133
=
YHPreviewQuestionAndAnswerModel
(
question
:
"详细地址:"
,
answer
:
address
.
defaultStringIfEmpty
())
arr
.
append
(
tmp133
)
}
let
tmp13
=
YHPreviewQuestionAndAnswerModel
(
question
:
"目前是否在港:"
,
answer
:
model
.
hkIdentity
.
isEmpty
==
false
?
"是"
:
"否"
)
arr
.
append
(
tmp13
)
if
model
.
hkIdentity
.
isEmpty
==
false
{
let
tmp14
=
YHPreviewQuestionAndAnswerModel
(
question
:
"获准逗留至:"
,
answer
:
model
.
childInHk
.
info
)
let
tmp15
=
YHPreviewQuestionAndAnswerModel
(
question
:
"在港身份:"
,
answer
:
model
.
hkIdentity
==
"其他"
?
(
model
.
hkIdentityOther
.
defaultStringIfEmpty
(
detaultValue
:
"其他"
))
:
model
.
hkIdentity
)
arr
.
append
(
contentsOf
:
[
tmp14
,
tmp15
])
}
let
isHKIdCardHandled
=
model
.
isHaveHKIdentityCard
()
let
isHKIdCardHandledString
=
isHKIdCardHandled
?
"是"
:
"否"
let
tmp16
=
YHPreviewQuestionAndAnswerModel
(
question
:
"是否办理过香港身份证:"
,
answer
:
isHKIdCardHandledString
)
...
...
@@ -1608,8 +1591,6 @@ private extension YHPreviewViewModel {
let
tmp0
=
YHPreviewQuestionAndAnswerModel
(
question
:
"是否随行至香港:"
,
answer
:
"否"
)
let
arr
=
[
tmp0
]
var
title
=
""
if
totalChild
>
1
{
title
=
String
(
childIndex
+
1
)
...
...
@@ -1624,7 +1605,6 @@ private extension YHPreviewViewModel {
let
tmp1
=
YHPreviewQuestionAndAnswerModel
(
question
:
"曾用名:"
,
answer
:
model
.
usedName
.
defaultStringIfEmpty
())
let
tmp2
=
YHPreviewQuestionAndAnswerModel
(
question
:
"婚前姓氏:"
,
answer
:
model
.
surname
.
defaultStringIfEmpty
())
let
sexStr
=
YHConstantArrayData
.
getShowNameBy
(
indexStr
:
String
(
model
.
sex
),
type
:
.
sex
)
let
tmp22
=
YHPreviewQuestionAndAnswerModel
(
question
:
"性别:"
,
answer
:
sexStr
)
let
tmp3
=
YHPreviewQuestionAndAnswerModel
(
question
:
"出生日期:"
,
answer
:
model
.
birthday
)
var
city
=
""
if
model
.
birthPlaceAboard
==
0
{
...
...
@@ -1640,13 +1620,7 @@ private extension YHPreviewViewModel {
}
let
tmp4
=
YHPreviewQuestionAndAnswerModel
(
question
:
"出生城市:"
,
answer
:
city
)
let
tmp44
=
YHPreviewQuestionAndAnswerModel
(
question
:
"婚姻状况:"
,
answer
:
model
.
married
.
defaultStringIfEmpty
())
let
tmp444
=
YHPreviewQuestionAndAnswerModel
(
question
:
"职业:"
,
answer
:
model
.
occupation
.
defaultStringIfEmpty
())
var
arr
=
[
tmp0
,
tmp1
,
tmp2
,
tmp22
,
tmp3
,
tmp4
,
tmp44
,
tmp444
]
if
model
.
occupation
.
contains
(
"在职"
)
{
let
tmp5
=
YHPreviewQuestionAndAnswerModel
(
question
:
"职业名称:"
,
answer
:
model
.
occupationName
)
arr
.
append
(
tmp5
)
}
var
arr
=
[
tmp0
,
tmp1
,
tmp2
,
tmp3
,
tmp4
,
tmp44
]
let
isHKIdCardHandled
=
model
.
isHaveHKIdentityCard
()
let
isHKIdCardHandledString
=
isHKIdCardHandled
?
"是"
:
"否"
...
...
@@ -1669,39 +1643,19 @@ private extension YHPreviewViewModel {
}
}
if
model
.
isFollow
()
{
//1.跟随 证件信息
do
{
//中国身份证
var
str
=
model
.
certificates
.
cnIdentityCard
.
number
let
tmp0
=
YHPreviewQuestionAndAnswerModel
(
question
:
"中国身份证号码:"
,
answer
:
str
.
defaultStringIfEmpty
())
str
=
model
.
certificates
.
cnIdentityCard
.
issueAt
let
tmp1
=
YHPreviewQuestionAndAnswerModel
(
question
:
"签发地:"
,
answer
:
str
.
defaultStringIfEmpty
())
str
=
model
.
certificates
.
cnIdentityCard
.
issueDateStartAt
let
tmp2
=
YHPreviewQuestionAndAnswerModel
(
question
:
"签发日期:"
,
answer
:
str
.
defaultStringIfEmpty
())
str
=
model
.
certificates
.
cnIdentityCard
.
issueDateEndAt
if
str
.
isEmpty
{
str
=
""
}
else
{
if
str
==
"8888-01-01"
{
str
=
"长期"
}
}
let
tmp3
=
YHPreviewQuestionAndAnswerModel
(
question
:
"届满日期:"
,
answer
:
str
.
defaultStringIfEmpty
())
let
model0
=
YHPersonInfoCellModel1
(
cellTitle
:
"中国身份证"
,
cellData
:
[
tmp0
,
tmp1
,
tmp2
,
tmp3
])
// 证件信息显示逻辑
var
cerInfoArr
=
[
YHPersonInfoCellModel1
]()
let
a
=
showCerInfoLogic
(
familyMember
:
model
,
mainApplicantInfo
:
mainApplicant
)
let
isNeedShowHK
=
a
.
showHK
let
isNeedShowPassport
=
a
.
showPassport
if
isNeedShowHK
{
var
arr
=
[
model0
]
//港澳通行证
if
model
.
isHandled
==
1
{
str
=
model
.
certificates
.
hkMacaoPass
.
number
var
str
=
model
.
certificates
.
hkMacaoPass
.
number
let
tmp4
=
YHPreviewQuestionAndAnswerModel
(
question
:
"旅行社证件号码:"
,
answer
:
str
.
defaultStringIfEmpty
())
str
=
model
.
certificates
.
hkMacaoPass
.
issueAt
let
tmp5
=
YHPreviewQuestionAndAnswerModel
(
question
:
"签发地:"
,
answer
:
str
)
let
tmp5
=
YHPreviewQuestionAndAnswerModel
(
question
:
"签发地:"
,
answer
:
str
.
defaultStringIfEmpty
()
)
str
=
model
.
certificates
.
hkMacaoPass
.
issueDateStartAt
let
tmp6
=
YHPreviewQuestionAndAnswerModel
(
question
:
"签发日期:"
,
answer
:
str
.
defaultStringIfEmpty
())
...
...
@@ -1716,23 +1670,20 @@ private extension YHPreviewViewModel {
}
let
tmp7
=
YHPreviewQuestionAndAnswerModel
(
question
:
"届满日期:"
,
answer
:
str
.
defaultStringIfEmpty
())
let
model1
=
YHPersonInfoCellModel1
(
cellTitle
:
"港澳通行证"
,
cellData
:
[
tmp4
,
tmp5
,
tmp6
,
tmp7
])
a
rr
.
append
(
model1
)
cerInfoA
rr
.
append
(
model1
)
}
if
model
.
nationality
!=
"中国-China"
{
if
isNeedShowPassport
{
//护照及其他旅行证件
var
str
=
YHConstantArrayData
.
getShowNameBy
(
indexStr
:
String
(
model
.
certificates
.
passport
.
passPortType
),
type
:
.
idType
)
let
tmp8
=
YHPreviewQuestionAndAnswerModel
(
question
:
"证件类别:"
,
answer
:
str
)
str
=
model
.
certificates
.
passport
.
number
var
str
=
model
.
certificates
.
passport
.
number
let
tmp9
=
YHPreviewQuestionAndAnswerModel
(
question
:
"证件号码:"
,
answer
:
str
.
defaultStringIfEmpty
())
str
=
model
.
certificates
.
passport
.
issueAt
let
tmp10
=
YHPreviewQuestionAndAnswerModel
(
question
:
"签发地:"
,
answer
:
str
.
defaultStringIfEmpty
())
str
=
model
.
certificates
.
passport
.
issueDateStartAt
let
tmp11
=
YHPreviewQuestionAndAnswerModel
(
question
:
"签发日期:"
,
answer
:
str
)
let
tmp11
=
YHPreviewQuestionAndAnswerModel
(
question
:
"签发日期:"
,
answer
:
str
.
defaultStringIfEmpty
()
)
str
=
model
.
certificates
.
passport
.
issueDateEndAt
if
str
.
isEmpty
{
...
...
@@ -1743,45 +1694,39 @@ private extension YHPreviewViewModel {
}
}
let
tmp12
=
YHPreviewQuestionAndAnswerModel
(
question
:
"届满日期:"
,
answer
:
str
.
defaultStringIfEmpty
())
let
model2
=
YHPersonInfoCellModel1
(
cellTitle
:
"护照及其他旅行证件"
,
cellData
:
[
tmp8
,
tmp9
,
tmp10
,
tmp11
,
tmp12
])
arr
.
append
(
model2
)
let
model2
=
YHPersonInfoCellModel1
(
cellTitle
:
"护照及其他旅行证件"
,
cellData
:
[
tmp9
,
tmp10
,
tmp11
,
tmp12
])
cerInfoArr
.
append
(
model2
)
}
var
title
=
""
if
totalChild
>
1
{
title
=
String
(
childIndex
+
1
)
}
let
model3
=
YHPreviewInfoSessionModel
(
cellType
:
.
idCardInfoType
,
cellTitle
:
"证件信息"
+
title
,
cellData1
:
arr
)
let
model3
=
YHPreviewInfoSessionModel
(
cellType
:
.
idCardInfoType
,
cellTitle
:
"证件信息"
,
cellData1
:
cerInfoArr
)
arrTemp
.
append
(
model3
)
}
//2.跟随 证件照
do
{
//证件照片
// 证件照片显示逻辑
let
cerPhotoArr
=
showCerPhotoLogic
(
familyMember
:
model
,
mainApplicantInfo
:
mainApplicant
)
var
photoArr
=
[
YHPersonInfoCellModel2
]()
for
cerType
in
cerPhotoArr
{
if
cerType
==
.
idCard
{
let
front
=
model
.
certificates
.
cnIdentityCard
.
imgFront
let
back
=
model
.
certificates
.
cnIdentityCard
.
imgBack
let
model1
=
YHPersonInfoCellModel2
(
cellTitle
:
"中国身份证"
,
frontUrl
:
front
,
backUrl
:
back
,
idType
:
1
)
var
arr
=
[
model1
]
photoArr
.
append
(
model1
)
if
model
.
isHandled
==
1
{
}
else
if
cerType
==
.
hkPassPort
{
let
front
=
model
.
certificates
.
hkMacaoPass
.
imgFront
let
back
=
model
.
certificates
.
hkMacaoPass
.
imgBack
let
model2
=
YHPersonInfoCellModel2
(
cellTitle
:
"港澳通行证"
,
frontUrl
:
front
,
backUrl
:
back
,
idType
:
2
)
arr
.
append
(
model2
)
}
photoArr
.
append
(
model2
)
var
title
=
""
if
totalChild
>
1
{
title
=
String
(
childIndex
+
1
)
}
let
model4
=
YHPreviewInfoSessionModel
(
cellType
:
.
idPictureType
,
cellTitle
:
"证件照片"
+
title
,
cellData2
:
arr
)
arrTemp
.
append
(
model4
)
}
else
if
cerType
==
.
passPort
{
let
front
=
model
.
certificates
.
passport
.
imgFront
let
back
=
model
.
certificates
.
passport
.
imgBack
let
model3
=
YHPersonInfoCellModel2
(
cellTitle
:
"护照"
,
frontUrl
:
front
,
backUrl
:
back
,
idType
:
3
)
photoArr
.
append
(
model3
)
}
}
let
model4
=
YHPreviewInfoSessionModel
(
cellType
:
.
idPictureType
,
cellTitle
:
"证件照片"
,
cellData2
:
photoArr
)
arrTemp
.
append
(
model4
)
arrDataForChildren
.
append
(
contentsOf
:
arrTemp
)
}
...
...
@@ -1849,4 +1794,157 @@ private extension YHPreviewViewModel {
}
}
}
func
showCerInfoLogic
(
familyMember
:
YHFamilyMember
?,
mainApplicantInfo
:
YHMyMainApplicantInfoModel
?)
->
(
showHK
:
Bool
,
isHKMust
:
Bool
,
showPassport
:
Bool
,
isPassportMust
:
Bool
)
{
guard
let
familyMember
=
familyMember
else
{
return
(
false
,
false
,
false
,
false
)
}
// 中国国籍&居住国内、中国国籍&居住国外不满一年
// 1) 办理过港澳通
// 证件上传:身份证+港澳通
// 证件信息:港澳通行证必填(无身份证、护照)
//
// 2) 没办理过港澳通
// 证件上传:身份证
// 证件信息:港澳通行证非必填(无身份证、护照)
//
// 中国国籍&居住国外满一年
// 证件上传:护照+身份证
// 证件信息:护照必填(无身份证)
//
// 外籍国籍(无论是否在国外居住满一年):
// 证件上传:护照
// 证件信息:仅护照且必填(无身份证)
// 是否显示港澳通行证
var
showHK
=
false
// 港澳通行证是否必填
var
isHKMust
=
false
// 是否显示护照
var
showPassport
=
false
// 护照是否必填
var
isPassportMust
=
false
// 国籍
let
nationality
=
familyMember
.
nationality
// 居住国外是否满一年
var
is_live_oversea_year
=
familyMember
.
isOverSeasOver1Year
()
// 居住国家
var
liveCountry
=
familyMember
.
address
.
country
if
familyMember
.
isLiveTother
(),
let
mainApplicant
=
mainApplicantInfo
{
// 与主申请人同住用主申请人的居住信息判断
liveCountry
=
mainApplicant
.
applicant_address
.
country
is_live_oversea_year
=
mainApplicant
.
isOverSeasOver1Year
()
}
if
nationality
.
contains
(
"中国"
)
{
// 中国国籍
let
isLiveInChina
=
liveCountry
.
contains
(
"中国"
.
local
)
if
isLiveInChina
{
// 居住国内
if
familyMember
.
isHandled
==
0
{
// 没办理过港澳通行证
// 证件信息:港澳通行证非必填(无身份证、护照)
showHK
=
true
isHKMust
=
false
}
else
{
// 办理过港澳通行证
// 证件信息:港澳通行证必填(无身份证、护照)
showHK
=
true
isHKMust
=
true
}
}
else
{
// 居住国外
if
!
is_live_oversea_year
{
// 居住国外不满一年
if
familyMember
.
isHandled
==
0
{
// 没办理过港澳通行证
// 证件信息:港澳通行证非必填(无身份证、护照)
showHK
=
true
isHKMust
=
false
}
else
{
// 办理过港澳通行证
// 证件信息:港澳通行证必填(无身份证、护照)
showHK
=
true
isHKMust
=
true
}
}
else
{
// 居住国外满一年
// 证件信息:护照必填(无身份证)
showPassport
=
true
isPassportMust
=
true
}
}
}
else
{
// 外国国籍
// 证件信息:仅护照且必填(无身份证)
showPassport
=
true
isPassportMust
=
true
}
return
(
showHK
,
isHKMust
,
showPassport
,
isPassportMust
)
}
func
showCerPhotoLogic
(
familyMember
:
YHFamilyMember
?,
mainApplicantInfo
:
YHMyMainApplicantInfoModel
?)
->
[
YHCerPhotoInfoType
]
{
guard
let
familyMember
=
familyMember
else
{
return
[
.
none
]
}
// 中国国籍&居住国内、中国国籍&居住国外不满一年
// 1) 办理过港澳通
// 证件上传:身份证+港澳通
// 证件信息:港澳通行证必填(无身份证、护照)
//
// 2) 没办理过港澳通
// 证件上传:身份证
// 证件信息:港澳通行证非必填(无身份证、护照)
//
// 中国国籍&居住国外满一年
// 证件上传:护照+身份证
// 证件信息:护照必填(无身份证)
//
// 外籍国籍(无论是否在国外居住满一年):
// 证件上传:护照
// 证件信息:仅护照且必填(无身份证)
// 国籍
let
nationality
=
familyMember
.
nationality
// 居住国外是否满一年
var
is_live_oversea_year
=
familyMember
.
isOverSeasOver1Year
()
// 居住国家
var
liveCountry
=
familyMember
.
address
.
country
if
familyMember
.
isLiveTother
(),
let
mainApplicant
=
mainApplicantInfo
{
// 与主申请人同住用主申请人的居住信息判断
liveCountry
=
mainApplicant
.
applicant_address
.
country
is_live_oversea_year
=
mainApplicant
.
isOverSeasOver1Year
()
}
if
nationality
.
contains
(
"中国"
)
{
// 中国国籍
let
isLiveInChina
=
liveCountry
.
contains
(
"中国"
.
local
)
if
isLiveInChina
{
// 居住国内
if
familyMember
.
isHandled
==
0
{
// 没办理过港澳通行证
// 证件上传:身份证
return
[
.
idCard
]
}
else
{
// 办理过港澳通行证
// 证件上传:身份证+港澳通
return
[
.
idCard
,
.
hkPassPort
]
}
}
else
{
// 居住国外
if
!
is_live_oversea_year
{
// 居住国外不满一年
if
familyMember
.
isHandled
==
0
{
// 没办理过港澳通行证
// 证件上传:身份证
return
[
.
idCard
]
}
else
{
// 办理过港澳通行证
// 证件上传:身份证+港澳通
return
[
.
idCard
,
.
hkPassPort
]
}
}
else
{
// 居住国外满一年
// 证件上传:护照+身份证
return
[
.
passPort
,
.
idCard
]
}
}
}
else
{
// 外国国籍
// 证件信息:仅护照且必填(无身份证)
return
[
.
passPort
]
}
}
}
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