Commit 965acaf7 authored by Steven杜宇's avatar Steven杜宇

// plan

parent 026d733f
......@@ -629,11 +629,6 @@ extension YHMyNewViewController {
func clickItem(_ item: PersonalModuleItem) {
do {
let vc = YHPlanViewController()
self.navigationController?.pushViewController(vc)
return
}
if !checkLogin() {
return
}
......
......@@ -83,15 +83,15 @@ class YHPlanPolicyDetailViewController: YHBaseViewController {
if 0 <= currentIndex, currentIndex < arr.count {
let model = arr[currentIndex]
if type == .wechat {
sendImageToWechat(model.img_url)
sendImageToWechat(model.image_poster)
} else if type == .copyLink {
let pasteBoard = UIPasteboard.general
pasteBoard.string = model.img_url
pasteBoard.string = model.image_poster
YHHUD.flash(message: "复制成功")
} else if type == .saveImg {
saveImgFromUrl(model.img_url)
saveImgFromUrl(model.image_poster)
}
}
}
......@@ -137,7 +137,7 @@ class YHPlanPolicyDetailViewController: YHBaseViewController {
func showBgImage(index: Int) {
if 0 <= index, index < arr.count {
let model = arr[index]
if let url = URL(string: model.img_url) {
if let url = URL(string: model.image_poster) {
bgImgView.kf.setImage(with: url)
}
}
......@@ -155,13 +155,14 @@ class YHPlanPolicyDetailViewController: YHBaseViewController {
let ossGroup = DispatchGroup()
for item in imgs {
ossGroup.enter()
item.imgView.kf.setImage(with: URL(string: item.model.img_url)) { result in
item.imgView.kf.setImage(with: URL(string: item.model.image_poster)) { result in
switch result {
case let .success(value):
let size = value.image.size
let scale = size.height > 0 ? Double(size.width / size.height) : 1.0
if scale > 0 {
item.width = scale * item.height
printLog("IMG_SIZE: \(item.width), \(item.height)")
}
case let .failure(error):
print("Job failed: \(error.localizedDescription)")
......
......@@ -143,15 +143,15 @@ class YHPlanShareViewController: YHBaseViewController {
let fileName = destinationURL.lastPathComponent
let fileExtension = destinationURL.pathExtension
YHShareManager.shared.shareFileToWeChat(fileUrl: destinationURL, filename: fileName, ext: fileExtension)
}
} else if eventType == .saveImg {
if FileManager.default.fileExists(atPath: destinationURL.path) {
YHHUD.flash(message: "已下载PDF")
return
}
// if FileManager.default.fileExists(atPath: destinationURL.path) {
// YHHUD.flash(message: "已下载PDF")
// return
// }
//
if pdfDownloadUrl.isEmpty {
requestPDF()
......
......@@ -15,7 +15,7 @@ class YHPlanShareImageCell: UICollectionViewCell {
var model: YHPlanPolicyImageInfo = YHPlanPolicyImageInfo() {
didSet {
if let url = URL(string: model.model.img_url) {
if let url = URL(string: model.model.image_poster) {
imgView.kf.setImage(with: url, placeholder: UIImage(named: "global_default_image"))
} else {
imgView.image = UIImage(named: "global_default_image")
......
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