瀏覽代碼

1.图片和视频的初步UI完成,交互未处理

huangxiaodong 1 年之前
父節點
當前提交
dc33f948c6

+ 52 - 0
创维盒子/双子星云手机.xcodeproj/project.pbxproj

@@ -209,6 +209,18 @@
 		6B304EA52BEF6944004F5580 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6B304E9F2BEF68DB004F5580 /* SystemConfiguration.framework */; };
 		6B304EA62BEF6954004F5580 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6B304EA12BEF68F1004F5580 /* CoreGraphics.framework */; };
 		6B304EA72BEF6967004F5580 /* CoreTelephony.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6B304EA32BEF6911004F5580 /* CoreTelephony.framework */; };
+		6B34DC4D2BF1BA11002DD1EF /* previewImageOrVideoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B34DC4C2BF1BA11002DD1EF /* previewImageOrVideoViewController.m */; };
+		6B34DC4E2BF1BA11002DD1EF /* previewImageOrVideoViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B34DC4B2BF1BA11002DD1EF /* previewImageOrVideoViewController.h */; };
+		6B34DC4F2BF1BA11002DD1EF /* previewImageOrVideoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B34DC4C2BF1BA11002DD1EF /* previewImageOrVideoViewController.m */; };
+		6B34DC502BF1BA11002DD1EF /* previewImageOrVideoViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B34DC4B2BF1BA11002DD1EF /* previewImageOrVideoViewController.h */; };
+		6B34DC662BF1FFB1002DD1EF /* imageCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B34DC652BF1FFB1002DD1EF /* imageCollectionViewCell.m */; };
+		6B34DC672BF1FFB1002DD1EF /* imageCollectionViewCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B34DC642BF1FFB1002DD1EF /* imageCollectionViewCell.h */; };
+		6B34DC682BF1FFB1002DD1EF /* imageCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B34DC652BF1FFB1002DD1EF /* imageCollectionViewCell.m */; };
+		6B34DC692BF1FFB1002DD1EF /* imageCollectionViewCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B34DC642BF1FFB1002DD1EF /* imageCollectionViewCell.h */; };
+		6B34DC6C2BF2070D002DD1EF /* titleLabelReusableView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B34DC6B2BF2070D002DD1EF /* titleLabelReusableView.m */; };
+		6B34DC6D2BF2070D002DD1EF /* titleLabelReusableView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B34DC6A2BF2070D002DD1EF /* titleLabelReusableView.h */; };
+		6B34DC6E2BF2070D002DD1EF /* titleLabelReusableView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B34DC6B2BF2070D002DD1EF /* titleLabelReusableView.m */; };
+		6B34DC6F2BF2070D002DD1EF /* titleLabelReusableView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B34DC6A2BF2070D002DD1EF /* titleLabelReusableView.h */; };
 		6B3A4B152B6F69A500F74679 /* cloudPhoneCommonModel.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B3A4B132B6F69A500F74679 /* cloudPhoneCommonModel.h */; };
 		6B3A4B162B6F69A500F74679 /* cloudPhoneCommonModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B3A4B142B6F69A500F74679 /* cloudPhoneCommonModel.m */; };
 		6B3F96342AD2A15A008E349E /* netWorkManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B3F96322AD2A15A008E349E /* netWorkManager.h */; };
