Commit 2e3a147d authored by Alex朱枝文's avatar Alex朱枝文

h5文件预览bug修复

parent 380fa909
......@@ -8031,7 +8031,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 11;
CURRENT_PROJECT_VERSION = 12;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
......@@ -8180,7 +8180,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 11;
CURRENT_PROJECT_VERSION = 12;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
......@@ -8391,7 +8391,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 11;
CURRENT_PROJECT_VERSION = 12;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
......@@ -8442,7 +8442,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 11;
CURRENT_PROJECT_VERSION = 12;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = RXHYW88XR7;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
......
......@@ -98,6 +98,11 @@ class YHHomeWebViewController: YHBaseViewController, WKUIDelegate, WKNavigationD
return view
}()
lazy var previewFileTool:YHFilePreviewTool = {
let tool = YHFilePreviewTool(targetVC: self)
return tool
}()
//有些界面需要保存图片的功能
var showSavePicBottomFlag : Bool = false
......@@ -414,6 +419,10 @@ class YHHomeWebViewController: YHBaseViewController, WKUIDelegate, WKNavigationD
}
}
func gotoPreviewTool(urlString: String) {
previewFileTool.openXLSXRemoteFile(urlString: urlString, fileName: "")
}
// MARK: - WKNavigationDelegate
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
// if vcTitle == nil {
......
......@@ -69,7 +69,10 @@ class YHH5WebViewVC: YHBaseViewController, WKUIDelegate, WKNavigationDelegate {
//是否曾今有过网络
private var isNetWorkOkBefore : Bool = false
lazy var previewFileTool:YHFilePreviewTool = {
let tool = YHFilePreviewTool(targetVC: self)
return tool
}()
override func viewDidLoad() {
super.viewDidLoad()
......@@ -546,6 +549,10 @@ extension YHH5WebViewVC {
}
}
func gotoPreviewTool(urlString: String) {
previewFileTool.openXLSXRemoteFile(urlString: urlString, fileName: "")
}
//25 关闭AI聊天的测评弹窗并获取测评结果
// type 1 直接关闭。 2 测评出结果关闭
// result 测评结果json 待定
......
......@@ -44,13 +44,19 @@ extension YHJsApi {
@objc func goPreviewFile(_ url: String) {
DispatchQueue.main.async {
let viewModel = YHBaseViewModel()
viewModel.getPublicImageUrl(url) { success, error in
viewModel.getRealUsefulUrl(url) { success in
YHHUD.hide()
if let success = success {
if success.count > 0 {
if let delegate = self.delegate as? YHH5WebViewVC {
delegate.gotoPreviewTool(urlString: success)
} else if let delegate = self.delegate as? YHHomeWebViewController {
delegate.gotoPreviewTool(urlString: success)
} else {// 这个位置局部变量tool容易被提前释放!!!!,请参考YHH5WebViewVC单独添加
let tool = YHFilePreviewTool(targetVC: UIViewController.current)
tool.openXLSXRemoteFile(urlString: success, fileName: "")
}
}
}
}
}
......
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