Commit ce82210b1cd2240e2fa9a58c1e48d26248a345cc
1 parent
2fb50746
上传图片失败时也返回回调 , 清空灰色占位图
Showing
3 changed files
with
17 additions
and
5 deletions
metaCode/Classes/Common/Util/CNLiveCommonQiniuTool.swift
| @@ -163,14 +163,23 @@ class UploadManager: NSObject { | @@ -163,14 +163,23 @@ class UploadManager: NSObject { | ||
| 163 | } else { | 163 | } else { |
| 164 | showLoading(message: "上传失败") | 164 | showLoading(message: "上传失败") |
| 165 | } | 165 | } |
| 166 | + if success != nil { | ||
| 167 | + success!("", "") | ||
| 168 | + } | ||
| 166 | } | 169 | } |
| 167 | }, option: uploadOption) | 170 | }, option: uploadOption) |
| 168 | } | 171 | } |
| 169 | } else { | 172 | } else { |
| 170 | showMessage(message: resp["errorMessage"] as! String) | 173 | showMessage(message: resp["errorMessage"] as! String) |
| 174 | + if success != nil { | ||
| 175 | + success!("", "") | ||
| 176 | + } | ||
| 171 | } | 177 | } |
| 172 | } else { | 178 | } else { |
| 173 | showMessage(message: error?.localizedDescription ?? "上传失败") | 179 | showMessage(message: error?.localizedDescription ?? "上传失败") |
| 180 | + if success != nil { | ||
| 181 | + success!("", "") | ||
| 182 | + } | ||
| 174 | } | 183 | } |
| 175 | } | 184 | } |
| 176 | } | 185 | } |
metaCode/Classes/Main/HomePage/Controller/DigitalAuth/证书相关页面/CNLiveVitaeAddCertificateController.swift
| @@ -113,11 +113,13 @@ class CNLiveVitaeAddCertificateController:CNLiveBaseViewController,UITableViewDa | @@ -113,11 +113,13 @@ class CNLiveVitaeAddCertificateController:CNLiveBaseViewController,UITableViewDa | ||
| 113 | return cell | 113 | return cell |
| 114 | } | 114 | } |
| 115 | cell.selectImageBlock = { image,key,url in | 115 | cell.selectImageBlock = { image,key,url in |
| 116 | - self.isAddCerPhoto = false | ||
| 117 | - self.tableView.reloadData() | ||
| 118 | - self.seleImage = image | ||
| 119 | - self.seleImageUrl = url | ||
| 120 | - self.bottomZhiNanWhiteView.isHidden = false | 116 | + if url.count > 0{ |
| 117 | + self.isAddCerPhoto = false | ||
| 118 | + self.tableView.reloadData() | ||
| 119 | + self.seleImage = image | ||
| 120 | + self.seleImageUrl = url | ||
| 121 | + self.bottomZhiNanWhiteView.isHidden = false | ||
| 122 | + } | ||
| 121 | } | 123 | } |
| 122 | return cell | 124 | return cell |
| 123 | }else{ | 125 | }else{ |
metaCode/Classes/Main/HomePage/View/Shop/GoodsManager/CNLiveAddGoodsSelectUploadImageView.swift
| @@ -841,6 +841,7 @@ class CNLiveAddGoodsSelectUploadImageView: UIView,UIImagePickerControllerDelegat | @@ -841,6 +841,7 @@ class CNLiveAddGoodsSelectUploadImageView: UIView,UIImagePickerControllerDelegat | ||
| 841 | model.uploadingPercent = percent | 841 | model.uploadingPercent = percent |
| 842 | self?.replaceImageModelInDataArr(model: model, target: image) | 842 | self?.replaceImageModelInDataArr(model: model, target: image) |
| 843 | } successBlock: { key, url in | 843 | } successBlock: { key, url in |
| 844 | + print("111111uplaod key:\(key),url:\(url)") | ||
| 844 | model.imageUrl = url | 845 | model.imageUrl = url |
| 845 | model.isUploading = false | 846 | model.isUploading = false |
| 846 | model.uploadKey = nil | 847 | model.uploadKey = nil |