@@ -1047,6 +1059,12 @@
 		6B304E9F2BEF68DB004F5580 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
 		6B304EA12BEF68F1004F5580 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
 		6B304EA32BEF6911004F5580 /* CoreTelephony.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreTelephony.framework; path = System/Library/Frameworks/CoreTelephony.framework; sourceTree = SDKROOT; };
+		6B34DC4B2BF1BA11002DD1EF /* previewImageOrVideoViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = previewImageOrVideoViewController.h; sourceTree = "<group>"; };
+		6B34DC4C2BF1BA11002DD1EF /* previewImageOrVideoViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = previewImageOrVideoViewController.m; sourceTree = "<group>"; };
+		6B34DC642BF1FFB1002DD1EF /* imageCollectionViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = imageCollectionViewCell.h; sourceTree = "<group>"; };
+		6B34DC652BF1FFB1002DD1EF /* imageCollectionViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = imageCollectionViewCell.m; sourceTree = "<group>"; };
+		6B34DC6A2BF2070D002DD1EF /* titleLabelReusableView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = titleLabelReusableView.h; sourceTree = "<group>"; };
+		6B34DC6B2BF2070D002DD1EF /* titleLabelReusableView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = titleLabelReusableView.m; sourceTree = "<group>"; };
 		6B3A4B132B6F69A500F74679 /* cloudPhoneCommonModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = cloudPhoneCommonModel.h; sourceTree = "<group>"; };
 		6B3A4B142B6F69A500F74679 /* cloudPhoneCommonModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = cloudPhoneCommonModel.m; sourceTree = "<group>"; };
 		6B3F96322AD2A15A008E349E /* netWorkManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = netWorkManager.h; sourceTree = "<group>"; };
@@ -1713,6 +1731,7 @@
 		18C4754C2A8E0D9B006129C0 /* Set */ = {
 			isa = PBXGroup;
 			children = (
+				6B34DC4A2BF1B9F2002DD1EF /* previewFile */,
 				6BEA31722BB654F4005167AA /* clearCache */,
 				6B21708E2B15BAC300656670 /* privacyMode */,
 				6B05815D2AFCD0A900D37290 /* uploadFile */,
@@ -1898,6 +1917,27 @@
 			path = privacyMode;
 			sourceTree = "<group>";
 		};
+		6B34DC4A2BF1B9F2002DD1EF /* previewFile */ = {
+			isa = PBXGroup;
+			children = (
+				6B34DC512BF1C1A3002DD1EF /* view */,
+				6B34DC4B2BF1BA11002DD1EF /* previewImageOrVideoViewController.h */,
+				6B34DC4C2BF1BA11002DD1EF /* previewImageOrVideoViewController.m */,
+			);
+			path = previewFile;
+			sourceTree = "<group>";
+		};
+		6B34DC512BF1C1A3002DD1EF /* view */ = {
+			isa = PBXGroup;
+			children = (
+				6B34DC642BF1FFB1002DD1EF /* imageCollectionViewCell.h */,
+				6B34DC652BF1FFB1002DD1EF /* imageCollectionViewCell.m */,
+				6B34DC6A2BF2070D002DD1EF /* titleLabelReusableView.h */,
+				6B34DC6B2BF2070D002DD1EF /* titleLabelReusableView.m */,
+			);
+			path = view;
+			sourceTree = "<group>";
+		};
 		6B3F96312AD2A0FA008E349E /* netWork */ = {
 			isa = PBXGroup;
 			children = (
@@ -2482,6 +2522,7 @@
 				6BA533382B16E65500D1CB5C /* TvStatusModel.h in Headers */,
 				6BBB35E22AE935C000E4A59B /* DDYLanguageTool.h in Headers */,
 				6B1FBD262B4503E700926382 /* photosBackupsTaskModel.h in Headers */,
+				6B34DC4E2BF1BA11002DD1EF /* previewImageOrVideoViewController.h in Headers */,
 				6BFF26882AF8949F00FCB4F7 /* playerShowSecretkeyView.h in Headers */,
 				6BF0F3D52AD3937B000AA133 /* DeviceThirdIdModel.h in Headers */,
 				6B2170982B15CD9200656670 /* NSDictionary+Log.h in Headers */,
@@ -2545,6 +2586,7 @@
 				6B5D40152B47F27A000965CF /* couldPhoneCommonModel.h in Headers */,
 				18BB18412AC417CB00A36F63 /* RYShearDeviceUDPManager.h in Headers */,
 				184C8AD52A949D5900F26650 /* AboutViewController.h in Headers */,
+				6B34DC672BF1FFB1002DD1EF /* imageCollectionViewCell.h in Headers */,
 				6B0581A22AFCF50300D37290 /* AJPhotoListCell.h in Headers */,
 				187076772A9F400300F15F7F /* PlayerLoadingView.h in Headers */,
 				6B1CC2CE2B6B6D6B00AD4217 /* commandSendCheckModel.h in Headers */,
@@ -2561,6 +2603,7 @@
 				6B1FBD3E2B46875300926382 /* backupsFileRecordCell.h in Headers */,
 				186820192AB94877005702A6 /* GuideLastView.h in Headers */,
 				6B0582632AFF4B7D00D37290 /* PhotoPreviewViewController.h in Headers */,
+				6B34DC6D2BF2070D002DD1EF /* titleLabelReusableView.h in Headers */,
 				6B304E982BEF6058004F5580 /* customShareManageTool.h in Headers */,
 				6B5D402F2B4BCBC1000965CF /* downLoadPreViewCell.h in Headers */,
 				6B0581AD2AFCF57300D37290 /* AJPhotoGroupView.h in Headers */,
@@ -2612,6 +2655,7 @@
 				6BD506B42B9576A4006E7CB0 /* TvStatusModel.h in Headers */,
 				6BD506B52B9576A4006E7CB0 /* DDYLanguageTool.h in Headers */,
 				6BD506B62B9576A4006E7CB0 /* photosBackupsTaskModel.h in Headers */,
+				6B34DC502BF1BA11002DD1EF /* previewImageOrVideoViewController.h in Headers */,
 				6BD506B72B9576A4006E7CB0 /* playerShowSecretkeyView.h in Headers */,
 				6BD506B82B9576A4006E7CB0 /* DeviceThirdIdModel.h in Headers */,
 				6BD506B92B9576A4006E7CB0 /* NSDictionary+Log.h in Headers */,
@@ -2675,6 +2719,7 @@
 				6BD506F02B9576A4006E7CB0 /* couldPhoneCommonModel.h in Headers */,
 				6BD506F12B9576A4006E7CB0 /* RYShearDeviceUDPManager.h in Headers */,
 				6BD506F22B9576A4006E7CB0 /* AboutViewController.h in Headers */,
+				6B34DC692BF1FFB1002DD1EF /* imageCollectionViewCell.h in Headers */,
 				6BD506F32B9576A4006E7CB0 /* AJPhotoListCell.h in Headers */,
 				6BD506F42B9576A4006E7CB0 /* PlayerLoadingView.h in Headers */,
 				6BD506F52B9576A4006E7CB0 /* commandSendCheckModel.h in Headers */,
@@ -2691,6 +2736,7 @@
 				6BD507002B9576A4006E7CB0 /* backupsFileRecordCell.h in Headers */,
 				6BD507012B9576A4006E7CB0 /* GuideLastView.h in Headers */,
 				6BD507022B9576A4006E7CB0 /* PhotoPreviewViewController.h in Headers */,
+				6B34DC6F2BF2070D002DD1EF /* titleLabelReusableView.h in Headers */,
 				6B304E992BEF6058004F5580 /* customShareManageTool.h in Headers */,
 				6BD507032B9576A4006E7CB0 /* downLoadPreViewCell.h in Headers */,
 				6BD507042B9576A4006E7CB0 /* AJPhotoGroupView.h in Headers */,
@@ -3157,6 +3203,7 @@
 				6BD5075A2B9576A4006E7CB0 /* PlayerViewController+backupsFile.m in Sources */,
 				6BD5075B2B9576A4006E7CB0 /* couldphoneSysInfoModel.m in Sources */,
 				6BD5075C2B9576A4006E7CB0 /* BGTool.m in Sources */,
+				6B34DC682BF1FFB1002DD1EF /* imageCollectionViewCell.m in Sources */,
 				6BD5075D2B9576A4006E7CB0 /* JSONModelClassProperty.m in Sources */,
 				6BD5075E2B9576A4006E7CB0 /* uploadFileManager.m in Sources */,
 				6BD5075F2B9576A4006E7CB0 /* QRCodeScanForChangeDeviceViewController.m in Sources */,
@@ -3169,6 +3216,7 @@
 				6BD507662B9576A4006E7CB0 /* JSONKeyMapper.m in Sources */,
 				6BD507672B9576A4006E7CB0 /* SimplePing.m in Sources */,
 				6BD507682B9576A4006E7CB0 /* FMResultSet.m in Sources */,
+				6B34DC6E2BF2070D002DD1EF /* titleLabelReusableView.m in Sources */,
 				6BD507692B9576A4006E7CB0 /* UIScrollView+EmptyDataSet.m in Sources */,
 				6BD5076A2B9576A4006E7CB0 /* SafeForKey.m in Sources */,
 				6BD5076B2B9576A4006E7CB0 /* JSONModel.m in Sources */,
@@ -3228,6 +3276,7 @@
 				6BD507A02B9576A4006E7CB0 /* playerShowSecretkeyView.m in Sources */,
 				6BD507A12B9576A4006E7CB0 /* uploadFileRecordCell.m in Sources */,
 				6BD507A22B9576A4006E7CB0 /* BaseNavigationController.m in Sources */,
+				6B34DC4F2BF1BA11002DD1EF /* previewImageOrVideoViewController.m in Sources */,
 				6BD507A32B9576A4006E7CB0 /* HWFolderModel.m in Sources */,
 				6BD507A42B9576A4006E7CB0 /* fileTransferPathCheckViewController.m in Sources */,
 				6BD507A52B9576A4006E7CB0 /* RCCommandHelp.m in Sources */,
@@ -3372,6 +3421,7 @@
 				6B1FBD372B455DD600926382 /* PlayerViewController+backupsFile.m in Sources */,
 				6B21708D2B14BDAA00656670 /* couldphoneSysInfoModel.m in Sources */,
 				A08A94FE27E9A4E400C544BB /* BGTool.m in Sources */,
+				6B34DC662BF1FFB1002DD1EF /* imageCollectionViewCell.m in Sources */,
 				183AE6072A89CE3C00B11CB0 /* JSONModelClassProperty.m in Sources */,
 				6B0582862B0457C400D37290 /* uploadFileManager.m in Sources */,
 				18F9CB082ABD7835003FF71A /* QRCodeScanForChangeDeviceViewController.m in Sources */,
@@ -3384,6 +3434,7 @@
 				183AE6032A89CE3C00B11CB0 /* JSONKeyMapper.m in Sources */,
 				6BF52C9B2AD5546500A617DB /* SimplePing.m in Sources */,
 				A08A950427E9A4E400C544BB /* FMResultSet.m in Sources */,
+				6B34DC6C2BF2070D002DD1EF /* titleLabelReusableView.m in Sources */,
 				A003F6C227D841FF00715CBF /* UIScrollView+EmptyDataSet.m in Sources */,
 				183AE7C82A8CB39100B11CB0 /* SafeForKey.m in Sources */,
 				183AE6042A89CE3C00B11CB0 /* JSONModel.m in Sources */,
@@ -3443,6 +3494,7 @@
 				6BFF26892AF8949F00FCB4F7 /* playerShowSecretkeyView.m in Sources */,
 				6B8FF6C22B05B24D00800981 /* uploadFileRecordCell.m in Sources */,
 				A003F6A727D841C800715CBF /* BaseNavigationController.m in Sources */,
+				6B34DC4D2BF1BA11002DD1EF /* previewImageOrVideoViewController.m in Sources */,
 				A00221E427EB256D00E45F78 /* HWFolderModel.m in Sources */,
 				6B5B606F2B3D7E3B009A2AE2 /* fileTransferPathCheckViewController.m in Sources */,
 				183AE6B02A8C9EAB00B11CB0 /* RCCommandHelp.m in Sources */,

+ 66 - 58
创维盒子/双子星云手机/Class/Set/MySetViewController.m

@@ -37,6 +37,8 @@
 #import "clearCacheAlretViewController.h"
 #import "customShareManageTool.h"
 
+#import "previewImageOrVideoViewController.h"
+
 @interface MySetViewController ()<HelpDownScrollViewDelegate,UITableViewDelegate,UITableViewDataSource,ComontAlretViewControllerDelegate>
 {
     UIButton* rightButton;
@@ -163,11 +165,17 @@
     KWeakSelf
     switch (tag) {
         case 100:{
-            [[customShareManageTool sharedManager] shareType:1 withShareUrl:@"https://baidu.com" withShareTitle:@"我是标题" withShareContent:@"我是测试内容"];
+            //[[customShareManageTool sharedManager] shareType:1 withShareUrl:@"https://baidu.com" withShareTitle:@"我是标题" withShareContent:@"我是测试内容"];
+            previewImageOrVideoViewController *vc = [previewImageOrVideoViewController new];
+            vc.isPhotoType = YES;
+            [self.navigationController pushViewController:vc animated:YES];
         }
             break;
         case 101:{
-            [[customShareManageTool sharedManager] shareType:2 withShareUrl:@"https://baidu.com" withShareTitle:@"我是标题" withShareContent:@"我是测试内容"];
+            //[[customShareManageTool sharedManager] shareType:2 withShareUrl:@"https://baidu.com" withShareTitle:@"我是标题" withShareContent:@"我是测试内容"];
+            previewImageOrVideoViewController *vc = [previewImageOrVideoViewController new];
+            vc.isPhotoType = NO;
+            [self.navigationController pushViewController:vc animated:YES];
         }
             break;
         case 102:{
@@ -205,19 +213,19 @@
             }
             
 
-            fileTransferPopView * fileTransferPopV = [[fileTransferPopView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, SCREEN_H)];
-            if(tag==2){
-                fileTransferPopV.fileTransferType =1;
-            }
-            else{
-                fileTransferPopV.fileTransferType =2;
-            }
-            [self.view.window addSubview:fileTransferPopV];
-            
-            
-            fileTransferPopV.didClickBut = ^(NSInteger tag) {
-                [weakSelf gotoFileTransferFunBy:tag];
-            };
+//            fileTransferPopView * fileTransferPopV = [[fileTransferPopView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, SCREEN_H)];
+//            if(tag==2){
+//                fileTransferPopV.fileTransferType =1;
+//            }
+//            else{
+//                fileTransferPopV.fileTransferType =2;
+//            }
+//            [self.view.window addSubview:fileTransferPopV];
+//            
+//            
+//            fileTransferPopV.didClickBut = ^(NSInteger tag) {
+//                [weakSelf gotoFileTransferFunBy:tag];
+//            };
             
         }
             break;
@@ -368,50 +376,50 @@
     [self.navigationController pushViewController:vc animated:YES];
 }
 
-- (void)checkDidHadDownloadTaskFunWith:(NSInteger)tag
-{
-    KWeakSelf
-    [[downloadManager shareInstance] getDataInDatabaseFun:YES complete:^(NSMutableArray * _Nonnull Arr) {
-        mainBlock(^{
-            if(Arr && Arr.count== 3){
-                NSArray *downloadingArr = Arr.firstObject;
-                if(downloadingArr.count == 0){
-                    [weakSelf gotoDownloadFileFunWith:tag];
-                }
-                else{
-                    [[iToast makeText:NSLocalizedString(@"download_task_not_done_tip",nil)] show];
-                }
-            }
-            else{
-                [weakSelf gotoDownloadFileFunWith:tag];
-            };
-        });
-            
-    }];
-}
-- (void)gotoDownloadFileFunWith:(NSInteger)tag
-{
-    downLoadPreviewViewController *vc = [downLoadPreviewViewController new];
-    if(tag ==12){
-        vc.isPhotoType = YES;
-    }
-    else{
-        vc.isPhotoType = NO;
-    }
-    
-    [self.navigationController pushViewController:vc animated:YES];
-}
+//- (void)checkDidHadDownloadTaskFunWith:(NSInteger)tag
+//{
+//    KWeakSelf
+//    [[downloadManager shareInstance] getDataInDatabaseFun:YES complete:^(NSMutableArray * _Nonnull Arr) {
+//        mainBlock(^{
+//            if(Arr && Arr.count== 3){
+//                NSArray *downloadingArr = Arr.firstObject;
+//                if(downloadingArr.count == 0){
+//                    [weakSelf gotoDownloadFileFunWith:tag];
+//                }
+//                else{
+//                    [[iToast makeText:NSLocalizedString(@"download_task_not_done_tip",nil)] show];
+//                }
+//            }
+//            else{
+//                [weakSelf gotoDownloadFileFunWith:tag];
+//            };
+//        });
+//            
+//    }];
+//}
+//- (void)gotoDownloadFileFunWith:(NSInteger)tag
+//{
+//    downLoadPreviewViewController *vc = [downLoadPreviewViewController new];
+//    if(tag ==12){
+//        vc.isPhotoType = YES;
+//    }
+//    else{
+//        vc.isPhotoType = NO;
+//    }
+//    
+//    [self.navigationController pushViewController:vc animated:YES];
+//}
 
-#pragma mark 点击图片或者视频
-- (void)gotoFileTransferFunBy:(NSInteger)tag
-{
-    if(tag == 11 ||tag == 21){
-        [self checkDidHadUploadTaskFunWith:tag];
-    }
-    else if(tag == 12 ||tag == 22){
-        [self checkDidHadDownloadTaskFunWith:tag];
-    }
-}
+//#pragma mark 点击图片或者视频
+//- (void)gotoFileTransferFunBy:(NSInteger)tag
+//{
+//    if(tag == 11 ||tag == 21){
+//        [self checkDidHadUploadTaskFunWith:tag];
+//    }
+//    else if(tag == 12 ||tag == 22){
+//        [self checkDidHadDownloadTaskFunWith:tag];
+//    }
+//}
 
 - (UIView *)tableFoorView{
     UIView *bgView = [[UIView alloc] initWithFrame:(CGRectMake(0, 0, SCREEN_W, 48.f + 40))];

+ 16 - 0
创维盒子/双子星云手机/Class/Set/previewFile/previewImageOrVideoViewController.h

@@ -0,0 +1,16 @@
+//
+//  previewImageOrVideoViewController.h
+//  双子星云手机
+//
+//  Created by xd h on 2024/5/13.
+//
+
+#import "BaseViewController.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface previewImageOrVideoViewController : BaseViewController
+@property (nonatomic,assign) BOOL isPhotoType;//是否为选择图片类型
+@end
+
+NS_ASSUME_NONNULL_END

+ 695 - 0
创维盒子/双子星云手机/Class/Set/previewFile/previewImageOrVideoViewController.m

@@ -0,0 +1,695 @@
+//
+//  previewImageOrVideoViewController.m
+//  双子星云手机
+//
+//  Created by xd h on 2024/5/13.
+//
+
+#import "previewImageOrVideoViewController.h"
+
+#import "couldPhoneFileListModel.h"
+#import "downLoadPreViewCell.h"
+#import "downloadFileBottomView.h"
+#import "downloadThumbnailManager.h"
+#import "downloadManager.h"
+#import "uploadFileRecordViewController.h"
+#import "UIScrollView+EmptyDataSet.h"
+#import "diskListBgView.h"
+#import "diskListTableView.h"
+#import "imageCollectionViewCell.h"
+#import "titleLabelReusableView.h"
+
+@interface previewImageOrVideoViewController ()<UICollectionViewDelegate,UICollectionViewDataSource,DZNEmptyDataSetSource, DZNEmptyDataSetDelegate>
+{
+    UIButton *tapBtn;
+}
+@property (nonatomic, strong) UICollectionView *dataCollectionView;
+
+@property (strong, nonatomic) UILabel *MytitleLabel;
+@property (strong, nonatomic) UIImageView *selectTip;
+@property (nonatomic, strong) UIButton *rightButton;
+@property (nonatomic, strong) diskListBgView *diskListBgV;
+@property (nonatomic, strong) diskListTableView *diskListTableV;
+@property (nonatomic, strong)  NSMutableArray*diskListArr;
+@property (nonatomic, copy) NSString *defaultDiskPath;
+
+
+@property (nonatomic, strong) downloadFileBottomView *downloadFileBottomV;
+
+@property(nonatomic,strong) couldPhoneFileListModel *curCouldPhoneFileListMod;
+@end
+
+@implementation previewImageOrVideoViewController
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    // Do any additional setup after loading the view.
+    
+    [self.toolBar setHidden:YES];
+    [self.navigationBar setHidden:YES];
+    [self.navBarBGView setHidden:NO];
+    self.navBarBGView.backgroundColor = [UIColor whiteColor];
+    [self.view setBackgroundColor:[UIColor whiteColor]];
+    
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(searchFileListDoneFun:) name:searchFileListDoneNotification object:nil];
+    
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didDownloadOneFileFun) name:downloadThumbnailDoneOneNotification object:nil];
+    
+    [self drawAnyView];
+}
+
+- (void)drawAnyView{
+    
+    [self initNavHeadUIFun];
+    
+    [self.view addSubview:self.dataCollectionView];
+    [self.dataCollectionView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(0);
+        make.right.mas_equalTo(0);
+        make.bottom.mas_equalTo(-(60 + safeArea));
+        make.top.equalTo(self.navBarBGView.mas_bottom).offset(10.f);
+    }];
+    
+    _downloadFileBottomV = [[downloadFileBottomView alloc] init];
+    [self.view insertSubview:_downloadFileBottomV atIndex:0];
+    
+    [_downloadFileBottomV mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(0);
+        make.right.mas_equalTo(0);
+        make.bottom.mas_equalTo(0);
+        make.height.mas_equalTo(60 + safeArea);
+    }];
+    
+    [self RefreshBottomViewUIFun];
+    
+    KWeakSelf
+    _downloadFileBottomV.didClickDownloadFile = ^{
+        [weakSelf gotoDownloadloadFileRecordFun];
+    };
+    
+    
+    NSMutableArray *arr = [NSMutableArray new];
+    NSArray *diskList = ksharedAppDelegate.cloudPhoneExtraFileListMod.data;
+    if(diskList && [diskList isKindOfClass:[NSArray class]]){
+        for (cloudPhoneExtraFileModel *model in diskList) {
+            model.isCheckType = NO;
+            [arr addObject:model];
+        }
+    }
+    
+    if(arr.count >0){
+        cloudPhoneExtraFileModel *model = arr.firstObject;
+        model.isCheckType = YES;
+        _defaultDiskPath = model.extraPath;
+    }
+    _diskListArr = arr;
+    [self setTitleAfterGetdiskFun];
+}
+
+- (void)initNavHeadUIFun
+{
+    //title
+    UILabel *titleLabel = [[UILabel alloc] init];
+    titleLabel.textAlignment = NSTextAlignmentCenter;
+    titleLabel.font = [UIFont boldSystemFontOfSize:16.0];
+    titleLabel.textColor = [UIColor blackColor];
+    titleLabel.translatesAutoresizingMaskIntoConstraints = NO;
+    [self.navBarBGView addSubview:titleLabel];
+
+    self.MytitleLabel = titleLabel;
+    
+    //selectTipImageView
+    UIImageView *selectTip = [[UIImageView alloc] init];
+    selectTip.image = [UIImage imageNamed:@"upload_image_arrow"];
+    selectTip.translatesAutoresizingMaskIntoConstraints = NO;
+    [self.navBarBGView addSubview:selectTip];
+    self.selectTip = selectTip;
+    
+    tapBtn = [UIButton buttonWithType:UIButtonTypeCustom];
+    tapBtn.backgroundColor = [UIColor clearColor];
+    tapBtn.translatesAutoresizingMaskIntoConstraints = NO;
+    [tapBtn addTarget:self action:@selector(selectDiskAction:) forControlEvents:UIControlEventTouchUpInside];
+    [self.navBarBGView addSubview:tapBtn];
+    
+    [tapBtn mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.centerX.mas_equalTo(self.navBarBGView.mas_centerX);
+        make.centerY.mas_equalTo(self.backBtn.mas_centerY);
+        make.width.mas_equalTo(100);
+        make.height.mas_equalTo(30);
+    }];
+    
+    [self setTitleLabelText:@""];
+    
+    _rightButton = [[UIButton alloc] init];
+    [_rightButton setTitle:NSLocalizedString(@"File_upload_Record_select_all",nil) forState:UIControlStateNormal];
+    [_rightButton setTitle:NSLocalizedString(@"File_upload_cancel_select_all",nil) forState:UIControlStateSelected];
+    
+    [_rightButton setTitleColor:[UIColor hwColor:@"#01B7EA" alpha:1.0] forState:UIControlStateNormal];
+    _rightButton.titleLabel.font = [UIFont systemFontOfSize:16.0];
+    _rightButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentRight;
+    [_rightButton addTarget:self action:@selector(didClickSelectAllButton:) forControlEvents:UIControlEventTouchUpInside];
+    [self.navBarBGView addSubview:_rightButton];
+    
+    //多国语言适配
+    NSString *languageCode = [NSLocale preferredLanguages][0];
+    if([languageCode rangeOfString:@"ja-"].location != NSNotFound)
+    {
+        _rightButton.titleLabel.font = [UIFont systemFontOfSize:13.0];
+    }
+    
+    [_rightButton mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.width.mas_equalTo(80);
+        make.height.mas_equalTo(40);
+        make.right.mas_equalTo(-15);
+        make.centerY.mas_equalTo(self.titleLabel.mas_centerY);
+    }];
+    
+    //_rightButton.backgroundColor = [UIColor redColor];
+}
+
+
+#pragma mark - 懒加载
+- (UICollectionView *)dataCollectionView{
+    if (!_dataCollectionView) {
+        UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
+        // 设置item的行间距和列间距
+        layout.minimumInteritemSpacing = 1;
+        layout.minimumLineSpacing = 1;
+        // 设置item的大小
+        CGFloat itemW = ([UIScreen mainScreen].bounds.size.width - 10) /4 ;
+        layout.itemSize = CGSizeMake(itemW, itemW);
+        layout.headerReferenceSize = CGSizeMake([UIScreen mainScreen].bounds.size.width, 40);
+        //layout.footerReferenceSize = CGSizeMake([UIScreen mainScreen].bounds.size.width, 40);
+        // 设置每个分区的 上左下右 的内边距
+        layout.sectionInset = UIEdgeInsetsMake(1, 1 ,1, 1);
+        // 设置区头和区尾的大小
+        layout.headerReferenceSize = CGSizeMake([UIScreen mainScreen].bounds.size.width, 10);
+        //layout.footerReferenceSize = CGSizeMake([UIScreen mainScreen].bounds.size.width, 10);
+        // 设置分区的头视图和尾视图 是否始终固定在屏幕上边和下边
+        layout.sectionFootersPinToVisibleBounds = YES;
+         //设置滚动条方向
+        layout.scrollDirection = UICollectionViewScrollDirectionVertical;
+        
+        _dataCollectionView = [[UICollectionView alloc]initWithFrame:CGRectZero collectionViewLayout:layout];
+        _dataCollectionView.backgroundColor = [UIColor whiteColor];
+        _dataCollectionView.scrollEnabled = YES;
+        
+        //注册cell
+        [_dataCollectionView registerClass:[imageCollectionViewCell class] forCellWithReuseIdentifier:@"imageCollectionViewCell"];
+    
+        [_dataCollectionView registerClass:[titleLabelReusableView class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"titleLabelReusableView"];
+
+        _dataCollectionView.delegate = self;
+        _dataCollectionView.dataSource = self;
+        
+        //空数据引入第三方开源处理
+        _dataCollectionView.emptyDataSetSource = self;
+        _dataCollectionView.emptyDataSetDelegate = self;
+    }
+    
+    return _dataCollectionView;
+}
+
+- (diskListBgView*)diskListBgV
+{
+    if(!_diskListBgV){
+        _diskListBgV = [[diskListBgView alloc] initWithFrame:CGRectMake(0, 0, 0, 0)];
+        _diskListBgV.hidden = YES;
+        [self.view addSubview:_diskListBgV];
+        
+        KWeakSelf
+        _diskListBgV.didTapWhitePlace = ^{
+            [weakSelf hideDiskListVieFun];
+        };
+        
+        [_diskListBgV mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.left.mas_equalTo(0);
+            make.bottom.mas_equalTo(0);
+            make.right.mas_equalTo(0);
+            make.top.mas_equalTo(self.navBarBGView.mas_bottom);
+        }];
+        
+        [self.view addSubview:self.diskListTableV];
+        self.diskListTableV.hidden = YES;
+        [self.diskListTableV mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.left.mas_equalTo(0);
+            make.height.mas_equalTo(3*70);
+            make.right.mas_equalTo(0);
+            make.top.mas_equalTo(self.navBarBGView.mas_bottom);
+        }];
+       
+        self.diskListTableV.diskListArr = _diskListArr;
+        
+        self.diskListTableV.didClickDiskModel = ^(NSString * _Nonnull checkPath) {
+            [weakSelf didCheckDiskFunByPath:checkPath];
+        };
+    }
+    
+    return  _diskListBgV;
+}
+
+- (UITableView *)diskListTableV{
+    if (!_diskListTableV) {
+        _diskListTableV = [[diskListTableView alloc] init];
+//
+    }
+    return _diskListTableV;
+}
+
+#pragma mark 选中磁盘
+- (void)didCheckDiskFunByPath:(NSString*)pathStr
+{
+    if(self.defaultDiskPath
+       && self.defaultDiskPath.length>0
+       && ![self.defaultDiskPath isEqualToString:pathStr]){
+        //切换硬盘了 取消全选
+        
+        _rightButton.selected = YES;
+        [self didClickSelectAllButton:_rightButton];
+    }
+    
+    self.defaultDiskPath = pathStr;
+    //[self searchFileListFun];
+    [self setTitleAfterGetdiskFun];
+    [self hideDiskListVieFun];
+}
+
+#pragma mark - 瀑布流委托
+- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView {
+    return 1;
+}
+- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
+
+    if(!_curCouldPhoneFileListMod){
+        return 0;
+    }
+    return _curCouldPhoneFileListMod.data.list.count;
+}
+
+- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
+{
+    __block NSInteger row = indexPath.row;
+    //创建item 从缓存池中拿 Item
+    imageCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"imageCollectionViewCell" forIndexPath:indexPath];
+    if(!cell){
+        cell = [[imageCollectionViewCell alloc] init];
+    }
+    
+    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];
+//            }
+//        };
+    }
+    
+    return cell;
+
+}
+
+- (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath{
+    if ([kind isEqualToString:UICollectionElementKindSectionHeader]) {
+        titleLabelReusableView *headerView = [collectionView dequeueReusableSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"titleLabelReusableView" forIndexPath:indexPath];
+        headerView.titlelabel.text = @"2025年13月32号";
+        return headerView;
+    }
+    
+    return nil;
+}
+
+- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout*)collectionViewLayout referenceSizeForHeaderInSection:(NSInteger)section{
+    
+    return CGSizeMake([UIScreen mainScreen].bounds.size.width, 40);
+}
+
+#pragma mark 空数据
+- (UIImage *)imageForEmptyDataSet:(UIScrollView *)scrollView {
+    
+    NSString *imageName = @"uploadFile_noData";
+    
+    return [UIImage imageNamed:imageName];
+}
+
+- (NSAttributedString *)titleForEmptyDataSet:(UIScrollView *)scrollView {
+    NSString *text = NSLocalizedString(@"File_download_file_no_data",nil);
+    
+    NSDictionary *attributes = @{NSFontAttributeName: [UIFont systemFontOfSize:16.0f],
+                                 NSForegroundColorAttributeName: HW999999Color};
+    
+    return [[NSAttributedString alloc] initWithString:text attributes:attributes];
+}
+
+//调整图片位置
+- (CGFloat)verticalOffsetForEmptyDataSet:(UIScrollView *)scrollView {
+    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){
+        couldPhoneFileModel* fileModel = _curCouldPhoneFileListMod.data.list[row];
+         fileModel.isSelectType = !fileModel.isSelectType;
+        //[self.tableView reloadData];
+        [self.dataCollectionView reloadData];
+        [self RefreshBottomViewUIFun];
+    }
+}
+
+- (void)didClickSelectAllButton:(UIButton*)button
+{
+    button.selected = !button.selected;
+    BOOL isNeedShowTip = NO;
+    for (couldPhoneFileModel* fileModel in _curCouldPhoneFileListMod.data.list) {
+        
+        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];
+    [self.dataCollectionView reloadData];
+    [self RefreshBottomViewUIFun];
+}
+
+#pragma mark 设置标题
+- (void)setTitleLabelText:(NSString*)title
+{
+    NSArray *diskNameArr = [_defaultDiskPath componentsSeparatedByString:@"/"];
+    if(diskNameArr && diskNameArr.count >= 2){
+        
+        NSString *name = diskNameArr.lastObject;
+        if(name.length == 0)
+        {
+            name = diskNameArr[diskNameArr.count -2];
+        }
+        
+        title = [[NSString alloc] initWithFormat:@"[%@]%@",name,title];
+    }
+    
+    
+    
+    self.MytitleLabel.text = title;
+    
+    CGFloat curWidth = [title boundingRectWithSize:CGSizeMake(SCREEN_W, 30) options:(NSStringDrawingUsesLineFragmentOrigin) attributes:@{NSFontAttributeName:[UIFont boldSystemFontOfSize:16.f]} context:nil].size.width;
+    
+    curWidth += 20;
+    //HLog(@"title w:%f",curWidth);
+    [self.MytitleLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
+        make.centerX.mas_equalTo(self.navBarBGView.mas_centerX).offset(-10);
+        make.centerY.mas_equalTo(self.backBtn.mas_centerY);
+        make.width.mas_equalTo(curWidth);
+        make.height.mas_equalTo(30);
+    }];
+    //self.MytitleLabel.backgroundColor = [UIColor greenColor];
+    
+    [self.selectTip mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(self.MytitleLabel.mas_right).offset(0);
+        make.centerY.mas_equalTo(self.backBtn.mas_centerY);
+        make.width.mas_equalTo(15);
+        make.height.mas_equalTo(15);
+    }];
+    
+    [tapBtn mas_remakeConstraints:^(MASConstraintMaker *make) {
+        make.centerX.mas_equalTo(self.navBarBGView.mas_centerX);
+        make.centerY.mas_equalTo(self.backBtn.mas_centerY);
+        make.width.mas_equalTo(curWidth+15);
+        make.height.mas_equalTo(30);
+    }];
+}
+
+#pragma mark 选择硬盘
+- (void)selectDiskAction:(UIButton*)but
+{
+    if(self.diskListBgV.hidden){
+        [self showDiskListVieFun];
+    }
+    else{
+        [self hideDiskListVieFun];
+        
+    }
+}
+
+- (void)showDiskListVieFun
+{
+    self.diskListBgV.hidden = NO;
+    self.diskListTableV.hidden = NO;
+    
+    [UIView animateWithDuration:0.3 animations:^{
+        CGRect rect = self.diskListTableV.frame;
+        rect.origin.y = CGRectGetMaxY(self.navBarBGView.frame);
+        self.diskListTableV.frame = rect;
+
+        self.selectTip.transform = CGAffineTransformMakeRotation(M_PI);
+    }];
+}
+
+- (void)hideDiskListVieFun
+{
+    self.diskListBgV.hidden = YES;
+    
+    [UIView animateWithDuration:0.3 animations:^{
+        self.diskListTableV.hidden = YES;
+        self.selectTip.transform = CGAffineTransformIdentity;
+        
+    }completion:^(BOOL finished) {
+        CGRect rect = self.diskListTableV.frame;
+        rect.origin.y = 0;
+        self.diskListTableV.frame = rect;
+    }];
+}
+
+
+#pragma mark 刷新底部
+- (void)RefreshBottomViewUIFun
+{
+    NSMutableArray *selectArr = [NSMutableArray new];
+    
+    for (couldPhoneFileModel* fileModel in _curCouldPhoneFileListMod.data.list) {
+        
+        if(fileModel.isSelectType){
+            [selectArr addObject:fileModel];
+        }
+    }
+    
+    _downloadFileBottomV.indexPathsForSelectedItems = selectArr;
+}
+
+
+#pragma mark 设置标题
+- (void)setTitleAfterGetdiskFun
+{
+    if(_isPhotoType){
+        //self.titleLabel.text = NSLocalizedString(@"my_set_no_image_upload",nil) ;
+        [self setTitleLabelText:NSLocalizedString(@"my_set_no_image_upload",nil)];
+    }
+    else{
+        //self.titleLabel.text = NSLocalizedString(@"my_set_no_video_upload",nil) ;
+        [self setTitleLabelText:NSLocalizedString(@"my_set_no_video_upload",nil)];
+    }
+    
+    [self searchFileListFun];
+}
+
+- (void)viewWillAppear:(BOOL)animated
+{
+    [super viewWillAppear:animated];
+    
+    
+}
+
+- (void)viewWillDisappear:(BOOL)animated{
+    [super viewWillDisappear:animated];
+    
+    //[self removeNewIndicator];
+    [self removeNewIndicatorHaveStr];
+}
+
+- (void)searchFileListFun
+{
+    NSMutableDictionary *dict = [NSMutableDictionary new];
+    NSNumber *curNum = [NSNumber numberWithBool:_isPhotoType];
+    [dict setObject:curNum forKey:@"type"];
+    if(!_defaultDiskPath){
+        _defaultDiskPath = @"";
+    }
+    [dict setObject:_defaultDiskPath forKey:@"path"];
+    
+    [[NSNotificationCenter defaultCenter] postNotificationName:searchFileListBeginNotification object:dict];/*发送通知*/
+    
+    //[self showNewIndicatorWithCanBack:YES canTouch:NO];
+    [self showNewIndicatorHaveStrWithCanBack:YES canTouch:NO showText:NSLocalizedString(@"common_loading_tip",nil)];
+    
+}
+
+- (void)searchFileListDoneFun:(NSNotification*)notification
+{
+    //[self removeNewIndicator];
+    [self removeNewIndicatorHaveStr];
+    
+    NSDictionary *dataDict = [notification object];
+    
+    if(!dataDict || ![dataDict isKindOfClass:[NSDictionary class]]){
+        return;
+    }
+    
+    _curCouldPhoneFileListMod = [[couldPhoneFileListModel alloc] initWithDictionary:dataDict error:nil];
+    
+    NSMutableArray *filterArr = [NSMutableArray new];
+    for (couldPhoneFileModel*model in _curCouldPhoneFileListMod.data.list) {
+        //if(model.length > 1024)
+        if(model.length > 1024*50)
+        {
+            [filterArr addObject:model];
+        }
+    }
+    
+    _curCouldPhoneFileListMod.data.list = filterArr;
+    
+    //[self.tableView reloadData];
+    [self.dataCollectionView reloadData];
+    
+    //这个要做判断 不能为空
+    [self gotoDownThumbnailManagerFun];
+}
+
+
+#pragma mark 去下载缩略图
+- (void)gotoDownThumbnailManagerFun
+{
+//    if(_curCouldPhoneFileListMod.data.list && _curCouldPhoneFileListMod.data.list.count >0){
+//        [[downloadThumbnailManager shareInstance] handlToDownloadThumbnailWith:_curCouldPhoneFileListMod.data.list];
+//    }
+}
+
+- (void)gotoDownloadloadFileRecordFun
+{
+    uploadFileRecordViewController *vc = [uploadFileRecordViewController new];
+    [self.navigationController pushViewController:vc animated:YES];
+    vc.isDownloadingType = YES;
+    [vc gotoDownloadFile:_downloadFileBottomV.indexPathsForSelectedItems];
+}
+
+- (void)viewDidAppear:(BOOL)animated{
+    [super viewDidAppear:animated];
+    [self showDownloadTipFun];
+}
+
+- (void)showDownloadTipFun
+{
+    BOOL didReadUploadTipType = [HWDataManager getBoolWithKey:Const_file_downLoad_need_read];
+   
+    if(didReadUploadTipType){
+        return;
+    }
+    
+    
+    //KWeakSelf
+    /*弹窗提示恢复出厂*/
+    ComontAlretViewController *nextVC = [[ComontAlretViewController alloc] initWithTiTle:nil
+                                                                                     msg:NSLocalizedString(@"upload_download_need_read_msg",nil)
+                                                                                imageStr:nil
+                                                                             cancelTitle:NSLocalizedString(@"guide_set_pwd_guide_know",nil)
+                                                                                 okTitle:nil
+                                                                        isOkBtnHighlight:NO
+                                                                              didClickOk:^{
+        
+    } didClickCancel:^{
+        [HWDataManager setBoolWithKey:Const_file_downLoad_need_read value:YES];
+    }];
+    
+    nextVC.modalPresentationStyle = UIModalPresentationCustom;
+    
+    [self presentViewController:nextVC animated:YES completion:^{
+        nextVC.view.superview.backgroundColor = [UIColor clearColor];
+    }];
+    
+}
+
+- (void)didDownloadOneFileFun
+{
+    mainBlock(^{
+        //[self.tableView reloadData];
+        [self.dataCollectionView reloadData];
+    });
+}
+
+@end

