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

// 添加方法

parent 1fb75a3e
...@@ -18,6 +18,32 @@ class YHJsApi: NSObject { ...@@ -18,6 +18,32 @@ class YHJsApi: NSObject {
} }
extension YHJsApi { 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) { @objc func disableFullScreenGestureSyn(_ tag : Any) {
DispatchQueue.main.async { DispatchQueue.main.async {
...@@ -35,6 +61,7 @@ extension YHJsApi { ...@@ -35,6 +61,7 @@ extension YHJsApi {
} }
} }
// 关闭优才测评
@objc func closeEvaluationGetResult(_ dicData: String) { @objc func closeEvaluationGetResult(_ dicData: String) {
DispatchQueue.main.async { DispatchQueue.main.async {
if let data = dicData.data(using: .utf8) { if let data = dicData.data(using: .utf8) {
......
...@@ -137,6 +137,7 @@ enum tabBarPageType : Int { ...@@ -137,6 +137,7 @@ enum tabBarPageType : Int {
// case message //消息 // case message //消息
case mine //我的 case mine //我的
case community //社区 case community //社区
case AI // 港小宝
} }
func goTabBarBy(tabType : tabBarPageType) { func goTabBarBy(tabType : tabBarPageType) {
...@@ -147,15 +148,23 @@ func goTabBarBy(tabType : tabBarPageType) { ...@@ -147,15 +148,23 @@ func goTabBarBy(tabType : tabBarPageType) {
tabIndex = 0 tabIndex = 0
case .service: case .service:
tabIndex = 1 tabIndex = 1
case .AI:
tabIndex = 2
case .community: case .community:
tabIndex = 3 tabIndex = 3
case .mine: case .mine:
tabIndex = 4 tabIndex = 4
} }
if tabType == .AI {
let vc = YHAITabViewController()
UIViewController.current?.navigationController?.pushViewController(vc)
} else {
if let vc = UIApplication.shared.keyWindow?.rootViewController as? YHTabBarViewController { if let vc = UIApplication.shared.keyWindow?.rootViewController as? YHTabBarViewController {
vc.selectedIndex = tabIndex vc.selectedIndex = tabIndex
} }
}
} }
func goToMessagePage() { func goToMessagePage() {
......
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