Commit 10b58f29 authored by Steven杜宇's avatar Steven杜宇

// 我的方案

parent 71e2e002
......@@ -13,7 +13,8 @@ class YHImproveSchemeTemplateListCell: UITableViewCell {
static let cellReuseIdentifier = "YHImproveSchemeTemplateListCell"
var model = YHSchemeTemplatesModel()
var clickBlock: ((YHSchemeTemplatesModel)->())?
lazy var previewFileTool:YHFilePreviewTool = {
let tool = YHFilePreviewTool(targetVC: UIViewController.current)
return tool
......@@ -45,19 +46,7 @@ class YHImproveSchemeTemplateListCell: UITableViewCell {
}()
@objc func didBtnClicked() {
if !model.url.isEmpty {
let viewModel = YHBaseViewModel()
if model.url.contains("pub.galaxy-immi.com") { // 资源文件
viewModel.getRealUsefulUrl(model.url) { success in
self.previewFileTool.openXLSXRemoteFile(urlString: success, fileName:"预览")
}
} else { // web
let vc = YHH5WebViewVC()
vc.url = model.url
vc.isFullScreenFlag = false
UIViewController.current?.navigationController?.pushViewController(vc)
}
}
clickBlock?(model)
}
required init?(coder: NSCoder) {
......
......@@ -155,6 +155,23 @@ extension YHImproveSchemeTemplateListView : UITableViewDelegate, UITableViewData
let cell = tableView.dequeueReusableCell(withIdentifier: YHImproveSchemeTemplateListCell.cellReuseIdentifier, for: indexPath) as! YHImproveSchemeTemplateListCell
cell.titleLabel.text = "\(indexPath.row+1)\(item.name)"
cell.model = item
cell.clickBlock = {
[weak self] model in
if !model.url.isEmpty {
let viewModel = YHBaseViewModel()
if model.url.contains("pub.galaxy-immi.com") { // 资源文件
viewModel.getRealUsefulUrl(model.url) { success in
self.previewFileTool.openXLSXRemoteFile(urlString: success, fileName:"预览")
}
} else { // web
let vc = YHH5WebViewVC()
vc.url = model.url
vc.isFullScreenFlag = false
UIViewController.current?.navigationController?.pushViewController(vc)
}
}
self.dismiss()
}
return cell
}
......
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