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
d2984cc8
Commit
d2984cc8
authored
Oct 13, 2024
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// 分批修改
parent
f2132ce0
Changes
12
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
129 additions
and
86 deletions
+129
-86
project.pbxproj
galaxy/galaxy.xcodeproj/project.pbxproj
+1
-1
YHResignAppointSubmitScheduleViewController.swift
...递交预约)/C/YHResignAppointSubmitScheduleViewController.swift
+36
-0
YHResignAppointTimeModifyViewController.swift
...t(在港递交预约)/C/YHResignAppointTimeModifyViewController.swift
+0
-0
YHResignAppointTimeViewController.swift
...Appoint(在港递交预约)/C/YHResignAppointTimeViewController.swift
+11
-2
YHResignAppointGroup.swift
...(续签)/ResignHKAppoint(在港递交预约)/M/YHResignAppointGroup.swift
+39
-0
YHResignAppointTimeSettingModel.swift
...HKAppoint(在港递交预约)/M/YHResignAppointTimeSettingModel.swift
+2
-1
YHResignAppointApplicantInfoCell.swift
...KAppoint(在港递交预约)/V/YHResignAppointApplicantInfoCell.swift
+16
-2
YHResignAppointOptionResultCell.swift
...HKAppoint(在港递交预约)/V/YHResignAppointOptionResultCell.swift
+6
-0
YHResignAppointShowTimeItemView.swift
...HKAppoint(在港递交预约)/V/YHResignAppointShowTimeItemView.swift
+5
-1
YHResignAppointedScheduleSingleItemView.swift
...t(在港递交预约)/V/YHResignAppointedScheduleSingleItemView.swift
+6
-20
YHResignHaveAppointedMultipleInfoCell.swift
...int(在港递交预约)/V/YHResignHaveAppointedMultipleInfoCell.swift
+6
-40
YHResignHaveAppointedSingleInfoCell.swift
...point(在港递交预约)/V/YHResignHaveAppointedSingleInfoCell.swift
+1
-19
No files found.
galaxy/galaxy.xcodeproj/project.pbxproj
View file @
d2984cc8
...
@@ -3549,8 +3549,8 @@
...
@@ -3549,8 +3549,8 @@
children
=
(
children
=
(
04912F932CB921C300CC3105
/* YHResignAppointContainerViewController.swift */
,
04912F932CB921C300CC3105
/* YHResignAppointContainerViewController.swift */
,
04912F6F2CB765FE00CC3105
/* YHResignAppointTimeViewController.swift */
,
04912F6F2CB765FE00CC3105
/* YHResignAppointTimeViewController.swift */
,
04912F952CB924DA00CC3105
/* YHResignAppointTimeModifyViewController.swift */
,
04F4A5272CB8D4270026D469
/* YHResignAppointSubmitScheduleViewController.swift */
,
04F4A5272CB8D4270026D469
/* YHResignAppointSubmitScheduleViewController.swift */
,
04912F952CB924DA00CC3105
/* YHResignAppointTimeModifyViewController.swift */
,
);
);
path
=
C
;
path
=
C
;
sourceTree
=
"<group>"
;
sourceTree
=
"<group>"
;
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/Resign(续签)/ResignHKAppoint(在港递交预约)/C/YHResignAppointSubmitScheduleViewController.swift
View file @
d2984cc8
...
@@ -15,6 +15,7 @@ class YHResignAppointSubmitScheduleViewController: YHBaseViewController {
...
@@ -15,6 +15,7 @@ class YHResignAppointSubmitScheduleViewController: YHBaseViewController {
var
scheduleArr
:
[
YHResignAppointGroup
]
=
[]
{
var
scheduleArr
:
[
YHResignAppointGroup
]
=
[]
{
didSet
{
didSet
{
self
.
tableView
.
reloadData
()
self
.
tableView
.
reloadData
()
self
.
updateBottomBtnStatus
()
}
}
}
}
...
@@ -102,6 +103,7 @@ class YHResignAppointSubmitScheduleViewController: YHBaseViewController {
...
@@ -102,6 +103,7 @@ class YHResignAppointSubmitScheduleViewController: YHBaseViewController {
make
.
left
.
right
.
bottom
.
equalToSuperview
()
make
.
left
.
right
.
bottom
.
equalToSuperview
()
make
.
height
.
equalTo
(
98
)
make
.
height
.
equalTo
(
98
)
}
}
self
.
updateBottomBtnStatus
()
}
}
...
@@ -109,6 +111,21 @@ class YHResignAppointSubmitScheduleViewController: YHBaseViewController {
...
@@ -109,6 +111,21 @@ class YHResignAppointSubmitScheduleViewController: YHBaseViewController {
}
}
// 更新底部下一步按钮点击状态
func
updateBottomBtnStatus
()
{
// 是否所有分批都已确认在港
var
isAllGroupHaveConfirmInHK
=
true
for
group
in
scheduleArr
{
let
confirmHKStatus
=
group
.
getConfirmInHKStatus
()
if
confirmHKStatus
!=
.
haveConfirmHK
{
isAllGroupHaveConfirmInHK
=
false
}
}
self
.
nextBtn
.
isUserInteractionEnabled
=
isAllGroupHaveConfirmInHK
self
.
nextBtn
.
alpha
=
isAllGroupHaveConfirmInHK
?
1.0
:
0.3
}
func
clickConfirmHKButton
(
status
:
YHResignConfirmHKStatus
)
{
func
clickConfirmHKButton
(
status
:
YHResignConfirmHKStatus
)
{
if
status
==
.
waitConfirmHK
{
// 待确认在港
if
status
==
.
waitConfirmHK
{
// 待确认在港
// 展示提前到港弹窗
// 展示提前到港弹窗
...
@@ -152,6 +169,8 @@ class YHResignAppointSubmitScheduleViewController: YHBaseViewController {
...
@@ -152,6 +169,8 @@ class YHResignAppointSubmitScheduleViewController: YHBaseViewController {
let
vc
=
YHResignAppointTimeViewController
()
let
vc
=
YHResignAppointTimeViewController
()
if
scheduleArr
.
count
>
0
{
if
scheduleArr
.
count
>
0
{
let
group
=
scheduleArr
[
0
]
let
group
=
scheduleArr
[
0
]
vc
.
defaultSubmitTime
=
group
.
ready_to_submit_at
vc
.
defaultLeaveHKTime
=
group
.
leave_hk_at
vc
.
allAppointUsers
=
group
.
user_list
.
map
{
vc
.
allAppointUsers
=
group
.
user_list
.
map
{
return
$0
.
transformToMember
()
return
$0
.
transformToMember
()
}
}
...
@@ -161,7 +180,24 @@ class YHResignAppointSubmitScheduleViewController: YHBaseViewController {
...
@@ -161,7 +180,24 @@ class YHResignAppointSubmitScheduleViewController: YHBaseViewController {
}
}
// 多人多批
// 多人多批
var
groupArr
=
[
YHResignAppointTimeSettingModel
]()
for
(
index
,
group
)
in
scheduleArr
.
enumerated
()
{
let
model
=
YHResignAppointTimeSettingModel
()
let
status
=
group
.
getConfirmInHKStatus
()
model
.
isHaveAppointed
=
(
status
==
.
haveConfirmHK
)
model
.
ready_to_submit_at
=
group
.
ready_to_submit_at
model
.
leave_hk_at
=
group
.
leave_hk_at
model
.
notleaveHK
=
group
.
leave_hk_at
.
isEmpty
model
.
itemIndex
=
index
model
.
users
=
group
.
user_list
.
map
{
return
$0
.
transformToMember
()
}
groupArr
.
append
(
model
)
}
let
modifyVC
=
YHResignAppointTimeModifyViewController
()
modifyVC
.
selectGroupArr
=
groupArr
self
.
navigationController
?
.
pushViewController
(
modifyVC
)
}
}
}
}
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/Resign(续签)/ResignHKAppoint(在港递交预约)/C/YHResignAppointTimeModifyViewController.swift
View file @
d2984cc8
This diff is collapsed.
Click to expand it.
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/Resign(续签)/ResignHKAppoint(在港递交预约)/C/YHResignAppointTimeViewController.swift
View file @
d2984cc8
...
@@ -10,16 +10,23 @@ import UIKit
...
@@ -10,16 +10,23 @@ import UIKit
import
AttributedString
import
AttributedString
import
SwifterSwift
import
SwifterSwift
// 初始是单人或初始默认为所有人为一批的情况 可用此VC
class
YHResignAppointTimeViewController
:
YHBaseViewController
{
class
YHResignAppointTimeViewController
:
YHBaseViewController
{
var
renewalId
:
Int
=
0
var
renewalId
:
Int
=
0
// 所有预约人员
// 所有预约人员
var
allAppointUsers
:
[
YHResignAppointMember
]
=
[]
var
allAppointUsers
:
[
YHResignAppointMember
]
=
[]
// 预约在港递交时间
var
defaultSubmitTime
:
String
=
""
// 预计离港时间
var
defaultLeaveHKTime
:
String
=
""
let
viewModel
=
YHResignAppointViewModel
()
let
viewModel
=
YHResignAppointViewModel
()
// 申请人是否在港
// 申请人是否在港
var
togetherArr
:
[
YHResignAppointTogetherSetting
]
=
[]
var
togetherArr
:
[
YHResignAppointTogetherSetting
]
=
[]
// 是否一起在港递交
lazy
var
togetherSetting
=
{
lazy
var
togetherSetting
=
{
let
model
=
YHResignAppointTogetherSetting
()
let
model
=
YHResignAppointTogetherSetting
()
model
.
is_together
=
1
model
.
is_together
=
1
...
@@ -28,8 +35,6 @@ class YHResignAppointTimeViewController: YHBaseViewController {
...
@@ -28,8 +35,6 @@ class YHResignAppointTimeViewController: YHBaseViewController {
// 分组信息
// 分组信息
var
selectGroupArr
:
[
YHResignAppointTimeSettingModel
]
=
[]
var
selectGroupArr
:
[
YHResignAppointTimeSettingModel
]
=
[]
// 是否一起赴港
var
isTogether
:
Bool
=
true
// 是否单人
// 是否单人
private
var
isOnyOne
:
Bool
{
private
var
isOnyOne
:
Bool
{
get
{
get
{
...
@@ -126,6 +131,8 @@ class YHResignAppointTimeViewController: YHBaseViewController {
...
@@ -126,6 +131,8 @@ class YHResignAppointTimeViewController: YHBaseViewController {
if
isOnyOne
{
// 只有一个人
if
isOnyOne
{
// 只有一个人
self
.
togetherSetting
.
is_together
=
0
self
.
togetherSetting
.
is_together
=
0
let
model1
=
YHResignAppointTimeSettingModel
()
let
model1
=
YHResignAppointTimeSettingModel
()
model1
.
ready_to_submit_at
=
defaultSubmitTime
model1
.
leave_hk_at
=
defaultLeaveHKTime
selectGroupArr
.
append
(
model1
)
selectGroupArr
.
append
(
model1
)
self
.
tableView
.
reloadData
()
self
.
tableView
.
reloadData
()
return
return
...
@@ -136,6 +143,8 @@ class YHResignAppointTimeViewController: YHBaseViewController {
...
@@ -136,6 +143,8 @@ class YHResignAppointTimeViewController: YHBaseViewController {
togetherArr
.
append
(
self
.
togetherSetting
)
togetherArr
.
append
(
self
.
togetherSetting
)
// 分组数据
// 分组数据
let
model1
=
YHResignAppointTimeSettingModel
()
let
model1
=
YHResignAppointTimeSettingModel
()
model1
.
ready_to_submit_at
=
defaultSubmitTime
model1
.
leave_hk_at
=
defaultLeaveHKTime
if
self
.
togetherSetting
.
is_together
==
2
{
// 不一起递交 需显示候选人列表
if
self
.
togetherSetting
.
is_together
==
2
{
// 不一起递交 需显示候选人列表
// 默认全部选中
// 默认全部选中
let
users
=
allAppointUsers
.
deepCopy
()
.
map
{
let
users
=
allAppointUsers
.
deepCopy
()
.
map
{
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/Resign(续签)/ResignHKAppoint(在港递交预约)/M/YHResignAppointGroup.swift
View file @
d2984cc8
...
@@ -39,6 +39,45 @@ class YHResignAppointGroup: SmartCodable {
...
@@ -39,6 +39,45 @@ class YHResignAppointGroup: SmartCodable {
// 自定义 第几批
// 自定义 第几批
var
batchIndex
:
Int
=
0
var
batchIndex
:
Int
=
0
func
getConfirmInHKStatus
()
->
YHResignConfirmHKStatus
{
let
dateFormatter
=
DateFormatter
()
dateFormatter
.
dateFormat
=
"yyyy-MM-dd HH:mm:ss"
let
nowDateString
=
dateFormatter
.
string
(
from
:
Date
())
var
confirmStatus
=
YHResignConfirmHKStatus
.
waitConfirmHK
// 是否到了预约递交时间
let
isArriveSubmitTime
=
compareDates
(
self
.
ready_to_submit_at
,
nowDateString
)
if
!
isArriveSubmitTime
{
// 待确认在港
confirmStatus
=
.
waitConfirmHK
}
else
{
confirmStatus
=
!
self
.
determine_hk_at
.
isEmpty
?
.
haveConfirmHK
:
.
canConfirmHK
}
return
confirmStatus
}
// dateString1 是否不小于dateString2
func
compareDates
(
_
dateString1
:
String
,
_
dateString2
:
String
)
->
Bool
{
let
dateFormatter
=
DateFormatter
()
dateFormatter
.
dateFormat
=
"yyyy-MM-dd HH:mm:ss"
// 将字符串转换为 Date 对象
guard
let
date1
=
dateFormatter
.
date
(
from
:
dateString1
),
let
date2
=
dateFormatter
.
date
(
from
:
dateString2
)
else
{
print
(
"日期格式错误"
)
return
false
}
// 比较日期
if
date1
<
date2
{
print
(
"
\(
dateString1
)
小于
\(
dateString2
)
"
)
return
false
}
return
true
}
required
init
()
{
required
init
()
{
}
}
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/Resign(续签)/ResignHKAppoint(在港递交预约)/M/YHResignAppointTimeSettingModel.swift
View file @
d2984cc8
...
@@ -15,8 +15,9 @@ class YHResignAppointTimeSettingModel: SmartCodable {
...
@@ -15,8 +15,9 @@ class YHResignAppointTimeSettingModel: SmartCodable {
var
leave_hk_at
:
String
=
""
// 预计离港时间
var
leave_hk_at
:
String
=
""
// 预计离港时间
var
notleaveHK
:
Bool
=
false
// 暂不离港
var
notleaveHK
:
Bool
=
false
// 暂不离港
var
users
:
[
YHResignAppointMember
]
=
[]
var
users
:
[
YHResignAppointMember
]
=
[]
var
itemIndex
:
Int
=
0
// 第几批
var
itemIndex
:
Int
=
0
// 第几批
从0开始
var
isClickSubmit
:
Bool
=
false
var
isClickSubmit
:
Bool
=
false
var
isHaveAppointed
:
Bool
=
false
required
init
()
{
required
init
()
{
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/Resign(续签)/ResignHKAppoint(在港递交预约)/V/YHResignAppointApplicantInfoCell.swift
View file @
d2984cc8
...
@@ -31,7 +31,7 @@ class YHResignAppointApplicantInfoCell: UITableViewCell {
...
@@ -31,7 +31,7 @@ class YHResignAppointApplicantInfoCell: UITableViewCell {
label
.
numberOfLines
=
0
label
.
numberOfLines
=
0
label
.
font
=
UIFont
.
PFSC_M
(
ofSize
:
17
)
label
.
font
=
UIFont
.
PFSC_M
(
ofSize
:
17
)
label
.
textColor
=
.
mainTextColor
label
.
textColor
=
.
mainTextColor
label
.
text
=
"第
一
批赴港递交信息"
label
.
text
=
"第
?
批赴港递交信息"
return
label
return
label
}()
}()
...
@@ -55,7 +55,7 @@ class YHResignAppointApplicantInfoCell: UITableViewCell {
...
@@ -55,7 +55,7 @@ class YHResignAppointApplicantInfoCell: UITableViewCell {
label
.
numberOfLines
=
0
label
.
numberOfLines
=
0
label
.
font
=
UIFont
.
PFSC_M
(
ofSize
:
14
)
label
.
font
=
UIFont
.
PFSC_M
(
ofSize
:
14
)
label
.
textColor
=
.
mainTextColor
label
.
textColor
=
.
mainTextColor
label
.
text
=
"成员:
侯林、张曼玉、刘德华
"
label
.
text
=
"成员:"
return
label
return
label
}()
}()
...
@@ -82,6 +82,20 @@ class YHResignAppointApplicantInfoCell: UITableViewCell {
...
@@ -82,6 +82,20 @@ class YHResignAppointApplicantInfoCell: UITableViewCell {
setupUI
()
setupUI
()
}
}
func
updateModel
(
_
model
:
YHResignAppointTimeSettingModel
)
{
titleLabel
.
text
=
"第
\(
String
.
convertNumberToChineseText
(
model
.
itemIndex
+
1
)
)
批赴港递交信息"
var
names
=
"成员:"
for
(
index
,
user
)
in
model
.
users
.
enumerated
()
{
names
+=
user
.
apply_name
if
index
!=
model
.
users
.
count
-
1
{
names
+=
"、"
}
}
applicantNamesLabel
.
text
=
names
submitTimeView
.
detail
=
model
.
ready_to_submit_at
leaveHKTimeView
.
detail
=
model
.
leave_hk_at
}
func
setupUI
()
{
func
setupUI
()
{
self
.
selectionStyle
=
.
none
self
.
selectionStyle
=
.
none
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/Resign(续签)/ResignHKAppoint(在港递交预约)/V/YHResignAppointOptionResultCell.swift
View file @
d2984cc8
...
@@ -11,6 +11,12 @@ import UIKit
...
@@ -11,6 +11,12 @@ import UIKit
class
YHResignAppointOptionResultCell
:
UITableViewCell
{
class
YHResignAppointOptionResultCell
:
UITableViewCell
{
static
let
cellReuseIdentifier
=
"YHResignAppointOptionResultCell"
static
let
cellReuseIdentifier
=
"YHResignAppointOptionResultCell"
var
isTogether
:
Bool
=
false
{
didSet
{
optionLabel
.
text
=
isTogether
?
"是"
:
"否"
}
}
lazy
var
whiteContentView
:
UIView
=
{
lazy
var
whiteContentView
:
UIView
=
{
let
view
=
UIView
()
let
view
=
UIView
()
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/Resign(续签)/ResignHKAppoint(在港递交预约)/V/YHResignAppointShowTimeItemView.swift
View file @
d2984cc8
...
@@ -18,7 +18,11 @@ class YHResignAppointShowTimeItemView: UIView {
...
@@ -18,7 +18,11 @@ class YHResignAppointShowTimeItemView: UIView {
var
detail
:
String
=
""
{
var
detail
:
String
=
""
{
didSet
{
didSet
{
detailLabel
.
text
=
detail
var
text
=
detail
if
text
.
isEmpty
{
text
=
" "
// 空字符串不能自适应label高度
}
detailLabel
.
text
=
text
}
}
}
}
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/Resign(续签)/ResignHKAppoint(在港递交预约)/V/YHResignAppointedScheduleSingleItemView.swift
View file @
d2984cc8
...
@@ -98,26 +98,12 @@ class YHResignAppointedScheduleSingleItemView: UIView {
...
@@ -98,26 +98,12 @@ class YHResignAppointedScheduleSingleItemView: UIView {
submitTimeLabel
.
text
=
"预约递交时间: "
+
model
.
ready_to_submit_at
submitTimeLabel
.
text
=
"预约递交时间: "
+
model
.
ready_to_submit_at
confirmHKTimeLabel
.
text
=
"确认在港时间: "
+
model
.
determine_hk_at
confirmHKTimeLabel
.
text
=
"确认在港时间: "
+
model
.
determine_hk_at
let
dateFormatter
=
DateFormatter
()
self
.
confirmHKStatus
=
model
.
getConfirmInHKStatus
()
dateFormatter
.
dateFormat
=
"yyyy-MM-dd HH:mm:ss"
let
nowDateString
=
dateFormatter
.
string
(
from
:
Date
())
var
confirmStatus
=
YHResignConfirmHKStatus
.
waitConfirmHK
// 是否到了预约递交时间
let
isArriveSubmitTime
=
compareDates
(
model
.
ready_to_submit_at
,
nowDateString
)
if
!
isArriveSubmitTime
{
// 待确认在港
confirmStatus
=
.
waitConfirmHK
}
else
{
confirmStatus
=
!
model
.
determine_hk_at
.
isEmpty
?
.
haveConfirmHK
:
.
canConfirmHK
}
self
.
confirmHKStatus
=
confirmStatus
haveConfirmInHKLabel
.
isHidden
=
(
confirm
Status
!=
.
haveConfirmHK
)
haveConfirmInHKLabel
.
isHidden
=
(
self
.
confirmHK
Status
!=
.
haveConfirmHK
)
confirmInHKBtn
.
isHidden
=
(
confirm
Status
==
.
haveConfirmHK
)
confirmInHKBtn
.
isHidden
=
(
self
.
confirmHK
Status
==
.
haveConfirmHK
)
if
confirm
Status
==
.
waitConfirmHK
{
if
self
.
confirmHK
Status
==
.
waitConfirmHK
{
confirmInHKBtn
.
setTitle
(
"待确认在港"
,
for
:
.
normal
)
confirmInHKBtn
.
setTitle
(
"待确认在港"
,
for
:
.
normal
)
confirmInHKBtn
.
setTitleColor
(
.
mainTextColor
,
for
:
.
normal
)
confirmInHKBtn
.
setTitleColor
(
.
mainTextColor
,
for
:
.
normal
)
confirmInHKBtn
.
backgroundColor
=
.
init
(
hex
:
0xF4F6FA
)
confirmInHKBtn
.
backgroundColor
=
.
init
(
hex
:
0xF4F6FA
)
...
@@ -126,7 +112,7 @@ class YHResignAppointedScheduleSingleItemView: UIView {
...
@@ -126,7 +112,7 @@ class YHResignAppointedScheduleSingleItemView: UIView {
}
}
}
else
if
confirm
Status
==
.
canConfirmHK
{
}
else
if
self
.
confirmHK
Status
==
.
canConfirmHK
{
confirmInHKBtn
.
setTitle
(
"确认在港"
,
for
:
.
normal
)
confirmInHKBtn
.
setTitle
(
"确认在港"
,
for
:
.
normal
)
confirmInHKBtn
.
setTitleColor
(
.
white
,
for
:
.
normal
)
confirmInHKBtn
.
setTitleColor
(
.
white
,
for
:
.
normal
)
confirmInHKBtn
.
backgroundColor
=
.
brandMainColor
confirmInHKBtn
.
backgroundColor
=
.
brandMainColor
...
@@ -138,7 +124,7 @@ class YHResignAppointedScheduleSingleItemView: UIView {
...
@@ -138,7 +124,7 @@ class YHResignAppointedScheduleSingleItemView: UIView {
confirmHKTimeLabel
.
removeFromSuperview
()
confirmHKTimeLabel
.
removeFromSuperview
()
confirmHKTimeLabel
.
snp
.
removeConstraints
()
confirmHKTimeLabel
.
snp
.
removeConstraints
()
if
confirm
Status
==
.
haveConfirmHK
{
// 已确认在港 需要显示确认在港时间
if
self
.
confirmHK
Status
==
.
haveConfirmHK
{
// 已确认在港 需要显示确认在港时间
self
.
addSubview
(
confirmHKTimeLabel
)
self
.
addSubview
(
confirmHKTimeLabel
)
confirmHKTimeLabel
.
snp
.
remakeConstraints
{
make
in
confirmHKTimeLabel
.
snp
.
remakeConstraints
{
make
in
make
.
left
.
equalTo
(
18
)
make
.
left
.
equalTo
(
18
)
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/Resign(续签)/ResignHKAppoint(在港递交预约)/V/YHResignHaveAppointedMultipleInfoCell.swift
View file @
d2984cc8
...
@@ -118,26 +118,12 @@ class YHResignHaveAppointedMultipleInfoCell: UITableViewCell {
...
@@ -118,26 +118,12 @@ class YHResignHaveAppointedMultipleInfoCell: UITableViewCell {
submitTimeLabel
.
text
=
"预约递交时间: "
+
model
.
ready_to_submit_at
submitTimeLabel
.
text
=
"预约递交时间: "
+
model
.
ready_to_submit_at
confirmHKTimeLabel
.
text
=
"确认在港时间: "
+
model
.
determine_hk_at
confirmHKTimeLabel
.
text
=
"确认在港时间: "
+
model
.
determine_hk_at
let
dateFormatter
=
DateFormatter
()
self
.
confirmHKStatus
=
model
.
getConfirmInHKStatus
()
dateFormatter
.
dateFormat
=
"yyyy-MM-dd HH:mm:ss"
let
nowDateString
=
dateFormatter
.
string
(
from
:
Date
())
var
confirmStatus
=
YHResignConfirmHKStatus
.
waitConfirmHK
haveConfirmInHKLabel
.
isHidden
=
(
self
.
confirmHKStatus
!=
.
haveConfirmHK
)
// 是否到了预约递交时间
confirmInHKBtn
.
isHidden
=
(
self
.
confirmHKStatus
==
.
haveConfirmHK
)
let
isArriveSubmitTime
=
compareDates
(
model
.
ready_to_submit_at
,
nowDateString
)
if
!
isArriveSubmitTime
{
if
self
.
confirmHKStatus
==
.
waitConfirmHK
{
// 待确认在港
confirmStatus
=
.
waitConfirmHK
}
else
{
confirmStatus
=
!
model
.
determine_hk_at
.
isEmpty
?
.
haveConfirmHK
:
.
canConfirmHK
}
self
.
confirmHKStatus
=
confirmStatus
haveConfirmInHKLabel
.
isHidden
=
(
confirmStatus
!=
.
haveConfirmHK
)
confirmInHKBtn
.
isHidden
=
(
confirmStatus
==
.
haveConfirmHK
)
if
confirmStatus
==
.
waitConfirmHK
{
confirmInHKBtn
.
setTitle
(
"待确认在港"
,
for
:
.
normal
)
confirmInHKBtn
.
setTitle
(
"待确认在港"
,
for
:
.
normal
)
confirmInHKBtn
.
setTitleColor
(
.
mainTextColor
,
for
:
.
normal
)
confirmInHKBtn
.
setTitleColor
(
.
mainTextColor
,
for
:
.
normal
)
confirmInHKBtn
.
backgroundColor
=
.
init
(
hex
:
0xF4F6FA
)
confirmInHKBtn
.
backgroundColor
=
.
init
(
hex
:
0xF4F6FA
)
...
@@ -146,7 +132,7 @@ class YHResignHaveAppointedMultipleInfoCell: UITableViewCell {
...
@@ -146,7 +132,7 @@ class YHResignHaveAppointedMultipleInfoCell: UITableViewCell {
}
}
}
else
if
confirm
Status
==
.
canConfirmHK
{
}
else
if
self
.
confirmHK
Status
==
.
canConfirmHK
{
confirmInHKBtn
.
setTitle
(
"确认在港"
,
for
:
.
normal
)
confirmInHKBtn
.
setTitle
(
"确认在港"
,
for
:
.
normal
)
confirmInHKBtn
.
setTitleColor
(
.
white
,
for
:
.
normal
)
confirmInHKBtn
.
setTitleColor
(
.
white
,
for
:
.
normal
)
confirmInHKBtn
.
backgroundColor
=
.
brandMainColor
confirmInHKBtn
.
backgroundColor
=
.
brandMainColor
...
@@ -158,7 +144,7 @@ class YHResignHaveAppointedMultipleInfoCell: UITableViewCell {
...
@@ -158,7 +144,7 @@ class YHResignHaveAppointedMultipleInfoCell: UITableViewCell {
confirmHKTimeLabel
.
removeFromSuperview
()
confirmHKTimeLabel
.
removeFromSuperview
()
confirmHKTimeLabel
.
snp
.
removeConstraints
()
confirmHKTimeLabel
.
snp
.
removeConstraints
()
if
confirm
Status
==
.
haveConfirmHK
{
// 已确认在港 需要显示确认在港时间
if
self
.
confirmHK
Status
==
.
haveConfirmHK
{
// 已确认在港 需要显示确认在港时间
self
.
addSubview
(
confirmHKTimeLabel
)
self
.
addSubview
(
confirmHKTimeLabel
)
confirmHKTimeLabel
.
snp
.
remakeConstraints
{
make
in
confirmHKTimeLabel
.
snp
.
remakeConstraints
{
make
in
make
.
left
.
equalTo
(
18
)
make
.
left
.
equalTo
(
18
)
...
@@ -190,26 +176,6 @@ class YHResignHaveAppointedMultipleInfoCell: UITableViewCell {
...
@@ -190,26 +176,6 @@ class YHResignHaveAppointedMultipleInfoCell: UITableViewCell {
self
.
layoutIfNeeded
()
self
.
layoutIfNeeded
()
}
}
// dateString1 是否不小于dateString2
func
compareDates
(
_
dateString1
:
String
,
_
dateString2
:
String
)
->
Bool
{
let
dateFormatter
=
DateFormatter
()
dateFormatter
.
dateFormat
=
"yyyy-MM-dd HH:mm:ss"
// 将字符串转换为 Date 对象
guard
let
date1
=
dateFormatter
.
date
(
from
:
dateString1
),
let
date2
=
dateFormatter
.
date
(
from
:
dateString2
)
else
{
print
(
"日期格式错误"
)
return
false
}
// 比较日期
if
date1
<
date2
{
print
(
"
\(
dateString1
)
小于
\(
dateString2
)
"
)
return
false
}
return
true
}
func
createUI
()
{
func
createUI
()
{
self
.
selectionStyle
=
.
none
self
.
selectionStyle
=
.
none
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/Resign(续签)/ResignHKAppoint(在港递交预约)/V/YHResignHaveAppointedSingleInfoCell.swift
View file @
d2984cc8
...
@@ -73,25 +73,7 @@ class YHResignHaveAppointedSingleInfoCell: UITableViewCell {
...
@@ -73,25 +73,7 @@ class YHResignHaveAppointedSingleInfoCell: UITableViewCell {
modifyBtnBlock
?()
modifyBtnBlock
?()
}
}
// dateString1 是否不小于dateString2
func
compareDates
(
_
dateString1
:
String
,
_
dateString2
:
String
)
->
Bool
{
let
dateFormatter
=
DateFormatter
()
dateFormatter
.
dateFormat
=
"yyyy-MM-dd HH:mm:ss"
// 将字符串转换为 Date 对象
guard
let
date1
=
dateFormatter
.
date
(
from
:
dateString1
),
let
date2
=
dateFormatter
.
date
(
from
:
dateString2
)
else
{
print
(
"日期格式错误"
)
return
false
}
// 比较日期
if
date1
<
date2
{
print
(
"
\(
dateString1
)
小于
\(
dateString2
)
"
)
return
false
}
return
true
}
func
setupUI
()
{
func
setupUI
()
{
self
.
selectionStyle
=
.
none
self
.
selectionStyle
=
.
none
...
...
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