Commit 42166af4 authored by pete谢兆麟's avatar pete谢兆麟

吴测试牛逼

parent 83142c53
...@@ -53,13 +53,15 @@ extension YHFourKingViewController { ...@@ -53,13 +53,15 @@ extension YHFourKingViewController {
for item in classify { for item in classify {
let model = item as YHHomeClassifyModel let model = item as YHHomeClassifyModel
if model.id == self.id { if model.id == self.id {
gk_navTitle = model.name if self.classId == 0 {
self.sectionView.items = model.children gk_navTitle = model.name
let classifyID = model.children.first?.id ?? 0 self.sectionView.items = model.children
self.classId = classifyID let classifyID = model.children.first?.id ?? 0
self.homeViewModel.getList(true, classifyID) {[weak self] success, error in self.classId = classifyID
guard let self = self else { return } self.homeViewModel.getList(true, classifyID) {[weak self] success, error in
self.dataSouce = self.homeViewModel.arrHomeNewsData ?? [] guard let self = self else { return }
self.dataSouce = self.homeViewModel.arrHomeNewsData ?? []
}
} }
} }
} }
......
...@@ -166,11 +166,10 @@ extension YHHomePageViewController: UICollectionViewDelegate, UICollectionViewDa ...@@ -166,11 +166,10 @@ extension YHHomePageViewController: UICollectionViewDelegate, UICollectionViewDa
if targetItem.id == item.id { if targetItem.id == item.id {
targetItem.is_like = item.is_like targetItem.is_like = item.is_like
targetItem.like_count = item.like_count targetItem.like_count = item.like_count
self.homeCollectView.reloadItems(at: [IndexPath(index: index)]) self.homeCollectView.reloadItems(at: [IndexPath.SubSequence(item: index, section: 0)])
} }
} }
} }
} }
self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
} else if model.type == 1 { } else if model.type == 1 {
......
...@@ -61,15 +61,14 @@ extension YHServerHKLifeViewController { ...@@ -61,15 +61,14 @@ extension YHServerHKLifeViewController {
if model.id == 2 { if model.id == 2 {
self.sectionView.items = model.children self.sectionView.items = model.children
if self.classId == 0 { if self.classId == 0 {
return let classifyID = model.children.first?.id ?? 0
} self.classId = classifyID
let classifyID = model.children.first?.id ?? 0 self.homeViewModel.getList(true, classifyID) {[weak self] success, error in
self.classId = classifyID guard let self = self else { return }
self.homeViewModel.getList(true, classifyID) {[weak self] success, error in self.dataSouce = self.homeViewModel.arrHomeNewsData ?? []
guard let self = self else { return } if self.homeViewModel.hasMoreForHomeNews == false {
self.dataSouce = self.homeViewModel.arrHomeNewsData ?? [] self.homeTableView.es.noticeNoMoreData()
if self.homeViewModel.hasMoreForHomeNews == false { }
self.homeTableView.es.noticeNoMoreData()
} }
} }
} }
......
...@@ -45,15 +45,14 @@ extension YHServiceListViewController { ...@@ -45,15 +45,14 @@ extension YHServiceListViewController {
if model.id == 1 { if model.id == 1 {
self.normalView.sectionView.items = model.children self.normalView.sectionView.items = model.children
if self.classId == 0 { if self.classId == 0 {
return let classifyID = model.children.first?.id ?? 0
} self.classId = classifyID
let classifyID = model.children.first?.id ?? 0 self.homeViewModel.getList(true, classifyID) {[weak self] success, error in
self.classId = classifyID guard let self = self else { return }
self.homeViewModel.getList(true, classifyID) {[weak self] success, error in self.normalView.dataSouce = self.homeViewModel.arrHomeNewsData ?? []
guard let self = self else { return } if self.homeViewModel.hasMoreForHomeNews == false {
self.normalView.dataSouce = self.homeViewModel.arrHomeNewsData ?? [] self.normalView.homeTableView.es.noticeNoMoreData()
if self.homeViewModel.hasMoreForHomeNews == false { }
self.normalView.homeTableView.es.noticeNoMoreData()
} }
} }
} }
......
...@@ -84,6 +84,18 @@ extension YHServiceTableFootView: UICollectionViewDelegate, UICollectionViewData ...@@ -84,6 +84,18 @@ extension YHServiceTableFootView: UICollectionViewDelegate, UICollectionViewData
let vc = YHHomeWebViewController() let vc = YHHomeWebViewController()
vc.url = YHConfigManager.shared.h5Url + "?id=\(model.id)" vc.url = YHConfigManager.shared.h5Url + "?id=\(model.id)"
vc.id = model.id vc.id = model.id
vc.block = {[weak self] model in
guard let self = self else { return }
let arr = self.items
for (index, targetItem) in arr.enumerated() {
guard let target = targetItem else { return }
if target.id == model.id {
target.is_like = model.is_like
target.like_count = model.like_count
self.myCollectView.reloadItems(at: [IndexPath.SubSequence(item: index, section: 0)])
}
}
}
UIViewController.current?.navigationController?.pushViewController(vc) UIViewController.current?.navigationController?.pushViewController(vc)
} else if model.type == 1 { } else if model.type == 1 {
printLog("直接播放视频") printLog("直接播放视频")
......
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