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
f0efb0d0
Commit
f0efb0d0
authored
Apr 08, 2024
by
pete谢兆麟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
加载按钮
parent
ca8706e5
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
293 additions
and
29 deletions
+293
-29
project.pbxproj
galaxy/galaxy.xcodeproj/project.pbxproj
+8
-0
YHServerHKLifeViewController.swift
...lligentService(服务中心)/C/YHServerHKLifeViewController.swift
+11
-24
YHMyDocumentsDetailViewController.swift
...Documents(我的文书)/C/YHMyDocumentsDetailViewController.swift
+2
-0
YHServerTableHeadView.swift
...es/IntelligentService(服务中心)/V/YHServerTableHeadView.swift
+4
-5
YHServiceBannerView.swift
...ules/IntelligentService(服务中心)/V/YHServiceBannerView.swift
+136
-0
YHServiceSectionView.swift
...les/IntelligentService(服务中心)/V/YHServiceSectionView.swift
+132
-0
No files found.
galaxy/galaxy.xcodeproj/project.pbxproj
View file @
f0efb0d0
...
...
@@ -231,6 +231,7 @@
049537852BA9B28500AF7E59
/* YHCertificateTemplateCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
049537842BA9B28500AF7E59
/* YHCertificateTemplateCell.swift */
;
};
049A48A82B49417300D0C641
/* YHAboutUsViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
049A48A72B49417300D0C641
/* YHAboutUsViewController.swift */
;
};
049A48AA2B49536000D0C641
/* YHAboutUsAdvantageCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
049A48A92B49536000D0C641
/* YHAboutUsAdvantageCell.swift */
;
};
049AC4C62BC3E55300F857F4
/* YHServiceSectionView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
049AC4C52BC3E55300F857F4
/* YHServiceSectionView.swift */
;
};
04A271232BABFF3200652B1B
/* YHCertificateUploadTypeCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04A271222BABFF3200652B1B
/* YHCertificateUploadTypeCell.swift */
;
};
04A271252BAC33BB00652B1B
/* YHFilePreviewTool.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04A271242BAC33BB00652B1B
/* YHFilePreviewTool.swift */
;
};
04A671592B9F18C800C1FB91
/* YHCertificateUploadSheetView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04A671582B9F18C800C1FB91
/* YHCertificateUploadSheetView.swift */
;
};
...
...
@@ -250,6 +251,7 @@
04C693622B723AB8004C1758
/* YHMySettingViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04C693612B723AB8004C1758
/* YHMySettingViewController.swift */
;
};
04C693642B723B56004C1758
/* YHMySettingCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04C693632B723B56004C1758
/* YHMySettingCell.swift */
;
};
04C8F4832B7216D800ADF59B
/* YHUserInfoHeaderView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04C8F4822B7216D800ADF59B
/* YHUserInfoHeaderView.swift */
;
};
04CC2EF02BC3DDB2000305DD
/* YHServiceBannerView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04CC2EEF2BC3DDB2000305DD
/* YHServiceBannerView.swift */
;
};
04D5C5662B8ED92600190021
/* YHBaseModel.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04D5C5652B8ED92600190021
/* YHBaseModel.swift */
;
};
04E86E092B707ACE00A35F4B
/* YHPhoneLoginViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04E86E082B707ACE00A35F4B
/* YHPhoneLoginViewController.swift */
;
};
04E86E0B2B70C13300A35F4B
/* YHCodeSueecssViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04E86E0A2B70C13300A35F4B
/* YHCodeSueecssViewController.swift */
;
};
...
...
@@ -653,6 +655,7 @@
049537842BA9B28500AF7E59
/* YHCertificateTemplateCell.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHCertificateTemplateCell.swift
;
sourceTree
=
"<group>"
;
};
049A48A72B49417300D0C641
/* YHAboutUsViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHAboutUsViewController.swift
;
sourceTree
=
"<group>"
;
};
049A48A92B49536000D0C641
/* YHAboutUsAdvantageCell.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHAboutUsAdvantageCell.swift
;
sourceTree
=
"<group>"
;
};
049AC4C52BC3E55300F857F4
/* YHServiceSectionView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHServiceSectionView.swift
;
sourceTree
=
"<group>"
;
};
04A271222BABFF3200652B1B
/* YHCertificateUploadTypeCell.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHCertificateUploadTypeCell.swift
;
sourceTree
=
"<group>"
;
};
04A271242BAC33BB00652B1B
/* YHFilePreviewTool.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHFilePreviewTool.swift
;
sourceTree
=
"<group>"
;
};
04A671582B9F18C800C1FB91
/* YHCertificateUploadSheetView.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHCertificateUploadSheetView.swift
;
sourceTree
=
"<group>"
;
};
...
...
@@ -673,6 +676,7 @@
04C693612B723AB8004C1758
/* YHMySettingViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHMySettingViewController.swift
;
sourceTree
=
"<group>"
;
};
04C693632B723B56004C1758
/* YHMySettingCell.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHMySettingCell.swift
;
sourceTree
=
"<group>"
;
};
04C8F4822B7216D800ADF59B
/* YHUserInfoHeaderView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHUserInfoHeaderView.swift
;
sourceTree
=
"<group>"
;
};
04CC2EEF2BC3DDB2000305DD
/* YHServiceBannerView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHServiceBannerView.swift
;
sourceTree
=
"<group>"
;
};
04D5C5652B8ED92600190021
/* YHBaseModel.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHBaseModel.swift
;
sourceTree
=
"<group>"
;
};
04E86E082B707ACE00A35F4B
/* YHPhoneLoginViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHPhoneLoginViewController.swift
;
sourceTree
=
"<group>"
;
};
04E86E0A2B70C13300A35F4B
/* YHCodeSueecssViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHCodeSueecssViewController.swift
;
sourceTree
=
"<group>"
;
};
...
...
@@ -2056,9 +2060,11 @@
A5FD63C82B63A35B00D1D9DA
/* YHInformationFillTipsAlertView.swift */
,
A5FD63CA2B63D6C300D1D9DA
/* YHInformationFillTipsCell.swift */
,
044414022BC39B8D00784A14
/* YHServerTableHeadView.swift */
,
049AC4C52BC3E55300F857F4
/* YHServiceSectionView.swift */
,
044414042BC3B9DE00784A14
/* YHServiceTableFootView.swift */
,
044414062BC3C54B00784A14
/* YHHomeCollectionViewCell.swift */
,
044414082BC3CE8500784A14
/* YHHomeCollectionLayout.swift */
,
04CC2EEF2BC3DDB2000305DD
/* YHServiceBannerView.swift */
,
);
path
=
V
;
sourceTree
=
"<group>"
;
...
...
@@ -2435,6 +2441,7 @@
045EEE8D2B9F171A0022A143
/* YHPreviewInfoCell.swift in Sources */
,
045EEF0C2B9F171A0022A143
/* YHBasicInfoFillBottomView.swift in Sources */
,
A5ACE93D2B4564F7002C94D2
/* UIButton+Extension.swift in Sources */
,
04CC2EF02BC3DDB2000305DD
/* YHServiceBannerView.swift in Sources */
,
045EEEA32B9F171A0022A143
/* YHCompanyModel.swift in Sources */
,
045EEEC62B9F171A0022A143
/* YHOtherTextViewItemView.swift in Sources */
,
044413F72BC2786200784A14
/* YHHomeWebViewController.swift in Sources */
,
...
...
@@ -2526,6 +2533,7 @@
04C693642B723B56004C1758
/* YHMySettingCell.swift in Sources */
,
A5FD63C92B63A35B00D1D9DA
/* YHInformationFillTipsAlertView.swift in Sources */
,
045EEEE32B9F171A0022A143
/* YHMySignatureListModel.swift in Sources */
,
049AC4C62BC3E55300F857F4
/* YHServiceSectionView.swift in Sources */
,
A582B2432BB95E20009D098C
/* YHHKPlanCell.swift in Sources */
,
045EEEC52B9F171A0022A143
/* YHOtherPickerView.swift in Sources */
,
045EEE842B9F171A0022A143
/* YHPreviewBasiceInformationViewController.swift in Sources */
,
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/C/YHServerHKLifeViewController.swift
View file @
f0efb0d0
...
...
@@ -14,9 +14,10 @@ class YHServerHKLifeViewController: YHBaseViewController {
private
let
serviceCenterMainReqVM
:
YHServiceCenterMainViewModel
=
YHServiceCenterMainViewModel
()
var
tableHeadView
:
YHServerTableHeadView
!
var
tableFootView
:
YHServiceTableFootView
!
var
sectionView
:
YHServiceSectionView
!
var
homeTableView
:
UITableView
=
{
let
tableView
=
UITableView
(
frame
:
.
zero
,
style
:
.
grouped
)
let
tableView
=
UITableView
(
frame
:
.
zero
,
style
:
.
plain
)
tableView
.
backgroundColor
=
.
clear
tableView
.
separatorStyle
=
.
none
tableView
.
showsHorizontalScrollIndicator
=
false
...
...
@@ -60,10 +61,14 @@ extension YHServerHKLifeViewController {
gk_navBarAlpha
=
0
gk_navigationBar
.
isHidden
=
true
sectionView
=
{
let
view
=
YHServiceSectionView
()
return
view
}()
tableHeadView
=
YHServerTableHeadView
()
tableHeadView
.
frame
=
CGRect
(
x
:
0
,
y
:
0
,
width
:
KScreenWidth
,
height
:
365
)
tableFootView
=
YHServiceTableFootView
()
// tableFootView.frame = CGRect(x: 0, y: 0, width: KScreenWidth, height: KScreenHeight - k_Height_safeAreaInsetsTop() - 48 - k_Height_TabBar)
tableFootView
.
frame
=
CGRect
(
x
:
0
,
y
:
0
,
width
:
KScreenWidth
,
height
:
KScreenHeight
)
view
.
addSubview
(
homeTableView
)
homeTableView
.
tableHeaderView
=
tableHeadView
...
...
@@ -96,12 +101,11 @@ extension YHServerHKLifeViewController : UITableViewDelegate,UITableViewDataSour
}
func
tableView
(
_
tableView
:
UITableView
,
heightForHeaderInSection
section
:
Int
)
->
CGFloat
{
return
kMargin
return
48
}
func
tableView
(
_
tableView
:
UITableView
,
viewForHeaderInSection
section
:
Int
)
->
UIView
?
{
let
view
=
UIView
(
frame
:
CGRect
(
x
:
0
,
y
:
0
,
width
:
KScreenWidth
,
height
:
kMargin
))
return
view
return
sectionView
}
func
tableView
(
_
tableView
:
UITableView
,
heightForFooterInSection
section
:
Int
)
->
CGFloat
{
...
...
@@ -114,33 +118,16 @@ extension YHServerHKLifeViewController : UITableViewDelegate,UITableViewDataSour
func
tableView
(
_
tableView
:
UITableView
,
heightForRowAt
indexPath
:
IndexPath
)
->
CGFloat
{
return
8
1
return
0.
1
}
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
]
}
let
cell0
=
UITableViewCell
()
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
)
}
}
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/MyDocuments(我的文书)/C/YHMyDocumentsDetailViewController.swift
View file @
f0efb0d0
...
...
@@ -290,7 +290,9 @@ class YHMyDocumentsDetailViewController: YHBaseViewController {
func
showSureAlert
()
{
YHCommonAlertView
.
show
(
""
,
"请确认是否已完成编辑并提交"
,
"取消"
,
"确认"
)
{[
weak
self
]
in
guard
let
self
=
self
else
{
return
}
YHHUD
.
show
(
.
progress
(
message
:
""
))
self
.
viewModel
.
requestDocumentSubmit
(
"
\(
self
.
id
)
"
)
{[
weak
self
]
success
,
error
in
YHHUD
.
hide
()
guard
let
self
=
self
else
{
return
}
if
success
{
YHHUD
.
flash
(
message
:
"提交成功"
)
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/V/YHServerTableHeadView.swift
View file @
f0efb0d0
...
...
@@ -9,8 +9,8 @@
import
UIKit
class
YHServerTableHeadView
:
UIView
{
var
search
:
UI
View
!
var
bannarView
:
UI
View
!
var
search
:
YHHomeSearch
View
!
var
bannarView
:
YHServiceBanner
View
!
var
titleLabel
:
UILabel
!
var
dataSource
:
YHScemeHeadModel
?
{
...
...
@@ -30,7 +30,7 @@ class YHServerTableHeadView: UIView {
func
setUpView
()
{
search
=
{
let
view
=
UI
View
()
let
view
=
YHHomeSearch
View
()
return
view
}()
addSubview
(
search
)
...
...
@@ -42,8 +42,7 @@ class YHServerTableHeadView: UIView {
}
bannarView
=
{
let
view
=
UIView
()
view
.
backgroundColor
=
.
white
let
view
=
YHServiceBannerView
()
return
view
}()
addSubview
(
bannarView
)
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/V/YHServiceBannerView.swift
0 → 100644
View file @
f0efb0d0
//
// YHServiceBannerView.swift
// galaxy
//
// Created by EDY on 2024/4/8.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import
UIKit
import
FSPagerView
class
YHServiceBannerView
:
UIView
{
// 位置、大小、图片、文本
fileprivate
var
dataArr
:
[
YHBannerModel
]
=
[
YHBannerModel
(),
YHBannerModel
(),
YHBannerModel
(),
YHBannerModel
(),
YHBannerModel
()]
override
init
(
frame
:
CGRect
)
{
super
.
init
(
frame
:
frame
)
initView
()
}
required
init
?(
coder
:
NSCoder
)
{
fatalError
(
"init(coder:) has not been implemented"
)
}
private
lazy
var
bannerView
:
FSPagerView
=
{
let
view
=
FSPagerView
()
view
.
delegate
=
self
view
.
dataSource
=
self
view
.
automaticSlidingInterval
=
3
view
.
register
(
FSPagerViewCell
.
self
,
forCellWithReuseIdentifier
:
"cell"
)
view
.
itemSize
=
FSPagerView
.
automaticSize
view
.
interitemSpacing
=
10
return
view
}()
lazy
var
pageControl
:
FSPageControl
=
{
let
view
=
FSPageControl
()
return
view
}()
}
private
extension
YHServiceBannerView
{
func
initView
()
{
addSubview
(
bannerView
)
bannerView
.
snp
.
makeConstraints
{
make
in
make
.
top
.
left
.
right
.
bottom
.
equalToSuperview
()
}
bannerView
.
addSubview
(
pageControl
)
pageControl
.
snp
.
makeConstraints
{
make
in
make
.
left
.
bottom
.
right
.
equalToSuperview
()
make
.
height
.
equalTo
(
25
)
}
setupPageControl
()
bannerView
.
reloadData
()
}
func
setupPageControl
()
{
self
.
pageControl
.
numberOfPages
=
self
.
dataArr
.
count
self
.
pageControl
.
contentHorizontalAlignment
=
.
center
self
.
pageControl
.
contentInsets
=
UIEdgeInsets
(
top
:
0
,
left
:
12
,
bottom
:
10
,
right
:
12
)
let
normalImage
=
UIImage
(
color
:
UIColor
(
hex
:
0xff0000
,
alpha
:
1.0
),
size
:
CGSize
(
width
:
5
,
height
:
5
))
let
selectImage
=
UIImage
(
color
:
.
white
,
size
:
CGSize
(
width
:
8
,
height
:
5
))
self
.
pageControl
.
setImage
(
normalImage
,
for
:
.
normal
)
self
.
pageControl
.
setImage
(
selectImage
,
for
:
.
selected
)
self
.
pageControl
.
interitemSpacing
=
3
}
}
extension
YHServiceBannerView
:
FSPagerViewDataSource
,
FSPagerViewDelegate
{
public
func
numberOfItems
(
in
pagerView
:
FSPagerView
)
->
Int
{
return
self
.
dataArr
.
count
}
public
func
pagerView
(
_
pagerView
:
FSPagerView
,
cellForItemAt
index
:
Int
)
->
FSPagerViewCell
{
let
cell
=
pagerView
.
dequeueReusableCell
(
withReuseIdentifier
:
"cell"
,
at
:
index
)
let
image
=
UIImage
(
named
:
"default_placeholder_image"
)?
.
bs_scaled
(
toWidth
:
UIDevice
.
kScreenW
-
16*
2
,
opaque
:
false
)
cell
.
imageView
?
.
image
=
image
if
index
<
dataArr
.
count
{
let
model
=
dataArr
[
index
]
if
let
url
=
URL
(
string
:
model
.
img_url
)
{
cell
.
imageView
?
.
kf
.
setImage
(
with
:
url
)
}
cell
.
textLabel
?
.
text
=
model
.
title
}
cell
.
imageView
?
.
contentMode
=
.
scaleAspectFill
cell
.
backgroundColor
=
.
contentBkgColor
cell
.
contentView
.
layer
.
shadowColor
=
UIColor
.
clear
.
cgColor
return
cell
}
// MARK: - FSPagerView Delegate
func
pagerView
(
_
pagerView
:
FSPagerView
,
didSelectItemAt
index
:
Int
)
{
pagerView
.
deselectItem
(
at
:
index
,
animated
:
true
)
pagerView
.
scrollToItem
(
at
:
index
,
animated
:
true
)
if
index
>=
dataArr
.
count
{
return
}
let
model
=
dataArr
[
index
]
switch
model
.
link_type
{
case
10
:
//跳转H5
// let vc = BsWebViewController()
// vc.urlString = model.link_url
// UIViewController.navTopViewController?.navigationController?.pushViewController(vc, animated: true)
break
case
20
:
//跳转原生页面
if
let
vc
=
UIViewController
.
classFromString
(
model
.
link_url
)
{
UIViewController
.
navTopViewController
?
.
navigationController
?
.
pushViewController
(
vc
,
animated
:
true
)
}
break
default
:
break
}
}
func
pagerViewWillEndDragging
(
_
pagerView
:
FSPagerView
,
targetIndex
:
Int
)
{
self
.
pageControl
.
currentPage
=
targetIndex
}
func
pagerViewDidEndScrollAnimation
(
_
pagerView
:
FSPagerView
)
{
self
.
pageControl
.
currentPage
=
pagerView
.
currentIndex
}
}
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/V/YHServiceSectionView.swift
0 → 100644
View file @
f0efb0d0
//
// YHServiceSectionView.swift
// galaxy
//
// Created by EDY on 2024/4/8.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import
UIKit
class
YHServiceSectionView
:
UIView
{
var
items
:
[
String
]
=
[]
lazy
var
myCollectView
=
{
// 设置布局方向
let
flowLayout
=
UICollectionViewFlowLayout
()
flowLayout
.
itemSize
=
CGSize
(
width
:
75
,
height
:
32
)
flowLayout
.
minimumInteritemSpacing
=
12.0
flowLayout
.
minimumLineSpacing
=
12.0
flowLayout
.
scrollDirection
=
.
horizontal
let
collectinoView
=
UICollectionView
(
frame
:
.
zero
,
collectionViewLayout
:
flowLayout
)
collectinoView
.
backgroundColor
=
.
white
collectinoView
.
contentInset
=
UIEdgeInsets
(
top
:
10
,
left
:
20
,
bottom
:
0
,
right
:
20
)
collectinoView
.
register
(
YHServiceSectionCollectionViewCell
.
self
,
forCellWithReuseIdentifier
:
YHServiceSectionCollectionViewCell
.
cellReuseIdentifier
)
collectinoView
.
delegate
=
self
collectinoView
.
dataSource
=
self
collectinoView
.
showsVerticalScrollIndicator
=
false
collectinoView
.
translatesAutoresizingMaskIntoConstraints
=
false
collectinoView
.
alwaysBounceVertical
=
true
return
collectinoView
}()
var
dataSource
:
YHScemeHeadModel
?
{
didSet
{
updateAllViews
()
}
}
override
init
(
frame
:
CGRect
)
{
super
.
init
(
frame
:
frame
)
backgroundColor
=
.
white
setUpView
()
self
.
items
=
[
"优才"
,
"高才"
,
"留学"
,
"专才"
]
self
.
myCollectView
.
reloadData
()
}
required
init
?(
coder
:
NSCoder
)
{
fatalError
(
"init(coder:) has not been implemented"
)
}
func
setUpView
()
{
backgroundColor
=
.
white
addSubview
(
myCollectView
)
myCollectView
.
snp
.
makeConstraints
{
make
in
make
.
top
.
left
.
right
.
bottom
.
equalToSuperview
()
}
// self.myCollectView.es.addInfiniteScrolling {
// self.loadFakeData()
// }
}
func
updateAllViews
()
{
guard
let
model
=
dataSource
else
{
return
}
}
}
extension
YHServiceSectionView
:
UICollectionViewDelegate
,
UICollectionViewDataSource
{
func
collectionView
(
_
collectionView
:
UICollectionView
,
numberOfItemsInSection
section
:
Int
)
->
Int
{
return
items
.
count
}
func
collectionView
(
_
collectionView
:
UICollectionView
,
cellForItemAt
indexPath
:
IndexPath
)
->
UICollectionViewCell
{
let
cell
=
collectionView
.
dequeueReusableCell
(
withReuseIdentifier
:
YHServiceSectionCollectionViewCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHServiceSectionCollectionViewCell
cell
.
dataSource
=
items
[
indexPath
.
row
]
return
cell
}
private
func
collectionView
(
collectionView
:
UICollectionView
,
didSelectItemAtIndexPath
indexPath
:
NSIndexPath
)
{
print
(
"index is
\(
indexPath
.
row
)
"
)
}
}
class
YHServiceSectionCollectionViewCell
:
UICollectionViewCell
{
static
let
cellReuseIdentifier
=
"YHServiceSectionCollectionViewCell"
var
dataSource
:
String
?
{
didSet
{
updataAllSubViews
()
}
}
lazy
var
descripeLable
:
UILabel
=
{
let
label
=
UILabel
()
label
.
text
=
"赴港"
label
.
textColor
=
UIColor
(
hex
:
0x94a3bb
)
label
.
font
=
UIFont
.
PFSC_R
(
ofSize
:
13
)
label
.
textAlignment
=
.
center
return
label
}()
required
init
?(
coder
:
NSCoder
)
{
super
.
init
(
coder
:
coder
)
}
override
init
(
frame
:
CGRect
)
{
super
.
init
(
frame
:
frame
)
setupUI
()
}
private
func
setupUI
()
{
contentView
.
backgroundColor
=
UIColor
(
hex
:
0xf4f6fa
)
contentView
.
clipsToBounds
=
true
contentView
.
layer
.
cornerRadius
=
16
contentView
.
addSubview
(
descripeLable
)
descripeLable
.
snp
.
makeConstraints
{
make
in
make
.
top
.
left
.
right
.
bottom
.
equalToSuperview
()
}
}
func
updataAllSubViews
()
{
guard
let
dataSource
=
dataSource
else
{
return
}
descripeLable
.
text
=
dataSource
}
}
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