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

1、跳转 首页-生活 tab

2、跳转H5界面
parent 3c32753d
......@@ -45,7 +45,7 @@ class YHH5WebViewVC: YHBaseViewController, WKUIDelegate, WKNavigationDelegate {
}
deinit {
// webview.removeObserver(self, forKeyPath: "estimatedProgress")
webview.removeObserver(self, forKeyPath: "estimatedProgress")
NotificationCenter.default.removeObserver(self)
}
......@@ -227,7 +227,7 @@ private extension YHH5WebViewVC {
progBar.tintColor = UIColor.brandMainColor
webview.addSubview(progBar)
// 监听网页加载的进度
// webview.addObserver(self, forKeyPath: "estimatedProgress", options: .new, context: nil)
webview.addObserver(self, forKeyPath: "estimatedProgress", options: .new, context: nil)
view.addSubview(noNetWorkTipsView)
self.noNetWorkTipsView.snp.makeConstraints { make in
......
......@@ -17,6 +17,68 @@ class YHJsApi: NSObject {
}
extension YHJsApi {
//7、跳转 首页-生活 tab
@objc func goHomeLifeTabSyn() {
DispatchQueue.main.async {
UIViewController.current?.navigationController?.popToRootViewController(animated: false)
goTabBarBy(tabType: .home)
NotificationCenter.default.post(name: YhConstant.YhNotification.didJumpToHomePageLifeTabNotification, object: nil)
}
}
//6、跳转H5界面
@objc func goH5UISyn(_ dicH5: String) {
DispatchQueue.main.async {
if let data = dicH5.data(using: .utf8) {
do {
if let jsonObject = try JSONSerialization.jsonObject(with: data, options: []) as? [String: Any] {
// 转换成功,jsonObject 是一个字典
print("JSON字符串转换为字典成功: \(jsonObject)")
/*
url:跳转地址
isInformationUrl:1, //1-资讯类型 0-非资讯类型
id:1 // 资讯id
isFullScreen: 1,// 1-通屏 0-非通屏
*/
if !jsonObject.isEmpty {
let url : String = jsonObject["url"] as? String ?? ""
let isInformationUrl : Int = jsonObject["isInformationUrl"] as? Int ?? 0
let id : Int = jsonObject["id"] as? Int ?? -1
let isFullScreen : Int = jsonObject["isFullScreen"] as? Int ?? 1
let navTitle : String = jsonObject["navTitle"] as? String ?? ""
if !url.isEmpty {
if isInformationUrl == 1 {
//资讯详情
let vc = YHHomeWebViewController()
vc.url = url
vc.gk_navTitle = navTitle
// vc.id = model.id
self.delegate?.navigationController?.pushViewController(vc)
} else {
//普通界面
let vc = YHH5WebViewVC()
vc.url = url
vc.isFullScreenFlag = isFullScreen == 1 ? true : false
vc.navTitle = navTitle
self.delegate?.navigationController?.pushViewController(vc)
}
}
} else {
printLog("ddddd")
}
} else {
printLog("JSON字符串不是有效的字典格式")
}
} catch {
printLog("JSON解析错误: \(error)")
}
}
}
}
//5、返回App上一个界面
@objc func backToAppPreView() {
DispatchQueue.main.async {
......
......@@ -275,7 +275,7 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget {
items.removeAll()
if YHUatHelper.shared.getUatModuleStatusBy(module: YHUatModules(rawValue: 1)) == 1 {
if YHUatHelper.shared.getUatModuleStatusBy(module: .Mine_MyCard) == 1 {
let item = PersonalModuleItem(icon: "mine_item_card", title: "我的名片".local, type:.myCard)
items.append(item)
}
......@@ -286,29 +286,29 @@ class YHMyViewController: YHBaseViewController, ConstraintRelatableTarget {
}
if let configModel = YHConfigManager.shared.reqVM.configModel,configModel.is_integral_open {
if YHUatHelper.shared.getUatModuleStatusBy(module: YHUatModules(rawValue: 2)) == 1 {
if YHUatHelper.shared.getUatModuleStatusBy(module: .Mine_IntegralCenter) == 1 {
let item = PersonalModuleItem(icon: "mine_item_scoreCenter", title: "积分中心".local, type:.scoreCenter)
items.append(item)
}
}
if YHUatHelper.shared.getUatModuleStatusBy(module: YHUatModules(rawValue: 3)) == 1 {
if YHUatHelper.shared.getUatModuleStatusBy(module: .Mine_EvaluationCode) == 1 {
let item = PersonalModuleItem(icon: "mine_item_code", title: "我的测评码".local, type:.myTestCode)
items.append(item)
}
if YHUatHelper.shared.getUatModuleStatusBy(module: YHUatModules(rawValue: 4)) == 1 {
if YHUatHelper.shared.getUatModuleStatusBy(module: .Mine_AboutYinHeHarbour) == 1 {
let item = PersonalModuleItem(icon: "mine_item_appoint", title: "关于银河湾".local, type:.appointGalaxyBay)
items.append(item)
}
if YHUatHelper.shared.getUatModuleStatusBy(module: YHUatModules(rawValue: 5)) == 1 {
if YHUatHelper.shared.getUatModuleStatusBy(module: .Mine_MyActivity) == 1 {
let item = PersonalModuleItem(icon: "mine_item_activity", title: "我的活动".local, type:.myActivity)
items.append(item)
}
if YHUatHelper.shared.getUatModuleStatusBy(module: YHUatModules(rawValue: 6)) == 1 {
if YHUatHelper.shared.getUatModuleStatusBy(module: .Mine_AboutUS) == 1 {
let item = PersonalModuleItem(icon: "mine_item_about_us", title: "关于我们".local, type:. aboutUs)
items.append(item)
}
......
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