Commit a9d199f3 authored by David黄金龙's avatar David黄金龙

跳转 生活-教育

parent 45346fc1
......@@ -20,6 +20,7 @@ class YHLifeViewController: YHBaseViewController {
override func viewDidLoad() {
super.viewDidLoad()
setupUI()
loadData()
}
......@@ -80,7 +81,22 @@ extension YHLifeViewController {
}
}
@objc func didJumpToEduTab() {
let index : Int = 1
if index < self.viewModel.categoryArr.count {
selectSubIndex = index
self.selectSubTab = self.viewModel.categoryArr[index]
self.getDetailImages()
self.sectionView.selectIndex = index
}
}
func setupUI() {
NotificationCenter.default.addObserver(self, selector: #selector(didJumpToEduTab), name: YhConstant.YhNotification.didJumpToHomePageLifeEduTabNotification, object: nil)
gk_navBarAlpha = 0
gk_navigationBar.isHidden = true
view.backgroundColor = .white
......
......@@ -23,7 +23,12 @@ class YHLifeSectionView: UIView {
var type: Int = 0
var selectIndex = 0
var selectIndex = 0 {
didSet {
self.myCollectView.reloadData()
}
}
lazy var myCollectView = {
// 设置布局方向
let flowLayout = UICollectionViewFlowLayout()
......
......@@ -110,6 +110,10 @@ extension YHJsApi {
UIViewController.current?.navigationController?.popToRootViewController(animated: false)
goTabBarBy(tabType: .home)
NotificationCenter.default.post(name: YhConstant.YhNotification.didJumpToHomePageLifeTabNotification, object: nil)
DispatchQueue.main.asyncAfter(deadline: .now() + 0.35) {
NotificationCenter.default.post(name: YhConstant.YhNotification.didJumpToHomePageLifeEduTabNotification, object: nil)
}
}
}
......
......@@ -302,6 +302,9 @@ extension YhConstant {
// 跳转到首页生活tab
public static let didJumpToHomePageLifeTabNotification = Notification.Name(rawValue: "com.yinhe.homePage.life")
// 跳转到首页生活tab - 教育
public static let didJumpToHomePageLifeEduTabNotification = Notification.Name(rawValue: "com.yinhe.homePage.life.edu")
}
}
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