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
8d8216a8
Commit
8d8216a8
authored
Apr 11, 2024
by
David黄金龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
首页 逻辑
parent
1b118b8a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
8 deletions
+15
-8
YHHomePageViewController.swift
...Classes/Modules/Home(首页)/C/YHHomePageViewController.swift
+1
-3
YHHomeListModel.swift
...y/galaxy/Classes/Modules/Home(首页)/M/YHHomeListModel.swift
+6
-4
YHHomeCollectionViewCell.swift
...IntelligentService(服务中心)/V/YHHomeCollectionViewCell.swift
+8
-1
No files found.
galaxy/galaxy/Classes/Modules/Home(首页)/C/YHHomePageViewController.swift
View file @
8d8216a8
...
@@ -62,9 +62,7 @@ class YHHomePageViewController: YHBaseViewController {
...
@@ -62,9 +62,7 @@ class YHHomePageViewController: YHBaseViewController {
func
getData
()
{
func
getData
()
{
viewModel
.
getHomeNewsList
{[
weak
self
]
success
,
error
in
viewModel
.
getHomeNewsList
{[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
guard
let
self
=
self
else
{
return
}
// DispatchQueue.main.async {
self
.
homeCollectView
.
reloadData
()
self
.
homeCollectView
.
reloadData
()
// }
}
}
viewModel
.
getHomeBanner
(
0
)
{[
weak
self
]
success
,
error
in
viewModel
.
getHomeBanner
(
0
)
{[
weak
self
]
success
,
error
in
guard
let
self
=
self
else
{
return
}
guard
let
self
=
self
else
{
return
}
...
...
galaxy/galaxy/Classes/Modules/Home(首页)/M/YHHomeListModel.swift
View file @
8d8216a8
...
@@ -15,7 +15,8 @@ class YHHomeListModel: YHBaseModel {
...
@@ -15,7 +15,8 @@ class YHHomeListModel: YHBaseModel {
var
content
:
String
=
""
var
content
:
String
=
""
var
view_count
:
Int
=
0
var
view_count
:
Int
=
0
var
img_url
:
String
=
""
var
img_url
:
String
=
""
var
type
:
Int
=
0
var
type
:
Int
=
0
//文章类型 '文章类型 1视频 2图文 3图片',
var
is_like
:
Bool
=
false
//网络返回的图片宽高
//网络返回的图片宽高
var
img_width
:
CGFloat
=
0
var
img_width
:
CGFloat
=
0
...
@@ -48,8 +49,8 @@ class YHHomeListModel: YHBaseModel {
...
@@ -48,8 +49,8 @@ class YHHomeListModel: YHBaseModel {
var
textHeight
:
CGFloat
=
size
.
height
var
textHeight
:
CGFloat
=
size
.
height
if
textHeight
>
40.0
{
if
textHeight
>
40.0
{
textHeight
=
40.0
textHeight
=
40.0
}
else
if
textHeight
<
20.0
{
}
else
if
textHeight
<
16
{
textHeight
=
20.0
textHeight
=
16
}
}
self
.
textH
=
textHeight
self
.
textH
=
textHeight
...
@@ -64,12 +65,13 @@ class YHHomeListModel: YHBaseModel {
...
@@ -64,12 +65,13 @@ class YHHomeListModel: YHBaseModel {
}
}
}
}
let
totalHeight
=
imageHeight
+
textHeight
+
30
+
1
8
let
totalHeight
=
imageHeight
+
textHeight
+
30
+
1
6
self
.
img_width_use
=
width
self
.
img_width_use
=
width
self
.
img_height_use
=
imageHeight
self
.
img_height_use
=
imageHeight
self
.
img_width_cell
=
width
self
.
img_width_cell
=
width
self
.
img_height_cell
=
totalHeight
self
.
img_height_cell
=
totalHeight
}
}
}
}
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/V/YHHomeCollectionViewCell.swift
View file @
8d8216a8
...
@@ -95,7 +95,7 @@ class YHHomeCollectionViewCell: UICollectionViewCell {
...
@@ -95,7 +95,7 @@ class YHHomeCollectionViewCell: UICollectionViewCell {
numLable
.
snp
.
makeConstraints
{
make
in
numLable
.
snp
.
makeConstraints
{
make
in
make
.
right
.
equalToSuperview
()
.
offset
(
-
8
)
make
.
right
.
equalToSuperview
()
.
offset
(
-
8
)
make
.
top
.
equalTo
(
descripeLable
.
snp
.
bottom
)
.
offset
(
10
)
make
.
top
.
equalTo
(
descripeLable
.
snp
.
bottom
)
.
offset
(
10
)
make
.
height
.
equalTo
(
1
8
)
make
.
height
.
equalTo
(
1
6
)
}
}
subHoldView
.
addSubview
(
heartImageView
)
subHoldView
.
addSubview
(
heartImageView
)
...
@@ -125,5 +125,12 @@ class YHHomeCollectionViewCell: UICollectionViewCell {
...
@@ -125,5 +125,12 @@ class YHHomeCollectionViewCell: UICollectionViewCell {
make
.
bottom
.
equalTo
(
-
36
)
make
.
bottom
.
equalTo
(
-
36
)
}
}
numLable
.
text
=
listModel
.
collect_count
.
string
numLable
.
text
=
listModel
.
collect_count
.
string
if
listModel
.
is_like
{
headImageView
.
image
=
UIImage
(
named
:
"home_red_heart"
)
}
else
{
headImageView
.
image
=
UIImage
(
named
:
"home_grey_heart"
)
}
}
}
}
}
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