|
@@ -21,6 +21,7 @@
|
|
|
#import "editShareView.h"
|
|
|
#import "previewToUploadFileView.h"
|
|
|
#import "NASFilePicModel.h"
|
|
|
+#import "imageDetailsScrollViewController.h"
|
|
|
|
|
|
@interface previewImageOrVideoViewController ()<UICollectionViewDelegate,UICollectionViewDataSource,DZNEmptyDataSetSource, DZNEmptyDataSetDelegate>
|
|
|
{
|
|
@@ -370,15 +371,15 @@
|
|
|
cell.curFileModel = dataModel;
|
|
|
|
|
|
KWeakSelf
|
|
|
-// cell.didClckSelectBut = ^(BOOL selectType){
|
|
|
-// if([weakSelf userCheckFileModel:fileModel withShowTip:YES]){
|
|
|
-// [weakSelf userCheckFilePreviewByRow:row];
|
|
|
-// }
|
|
|
-// };
|
|
|
-//
|
|
|
-// cell.didClickEditType = ^(BOOL editType) {
|
|
|
-// [self setViewEditTypeFun];
|
|
|
-// };
|
|
|
+ cell.didClckSelectBut = ^(BOOL selectType){
|
|
|
+ if([weakSelf userCheckFileModel:dataModel withShowTip:YES]){
|
|
|
+ [weakSelf userCheckFilePreviewByRow:row];
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ cell.didClickEditType = ^(BOOL editType) {
|
|
|
+ [weakSelf setViewEditTypeFun];
|
|
|
+ };
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -388,8 +389,13 @@
|
|
|
|
|
|
- (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath{
|
|
|
if ([kind isEqualToString:UICollectionElementKindSectionHeader]) {
|
|
|
+ NSInteger section = indexPath.section;
|
|
|
titleLabelReusableView *headerView = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"titleLabelReusableView" forIndexPath:indexPath];
|
|
|
- headerView.titlelabel.text = @"2025年13月32号";
|
|
|
+
|
|
|
+ if(_curNASFilePicModel && _curNASFilePicModel.data.count > section){
|
|
|
+ NASFilePicTimeArrModel *timeArrModel = _curNASFilePicModel.data[section];
|
|
|
+ headerView.titlelabel.text = timeArrModel.time;
|
|
|
+ }
|
|
|
return headerView;
|
|
|
}
|
|
|
|
|
@@ -401,6 +407,23 @@
|
|
|
return CGSizeMake([UIScreen mainScreen].bounds.size.width, 40);
|
|
|
}
|
|
|
|
|
|
+- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
|
|
|
+{
|
|
|
+ NSInteger row = indexPath.row;
|
|
|
+ NSInteger section = indexPath.section;
|
|
|
+
|
|
|
+ if(_curNASFilePicModel && _curNASFilePicModel.data.count > section){
|
|
|
+ NASFilePicTimeArrModel *timeArrModel = _curNASFilePicModel.data[section];
|
|
|
+ if (timeArrModel.list.count > row) {
|
|
|
+ //NASFilePicDataArrModel * dataModel = timeArrModel.list[row];
|
|
|
+
|
|
|
+ if(_isPhotoType){
|
|
|
+ [self didClickPicDetailsWithSection:section withRow:row];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
#pragma mark 空数据
|
|
|
- (UIImage *)imageForEmptyDataSet:(UIScrollView *)scrollView {
|
|
|
|
|
@@ -431,51 +454,51 @@
|
|
|
//需求说明:解决除JPG PNG GIF TIFF BMP总计5种格式外,其他格式下载失败的问题
|
|
|
//视觉交互:选择文件中含有其他格式,toast提示“IOS系统仅支持JPG 、PNG、GIF、TIFF、BMP的图片格式,其他格式无法下载”。点击下载按钮,过滤其他格式文件,仅下载JPG 、PNG、GIF、TIFF、BMP的图片格式文件;
|
|
|
|
|
|
-- (BOOL)userCheckFileModel:(couldPhoneFileModel*)fileModel withShowTip:(BOOL)canShow{
|
|
|
- NSString*name = [fileModel.name lowercaseString];
|
|
|
- NSArray *nameArr = [name componentsSeparatedByString:@"."];
|
|
|
- if(nameArr.count >0 && !_isPhotoType){
|
|
|
- BOOL canDownLoadType = NO;
|
|
|
-
|
|
|
- NSString *lastName = nameArr.lastObject;
|
|
|
- if([lastName isEqualToString:@"mp4"]
|
|
|
- ||[lastName isEqualToString:@"mov"]
|
|
|
- ||[lastName isEqualToString:@"3gp"]
|
|
|
- ||[lastName isEqualToString:@"m4v"]){
|
|
|
- canDownLoadType = YES;
|
|
|
- }
|
|
|
-
|
|
|
- if(!canDownLoadType){
|
|
|
- if(canShow){
|
|
|
- [[iToast makeText:NSLocalizedString(@"download_video_disable_state",nil)] show];
|
|
|
- }
|
|
|
-
|
|
|
- return NO;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if(nameArr.count >0 && _isPhotoType){
|
|
|
- BOOL canDownLoadType = NO;
|
|
|
- //JPG 、PNG、GIF、TIFF、BMP
|
|
|
- NSString *lastName = nameArr.lastObject;
|
|
|
- if([lastName isEqualToString:@"jpg"]
|
|
|
- ||[lastName isEqualToString:@"png"]
|
|
|
- ||[lastName isEqualToString:@"gif"]
|
|
|
- ||[lastName isEqualToString:@"tiff"]
|
|
|
- ||[lastName isEqualToString:@"bmp"]
|
|
|
- ||[lastName isEqualToString:@"heic"]
|
|
|
- ||[lastName isEqualToString:@"jpeg"]
|
|
|
- ||[lastName isEqualToString:@"heif"]){
|
|
|
- canDownLoadType = YES;
|
|
|
- }
|
|
|
-
|
|
|
- if(!canDownLoadType){
|
|
|
- if(canShow){
|
|
|
- [[iToast makeText:NSLocalizedString(@"download_image_disable_state",nil)] show];
|
|
|
- }
|
|
|
- return NO;
|
|
|
- }
|
|
|
- }
|
|
|
+- (BOOL)userCheckFileModel:(NASFilePicDataArrModel*)fileModel withShowTip:(BOOL)canShow{
|
|
|
+// NSString*name = [fileModel.name lowercaseString];
|
|
|
+// NSArray *nameArr = [name componentsSeparatedByString:@"."];
|
|
|
+// if(nameArr.count >0 && !_isPhotoType){
|
|
|
+// BOOL canDownLoadType = NO;
|
|
|
+//
|
|
|
+// NSString *lastName = nameArr.lastObject;
|
|
|
+// if([lastName isEqualToString:@"mp4"]
|
|
|
+// ||[lastName isEqualToString:@"mov"]
|
|
|
+// ||[lastName isEqualToString:@"3gp"]
|
|
|
+// ||[lastName isEqualToString:@"m4v"]){
|
|
|
+// canDownLoadType = YES;
|
|
|
+// }
|
|
|
+//
|
|
|
+// if(!canDownLoadType){
|
|
|
+// if(canShow){
|
|
|
+// [[iToast makeText:NSLocalizedString(@"download_video_disable_state",nil)] show];
|
|
|
+// }
|
|
|
+//
|
|
|
+// return NO;
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+// if(nameArr.count >0 && _isPhotoType){
|
|
|
+// BOOL canDownLoadType = NO;
|
|
|
+// //JPG 、PNG、GIF、TIFF、BMP
|
|
|
+// NSString *lastName = nameArr.lastObject;
|
|
|
+// if([lastName isEqualToString:@"jpg"]
|
|
|
+// ||[lastName isEqualToString:@"png"]
|
|
|
+// ||[lastName isEqualToString:@"gif"]
|
|
|
+// ||[lastName isEqualToString:@"tiff"]
|
|
|
+// ||[lastName isEqualToString:@"bmp"]
|
|
|
+// ||[lastName isEqualToString:@"heic"]
|
|
|
+// ||[lastName isEqualToString:@"jpeg"]
|
|
|
+// ||[lastName isEqualToString:@"heif"]){
|
|
|
+// canDownLoadType = YES;
|
|
|
+// }
|
|
|
+//
|
|
|
+// if(!canDownLoadType){
|
|
|
+// if(canShow){
|
|
|
+// [[iToast makeText:NSLocalizedString(@"download_image_disable_state",nil)] show];
|
|
|
+// }
|
|
|
+// return NO;
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
return YES;
|
|
|
}
|
|
@@ -721,7 +744,10 @@
|
|
|
[self showDownloadTipFun];
|
|
|
[self checkFileTransferTask];
|
|
|
|
|
|
- [self getFileListFun];
|
|
|
+ if(!_curNASFilePicModel){
|
|
|
+ [self getFileListFun];
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
- (void)viewWillDisappear:(BOOL)animated{
|
|
@@ -833,4 +859,28 @@
|
|
|
}];
|
|
|
}
|
|
|
|
|
|
+#pragma mark 点击图片详情
|
|
|
+- (void)didClickPicDetailsWithSection:(NSInteger)section withRow:(NSInteger)row{
|
|
|
+
|
|
|
+ if(_curNASFilePicModel){
|
|
|
+ NSMutableArray *totalArr = [NSMutableArray new];
|
|
|
+ NSInteger index = 0;
|
|
|
+
|
|
|
+ for (int i=0; i<_curNASFilePicModel.data.count; i++) {
|
|
|
+ NASFilePicTimeArrModel *timeModel = _curNASFilePicModel.data[i];
|
|
|
+
|
|
|
+ if(i == section){
|
|
|
+ index = totalArr.count + row;
|
|
|
+ }
|
|
|
+
|
|
|
+ [totalArr addObjectsFromArray:timeModel.list];
|
|
|
+ }
|
|
|
+
|
|
|
+ imageDetailsScrollViewController *vc = [imageDetailsScrollViewController new];
|
|
|
+ vc.index = index;
|
|
|
+ vc.totalDataArr = totalArr;
|
|
|
+ [self.navigationController pushViewController:vc animated:YES];
|
|
|
+
|
|
|
+ }
|
|
|
+}
|
|
|
@end
|