+ 17 - 0
创维盒子/双子星云手机/Class/Set/previewFile/view/imageCollectionViewCell.h

@@ -0,0 +1,17 @@
+//
+//  imageCollectionViewCell.h
+//  双子星云手机
+//
+//  Created by xd h on 2024/5/13.
+//
+
+#import <UIKit/UIKit.h>
+#import "couldPhoneFileListModel.h"
+NS_ASSUME_NONNULL_BEGIN
+
+@interface imageCollectionViewCell : UICollectionViewCell
+
+@property(nonatomic,strong) couldPhoneFileModel*curFileModel;
+@end
+
+NS_ASSUME_NONNULL_END

+ 62 - 0
创维盒子/双子星云手机/Class/Set/previewFile/view/imageCollectionViewCell.m

@@ -0,0 +1,62 @@
+//
+//  imageCollectionViewCell.m
+//  双子星云手机
+//
+//  Created by xd h on 2024/5/13.
+//
+
+#import "imageCollectionViewCell.h"
+
+@interface imageCollectionViewCell()
+@property (strong, nonatomic) UIImageView *imageView;
+@property (nonatomic, strong) UIButton *selectButton;
+@end
+
+@implementation imageCollectionViewCell
+
+- (instancetype)initWithFrame:(CGRect)frame {
+    if (self = [super initWithFrame:frame]) {
+        
+        [self setupSubViews];
+    }
+    return self;
+}
+
+- (void)setupSubViews{
+    _imageView = [UIImageView new];
+    [self addSubview:_imageView];
+    
+    [_imageView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(0);
+        make.right.mas_equalTo(0);
+        make.top.mas_equalTo(0);
+        make.bottom.mas_equalTo(0);
+    }];
+}
+
+- (void)setCurFileModel:(couldPhoneFileModel *)curFileModel
+{
+    _curFileModel = curFileModel;
+    
+    
+    //[[downloadThumbnailManager shareInstance] handlToDownloadThumbnailInDownTableViewWith:@[_curFileModel]];
+    
+    _imageView.image = [UIImage imageNamed:@"uploadFile_image"];
+    if([curFileModel.fileType isEqualToString:@"video"])
+    {
+        _imageView.image = [UIImage imageNamed:@"uploadFile_Video"];
+    }
+    
+    //checkButton.selected = curFileModel.isSelectType;
+
+    NSString *fileName = [_curFileModel getFileNameFun];
+    NSString*pathStr = [cachesFileManager getFilePathWithName:fileName type:DownLoadThumbnail];
+    UIImage *curImage = [UIImage imageWithContentsOfFile:pathStr];
+    if(curImage){
+        _imageView.image = curImage;
+    }
+    
+}
+
+
+@end

