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

// plan

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