Commit 3ca7e00d authored by David黄金龙's avatar David黄金龙

多页每次请求 6

控制 banner 不超过6
parent 29b83ed8
...@@ -17,7 +17,7 @@ class YHHomePageViewModel : YHBaseViewModel { ...@@ -17,7 +17,7 @@ class YHHomePageViewModel : YHBaseViewModel {
var hkList: [YHHKEventModel]? var hkList: [YHHKEventModel]?
//首页相关参数 //首页相关参数
private var curPageIndex : Int = 1 private var curPageIndex : Int = 1
private var page_Size : Int = 10 private var page_Size : Int = 6
private var totalCount : Int = 0 private var totalCount : Int = 0
var hasMoreForHomeNews : Bool = true var hasMoreForHomeNews : Bool = true
} }
...@@ -117,7 +117,14 @@ extension YHHomePageViewModel { ...@@ -117,7 +117,14 @@ extension YHHomePageViewModel {
callBackBlock(false,nil) callBackBlock(false,nil)
return return
} }
self.banners = result as? [YHBannerModel]
var arrData = result as? [YHBannerModel]
if let arr = arrData,arr.count > 6 {
arrData = Array(arrData?[0...5] ?? [])
}
self.banners = arrData
callBackBlock(true, nil) callBackBlock(true, nil)
} else { } else {
let error : YHErrorModel = YHErrorModel(errorCode:Int32(json.code), errorMsg: json.msg) let error : YHErrorModel = YHErrorModel(errorCode:Int32(json.code), errorMsg: json.msg)
......
...@@ -12,7 +12,7 @@ class YHMyLikeViewModel: YHBaseViewModel { ...@@ -12,7 +12,7 @@ class YHMyLikeViewModel: YHBaseViewModel {
var arrHomeNewsData: [YHHomeListModel]? var arrHomeNewsData: [YHHomeListModel]?
private var curPageIndex : Int = 1 private var curPageIndex : Int = 1
private var page_Size : Int = 10 private var page_Size : Int = 6
private var totalCount : Int = 0 private var totalCount : Int = 0
var hasMoreForHomeNews : Bool = true var hasMoreForHomeNews : Bool = true
} }
......
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