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

非 通屏

parent fbbdceb2
...@@ -388,21 +388,6 @@ class YHHomeWebViewController: YHBaseViewController, WKUIDelegate, WKNavigationD ...@@ -388,21 +388,6 @@ class YHHomeWebViewController: YHBaseViewController, WKUIDelegate, WKNavigationD
printLog("\(error.localizedDescription)") printLog("\(error.localizedDescription)")
} }
// MARK: - webview function
@objc func toBack() {
if webview.canGoBack {
webview.goBack()
}
}
@objc func toForward() {
if webview.canGoForward {
webview.goForward()
}
}
// MARK: - KVO // MARK: - KVO
override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) { override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
if keyPath == "estimatedProgress" { if keyPath == "estimatedProgress" {
......
...@@ -231,18 +231,6 @@ private extension YHStatusAdvantageVC { ...@@ -231,18 +231,6 @@ private extension YHStatusAdvantageVC {
} }
} }
} }
@objc func toBack() {
if webview.canGoBack {
webview.goBack()
}
}
@objc func toForward() {
if webview.canGoForward {
webview.goForward()
}
}
} }
......
...@@ -127,9 +127,11 @@ private extension YHH5WebViewVC { ...@@ -127,9 +127,11 @@ private extension YHH5WebViewVC {
gk_navLineHidden = false gk_navLineHidden = false
gk_navBackgroundColor = .white gk_navBackgroundColor = .white
gk_navTitle = navTitle
if isFullScreenFlag { if isFullScreenFlag {
gk_navBarAlpha = 0.0 gk_navBarAlpha = 0.0
} else {
gk_navTitle = navTitle
} }
NotificationCenter.default.addObserver(self, selector: #selector(updateNetWorkUI), name: .reachabilityChanged, object: nil) NotificationCenter.default.addObserver(self, selector: #selector(updateNetWorkUI), name: .reachabilityChanged, object: nil)
...@@ -139,10 +141,6 @@ private extension YHH5WebViewVC { ...@@ -139,10 +141,6 @@ private extension YHH5WebViewVC {
if isWithBottomViewFlag { if isWithBottomViewFlag {
loadQrInfo() loadQrInfo()
view.addSubview(shareView) view.addSubview(shareView)
}
shareView.block = { tag in shareView.block = { tag in
if tag == 0 { if tag == 0 {
//分享 //分享
...@@ -156,6 +154,7 @@ private extension YHH5WebViewVC { ...@@ -156,6 +154,7 @@ private extension YHH5WebViewVC {
} }
} }
} }
}
// 创建wkwebview // 创建wkwebview
webview = DWKWebView(frame: .zero) webview = DWKWebView(frame: .zero)
...@@ -273,19 +272,6 @@ private extension YHH5WebViewVC { ...@@ -273,19 +272,6 @@ private extension YHH5WebViewVC {
} }
} }
} }
// MARK: - webview function
@objc func toBack() {
if webview.canGoBack {
webview.goBack()
}
}
@objc func toForward() {
if webview.canGoForward {
webview.goForward()
}
}
} }
...@@ -297,6 +283,11 @@ extension YHH5WebViewVC { ...@@ -297,6 +283,11 @@ extension YHH5WebViewVC {
progBar.setProgress(Float(webview.estimatedProgress), animated: true) progBar.setProgress(Float(webview.estimatedProgress), animated: true)
//进度条的值最大为1.0 //进度条的值最大为1.0
if(self.webview.estimatedProgress >= 1.0) { if(self.webview.estimatedProgress >= 1.0) {
if isFullScreenFlag {
gk_navBarAlpha = 0.0
gk_navTitle = ""
}
UIView.animate(withDuration: 0.3, delay: 0.1, options: .curveEaseInOut, animations: { () -> Void in UIView.animate(withDuration: 0.3, delay: 0.1, options: .curveEaseInOut, animations: { () -> Void in
self.progBar.alpha = 0.0 self.progBar.alpha = 0.0
}, completion: { (finished:Bool) -> Void in }, completion: { (finished:Bool) -> Void in
...@@ -377,11 +368,11 @@ extension YHH5WebViewVC { ...@@ -377,11 +368,11 @@ extension YHH5WebViewVC {
} }
} }
//MARK: - UIScrollViewDelegate //MARK: - UIScrollViewDelegate
extension YHH5WebViewVC : UIScrollViewDelegate { extension YHH5WebViewVC : UIScrollViewDelegate {
func scrollViewDidScroll(_ scrollView: UIScrollView) { func scrollViewDidScroll(_ scrollView: UIScrollView) {
if isFullScreenFlag,scrollView == webview.scrollView {
if scrollView.contentOffset.y > 0 { if scrollView.contentOffset.y > 0 {
var alpha = scrollView.contentOffset.y / (k_Height_NavigationtBarAndStatuBar) var alpha = scrollView.contentOffset.y / (k_Height_NavigationtBarAndStatuBar)
if alpha > 1.0 { if alpha > 1.0 {
...@@ -394,4 +385,5 @@ extension YHH5WebViewVC : UIScrollViewDelegate { ...@@ -394,4 +385,5 @@ extension YHH5WebViewVC : UIScrollViewDelegate {
gk_navTitle = "" gk_navTitle = ""
} }
} }
}
} }
...@@ -80,20 +80,6 @@ class YHWebViewViewController: YHBaseViewController, WKUIDelegate, WKNavigationD ...@@ -80,20 +80,6 @@ class YHWebViewViewController: YHBaseViewController, WKUIDelegate, WKNavigationD
self.present(alert, animated: true, completion: nil) self.present(alert, animated: true, completion: nil)
} }
// MARK: - webview function
@objc func toBack() {
if webview.canGoBack {
webview.goBack()
}
}
@objc func toForward() {
if webview.canGoForward {
webview.goForward()
}
}
// MARK: - KVO // MARK: - KVO
override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) { override func observeValue(forKeyPath keyPath: String?, of object: Any?, change: [NSKeyValueChangeKey : Any]?, context: UnsafeMutableRawPointer?) {
......
...@@ -381,7 +381,7 @@ extension YHMyViewController : UITableViewDelegate, UITableViewDataSource { ...@@ -381,7 +381,7 @@ extension YHMyViewController : UITableViewDelegate, UITableViewDataSource {
let vc = YHH5WebViewVC() let vc = YHH5WebViewVC()
vc.navTitle = "积分中心" vc.navTitle = "积分中心"
vc.url = url vc.url = url
vc.isSupportWebviewInterBackFlag = true // vc.isSupportWebviewInterBackFlag = true
self.navigationController?.pushViewController(vc) self.navigationController?.pushViewController(vc)
} }
case .myTestCode://我的测评码 case .myTestCode://我的测评码
......
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