Commit 7a1f817f authored by David黄金龙's avatar David黄金龙

webview 的 title处理

parent 0718d473
...@@ -138,6 +138,7 @@ private extension YHStartPageViewController { ...@@ -138,6 +138,7 @@ private extension YHStartPageViewController {
guard let self = self else { return } guard let self = self else { return }
let vc = YHWebViewViewController() let vc = YHWebViewViewController()
vc.url = url vc.url = url
vc.navTitle = "隐私协议"
self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
} }
......
...@@ -209,6 +209,7 @@ class YHPhoneLoginViewController: YHBaseViewController { ...@@ -209,6 +209,7 @@ class YHPhoneLoginViewController: YHBaseViewController {
guard let self = self else { return } guard let self = self else { return }
let vc = YHWebViewViewController() let vc = YHWebViewViewController()
vc.url = url vc.url = url
vc.navTitle = "隐私协议"
self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
} }
view.agreeBlock = { [weak self] in view.agreeBlock = { [weak self] in
......
...@@ -14,9 +14,12 @@ class YHWebViewViewController: YHBaseViewController, WKUIDelegate, WKNavigationD ...@@ -14,9 +14,12 @@ class YHWebViewViewController: YHBaseViewController, WKUIDelegate, WKNavigationD
var webview = WKWebView() var webview = WKWebView()
var progBar = UIProgressView() var progBar = UIProgressView()
var url = "" var url = ""
var navTitle = ""
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
gk_navTitle = navTitle
//获取导航栏高度 //获取导航栏高度
let navHeight = self.navigationController?.navigationBar.frame.height let navHeight = self.navigationController?.navigationBar.frame.height
//获取状态栏高度 //获取状态栏高度
...@@ -55,7 +58,9 @@ class YHWebViewViewController: YHBaseViewController, WKUIDelegate, WKNavigationD ...@@ -55,7 +58,9 @@ class YHWebViewViewController: YHBaseViewController, WKUIDelegate, WKNavigationD
// MARK: - WKNavigationDelegate // MARK: - WKNavigationDelegate
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) { func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
self.navigationItem.title = webview.title if navTitle.isEmpty {
self.navigationItem.title = webview.title
}
} }
// MARK: - WKUIDelegate // MARK: - WKUIDelegate
......
...@@ -117,12 +117,14 @@ class YHLoginPrivacyView: UIView { ...@@ -117,12 +117,14 @@ class YHLoginPrivacyView: UIView {
@objc func firstUrlClick() { @objc func firstUrlClick() {
let vc = YHWebViewViewController() let vc = YHWebViewViewController()
vc.url = YHBaseUrlManager.shared.curPrivacyAgreementUrl() vc.url = YHBaseUrlManager.shared.curPrivacyAgreementUrl()
vc.navTitle = "隐私协议"
UIViewController.current?.navigationController?.pushViewController(vc) UIViewController.current?.navigationController?.pushViewController(vc)
} }
@objc func secondUrlClick() { @objc func secondUrlClick() {
let vc = YHWebViewViewController() let vc = YHWebViewViewController()
vc.url = YHBaseUrlManager.shared.curUserItemsUrl() vc.url = YHBaseUrlManager.shared.curUserItemsUrl()
vc.navTitle = "用户条款"
UIViewController.current?.navigationController?.pushViewController(vc) UIViewController.current?.navigationController?.pushViewController(vc)
} }
} }
...@@ -121,7 +121,7 @@ class YHMySettingViewController: YHBaseViewController, ConstraintRelatableTarget ...@@ -121,7 +121,7 @@ class YHMySettingViewController: YHBaseViewController, ConstraintRelatableTarget
versionLabel.text = version versionLabel.text = version
#endif #endif
} }
@objc func logout() { @objc func logout() {
YHHUD.show(.progress(message: "退出登录中...")) YHHUD.show(.progress(message: "退出登录中..."))
...@@ -146,7 +146,7 @@ class YHMySettingViewController: YHBaseViewController, ConstraintRelatableTarget ...@@ -146,7 +146,7 @@ class YHMySettingViewController: YHBaseViewController, ConstraintRelatableTarget
msg = error.errorMsg msg = error.errorMsg
} }
YHHUD.flash(message: msg) YHHUD.flash(message: msg)
} }
} }
} }
...@@ -192,11 +192,11 @@ extension YHMySettingViewController : UITableViewDelegate, UITableViewDataSource ...@@ -192,11 +192,11 @@ extension YHMySettingViewController : UITableViewDelegate, UITableViewDataSource
if item.type == .notifySettings { if item.type == .notifySettings {
let vc = YHMyNotifySettingVC() let vc = YHMyNotifySettingVC()
self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
} else if item.type == .permissionSettings { } else if item.type == .permissionSettings {
let vc = YHMyPermissionSettingVC() let vc = YHMyPermissionSettingVC()
self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
} else if item.type == .aboutUs { } else if item.type == .aboutUs {
let vc = YHAboutUsViewController() let vc = YHAboutUsViewController()
self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
...@@ -204,14 +204,16 @@ extension YHMySettingViewController : UITableViewDelegate, UITableViewDataSource ...@@ -204,14 +204,16 @@ extension YHMySettingViewController : UITableViewDelegate, UITableViewDataSource
} else if item.type == .userItems { } else if item.type == .userItems {
// 用户条款 // 用户条款
let vc = YHWebViewViewController() let vc = YHWebViewViewController()
vc.url = YHBaseUrlManager.shared.curUserItemsUrl() vc.url = YHBaseUrlManager.shared.curUserItemsUrl()
UIViewController.current?.navigationController?.pushViewController(vc) vc.navTitle = "用户条款"
UIViewController.current?.navigationController?.pushViewController(vc)
} else if item.type == .privaceAgreement { } else if item.type == .privaceAgreement {
//隐私政策 //隐私政策
let vc = YHWebViewViewController() let vc = YHWebViewViewController()
vc.url = YHBaseUrlManager.shared.curPrivacyAgreementUrl() vc.url = YHBaseUrlManager.shared.curPrivacyAgreementUrl()
UIViewController.current?.navigationController?.pushViewController(vc) vc.navTitle = "隐私政策"
UIViewController.current?.navigationController?.pushViewController(vc)
} }
else if item.type == .deviceInfo { else if item.type == .deviceInfo {
......
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