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
8e6715af
Commit
8e6715af
authored
Jul 18, 2024
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// 首页身份tab子页面
parent
c9f40434
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
296 additions
and
0 deletions
+296
-0
project.pbxproj
galaxy/galaxy.xcodeproj/project.pbxproj
+12
-0
YHHomeIdentityViewController.swift
...ses/Modules/Home(首页)/C/YHHomeIdentityViewController.swift
+164
-0
YHHomeIdentityCell.swift
...alaxy/Classes/Modules/Home(首页)/V/YHHomeIdentityCell.swift
+32
-0
YHIdentityTabBar.swift
.../galaxy/Classes/Modules/Home(首页)/V/YHIdentityTabBar.swift
+84
-0
UIColor+Extension.swift
...xy/galaxy/Classes/Tools/Extention/UIColor+Extension.swift
+4
-0
No files found.
galaxy/galaxy.xcodeproj/project.pbxproj
View file @
8e6715af
...
@@ -23,6 +23,9 @@
...
@@ -23,6 +23,9 @@
04174D7A2BCD5B74000BA46D
/* YHDetailMessageCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04174D722BCD5B74000BA46D
/* YHDetailMessageCell.swift */
;
};
04174D7A2BCD5B74000BA46D
/* YHDetailMessageCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04174D722BCD5B74000BA46D
/* YHDetailMessageCell.swift */
;
};
04213B202C47ADEA00797900
/* ATAuthSDK_D.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04213B1F2C47ADEA00797900
/* ATAuthSDK_D.framework */
;
};
04213B202C47ADEA00797900
/* ATAuthSDK_D.framework in Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04213B1F2C47ADEA00797900
/* ATAuthSDK_D.framework */
;
};
04213B212C47AE0100797900
/* ATAuthSDK_D.framework in Embed Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04213B1F2C47ADEA00797900
/* ATAuthSDK_D.framework */
;
settings
=
{
ATTRIBUTES
=
(
CodeSignOnCopy
,
RemoveHeadersOnCopy
,
);
};
};
04213B212C47AE0100797900
/* ATAuthSDK_D.framework in Embed Frameworks */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04213B1F2C47ADEA00797900
/* ATAuthSDK_D.framework */
;
settings
=
{
ATTRIBUTES
=
(
CodeSignOnCopy
,
RemoveHeadersOnCopy
,
);
};
};
04213B232C48B7F700797900
/* YHIdentityTabBar.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04213B222C48B7F700797900
/* YHIdentityTabBar.swift */
;
};
04213B252C48C15400797900
/* YHHomeIdentityViewController.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04213B242C48C15400797900
/* YHHomeIdentityViewController.swift */
;
};
04213B272C48C95E00797900
/* YHHomeIdentityCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
04213B262C48C95E00797900
/* YHHomeIdentityCell.swift */
;
};
0425E63D2BA9345200A5E763
/* YHSchemeTableViewCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0425E63C2BA9345200A5E763
/* YHSchemeTableViewCell.swift */
;
};
0425E63D2BA9345200A5E763
/* YHSchemeTableViewCell.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0425E63C2BA9345200A5E763
/* YHSchemeTableViewCell.swift */
;
};
0425E6402BA9357D00A5E763
/* YHScemeItemModel.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0425E63F2BA9357D00A5E763
/* YHScemeItemModel.swift */
;
};
0425E6402BA9357D00A5E763
/* YHScemeItemModel.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0425E63F2BA9357D00A5E763
/* YHScemeItemModel.swift */
;
};
0425E6422BA95B1B00A5E763
/* YHSchemeTableFooterView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0425E6412BA95B1B00A5E763
/* YHSchemeTableFooterView.swift */
;
};
0425E6422BA95B1B00A5E763
/* YHSchemeTableFooterView.swift in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
0425E6412BA95B1B00A5E763
/* YHSchemeTableFooterView.swift */
;
};
...
@@ -602,6 +605,9 @@
...
@@ -602,6 +605,9 @@
04174D712BCD5B74000BA46D
/* YHMessageSessionCell.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHMessageSessionCell.swift
;
sourceTree
=
"<group>"
;
};
04174D712BCD5B74000BA46D
/* YHMessageSessionCell.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHMessageSessionCell.swift
;
sourceTree
=
"<group>"
;
};
04174D722BCD5B74000BA46D
/* YHDetailMessageCell.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHDetailMessageCell.swift
;
sourceTree
=
"<group>"
;
};
04174D722BCD5B74000BA46D
/* YHDetailMessageCell.swift */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHDetailMessageCell.swift
;
sourceTree
=
"<group>"
;
};
04213B1F2C47ADEA00797900
/* ATAuthSDK_D.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
name
=
ATAuthSDK_D.framework
;
path
=
framework/ATAuthSDK_D.framework
;
sourceTree
=
"<group>"
;
};
04213B1F2C47ADEA00797900
/* ATAuthSDK_D.framework */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
wrapper.framework
;
name
=
ATAuthSDK_D.framework
;
path
=
framework/ATAuthSDK_D.framework
;
sourceTree
=
"<group>"
;
};
04213B222C48B7F700797900
/* YHIdentityTabBar.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHIdentityTabBar.swift
;
sourceTree
=
"<group>"
;
};
04213B242C48C15400797900
/* YHHomeIdentityViewController.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHHomeIdentityViewController.swift
;
sourceTree
=
"<group>"
;
};
04213B262C48C95E00797900
/* YHHomeIdentityCell.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHHomeIdentityCell.swift
;
sourceTree
=
"<group>"
;
};
0425E63C2BA9345200A5E763
/* YHSchemeTableViewCell.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHSchemeTableViewCell.swift
;
sourceTree
=
"<group>"
;
};
0425E63C2BA9345200A5E763
/* YHSchemeTableViewCell.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHSchemeTableViewCell.swift
;
sourceTree
=
"<group>"
;
};
0425E63F2BA9357D00A5E763
/* YHScemeItemModel.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHScemeItemModel.swift
;
sourceTree
=
"<group>"
;
};
0425E63F2BA9357D00A5E763
/* YHScemeItemModel.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHScemeItemModel.swift
;
sourceTree
=
"<group>"
;
};
0425E6412BA95B1B00A5E763
/* YHSchemeTableFooterView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHSchemeTableFooterView.swift
;
sourceTree
=
"<group>"
;
};
0425E6412BA95B1B00A5E763
/* YHSchemeTableFooterView.swift */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
sourcecode.swift
;
path
=
YHSchemeTableFooterView.swift
;
sourceTree
=
"<group>"
;
};
...
@@ -2524,6 +2530,7 @@
...
@@ -2524,6 +2530,7 @@
A567E57A2BD7643D00D5D5A0
/* YHConfigManager.swift */
,
A567E57A2BD7643D00D5D5A0
/* YHConfigManager.swift */
,
A567E5762BD7643D00D5D5A0
/* YHHomePageViewController.swift */
,
A567E5762BD7643D00D5D5A0
/* YHHomePageViewController.swift */
,
A5000F502C3BC28B00843452
/* YHHomeHoldViewPageViewController.swift */
,
A5000F502C3BC28B00843452
/* YHHomeHoldViewPageViewController.swift */
,
04213B242C48C15400797900
/* YHHomeIdentityViewController.swift */
,
);
);
path
=
C
;
path
=
C
;
sourceTree
=
"<group>"
;
sourceTree
=
"<group>"
;
...
@@ -2559,6 +2566,8 @@
...
@@ -2559,6 +2566,8 @@
A566A7992C219FA400980D06
/* YHHomeSalonAreaView.swift */
,
A566A7992C219FA400980D06
/* YHHomeSalonAreaView.swift */
,
A566A79B2C227C9B00980D06
/* YHOrderTipsItemView.swift */
,
A566A79B2C227C9B00980D06
/* YHOrderTipsItemView.swift */
,
04C85DE02C3677CB008B20D6
/* YHConsultantQRCodeView.swift */
,
04C85DE02C3677CB008B20D6
/* YHConsultantQRCodeView.swift */
,
04213B222C48B7F700797900
/* YHIdentityTabBar.swift */
,
04213B262C48C95E00797900
/* YHHomeIdentityCell.swift */
,
);
);
path
=
V
;
path
=
V
;
sourceTree
=
"<group>"
;
sourceTree
=
"<group>"
;
...
@@ -3206,6 +3215,7 @@
...
@@ -3206,6 +3215,7 @@
045EEEF62B9F171A0022A143
/* YHSpousePrimaryInfoVC.swift in Sources */
,
045EEEF62B9F171A0022A143
/* YHSpousePrimaryInfoVC.swift in Sources */
,
044867B82BA1C75700DFAD4A
/* YHCertificateUploadFailTipsView.swift in Sources */
,
044867B82BA1C75700DFAD4A
/* YHCertificateUploadFailTipsView.swift in Sources */
,
044D0C062C22736F00C5CF5E
/* YHSetExplainView.swift in Sources */
,
044D0C062C22736F00C5CF5E
/* YHSetExplainView.swift in Sources */
,
04213B252C48C15400797900
/* YHHomeIdentityViewController.swift in Sources */
,
045EEF002B9F171A0022A143
/* YHFormItemEnterDetailCell.swift in Sources */
,
045EEF002B9F171A0022A143
/* YHFormItemEnterDetailCell.swift in Sources */
,
04FB01CE2C23DDBD0040115D
/* YHPeopleMatchNoDataView.swift in Sources */
,
04FB01CE2C23DDBD0040115D
/* YHPeopleMatchNoDataView.swift in Sources */
,
A5ACE9362B4564F7002C94D2
/* YHNetworkStatusManager.swift in Sources */
,
A5ACE9362B4564F7002C94D2
/* YHNetworkStatusManager.swift in Sources */
,
...
@@ -3248,6 +3258,7 @@
...
@@ -3248,6 +3258,7 @@
04B9EE5B2C06CC3100A4018D
/* YHOtherLoginViewController.swift in Sources */
,
04B9EE5B2C06CC3100A4018D
/* YHOtherLoginViewController.swift in Sources */
,
045EEF0C2B9F171A0022A143
/* YHBasicInfoFillBottomView.swift in Sources */
,
045EEF0C2B9F171A0022A143
/* YHBasicInfoFillBottomView.swift in Sources */
,
A5ACE93D2B4564F7002C94D2
/* UIButton+Extension.swift in Sources */
,
A5ACE93D2B4564F7002C94D2
/* UIButton+Extension.swift in Sources */
,
04213B232C48B7F700797900
/* YHIdentityTabBar.swift in Sources */
,
04F5F86C2C1A9B52004A463C
/* YHOtherServiceListViewController.swift in Sources */
,
04F5F86C2C1A9B52004A463C
/* YHOtherServiceListViewController.swift in Sources */
,
04CC2EF02BC3DDB2000305DD
/* YHServiceBannerView.swift in Sources */
,
04CC2EF02BC3DDB2000305DD
/* YHServiceBannerView.swift in Sources */
,
045EEEA32B9F171A0022A143
/* YHCompanyModel.swift in Sources */
,
045EEEA32B9F171A0022A143
/* YHCompanyModel.swift in Sources */
,
...
@@ -3475,6 +3486,7 @@
...
@@ -3475,6 +3486,7 @@
045EEECF2B9F171A0022A143
/* YHScoreOptionsView.swift in Sources */
,
045EEECF2B9F171A0022A143
/* YHScoreOptionsView.swift in Sources */
,
04CE1AD22C2AD91F001CB80A
/* YHActivityModel.swift in Sources */
,
04CE1AD22C2AD91F001CB80A
/* YHActivityModel.swift in Sources */
,
0445E6AF2BE9CFF6003C52F9
/* YHAppVersionForceUpdateView.swift in Sources */
,
0445E6AF2BE9CFF6003C52F9
/* YHAppVersionForceUpdateView.swift in Sources */
,
04213B272C48C95E00797900
/* YHHomeIdentityCell.swift in Sources */
,
04CE1AD32C2AD91F001CB80A
/* YHTravelModel.swift in Sources */
,
04CE1AD32C2AD91F001CB80A
/* YHTravelModel.swift in Sources */
,
04B9EE5A2C06CC3100A4018D
/* YHCodeSueecssViewController.swift in Sources */
,
04B9EE5A2C06CC3100A4018D
/* YHCodeSueecssViewController.swift in Sources */
,
045EEEC12B9F171A0022A143
/* YHOtherInfoFillModel.swift in Sources */
,
045EEEC12B9F171A0022A143
/* YHOtherInfoFillModel.swift in Sources */
,
...
...
galaxy/galaxy/Classes/Modules/Home(首页)/C/YHHomeIdentityViewController.swift
0 → 100644
View file @
8e6715af
//
// YHHomeIdentityViewController.swift
// galaxy
//
// Created by edy on 2024/7/18.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import
UIKit
import
JXSegmentedView
class
YHHomeIdentityViewController
:
YHBaseViewController
{
lazy
var
subTabBar
:
YHIdentityTabBar
=
{
let
items
=
[
YHIdentityTabBarItem
(
title
:
"优才"
,
type
:
.
talent
),
YHIdentityTabBarItem
(
title
:
"高才"
,
type
:
.
high
),
YHIdentityTabBarItem
(
title
:
"专才"
,
type
:
.
expert
),
YHIdentityTabBarItem
(
title
:
"留学"
,
type
:
.
study
)]
let
bar
=
YHIdentityTabBar
.
tabBarForItems
(
items
)
bar
.
selectBlock
=
{
[
weak
self
]
type
in
guard
let
self
=
self
else
{
return
}
}
return
bar
}()
lazy
var
tableView
:
UITableView
=
{
let
tableView
=
UITableView
(
frame
:
CGRect
.
zero
,
style
:
.
grouped
)
tableView
.
contentInsetAdjustmentBehavior
=
.
never
tableView
.
showsVerticalScrollIndicator
=
false
tableView
.
backgroundColor
=
UIColor
.
white
tableView
.
separatorStyle
=
.
none
tableView
.
register
(
YHHomeIdentityCell
.
self
,
forCellReuseIdentifier
:
YHHomeIdentityCell
.
cellReuseIdentifier
)
tableView
.
delegate
=
self
tableView
.
dataSource
=
self
tableView
.
tableHeaderView
=
self
.
headerView
return
tableView
}()
lazy
var
headerView
:
UIView
=
{
let
view
=
UIView
(
frame
:
CGRectMake
(
0
,
0
,
KScreenWidth
,
KScreenWidth
+
44.0
+
8.0
))
view
.
backgroundColor
=
.
white
let
imgView
=
UIImageView
()
imgView
.
backgroundColor
=
.
red
view
.
addSubview
(
imgView
)
imgView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
top
.
right
.
equalToSuperview
()
make
.
height
.
equalTo
(
imgView
.
snp
.
width
)
}
self
.
segmentedView
.
dataSource
=
segmentedDataSource
view
.
addSubview
(
self
.
segmentedView
)
segmentedView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
right
.
equalToSuperview
()
make
.
height
.
equalTo
(
44
)
make
.
top
.
equalTo
(
imgView
.
snp
.
bottom
)
.
offset
(
8.0
)
}
return
view
}()
lazy
var
segmentedView
:
JXSegmentedView
=
{
let
segmentedView
=
JXSegmentedView
(
frame
:
CGRect
(
x
:
0
,
y
:
0
,
width
:
KScreenWidth
,
height
:
44
))
segmentedView
.
delegate
=
self
//配置指示器
let
indicator
=
JXSegmentedIndicatorLineView
()
indicator
.
indicatorWidth
=
16
indicator
.
indicatorHeight
=
2
indicator
.
indicatorCornerRadius
=
0.0
indicator
.
indicatorColor
=
.
brandMainColor
segmentedView
.
indicators
=
[
indicator
]
segmentedView
.
defaultSelectedIndex
=
0
return
segmentedView
}()
lazy
var
segmentedDataSource
:
JXSegmentedTitleDataSource
=
{
let
dataSource
=
JXSegmentedTitleDataSource
()
dataSource
.
titles
=
[
"项目介绍"
,
"申请条件"
,
"申请流程"
,
"费用详情"
]
dataSource
.
titleNormalFont
=
UIFont
.
PFSC_R
(
ofSize
:
16
)
dataSource
.
titleNormalColor
=
UIColor
.
init
(
hex
:
0x94A3B8
)
dataSource
.
titleSelectedFont
=
UIFont
.
PFSC_M
(
ofSize
:
16
)
dataSource
.
titleSelectedColor
=
.
mainTextColor
dataSource
.
itemWidth
=
JXSegmentedViewAutomaticDimension
dataSource
.
itemSpacing
=
22.0
return
dataSource
}()
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
view
.
backgroundColor
=
.
white
createUI
()
}
func
createUI
()
{
self
.
view
.
addSubview
(
self
.
tableView
)
self
.
view
.
addSubview
(
self
.
subTabBar
)
self
.
subTabBar
.
snp
.
makeConstraints
{
make
in
make
.
top
.
equalTo
(
k_Height_NavigationtBarAndStatuBar
)
make
.
left
.
equalTo
(
20
)
make
.
right
.
equalTo
(
-
20
)
make
.
height
.
equalTo
(
44
)
}
self
.
tableView
.
snp
.
makeConstraints
{
make
in
make
.
top
.
equalTo
(
k_Height_NavigationtBarAndStatuBar
+
44
)
make
.
left
.
right
.
bottom
.
equalToSuperview
()
}
}
func
scrollViewDidScroll
(
_
scrollView
:
UIScrollView
)
{
printLog
(
"offset:
\(
scrollView
.
contentOffset
.
y
)
"
)
}
}
extension
YHHomeIdentityViewController
:
JXSegmentedViewDelegate
{
func
segmentedView
(
_
segmentedView
:
JXSegmentedView
,
didSelectedItemAt
index
:
Int
)
{
let
sectionRect
=
self
.
tableView
.
rectForHeader
(
inSection
:
index
)
printLog
(
"sectionRect:
\(
sectionRect
)
"
)
self
.
tableView
.
scrollToRow
(
at
:
IndexPath
(
row
:
0
,
section
:
index
),
at
:
.
top
,
animated
:
true
)
// DispatchQueue.main.asyncAfter(deadline: .now() + 0.2, execute: {
// var gap = 0.0
// // 此处处理内容总长度不够滚到相应tab的差距
// let sectionRect = self.tableView.rectForHeader(inSection: index)
// if self.tableView.contentOffset.y >= 0.0, sectionRect.origin.y > self.tableView.contentOffset.y {
// gap = sectionRect.origin.y - self.tableView.contentOffset.y
// }
// let offsetY = self.tableView.contentOffset.y + gap
// self.tableView.setContentOffset(CGPointMake(0, offsetY+4), animated: true)
// })
}
}
extension
YHHomeIdentityViewController
:
UITableViewDataSource
,
UITableViewDelegate
{
func
tableView
(
_
tableView
:
UITableView
,
cellForRowAt
indexPath
:
IndexPath
)
->
UITableViewCell
{
let
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
YHHomeIdentityCell
.
cellReuseIdentifier
,
for
:
indexPath
)
as!
YHHomeIdentityCell
return
cell
}
func
tableView
(
_
tableView
:
UITableView
,
heightForRowAt
indexPath
:
IndexPath
)
->
CGFloat
{
return
300
}
func
numberOfSections
(
in
tableView
:
UITableView
)
->
Int
{
return
4
}
func
tableView
(
_
tableView
:
UITableView
,
numberOfRowsInSection
section
:
Int
)
->
Int
{
return
1
}
func
tableView
(
_
tableView
:
UITableView
,
heightForHeaderInSection
section
:
Int
)
->
CGFloat
{
return
0.01
}
func
tableView
(
_
tableView
:
UITableView
,
heightForFooterInSection
section
:
Int
)
->
CGFloat
{
return
0.01
}
func
tableView
(
_
tableView
:
UITableView
,
viewForHeaderInSection
section
:
Int
)
->
UIView
?
{
return
UIView
()
}
func
tableView
(
_
tableView
:
UITableView
,
viewForFooterInSection
section
:
Int
)
->
UIView
?
{
return
UIView
()
}
}
galaxy/galaxy/Classes/Modules/Home(首页)/V/YHHomeIdentityCell.swift
0 → 100644
View file @
8e6715af
//
// YHHomeIdentityCell.swift
// galaxy
//
// Created by edy on 2024/7/18.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import
UIKit
class
YHHomeIdentityCell
:
UITableViewCell
{
static
let
cellReuseIdentifier
=
"YHHomeIdentityCell"
override
init
(
style
:
UITableViewCell
.
CellStyle
,
reuseIdentifier
:
String
?)
{
super
.
init
(
style
:
style
,
reuseIdentifier
:
reuseIdentifier
)
setupUI
()
}
required
init
?(
coder
:
NSCoder
)
{
fatalError
(
"init(coder:) has not been implemented"
)
}
func
setupUI
()
{
let
randomRed
=
CGFloat
.
random
(
in
:
0
...
1
)
let
randomGreen
=
CGFloat
.
random
(
in
:
0
...
1
)
let
randomBlue
=
CGFloat
.
random
(
in
:
0
...
1
)
let
randomColor
=
UIColor
(
displayP3Red
:
randomRed
,
green
:
randomGreen
,
blue
:
randomBlue
,
alpha
:
1.0
)
self
.
contentView
.
backgroundColor
=
randomColor
}
}
galaxy/galaxy/Classes/Modules/Home(首页)/V/YHIdentityTabBar.swift
0 → 100644
View file @
8e6715af
//
// YHIdentityTabBar.swift
// galaxy
//
// Created by edy on 2024/7/18.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import
UIKit
enum
YHIdentityTabBarType
:
Int
{
case
none
=
0
case
talent
=
1
// 优才
case
high
=
2
// 高才
case
expert
=
3
// 专才
case
study
=
4
// 留学
}
class
YHIdentityTabBarItem
{
var
title
:
String
=
""
var
type
:
YHIdentityTabBarType
=
.
none
init
(
title
:
String
,
type
:
YHIdentityTabBarType
)
{
self
.
title
=
title
self
.
type
=
type
}
}
class
YHIdentityTabBar
:
UIView
{
static
let
baseTag
=
9527
static
let
itemWidth
=
50.0
static
let
itemHeight
=
26.0
static
let
gap
=
10.0
var
selectType
:
YHIdentityTabBarType
=
.
talent
var
selectBlock
:((
YHIdentityTabBarType
)
->
Void
)?
static
func
tabBarForItems
(
_
items
:
[
YHIdentityTabBarItem
])
->
YHIdentityTabBar
{
let
width
=
Self
.
itemWidth
*
Double
(
items
.
count
)
+
Self
.
gap
*
Double
(
items
.
count
-
1
)
let
bar
=
YHIdentityTabBar
(
frame
:
CGRect
(
x
:
0
,
y
:
0
,
width
:
width
,
height
:
44.0
))
bar
.
updateItems
(
items
)
return
bar
}
func
updateItems
(
_
items
:
[
YHIdentityTabBarItem
])
{
self
.
removeSubviews
()
for
(
index
,
item
)
in
items
.
enumerated
()
{
let
x
=
(
Self
.
itemWidth
+
Self
.
gap
)
*
Double
(
index
)
let
btn
=
UIButton
(
type
:
.
custom
)
btn
.
titleLabel
?
.
font
=
UIFont
.
PFSC_R
(
ofSize
:
13
)
btn
.
setTitle
(
item
.
title
,
for
:
.
normal
)
btn
.
layer
.
borderWidth
=
0.5
self
.
setButton
(
btn
,
isSelected
:
index
==
0
)
btn
.
tag
=
Self
.
baseTag
+
index
+
1
btn
.
addTarget
(
self
,
action
:
#selector(
didTabButtonClicked(_:)
)
,
for
:
.
touchUpInside
)
self
.
addSubview
(
btn
)
btn
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
x
)
make
.
centerY
.
equalToSuperview
()
make
.
width
.
equalTo
(
Self
.
itemWidth
)
make
.
height
.
equalTo
(
Self
.
itemHeight
)
}
}
}
func
setButton
(
_
btn
:
UIButton
,
isSelected
:
Bool
)
{
let
titleColor
=
isSelected
?
UIColor
.
mainTextColor
:
UIColor
.
mainTextColor50
let
borderColor
=
isSelected
?
UIColor
.
mainTextColor
:
UIColor
.
mainTextColor
(
alpha
:
0.18
)
btn
.
setTitleColor
(
titleColor
,
for
:
.
normal
)
btn
.
layer
.
borderColor
=
borderColor
.
cgColor
}
@objc
func
didTabButtonClicked
(
_
selectBtn
:
UIButton
)
{
self
.
selectType
=
YHIdentityTabBarType
(
rawValue
:
selectBtn
.
tag
-
Self
.
baseTag
)
??
.
talent
for
(
index
,
item
)
in
self
.
subviews
.
enumerated
()
{
if
item
.
isKind
(
of
:
UIButton
.
self
)
{
let
itemBtn
=
item
as!
UIButton
self
.
setButton
(
itemBtn
,
isSelected
:
itemBtn
.
tag
==
selectBtn
.
tag
)
}
}
self
.
selectBlock
?(
self
.
selectType
)
}
}
galaxy/galaxy/Classes/Tools/Extention/UIColor+Extension.swift
View file @
8e6715af
...
@@ -42,6 +42,10 @@ extension UIColor {
...
@@ -42,6 +42,10 @@ extension UIColor {
static
let
mainTextColor50
:
UIColor
=
UIColor
(
hexString
:
"#121A26"
,
transparency
:
0.5
)
!
static
let
mainTextColor50
:
UIColor
=
UIColor
(
hexString
:
"#121A26"
,
transparency
:
0.5
)
!
static
let
mainTextColor70
:
UIColor
=
UIColor
(
hexString
:
"#121A26"
,
transparency
:
0.7
)
!
static
let
mainTextColor70
:
UIColor
=
UIColor
(
hexString
:
"#121A26"
,
transparency
:
0.7
)
!
public
static
func
mainTextColor
(
alpha
:
CGFloat
)
->
UIColor
{
return
UIColor
(
hexString
:
"#121A26"
,
transparency
:
alpha
)
!
}
//次内容一
//次内容一
static
let
subTextColor
:
UIColor
=
UIColor
(
hexString
:
"#4E4E4E"
)
!
static
let
subTextColor
:
UIColor
=
UIColor
(
hexString
:
"#4E4E4E"
)
!
...
...
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