Commit 4875f48c authored by David黄金龙's avatar David黄金龙

处理 page的初始值

parent 7714d7aa
......@@ -180,15 +180,13 @@ extension YHHomePageViewModel {
"page_size": page_Size,
"classify_id[0]": classifyID]
if firstPageFlag {
curPageIndex = 1
params = ["page": curPageIndex,
params = ["page": 1,
"page_size": page_Size,
"classify_id[0]": classifyID]
} else {
params = ["page": curPageIndex + 1,
"page_size": page_Size,
"classify_id[0]": classifyID]
curPageIndex = curPageIndex + 1
}
let strUrl = YHBaseUrlManager.shared.curURL() + YHAllApiName.Common.article
let _ = YHNetRequest.getRequest(url: strUrl, params: params) { [weak self] json, code in
......@@ -206,9 +204,11 @@ extension YHHomePageViewModel {
}
if firstPageFlag {
self.curPageIndex = 1
self.totalCount = result.total
self.arrHomeNewsData = result.data
} else {
self.curPageIndex = self.curPageIndex + 1
self.arrHomeNewsData?.append(contentsOf: result.data)
}
......@@ -260,8 +260,7 @@ extension YHHomePageViewModel {
var params: [String : Any] = [:]
if isFirstPage {
curPageIndex = 1
params = ["page": curPageIndex,
params = ["page": 1,
"page_size": 10,
"title": title]
} else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment