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
b9f28cd8
Commit
b9f28cd8
authored
Nov 19, 2024
by
Alex朱枝文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
收入记录添加未输入提示,以及代码优化
parent
22c42aa0
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
464 additions
and
81 deletions
+464
-81
YHIncomeRecordViewController.swift
...)/IncomeRecord(收入记录)/C/YHIncomeRecordViewController.swift
+51
-10
YHIncomeRecordWorkExperienceViewController.swift
...(收入记录)/C/YHIncomeRecordWorkExperienceViewController.swift
+132
-24
YHIncomeRecordUtilType.swift
...我的信息流程)/IncomeRecord(收入记录)/M/YHIncomeRecordUtilType.swift
+7
-0
YHIncomeDocumentationConfirmationCell.swift
...ecord(收入记录)/V/YHIncomeDocumentationConfirmationCell.swift
+93
-16
YHIncomeInputMoneyCell.swift
...我的信息流程)/IncomeRecord(收入记录)/V/YHIncomeInputMoneyCell.swift
+29
-7
YHIncomeTypeSelectCell.swift
...我的信息流程)/IncomeRecord(收入记录)/V/YHIncomeTypeSelectCell.swift
+53
-4
YHIncomeTypesCell.swift
...cess(我的信息流程)/IncomeRecord(收入记录)/V/YHIncomeTypesCell.swift
+5
-0
YHInfoConsentForHKTravelCell.swift
...)/IncomeRecord(收入记录)/V/YHInfoConsentForHKTravelCell.swift
+90
-16
YHIncomeRecordViewModel.swift
...信息流程)/IncomeRecord(收入记录)/VM/YHIncomeRecordViewModel.swift
+4
-4
No files found.
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/QMAS(优才)/ServiceProcess(我的信息流程)/IncomeRecord(收入记录)/C/YHIncomeRecordViewController.swift
View file @
b9f28cd8
...
@@ -15,11 +15,15 @@ class YHIncomeRecordViewController: YHBaseViewController {
...
@@ -15,11 +15,15 @@ class YHIncomeRecordViewController: YHBaseViewController {
case
incomeSummary
(
_
isEditing
:
Bool
=
false
,
_
isEditEnable
:
Bool
=
false
)
case
incomeSummary
(
_
isEditing
:
Bool
=
false
,
_
isEditEnable
:
Bool
=
false
)
case
incomeItem
(
_
isEditState
:
Bool
=
false
,
_
company
:
String
,
_
money
:
String
,
_
timeStr
:
String
,
_
incomeId
:
Int
)
case
incomeItem
(
_
isEditState
:
Bool
=
false
,
_
company
:
String
,
_
money
:
String
,
_
timeStr
:
String
,
_
incomeId
:
Int
)
case
totalIncome
(
_
money
:
ASAttributedString
)
case
totalIncome
(
_
money
:
ASAttributedString
)
case
consentForHKTravel
(
_
title
:
String
,
_
detail
:
ASAttributedString
,
_
question
:
String
,
_
isSelectSureBtn
:
Bool
=
true
)
case
consentForHKTravel
(
_
title
:
String
,
_
detail
:
ASAttributedString
,
_
question
:
String
)
}
}
private
lazy
var
datas
:
[[
TableRow
]]
=
[]
private
lazy
var
datas
:
[[
TableRow
]]
=
[]
/// 是否超过
private
var
isOver100OK
=
true
private
var
over100IndexPath
:
IndexPath
?
private
lazy
var
viewModel
=
YHIncomeRecordViewModel
()
private
lazy
var
viewModel
=
YHIncomeRecordViewModel
()
private
var
incomeModel
=
YHIncomeRecordCompleteModel
()
private
var
incomeModel
=
YHIncomeRecordCompleteModel
()
...
@@ -113,6 +117,9 @@ extension YHIncomeRecordViewController {
...
@@ -113,6 +117,9 @@ extension YHIncomeRecordViewController {
}
}
@objc
private
func
clickSubmitButton
()
{
@objc
private
func
clickSubmitButton
()
{
guard
checkInput
()
else
{
return
}
updateIncome
(
.
submit
)
updateIncome
(
.
submit
)
}
}
...
@@ -158,7 +165,7 @@ extension YHIncomeRecordViewController {
...
@@ -158,7 +165,7 @@ extension YHIncomeRecordViewController {
private
func
setupData
()
{
private
func
setupData
()
{
let
detail
:
ASAttributedString
=
.
init
(
string
:
"备注:全年收入是指应课税(应纳所得税)的就业或业务收入,包括工资薪金、津贴、股票期权及从其拥有的公司所得的利润。由个人投资所产生的收入不会计算在内。"
,
.
font
(
UIFont
.
PFSC_R
(
ofSize
:
13
)),
.
foreground
(
UIColor
(
hexString
:
"#8993A2"
)
??
.
gray
))
let
detail
:
ASAttributedString
=
.
init
(
string
:
"备注:全年收入是指应课税(应纳所得税)的就业或业务收入,包括工资薪金、津贴、股票期权及从其拥有的公司所得的利润。由个人投资所产生的收入不会计算在内。"
,
.
font
(
UIFont
.
PFSC_R
(
ofSize
:
13
)),
.
foreground
(
UIColor
(
hexString
:
"#8993A2"
)
??
.
gray
))
let
firstSection
:
[
TableRow
]
=
[
.
consentForHKTravel
(
"收入情况"
,
detail
,
"您在前一年,全年收入是否达港币100万元或以上"
,
incomeModel
.
income_over_100
==
YHIncomeOver100
.
true
.
rawValue
)]
let
firstSection
:
[
TableRow
]
=
[
.
consentForHKTravel
(
"收入情况"
,
detail
,
"您在前一年,全年收入是否达港币100万元或以上"
)]
guard
incomeModel
.
income_over_100
==
YHIncomeOver100
.
true
.
rawValue
else
{
guard
incomeModel
.
income_over_100
==
YHIncomeOver100
.
true
.
rawValue
else
{
datas
=
[
firstSection
]
datas
=
[
firstSection
]
tableView
.
reloadData
()
tableView
.
reloadData
()
...
@@ -167,14 +174,15 @@ extension YHIncomeRecordViewController {
...
@@ -167,14 +174,15 @@ extension YHIncomeRecordViewController {
let
hkdFormatter
=
currencyFormat
(
""
)
let
hkdFormatter
=
currencyFormat
(
""
)
var
money
:
Double
=
0
var
money
:
Double
=
0
var
secondSection
:
[
TableRow
]
=
[
.
incomeSummary
(
false
,
false
)]
var
secondSection
:
[
TableRow
]
=
[
.
incomeSummary
(
false
,
false
)]
let
rate
=
self
.
incomeModel
.
rate
>
0
?
self
.
incomeModel
.
rate
:
0.92
incomeModel
.
list
.
forEach
{
companyModel
in
incomeModel
.
list
.
forEach
{
companyModel
in
money
+=
companyModel
.
income_money
money
+=
companyModel
.
income_money
let
moneyStr
=
"约"
+
(
hkdFormatter
.
string
(
from
:
NSNumber
(
value
:
companyModel
.
income_money
))
??
"0"
)
+
"港币"
let
moneyStr
=
"约"
+
(
hkdFormatter
.
string
(
from
:
NSNumber
(
value
:
companyModel
.
income_money
/
rate
))
??
"0"
)
+
"港币"
let
timeStr
:
String
=
companyModel
.
fill_status
?
"已填写"
:
"有
\(
companyModel
.
unfilled_count
)
项未填写"
let
timeStr
:
String
=
companyModel
.
fill_status
?
"已填写"
:
"有
\(
companyModel
.
unfilled_count
)
项未填写"
let
incomeItem
:
TableRow
=
.
incomeItem
(
false
,
companyModel
.
company_name
,
moneyStr
,
timeStr
,
companyModel
.
income_id
)
let
incomeItem
:
TableRow
=
.
incomeItem
(
false
,
companyModel
.
company_name
,
moneyStr
,
timeStr
,
companyModel
.
income_id
)
secondSection
.
append
(
incomeItem
)
secondSection
.
append
(
incomeItem
)
}
}
let
totalNum
=
hkdFormatter
.
string
(
from
:
NSNumber
(
value
:
money
))
??
"0"
let
totalNum
=
hkdFormatter
.
string
(
from
:
NSNumber
(
value
:
money
/
rate
))
??
"0"
let
totalMoney
:
ASAttributedString
=
.
init
(
string
:
"约 "
,
.
font
(
.
PFSC_R
(
ofSize
:
14
)))
+
.
init
(
string
:
totalNum
,
.
font
(
UIFont
(
name
:
"DINAlternate-Bold"
,
size
:
20
)
??
UIFont
.
systemFont
(
ofSize
:
20
)))
+
.
init
(
string
:
" 港币"
,
.
font
(
.
PFSC_R
(
ofSize
:
14
)))
let
totalMoney
:
ASAttributedString
=
.
init
(
string
:
"约 "
,
.
font
(
.
PFSC_R
(
ofSize
:
14
)))
+
.
init
(
string
:
totalNum
,
.
font
(
UIFont
(
name
:
"DINAlternate-Bold"
,
size
:
20
)
??
UIFont
.
systemFont
(
ofSize
:
20
)))
+
.
init
(
string
:
" 港币"
,
.
font
(
.
PFSC_R
(
ofSize
:
14
)))
secondSection
.
append
(
.
totalIncome
(
totalMoney
))
secondSection
.
append
(
.
totalIncome
(
totalMoney
))
datas
=
[
firstSection
,
secondSection
]
datas
=
[
firstSection
,
secondSection
]
...
@@ -236,17 +244,37 @@ extension YHIncomeRecordViewController: UITableViewDelegate, UITableViewDataSour
...
@@ -236,17 +244,37 @@ extension YHIncomeRecordViewController: UITableViewDelegate, UITableViewDataSour
}
}
return
cell
return
cell
}
}
case
let
.
consentForHKTravel
(
title
,
detail
,
question
,
isSelectSureBtn
):
case
let
.
consentForHKTravel
(
title
,
detail
,
question
):
if
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHInfoConsentForHKTravelCell
.
cellReuseIdentifier
)
as?
YHInfoConsentForHKTravelCell
{
if
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHInfoConsentForHKTravelCell
.
cellReuseIdentifier
)
as?
YHInfoConsentForHKTravelCell
{
cell
.
setupCellInfo
(
title
:
title
,
detail
:
detail
,
question
:
question
)
over100IndexPath
=
indexPath
cell
.
setupCellInfo
(
title
:
title
,
detail
:
detail
,
question
:
question
,
needShowFailButton
:
!
isOver100OK
)
cell
.
didSelectSureButton
=
{
[
weak
self
]
selected
in
cell
.
didSelectSureButton
=
{
[
weak
self
]
selected
in
guard
let
self
=
self
else
{
guard
let
self
=
self
else
{
return
return
}
}
self
.
incomeModel
.
income_over_100
=
selected
?
YHIncomeOver100
.
true
.
rawValue
:
YHIncomeOver100
.
false
.
rawValue
switch
selected
{
case
.
true
:
self
.
incomeModel
.
income_over_100
=
YHIncomeOver100
.
true
.
rawValue
isOver100OK
=
true
case
.
false
:
self
.
incomeModel
.
income_over_100
=
YHIncomeOver100
.
false
.
rawValue
isOver100OK
=
true
case
.
unknown
:
self
.
incomeModel
.
income_over_100
=
YHIncomeOver100
.
unknown
.
rawValue
isOver100OK
=
false
}
self
.
setupData
()
self
.
setupData
()
}
}
cell
.
selectedSureButton
=
isSelectSureBtn
let
over100Type
=
YHIncomeOver100
(
rawValue
:
incomeModel
.
income_over_100
)
??
.
unknown
switch
over100Type
{
case
.
true
:
cell
.
selectedSureButton
=
.
true
case
.
false
:
cell
.
selectedSureButton
=
.
false
case
.
unknown
:
cell
.
selectedSureButton
=
.
unknown
}
return
cell
return
cell
}
}
...
@@ -287,6 +315,18 @@ extension YHIncomeRecordViewController: UITableViewDelegate, UITableViewDataSour
...
@@ -287,6 +315,18 @@ extension YHIncomeRecordViewController: UITableViewDelegate, UITableViewDataSour
}
}
extension
YHIncomeRecordViewController
{
extension
YHIncomeRecordViewController
{
private
func
checkInput
()
->
Bool
{
if
incomeModel
.
income_over_100
==
YHIncomeOver100
.
unknown
.
rawValue
{
isOver100OK
=
false
if
let
over100IndexPath
=
over100IndexPath
,
tableView
.
numberOfSections
>
over100IndexPath
.
section
,
tableView
.
numberOfRows
(
inSection
:
over100IndexPath
.
section
)
>
over100IndexPath
.
row
{
tableView
.
reloadRows
(
at
:
[
over100IndexPath
],
with
:
.
none
)
}
return
false
}
isOver100OK
=
true
return
true
}
private
func
requestData
(
isNeedLoading
:
Bool
=
false
)
{
private
func
requestData
(
isNeedLoading
:
Bool
=
false
)
{
if
isNeedLoading
{
if
isNeedLoading
{
YHHUD
.
show
(
.
progress
(
message
:
"加载中..."
))
YHHUD
.
show
(
.
progress
(
message
:
"加载中..."
))
...
@@ -314,10 +354,9 @@ extension YHIncomeRecordViewController {
...
@@ -314,10 +354,9 @@ extension YHIncomeRecordViewController {
}
}
private
func
updateIncome
(
_
type
:
YHIncomeRecordUpdateType
)
{
private
func
updateIncome
(
_
type
:
YHIncomeRecordUpdateType
)
{
let
incomeOver100
:
YHIncomeOver100
=
YHIncomeOver100
(
rawValue
:
incomeModel
.
income_over_100
)
??
.
true
let
msg
=
type
==
.
save
?
"保存中..."
:
"提交中..."
let
msg
=
type
==
.
save
?
"保存中..."
:
"提交中..."
YHHUD
.
show
(
.
progress
(
message
:
msg
))
YHHUD
.
show
(
.
progress
(
message
:
msg
))
viewModel
.
incomeUpdate
(
orderId
:
orderId
,
incomeOver100
:
income
Over
100
,
type
:
type
)
{
[
weak
self
]
success
,
error
in
viewModel
.
incomeUpdate
(
orderId
:
orderId
,
incomeOver100
:
income
Model
.
income_over_
100
,
type
:
type
)
{
[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
guard
let
self
=
self
else
{
return
return
}
}
...
@@ -327,6 +366,8 @@ extension YHIncomeRecordViewController {
...
@@ -327,6 +366,8 @@ extension YHIncomeRecordViewController {
YHHUD
.
flash
(
message
:
msg
)
YHHUD
.
flash
(
message
:
msg
)
if
type
==
.
submit
{
if
type
==
.
submit
{
self
.
navigationController
?
.
popViewController
(
animated
:
true
)
self
.
navigationController
?
.
popViewController
(
animated
:
true
)
}
else
{
self
.
requestData
(
isNeedLoading
:
true
)
}
}
}
else
if
let
errorMsg
=
error
?
.
errorMsg
,
errorMsg
.
count
>
0
{
}
else
if
let
errorMsg
=
error
?
.
errorMsg
,
errorMsg
.
count
>
0
{
YHHUD
.
flash
(
message
:
errorMsg
)
YHHUD
.
flash
(
message
:
errorMsg
)
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/QMAS(优才)/ServiceProcess(我的信息流程)/IncomeRecord(收入记录)/C/YHIncomeRecordWorkExperienceViewController.swift
View file @
b9f28cd8
...
@@ -17,7 +17,7 @@ class YHIncomeRecordWorkExperienceViewController: YHBaseViewController {
...
@@ -17,7 +17,7 @@ class YHIncomeRecordWorkExperienceViewController: YHBaseViewController {
case
incomeTypes
(
_
types
:
[
YHIncomeType
])
case
incomeTypes
(
_
types
:
[
YHIncomeType
])
case
inputMoney
(
_
title
:
String
,
_
detail
:
String
?,
_
inputStr
:
String
?,
_
showBottomLine
:
Bool
,
_
showStar
:
Bool
,
_
isIncomeMoney
:
Bool
)
case
inputMoney
(
_
title
:
String
,
_
detail
:
String
?,
_
inputStr
:
String
?,
_
showBottomLine
:
Bool
,
_
showStar
:
Bool
,
_
isIncomeMoney
:
Bool
)
case
inputRemark
(
_
detail
:
String
)
case
inputRemark
(
_
detail
:
String
)
case
documentComfirm
(
_
title
:
String
,
_
question
:
String
,
_
isSelectedSure
:
Bool
,
_
docs
:
[
String
])
case
documentComfirm
(
_
title
:
String
,
_
question
:
String
,
_
docs
:
[
String
])
}
}
private
lazy
var
datas
:
[[
TableRow
]]
=
[]
private
lazy
var
datas
:
[[
TableRow
]]
=
[]
...
@@ -28,6 +28,19 @@ class YHIncomeRecordWorkExperienceViewController: YHBaseViewController {
...
@@ -28,6 +28,19 @@ class YHIncomeRecordWorkExperienceViewController: YHBaseViewController {
private
var
isSaving
=
false
private
var
isSaving
=
false
var
submitSuccess
:
(()
->
Void
)?
var
submitSuccess
:
(()
->
Void
)?
// 校验字段控制
/// 是否选定收入类型
private
var
isIncomeTypeOK
=
true
private
var
incomeTypeIndexPath
:
IndexPath
?
/// 是否选定文件
private
var
isHasAllFileOK
=
true
private
var
hasAllFileIndexPath
:
IndexPath
?
/// 是否收入金额已填写
private
var
isIncomeMoneyOK
=
true
private
var
incomMoneyIndexPath
:
IndexPath
?
private
lazy
var
viewModel
=
YHIncomeRecordViewModel
()
private
lazy
var
viewModel
=
YHIncomeRecordViewModel
()
private
var
companyModel
=
YHIncomeCompanyDetailModel
()
private
var
companyModel
=
YHIncomeCompanyDetailModel
()
...
@@ -175,16 +188,16 @@ extension YHIncomeRecordWorkExperienceViewController {
...
@@ -175,16 +188,16 @@ extension YHIncomeRecordWorkExperienceViewController {
let
rmbFmt
=
currencyFormat
(
"¥"
)
let
rmbFmt
=
currencyFormat
(
"¥"
)
let
rate
=
companyModel
.
rate
>
0
?
companyModel
.
rate
:
0.92
let
rate
=
companyModel
.
rate
>
0
?
companyModel
.
rate
:
0.92
if
selectedTypes
.
contains
(
.
incomeOfMainland
)
||
selectedTypes
.
contains
(
.
incomeOfHKCompanies
)
||
selectedTypes
.
contains
(
.
incomeOfMacauCompanies
)
||
selectedTypes
.
contains
(
.
incomeOfOtherOverseasCompanies
)
{
if
selectedTypes
.
contains
(
.
incomeOfMainland
)
||
selectedTypes
.
contains
(
.
incomeOfHKCompanies
)
||
selectedTypes
.
contains
(
.
incomeOfMacauCompanies
)
||
selectedTypes
.
contains
(
.
incomeOfOtherOverseasCompanies
)
{
firstSection
.
append
(
.
inputMoney
(
"公司营业额(近一年)"
,
"约
\(
hkdFmt
.
string
(
from
:
NSNumber
(
value
:
companyModel
.
corporate_turnover
/
rate
))
??
"0"
)
港币"
,
(
rmbFmt
.
string
(
from
:
NSNumber
(
value
:
companyModel
.
corporate_turnover
))
??
"0"
)
,
true
,
false
,
false
))
firstSection
.
append
(
.
inputMoney
(
"公司营业额(近一年)"
,
"约
\(
hkdFmt
.
string
(
from
:
NSNumber
(
value
:
companyModel
.
corporate_turnover
/
rate
))
??
"0"
)
港币"
,
rmbFmt
.
string
(
from
:
NSNumber
(
value
:
companyModel
.
corporate_turnover
))
??
"0"
,
true
,
false
,
false
))
}
}
firstSection
.
append
(
.
inputMoney
(
"收入金额"
,
"约
\(
hkdFmt
.
string
(
from
:
NSNumber
(
value
:
companyModel
.
income_money
/
rate
))
??
"0"
)
港币"
,
(
rmbFmt
.
string
(
from
:
NSNumber
(
value
:
companyModel
.
income_money
))
??
"0"
)
,
false
,
true
,
true
))
firstSection
.
append
(
.
inputMoney
(
"收入金额"
,
"约
\(
hkdFmt
.
string
(
from
:
NSNumber
(
value
:
companyModel
.
income_money
/
rate
))
??
"0"
)
港币"
,
rmbFmt
.
string
(
from
:
NSNumber
(
value
:
companyModel
.
income_money
))
??
"0"
,
false
,
true
,
true
))
firstSection
.
append
(
.
inputRemark
(
"注:按1港币≈
\(
rate
)
人民币计算,实际金额按递交时入境处给出的汇率为准"
))
firstSection
.
append
(
.
inputRemark
(
"注:按1港币≈
\(
rate
)
人民币计算,实际金额按递交时入境处给出的汇率为准"
))
let
set
=
Set
(
selectedTypes
.
map
{
$0
.
docsArray
()
}
.
flatMap
{
$0
})
let
set
=
Set
(
selectedTypes
.
map
{
$0
.
docsArray
()
}
.
flatMap
{
$0
})
var
arr
=
Array
(
set
)
var
arr
=
Array
(
set
)
if
set
.
count
==
0
{
if
set
.
count
==
0
{
arr
=
YHIncomeType
.
defaultDocs
()
arr
=
YHIncomeType
.
defaultDocs
()
}
}
let
secondSection
:
[
TableRow
]
=
[
.
documentComfirm
(
"证件提供确认"
,
"您是否可以提供以下所有证明文件"
,
companyModel
.
has_all_file
==
YHIncomeRecordHasAllFile
.
true
.
rawValue
,
arr
)]
let
secondSection
:
[
TableRow
]
=
[
.
documentComfirm
(
"证件提供确认"
,
"您是否可以提供以下所有证明文件"
,
arr
)]
datas
=
[
firstSection
,
secondSection
]
datas
=
[
firstSection
,
secondSection
]
tableView
.
reloadData
()
tableView
.
reloadData
()
}
}
...
@@ -206,9 +219,13 @@ extension YHIncomeRecordWorkExperienceViewController {
...
@@ -206,9 +219,13 @@ extension YHIncomeRecordWorkExperienceViewController {
private
func
updateSelectTypes
()
{
private
func
updateSelectTypes
()
{
companyModel
.
income_type
=
selectedTypes
.
map
{
$0
.
rawValue
}
companyModel
.
income_type
=
selectedTypes
.
map
{
$0
.
rawValue
}
if
companyModel
.
income_type
.
count
>
0
{
isIncomeTypeOK
=
true
}
var
incomeTypesIndexPath
:
IndexPath
?
var
incomeTypesIndexPath
:
IndexPath
?
var
incomeTypeSelectIndexPath
:
IndexPath
?
var
incomeTypeSelectIndexPath
:
IndexPath
?
var
docIndexPath
:
IndexPath
?
var
docIndexPath
:
IndexPath
?
var
incomeCompanyIndexPath
:
IndexPath
?
datas
=
datas
.
enumerated
()
.
map
{
section
,
sectionArr
in
datas
=
datas
.
enumerated
()
.
map
{
section
,
sectionArr
in
sectionArr
.
enumerated
()
.
map
{
row
,
tableRow
in
sectionArr
.
enumerated
()
.
map
{
row
,
tableRow
in
switch
tableRow
{
switch
tableRow
{
...
@@ -218,14 +235,19 @@ extension YHIncomeRecordWorkExperienceViewController {
...
@@ -218,14 +235,19 @@ extension YHIncomeRecordWorkExperienceViewController {
case
let
.
incomeTypeSelect
(
title
,
detail
,
_
):
case
let
.
incomeTypeSelect
(
title
,
detail
,
_
):
incomeTypeSelectIndexPath
=
IndexPath
(
row
:
row
,
section
:
section
)
incomeTypeSelectIndexPath
=
IndexPath
(
row
:
row
,
section
:
section
)
return
.
incomeTypeSelect
(
title
,
detail
,
selectedTypes
.
count
>
0
)
return
.
incomeTypeSelect
(
title
,
detail
,
selectedTypes
.
count
>
0
)
case
let
.
documentComfirm
(
title
,
question
,
isSelectSure
,
docs
):
case
let
.
documentComfirm
(
title
,
question
,
_
):
docIndexPath
=
IndexPath
(
row
:
row
,
section
:
section
)
docIndexPath
=
IndexPath
(
row
:
row
,
section
:
section
)
let
set
=
Set
(
selectedTypes
.
map
{
$0
.
docsArray
()
}
.
flatMap
{
$0
})
let
set
=
Set
(
selectedTypes
.
map
{
$0
.
docsArray
()
}
.
flatMap
{
$0
})
if
set
.
count
>
0
{
if
set
.
count
>
0
{
return
.
documentComfirm
(
title
,
question
,
isSelectSure
,
Array
(
set
))
return
.
documentComfirm
(
title
,
question
,
Array
(
set
))
}
else
{
}
else
{
return
.
documentComfirm
(
title
,
question
,
isSelectSure
,
YHIncomeType
.
defaultDocs
())
return
.
documentComfirm
(
title
,
question
,
YHIncomeType
.
defaultDocs
())
}
}
case
let
.
inputMoney
(
_
,
_
,
_
,
_
,
_
,
isIncomeMoney
):
if
!
isIncomeMoney
{
incomeCompanyIndexPath
=
IndexPath
(
row
:
row
,
section
:
section
)
}
return
tableRow
default
:
default
:
return
tableRow
return
tableRow
}
}
...
@@ -248,6 +270,41 @@ extension YHIncomeRecordWorkExperienceViewController {
...
@@ -248,6 +270,41 @@ extension YHIncomeRecordWorkExperienceViewController {
sectionArr
.
remove
(
at
:
incomeTypesIndexPath
.
row
)
sectionArr
.
remove
(
at
:
incomeTypesIndexPath
.
row
)
datas
[
incomeTypesIndexPath
.
section
]
=
sectionArr
datas
[
incomeTypesIndexPath
.
section
]
=
sectionArr
}
}
if
selectedTypes
.
contains
(
.
incomeOfMainland
)
||
selectedTypes
.
contains
(
.
incomeOfHKCompanies
)
||
selectedTypes
.
contains
(
.
incomeOfMacauCompanies
)
||
selectedTypes
.
contains
(
.
incomeOfOtherOverseasCompanies
)
{
if
incomeCompanyIndexPath
==
nil
{
var
sectionArr
=
datas
[
incomeTypeSelectIndexPath
.
section
]
if
let
incomeIndex
=
sectionArr
.
firstIndex
(
where
:
{
tableRow
in
if
case
let
.
inputMoney
(
_
,
_
,
_
,
_
,
_
,
isIncomeMoney
)
=
tableRow
,
isIncomeMoney
==
true
{
return
true
}
else
{
return
false
}
})
{
let
newIndex
=
incomeIndex
//> 1 ? incomeIndex - 1 : 0
let
hkdFmt
=
currencyFormat
(
""
)
let
rmbFmt
=
currencyFormat
(
"¥"
)
let
rate
=
companyModel
.
rate
>
0
?
companyModel
.
rate
:
0.92
sectionArr
.
insert
(
.
inputMoney
(
"公司营业额(近一年)"
,
"约
\(
hkdFmt
.
string
(
from
:
NSNumber
(
value
:
companyModel
.
corporate_turnover
/
rate
))
??
"0"
)
港币"
,
rmbFmt
.
string
(
from
:
NSNumber
(
value
:
companyModel
.
corporate_turnover
))
??
"0"
,
true
,
false
,
false
),
at
:
newIndex
)
datas
[
incomeTypeSelectIndexPath
.
section
]
=
sectionArr
}
}
}
else
{
if
incomeCompanyIndexPath
!=
nil
{
var
sectionArr
=
datas
[
incomeTypeSelectIndexPath
.
section
]
if
let
companyIndex
=
sectionArr
.
firstIndex
(
where
:
{
tableRow
in
if
case
let
.
inputMoney
(
_
,
_
,
_
,
_
,
_
,
isIncomeMoney
)
=
tableRow
,
isIncomeMoney
==
false
{
return
true
}
else
{
return
false
}
})
{
sectionArr
.
remove
(
at
:
companyIndex
)
datas
[
incomeTypeSelectIndexPath
.
section
]
=
sectionArr
}
}
}
if
let
secondSection
=
docIndexPath
?
.
section
{
if
let
secondSection
=
docIndexPath
?
.
section
{
tableView
.
performBatchUpdates
{
[
weak
tableView
]
in
tableView
.
performBatchUpdates
{
[
weak
tableView
]
in
tableView
?
.
reloadSections
(
IndexSet
(
arrayLiteral
:
incomeTypeSelectIndexPath
.
section
,
secondSection
),
with
:
.
automatic
)
tableView
?
.
reloadSections
(
IndexSet
(
arrayLiteral
:
incomeTypeSelectIndexPath
.
section
,
secondSection
),
with
:
.
automatic
)
...
@@ -257,7 +314,6 @@ extension YHIncomeRecordWorkExperienceViewController {
...
@@ -257,7 +314,6 @@ extension YHIncomeRecordWorkExperienceViewController {
tableView
?
.
reloadSections
(
IndexSet
(
integer
:
incomeTypeSelectIndexPath
.
section
),
with
:
.
automatic
)
tableView
?
.
reloadSections
(
IndexSet
(
integer
:
incomeTypeSelectIndexPath
.
section
),
with
:
.
automatic
)
}
}
}
}
}
}
private
func
currencyFormat
(
_
currencySymbol
:
String
)
->
NumberFormatter
{
private
func
currencyFormat
(
_
currencySymbol
:
String
)
->
NumberFormatter
{
...
@@ -304,7 +360,8 @@ extension YHIncomeRecordWorkExperienceViewController: UITableViewDelegate, UITab
...
@@ -304,7 +360,8 @@ extension YHIncomeRecordWorkExperienceViewController: UITableViewDelegate, UITab
}
}
case
let
.
incomeTypeSelect
(
title
,
detail
,
isSelectedOne
):
case
let
.
incomeTypeSelect
(
title
,
detail
,
isSelectedOne
):
if
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHIncomeTypeSelectCell
.
cellReuseIdentifier
)
as?
YHIncomeTypeSelectCell
{
if
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHIncomeTypeSelectCell
.
cellReuseIdentifier
)
as?
YHIncomeTypeSelectCell
{
cell
.
setupCellInfo
(
title
:
title
,
detail
:
detail
,
isSelectedOne
:
isSelectedOne
,
showBottomLine
:
!
isSelectedOne
)
cell
.
setupCellInfo
(
title
:
title
,
detail
:
detail
,
isSelectedOne
:
isSelectedOne
,
showBottomLine
:
!
isSelectedOne
,
needShowFailButton
:
!
isIncomeTypeOK
)
incomeTypeIndexPath
=
indexPath
return
cell
return
cell
}
}
case
let
.
incomeTypes
(
types
):
case
let
.
incomeTypes
(
types
):
...
@@ -321,7 +378,12 @@ extension YHIncomeRecordWorkExperienceViewController: UITableViewDelegate, UITab
...
@@ -321,7 +378,12 @@ extension YHIncomeRecordWorkExperienceViewController: UITableViewDelegate, UITab
}
}
case
let
.
inputMoney
(
title
,
detail
,
inputStr
,
showBottomLine
,
showStar
,
isIncomeMoney
):
case
let
.
inputMoney
(
title
,
detail
,
inputStr
,
showBottomLine
,
showStar
,
isIncomeMoney
):
if
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHIncomeInputMoneyCell
.
cellReuseIdentifier
)
as?
YHIncomeInputMoneyCell
{
if
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHIncomeInputMoneyCell
.
cellReuseIdentifier
)
as?
YHIncomeInputMoneyCell
{
cell
.
setupCellInfo
(
title
:
title
,
detail
:
detail
,
inputValue
:
inputStr
,
showBottomLine
:
showBottomLine
,
showStarIcon
:
showStar
)
var
needShowFailButton
=
false
if
isIncomeMoney
{
incomMoneyIndexPath
=
indexPath
needShowFailButton
=
!
isIncomeMoneyOK
}
cell
.
setupCellInfo
(
title
:
title
,
detail
:
detail
,
inputValue
:
inputStr
,
showBottomLine
:
showBottomLine
,
showStarIcon
:
showStar
,
needShowFailButton
:
needShowFailButton
)
cell
.
didBeginEditing
=
{
textField
in
cell
.
didBeginEditing
=
{
textField
in
var
text
=
textField
.
text
??
""
var
text
=
textField
.
text
??
""
text
=
text
.
replacingOccurrences
(
of
:
"¥"
,
with
:
""
)
text
=
text
.
replacingOccurrences
(
of
:
"¥"
,
with
:
""
)
...
@@ -332,7 +394,22 @@ extension YHIncomeRecordWorkExperienceViewController: UITableViewDelegate, UITab
...
@@ -332,7 +394,22 @@ extension YHIncomeRecordWorkExperienceViewController: UITableViewDelegate, UITab
guard
let
self
=
self
else
{
guard
let
self
=
self
else
{
return
return
}
}
guard
let
text
=
textField
.
text
else
{
guard
let
text
=
textField
.
text
,
text
.
count
>
0
else
{
if
self
.
datas
.
count
>
indexPath
.
section
{
let
sectionArr
=
self
.
datas
[
indexPath
.
section
]
if
sectionArr
.
count
>
indexPath
.
row
{
let
currentRow
=
sectionArr
[
indexPath
.
row
]
if
case
let
.
inputMoney
(
title
,
_
,
_
,
showBottomLine
,
showStar
,
isIncomeMoney
)
=
currentRow
{
self
.
datas
[
indexPath
.
section
][
indexPath
.
row
]
=
.
inputMoney
(
title
,
nil
,
nil
,
showBottomLine
,
showStar
,
isIncomeMoney
)
self
.
tableView
.
reloadRows
(
at
:
[
indexPath
],
with
:
.
automatic
)
if
isIncomeMoney
{
self
.
companyModel
.
income_money
=
0
}
else
{
self
.
companyModel
.
corporate_turnover
=
0
}
}
}
}
return
return
}
}
// 转换为数字
// 转换为数字
...
@@ -340,6 +417,7 @@ extension YHIncomeRecordWorkExperienceViewController: UITableViewDelegate, UITab
...
@@ -340,6 +417,7 @@ extension YHIncomeRecordWorkExperienceViewController: UITableViewDelegate, UITab
// 格式化为带货币符号和千分位
// 格式化为带货币符号和千分位
let
detail
=
number
/
self
.
currencyRate
let
detail
=
number
/
self
.
currencyRate
if
isIncomeMoney
{
if
isIncomeMoney
{
self
.
isIncomeMoneyOK
=
true
self
.
companyModel
.
income_money
=
number
self
.
companyModel
.
income_money
=
number
}
else
{
}
else
{
self
.
companyModel
.
corporate_turnover
=
number
self
.
companyModel
.
corporate_turnover
=
number
...
@@ -369,20 +447,18 @@ extension YHIncomeRecordWorkExperienceViewController: UITableViewDelegate, UITab
...
@@ -369,20 +447,18 @@ extension YHIncomeRecordWorkExperienceViewController: UITableViewDelegate, UITab
cell
.
setupCellInfo
(
detail
)
cell
.
setupCellInfo
(
detail
)
return
cell
return
cell
}
}
case
let
.
documentComfirm
(
title
,
question
,
isSelectedSure
,
docs
):
case
let
.
documentComfirm
(
title
,
question
,
docs
):
if
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHIncomeDocumentationConfirmationCell
.
cellReuseIdentifier
)
as?
YHIncomeDocumentationConfirmationCell
{
if
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHIncomeDocumentationConfirmationCell
.
cellReuseIdentifier
)
as?
YHIncomeDocumentationConfirmationCell
{
cell
.
setupCellInfo
(
title
:
title
,
question
:
question
,
documents
:
docs
)
hasAllFileIndexPath
=
indexPath
cell
.
selectedSureButton
=
isSelectedSure
cell
.
setupCellInfo
(
title
:
title
,
question
:
question
,
documents
:
docs
,
needShowFailButton
:
!
isHasAllFileOK
)
cell
.
selectedSureButton
=
YHIncomeRecordHasAllFile
(
rawValue
:
companyModel
.
has_all_file
)
??
.
unknown
cell
.
didSelectSureButton
=
{
[
weak
self
]
flag
in
cell
.
didSelectSureButton
=
{
[
weak
self
]
flag
in
guard
let
self
=
self
else
{
guard
let
self
=
self
else
{
return
return
}
}
if
flag
{
self
.
companyModel
.
has_all_file
=
flag
.
rawValue
self
.
companyModel
.
has_all_file
=
YHIncomeRecordHasAllFile
.
true
.
rawValue
self
.
isHasAllFileOK
=
flag
!=
.
unknown
}
else
{
self
.
tableView
.
reloadRows
(
at
:
[
indexPath
],
with
:
.
none
)
self
.
companyModel
.
has_all_file
=
YHIncomeRecordHasAllFile
.
false
.
rawValue
}
}
}
return
cell
return
cell
}
}
...
@@ -420,6 +496,34 @@ extension YHIncomeRecordWorkExperienceViewController: UITableViewDelegate, UITab
...
@@ -420,6 +496,34 @@ extension YHIncomeRecordWorkExperienceViewController: UITableViewDelegate, UITab
}
}
extension
YHIncomeRecordWorkExperienceViewController
{
extension
YHIncomeRecordWorkExperienceViewController
{
private
func
checkInput
()
->
Bool
{
if
companyModel
.
has_all_file
==
YHIncomeRecordHasAllFile
.
unknown
.
rawValue
{
isHasAllFileOK
=
false
if
let
hasAllFileIndexPath
=
hasAllFileIndexPath
,
tableView
.
numberOfSections
>
hasAllFileIndexPath
.
section
,
tableView
.
numberOfRows
(
inSection
:
hasAllFileIndexPath
.
section
)
>
hasAllFileIndexPath
.
row
{
tableView
.
reloadRows
(
at
:
[
hasAllFileIndexPath
],
with
:
.
none
)
}
return
false
}
isHasAllFileOK
=
true
if
companyModel
.
income_type
.
count
==
0
{
isIncomeTypeOK
=
false
if
let
incomeTypeIndexPath
=
incomeTypeIndexPath
,
tableView
.
numberOfSections
>
incomeTypeIndexPath
.
section
,
tableView
.
numberOfRows
(
inSection
:
incomeTypeIndexPath
.
section
)
>
incomeTypeIndexPath
.
row
{
tableView
.
reloadRows
(
at
:
[
incomeTypeIndexPath
],
with
:
.
none
)
}
return
false
}
isIncomeTypeOK
=
true
if
companyModel
.
income_money
==
0
{
isIncomeMoneyOK
=
false
if
let
incomMoneyIndexPath
=
incomMoneyIndexPath
,
tableView
.
numberOfSections
>
incomMoneyIndexPath
.
section
,
tableView
.
numberOfRows
(
inSection
:
incomMoneyIndexPath
.
section
)
>
incomMoneyIndexPath
.
row
{
tableView
.
reloadRows
(
at
:
[
incomMoneyIndexPath
],
with
:
.
none
)
}
return
false
}
isIncomeMoneyOK
=
true
return
true
}
private
func
requestData
(
isNeedLoading
:
Bool
=
false
)
{
private
func
requestData
(
isNeedLoading
:
Bool
=
false
)
{
if
isNeedLoading
{
if
isNeedLoading
{
...
@@ -449,9 +553,13 @@ extension YHIncomeRecordWorkExperienceViewController {
...
@@ -449,9 +553,13 @@ extension YHIncomeRecordWorkExperienceViewController {
private
func
submitIncome
(
_
type
:
YHIncomeRecordUpdateType
,
complete
:
@escaping
(
Bool
)
->
Void
)
{
private
func
submitIncome
(
_
type
:
YHIncomeRecordUpdateType
,
complete
:
@escaping
(
Bool
)
->
Void
)
{
let
msg
=
type
==
.
save
?
"保存中..."
:
"提交中..."
let
msg
=
type
==
.
save
?
"保存中..."
:
"提交中..."
if
type
==
.
submit
{
if
checkInput
()
==
false
{
return
}
}
YHHUD
.
show
(
.
progress
(
message
:
msg
))
YHHUD
.
show
(
.
progress
(
message
:
msg
))
let
hasFile
:
YHIncomeRecordHasAllFile
=
companyModel
.
has_all_file
==
YHIncomeRecordHasAllFile
.
true
.
rawValue
?
.
true
:
.
false
viewModel
.
updateDetail
(
incomeId
:
incomeId
,
incomeMoney
:
companyModel
.
income_money
,
corporateTurnover
:
companyModel
.
corporate_turnover
,
incomeType
:
companyModel
.
income_type
,
hasAllFile
:
companyModel
.
has_all_file
)
{
[
weak
self
]
success
,
error
in
viewModel
.
updateDetail
(
incomeId
:
incomeId
,
incomeMoney
:
companyModel
.
income_money
,
corporateTurnover
:
companyModel
.
corporate_turnover
,
incomeType
:
companyModel
.
income_type
,
hasAllFile
:
hasFile
)
{
[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
guard
let
self
=
self
else
{
complete
(
false
)
complete
(
false
)
return
return
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/QMAS(优才)/ServiceProcess(我的信息流程)/IncomeRecord(收入记录)/M/YHIncomeRecordUtilType.swift
View file @
b9f28cd8
...
@@ -15,6 +15,13 @@ enum YHIncomeRecordHasAllFile: Int {
...
@@ -15,6 +15,13 @@ enum YHIncomeRecordHasAllFile: Int {
}
}
enum
YHIncomeOver100
:
Int
{
enum
YHIncomeOver100
:
Int
{
case
unknown
=
0
case
`
true
`
=
1
case
`
false
`
=
2
}
enum
YHCheckboxSelectType
:
Int
{
case
unknown
=
0
case
`
true
`
=
1
case
`
true
`
=
1
case
`
false
`
=
2
case
`
false
`
=
2
}
}
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/QMAS(优才)/ServiceProcess(我的信息流程)/IncomeRecord(收入记录)/V/YHIncomeDocumentationConfirmationCell.swift
View file @
b9f28cd8
...
@@ -10,13 +10,13 @@ import UIKit
...
@@ -10,13 +10,13 @@ import UIKit
class
YHIncomeDocumentationConfirmationCell
:
YHResignDocumentCell
{
class
YHIncomeDocumentationConfirmationCell
:
YHResignDocumentCell
{
static
let
cellReuseIdentifier
=
"YHIncomeDocumentationConfirmationCell"
static
let
cellReuseIdentifier
=
"YHIncomeDocumentationConfirmationCell"
var
didSelectSureButton
:
((
Bool
)
->
Void
)?
var
didSelectSureButton
:
((
YHIncomeRecordHasAllFile
)
->
Void
)?
private
var
documentationViews
:
[
YHIncomeDocumentationView
]
=
[]
private
var
documentationViews
:
[
YHIncomeDocumentationView
]
=
[]
private
var
lastDocuments
:
[
String
]
=
[]
var
selectedSureButton
:
Bool
=
true
{
var
selectedSureButton
:
YHIncomeRecordHasAllFile
=
.
unknown
{
didSet
{
didSet
{
updateButtonState
(
sureButton
,
selectedSureButton
)
updateButtonsState
(
selectedSureButton
)
updateButtonState
(
cancelButton
,
!
selectedSureButton
)
}
}
}
}
...
@@ -77,6 +77,14 @@ class YHIncomeDocumentationConfirmationCell: YHResignDocumentCell {
...
@@ -77,6 +77,14 @@ class YHIncomeDocumentationConfirmationCell: YHResignDocumentCell {
return
view
return
view
}()
}()
private
lazy
var
infoFailLabel
:
UILabel
=
{
let
label
=
UILabel
()
label
.
font
=
.
PFSC_R
(
ofSize
:
12
)
label
.
textColor
=
.
failColor
label
.
text
=
"请选择"
return
label
}()
override
init
(
style
:
UITableViewCell
.
CellStyle
,
reuseIdentifier
:
String
?)
{
override
init
(
style
:
UITableViewCell
.
CellStyle
,
reuseIdentifier
:
String
?)
{
super
.
init
(
style
:
style
,
reuseIdentifier
:
reuseIdentifier
)
super
.
init
(
style
:
style
,
reuseIdentifier
:
reuseIdentifier
)
setupUI
()
setupUI
()
...
@@ -86,9 +94,11 @@ class YHIncomeDocumentationConfirmationCell: YHResignDocumentCell {
...
@@ -86,9 +94,11 @@ class YHIncomeDocumentationConfirmationCell: YHResignDocumentCell {
fatalError
(
"init(coder:) has not been implemented"
)
fatalError
(
"init(coder:) has not been implemented"
)
}
}
func
setupCellInfo
(
title
:
String
,
question
:
String
,
documents
:
[
String
])
{
func
setupCellInfo
(
title
:
String
,
question
:
String
,
documents
:
[
String
]
,
needShowFailButton
:
Bool
)
{
infoTitleLabel
.
text
=
title
infoTitleLabel
.
text
=
title
infoQuestionLabel
.
text
=
question
infoQuestionLabel
.
text
=
question
if
lastDocuments
!=
documents
||
documentationViews
.
count
!=
documents
.
count
{
lastDocuments
=
documents
documentationViews
.
forEach
{
documentationViews
.
forEach
{
$0
.
removeFromSuperview
()
$0
.
removeFromSuperview
()
}
}
...
@@ -118,23 +128,58 @@ class YHIncomeDocumentationConfirmationCell: YHResignDocumentCell {
...
@@ -118,23 +128,58 @@ class YHIncomeDocumentationConfirmationCell: YHResignDocumentCell {
}
}
}
}
}
}
updateFailLabel
(
needShowFailButton
)
}
}
}
extension
YHIncomeDocumentationConfirmationCell
{
extension
YHIncomeDocumentationConfirmationCell
{
private
func
updateFailLabel
(
_
needShowFailButton
:
Bool
)
{
if
needShowFailButton
{
infoFailLabel
.
isHidden
=
false
containerView
.
snp
.
remakeConstraints
{
make
in
make
.
left
.
equalTo
(
infoTitleLabel
.
snp
.
left
)
make
.
right
.
equalToSuperview
()
.
offset
(
-
18
)
make
.
top
.
equalTo
(
infoQuestionLabel
.
snp
.
bottom
)
.
offset
(
16
)
}
infoFailLabel
.
snp
.
remakeConstraints
{
make
in
make
.
top
.
equalTo
(
containerView
.
snp
.
bottom
)
.
offset
(
6
)
make
.
left
.
equalTo
(
containerView
)
make
.
right
.
lessThanOrEqualToSuperview
()
.
offset
(
-
18
)
make
.
bottom
.
equalToSuperview
()
.
offset
(
-
16
)
}
}
else
{
infoFailLabel
.
isHidden
=
true
containerView
.
snp
.
remakeConstraints
{
make
in
make
.
left
.
equalTo
(
infoTitleLabel
.
snp
.
left
)
make
.
right
.
equalToSuperview
()
.
offset
(
-
18
)
make
.
top
.
equalTo
(
infoQuestionLabel
.
snp
.
bottom
)
.
offset
(
16
)
make
.
bottom
.
equalToSuperview
()
.
offset
(
-
16
)
}
infoFailLabel
.
snp
.
remakeConstraints
{
make
in
make
.
left
.
equalTo
(
containerView
)
make
.
right
.
lessThanOrEqualToSuperview
()
.
offset
(
-
18
)
make
.
bottom
.
equalToSuperview
()
.
offset
(
-
16
)
}
}
}
@objc
private
func
cancelButtonDidClick
(
_
sender
:
UIButton
)
{
@objc
private
func
cancelButtonDidClick
(
_
sender
:
UIButton
)
{
guard
!
sender
.
isSelected
else
{
guard
!
sender
.
isSelected
else
{
return
return
}
}
selectedSureButton
=
false
selectedSureButton
=
.
false
didSelectSureButton
?(
false
)
didSelectSureButton
?(
.
false
)
}
}
@objc
private
func
sureButtonDidClick
(
_
sender
:
UIButton
)
{
@objc
private
func
sureButtonDidClick
(
_
sender
:
UIButton
)
{
guard
!
sender
.
isSelected
else
{
guard
!
sender
.
isSelected
else
{
return
return
}
}
selectedSureButton
=
true
selectedSureButton
=
.
true
didSelectSureButton
?(
true
)
didSelectSureButton
?(
.
true
)
}
}
private
func
setupUI
()
{
private
func
setupUI
()
{
...
@@ -146,6 +191,7 @@ extension YHIncomeDocumentationConfirmationCell {
...
@@ -146,6 +191,7 @@ extension YHIncomeDocumentationConfirmationCell {
subContainerView
.
addSubview
(
sureButton
)
subContainerView
.
addSubview
(
sureButton
)
subContainerView
.
addSubview
(
cancelButton
)
subContainerView
.
addSubview
(
cancelButton
)
subContainerView
.
addSubview
(
containerView
)
subContainerView
.
addSubview
(
containerView
)
subContainerView
.
addSubview
(
infoFailLabel
)
sureButton
.
setContentCompressionResistancePriority
(
.
required
,
for
:
.
horizontal
)
sureButton
.
setContentCompressionResistancePriority
(
.
required
,
for
:
.
horizontal
)
cancelButton
.
setContentCompressionResistancePriority
(
.
required
,
for
:
.
horizontal
)
cancelButton
.
setContentCompressionResistancePriority
(
.
required
,
for
:
.
horizontal
)
...
@@ -199,14 +245,46 @@ extension YHIncomeDocumentationConfirmationCell {
...
@@ -199,14 +245,46 @@ extension YHIncomeDocumentationConfirmationCell {
make
.
bottom
.
equalToSuperview
()
.
offset
(
-
16
)
make
.
bottom
.
equalToSuperview
()
.
offset
(
-
16
)
}
}
selectedSureButton
=
true
infoFailLabel
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
containerView
)
make
.
right
.
lessThanOrEqualToSuperview
()
.
offset
(
-
18
)
make
.
bottom
.
equalToSuperview
()
.
offset
(
-
16
)
}
infoFailLabel
.
isHidden
=
true
selectedSureButton
=
.
unknown
}
}
private
func
updateButtonState
(
_
button
:
UIButton
,
_
isSelected
:
Bool
)
{
private
func
updateButtonsState
(
_
state
:
YHIncomeRecordHasAllFile
)
{
button
.
isSelected
=
isSelected
switch
state
{
button
.
backgroundColor
=
isSelected
?
UIColor
(
hexString
:
"#EBF0F9"
)
:
.
contentBkgColor
case
.
unknown
:
button
.
layer
.
borderColor
=
isSelected
?
UIColor
.
brandMainColor
.
cgColor
:
nil
sureButton
.
isSelected
=
false
button
.
layer
.
borderWidth
=
isSelected
?
1
:
0
sureButton
.
backgroundColor
=
.
contentBkgColor
sureButton
.
layer
.
borderColor
=
nil
sureButton
.
layer
.
borderWidth
=
0
cancelButton
.
isSelected
=
false
cancelButton
.
backgroundColor
=
.
contentBkgColor
cancelButton
.
layer
.
borderColor
=
nil
cancelButton
.
layer
.
borderWidth
=
0
case
.
true
:
sureButton
.
isSelected
=
true
sureButton
.
backgroundColor
=
UIColor
(
hexString
:
"#EBF0F9"
)
sureButton
.
layer
.
borderColor
=
UIColor
.
brandMainColor
.
cgColor
sureButton
.
layer
.
borderWidth
=
1
cancelButton
.
isSelected
=
false
cancelButton
.
backgroundColor
=
.
contentBkgColor
cancelButton
.
layer
.
borderColor
=
nil
cancelButton
.
layer
.
borderWidth
=
0
case
.
false
:
cancelButton
.
isSelected
=
true
cancelButton
.
backgroundColor
=
UIColor
(
hexString
:
"#EBF0F9"
)
cancelButton
.
layer
.
borderColor
=
UIColor
.
brandMainColor
.
cgColor
cancelButton
.
layer
.
borderWidth
=
1
sureButton
.
isSelected
=
false
sureButton
.
backgroundColor
=
.
contentBkgColor
sureButton
.
layer
.
borderColor
=
nil
sureButton
.
layer
.
borderWidth
=
0
}
}
}
}
}
...
@@ -229,7 +307,6 @@ private class YHIncomeDocumentationView: UIView {
...
@@ -229,7 +307,6 @@ private class YHIncomeDocumentationView: UIView {
return
view
return
view
}()
}()
override
init
(
frame
:
CGRect
)
{
override
init
(
frame
:
CGRect
)
{
super
.
init
(
frame
:
frame
)
super
.
init
(
frame
:
frame
)
setupUI
()
setupUI
()
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/QMAS(优才)/ServiceProcess(我的信息流程)/IncomeRecord(收入记录)/V/YHIncomeInputMoneyCell.swift
View file @
b9f28cd8
...
@@ -53,6 +53,14 @@ class YHIncomeInputMoneyCell: YHResignDocumentCell {
...
@@ -53,6 +53,14 @@ class YHIncomeInputMoneyCell: YHResignDocumentCell {
return
view
return
view
}()
}()
private
lazy
var
infoFailLabel
:
UILabel
=
{
let
label
=
UILabel
()
label
.
font
=
.
PFSC_R
(
ofSize
:
12
)
label
.
textColor
=
.
failColor
label
.
text
=
"请选择"
return
label
}()
override
init
(
style
:
UITableViewCell
.
CellStyle
,
reuseIdentifier
:
String
?)
{
override
init
(
style
:
UITableViewCell
.
CellStyle
,
reuseIdentifier
:
String
?)
{
super
.
init
(
style
:
style
,
reuseIdentifier
:
reuseIdentifier
)
super
.
init
(
style
:
style
,
reuseIdentifier
:
reuseIdentifier
)
setupUI
()
setupUI
()
...
@@ -62,7 +70,7 @@ class YHIncomeInputMoneyCell: YHResignDocumentCell {
...
@@ -62,7 +70,7 @@ class YHIncomeInputMoneyCell: YHResignDocumentCell {
fatalError
(
"init(coder:) has not been implemented"
)
fatalError
(
"init(coder:) has not been implemented"
)
}
}
func
setupCellInfo
(
title
:
String
,
detail
:
String
?,
inputValue
:
String
?,
showBottomLine
:
Bool
=
true
,
showStarIcon
:
Bool
=
false
)
{
func
setupCellInfo
(
title
:
String
,
detail
:
String
?,
inputValue
:
String
?,
showBottomLine
:
Bool
=
true
,
showStarIcon
:
Bool
=
false
,
needShowFailButton
:
Bool
)
{
infoTitleLabel
.
text
=
title
infoTitleLabel
.
text
=
title
bottomLineView
.
isHidden
=
!
showBottomLine
bottomLineView
.
isHidden
=
!
showBottomLine
inputTextField
.
text
=
inputValue
inputTextField
.
text
=
inputValue
...
@@ -82,12 +90,8 @@ class YHIncomeInputMoneyCell: YHResignDocumentCell {
...
@@ -82,12 +90,8 @@ class YHIncomeInputMoneyCell: YHResignDocumentCell {
make
.
width
.
lessThanOrEqualTo
(
102
)
make
.
width
.
lessThanOrEqualTo
(
102
)
}
}
}
}
updateDetailText
(
detail
)
infoDetailLabel
.
text
=
detail
}
if
let
detail
=
detail
,
detail
.
count
>
0
{
func
updateDetailText
(
_
text
:
String
?)
{
infoDetailLabel
.
text
=
text
if
let
text
=
text
,
text
.
count
>
0
{
infoDetailLabel
.
snp
.
remakeConstraints
{
make
in
infoDetailLabel
.
snp
.
remakeConstraints
{
make
in
make
.
top
.
equalTo
(
inputTextField
.
snp
.
bottom
)
.
offset
(
4
)
make
.
top
.
equalTo
(
inputTextField
.
snp
.
bottom
)
.
offset
(
4
)
make
.
bottom
.
lessThanOrEqualToSuperview
()
.
offset
(
-
16
)
make
.
bottom
.
lessThanOrEqualToSuperview
()
.
offset
(
-
16
)
...
@@ -102,6 +106,17 @@ class YHIncomeInputMoneyCell: YHResignDocumentCell {
...
@@ -102,6 +106,17 @@ class YHIncomeInputMoneyCell: YHResignDocumentCell {
make
.
right
.
lessThanOrEqualToSuperview
()
.
offset
(
-
18
)
make
.
right
.
lessThanOrEqualToSuperview
()
.
offset
(
-
18
)
}
}
}
}
infoFailLabel
.
isHidden
=
!
needShowFailButton
infoFailLabel
.
snp
.
remakeConstraints
{
make
in
if
needShowFailButton
{
make
.
top
.
equalTo
(
infoDetailLabel
.
snp
.
bottom
)
.
offset
(
6
)
}
make
.
left
.
equalToSuperview
()
.
offset
(
18
)
make
.
right
.
lessThanOrEqualToSuperview
()
.
offset
(
-
18
)
make
.
bottom
.
equalToSuperview
()
.
offset
(
-
16
)
}
}
}
}
}
...
@@ -114,6 +129,7 @@ extension YHIncomeInputMoneyCell {
...
@@ -114,6 +129,7 @@ extension YHIncomeInputMoneyCell {
subContainerView
.
addSubview
(
inputTextField
)
subContainerView
.
addSubview
(
inputTextField
)
subContainerView
.
addSubview
(
infoDetailLabel
)
subContainerView
.
addSubview
(
infoDetailLabel
)
subContainerView
.
addSubview
(
bottomLineView
)
subContainerView
.
addSubview
(
bottomLineView
)
subContainerView
.
addSubview
(
infoFailLabel
)
dotIcon
.
setContentCompressionResistancePriority
(
.
required
,
for
:
.
horizontal
)
dotIcon
.
setContentCompressionResistancePriority
(
.
required
,
for
:
.
horizontal
)
infoTitleLabel
.
setContentCompressionResistancePriority
(
.
defaultHigh
,
for
:
.
horizontal
)
infoTitleLabel
.
setContentCompressionResistancePriority
(
.
defaultHigh
,
for
:
.
horizontal
)
...
@@ -145,6 +161,12 @@ extension YHIncomeInputMoneyCell {
...
@@ -145,6 +161,12 @@ extension YHIncomeInputMoneyCell {
make
.
left
.
equalToSuperview
()
.
offset
(
147
)
make
.
left
.
equalToSuperview
()
.
offset
(
147
)
make
.
right
.
lessThanOrEqualToSuperview
()
.
offset
(
-
18
)
make
.
right
.
lessThanOrEqualToSuperview
()
.
offset
(
-
18
)
}
}
infoFailLabel
.
isHidden
=
true
infoFailLabel
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalToSuperview
()
.
offset
(
18
)
make
.
right
.
lessThanOrEqualToSuperview
()
.
offset
(
-
18
)
make
.
bottom
.
equalToSuperview
()
.
offset
(
-
16
)
}
bottomLineView
.
snp
.
makeConstraints
{
make
in
bottomLineView
.
snp
.
makeConstraints
{
make
in
make
.
bottom
.
equalToSuperview
()
make
.
bottom
.
equalToSuperview
()
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/QMAS(优才)/ServiceProcess(我的信息流程)/IncomeRecord(收入记录)/V/YHIncomeTypeSelectCell.swift
View file @
b9f28cd8
...
@@ -44,6 +44,14 @@ class YHIncomeTypeSelectCell: YHResignDocumentCell {
...
@@ -44,6 +44,14 @@ class YHIncomeTypeSelectCell: YHResignDocumentCell {
return
view
return
view
}()
}()
private
lazy
var
infoFailLabel
:
UILabel
=
{
let
label
=
UILabel
()
label
.
font
=
.
PFSC_R
(
ofSize
:
12
)
label
.
textColor
=
.
failColor
label
.
text
=
"请选择"
return
label
}()
override
init
(
style
:
UITableViewCell
.
CellStyle
,
reuseIdentifier
:
String
?)
{
override
init
(
style
:
UITableViewCell
.
CellStyle
,
reuseIdentifier
:
String
?)
{
super
.
init
(
style
:
style
,
reuseIdentifier
:
reuseIdentifier
)
super
.
init
(
style
:
style
,
reuseIdentifier
:
reuseIdentifier
)
setupUI
()
setupUI
()
...
@@ -53,16 +61,49 @@ class YHIncomeTypeSelectCell: YHResignDocumentCell {
...
@@ -53,16 +61,49 @@ class YHIncomeTypeSelectCell: YHResignDocumentCell {
fatalError
(
"init(coder:) has not been implemented"
)
fatalError
(
"init(coder:) has not been implemented"
)
}
}
func
setupCellInfo
(
title
:
String
,
detail
:
String
=
"请选择"
,
isSelectedOne
:
Bool
=
false
,
showBottomLine
:
Bool
=
false
)
{
func
setupCellInfo
(
title
:
String
,
detail
:
String
=
"请选择"
,
isSelectedOne
:
Bool
=
false
,
showBottomLine
:
Bool
=
false
,
needShowFailButton
:
Bool
)
{
infoTitleLabel
.
text
=
title
infoTitleLabel
.
text
=
title
infoDetailLabel
.
text
=
detail
infoDetailLabel
.
text
=
detail
infoDetailLabel
.
isHidden
=
isSelectedOne
infoDetailLabel
.
isHidden
=
isSelectedOne
bottomLineView
.
isHidden
=
!
showBottomLine
bottomLineView
.
isHidden
=
!
showBottomLine
updateFailLabel
(
needShowFailButton
)
}
}
}
}
extension
YHIncomeTypeSelectCell
{
extension
YHIncomeTypeSelectCell
{
private
func
updateFailLabel
(
_
needShowFailButton
:
Bool
)
{
if
needShowFailButton
{
infoDetailLabel
.
snp
.
remakeConstraints
{
make
in
make
.
top
.
equalToSuperview
()
.
offset
(
16
)
make
.
left
.
equalToSuperview
()
.
offset
(
147
)
make
.
right
.
lessThanOrEqualTo
(
rightArrowIcon
.
snp
.
left
)
.
offset
(
-
18
)
}
infoFailLabel
.
snp
.
remakeConstraints
{
make
in
make
.
top
.
equalTo
(
infoDetailLabel
.
snp
.
bottom
)
.
offset
(
6
)
make
.
left
.
equalTo
(
dotIcon
)
make
.
right
.
lessThanOrEqualToSuperview
()
.
offset
(
-
18
)
make
.
bottom
.
equalToSuperview
()
.
offset
(
-
16
)
}
infoFailLabel
.
isHidden
=
false
}
else
{
infoDetailLabel
.
snp
.
remakeConstraints
{
make
in
make
.
top
.
equalToSuperview
()
.
offset
(
16
)
make
.
bottom
.
equalToSuperview
()
.
offset
(
-
16
)
make
.
left
.
equalToSuperview
()
.
offset
(
147
)
make
.
right
.
lessThanOrEqualTo
(
rightArrowIcon
.
snp
.
left
)
.
offset
(
-
18
)
}
infoFailLabel
.
snp
.
remakeConstraints
{
make
in
make
.
left
.
equalTo
(
dotIcon
)
make
.
right
.
lessThanOrEqualToSuperview
()
.
offset
(
-
18
)
make
.
bottom
.
equalToSuperview
()
.
offset
(
-
16
)
}
infoFailLabel
.
isHidden
=
true
}
}
private
func
setupUI
()
{
private
func
setupUI
()
{
updateCellCorner
(
.
mid
)
updateCellCorner
(
.
mid
)
subContainerView
.
addSubview
(
dotIcon
)
subContainerView
.
addSubview
(
dotIcon
)
...
@@ -70,6 +111,7 @@ extension YHIncomeTypeSelectCell {
...
@@ -70,6 +111,7 @@ extension YHIncomeTypeSelectCell {
subContainerView
.
addSubview
(
infoDetailLabel
)
subContainerView
.
addSubview
(
infoDetailLabel
)
subContainerView
.
addSubview
(
rightArrowIcon
)
subContainerView
.
addSubview
(
rightArrowIcon
)
subContainerView
.
addSubview
(
bottomLineView
)
subContainerView
.
addSubview
(
bottomLineView
)
subContainerView
.
addSubview
(
infoFailLabel
)
dotIcon
.
setContentCompressionResistancePriority
(
.
required
,
for
:
.
horizontal
)
dotIcon
.
setContentCompressionResistancePriority
(
.
required
,
for
:
.
horizontal
)
infoTitleLabel
.
setContentCompressionResistancePriority
(
.
defaultHigh
,
for
:
.
horizontal
)
infoTitleLabel
.
setContentCompressionResistancePriority
(
.
defaultHigh
,
for
:
.
horizontal
)
...
@@ -77,18 +119,18 @@ extension YHIncomeTypeSelectCell {
...
@@ -77,18 +119,18 @@ extension YHIncomeTypeSelectCell {
rightArrowIcon
.
setContentCompressionResistancePriority
(
.
required
,
for
:
.
horizontal
)
rightArrowIcon
.
setContentCompressionResistancePriority
(
.
required
,
for
:
.
horizontal
)
dotIcon
.
snp
.
makeConstraints
{
make
in
dotIcon
.
snp
.
makeConstraints
{
make
in
make
.
centerY
.
equalTo
Superview
(
)
make
.
centerY
.
equalTo
(
infoTitleLabel
)
make
.
left
.
equalToSuperview
()
.
offset
(
18
)
make
.
left
.
equalToSuperview
()
.
offset
(
18
)
make
.
width
.
height
.
equalTo
(
6
)
make
.
width
.
height
.
equalTo
(
6
)
}
}
infoTitleLabel
.
snp
.
makeConstraints
{
make
in
infoTitleLabel
.
snp
.
makeConstraints
{
make
in
make
.
centerY
.
equalToSuperview
(
)
make
.
top
.
equalToSuperview
()
.
offset
(
16
)
make
.
left
.
equalTo
(
dotIcon
.
snp
.
right
)
.
offset
(
2
)
make
.
left
.
equalTo
(
dotIcon
.
snp
.
right
)
.
offset
(
2
)
}
}
rightArrowIcon
.
snp
.
makeConstraints
{
make
in
rightArrowIcon
.
snp
.
makeConstraints
{
make
in
make
.
centerY
.
equalTo
Superview
(
)
make
.
centerY
.
equalTo
(
infoTitleLabel
)
make
.
right
.
equalToSuperview
()
.
offset
(
-
18
)
make
.
right
.
equalToSuperview
()
.
offset
(
-
18
)
make
.
width
.
height
.
equalTo
(
20
)
make
.
width
.
height
.
equalTo
(
20
)
}
}
...
@@ -100,6 +142,13 @@ extension YHIncomeTypeSelectCell {
...
@@ -100,6 +142,13 @@ extension YHIncomeTypeSelectCell {
make
.
right
.
lessThanOrEqualTo
(
rightArrowIcon
.
snp
.
left
)
.
offset
(
-
18
)
make
.
right
.
lessThanOrEqualTo
(
rightArrowIcon
.
snp
.
left
)
.
offset
(
-
18
)
}
}
infoFailLabel
.
snp
.
remakeConstraints
{
make
in
make
.
left
.
equalTo
(
dotIcon
)
make
.
right
.
lessThanOrEqualToSuperview
()
.
offset
(
-
18
)
make
.
bottom
.
equalToSuperview
()
.
offset
(
-
16
)
}
infoFailLabel
.
isHidden
=
true
bottomLineView
.
snp
.
makeConstraints
{
make
in
bottomLineView
.
snp
.
makeConstraints
{
make
in
make
.
bottom
.
equalToSuperview
()
make
.
bottom
.
equalToSuperview
()
make
.
left
.
equalToSuperview
()
.
offset
(
18
)
make
.
left
.
equalToSuperview
()
.
offset
(
18
)
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/QMAS(优才)/ServiceProcess(我的信息流程)/IncomeRecord(收入记录)/V/YHIncomeTypesCell.swift
View file @
b9f28cd8
...
@@ -13,6 +13,7 @@ class YHIncomeTypesCell: YHResignDocumentCell {
...
@@ -13,6 +13,7 @@ class YHIncomeTypesCell: YHResignDocumentCell {
var
didClickTypeView
:
((
Int
)
->
Void
)?
var
didClickTypeView
:
((
Int
)
->
Void
)?
private
var
typeViews
:
[
YHIncomeTypeView
]
=
[]
private
var
typeViews
:
[
YHIncomeTypeView
]
=
[]
private
var
lastTypes
:
[
String
]
=
[]
private
lazy
var
bottomLineView
:
UIView
=
{
private
lazy
var
bottomLineView
:
UIView
=
{
let
view
=
UIView
()
let
view
=
UIView
()
...
@@ -41,6 +42,10 @@ class YHIncomeTypesCell: YHResignDocumentCell {
...
@@ -41,6 +42,10 @@ class YHIncomeTypesCell: YHResignDocumentCell {
}
}
func
setupCellInfo
(
types
:
[
String
])
{
func
setupCellInfo
(
types
:
[
String
])
{
guard
lastTypes
!=
types
||
types
.
count
!=
typeViews
.
count
else
{
return
}
lastTypes
=
types
typeViews
.
forEach
{
typeViews
.
forEach
{
$0
.
removeFromSuperview
()
$0
.
removeFromSuperview
()
}
}
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/QMAS(优才)/ServiceProcess(我的信息流程)/IncomeRecord(收入记录)/V/YHInfoConsentForHKTravelCell.swift
View file @
b9f28cd8
...
@@ -11,12 +11,11 @@ import UIKit
...
@@ -11,12 +11,11 @@ import UIKit
class
YHInfoConsentForHKTravelCell
:
YHResignDocumentCell
{
class
YHInfoConsentForHKTravelCell
:
YHResignDocumentCell
{
static
let
cellReuseIdentifier
=
"YHInfoConsentForHKTravelCell"
static
let
cellReuseIdentifier
=
"YHInfoConsentForHKTravelCell"
var
didSelectSureButton
:
((
Bool
)
->
Void
)?
var
didSelectSureButton
:
((
YHCheckboxSelectType
)
->
Void
)?
var
selectedSureButton
:
Bool
=
true
{
var
selectedSureButton
:
YHCheckboxSelectType
=
.
unknown
{
didSet
{
didSet
{
updateButtonState
(
sureButton
,
selectedSureButton
)
updateButtonsState
(
selectedSureButton
)
updateButtonState
(
cancelButton
,
!
selectedSureButton
)
}
}
}
}
...
@@ -86,6 +85,14 @@ class YHInfoConsentForHKTravelCell: YHResignDocumentCell {
...
@@ -86,6 +85,14 @@ class YHInfoConsentForHKTravelCell: YHResignDocumentCell {
return
button
return
button
}()
}()
private
lazy
var
infoFailLabel
:
UILabel
=
{
let
label
=
UILabel
()
label
.
font
=
.
PFSC_R
(
ofSize
:
12
)
label
.
textColor
=
.
failColor
label
.
text
=
"请选择"
return
label
}()
override
init
(
style
:
UITableViewCell
.
CellStyle
,
reuseIdentifier
:
String
?)
{
override
init
(
style
:
UITableViewCell
.
CellStyle
,
reuseIdentifier
:
String
?)
{
super
.
init
(
style
:
style
,
reuseIdentifier
:
reuseIdentifier
)
super
.
init
(
style
:
style
,
reuseIdentifier
:
reuseIdentifier
)
setupUI
()
setupUI
()
...
@@ -95,29 +102,62 @@ class YHInfoConsentForHKTravelCell: YHResignDocumentCell {
...
@@ -95,29 +102,62 @@ class YHInfoConsentForHKTravelCell: YHResignDocumentCell {
fatalError
(
"init(coder:) has not been implemented"
)
fatalError
(
"init(coder:) has not been implemented"
)
}
}
func
setupCellInfo
(
title
:
String
,
detail
:
ASAttributedString
,
question
:
String
,
showBottomLine
:
Bool
=
false
)
{
func
setupCellInfo
(
title
:
String
,
detail
:
ASAttributedString
,
question
:
String
,
showBottomLine
:
Bool
=
false
,
needShowFailButton
:
Bool
)
{
bottomLineView
.
isHidden
=
!
showBottomLine
bottomLineView
.
isHidden
=
!
showBottomLine
infoTitleLabel
.
text
=
title
infoTitleLabel
.
text
=
title
infoDetailLabel
.
attributed
.
text
=
detail
infoDetailLabel
.
attributed
.
text
=
detail
infoQuestionLabel
.
text
=
question
infoQuestionLabel
.
text
=
question
updateFailLabel
(
needShowFailButton
)
}
}
}
}
extension
YHInfoConsentForHKTravelCell
{
extension
YHInfoConsentForHKTravelCell
{
private
func
updateFailLabel
(
_
needShowFailButton
:
Bool
)
{
if
needShowFailButton
{
infoFailLabel
.
isHidden
=
false
infoQuestionLabel
.
snp
.
remakeConstraints
{
make
in
make
.
left
.
equalTo
(
dotIcon
.
snp
.
right
)
.
offset
(
2
)
make
.
top
.
equalTo
(
infoDetailLabel
.
snp
.
bottom
)
.
offset
(
16
)
make
.
height
.
greaterThanOrEqualTo
(
40
)
make
.
width
.
lessThanOrEqualTo
(
113
)
}
infoFailLabel
.
snp
.
remakeConstraints
{
make
in
make
.
top
.
equalTo
(
infoQuestionLabel
.
snp
.
bottom
)
.
offset
(
6
)
make
.
left
.
equalToSuperview
()
.
offset
(
18
)
make
.
right
.
lessThanOrEqualToSuperview
()
.
offset
(
-
18
)
make
.
bottom
.
equalToSuperview
()
.
offset
(
-
16
)
}
}
else
{
infoFailLabel
.
isHidden
=
true
infoQuestionLabel
.
snp
.
remakeConstraints
{
make
in
make
.
left
.
equalTo
(
dotIcon
.
snp
.
right
)
.
offset
(
2
)
make
.
top
.
equalTo
(
infoDetailLabel
.
snp
.
bottom
)
.
offset
(
16
)
make
.
height
.
greaterThanOrEqualTo
(
40
)
make
.
width
.
lessThanOrEqualTo
(
113
)
make
.
bottom
.
equalToSuperview
()
.
offset
(
-
16
)
}
infoFailLabel
.
snp
.
remakeConstraints
{
make
in
make
.
left
.
equalToSuperview
()
.
offset
(
18
)
make
.
right
.
lessThanOrEqualToSuperview
()
.
offset
(
-
18
)
make
.
bottom
.
equalToSuperview
()
.
offset
(
-
16
)
}
}
}
@objc
private
func
cancelButtonDidClick
(
_
sender
:
UIButton
)
{
@objc
private
func
cancelButtonDidClick
(
_
sender
:
UIButton
)
{
guard
!
sender
.
isSelected
else
{
guard
!
sender
.
isSelected
else
{
return
return
}
}
selectedSureButton
=
false
selectedSureButton
=
.
false
didSelectSureButton
?(
false
)
didSelectSureButton
?(
.
false
)
}
}
@objc
private
func
sureButtonDidClick
(
_
sender
:
UIButton
)
{
@objc
private
func
sureButtonDidClick
(
_
sender
:
UIButton
)
{
guard
!
sender
.
isSelected
else
{
guard
!
sender
.
isSelected
else
{
return
return
}
}
selectedSureButton
=
true
selectedSureButton
=
.
true
didSelectSureButton
?(
true
)
didSelectSureButton
?(
.
true
)
}
}
private
func
setupUI
()
{
private
func
setupUI
()
{
...
@@ -130,6 +170,7 @@ extension YHInfoConsentForHKTravelCell {
...
@@ -130,6 +170,7 @@ extension YHInfoConsentForHKTravelCell {
subContainerView
.
addSubview
(
infoQuestionLabel
)
subContainerView
.
addSubview
(
infoQuestionLabel
)
subContainerView
.
addSubview
(
sureButton
)
subContainerView
.
addSubview
(
sureButton
)
subContainerView
.
addSubview
(
cancelButton
)
subContainerView
.
addSubview
(
cancelButton
)
subContainerView
.
addSubview
(
infoFailLabel
)
sureButton
.
setContentCompressionResistancePriority
(
.
required
,
for
:
.
horizontal
)
sureButton
.
setContentCompressionResistancePriority
(
.
required
,
for
:
.
horizontal
)
cancelButton
.
setContentCompressionResistancePriority
(
.
required
,
for
:
.
horizontal
)
cancelButton
.
setContentCompressionResistancePriority
(
.
required
,
for
:
.
horizontal
)
...
@@ -165,6 +206,7 @@ extension YHInfoConsentForHKTravelCell {
...
@@ -165,6 +206,7 @@ extension YHInfoConsentForHKTravelCell {
make
.
top
.
equalTo
(
infoDetailLabel
.
snp
.
bottom
)
.
offset
(
16
)
make
.
top
.
equalTo
(
infoDetailLabel
.
snp
.
bottom
)
.
offset
(
16
)
make
.
height
.
greaterThanOrEqualTo
(
40
)
make
.
height
.
greaterThanOrEqualTo
(
40
)
make
.
width
.
lessThanOrEqualTo
(
113
)
make
.
width
.
lessThanOrEqualTo
(
113
)
make
.
bottom
.
equalToSuperview
()
.
offset
(
-
16
)
}
}
cancelButton
.
snp
.
makeConstraints
{
make
in
cancelButton
.
snp
.
makeConstraints
{
make
in
...
@@ -187,15 +229,47 @@ extension YHInfoConsentForHKTravelCell {
...
@@ -187,15 +229,47 @@ extension YHInfoConsentForHKTravelCell {
make
.
left
.
equalToSuperview
()
.
offset
(
18
)
make
.
left
.
equalToSuperview
()
.
offset
(
18
)
make
.
right
.
equalToSuperview
()
.
offset
(
-
18
)
make
.
right
.
equalToSuperview
()
.
offset
(
-
18
)
make
.
height
.
equalTo
(
0.5
)
make
.
height
.
equalTo
(
0.5
)
make
.
top
.
equalTo
(
infoQuestionLabel
.
snp
.
bottom
)
.
offset
(
22
)
}
}
selectedSureButton
=
true
infoFailLabel
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalToSuperview
()
.
offset
(
18
)
make
.
right
.
lessThanOrEqualToSuperview
()
.
offset
(
-
18
)
make
.
bottom
.
equalToSuperview
()
.
offset
(
-
16
)
}
infoFailLabel
.
isHidden
=
true
selectedSureButton
=
.
unknown
}
}
private
func
updateButtonState
(
_
button
:
UIButton
,
_
isSelected
:
Bool
)
{
private
func
updateButtonsState
(
_
state
:
YHCheckboxSelectType
)
{
button
.
isSelected
=
isSelected
switch
state
{
button
.
backgroundColor
=
isSelected
?
UIColor
(
hexString
:
"#EBF0F9"
)
:
.
contentBkgColor
case
.
unknown
:
button
.
layer
.
borderColor
=
isSelected
?
UIColor
.
brandMainColor
.
cgColor
:
nil
sureButton
.
isSelected
=
false
button
.
layer
.
borderWidth
=
isSelected
?
1
:
0
sureButton
.
backgroundColor
=
.
contentBkgColor
sureButton
.
layer
.
borderColor
=
nil
sureButton
.
layer
.
borderWidth
=
0
cancelButton
.
isSelected
=
false
cancelButton
.
backgroundColor
=
.
contentBkgColor
cancelButton
.
layer
.
borderColor
=
nil
cancelButton
.
layer
.
borderWidth
=
0
case
.
true
:
sureButton
.
isSelected
=
true
sureButton
.
backgroundColor
=
UIColor
(
hexString
:
"#EBF0F9"
)
sureButton
.
layer
.
borderColor
=
UIColor
.
brandMainColor
.
cgColor
sureButton
.
layer
.
borderWidth
=
1
cancelButton
.
isSelected
=
false
cancelButton
.
backgroundColor
=
.
contentBkgColor
cancelButton
.
layer
.
borderColor
=
nil
cancelButton
.
layer
.
borderWidth
=
0
case
.
false
:
cancelButton
.
isSelected
=
true
cancelButton
.
backgroundColor
=
UIColor
(
hexString
:
"#EBF0F9"
)
cancelButton
.
layer
.
borderColor
=
UIColor
.
brandMainColor
.
cgColor
cancelButton
.
layer
.
borderWidth
=
1
sureButton
.
isSelected
=
false
sureButton
.
backgroundColor
=
.
contentBkgColor
sureButton
.
layer
.
borderColor
=
nil
sureButton
.
layer
.
borderWidth
=
0
}
}
}
}
}
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/QMAS(优才)/ServiceProcess(我的信息流程)/IncomeRecord(收入记录)/VM/YHIncomeRecordViewModel.swift
View file @
b9f28cd8
...
@@ -58,12 +58,12 @@ class YHIncomeRecordViewModel: YHBaseViewModel {
...
@@ -58,12 +58,12 @@ class YHIncomeRecordViewModel: YHBaseViewModel {
}
}
}
}
func
updateDetail
(
incomeId
:
Int
,
incomeMoney
:
Double
,
corporateTurnover
:
Double
,
incomeType
:
[
Int
],
hasAllFile
:
YHIncomeRecordHasAllFile
,
callBackBlock
:
@escaping
(
_
success
:
Bool
,
_
error
:
YHErrorModel
?)
->
Void
)
{
func
updateDetail
(
incomeId
:
Int
,
incomeMoney
:
Double
,
corporateTurnover
:
Double
,
incomeType
:
[
Int
],
hasAllFile
:
Int
,
callBackBlock
:
@escaping
(
_
success
:
Bool
,
_
error
:
YHErrorModel
?)
->
Void
)
{
let
params
:
[
String
:
Any
]
=
[
"income_id"
:
incomeId
,
let
params
:
[
String
:
Any
]
=
[
"income_id"
:
incomeId
,
"income_money"
:
incomeMoney
,
"income_money"
:
incomeMoney
,
"corporate_turnover"
:
corporateTurnover
,
"corporate_turnover"
:
corporateTurnover
,
"income_type"
:
incomeType
,
"income_type"
:
incomeType
,
"has_all_file"
:
hasAllFile
.
rawValue
]
"has_all_file"
:
hasAllFile
]
let
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
YHAllApiName
.
IncomeRecord
.
updateDetail
let
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
YHAllApiName
.
IncomeRecord
.
updateDetail
_
=
YHNetRequest
.
postRequest
(
url
:
strUrl
,
params
:
params
)
{
json
,
_
in
_
=
YHNetRequest
.
postRequest
(
url
:
strUrl
,
params
:
params
)
{
json
,
_
in
// 1. json字符串 转 对象
// 1. json字符串 转 对象
...
@@ -79,9 +79,9 @@ class YHIncomeRecordViewModel: YHBaseViewModel {
...
@@ -79,9 +79,9 @@ class YHIncomeRecordViewModel: YHBaseViewModel {
}
}
}
}
func
incomeUpdate
(
orderId
:
Int
,
incomeOver100
:
YHIncomeOver100
,
type
:
YHIncomeRecordUpdateType
,
callBackBlock
:
@escaping
(
_
success
:
Bool
,
_
error
:
YHErrorModel
?)
->
Void
)
{
func
incomeUpdate
(
orderId
:
Int
,
incomeOver100
:
Int
,
type
:
YHIncomeRecordUpdateType
,
callBackBlock
:
@escaping
(
_
success
:
Bool
,
_
error
:
YHErrorModel
?)
->
Void
)
{
let
params
:
[
String
:
Any
]
=
[
"order_id"
:
orderId
,
let
params
:
[
String
:
Any
]
=
[
"order_id"
:
orderId
,
"income_over_100"
:
incomeOver100
.
rawValue
,
"income_over_100"
:
incomeOver100
,
"type"
:
type
.
rawValue
]
"type"
:
type
.
rawValue
]
let
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
YHAllApiName
.
IncomeRecord
.
incomeUpdate
let
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
YHAllApiName
.
IncomeRecord
.
incomeUpdate
_
=
YHNetRequest
.
postRequest
(
url
:
strUrl
,
params
:
params
)
{
json
,
_
in
_
=
YHNetRequest
.
postRequest
(
url
:
strUrl
,
params
:
params
)
{
json
,
_
in
...
...
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