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

图片预览

parent 47c7bcf3
...@@ -12,9 +12,6 @@ import Photos ...@@ -12,9 +12,6 @@ import Photos
import dsBridge import dsBridge
class YHHomeWebViewController: YHBaseViewController, WKUIDelegate, WKNavigationDelegate { class YHHomeWebViewController: YHBaseViewController, WKUIDelegate, WKNavigationDelegate {
var operationFlag:Bool = false var operationFlag:Bool = false
typealias Block = (YHWebModel) -> () typealias Block = (YHWebModel) -> ()
......
...@@ -26,7 +26,6 @@ extension YHJsApi { ...@@ -26,7 +26,6 @@ extension YHJsApi {
if curIndex > -1,arrPics.count > 0 { if curIndex > -1,arrPics.count > 0 {
DispatchQueue.main.async { DispatchQueue.main.async {
// let arr = ["https://img1.baidu.com/it/u=2032777443,4245182967&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=1422","http://img0.baidu.com/it/u=594725074,698294204&fm=253&app=138&f=JPEG?w=800&h=1422"]
YHPictureReviewManager.shared.showNetWorkPicturs(curIndex: curIndex, arrPicturs: arrPics) YHPictureReviewManager.shared.showNetWorkPicturs(curIndex: curIndex, arrPicturs: arrPics)
} }
} }
......
...@@ -11,7 +11,9 @@ import PhotosUI ...@@ -11,7 +11,9 @@ import PhotosUI
class YHLongtapPictureSheetView: UIView { class YHLongtapPictureSheetView: UIView {
private var uploadTypeArr = ["分享图片","保存图片","取消"] private var uploadTypeArr = ["分享图片","保存图片","取消"]
private let testUrl = "https://img1.baidu.com/it/u=2032777443,4245182967&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=1422" // private let testUrl = "https://img1.baidu.com/it/u=2032777443,4245182967&fm=253&fmt=auto&app=138&f=JPEG?w=800&h=1422"
var myUrl : String = ""
lazy var blackMaskView: UIView = { lazy var blackMaskView: UIView = {
let view = UIView() let view = UIView()
view.backgroundColor = UIColor(hex: 0x0F1214, alpha: 0.5) view.backgroundColor = UIColor(hex: 0x0F1214, alpha: 0.5)
...@@ -213,7 +215,7 @@ extension YHLongtapPictureSheetView { ...@@ -213,7 +215,7 @@ extension YHLongtapPictureSheetView {
private extension YHLongtapPictureSheetView { private extension YHLongtapPictureSheetView {
@objc func share() { @objc func share() {
self.dismiss() self.dismiss()
guard let url = URL(string: testUrl) else { guard let url = URL(string: myUrl) else {
return return
} }
let task = URLSession.shared.dataTask(with: url) { data, response, error in let task = URLSession.shared.dataTask(with: url) { data, response, error in
...@@ -230,7 +232,7 @@ private extension YHLongtapPictureSheetView { ...@@ -230,7 +232,7 @@ private extension YHLongtapPictureSheetView {
} }
@objc func save() { @objc func save() {
saveLocalPictureSyn(testUrl) saveLocalPictureSyn(myUrl)
self.dismiss() self.dismiss()
} }
......
...@@ -62,7 +62,11 @@ extension YHPictureReviewManager { ...@@ -62,7 +62,11 @@ extension YHPictureReviewManager {
extension YHPictureReviewManager { extension YHPictureReviewManager {
private func longPress(cell: JXPhotoBrowserImageCell) { private func longPress(cell: JXPhotoBrowserImageCell) {
let view = YHLongtapPictureSheetView.sheetView() let index = cell.index
view.show() if index < self.arrPics.count,index > -1 {
let view = YHLongtapPictureSheetView.sheetView()
view.myUrl = self.arrPics[index]
view.show()
}
} }
} }
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