|
@@ -281,14 +281,14 @@
|
|
|
if(row < _curCouldPhoneFileListMod.data.list.count){
|
|
|
couldPhoneFileModel* fileModel = _curCouldPhoneFileListMod.data.list[row];
|
|
|
cell.curFileModel = fileModel;
|
|
|
+
|
|
|
+ KWeakSelf
|
|
|
+ cell.didClickSwitch = ^(BOOL SwitchOn) {
|
|
|
+ if([weakSelf userCheckFileModel:fileModel withShowTip:YES]){
|
|
|
+ [weakSelf userCheckFilePreviewByRow:row];
|
|
|
+ }
|
|
|
+ };
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
- KWeakSelf
|
|
|
- cell.didClickSwitch = ^(BOOL SwitchOn) {
|
|
|
- [weakSelf userCheckFilePreviewByRow:row];
|
|
|
- };
|
|
|
-
|
|
|
return cell;
|
|
|
}
|
|
|
|
|
@@ -318,6 +318,63 @@
|
|
|
return -150;
|
|
|
}
|
|
|
|
|
|
+//ios端:
|
|
|
+//1、需求说明:解决除MP4 MOV 3GP M4V 总计4种格式外,其他格式下载失败的问题;
|
|
|
+//2、交互说明:下载列表勾选文件中含有其他格式,toast提示“IOS系统仅支持MP4、MOV、3GP、M4V 的视频格式,其他格式无法下载”。点击下载按钮,过滤其他格式文件,仅下载MP4、MOV、3GP、M4V 的视频格式文件;
|
|
|
+
|
|
|
+//ios支持图片格式: (SVG 不支持)
|
|
|
+//需求说明:解决除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;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return YES;
|
|
|
+}
|
|
|
+
|
|
|
- (void)userCheckFilePreviewByRow:(NSInteger)row
|
|
|
{
|
|
|
if(row < _curCouldPhoneFileListMod.data.list.count){
|
|
@@ -331,9 +388,30 @@
|
|
|
- (void)didClickSelectAllButton:(UIButton*)button
|
|
|
{
|
|
|
button.selected = !button.selected;
|
|
|
-
|
|
|
+ BOOL isNeedShowTip = NO;
|
|
|
for (couldPhoneFileModel* fileModel in _curCouldPhoneFileListMod.data.list) {
|
|
|
- fileModel.isSelectType = button.selected;
|
|
|
+
|
|
|
+ if(!button.selected){
|
|
|
+ fileModel.isSelectType = button.selected;
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ if([self userCheckFileModel:fileModel withShowTip:NO]){
|
|
|
+ fileModel.isSelectType = button.selected;
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ isNeedShowTip = YES;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ if(isNeedShowTip){
|
|
|
+ if(_isPhotoType){
|
|
|
+ [[iToast makeText:NSLocalizedString(@"download_image_disable_state",nil)] show];
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ [[iToast makeText:NSLocalizedString(@"download_video_disable_state",nil)] show];
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
[self.tableView reloadData];
|