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
760fecfa
Commit
760fecfa
authored
Apr 08, 2024
by
pete谢兆麟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
服务中心页框架
parent
a1fc35d6
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
541 additions
and
2 deletions
+541
-2
project.pbxproj
galaxy/galaxy.xcodeproj/project.pbxproj
+12
-0
AppDelegate.swift
galaxy/galaxy/AppDelegate.swift
+1
-1
YHStartPageViewController.swift
...lasses/Modules/Home(首页)/C/YHStartPageViewController.swift
+1
-1
YHServerHKLifeViewController.swift
...lligentService(服务中心)/C/YHServerHKLifeViewController.swift
+169
-0
YHServiceCenterMainViewController.swift
...ntService(服务中心)/C/YHServiceCenterMainViewController.swift
+7
-0
YHServiceListViewController.swift
...elligentService(服务中心)/C/YHServiceListViewController.swift
+214
-0
YHServiceViewController.swift
.../IntelligentService(服务中心)/C/YHServiceViewController.swift
+137
-0
No files found.
galaxy/galaxy.xcodeproj/project.pbxproj
View file @
760fecfa
...
@@ -20,6 +20,9 @@
...
@@ -20,6 +20,9 @@
044413F72BC2786200784A14
/* YHHomeWebViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
044413F62BC2786200784A14
/* YHHomeWebViewController.swift */
;
};
044413F72BC2786200784A14
/* YHHomeWebViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
044413F62BC2786200784A14
/* YHHomeWebViewController.swift */
;
};
044413F92BC279D200784A14
/* YHHomeWebBottomView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
044413F82BC279D200784A14
/* YHHomeWebBottomView.swift */
;
};
044413F92BC279D200784A14
/* YHHomeWebBottomView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
044413F82BC279D200784A14
/* YHHomeWebBottomView.swift */
;
};
044413FB2BC27E6F00784A14
/* YHHomeWebBottomButton.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
044413FA2BC27E6F00784A14
/* YHHomeWebBottomButton.swift */
;
};
044413FB2BC27E6F00784A14
/* YHHomeWebBottomButton.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
044413FA2BC27E6F00784A14
/* YHHomeWebBottomButton.swift */
;
};
044413FD2BC386DA00784A14
/* YHServiceViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
044413FC2BC386DA00784A14
/* YHServiceViewController.swift */
;
};
044413FF2BC391F000784A14
/* YHServiceListViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
044413FE2BC391F000784A14
/* YHServiceListViewController.swift */
;
};
044414012BC3979800784A14
/* YHServerHKLifeViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
044414002BC3979800784A14
/* YHServerHKLifeViewController.swift */
;
};
044867B42BA1953B00DFAD4A
/* YHCertificateFilterView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
044867B32BA1953B00DFAD4A
/* YHCertificateFilterView.swift */
;
};
044867B42BA1953B00DFAD4A
/* YHCertificateFilterView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
044867B32BA1953B00DFAD4A
/* YHCertificateFilterView.swift */
;
};
044867B62BA1A03800DFAD4A
/* YHCertificateFilterItemCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
044867B52BA1A03800DFAD4A
/* YHCertificateFilterItemCell.swift */
;
};
044867B62BA1A03800DFAD4A
/* YHCertificateFilterItemCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
044867B52BA1A03800DFAD4A
/* YHCertificateFilterItemCell.swift */
;
};
044867B82BA1C75700DFAD4A
/* YHCertificateUploadFailTipsView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
044867B72BA1C75700DFAD4A
/* YHCertificateUploadFailTipsView.swift */
;
};
044867B82BA1C75700DFAD4A
/* YHCertificateUploadFailTipsView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
044867B72BA1C75700DFAD4A
/* YHCertificateUploadFailTipsView.swift */
;
};
...
@@ -431,6 +434,9 @@
...
@@ -431,6 +434,9 @@
044413F62BC2786200784A14
/* YHHomeWebViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHHomeWebViewController.swift
;
sourceTree
=
"<group>"
;
};
044413F62BC2786200784A14
/* YHHomeWebViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHHomeWebViewController.swift
;
sourceTree
=
"<group>"
;
};
044413F82BC279D200784A14
/* YHHomeWebBottomView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHHomeWebBottomView.swift
;
sourceTree
=
"<group>"
;
};
044413F82BC279D200784A14
/* YHHomeWebBottomView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHHomeWebBottomView.swift
;
sourceTree
=
"<group>"
;
};
044413FA2BC27E6F00784A14
/* YHHomeWebBottomButton.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHHomeWebBottomButton.swift
;
sourceTree
=
"<group>"
;
};
044413FA2BC27E6F00784A14
/* YHHomeWebBottomButton.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHHomeWebBottomButton.swift
;
sourceTree
=
"<group>"
;
};
044413FC2BC386DA00784A14
/* YHServiceViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHServiceViewController.swift
;
sourceTree
=
"<group>"
;
};
044413FE2BC391F000784A14
/* YHServiceListViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHServiceListViewController.swift
;
sourceTree
=
"<group>"
;
};
044414002BC3979800784A14
/* YHServerHKLifeViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHServerHKLifeViewController.swift
;
sourceTree
=
"<group>"
;
};
044867B32BA1953B00DFAD4A
/* YHCertificateFilterView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHCertificateFilterView.swift
;
sourceTree
=
"<group>"
;
};
044867B32BA1953B00DFAD4A
/* YHCertificateFilterView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHCertificateFilterView.swift
;
sourceTree
=
"<group>"
;
};
044867B52BA1A03800DFAD4A
/* YHCertificateFilterItemCell.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHCertificateFilterItemCell.swift
;
sourceTree
=
"<group>"
;
};
044867B52BA1A03800DFAD4A
/* YHCertificateFilterItemCell.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHCertificateFilterItemCell.swift
;
sourceTree
=
"<group>"
;
};
044867B72BA1C75700DFAD4A
/* YHCertificateUploadFailTipsView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHCertificateUploadFailTipsView.swift
;
sourceTree
=
"<group>"
;
};
044867B72BA1C75700DFAD4A
/* YHCertificateUploadFailTipsView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHCertificateUploadFailTipsView.swift
;
sourceTree
=
"<group>"
;
};
...
@@ -2014,6 +2020,9 @@
...
@@ -2014,6 +2020,9 @@
isa
=
PBXGroup
;
isa
=
PBXGroup
;
children
=
(
children
=
(
A5ACE9192B4564F7002C94D2
/* YHServiceCenterMainViewController.swift */
,
A5ACE9192B4564F7002C94D2
/* YHServiceCenterMainViewController.swift */
,
044413FC2BC386DA00784A14
/* YHServiceViewController.swift */
,
044413FE2BC391F000784A14
/* YHServiceListViewController.swift */
,
044414002BC3979800784A14
/* YHServerHKLifeViewController.swift */
,
A514E5DB2B60A2B700C93951
/* YHServiceCenterSecondViewController.swift */
,
A514E5DB2B60A2B700C93951
/* YHServiceCenterSecondViewController.swift */
,
A5FD63BC2B623C2C00D1D9DA
/* YHInformationPerfectListVC.swift */
,
A5FD63BC2B623C2C00D1D9DA
/* YHInformationPerfectListVC.swift */
,
);
);
...
@@ -2536,6 +2545,7 @@
...
@@ -2536,6 +2545,7 @@
0425E6442BA95FE100A5E763
/* YHSchemeTableHeadView.swift in Sources */
,
0425E6442BA95FE100A5E763
/* YHSchemeTableHeadView.swift in Sources */
,
045EEEBC2B9F171A0022A143
/* YHClipperButton.swift in Sources */
,
045EEEBC2B9F171A0022A143
/* YHClipperButton.swift in Sources */
,
045EEF102B9F171A0022A143
/* YHMainApplicantInformationViewModel.swift in Sources */
,
045EEF102B9F171A0022A143
/* YHMainApplicantInformationViewModel.swift in Sources */
,
044413FF2BC391F000784A14
/* YHServiceListViewController.swift in Sources */
,
0493B3DC2BA7EFE600AF9393
/* YHCertificateSearchViewController.swift in Sources */
,
0493B3DC2BA7EFE600AF9393
/* YHCertificateSearchViewController.swift in Sources */
,
A5FD63BF2B6250BC00D1D9DA
/* YHInformationPerfectCell.swift in Sources */
,
A5FD63BF2B6250BC00D1D9DA
/* YHInformationPerfectCell.swift in Sources */
,
045EEE942B9F171A0022A143
/* YHPreviewInfoQuestionAndAnswerItemView.swift in Sources */
,
045EEE942B9F171A0022A143
/* YHPreviewInfoQuestionAndAnswerItemView.swift in Sources */
,
...
@@ -2668,6 +2678,7 @@
...
@@ -2668,6 +2678,7 @@
0493B3DE2BA80C2300AF9393
/* YHCertificateFilterButton.swift in Sources */
,
0493B3DE2BA80C2300AF9393
/* YHCertificateFilterButton.swift in Sources */
,
045EEE822B9F171A0022A143
/* YHPersonInfoIdentityCardModel.swift in Sources */
,
045EEE822B9F171A0022A143
/* YHPersonInfoIdentityCardModel.swift in Sources */
,
045EEE952B9F171A0022A143
/* YHPreviewInfoCertificateInformationItemsView.swift in Sources */
,
045EEE952B9F171A0022A143
/* YHPreviewInfoCertificateInformationItemsView.swift in Sources */
,
044413FD2BC386DA00784A14
/* YHServiceViewController.swift in Sources */
,
045EEEBB2B9F171A0022A143
/* YHWorkIntroductionTableViewCell.swift in Sources */
,
045EEEBB2B9F171A0022A143
/* YHWorkIntroductionTableViewCell.swift in Sources */
,
045EEEED2B9F171A0022A143
/* YHParentInfoVC.swift in Sources */
,
045EEEED2B9F171A0022A143
/* YHParentInfoVC.swift in Sources */
,
A5ACE9582B4564F7002C94D2
/* YHNoDataTipView.swift in Sources */
,
A5ACE9582B4564F7002C94D2
/* YHNoDataTipView.swift in Sources */
,
...
@@ -2706,6 +2717,7 @@
...
@@ -2706,6 +2717,7 @@
A5FD63CB2B63D6C300D1D9DA
/* YHInformationFillTipsCell.swift in Sources */
,
A5FD63CB2B63D6C300D1D9DA
/* YHInformationFillTipsCell.swift in Sources */
,
045EEF1F2B9F171A0022A143
/* YHDatePickView.swift in Sources */
,
045EEF1F2B9F171A0022A143
/* YHDatePickView.swift in Sources */
,
045EEE972B9F171A0022A143
/* YHPreviewInfoWorkExpView.swift in Sources */
,
045EEE972B9F171A0022A143
/* YHPreviewInfoWorkExpView.swift in Sources */
,
044414012BC3979800784A14
/* YHServerHKLifeViewController.swift in Sources */
,
04D5C5662B8ED92600190021
/* YHBaseModel.swift in Sources */
,
04D5C5662B8ED92600190021
/* YHBaseModel.swift in Sources */
,
A5F8AC082B9F414000A21EFA
/* YHCustomTextView.swift in Sources */
,
A5F8AC082B9F414000A21EFA
/* YHCustomTextView.swift in Sources */
,
A5ACE9272B4564F7002C94D2
/* YHLoginViewController.swift in Sources */
,
A5ACE9272B4564F7002C94D2
/* YHLoginViewController.swift in Sources */
,
...
...
galaxy/galaxy/AppDelegate.swift
View file @
760fecfa
...
@@ -124,7 +124,7 @@ extension AppDelegate {
...
@@ -124,7 +124,7 @@ extension AppDelegate {
private
func
setupRootVC
()
{
private
func
setupRootVC
()
{
let
tabBarController
=
YHTabBarViewController
()
let
tabBarController
=
YHTabBarViewController
()
let
v0
=
YHNavigationController
(
rootVC
:
YHHomeViewController
())
let
v0
=
YHNavigationController
(
rootVC
:
YHHomeViewController
())
let
v1
=
YHNavigationController
(
rootVC
:
YHService
CenterMain
ViewController
())
let
v1
=
YHNavigationController
(
rootVC
:
YHServiceViewController
())
let
v2
=
YHNavigationController
(
rootVC
:
YHMsgViewController
())
let
v2
=
YHNavigationController
(
rootVC
:
YHMsgViewController
())
let
v3
=
YHNavigationController
(
rootVC
:
YHMyViewController
())
let
v3
=
YHNavigationController
(
rootVC
:
YHMyViewController
())
...
...
galaxy/galaxy/Classes/Modules/Home(首页)/C/YHStartPageViewController.swift
View file @
760fecfa
...
@@ -99,7 +99,7 @@ private extension YHStartPageViewController {
...
@@ -99,7 +99,7 @@ private extension YHStartPageViewController {
func
setupRootVC
()
{
func
setupRootVC
()
{
let
tabBarController
=
YHTabBarViewController
()
let
tabBarController
=
YHTabBarViewController
()
let
v0
=
YHNavigationController
(
rootVC
:
YHHomeViewController
())
let
v0
=
YHNavigationController
(
rootVC
:
YHHomeViewController
())
let
v1
=
YHNavigationController
(
rootVC
:
YHService
CenterMain
ViewController
())
let
v1
=
YHNavigationController
(
rootVC
:
YHServiceViewController
())
let
v2
=
YHNavigationController
(
rootVC
:
YHMsgViewController
())
let
v2
=
YHNavigationController
(
rootVC
:
YHMsgViewController
())
let
v3
=
YHNavigationController
(
rootVC
:
YHMyViewController
())
let
v3
=
YHNavigationController
(
rootVC
:
YHMyViewController
())
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/C/YHServerHKLifeViewController.swift
0 → 100644
View file @
760fecfa
//
// YHServerHKLifeViewController.swift
// galaxy
//
// Created by EDY on 2024/4/8.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import
UIKit
import
JXSegmentedView
class
YHServerHKLifeViewController
:
YHBaseViewController
{
private
let
serviceCenterMainReqVM
:
YHServiceCenterMainViewModel
=
YHServiceCenterMainViewModel
()
var
homeTableView
:
UITableView
=
{
let
tableView
=
UITableView
(
frame
:
.
zero
,
style
:
.
grouped
)
tableView
.
backgroundColor
=
.
clear
tableView
.
separatorStyle
=
.
none
tableView
.
showsHorizontalScrollIndicator
=
false
tableView
.
showsVerticalScrollIndicator
=
false
tableView
.
rowHeight
=
UITableView
.
automaticDimension
tableView
.
estimatedRowHeight
=
81.0
tableView
.
register
(
YHContractCell
.
self
,
forCellReuseIdentifier
:
YHContractCell
.
cellReuseIdentifier
)
return
tableView
}()
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
setupUI
()
handleRightUI
()
}
override
func
viewWillAppear
(
_
animated
:
Bool
)
{
super
.
viewWillAppear
(
animated
)
handleRightUI
()
loadData
()
}
}
extension
YHServerHKLifeViewController
{
func
loadData
()
{
if
YHLoginManager
.
shared
.
isLogin
()
==
false
{
return
}
serviceCenterMainReqVM
.
getContactList
{
success
,
error
in
if
success
==
true
{
}
else
{
YHHUD
.
flash
(
message
:
error
?
.
errorMsg
??
"请求出错"
)
}
self
.
handleRightUI
()
}
}
func
setupUI
()
{
gk_navBarAlpha
=
0
gk_navigationBar
.
isHidden
=
true
view
.
addSubview
(
homeTableView
)
homeTableView
.
snp
.
makeConstraints
{
make
in
make
.
top
.
left
.
right
.
equalToSuperview
()
make
.
bottom
.
equalToSuperview
()
.
offset
(
-
k_Height_TabBar
)
}
homeTableView
.
delegate
=
self
homeTableView
.
dataSource
=
self
self
.
homeTableView
.
isHidden
=
true
NotificationCenter
.
default
.
addObserver
(
self
,
selector
:
#selector(
loginSuccess
)
,
name
:
YhConstant
.
YhNotification
.
didLoginSuccessNotifiction
,
object
:
nil
)
NotificationCenter
.
default
.
addObserver
(
self
,
selector
:
#selector(
logoutSuccess
)
,
name
:
YhConstant
.
YhNotification
.
didLogoutSuccessNotifiction
,
object
:
nil
)
}
}
// MARK: - UITableViewDelegate 和 UITableViewDataSource
extension
YHServerHKLifeViewController
:
UITableViewDelegate
,
UITableViewDataSource
{
func
numberOfSections
(
in
tableView
:
UITableView
)
->
Int
{
return
self
.
serviceCenterMainReqVM
.
arrContactList
.
count
}
func
tableView
(
_
tableView
:
UITableView
,
numberOfRowsInSection
section
:
Int
)
->
Int
{
return
1
}
func
tableView
(
_
tableView
:
UITableView
,
heightForHeaderInSection
section
:
Int
)
->
CGFloat
{
return
kMargin
}
func
tableView
(
_
tableView
:
UITableView
,
viewForHeaderInSection
section
:
Int
)
->
UIView
?
{
let
view
=
UIView
(
frame
:
CGRect
(
x
:
0
,
y
:
0
,
width
:
KScreenWidth
,
height
:
kMargin
))
return
view
}
func
tableView
(
_
tableView
:
UITableView
,
heightForFooterInSection
section
:
Int
)
->
CGFloat
{
return
0
}
func
tableView
(
_
tableView
:
UITableView
,
viewForFooterInSection
section
:
Int
)
->
UIView
?
{
return
UIView
()
}
func
tableView
(
_
tableView
:
UITableView
,
heightForRowAt
indexPath
:
IndexPath
)
->
CGFloat
{
return
81
}
func
tableView
(
_
tableView
:
UITableView
,
cellForRowAt
indexPath
:
IndexPath
)
->
UITableViewCell
{
let
cell0
=
tableView
.
dequeueReusableCell
(
withClass
:
YHContractCell
.
self
)
cell0
.
selectionStyle
=
.
none
if
indexPath
.
section
<
self
.
serviceCenterMainReqVM
.
arrContactList
.
count
{
cell0
.
dataModel
=
self
.
serviceCenterMainReqVM
.
arrContactList
[
indexPath
.
section
]
}
return
cell0
}
func
tableView
(
_
tableView
:
UITableView
,
didSelectRowAt
indexPath
:
IndexPath
)
{
tableView
.
deselectRow
(
at
:
indexPath
,
animated
:
true
)
printLog
(
"点击了 tableView Cell
\(
indexPath
.
section
)
"
)
//获取订单号
let
orderId
=
serviceCenterMainReqVM
.
arrContactList
[
indexPath
.
section
]
.
id
UserDefaults
.
standard
.
set
(
orderId
,
forKey
:
"orderIdForPreview"
)
UserDefaults
.
standard
.
synchronize
()
let
vc
=
YHServiceCenterSecondViewController
()
vc
.
orderId
=
orderId
vc
.
mobile
=
serviceCenterMainReqVM
.
arrContactList
[
indexPath
.
section
]
.
mobile
self
.
navigationController
?
.
pushViewController
(
vc
)
}
}
extension
YHServerHKLifeViewController
{
@objc
func
loginSuccess
()
{
printLog
(
"登录成功,进行相应的 UI刷新操作"
)
loadData
()
}
@objc
func
logoutSuccess
()
{
handleRightUI
()
}
private
func
handleRightUI
()
{
if
YHLoginManager
.
shared
.
isLogin
()
==
false
{
homeTableView
.
isHidden
=
true
}
else
{
if
serviceCenterMainReqVM
.
arrContactList
.
isEmpty
{
homeTableView
.
isHidden
=
true
}
else
{
homeTableView
.
isHidden
=
false
}
}
homeTableView
.
reloadData
()
}
}
extension
YHServerHKLifeViewController
:
JXSegmentedListContainerViewListDelegate
{
func
listView
()
->
UIView
{
return
view
}
}
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/C/YHServiceCenterMainViewController.swift
View file @
760fecfa
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
//
//
import
UIKit
import
UIKit
import
JXSegmentedView
//服务中心
//服务中心
class
YHServiceCenterMainViewController
:
YHBaseViewController
{
class
YHServiceCenterMainViewController
:
YHBaseViewController
{
...
@@ -222,3 +223,9 @@ extension YHServiceCenterMainViewController {
...
@@ -222,3 +223,9 @@ extension YHServiceCenterMainViewController {
homeTableView
.
reloadData
()
homeTableView
.
reloadData
()
}
}
}
}
extension
YHServiceCenterMainViewController
:
JXSegmentedListContainerViewListDelegate
{
func
listView
()
->
UIView
{
return
view
}
}
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/C/YHServiceListViewController.swift
0 → 100644
View file @
760fecfa
//
// YHServiceListViewController.swift
// galaxy
//
// Created by EDY on 2024/4/8.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import
UIKit
import
JXSegmentedView
class
YHServiceListViewController
:
YHBaseViewController
{
private
let
serviceCenterMainReqVM
:
YHServiceCenterMainViewModel
=
YHServiceCenterMainViewModel
()
private
let
loginTipsView
:
YHLoginTipsView
=
{
let
view
=
YHLoginTipsView
()
view
.
viewType
=
0
view
.
isHidden
=
true
return
view
}()
private
let
noDataView
:
YHLoginTipsView
=
{
let
view
=
YHLoginTipsView
()
view
.
viewType
=
1
view
.
isHidden
=
true
return
view
}()
private
func
loginOp
()
{
let
vc
=
UINavigationController
(
rootVC
:
YHPhoneLoginViewController
())
vc
.
modalPresentationStyle
=
.
custom
self
.
navigationController
?
.
present
(
vc
,
animated
:
true
)
}
var
homeTableView
:
UITableView
=
{
let
tableView
=
UITableView
(
frame
:
.
zero
,
style
:
.
grouped
)
tableView
.
backgroundColor
=
.
clear
tableView
.
separatorStyle
=
.
none
tableView
.
showsHorizontalScrollIndicator
=
false
tableView
.
showsVerticalScrollIndicator
=
false
tableView
.
rowHeight
=
UITableView
.
automaticDimension
tableView
.
estimatedRowHeight
=
81.0
tableView
.
register
(
YHContractCell
.
self
,
forCellReuseIdentifier
:
YHContractCell
.
cellReuseIdentifier
)
return
tableView
}()
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
setupUI
()
handleRightUI
()
}
override
func
viewWillAppear
(
_
animated
:
Bool
)
{
super
.
viewWillAppear
(
animated
)
handleRightUI
()
loadData
()
}
}
extension
YHServiceListViewController
{
func
loadData
()
{
if
YHLoginManager
.
shared
.
isLogin
()
==
false
{
return
}
serviceCenterMainReqVM
.
getContactList
{
success
,
error
in
if
success
==
true
{
}
else
{
YHHUD
.
flash
(
message
:
error
?
.
errorMsg
??
"请求出错"
)
}
self
.
handleRightUI
()
}
}
func
setupUI
()
{
gk_navBarAlpha
=
0
gk_navigationBar
.
isHidden
=
true
loginTipsView
.
clickLoginBtnCallBackBlock
=
{
self
.
loginOp
()
}
view
.
addSubview
(
loginTipsView
)
loginTipsView
.
snp
.
makeConstraints
{
make
in
make
.
centerX
.
equalToSuperview
()
make
.
centerY
.
equalToSuperview
()
make
.
width
.
equalTo
(
KScreenWidth
)
}
view
.
addSubview
(
noDataView
)
noDataView
.
snp
.
makeConstraints
{
make
in
make
.
centerX
.
equalToSuperview
()
make
.
centerY
.
equalToSuperview
()
make
.
width
.
equalTo
(
KScreenWidth
)
}
view
.
addSubview
(
homeTableView
)
homeTableView
.
snp
.
makeConstraints
{
make
in
make
.
top
.
left
.
right
.
equalToSuperview
()
make
.
bottom
.
equalToSuperview
()
.
offset
(
-
k_Height_TabBar
)
}
homeTableView
.
delegate
=
self
homeTableView
.
dataSource
=
self
self
.
homeTableView
.
isHidden
=
true
self
.
noDataView
.
isHidden
=
false
NotificationCenter
.
default
.
addObserver
(
self
,
selector
:
#selector(
loginSuccess
)
,
name
:
YhConstant
.
YhNotification
.
didLoginSuccessNotifiction
,
object
:
nil
)
NotificationCenter
.
default
.
addObserver
(
self
,
selector
:
#selector(
logoutSuccess
)
,
name
:
YhConstant
.
YhNotification
.
didLogoutSuccessNotifiction
,
object
:
nil
)
}
}
// MARK: - UITableViewDelegate 和 UITableViewDataSource
extension
YHServiceListViewController
:
UITableViewDelegate
,
UITableViewDataSource
{
func
numberOfSections
(
in
tableView
:
UITableView
)
->
Int
{
return
self
.
serviceCenterMainReqVM
.
arrContactList
.
count
}
func
tableView
(
_
tableView
:
UITableView
,
numberOfRowsInSection
section
:
Int
)
->
Int
{
return
1
}
func
tableView
(
_
tableView
:
UITableView
,
heightForHeaderInSection
section
:
Int
)
->
CGFloat
{
return
kMargin
}
func
tableView
(
_
tableView
:
UITableView
,
viewForHeaderInSection
section
:
Int
)
->
UIView
?
{
let
view
=
UIView
(
frame
:
CGRect
(
x
:
0
,
y
:
0
,
width
:
KScreenWidth
,
height
:
kMargin
))
return
view
}
func
tableView
(
_
tableView
:
UITableView
,
heightForFooterInSection
section
:
Int
)
->
CGFloat
{
return
0
}
func
tableView
(
_
tableView
:
UITableView
,
viewForFooterInSection
section
:
Int
)
->
UIView
?
{
return
UIView
()
}
func
tableView
(
_
tableView
:
UITableView
,
heightForRowAt
indexPath
:
IndexPath
)
->
CGFloat
{
return
81
}
func
tableView
(
_
tableView
:
UITableView
,
cellForRowAt
indexPath
:
IndexPath
)
->
UITableViewCell
{
let
cell0
=
tableView
.
dequeueReusableCell
(
withClass
:
YHContractCell
.
self
)
cell0
.
selectionStyle
=
.
none
if
indexPath
.
section
<
self
.
serviceCenterMainReqVM
.
arrContactList
.
count
{
cell0
.
dataModel
=
self
.
serviceCenterMainReqVM
.
arrContactList
[
indexPath
.
section
]
}
return
cell0
}
func
tableView
(
_
tableView
:
UITableView
,
didSelectRowAt
indexPath
:
IndexPath
)
{
tableView
.
deselectRow
(
at
:
indexPath
,
animated
:
true
)
printLog
(
"点击了 tableView Cell
\(
indexPath
.
section
)
"
)
//获取订单号
let
orderId
=
serviceCenterMainReqVM
.
arrContactList
[
indexPath
.
section
]
.
id
UserDefaults
.
standard
.
set
(
orderId
,
forKey
:
"orderIdForPreview"
)
UserDefaults
.
standard
.
synchronize
()
let
vc
=
YHServiceCenterSecondViewController
()
vc
.
orderId
=
orderId
vc
.
mobile
=
serviceCenterMainReqVM
.
arrContactList
[
indexPath
.
section
]
.
mobile
self
.
navigationController
?
.
pushViewController
(
vc
)
}
}
extension
YHServiceListViewController
{
@objc
func
loginSuccess
()
{
printLog
(
"登录成功,进行相应的 UI刷新操作"
)
loadData
()
}
@objc
func
logoutSuccess
()
{
handleRightUI
()
}
private
func
handleRightUI
()
{
if
YHLoginManager
.
shared
.
isLogin
()
==
false
{
loginTipsView
.
isHidden
=
false
noDataView
.
isHidden
=
true
homeTableView
.
isHidden
=
true
}
else
{
loginTipsView
.
isHidden
=
true
if
serviceCenterMainReqVM
.
arrContactList
.
isEmpty
{
homeTableView
.
isHidden
=
true
noDataView
.
isHidden
=
false
}
else
{
homeTableView
.
isHidden
=
false
noDataView
.
isHidden
=
true
}
}
homeTableView
.
reloadData
()
}
}
extension
YHServiceListViewController
:
JXSegmentedListContainerViewListDelegate
{
func
listView
()
->
UIView
{
return
view
}
}
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/C/YHServiceViewController.swift
0 → 100644
View file @
760fecfa
//
// YHServiceViewController.swift
// galaxy
//
// Created by EDY on 2024/4/8.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import
UIKit
import
JXSegmentedView
class
YHServiceViewController
:
YHBaseViewController
{
var
canScroll
:
Bool
=
false
{
didSet
{
for
vc
in
arrItemVCs
{
}
}
}
let
arrItemTitles
=
[
"香港身份"
,
"香港生活"
]
var
arrItemVCs
:
[
YHBaseViewController
]
=
[]
var
segmentedView
:
JXSegmentedView
=
JXSegmentedView
(
frame
:
CGRect
(
x
:
0
,
y
:
k_Height_safeAreaInsetsTop
(),
width
:
KScreenWidth
,
height
:
48
))
lazy
var
segmentedDataSource
:
JXSegmentedBaseDataSource
=
{
let
dataSource
=
JXSegmentedTitleDataSource
()
dataSource
.
isTitleColorGradientEnabled
=
true
dataSource
.
titles
=
arrItemTitles
dataSource
.
titleNormalFont
=
UIFont
.
PFSC_M
(
ofSize
:
15
)
dataSource
.
titleNormalColor
=
.
labelTextColor2
dataSource
.
titleSelectedFont
=
UIFont
.
PFSC_M
(
ofSize
:
18
)
dataSource
.
titleSelectedColor
=
.
mainTextColor
dataSource
.
isItemSpacingAverageEnabled
=
false
dataSource
.
itemWidth
=
JXSegmentedViewAutomaticDimension
dataSource
.
itemSpacing
=
90
return
dataSource
}()
//分类title 所对应的VC
lazy
var
listContainerView
:
JXSegmentedListContainerView
!
=
{
return
JXSegmentedListContainerView
(
dataSource
:
self
,
type
:
.
scrollView
)
}()
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
gk_navBarAlpha
=
0
gk_navigationBar
.
isHidden
=
true
view
.
backgroundColor
=
.
white
for
i
in
0
..<
arrItemTitles
.
count
{
if
i
==
0
{
let
vc
=
YHServiceListViewController
()
arrItemVCs
.
append
(
vc
)
}
else
{
let
vc
=
YHServerHKLifeViewController
()
arrItemVCs
.
append
(
vc
)
}
}
//segmentedViewDataSource一定要通过属性强持有!!!!!!!!!
segmentedView
.
dataSource
=
segmentedDataSource
segmentedView
.
delegate
=
self
segmentedView
.
collectionView
.
backgroundColor
=
.
white
view
.
addSubview
(
segmentedView
)
segmentedView
.
listContainer
=
listContainerView
view
.
addSubview
(
listContainerView
)
//分类Title
segmentedView
.
dataSource
=
segmentedDataSource
segmentedView
.
delegate
=
self
//配置指示器
let
indicator
=
JXSegmentedIndicatorLineView
()
indicator
.
indicatorWidth
=
16
indicator
.
indicatorColor
=
.
blue
segmentedView
.
indicators
=
[
indicator
]
segmentedView
.
backgroundColor
=
UIColor
(
red
:
0.95
,
green
:
0.95
,
blue
:
0.95
,
alpha
:
1
)
}
override
func
viewWillAppear
(
_
animated
:
Bool
)
{
super
.
viewWillAppear
(
animated
)
//处于第一个item的时候,才允许屏幕边缘手势返回
navigationController
?
.
interactivePopGestureRecognizer
?
.
isEnabled
=
(
segmentedView
.
selectedIndex
==
0
)
}
override
func
viewWillDisappear
(
_
animated
:
Bool
)
{
super
.
viewWillDisappear
(
animated
)
//离开页面的时候,需要恢复屏幕边缘手势,不能影响其他页面
navigationController
?
.
interactivePopGestureRecognizer
?
.
isEnabled
=
true
}
override
func
viewDidLayoutSubviews
()
{
super
.
viewDidLayoutSubviews
()
segmentedView
.
frame
=
CGRect
(
x
:
0
,
y
:
k_Height_safeAreaInsetsTop
(),
width
:
view
.
bounds
.
size
.
width
,
height
:
48
)
listContainerView
.
frame
=
CGRect
(
x
:
0
,
y
:
k_Height_safeAreaInsetsTop
()
+
48
,
width
:
view
.
bounds
.
size
.
width
,
height
:
view
.
bounds
.
size
.
height
-
48
-
k_Height_safeAreaInsetsTop
())
}
}
extension
YHServiceViewController
:
JXSegmentedViewDelegate
{
func
segmentedView
(
_
segmentedView
:
JXSegmentedView
,
didSelectedItemAt
index
:
Int
)
{
// NotificationCenter.default.post(name: Notification.Name(rawValue: "scrollViewDidEndDragging"), object: nil)
}
/// 正在滚动中的回调
///
/// - Parameters:
/// - segmentedView: JXSegmentedView
/// - leftIndex: 正在滚动中,相对位置处于左边的index
/// - rightIndex: 正在滚动中,相对位置处于右边的index
/// - percent: 从左往右计算的百分比
func
segmentedView
(
_
segmentedView
:
JXSegmentedView
,
scrollingFrom
leftIndex
:
Int
,
to
rightIndex
:
Int
,
percent
:
CGFloat
)
{
// NotificationCenter.default.post(name: Notification.Name(rawValue: "scrollViewWillBeginDragging"), object: nil)
}
}
extension
YHServiceViewController
:
JXSegmentedListContainerViewDataSource
{
func
numberOfLists
(
in
listContainerView
:
JXSegmentedListContainerView
)
->
Int
{
if
let
titleDataSource
=
segmentedView
.
dataSource
as?
JXSegmentedBaseDataSource
{
return
titleDataSource
.
dataSource
.
count
}
return
0
}
func
listContainerView
(
_
listContainerView
:
JXSegmentedListContainerView
,
initListAt
index
:
Int
)
->
JXSegmentedListContainerViewListDelegate
{
return
arrItemVCs
[
index
]
as!
JXSegmentedListContainerViewListDelegate
}
}
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