Commit 05ad7d55 authored by David黄金龙's avatar David黄金龙

删除 不使用的代码

parent cf83bbd3
......@@ -377,12 +377,12 @@ class YHHomeWebViewController: YHBaseViewController, WKUIDelegate, WKNavigationD
}
func webView(_ webView: WKWebView, runJavaScriptAlertPanelWithMessage message: String, initiatedByFrame frame: WKFrameInfo, completionHandler: @escaping () -> Void) {
// 修复弹窗弹出的问题
let alert = UIAlertController(title: nil, message: message, preferredStyle: .alert)
alert.addAction(UIAlertAction(title: "Ok", style: .default, handler: { (_) -> Void in
completionHandler()
}))
self.present(alert, animated: true, completion: nil)
// // 修复弹窗弹出的问题
// let alert = UIAlertController(title: nil, message: message, preferredStyle: .alert)
// alert.addAction(UIAlertAction(title: "Ok", style: .default, handler: { (_) -> Void in
// completionHandler()
// }))
// self.present(alert, animated: true, completion: nil)
}
func webView(_ webView: WKWebView, didFailProvisionalNavigation navigation: WKNavigation!, withError error: Error) {
......
......@@ -267,12 +267,12 @@ extension YHStatusAdvantageVC {
}
func webView(_ webView: WKWebView, runJavaScriptAlertPanelWithMessage message: String, initiatedByFrame frame: WKFrameInfo, completionHandler: @escaping () -> Void) {
// 修复弹窗弹出的问题
let alert = UIAlertController(title: nil, message: message, preferredStyle: .alert)
alert.addAction(UIAlertAction(title: "Ok", style: .default, handler: { (_) -> Void in
completionHandler()
}))
self.present(alert, animated: true, completion: nil)
// // 修复弹窗弹出的问题
// let alert = UIAlertController(title: nil, message: message, preferredStyle: .alert)
// alert.addAction(UIAlertAction(title: "Ok", style: .default, handler: { (_) -> Void in
// completionHandler()
// }))
// self.present(alert, animated: true, completion: nil)
}
func webView(_ webView: WKWebView, didFailProvisionalNavigation navigation: WKNavigation!, withError error: Error) {
......
......@@ -166,17 +166,6 @@ extension YHLifeViewController: UITableViewDelegate, UITableViewDataSource {
vc.codeUrl = self.viewModel.detailModel.imageURLDefault
vc.downloadUrl = self.viewModel.detailModel.imageURLDefaultDownload
self.navigationController?.pushViewController(vc)
// let vc = YHH5WebViewVC()
//
// // TODO: - 谢
// vc.url = YHBaseUrlManager.shared.curH5URL() + "superAppBridge.html#/commodity_info?categoryId=2&levelId=5&productId=30&from=wxApp"
// vc.isWithBottomViewFlag = true
// vc.isShareToMiniProgramFlag = true
// vc.shareMiniPath = "/pages/commodityInfo/commodityInfo?categoryId=3&levelId=\(selectSubTab?.id ?? "")&productId=\(model.id)&from=wxApp"
//
// self.navigationController?.pushViewController(vc)
}
}
......
......@@ -74,11 +74,11 @@ class YHH5WebViewVC: YHBaseViewController, WKUIDelegate, WKNavigationDelegate {
//UI元素的控制变量 如下
//1、底部分享view
var isWithBottomViewFlag : Bool = false
lazy var shareView: YHShareViewOnTablebarView = {
let view = YHShareViewOnTablebarView()
return view
}()
// var isWithBottomViewFlag : Bool = false
// lazy var shareView: YHShareViewOnTablebarView = {
// let view = YHShareViewOnTablebarView()
// return view
// }()
//2、是否通屏展示- 默认通屏(导航栏透明)
var isFullScreenFlag : Bool = true
......@@ -92,7 +92,6 @@ class YHH5WebViewVC: YHBaseViewController, WKUIDelegate, WKNavigationDelegate {
//webView内部返回 - 默认不支持
var isSupportWebviewInterBackFlag : Bool = false
override func backItemClick(_ sender: Any) {
if isSupportWebviewInterBackFlag {
if webview.canGoBack {
......@@ -138,32 +137,31 @@ private extension YHH5WebViewVC {
if isFullScreenFlag {
gk_navBarAlpha = 0.0
} else {
gk_navTitle = navTitle
}
gk_navTitle = navTitle
NotificationCenter.default.addObserver(self, selector: #selector(updateNetWorkUI), name: .reachabilityChanged, object: nil)
view.backgroundColor = .white
if isWithBottomViewFlag {
loadQrInfo()
view.addSubview(shareView)
shareView.block = { tag in
if tag == 0 {
//分享
self.share()
} else {
//预约咨询
if self.arrQrInfo.count > 1 {
let codeUrl = self.arrQrInfo[0]
let downloadUrl = self.arrQrInfo[1]
YHConsultantQRCodeView.codeView(codeUrl, downloadUrl: downloadUrl).show()
}
}
}
}
// if isWithBottomViewFlag {
// loadQrInfo()
// view.addSubview(shareView)
//
// shareView.block = { tag in
// if tag == 0 {
// //分享
// self.share()
// } else {
// //预约咨询
// if self.arrQrInfo.count > 1 {
// let codeUrl = self.arrQrInfo[0]
// let downloadUrl = self.arrQrInfo[1]
// YHConsultantQRCodeView.codeView(codeUrl, downloadUrl: downloadUrl).show()
// }
// }
// }
// }
......@@ -184,26 +182,26 @@ private extension YHH5WebViewVC {
webview.load(request as URLRequest)
view.addSubview(webview)
if isWithBottomViewFlag {
view.addSubview(shareView)
shareView.snp.makeConstraints { make in
make.bottom.left.right.equalToSuperview()
make.height.equalTo(YHShareViewOnTablebarView.viewH)
}
if isFullScreenFlag {
webview.snp.makeConstraints { make in
make.top.left.right.equalToSuperview()
make.bottom.equalTo(shareView.snp.top)
}
} else {
webview.snp.makeConstraints { make in
make.top.equalToSuperview().offset(k_Height_NavigationtBarAndStatuBar)
make.left.right.equalToSuperview()
make.bottom.equalTo(shareView.snp.top)
}
}
} else {
// if isWithBottomViewFlag {
// view.addSubview(shareView)
// shareView.snp.makeConstraints { make in
// make.bottom.left.right.equalToSuperview()
// make.height.equalTo(YHShareViewOnTablebarView.viewH)
// }
//
// if isFullScreenFlag {
// webview.snp.makeConstraints { make in
// make.top.left.right.equalToSuperview()
// make.bottom.equalTo(shareView.snp.top)
// }
// } else {
// webview.snp.makeConstraints { make in
// make.top.equalToSuperview().offset(k_Height_NavigationtBarAndStatuBar)
// make.left.right.equalToSuperview()
// make.bottom.equalTo(shareView.snp.top)
// }
// }
// } else {
if isFullScreenFlag {
......@@ -217,7 +215,7 @@ private extension YHH5WebViewVC {
}
}
}
// }
......@@ -297,7 +295,6 @@ extension YHH5WebViewVC {
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
......@@ -328,12 +325,12 @@ extension YHH5WebViewVC {
}
func webView(_ webView: WKWebView, runJavaScriptAlertPanelWithMessage message: String, initiatedByFrame frame: WKFrameInfo, completionHandler: @escaping () -> Void) {
// 修复弹窗弹出的问题
let alert = UIAlertController(title: nil, message: message, preferredStyle: .alert)
alert.addAction(UIAlertAction(title: "Ok", style: .default, handler: { (_) -> Void in
completionHandler()
}))
self.present(alert, animated: true, completion: nil)
// // 修复弹窗弹出的问题
// let alert = UIAlertController(title: nil, message: message, preferredStyle: .alert)
// alert.addAction(UIAlertAction(title: "Ok", style: .default, handler: { (_) -> Void in
// completionHandler()
// }))
// self.present(alert, animated: true, completion: nil)
}
func webView(_ webView: WKWebView, didFailProvisionalNavigation navigation: WKNavigation!, withError error: Error) {
......@@ -395,10 +392,10 @@ extension YHH5WebViewVC : UIScrollViewDelegate {
alpha = 1.0
}
gk_navBarAlpha = alpha
gk_navTitle = navTitle
// gk_navTitle = navTitle
} else {
gk_navBarAlpha = 0.0
gk_navTitle = ""
// gk_navTitle = ""
}
}
}
......
......@@ -72,12 +72,12 @@ class YHWebViewViewController: YHBaseViewController, WKUIDelegate, WKNavigationD
}
func webView(_ webView: WKWebView, runJavaScriptAlertPanelWithMessage message: String, initiatedByFrame frame: WKFrameInfo, completionHandler: @escaping () -> Void) {
// 修复弹窗弹出的问题
let alert = UIAlertController(title: nil, message: message, preferredStyle: .alert)
alert.addAction(UIAlertAction(title: "Ok", style: .default, handler: { (_) -> Void in
completionHandler()
}))
self.present(alert, animated: true, completion: nil)
// // 修复弹窗弹出的问题
// let alert = UIAlertController(title: nil, message: message, preferredStyle: .alert)
// alert.addAction(UIAlertAction(title: "Ok", style: .default, handler: { (_) -> Void in
// completionHandler()
// }))
// self.present(alert, animated: true, completion: nil)
}
// MARK: - KVO
......
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