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

webview 的 title处理

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