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
acbc09fd
Commit
acbc09fd
authored
Jan 02, 2025
by
pete谢兆麟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
首页bug修复
parent
de5a8d9e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
14 deletions
+40
-14
YHSelectViewController.swift
.../Modules/Home(首页)/YHSelect/C/YHSelectViewController.swift
+15
-13
YHSelectLookHeadView.swift
...es/Modules/Home(首页)/YHSelect/V/YHSelectLookHeadView.swift
+25
-1
No files found.
galaxy/galaxy/Classes/Modules/Home(首页)/YHSelect/C/YHSelectViewController.swift
View file @
acbc09fd
...
@@ -39,6 +39,11 @@ class YHSelectViewController: YHBaseViewController {
...
@@ -39,6 +39,11 @@ class YHSelectViewController: YHBaseViewController {
self
.
viewModel
.
getLiveList
{[
weak
self
]
success
,
error
in
self
.
viewModel
.
getLiveList
{[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
guard
let
self
=
self
else
{
return
}
self
.
sectionView
.
items
=
self
.
viewModel
.
liveArr
self
.
sectionView
.
items
=
self
.
viewModel
.
liveArr
if
self
.
viewModel
.
liveArr
.
count
==
0
{
sectionView
.
frame
=
CGRect
(
x
:
0
,
y
:
0
,
width
:
KScreenWidth
,
height
:
0
)
}
else
{
sectionView
.
frame
=
CGRect
(
x
:
0
,
y
:
0
,
width
:
KScreenWidth
,
height
:
92
)
}
}
}
}
}
...
@@ -93,16 +98,6 @@ extension YHSelectViewController {
...
@@ -93,16 +98,6 @@ extension YHSelectViewController {
}
}
}
}
}
}
self
.
viewModel
.
getLiveList
{[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
self
.
sectionView
.
items
=
self
.
viewModel
.
liveArr
if
self
.
viewModel
.
liveArr
.
count
==
0
{
sectionView
.
frame
=
CGRect
(
x
:
0
,
y
:
0
,
width
:
KScreenWidth
,
height
:
0
)
}
else
{
sectionView
.
frame
=
CGRect
(
x
:
0
,
y
:
0
,
width
:
KScreenWidth
,
height
:
92
)
}
}
}
}
func
setupUI
()
{
func
setupUI
()
{
...
@@ -122,11 +117,18 @@ extension YHSelectViewController {
...
@@ -122,11 +117,18 @@ extension YHSelectViewController {
head
.
frame
=
CGRect
(
x
:
0
,
y
:
0
,
width
:
KScreenWidth
,
height
:
66
)
head
.
frame
=
CGRect
(
x
:
0
,
y
:
0
,
width
:
KScreenWidth
,
height
:
66
)
head
.
block
=
{
index
in
head
.
block
=
{
index
in
self
.
selectItem
=
index
self
.
selectItem
=
index
self
.
updataData
()
self
.
buttonItem
=
0
DispatchQueue
.
main
.
asyncAfter
(
deadline
:
.
now
()
+
0.3
)
{
self
.
updataData
()
self
.
tableView
.
contentOffset
=
CGPoint
(
x
:
0
,
y
:
92
)
}
}
}
head
.
buttonBlock
=
{
index
in
head
.
buttonBlock
=
{
index
in
self
.
buttonItem
=
index
self
.
buttonItem
=
index
self
.
updataData
()
DispatchQueue
.
main
.
asyncAfter
(
deadline
:
.
now
()
+
0.3
)
{
self
.
updataData
()
self
.
tableView
.
contentOffset
=
CGPoint
(
x
:
0
,
y
:
92
)
}
}
}
return
head
return
head
}()
}()
...
...
galaxy/galaxy/Classes/Modules/Home(首页)/YHSelect/V/YHSelectLookHeadView.swift
View file @
acbc09fd
...
@@ -15,7 +15,29 @@ class YHSelectLookHeadView: UIView {
...
@@ -15,7 +15,29 @@ class YHSelectLookHeadView: UIView {
var
normalButton
:
UIButton
!
var
normalButton
:
UIButton
!
var
hotButton
:
UIButton
!
var
hotButton
:
UIButton
!
var
priceButton
:
UIButton
!
var
priceButton
:
UIButton
!
var
buttonIndex
=
0
var
buttonIndex
=
0
{
didSet
{
if
buttonIndex
==
0
{
normalButton
.
isSelected
=
true
hotButton
.
isSelected
=
false
priceButton
.
isSelected
=
false
}
else
if
buttonIndex
==
1
{
normalButton
.
isSelected
=
false
hotButton
.
isSelected
=
true
priceButton
.
isSelected
=
false
}
else
if
buttonIndex
==
2
{
normalButton
.
isSelected
=
false
hotButton
.
isSelected
=
false
priceButton
.
isSelected
=
true
priceButton
.
setImage
(
UIImage
(
named
:
"home_select_icon_select"
),
for
:
.
selected
)
}
else
if
buttonIndex
==
3
{
normalButton
.
isSelected
=
false
hotButton
.
isSelected
=
false
priceButton
.
isSelected
=
true
priceButton
.
setImage
(
UIImage
(
named
:
"home_select_icon_select_two"
),
for
:
.
selected
)
}
}
}
var
items
:
[
String
]
=
[]
{
var
items
:
[
String
]
=
[]
{
didSet
{
didSet
{
self
.
myCollectView
.
reloadData
()
self
.
myCollectView
.
reloadData
()
...
@@ -76,6 +98,7 @@ class YHSelectLookHeadView: UIView {
...
@@ -76,6 +98,7 @@ class YHSelectLookHeadView: UIView {
button
.
setTitleColor
(
UIColor
.
brandMainColor
,
for
:
.
selected
)
button
.
setTitleColor
(
UIColor
.
brandMainColor
,
for
:
.
selected
)
// button.setImage(UIImage(named: "home_select_icon_select"), for: .selected)
// button.setImage(UIImage(named: "home_select_icon_select"), for: .selected)
button
.
addTarget
(
self
,
action
:
#selector(
normalClick
)
,
for
:
.
touchUpInside
)
button
.
addTarget
(
self
,
action
:
#selector(
normalClick
)
,
for
:
.
touchUpInside
)
button
.
isSelected
=
true
return
button
return
button
}()
}()
addSubview
(
normalButton
)
addSubview
(
normalButton
)
...
@@ -186,6 +209,7 @@ extension YHSelectLookHeadView: UICollectionViewDelegate, UICollectionViewDataSo
...
@@ -186,6 +209,7 @@ extension YHSelectLookHeadView: UICollectionViewDelegate, UICollectionViewDataSo
func
collectionView
(
_
collectionView
:
UICollectionView
,
didSelectItemAt
indexPath
:
IndexPath
)
{
func
collectionView
(
_
collectionView
:
UICollectionView
,
didSelectItemAt
indexPath
:
IndexPath
)
{
selectIndex
=
indexPath
.
row
selectIndex
=
indexPath
.
row
buttonIndex
=
0
collectionView
.
reloadData
()
collectionView
.
reloadData
()
if
let
block
=
block
{
if
let
block
=
block
{
block
(
indexPath
.
row
)
block
(
indexPath
.
row
)
...
...
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