Commit 522dc66c authored by David黄金龙's avatar David黄金龙

首页跳转

parent 1634f9a9
...@@ -13,13 +13,6 @@ class YHTabBarViewController: ESTabBarController { ...@@ -13,13 +13,6 @@ class YHTabBarViewController: ESTabBarController {
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
handleTabBarLine() handleTabBarLine()
// self.tabBar.shadowImage = UIImage()
// self.tabBar.backgroundImage = UIImage()
// NotificationCenter.default.addObserver(self, selector: #selector(hideTabBar), name: BsConstant.BsNotification.tabBarHideNotification, object: nil)
//
// NotificationCenter.default.addObserver(self, selector: #selector(showTabBar), name: BsConstant.BsNotification.tabBarShowNotification, object: nil)
} }
} }
......
...@@ -121,10 +121,29 @@ private extension YHHkLifeAndIdItemView { ...@@ -121,10 +121,29 @@ private extension YHHkLifeAndIdItemView {
@objc func tapView(gestureRecognizer:UITapGestureRecognizer) { @objc func tapView(gestureRecognizer:UITapGestureRecognizer) {
if itemType == .hkID { if itemType == .hkID {
//香港身份 //香港身份
if let vc = UIApplication.shared.keyWindow?.rootViewController as? YHTabBarViewController {
vc.selectedIndex = 1
DispatchQueue.main.asyncAfter(deadline: .now() + 0.25) {
if let vcs = vc.viewControllers,vcs.count > 1 {
if let nvc = vcs[1] as? YHNavigationController,let vvc = nvc.topViewController as? YHServiceViewController {
vvc.jumpToItemIndex(itemIndex: 0)
}
}
}
}
} else if itemType == .hklife { } else if itemType == .hklife {
//香港生活 //香港生活
if let vc = UIApplication.shared.keyWindow?.rootViewController as? YHTabBarViewController {
vc.selectedIndex = 1
DispatchQueue.main.asyncAfter(deadline: .now() + 0.25) {
if let vcs = vc.viewControllers,vcs.count > 1 {
if let nvc = vcs[1] as? YHNavigationController,let vvc = nvc.topViewController as? YHServiceViewController {
vvc.jumpToItemIndex(itemIndex: 1)
}
}
}
}
} else { } else {
printLog("errorr:未处理") printLog("errorr:未处理")
} }
......
...@@ -83,7 +83,7 @@ class YHServiceViewController: YHBaseViewController { ...@@ -83,7 +83,7 @@ class YHServiceViewController: YHBaseViewController {
segmentedView.indicators = [indicator] segmentedView.indicators = [indicator]
segmentedView.backgroundColor = UIColor(red: 0.95, green: 0.95, blue: 0.95, alpha: 1) segmentedView.backgroundColor = UIColor(red: 0.95, green: 0.95, blue: 0.95, alpha: 1)
} }
override func viewWillAppear(_ animated: Bool) { override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated) super.viewWillAppear(animated)
...@@ -105,6 +105,11 @@ class YHServiceViewController: YHBaseViewController { ...@@ -105,6 +105,11 @@ class YHServiceViewController: YHBaseViewController {
listContainerView.frame = CGRect(x: 0, y: k_Height_safeAreaInsetsTop() + 48, width: view.bounds.size.width, height: view.bounds.size.height - 48 - k_Height_safeAreaInsetsTop()) listContainerView.frame = CGRect(x: 0, y: k_Height_safeAreaInsetsTop() + 48, width: view.bounds.size.width, height: view.bounds.size.height - 48 - k_Height_safeAreaInsetsTop())
} }
} }
extension YHServiceViewController {
func jumpToItemIndex(itemIndex : Int) {
self.segmentedView.selectItemAt(index: itemIndex)
}
}
extension YHServiceViewController: JXSegmentedViewDelegate { extension YHServiceViewController: JXSegmentedViewDelegate {
func segmentedView(_ segmentedView: JXSegmentedView, didSelectedItemAt index: Int) { func segmentedView(_ segmentedView: JXSegmentedView, didSelectedItemAt index: Int) {
......
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