+ 16 - 0
创维盒子/双子星云手机/Class/Set/previewFile/view/titleLabelReusableView.h

@@ -0,0 +1,16 @@
+//
+//  titleLabelReusableView.h
+//  双子星云手机
+//
+//  Created by xd h on 2024/5/13.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface titleLabelReusableView : UICollectionReusableView
+@property(nonatomic,strong) UILabel *titlelabel;
+@end
+
+NS_ASSUME_NONNULL_END

+ 37 - 0
创维盒子/双子星云手机/Class/Set/previewFile/view/titleLabelReusableView.m

@@ -0,0 +1,37 @@
+//
+//  titleLabelReusableView.m
+//  双子星云手机
+//
+//  Created by xd h on 2024/5/13.
+//
+
+#import "titleLabelReusableView.h"
+
+@implementation titleLabelReusableView
+- (id)initWithFrame:(CGRect)frame
+{
+    self = [super initWithFrame:frame];
+
+    if (self)
+    {
+        [self drawAnyViewWithFrame:frame];
+    }
+
+    return self;
+}
+
+- (void)drawAnyViewWithFrame:(CGRect)frame
+{
+    _titlelabel = [[UILabel alloc] init];
+    _titlelabel.textColor = [UIColor blackColor];
+    _titlelabel.font = [UIFont boldSystemFontOfSize:14.0];
+    [self addSubview:_titlelabel];
+    
+    [_titlelabel mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(15);
+        make.right.mas_equalTo(0);
+        make.height.mas_equalTo(20);
+        make.centerY.mas_equalTo(0);
+    }];
+}
+@end