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
4875f48c
Commit
4875f48c
authored
Apr 15, 2024
by
David黄金龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
处理 page的初始值
parent
7714d7aa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
YHHomePageViewModel.swift
...axy/Classes/Modules/Home(首页)/VM/YHHomePageViewModel.swift
+4
-5
No files found.
galaxy/galaxy/Classes/Modules/Home(首页)/VM/YHHomePageViewModel.swift
View file @
4875f48c
...
@@ -180,15 +180,13 @@ extension YHHomePageViewModel {
...
@@ -180,15 +180,13 @@ extension YHHomePageViewModel {
"page_size"
:
page_Size
,
"page_size"
:
page_Size
,
"classify_id[0]"
:
classifyID
]
"classify_id[0]"
:
classifyID
]
if
firstPageFlag
{
if
firstPageFlag
{
curPageIndex
=
1
params
=
[
"page"
:
1
,
params
=
[
"page"
:
curPageIndex
,
"page_size"
:
page_Size
,
"page_size"
:
page_Size
,
"classify_id[0]"
:
classifyID
]
"classify_id[0]"
:
classifyID
]
}
else
{
}
else
{
params
=
[
"page"
:
curPageIndex
+
1
,
params
=
[
"page"
:
curPageIndex
+
1
,
"page_size"
:
page_Size
,
"page_size"
:
page_Size
,
"classify_id[0]"
:
classifyID
]
"classify_id[0]"
:
classifyID
]
curPageIndex
=
curPageIndex
+
1
}
}
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
...
@@ -206,9 +204,11 @@ extension YHHomePageViewModel {
...
@@ -206,9 +204,11 @@ extension YHHomePageViewModel {
}
}
if
firstPageFlag
{
if
firstPageFlag
{
self
.
curPageIndex
=
1
self
.
totalCount
=
result
.
total
self
.
totalCount
=
result
.
total
self
.
arrHomeNewsData
=
result
.
data
self
.
arrHomeNewsData
=
result
.
data
}
else
{
}
else
{
self
.
curPageIndex
=
self
.
curPageIndex
+
1
self
.
arrHomeNewsData
?
.
append
(
contentsOf
:
result
.
data
)
self
.
arrHomeNewsData
?
.
append
(
contentsOf
:
result
.
data
)
}
}
...
@@ -260,8 +260,7 @@ extension YHHomePageViewModel {
...
@@ -260,8 +260,7 @@ extension YHHomePageViewModel {
var
params
:
[
String
:
Any
]
=
[:]
var
params
:
[
String
:
Any
]
=
[:]
if
isFirstPage
{
if
isFirstPage
{
curPageIndex
=
1
params
=
[
"page"
:
1
,
params
=
[
"page"
:
curPageIndex
,
"page_size"
:
10
,
"page_size"
:
10
,
"title"
:
title
]
"title"
:
title
]
}
else
{
}
else
{
...
...
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