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

非 通屏

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