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
cc57a111
Commit
cc57a111
authored
Oct 14, 2024
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// 行程
parent
c90615f5
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
97 additions
and
37 deletions
+97
-37
YHResignAppointSubmitScheduleViewController.swift
...递交预约)/C/YHResignAppointSubmitScheduleViewController.swift
+76
-36
YHResignAppointGroup.swift
...(续签)/ResignHKAppoint(在港递交预约)/M/YHResignAppointGroup.swift
+1
-1
YHResignAppointViewModel.swift
...ResignHKAppoint(在港递交预约)/VM/YHResignAppointViewModel.swift
+18
-0
YHAllApiName.swift
galaxy/galaxy/Classes/Tools/NetWork/YHAllApiName.swift
+2
-0
No files found.
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/Resign(续签)/ResignHKAppoint(在港递交预约)/C/YHResignAppointSubmitScheduleViewController.swift
View file @
cc57a111
...
...
@@ -15,12 +15,15 @@ class YHResignAppointSubmitScheduleViewController: YHBaseViewController {
var
scheduleArr
:
[
YHResignAppointGroup
]
=
[]
{
didSet
{
self
.
tableView
.
reloadData
()
self
.
updateBottomBtnStatus
()
self
.
updateBottomBtn
AndMotifyBtn
Status
()
}
}
// 是否隐藏修改按钮
var
isHiddenModifyBtn
:
Bool
=
false
var
isTogether
:
Bool
{
get
{
// 只有一个行程安排 就是一起去递交
return
scheduleArr
.
count
<=
1
}
}
...
...
@@ -103,7 +106,7 @@ class YHResignAppointSubmitScheduleViewController: YHBaseViewController {
make
.
left
.
right
.
bottom
.
equalToSuperview
()
make
.
height
.
equalTo
(
98
)
}
self
.
updateBottomBtnStatus
()
self
.
updateBottomBtn
AndMotifyBtn
Status
()
}
...
...
@@ -112,21 +115,17 @@ class YHResignAppointSubmitScheduleViewController: YHBaseViewController {
}
// 更新底部下一步按钮点击状态
func
updateBottomBtnStatus
()
{
// 是否所有分批都已确认在港
var
isAllGroupHaveConfirmInHK
=
true
for
group
in
scheduleArr
{
let
confirmHKStatus
=
group
.
getConfirmInHKStatus
()
if
confirmHKStatus
!=
.
haveConfirmHK
{
isAllGroupHaveConfirmInHK
=
false
}
}
func
updateBottomBtnAndMotifyBtnStatus
()
{
var
isAtLeatOneHaveConfirmInHK
=
self
.
isAtLeatOneHaveConfirmInHK
()
self
.
nextBtn
.
isUserInteractionEnabled
=
isAtLeatOneHaveConfirmInHK
self
.
nextBtn
.
alpha
=
isAtLeatOneHaveConfirmInHK
?
1.0
:
0.3
self
.
nextBtn
.
isUserInteractionEnabled
=
isAllGroupHaveConfirmInHK
self
.
nextBtn
.
alpha
=
isAllGroupHaveConfirmInHK
?
1.0
:
0.3
// 所有分批都已确认在港 则无需修改了
self
.
isHiddenModifyBtn
=
self
.
isAllHaveHaveConfirmInHK
()
}
func
clickConfirmHKButton
(
status
:
YHResignConfirmHKStatus
)
{
func
clickConfirmHKButton
(
status
:
YHResignConfirmHKStatus
,
_
model
:
YHResignAppointGroup
)
{
if
status
==
.
waitConfirmHK
{
// 待确认在港
// 展示提前到港弹窗
let
alert
=
YHForwardArriveHKAlertView
.
alertView
()
...
...
@@ -141,7 +140,7 @@ class YHResignAppointSubmitScheduleViewController: YHBaseViewController {
alert
.
show
()
}
else
if
status
==
.
canConfirmHK
{
// 可点击确认在港
YHHUD
.
flash
(
message
:
"请求提交确认在港"
)
requestConfirmInHK
(
model
)
}
}
...
...
@@ -184,27 +183,22 @@ class YHResignAppointSubmitScheduleViewController: YHBaseViewController {
// 以下是多人的情况
// 先得到所有分批用户的集合
var
allAppointUsers
=
[
YHResignAppointUser
]()
for
group
in
scheduleArr
{
allAppointUsers
.
append
(
contentsOf
:
group
.
user_list
)
}
YHHUD
.
show
(
.
progress
(
message
:
"加载中..."
))
self
.
viewModel
.
getResignAppointUserlist
(
renewalId
:
self
.
renewalId
)
{
[
weak
self
]
success
,
error
in
YHHUD
.
hide
()
guard
let
self
=
self
else
{
return
}
// 过滤掉id重复的数据
var
uniqueAllAppointUsers
:
[
YHResignAppointUser
]
=
[]
var
setIds
=
Set
<
Int
>
()
for
model
in
allAppointUsers
{
if
!
setIds
.
contains
(
model
.
id
)
{
setIds
.
insert
(
model
.
id
)
uniqueAllAppointUsers
.
append
(
model
)
}
if
!
success
{
let
msg
=
error
?
.
errorMsg
??
""
YHHUD
.
flash
(
message
:
msg
)
return
}
let
appAppointUsers
=
self
.
viewModel
.
appointUsers
// 组装数据
// 上一个批次中未选中的用户集合
var
lastLeftUnselectUsers
:
[
YHResignAppointMember
]
=
uniqueAllAppointUsers
.
deepCopy
()
.
map
{
let
m
=
$0
.
transformToMember
()
m
.
isSelected
=
false
return
m
}
var
lastLeftUnselectUsers
:
[
YHResignAppointMember
]
=
appAppointUsers
.
deepCopy
()
var
groupArr
=
[
YHResignAppointTimeSettingModel
]()
for
(
index
,
group
)
in
scheduleArr
.
enumerated
()
{
...
...
@@ -227,7 +221,7 @@ class YHResignAppointSubmitScheduleViewController: YHBaseViewController {
// group.user_list 表示当前批已选用户组 更新已选择状态
for
selectUser
in
group
.
user_list
{
for
user
in
users
{
if
user
.
id
==
selectUser
.
i
d
{
if
user
.
id
==
selectUser
.
memberI
d
{
user
.
isSelected
=
true
break
}
...
...
@@ -243,7 +237,7 @@ class YHResignAppointSubmitScheduleViewController: YHBaseViewController {
lastLeftUnselectUsers
=
lastLeftUnselectUsers
.
filter
{
for
model
in
group
.
user_list
{
if
model
.
i
d
==
$0
.
id
{
// 该用户已经选择过
if
model
.
memberI
d
==
$0
.
id
{
// 该用户已经选择过
return
false
}
}
...
...
@@ -257,6 +251,7 @@ class YHResignAppointSubmitScheduleViewController: YHBaseViewController {
modifyVC
.
selectGroupArr
=
groupArr
self
.
navigationController
?
.
pushViewController
(
modifyVC
)
}
}
func
isAtLeatOneHaveConfirmInHK
()
->
Bool
{
// 所有行程安排中是否至少有一个已确认在港
for
group
in
scheduleArr
{
...
...
@@ -267,6 +262,47 @@ class YHResignAppointSubmitScheduleViewController: YHBaseViewController {
}
return
false
}
func
isAllHaveHaveConfirmInHK
()
->
Bool
{
// 是否所有行程安排都已确认在港
var
isAllHaveConfirmed
=
true
for
group
in
scheduleArr
{
let
status
=
group
.
getConfirmInHKStatus
()
if
status
!=
.
haveConfirmHK
{
isAllHaveConfirmed
=
false
}
}
return
isAllHaveConfirmed
}
func
requestConfirmInHK
(
_
model
:
YHResignAppointGroup
)
{
YHHUD
.
show
(
.
progress
(
message
:
"提交中..."
))
self
.
viewModel
.
submitConfirmInHK
(
id
:
model
.
id
)
{
[
weak
self
]
success
,
error
in
YHHUD
.
hide
()
guard
let
self
else
{
return
}
if
success
{
// 重新请求列表
self
.
requestList
()
return
}
let
msg
=
error
?
.
errorMsg
??
"提交失败"
YHHUD
.
flash
(
message
:
msg
)
}
}
func
requestList
()
{
YHHUD
.
show
(
.
progress
(
message
:
"加载中..."
))
self
.
viewModel
.
getAppointInfoList
(
renewalId
:
self
.
renewalId
)
{
[
weak
self
]
success
,
error
in
YHHUD
.
hide
()
guard
let
self
else
{
return
}
self
.
scheduleArr
.
removeAll
()
self
.
scheduleArr
.
append
(
contentsOf
:
self
.
viewModel
.
scheduleInfoList
.
renewal_List
)
self
.
tableView
.
reloadData
()
self
.
updateBottomBtnAndMotifyBtnStatus
()
}
}
}
extension
YHResignAppointSubmitScheduleViewController
:
UITableViewDelegate
,
UITableViewDataSource
{
...
...
@@ -282,11 +318,14 @@ extension YHResignAppointSubmitScheduleViewController: UITableViewDelegate, UITa
if
isTogether
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHResignHaveAppointedSingleInfoCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHResignHaveAppointedSingleInfoCell
cell
.
updateModel
(
model
)
// 点击确认在港或未确认在港按钮
cell
.
clickConfirmBtnBlock
=
{
[
weak
self
]
status
in
guard
let
self
=
self
else
{
return
}
self
.
clickConfirmHKButton
(
status
:
status
)
self
.
clickConfirmHKButton
(
status
:
status
,
model
)
}
cell
.
modifyBtn
.
isHidden
=
self
.
isHiddenModifyBtn
// 点击修改按钮
cell
.
modifyBtnBlock
=
{
[
weak
self
]
in
guard
let
self
=
self
else
{
return
}
...
...
@@ -302,7 +341,7 @@ extension YHResignAppointSubmitScheduleViewController: UITableViewDelegate, UITa
cell2
.
clickConfirmBtnBlock
=
{
[
weak
self
]
status
in
guard
let
self
=
self
else
{
return
}
self
.
clickConfirmHKButton
(
status
:
status
)
self
.
clickConfirmHKButton
(
status
:
status
,
model
)
}
let
isShowCorner
=
(
indexPath
.
row
==
scheduleArr
.
count
-
1
)
cell2
.
showBottomCorner
(
isShowCorner
)
...
...
@@ -362,6 +401,7 @@ extension YHResignAppointSubmitScheduleViewController: UITableViewDelegate, UITa
view
.
addSubview
(
titleLabel
)
let
modifyBtn
=
UIButton
()
modifyBtn
.
isHidden
=
self
.
isHiddenModifyBtn
modifyBtn
.
setTitle
(
"修改"
,
for
:
.
normal
)
modifyBtn
.
setTitleColor
(
.
brandMainColor
,
for
:
.
normal
)
modifyBtn
.
titleLabel
?
.
font
=
.
PFSC_M
(
ofSize
:
14
)
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/Resign(续签)/ResignHKAppoint(在港递交预约)/M/YHResignAppointGroup.swift
View file @
cc57a111
...
...
@@ -105,7 +105,7 @@ class YHResignAppointUser: SmartCodable, NSCopying {
func
transformToMember
()
->
YHResignAppointMember
{
let
m
=
YHResignAppointMember
()
m
.
id
=
self
.
i
d
m
.
id
=
self
.
memberI
d
m
.
apply_name
=
self
.
name
return
m
}
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/Resign(续签)/ResignHKAppoint(在港递交预约)/VM/YHResignAppointViewModel.swift
View file @
cc57a111
...
...
@@ -110,4 +110,22 @@ class YHResignAppointViewModel: NSObject {
callBack
(
false
,
err
)
}
}
// 点击确认在港
func
submitConfirmInHK
(
id
:
Int
,
callBack
:
@escaping
(
_
success
:
Bool
,
_
error
:
YHErrorModel
?)
->
())
{
let
params
:[
String
:
Any
]
=
[
"id"
:
id
]
let
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
YHAllApiName
.
ResignAppoint
.
confirmInHK
let
_
=
YHNetRequest
.
getRequest
(
url
:
strUrl
,
params
:
params
)
{
[
weak
self
]
json
,
code
in
//1. json字符串 转 对象
guard
let
_
=
self
else
{
return
}
if
json
.
code
==
200
{
callBack
(
true
,
nil
)
}
else
{
let
error
:
YHErrorModel
=
YHErrorModel
(
errorCode
:
Int32
(
json
.
code
),
errorMsg
:
json
.
msg
)
callBack
(
false
,
error
)
}
}
failBlock
:
{
err
in
callBack
(
false
,
err
)
}
}
}
galaxy/galaxy/Classes/Tools/NetWork/YHAllApiName.swift
View file @
cc57a111
...
...
@@ -561,6 +561,8 @@ class YHAllApiName {
static
let
appointInfoList
=
"super-app/renewal/reservation/list"
// 提交预约
static
let
submitAppoint
=
"super-app/renewal/reservation/submit"
// 提交确认在港
static
let
confirmInHK
=
"super-app/renewal/confirm-stay-hk"
}
// 在港记录
...
...
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