Commit 404928a3 authored by Steven杜宇's avatar Steven杜宇

// 添加方法

parent 1fb75a3e
......@@ -18,6 +18,32 @@ class YHJsApi: NSObject {
}
extension YHJsApi {
// 返回tab服务页
@objc func goAppTab(_ tag : Any) {
DispatchQueue.main.async {
if let tag = tag as? String {
UIViewController.current?.navigationController?.popToRootViewController(animated: false)
if tag == "home" {
goTabBarBy(tabType: .home)
} else if tag == "server" {
goTabBarBy(tabType: .service)
} else if tag == "ai" {
goTabBarBy(tabType: .AI)
} else if tag == "friend" {
goTabBarBy(tabType: .community)
} else if tag == "mine" {
goTabBarBy(tabType: .mine)
}
}
}
}
//禁用全局手势返回
@objc func disableFullScreenGestureSyn(_ tag : Any) {
DispatchQueue.main.async {
......@@ -35,6 +61,7 @@ extension YHJsApi {
}
}
// 关闭优才测评
@objc func closeEvaluationGetResult(_ dicData: String) {
DispatchQueue.main.async {
if let data = dicData.data(using: .utf8) {
......
......@@ -137,6 +137,7 @@ enum tabBarPageType : Int {
// case message //消息
case mine //我的
case community //社区
case AI // 港小宝
}
func goTabBarBy(tabType : tabBarPageType) {
......@@ -147,14 +148,22 @@ func goTabBarBy(tabType : tabBarPageType) {
tabIndex = 0
case .service:
tabIndex = 1
case .AI:
tabIndex = 2
case .community:
tabIndex = 3
case .mine:
tabIndex = 4
}
if let vc = UIApplication.shared.keyWindow?.rootViewController as? YHTabBarViewController {
vc.selectedIndex = tabIndex
if tabType == .AI {
let vc = YHAITabViewController()
UIViewController.current?.navigationController?.pushViewController(vc)
} else {
if let vc = UIApplication.shared.keyWindow?.rootViewController as? YHTabBarViewController {
vc.selectedIndex = tabIndex
}
}
}
......
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