|
|
@@ -223,27 +223,92 @@
|
|
|
|
|
|
_curCouldPhoneFileModel = curCouldPhoneFileModel;
|
|
|
|
|
|
- //[[downloadThumbnailManager shareInstance] handlToDownloadOneThumbnailWith:_curCouldPhoneFileModel];
|
|
|
- [[downloadThumbnailManager shareInstance] handlToDownloadThumbnailInDownTableViewWith:@[_curCouldPhoneFileModel]];
|
|
|
+ //[[downloadThumbnailManager shareInstance] handlToDownloadThumbnailInDownTableViewWith:@[_curCouldPhoneFileModel]];
|
|
|
|
|
|
if(_curCouldPhoneFileModel.curDownloadStateType != downloadStateDone){
|
|
|
//HLog(@"hhhhhhh2 %@ %ld ",_curCouldPhoneFileModel.name,_curCouldPhoneFileModel.didDownloadBytes);
|
|
|
}
|
|
|
|
|
|
-// NSString*pathStr = [cachesFileManager getFilePathWithName:curUploadFileDataModel.filename type:curUploadFileDataModel.curUploadFileType];
|
|
|
-// UIImage *image = [UIImage imageWithContentsOfFile:pathStr];
|
|
|
-//
|
|
|
-// if(image){
|
|
|
-// _fileImageView.image = image;
|
|
|
-// }
|
|
|
-// else
|
|
|
+ NSString *filePath = _curCouldPhoneFileModel.path;
|
|
|
+ NSString *urlStr = ksharedAppDelegate.NASFileByBoxService;
|
|
|
+ NSString *fileUrl = [[NSString alloc] initWithFormat:@"%@getThumbnail?path=%@",urlStr,filePath];
|
|
|
+
|
|
|
+ UIImage *placeholderImage = nil;
|
|
|
+
|
|
|
+ if([curCouldPhoneFileModel.fileType isEqualToString:@"video"])
|
|
|
+ {
|
|
|
+ placeholderImage = [UIImage imageNamed:@"uploadFile_Video"];
|
|
|
+ }
|
|
|
+ else if([curCouldPhoneFileModel.fileType containsString:@"jpg"])
|
|
|
+ {
|
|
|
+ placeholderImage = [UIImage imageNamed:@"uploadFile_image"];
|
|
|
+
|
|
|
+ //iOS格式的图片 代理拿不到缩略图
|
|
|
+ if([filePath rangeOfString:@".HEIC"].location != NSNotFound
|
|
|
+ ||[filePath rangeOfString:@".heic"].location != NSNotFound){
|
|
|
+ fileUrl = [[NSString alloc] initWithFormat:@"%@getFile?path=%@",urlStr,filePath];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if([curCouldPhoneFileModel.fileType isEqualToString:@"audio"])
|
|
|
+ {
|
|
|
+ _fileImageView.image = [UIImage imageNamed:@"uploadFile_audio"];
|
|
|
+ }
|
|
|
+ else if([curCouldPhoneFileModel.fileType isEqualToString:@"dir"])
|
|
|
{
|
|
|
- _fileImageView.image = [UIImage imageNamed:@"uploadFile_image"];
|
|
|
- if([curCouldPhoneFileModel.fileType isEqualToString:@"video"])
|
|
|
- {
|
|
|
- _fileImageView.image = [UIImage imageNamed:@"uploadFile_Video"];
|
|
|
+ _fileImageView.image = [UIImage imageNamed:@"uploadFile_dir"];
|
|
|
+ }
|
|
|
+ else if([curCouldPhoneFileModel.fileType isEqualToString:@"doc"])
|
|
|
+ {
|
|
|
+ //uploadFile_TXT uploadFile_pdf uploadFile_xlsx uploadFile_doc
|
|
|
+ NSArray *nameArr= [curCouldPhoneFileModel.fileType componentsSeparatedByString:@"."];
|
|
|
+ if (nameArr.count >= 2) {
|
|
|
+ NSString *lastName = nameArr.lastObject;
|
|
|
+
|
|
|
+ lastName = [lastName lowercaseString];
|
|
|
+
|
|
|
+ if ([lastName rangeOfString:@"txt"].location != NSNotFound) {
|
|
|
+ _fileImageView.image = [UIImage imageNamed:@"uploadFile_TXT"];
|
|
|
+ }
|
|
|
+ else if ([lastName rangeOfString:@"pdf"].location != NSNotFound) {
|
|
|
+ _fileImageView.image = [UIImage imageNamed:@"uploadFile_pdf"];
|
|
|
+ }
|
|
|
+ else if ([lastName rangeOfString:@"xlsx"].location != NSNotFound) {
|
|
|
+ _fileImageView.image = [UIImage imageNamed:@"uploadFile_xlsx"];
|
|
|
+ }
|
|
|
+ else if ([lastName rangeOfString:@"doc"].location != NSNotFound) {
|
|
|
+ _fileImageView.image = [UIImage imageNamed:@"uploadFile_doc"];
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ _fileImageView.image = [UIImage imageNamed:@"uploadFile_other"];
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ _fileImageView.image = [UIImage imageNamed:@"uploadFile_other"];
|
|
|
}
|
|
|
+
|
|
|
+ if([curCouldPhoneFileModel.fileType isEqualToString:@"video"]
|
|
|
+ ||([curCouldPhoneFileModel.fileType containsString:@"jpg"])){
|
|
|
+ fileUrl = [fileUrl stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
|
|
|
+
|
|
|
+ [_fileImageView sd_setImageWithURL:[NSURL URLWithString:fileUrl] placeholderImage:placeholderImage completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) {
|
|
|
+ if(image){
|
|
|
+ //HLog(@"11图片1:%@",imageURL.absoluteString);
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ //HLog(@"11图片0:%@",imageURL.absoluteString);
|
|
|
+ }
|
|
|
+ }];
|
|
|
+ }
|
|
|
+
|
|
|
+// {
|
|
|
+// _fileImageView.image = [UIImage imageNamed:@"uploadFile_image"];
|
|
|
+// if([curCouldPhoneFileModel.fileType isEqualToString:@"video"])
|
|
|
+// {
|
|
|
+// _fileImageView.image = [UIImage imageNamed:@"uploadFile_Video"];
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
NSString *fileName = [_curCouldPhoneFileModel getFileNameFun];
|
|
|
NSString*pathStr = [cachesFileManager getFilePathWithName:fileName type:DownLoadThumbnail];
|