|
@@ -41,13 +41,12 @@ class BaseTabbarViewController: NSObject {
|
|
|
/// 我的
|
|
|
var lottieAnimateContentView5 : BaseLottieAnimateContentView!
|
|
|
|
|
|
-
|
|
|
-
|
|
|
var lastIndex : Int = 0
|
|
|
|
|
|
func tabBarViewController() -> ESTabBarController {
|
|
|
esTabBarController = ESTabBarController()
|
|
|
|
|
|
+ esTabBarController.tabBar.backgroundImage = UIImage.imageWithColor(color: UIColor.white)
|
|
|
esTabBarController.tabBar.shadowImage = UIImage(named: "navbar_shadow_pic_down")
|
|
|
esTabBarController.shouldHijackHandler = {
|
|
|
[weak self] (tabbarController, viewController, index) in
|
|
@@ -153,11 +152,23 @@ class BaseTabbarViewController: NSObject {
|
|
|
func setLoginTabBarItem() {
|
|
|
// v4.tabBarItem = ESTabBarItem.init(lottieAnimateContentView4, title: "消息", image: UIImage(named: "tabbar_massage")?.withRenderingMode(UIImage.RenderingMode.alwaysOriginal), selectedImage: nil)
|
|
|
// v5.tabBarItem = ESTabBarItem.init(lottieAnimateContentView5, title: "我的", image: UIImage(named: "tabbar_my")?.withRenderingMode(UIImage.RenderingMode.alwaysOriginal), selectedImage: nil)
|
|
|
+ tabBarItemStyle(navc: v1, normalImg: "tabbar_home", selectorImg: "tabbar_home_pre", title: "社区")
|
|
|
+ tabBarItemStyle(navc: v2, normalImg: "tabbar_shopping", selectorImg: "tabbar_shopping_pre", title: "福利")
|
|
|
+ v3.tabBarItem = UITabBarItem(title: nil, image: UIImage(named: "tabbar_publish")?.withRenderingMode(UIImage.RenderingMode.alwaysOriginal), selectedImage: UIImage(named: "tabbar_publish")?.withRenderingMode(UIImage.RenderingMode.alwaysOriginal))
|
|
|
+ v3.tabBarItem.imageInsets = UIEdgeInsets(top: 4, left: 0, bottom: -4, right: 0);
|
|
|
+ tabBarItemStyle(navc: v4, normalImg: "tabbar_massage", selectorImg: "tabbar_massage_pre", title: "消息")
|
|
|
+ tabBarItemStyle(navc: v5, normalImg: "tabbar_my", selectorImg: "tabbar_my_pre", title: "我的")
|
|
|
}
|
|
|
|
|
|
func setLoginOutTabBarItem() {
|
|
|
// v4.tabBarItem = ESTabBarItem.init(BaseTabBarItemContentView(), title: "消息", image: UIImage(named: "tabbar_massage")?.withRenderingMode(UIImage.RenderingMode.alwaysOriginal), selectedImage:nil)
|
|
|
// v5.tabBarItem = ESTabBarItem.init(BaseTabBarItemContentView(), title: "我的", image: UIImage(named: "tabbar_my")?.withRenderingMode(UIImage.RenderingMode.alwaysOriginal), selectedImage:nil)
|
|
|
+ tabBarItemStyle(navc: v1, normalImg: "tabbar_home", selectorImg: "tabbar_home_pre", title: "社区")
|
|
|
+ tabBarItemStyle(navc: v2, normalImg: "tabbar_shopping", selectorImg: "tabbar_shopping_pre", title: "福利")
|
|
|
+ v3.tabBarItem = UITabBarItem(title: nil, image: UIImage(named: "tabbar_publish")?.withRenderingMode(UIImage.RenderingMode.alwaysOriginal), selectedImage: UIImage(named: "tabbar_publish")?.withRenderingMode(UIImage.RenderingMode.alwaysOriginal))
|
|
|
+ v3.tabBarItem.imageInsets = UIEdgeInsets(top: 4, left: 0, bottom: -4, right: 0);
|
|
|
+ tabBarItemStyle(navc: v4, normalImg: "tabbar_massage", selectorImg: "tabbar_massage_pre", title: "消息")
|
|
|
+ tabBarItemStyle(navc: v5, normalImg: "tabbar_my", selectorImg: "tabbar_my_pre", title: "我的")
|
|
|
}
|
|
|
|
|
|
/// 跳转到VC
|
|
@@ -166,6 +177,7 @@ class BaseTabbarViewController: NSObject {
|
|
|
let pickVc = PublishViewController()
|
|
|
// let pickVc = PublishNewViewController()
|
|
|
let nav = BaseNavigationViewController.init(rootViewController: pickVc)
|
|
|
+ nav.modalPresentationStyle = .fullScreen
|
|
|
BaseTabbarViewController.shared.esTabBarController.present(nav, animated: true, completion: nil)
|
|
|
} else {
|
|
|
SwiftProgressHUD.shared().showText("内容上传中,请稍等", textAlignment: .center)
|
|
@@ -238,25 +250,6 @@ class BaseTabbarViewController: NSObject {
|
|
|
NotificationCenter.default.post(name: NSNotification.Name("MineModuleTop"), object: nil)
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-// func tabBarViewController() -> BaseTabbarViewController {
|
|
|
-// let tabBarViewController = BaseTabbarViewController()
|
|
|
-//
|
|
|
-// let v1 = ShoppingMallViewController()
|
|
|
-// let v2 = ShoppingCartViewController()
|
|
|
-// let v3 = MineViewController()
|
|
|
-//
|
|
|
-// let n1 = BaseNavigationViewController.init(rootViewController: v1)
|
|
|
-// let n2 = BaseNavigationViewController.init(rootViewController: v2)
|
|
|
-// let n3 = BaseNavigationViewController.init(rootViewController: v3)
|
|
|
-//
|
|
|
-// tabBarItemStyle(navc: n1, normalImg: "tabbar_home", selectorImg: "tabbar_home_pre", title: "首页")
|
|
|
-// tabBarItemStyle(navc: n2, normalImg: "tabbar_shopping", selectorImg: "tabbar_shopping_pre", title: "购物车")
|
|
|
-// tabBarItemStyle(navc: n3, normalImg: "tabbar_my", selectorImg: "tabbar_my_pre", title: "我的彩虹")
|
|
|
-//
|
|
|
-// tabBarViewController.viewControllers = [n1, n2, n3]
|
|
|
-// return tabBarViewController
|
|
|
-// }
|
|
|
|
|
|
|
|
|
private func tabBarItemStyle(navc : BaseViewController, normalImg : String, selectorImg : String, title : String){
|