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
73df3ce1
Commit
73df3ce1
authored
Jul 19, 2024
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// 首页资讯
parent
b178d6f1
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
42 additions
and
3 deletions
+42
-3
YHHomeIdentityViewController.swift
...ses/Modules/Home(首页)/C/YHHomeIdentityViewController.swift
+1
-0
YHHomeInfoDetailContainerViewController.swift
.../Home(首页)/C/YHHomeInfoDetailContainerViewController.swift
+5
-0
YHHomeInfoDetailViewController.swift
...s/Modules/Home(首页)/C/YHHomeInfoDetailViewController.swift
+18
-1
YHHomeInformationViewController.swift
.../Modules/Home(首页)/C/YHHomeInformationViewController.swift
+4
-0
YHHomeInfoSectionCell.swift
...xy/Classes/Modules/Home(首页)/V/YHHomeInfoSectionCell.swift
+1
-0
YHHomeInfoSectionHeadView.swift
...lasses/Modules/Home(首页)/V/YHHomeInfoSectionHeadView.swift
+8
-1
YHHomePageViewModel.swift
...axy/Classes/Modules/Home(首页)/VM/YHHomePageViewModel.swift
+5
-1
No files found.
galaxy/galaxy/Classes/Modules/Home(首页)/C/YHHomeIdentityViewController.swift
View file @
73df3ce1
...
@@ -91,6 +91,7 @@ class YHHomeIdentityViewController: YHBaseViewController {
...
@@ -91,6 +91,7 @@ class YHHomeIdentityViewController: YHBaseViewController {
}
}
func
createUI
()
{
func
createUI
()
{
gk_navigationBar
.
isHidden
=
true
self
.
view
.
addSubview
(
self
.
tableView
)
self
.
view
.
addSubview
(
self
.
tableView
)
self
.
view
.
addSubview
(
self
.
subTabBar
)
self
.
view
.
addSubview
(
self
.
subTabBar
)
self
.
subTabBar
.
snp
.
makeConstraints
{
make
in
self
.
subTabBar
.
snp
.
makeConstraints
{
make
in
...
...
galaxy/galaxy/Classes/Modules/Home(首页)/C/YHHomeInfoDetailContainerViewController.swift
View file @
73df3ce1
...
@@ -12,6 +12,8 @@ import JXSegmentedView
...
@@ -12,6 +12,8 @@ import JXSegmentedView
class
YHHomeInfoDetailContainerViewController
:
YHBaseViewController
{
class
YHHomeInfoDetailContainerViewController
:
YHBaseViewController
{
var
customTitle
:
String
=
""
var
customTitle
:
String
=
""
var
classifyId
:
Int
=
0
var
isHaveHot
:
Bool
=
true
// 是否有精品
var
isHaveHot
:
Bool
=
true
// 是否有精品
lazy
var
tabTitles
:
[
String
]
=
{
lazy
var
tabTitles
:
[
String
]
=
{
if
isHaveHot
{
if
isHaveHot
{
...
@@ -24,9 +26,12 @@ class YHHomeInfoDetailContainerViewController: YHBaseViewController {
...
@@ -24,9 +26,12 @@ class YHHomeInfoDetailContainerViewController: YHBaseViewController {
let
vc1
=
YHHomeInfoDetailViewController
()
let
vc1
=
YHHomeInfoDetailViewController
()
vc1
.
isHot
=
false
vc1
.
isHot
=
false
vc1
.
isShowTab
=
self
.
isHaveHot
vc1
.
isShowTab
=
self
.
isHaveHot
vc1
.
classifyId
=
self
.
classifyId
let
vc2
=
YHHomeInfoDetailViewController
()
let
vc2
=
YHHomeInfoDetailViewController
()
vc2
.
isHot
=
true
vc2
.
isHot
=
true
vc2
.
isShowTab
=
self
.
isHaveHot
vc2
.
isShowTab
=
self
.
isHaveHot
vc2
.
classifyId
=
self
.
classifyId
if
isHaveHot
{
if
isHaveHot
{
return
[
vc1
,
vc2
]
return
[
vc1
,
vc2
]
...
...
galaxy/galaxy/Classes/Modules/Home(首页)/C/YHHomeInfoDetailViewController.swift
View file @
73df3ce1
...
@@ -12,6 +12,7 @@ import JXSegmentedView
...
@@ -12,6 +12,7 @@ import JXSegmentedView
class
YHHomeInfoDetailViewController
:
YHBaseViewController
{
class
YHHomeInfoDetailViewController
:
YHBaseViewController
{
var
isHot
:
Bool
=
false
// 是否是精品
var
isHot
:
Bool
=
false
// 是否是精品
var
classifyId
:
Int
=
0
var
isShowTab
:
Bool
=
true
var
isShowTab
:
Bool
=
true
lazy
var
viewModel
:
YHHomePageViewModel
=
{
lazy
var
viewModel
:
YHHomePageViewModel
=
{
let
viewModel
=
YHHomePageViewModel
()
let
viewModel
=
YHHomePageViewModel
()
...
@@ -40,6 +41,14 @@ class YHHomeInfoDetailViewController: YHBaseViewController {
...
@@ -40,6 +41,14 @@ class YHHomeInfoDetailViewController: YHBaseViewController {
return
collectinoView
return
collectinoView
}()
}()
lazy
var
emptyDataTipsView
:
YHEmptyDataView
=
{
let
view
=
YHEmptyDataView
.
createView
(
"暂无内容"
,
kEmptyCommonBgName
)
let
topMargin
=
310
-
k_Height_NavigationtBarAndStatuBar
view
.
topMargin
=
topMargin
view
.
isHidden
=
true
return
view
}()
override
func
viewDidLoad
()
{
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
self
.
setupUI
()
self
.
setupUI
()
...
@@ -50,11 +59,15 @@ class YHHomeInfoDetailViewController: YHBaseViewController {
...
@@ -50,11 +59,15 @@ class YHHomeInfoDetailViewController: YHBaseViewController {
gk_navigationBar
.
isHidden
=
true
gk_navigationBar
.
isHidden
=
true
self
.
view
.
backgroundColor
=
.
white
self
.
view
.
backgroundColor
=
.
white
self
.
view
.
addSubview
(
self
.
collectView
)
self
.
view
.
addSubview
(
self
.
collectView
)
self
.
view
.
addSubview
(
self
.
emptyDataTipsView
)
self
.
collectView
.
snp
.
makeConstraints
{
make
in
self
.
collectView
.
snp
.
makeConstraints
{
make
in
make
.
top
.
bottom
.
equalToSuperview
()
make
.
top
.
bottom
.
equalToSuperview
()
make
.
left
.
equalTo
(
20
)
make
.
left
.
equalTo
(
20
)
make
.
right
.
equalTo
(
-
20
)
make
.
right
.
equalTo
(
-
20
)
}
}
self
.
emptyDataTipsView
.
snp
.
makeConstraints
{
make
in
make
.
edges
.
equalToSuperview
()
}
}
}
}
}
...
@@ -121,7 +134,8 @@ extension YHHomeInfoDetailViewController: JXSegmentedListContainerViewListDelega
...
@@ -121,7 +134,8 @@ extension YHHomeInfoDetailViewController: JXSegmentedListContainerViewListDelega
extension
YHHomeInfoDetailViewController
{
extension
YHHomeInfoDetailViewController
{
// 获取最新资讯
// 获取最新资讯
func
getTheNewestInfoList
(
isFirstPage
:
Bool
)
{
func
getTheNewestInfoList
(
isFirstPage
:
Bool
)
{
self
.
viewModel
.
getList
(
isFirsPage
:
isFirstPage
,
isHot
:
self
.
isHot
)
{
success
,
error
in
let
haveHot
=
self
.
isHot
?
self
.
isHot
:
nil
self
.
viewModel
.
getList
(
isFirsPage
:
isFirstPage
,
isHot
:
haveHot
,
classifyId
:
classifyId
)
{
success
,
error
in
self
.
collectView
.
reloadData
()
self
.
collectView
.
reloadData
()
self
.
collectView
.
es
.
stopPullToRefresh
()
self
.
collectView
.
es
.
stopPullToRefresh
()
self
.
collectView
.
es
.
stopLoadingMore
()
self
.
collectView
.
es
.
stopLoadingMore
()
...
@@ -129,6 +143,9 @@ extension YHHomeInfoDetailViewController {
...
@@ -129,6 +143,9 @@ extension YHHomeInfoDetailViewController {
self
.
collectView
.
es
.
noticeNoMoreData
()
self
.
collectView
.
es
.
noticeNoMoreData
()
self
.
collectView
.
footer
?
.
alpha
=
1
self
.
collectView
.
footer
?
.
alpha
=
1
}
}
let
count
=
self
.
viewModel
.
arrHomeNewsData
?
.
count
??
0
self
.
emptyDataTipsView
.
isHidden
=
(
count
>
0
)
self
.
collectView
.
isHidden
=
(
count
<=
0
)
}
}
}
}
}
}
...
...
galaxy/galaxy/Classes/Modules/Home(首页)/C/YHHomeInformationViewController.swift
View file @
73df3ce1
...
@@ -44,6 +44,7 @@ class YHHomeInformationViewController: YHBaseViewController {
...
@@ -44,6 +44,7 @@ class YHHomeInformationViewController: YHBaseViewController {
override
func
viewDidLoad
()
{
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
gk_navigationBar
.
isHidden
=
true
self
.
view
.
backgroundColor
=
.
white
self
.
view
.
backgroundColor
=
.
white
self
.
view
.
addSubview
(
self
.
collectView
)
self
.
view
.
addSubview
(
self
.
collectView
)
self
.
collectView
.
snp
.
makeConstraints
{
make
in
self
.
collectView
.
snp
.
makeConstraints
{
make
in
...
@@ -122,6 +123,9 @@ extension YHHomeInformationViewController : CollectionViewWaterfallLayoutDelegat
...
@@ -122,6 +123,9 @@ extension YHHomeInformationViewController : CollectionViewWaterfallLayoutDelegat
func
collectionView
(
_
collectionView
:
UICollectionView
,
layout
:
UICollectionViewLayout
,
heightForHeaderInSection
section
:
Int
)
->
Float
{
func
collectionView
(
_
collectionView
:
UICollectionView
,
layout
:
UICollectionViewLayout
,
heightForHeaderInSection
section
:
Int
)
->
Float
{
if
self
.
sectionItems
.
count
<=
0
{
return
0.0
}
var
row
=
self
.
sectionItems
.
count
/
3
var
row
=
self
.
sectionItems
.
count
/
3
if
row
%
3
!=
0
{
if
row
%
3
!=
0
{
row
=
row
+
1
row
=
row
+
1
...
...
galaxy/galaxy/Classes/Modules/Home(首页)/V/YHHomeInfoSectionCell.swift
View file @
73df3ce1
...
@@ -23,6 +23,7 @@ class YHHomeInfoSectionCell: UICollectionViewCell {
...
@@ -23,6 +23,7 @@ class YHHomeInfoSectionCell: UICollectionViewCell {
lazy
var
imgView
:
UIImageView
=
{
lazy
var
imgView
:
UIImageView
=
{
let
imgV
=
UIImageView
(
image
:
UIImage
(
named
:
"global_default_image"
))
let
imgV
=
UIImageView
(
image
:
UIImage
(
named
:
"global_default_image"
))
imgV
.
clipsToBounds
=
true
return
imgV
return
imgV
}()
}()
...
...
galaxy/galaxy/Classes/Modules/Home(首页)/V/YHHomeInfoSectionHeadView.swift
View file @
73df3ce1
...
@@ -18,15 +18,21 @@ class YHHomeInfoSectionHeadView: UICollectionReusableView {
...
@@ -18,15 +18,21 @@ class YHHomeInfoSectionHeadView: UICollectionReusableView {
var
items
:[
YHHomeInfoClassifyModel
?]
=
[]
{
var
items
:[
YHHomeInfoClassifyModel
?]
=
[]
{
didSet
{
didSet
{
self
.
collectView
.
reloadData
()
var
row
=
items
.
count
/
3
var
row
=
items
.
count
/
3
if
row
%
3
!=
0
{
if
row
%
3
!=
0
{
row
=
row
+
1
row
=
row
+
1
}
}
let
totalHeight
=
Double
(
row
)
*
kHomeItemHeight
let
totalHeight
=
Double
(
row
)
*
kHomeItemHeight
self
.
collectView
.
reloadData
()
self
.
collectView
.
snp
.
updateConstraints
{
make
in
self
.
collectView
.
snp
.
updateConstraints
{
make
in
make
.
height
.
equalTo
(
totalHeight
)
make
.
height
.
equalTo
(
totalHeight
)
}
}
self
.
bottomLineView
.
snp
.
updateConstraints
{
make
in
make
.
top
.
equalTo
(
self
.
collectView
.
snp
.
bottom
)
.
offset
(
items
.
count
>
0
?
4.0
:
0.0
)
}
self
.
collectView
.
isHidden
=
items
.
count
<=
0
self
.
bottomLineView
.
isHidden
=
items
.
count
<=
0
self
.
titleLabel
.
isHidden
=
items
.
count
<=
0
self
.
setNeedsLayout
()
self
.
setNeedsLayout
()
self
.
layoutIfNeeded
()
self
.
layoutIfNeeded
()
}
}
...
@@ -118,6 +124,7 @@ extension YHHomeInfoSectionHeadView: UICollectionViewDelegate, UICollectionViewD
...
@@ -118,6 +124,7 @@ extension YHHomeInfoSectionHeadView: UICollectionViewDelegate, UICollectionViewD
let
vc
=
YHHomeInfoDetailContainerViewController
()
let
vc
=
YHHomeInfoDetailContainerViewController
()
vc
.
customTitle
=
item
.
name
vc
.
customTitle
=
item
.
name
vc
.
isHaveHot
=
item
.
hotNum
>
0
vc
.
isHaveHot
=
item
.
hotNum
>
0
vc
.
classifyId
=
item
.
id
UIViewController
.
current
?
.
navigationController
?
.
pushViewController
(
vc
)
UIViewController
.
current
?
.
navigationController
?
.
pushViewController
(
vc
)
}
}
}
}
...
...
galaxy/galaxy/Classes/Modules/Home(首页)/VM/YHHomePageViewModel.swift
View file @
73df3ce1
...
@@ -320,7 +320,7 @@ extension YHHomePageViewModel {
...
@@ -320,7 +320,7 @@ extension YHHomePageViewModel {
}
}
}
}
func
getList
(
isFirsPage
:
Bool
,
isHot
:
Bool
?
=
nil
,
callBackBlock
:
@escaping
(
_
success
:
Bool
,
_
error
:
YHErrorModel
?)
->
())
{
func
getList
(
isFirsPage
:
Bool
,
isHot
:
Bool
?
=
nil
,
c
lassifyId
:
Int
?
=
nil
,
c
allBackBlock
:
@escaping
(
_
success
:
Bool
,
_
error
:
YHErrorModel
?)
->
())
{
var
params
:
[
String
:
Any
]
=
[
"page"
:
curPageIndex
,
var
params
:
[
String
:
Any
]
=
[
"page"
:
curPageIndex
,
"page_size"
:
searchPageSize
]
"page_size"
:
searchPageSize
]
if
isFirsPage
{
if
isFirsPage
{
...
@@ -334,6 +334,10 @@ extension YHHomePageViewModel {
...
@@ -334,6 +334,10 @@ extension YHHomePageViewModel {
if
let
isHot
=
isHot
{
if
let
isHot
=
isHot
{
params
[
"is_hot"
]
=
isHot
?
1
:
0
params
[
"is_hot"
]
=
isHot
?
1
:
0
}
}
if
let
classifyId
=
classifyId
{
params
[
"classify_id[0]"
]
=
classifyId
}
let
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
YHAllApiName
.
Common
.
article
let
strUrl
=
YHBaseUrlManager
.
shared
.
curURL
()
+
YHAllApiName
.
Common
.
article
let
_
=
YHNetRequest
.
getRequest
(
url
:
strUrl
,
params
:
params
)
{
[
weak
self
]
json
,
code
in
let
_
=
YHNetRequest
.
getRequest
(
url
:
strUrl
,
params
:
params
)
{
[
weak
self
]
json
,
code
in
guard
let
self
=
self
else
{
return
}
guard
let
self
=
self
else
{
return
}
...
...
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