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
1e2f37ef
Commit
1e2f37ef
authored
Jul 31, 2024
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// 资讯身份无数据优化
parent
909ba335
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
7 deletions
+62
-7
.gitignore
galaxy/.gitignore
+1
-0
YHHomeIdentityViewController.swift
...ses/Modules/Home(首页)/C/YHHomeIdentityViewController.swift
+19
-0
YHHomeInformationViewController.swift
.../Modules/Home(首页)/C/YHHomeInformationViewController.swift
+42
-7
No files found.
galaxy/.gitignore
View file @
1e2f37ef
...
...
@@ -37,6 +37,7 @@ xcuserdata/
*.ipa
*.dSYM.zip
*.dSYM
*.zip
## Playgrounds
timeline.xctimeline
...
...
galaxy/galaxy/Classes/Modules/Home(首页)/C/YHHomeIdentityViewController.swift
View file @
1e2f37ef
...
...
@@ -43,6 +43,14 @@ class YHHomeIdentityViewController: YHBaseViewController {
return
view
}()
lazy
var
noDataView
:
YHEmptyDataView
=
{
let
view
=
YHEmptyDataView
.
createView
(
"暂无内容"
,
kEmptyCommonBgName
)
view
.
backgroundColor
=
.
white
view
.
topMargin
=
150
view
.
isHidden
=
true
return
view
}()
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
createUI
()
...
...
@@ -55,6 +63,8 @@ class YHHomeIdentityViewController: YHBaseViewController {
self
.
view
.
addSubview
(
self
.
scrollView
)
self
.
view
.
addSubview
(
self
.
subTabBar
)
self
.
view
.
addSubview
(
self
.
noDataView
)
self
.
subTabBar
.
snp
.
makeConstraints
{
make
in
make
.
top
.
equalToSuperview
()
make
.
left
.
equalTo
(
20
)
...
...
@@ -65,6 +75,10 @@ class YHHomeIdentityViewController: YHBaseViewController {
make
.
top
.
equalTo
(
self
.
subTabBar
.
snp
.
bottom
)
make
.
left
.
right
.
bottom
.
equalToSuperview
()
}
self
.
noDataView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
right
.
top
.
bottom
.
equalToSuperview
()
}
}
override
func
viewWillDisappear
(
_
animated
:
Bool
)
{
...
...
@@ -94,6 +108,11 @@ extension YHHomeIdentityViewController {
[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
if
!
success
{
self
.
view
.
bringSubviewToFront
(
self
.
noDataView
)
self
.
noDataView
.
isHidden
=
false
}
subTabArr
.
removeAll
()
for
item
in
self
.
viewModel
.
categoryArr
{
if
let
item
=
item
{
...
...
galaxy/galaxy/Classes/Modules/Home(首页)/C/YHHomeInformationViewController.swift
View file @
1e2f37ef
...
...
@@ -33,28 +33,61 @@ class YHHomeInformationViewController: YHBaseViewController {
collectinoView
.
alwaysBounceVertical
=
true
collectinoView
.
showsVerticalScrollIndicator
=
false
collectinoView
.
es
.
addYHPullToRefresh
{
self
.
getClassifies
()
self
.
getTheNewestInfoList
(
isFirstPage
:
true
)
self
.
requetData
()
}
collectinoView
.
es
.
addInfiniteScrolling
{
self
.
getTheNewestInfoList
(
isFirstPage
:
false
)
self
.
getTheNewestInfoList
(
isFirstPage
:
false
,
completion
:
nil
)
}
return
collectinoView
}()
lazy
var
noDataView
:
YHEmptyDataView
=
{
let
view
=
YHEmptyDataView
.
createView
(
"暂无内容"
,
kEmptyCommonBgName
)
view
.
backgroundColor
=
.
white
view
.
topMargin
=
150
view
.
isHidden
=
true
return
view
}()
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
gk_navigationBar
.
isHidden
=
true
self
.
view
.
backgroundColor
=
.
white
self
.
view
.
addSubview
(
self
.
collectView
)
self
.
view
.
addSubview
(
self
.
noDataView
)
self
.
collectView
.
snp
.
makeConstraints
{
make
in
make
.
top
.
equalTo
(
10
)
make
.
bottom
.
equalToSuperview
()
make
.
left
.
equalTo
(
20
)
make
.
right
.
equalTo
(
-
20
)
}
self
.
getClassifies
()
self
.
getTheNewestInfoList
(
isFirstPage
:
true
)
self
.
noDataView
.
snp
.
makeConstraints
{
make
in
make
.
left
.
right
.
top
.
bottom
.
equalToSuperview
()
}
requetData
()
}
func
requetData
()
{
let
ossGroup
=
DispatchGroup
()
ossGroup
.
enter
()
self
.
getClassifies
{
ossGroup
.
leave
()
}
ossGroup
.
enter
()
self
.
getTheNewestInfoList
(
isFirstPage
:
true
)
{
ossGroup
.
leave
()
}
ossGroup
.
notify
(
queue
:
.
main
)
{
let
count
=
self
.
viewModel
.
arrHomeNewsData
?
.
count
??
0
if
count
<=
0
,
self
.
sectionItems
.
count
<=
0
{
self
.
noDataView
.
isHidden
=
true
}
else
{
self
.
noDataView
.
isHidden
=
false
}
}
}
}
...
...
@@ -145,15 +178,16 @@ extension YHHomeInformationViewController: JXSegmentedListContainerViewListDeleg
extension
YHHomeInformationViewController
{
// 获取栏目
func
getClassifies
()
{
func
getClassifies
(
_
completion
:
(()
->
())?
)
{
self
.
viewModel
.
getHomeInfoClassifies
{
success
,
error
in
self
.
sectionItems
.
removeAll
()
self
.
sectionItems
.
append
(
contentsOf
:
self
.
viewModel
.
classifyArr
)
self
.
collectView
.
reloadData
()
completion
?()
}
}
// 获取最新资讯
func
getTheNewestInfoList
(
isFirstPage
:
Bool
)
{
func
getTheNewestInfoList
(
isFirstPage
:
Bool
,
completion
:
(()
->
())?
)
{
self
.
viewModel
.
getList
(
isFirsPage
:
isFirstPage
)
{
success
,
error
in
self
.
collectView
.
reloadData
()
self
.
collectView
.
es
.
stopPullToRefresh
()
...
...
@@ -162,6 +196,7 @@ extension YHHomeInformationViewController {
self
.
collectView
.
es
.
noticeNoMoreData
()
self
.
collectView
.
footer
?
.
alpha
=
1
}
completion
?()
}
}
}
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