Bladeren bron

1.搜索需求---搜索页完成

huangxiaodong 2 maanden geleden
bovenliggende
commit
baea01f148

+ 717 - 18
创维盒子/code/NAS/NasSearchViewController.m

@@ -7,10 +7,36 @@
 
 #import "NasSearchViewController.h"
 #import "searchBarSecondTypeView.h"
+#import "searchListModel.h"
+#import "couldPhoneFileListModel.h"
+#import "downloadManager.h"
+#import "uploadFileRecordViewController.h"
+#import "UIScrollView+EmptyDataSet.h"
+#import "downLoadPreViewCell.h"
+#import "editTypeHeadView.h"
+#import "editTypeBottomView.h"
+#import "editShareView.h"
+#import "netWorkManager.h"
+#import "queryShareModel.h"
+#import "audioPlayerViewController.h"
+#import "videoPlayByAVPlayerViewController.h"
+#import "MJRefresh.h"
+#import "previewFileAndFolderSecondViewController.h"
+#import "imageDetailsScrollViewController.h"
 
-@interface NasSearchViewController ()
-@property (nonatomic, strong) searchBarSecondTypeView * searchBarSecondTypeV;
+@interface NasSearchViewController ()<UITableViewDelegate,UITableViewDataSource,DZNEmptyDataSetSource, DZNEmptyDataSetDelegate>
+{
+    BOOL canShareType;
+}
+@property (nonatomic, strong) UITableView *tableView;
 
+@property(nonatomic,assign) BOOL isEditType;
+@property(nonatomic,strong) editTypeHeadView*curEditTypeHeadView;
+@property(nonatomic,strong) editTypeBottomView*curEditTypeBottomView;
+@property(nonatomic,strong) searchBarSecondTypeView* searchBarSecondTypeV;//tab
+@property (nonatomic, strong)  NSMutableArray*didSelectListArr;//选中的数据
+@property (nonatomic, strong) searchListModel *curSearchLisyMod;
+@property (nonatomic, copy) NSString *searchKeyWord;//搜索关键字
 @end
 
 @implementation NasSearchViewController
@@ -26,10 +52,15 @@
     [self.view setBackgroundColor:[UIColor whiteColor]];
     
     [self drawAnyView];
+    
+    _didSelectListArr = [NSMutableArray new];
+    
+    //数据埋点
+    //[[netWorkManager shareInstance] DataEmbeddingPointBy:2 withEventValue:@"Video"];
 }
 
-- (void)drawAnyView
-{
+- (void)drawAnyView{
+    
     _searchBarSecondTypeV = [[searchBarSecondTypeView alloc] init];
     [self.view addSubview:_searchBarSecondTypeV];
     
@@ -44,19 +75,499 @@
     
     KWeakSelf
     _searchBarSecondTypeV.didClickSearchFun = ^(NSString * _Nonnull searchText) {
-        HLog(@"1111:%@",searchText)
-        [weakSelf getFileListFun:NO];
+        //HLog(@"1111:%@",searchText)
+        weakSelf.searchKeyWord = searchText;
+        weakSelf.curSearchLisyMod = nil;
+        [weakSelf searchListDataFun:NO];
+    };
+    
+    _curEditTypeHeadView = [[editTypeHeadView alloc] init];
+    _curEditTypeHeadView.hidden = YES;
+    [self.navBarBGView addSubview:_curEditTypeHeadView];
+    
+    [_curEditTypeHeadView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(0);
+        make.right.mas_equalTo(0);
+        make.bottom.mas_equalTo(0);
+        make.height.mas_equalTo(NAVIHEIGHT - AdaptNaviHeight);
+    }];
+    
+#pragma mark 编辑状态的 取消 和全选按钮 响应事件
+    _curEditTypeHeadView.didClickButtonFun = ^(NSInteger tag) {
+        if(tag==1){
+            [weakSelf userCancelEditTypeFun];
+        }
     };
+    
+    _curEditTypeHeadView.didClickSelectAllFun = ^(UIButton * _Nonnull but) {
+        [weakSelf didClickSelectAllButton:but];
+    };
+    
+    
+    _curEditTypeBottomView = [[editTypeBottomView alloc] init];
+    _curEditTypeBottomView.hidden = YES;
+    [self.view addSubview:_curEditTypeBottomView];
+    
+    [_curEditTypeBottomView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(0);
+        make.right.mas_equalTo(0);
+        make.bottom.mas_equalTo(0);
+        make.height.mas_equalTo(60 + AdaptTabHeight);
+    }];
+    
+#pragma mark 编辑状态的 下载 分享 删除 响应事件
+    _curEditTypeBottomView.didClickButtonFun = ^(NSInteger tag) {
+        if(tag==1){
+            [weakSelf gotoDownLoadFileFun];
+        }
+        else if(tag==2){
+            [weakSelf gotoShareViewFun];
+        }
+        else if(tag==3){
+            [weakSelf showDeleteAlearViewFun];
+        }
+    };
+    
+    [self.view addSubview:self.tableView];
+    [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(0);
+        make.right.mas_equalTo(0);
+        //make.bottom.mas_equalTo(-(safeArea));
+        make.bottom.mas_equalTo(0);
+        make.top.equalTo(self.navBarBGView.mas_bottom).offset(10.f);
+    }];
+}
+
+
+#pragma mark - 懒加载
+- (UITableView *)tableView{
+    if (!_tableView) {
+        _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, SCREEN_H - TABBARHEIGHT) style:UITableViewStylePlain];
+        _tableView.delegate = self;
+        _tableView.dataSource = self;
+        _tableView.showsVerticalScrollIndicator = NO;
+        _tableView.showsHorizontalScrollIndicator = NO;
+//        _tableView.contentInset = UIEdgeInsetsMake(-H_STATE_BAR, 0, 0, 0);
+        [_tableView setSeparatorStyle:(UITableViewCellSeparatorStyleNone)];
+        [_tableView setSeparatorColor:[UIColor clearColor]];
+        [_tableView setBackgroundColor:[UIColor clearColor]];
+        [_tableView setTableFooterView:[UIView new]];
+        [_tableView setBounces:YES];
+        
+        if (@available(iOS 15.0, *)) {
+            _tableView.sectionHeaderTopPadding = 0;
+        }
+        
+        //空数据引入第三方开源处理
+        _tableView.emptyDataSetSource = self;
+        _tableView.emptyDataSetDelegate = self;
+        
+        // 下拉追加
+        MJRefreshAutoNormalFooter *footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
+            [self getMoreNetWorkData];
+        }];
+
+        NSString *text =  NSLocalizedString(@"NAS_bottom_tip",nil);
+        [footer setTitle:text forState:MJRefreshStateNoMoreData];
+        _tableView.mj_footer = footer;
+        _tableView.mj_footer.hidden = YES;
+    }
+    
+    return _tableView;
+}
+
+
+#pragma mark - 列表委托
+- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
+    return 1;
+}
+
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
+    if(!_curSearchLisyMod){
+        return 0;
+    }
+    return _curSearchLisyMod.data.count;
+}
+
+- (downLoadPreViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
+    
+    __block NSInteger row = indexPath.row;
+    static NSString *identifier = @"downLoadPreViewCell";
+    
+    downLoadPreViewCell * cell =  [tableView dequeueReusableCellWithIdentifier:identifier];
+    cell.selectionStyle = UITableViewCellSelectionStyleNone;
+    if (!cell){
+        cell = [[downLoadPreViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier];
+        [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
+        [cell setBackgroundColor:[UIColor clearColor]];
+        [cell setAccessoryType:(UITableViewCellAccessoryNone)];
+        
+        [cell.bgViewLayer removeFromSuperlayer];
+        [cell.titleLabel2 setHidden:NO];
+        [cell.rightImage setHidden:YES];
+        [cell.lineView setHidden:YES];
+        [cell.checkButton setHidden:NO];
+        
+    }
+    
+    if(row < _curSearchLisyMod.data.count){
+        searchDataModel* dataModel = _curSearchLisyMod.data[row];
+        cell.curNASFileAudioDataModel = (NASFileAudioDataModel*)dataModel;
+        
+        KWeakSelf
+        cell.didClickSwitch = ^(BOOL SwitchOn) {
+            //if([weakSelf userCheckFileModel:dataModel withShowTip:YES]){
+                [weakSelf userCheckFilePreviewByRow:row];
+            //}
+        };
+    }
+    return cell;
+}
+
+- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
+    return 70;
+}
+
+- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
+{
+    NSInteger row = indexPath.row;
+    if(row < _curSearchLisyMod.data.count){
+        NASFileAndFolderDataModel* dataModel = _curSearchLisyMod.data[row];
+        
+        if([dataModel.type isEqualToString:@"dir"])
+        {
+            previewFileAndFolderSecondViewController *vc =  [previewFileAndFolderSecondViewController new];
+            vc.curFolderDataModel = dataModel;
+            vc.canShareType = canShareType;
+            [self.navigationController pushViewController:vc animated:YES];
+        }
+        else if([dataModel.type isEqualToString:@"video"]){
+            videoPlayByAVPlayerViewController *vc = [videoPlayByAVPlayerViewController new];
+            vc.VideoDataMode = dataModel;
+            [self.navigationController pushViewController:vc animated:YES];
+            
+            KWeakSelf
+            vc.didNeedDeleteFile = ^(NSString * _Nonnull filePath) {
+                [weakSelf deleteNetDataByFilePath:filePath];
+            };
+
+        }
+        else if([dataModel.type isEqualToString:@"audio"]){
+            
+//            NSMutableArray *dataArr = [NSMutableArray new];
+//            [dataArr addObject:dataModel];
+            
+            audioPlayerViewController * vc = [audioPlayerViewController new];
+            vc.isfirstEnterType = YES;
+            vc.outSideDataModel = (NASFileAudioDataModel *)dataModel;
+            [self.navigationController pushViewController:vc animated:YES];
+            
+            KWeakSelf
+            vc.didNeedDeleteFile = ^(NSString * _Nonnull filePath) {
+                [weakSelf deleteNetDataByFilePath:filePath];
+            };
+        }
+        else if([dataModel.type containsString:@"jpg"]){
+
+            NSMutableArray *jpgDataArr = [NSMutableArray new];
+            NSInteger index = 0;
+            [jpgDataArr addObject:dataModel];
+
+            imageDetailsScrollViewController *vc = [imageDetailsScrollViewController new];
+            vc.index = index;
+            vc.totalDataArr = jpgDataArr;
+            [self.navigationController pushViewController:vc animated:YES];
+            vc.canShareType = canShareType;
+
+        }
+    }
+
+}
+
+#pragma mark 空数据
+- (UIImage *)imageForEmptyDataSet:(UIScrollView *)scrollView {
+    
+    NSString *imageName = @"common_no_data_pic";
+    
+    return [UIImage imageNamed:imageName];
+}
+
+- (NSAttributedString *)titleForEmptyDataSet:(UIScrollView *)scrollView {
+    NSString *text = NSLocalizedString(@"common_no_data_tip",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){
+        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){
+        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;
+}
+
+#pragma mark 用户长按图片进入编辑
+- (void)setViewEditTypeFun
+{
+    _isEditType = YES;
+    _searchBarSecondTypeV.hidden = YES;
+    //[self.tableView  reloadData];
+    
+    _curEditTypeHeadView.hidden = NO;
+    _curEditTypeBottomView.hidden = NO;
+    
+    [self RefreshAllUIFun];
+}
+
+#pragma mark 用户取消编辑编辑
+- (void)userCancelEditTypeFun
+{
+    //数据还原
+    for (NASFileAudioDataModel*model in _didSelectListArr) {
+        model.isSelectType = NO;
+    }
+    [_didSelectListArr removeAllObjects];
+    
+    _isEditType = NO;
+    _searchBarSecondTypeV.hidden = NO;
+    //[self.tableView  reloadData];
+    
+    _curEditTypeHeadView.hidden = YES;
+    _curEditTypeBottomView.hidden = YES;
+    
+    [self RefreshAllUIFun];
+}
+
+#pragma mark 更新UI界面
+- (void)RefreshAllUIFun
+{
+        
+    [self.tableView  reloadData];
+    
+    KWeakSelf
+    [self.tableView  mas_remakeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(0);
+        make.right.mas_equalTo(0);
+        if(weakSelf.isEditType){
+            make.bottom.equalTo(weakSelf.curEditTypeBottomView.mas_top).offset(0.0);
+        }
+        else{
+            make.bottom.mas_equalTo(0);
+        }
+        
+        make.top.equalTo(self.navBarBGView.mas_bottom).offset(10.f);
+    }];
+}
+
+- (void)userCheckFilePreviewByRow:(NSInteger)row
+{
+    if(row < _curSearchLisyMod.data.count){
+        NASFileAudioDataModel* dataModel = _curSearchLisyMod.data[row];
+        
+        if(dataModel.isSelectType){
+            [_didSelectListArr removeObject:dataModel];
+        }
+        else{
+            [_didSelectListArr addObject:dataModel];
+        }
+        
+        dataModel.isSelectType = !dataModel.isSelectType;
+    
+        [self setEditTypeTitleFun];
+    }
+}
+
+- (void)didClickSelectAllButton:(UIButton*)button
+{
+    //button.selected = !button.selected;
+    
+    [_didSelectListArr removeAllObjects];
+    
+    for (NASFileAudioDataModel* dataModel in _curSearchLisyMod.data) {
+        
+        if(!button.selected){
+            dataModel.isSelectType = button.selected;
+        }
+        else{
+            [_didSelectListArr addObject:dataModel];
+            dataModel.isSelectType = button.selected;
+        }
+    }
+    
+    [self.tableView reloadData];
+    //[self.dataCollectionView reloadData];
+    [self setEditTypeTitleFun];
+}
+
+#pragma mark 设置选中标题
+- (void)setEditTypeTitleFun
+{
+    [_curEditTypeHeadView setTitleLabetextByNumbers:_didSelectListArr.count];
+    
+    if(_didSelectListArr.count > 0){
+        [self  setViewEditTypeFun];
+    }
+    else{
+        [self userCancelEditTypeFun];
+    }
+}
+
+#pragma mark 用户点击分享
+- (void)gotoShareViewFun
+{
+    if (_didSelectListArr.count > 5) {
+        [[iToast makeText:NSLocalizedString(@"share_max_count_tip2",nil)] show];
+        return;
+    }
+    
+    editShareView *editShareV = [[editShareView alloc] init];
+    editShareV.didSelectListArr = _didSelectListArr;
+    editShareV.shareFileType = @"3";
+    [self.view addSubview:editShareV];
+    
+    [editShareV mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(0);
+        make.right.mas_equalTo(0);
+        make.bottom.mas_equalTo(0);
+        make.top.mas_equalTo(0);
+    }];
+}
+
+
+- (void)viewWillAppear:(BOOL)animated
+{
+    [super viewWillAppear:animated];
+    
+}
+
+- (void)viewDidAppear:(BOOL)animated{
+    [super viewDidAppear:animated];
+    [self showDownloadTipFun];
+    
+    if(!_curSearchLisyMod){
+        [self queryShareSwitchFunFun];
+    }
+}
+
+- (void)viewWillDisappear:(BOOL)animated{
+    [super viewWillDisappear:animated];
+    
+    //[self removeNewIndicator];
+    [self removeNewIndicatorHaveStr];
+}
+
+
+- (void)gotoDownloadloadFileRecordFun
+{
+    uploadFileRecordViewController *vc = [uploadFileRecordViewController new];
+    [self.navigationController pushViewController:vc animated:YES];
+    vc.isDownloadingType = YES;
+    //[vc gotoDownloadFile:_downloadFileBottomV.indexPathsForSelectedItems];
+}
+
+- (void)showDownloadTipFun
+{
+    BOOL didReadUploadTipType = [HWDataManager getBoolWithKey:Const_file_downLoad_need_read];
+   
+    if(didReadUploadTipType){
+        return;
+    }
+    
+    
+    //KWeakSelf
+    /*弹窗提示恢复出厂*/
+    ComontAlretViewController *nextVC = [[ComontAlretViewController alloc] initWithTiTle:@""
+                                                                                     msg:NSLocalizedString(@"upload_download_need_read_msg",nil)
+                                                                                imageStr:@""
+                                                                             cancelTitle:NSLocalizedString(@"guide_set_pwd_guide_know",nil)
+                                                                                 okTitle:@""
+                                                                        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)didiClikRightButGotoTransferListFun:(UIButton*)but
+{
+    uploadFileRecordViewController *vc = [uploadFileRecordViewController new];
+    [self.navigationController pushViewController:vc animated:YES];
+}
+
 #pragma mark 获取文件数据
-- (void)getFileListFun:(BOOL)isMoreDataType
+- (void)searchListDataFun:(BOOL)isMoreDataType
 {
     NSMutableDictionary*paraDict = [NSMutableDictionary new];
     
-    [paraDict setValue:@"7266" forKey:@"keyword"];
-    //[paraDict setValue:@"doc" forKey:@"fileType"];
+    if(self.searchKeyWord){
+        [paraDict setValue:self.searchKeyWord forKey:@"keyword"];
+    }
     
     if(!isMoreDataType){
         self.pageIndex = 0;
@@ -72,16 +583,25 @@
     
     KWeakSelf
     [[netWorkManager shareInstance] cloudPhoneGETCallBackCode:@"search" Parameters:paraDict success:^(id  _Nonnull responseObject) {
-        //[weakSelf.tableView.mj_footer endRefreshing];
+        [weakSelf.tableView.mj_footer endRefreshing];
         [weakSelf removeNewIndicatorHaveStr];
-//        weakSelf.getInstalledAppListMod = [[getInstalledAppListModel alloc] initWithDictionary:responseObject error:nil];
-//        
-//        if(weakSelf.getInstalledAppListMod && weakSelf.getInstalledAppListMod.status == 0){
-//            [weakSelf RefreshAllUIFun];
-//        }
-//        
+        searchListModel *model = [[searchListModel alloc] initWithDictionary:responseObject error:nil];;
+        
+        if(model && model.status == 0){
+            [self handelNetDataAfterFilterDataBy:model];
+            
+            if (model.data.count < pageSizeNum) {
+                [weakSelf.tableView.mj_footer endRefreshingWithNoMoreData];
+            }
+            else{
+                [weakSelf.tableView.mj_footer resetNoMoreData];
+            }
+            
+            [weakSelf RefreshAllUIFun];
+        }
+        
     } failure:^(NSError * _Nonnull error) {
-        //[weakSelf.tableView.mj_footer endRefreshing];
+        [weakSelf.tableView.mj_footer endRefreshing];
         [weakSelf removeNewIndicatorHaveStr];
         if([AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == AFNetworkReachabilityStatusNotReachable)
         {
@@ -97,7 +617,186 @@
 #pragma mark 上拉或者点击更多数据
 - (void)getMoreNetWorkData
 {
-    [self getFileListFun:YES];
+    [self searchListDataFun:YES];
+}
+
+#pragma mark 分页数据组装
+- (void)handelNetDataAfterFilterDataBy:(searchListModel*)model
+{
+    if(_curSearchLisyMod && _curSearchLisyMod.data ){
+        NSMutableArray *handelDataArr = [NSMutableArray arrayWithArray:_curSearchLisyMod.data];//旧数据
+        [handelDataArr addObjectsFromArray:model.data];//新数据
+
+        _curSearchLisyMod.data = (NSArray<searchDataModel>*)handelDataArr;
+    }
+    else{
+        _curSearchLisyMod = model;
+    }
+
+    if(_curSearchLisyMod.data.count == 0 ){
+        self.tableView.mj_footer.hidden = YES;
+    }
+    else{
+        self.tableView.mj_footer.hidden = NO;
+    }
+}
+
+
+#pragma mark 文件下载
+- (void)gotoDownLoadFileFun
+{
+    if(_didSelectListArr.count == 0){
+        [[iToast makeText:@""] show];
+        return;
+    }
+    
+    NSMutableArray *arr = [NSMutableArray new];
+    for (NASFilePicDataArrModel *dataModel in _didSelectListArr) {
+        
+        couldPhoneFileModel* fileModel =  [couldPhoneFileModel new];
+        fileModel.fileType = dataModel.type;
+        fileModel.path = dataModel.path;
+        fileModel.name = dataModel.name;
+        fileModel.length = dataModel.size;
+        fileModel.time = dataModel.duration;
+        
+        [arr addObject:fileModel];
+    }
+    
+    uploadFileRecordViewController *vc = [uploadFileRecordViewController new];
+    [self.navigationController pushViewController:vc animated:YES];
+    vc.isDownloadingType = YES;
+    [vc gotoDownloadFile:arr];
+}
+
+#pragma mark 删除图片
+- (void)showDeleteAlearViewFun
+{
+    NSString *titleStr = NSLocalizedString(@"delete_file_title_msg",nil);
+    NSString *tipStr = NSLocalizedString(@"delete_file_tip_msg",nil);
+
+    KWeakSelf
+    ComontAlretViewController *curAlretVC= [[ComontAlretViewController alloc] initWithTiTle:titleStr
+                                                                                      msg:tipStr
+                                                                                 imageStr:@""
+                                                                              cancelTitle:NSLocalizedString(@"other_cancel",nil)
+                                                                                  okTitle:NSLocalizedString(@"other_confirm",nil) isOkBtnHighlight:YES
+                                                                               didClickOk:^{
+        
+        [weakSelf delFileListFun];
+     } didClickCancel:^{
+         
+     }];
+    
+    curAlretVC.modalPresentationStyle = UIModalPresentationCustom;
+     
+     [self presentViewController:curAlretVC animated:YES completion:^{
+         curAlretVC.view.superview.backgroundColor = [UIColor clearColor];
+     }];
+}
+
+
+#pragma mark 删除文件数据
+- (void)delFileListFun
+{
+    NSMutableDictionary*paraDict = [NSMutableDictionary new];
+    
+    NSMutableArray *pathArr = [NSMutableArray new];
+    for (NASFilePicDataArrModel *dataModel in _didSelectListArr) {
+        [pathArr addObject:dataModel.path];
+    }
+    
+    [paraDict setValue:pathArr forKey:@"path"];
+    
+    [self showNewIndicatorWithCanBack:YES canTouch:NO];
+    
+    //NSString*code = [[NSString alloc] initWithFormat:@"delFile?path=%@",paraDict[@"path"]]; //delFile?path=[/storage/emulated/0/Download/IMG_6464.HEIC]
+    KWeakSelf //@"delFile"
+    [[netWorkManager shareInstance] cloudPhonePostCallBackCode:@"delFile" Parameters:paraDict success:^(id  _Nonnull responseObject) {
+        [weakSelf removeNewIndicator];
+        SuperModel *model = [[SuperModel alloc] initWithDictionary:responseObject error:nil];
+        if(model && model.status == 0){
+            [[iToast makeText:NSLocalizedString(@"delete_file_suc_msg",nil)] show];
+            [weakSelf didDeleteSucFun];
+        }
+        else{
+            
+        }
+    } failure:^(NSError * _Nonnull error) {
+        [weakSelf removeNewIndicator];
+    }];
+    
+    //数据埋点
+    [[netWorkManager shareInstance] DataEmbeddingPointBy:3 withEventValue:@"Video_delete"];
+}
+
+#pragma  mark 删除成功
+- (void)didDeleteSucFun
+{
+    //删除最近文件
+    for (NASFilePicDataArrModel *dataModel in _didSelectListArr) {
+        [[lastFileManager shareManager] deleteFileInfoWithUrl:dataModel.path];
+    }
+    
+    //2.删除已经获取到的网络数据
+    [self deleteNetDataByDeleteSucFun];
+    
+    [_didSelectListArr removeAllObjects];
+    [self setEditTypeTitleFun];
+    
+}
+
+#pragma mark 删除成功后 对应删除原来获取的网络数据
+- (void)deleteNetDataByDeleteSucFun
+{
+    NSMutableArray *afterFilterArr = [NSMutableArray new];
+    for (searchDataModel *model in _curSearchLisyMod.data) {
+        if (!model.isSelectType) {
+            [afterFilterArr addObject:model];
+        }
+    }
+    
+    _curSearchLisyMod.data = (NSArray<searchDataModel>*)afterFilterArr;
+    
+    [self.tableView reloadData];
 }
 
+#pragma mark 图片详情删除成功后 对应删除原来获取的网络数据
+- (void)deleteNetDataByFilePath:(NSString*)filePath
+{
+    if(!filePath || filePath.length == 0){
+        return;
+    }
+    
+    NSMutableArray *afterFilterArr = [NSMutableArray new];
+    for (searchDataModel *model in _curSearchLisyMod.data) {
+        if (![model.path isEqualToString:filePath]) {
+            [afterFilterArr addObject:model];
+        }
+    }
+    
+    _curSearchLisyMod.data = (NSArray<searchDataModel>*)afterFilterArr;
+    [self.tableView reloadData];
+}
+
+
+#pragma mark 获取分享开关
+-(void)queryShareSwitchFunFun
+{
+    NSMutableDictionary *paraDict = [NSMutableDictionary new];
+    
+    [paraDict setValue:@3 forKey:@"type"];
+    
+    KWeakSelf
+    [[netWorkManager shareInstance] CommonGetWithCallBackCode:queryShareSwitchFun Parameters:paraDict success:^(id  _Nonnull responseObject){
+        queryShareModel *queryShareMod = [[queryShareModel alloc] initWithDictionary:responseObject error:nil];
+        if(queryShareMod){
+            self->canShareType = queryShareMod.data.configValue;
+            //weakSelf.curEditTypeBottomView.isCanShareType = self->canShareType;
+            [weakSelf.curEditTypeBottomView setCanShaewFunBy:queryShareMod.data.configValue];
+        }
+        
+    } failure:^(NSError * _Nonnull error) {
+    }];
+}
 @end

+ 30 - 0
创维盒子/code/NAS/model/searchListModel.h

@@ -0,0 +1,30 @@
+//
+//  searchListModel.h
+//  双子星云手机
+//
+//  Created by xd h on 2025/3/19.
+//
+
+#import "SuperModel.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface searchDataModel : SuperModel
+@property (nonatomic, copy) NSString*path;
+@property (nonatomic, copy) NSString*name;
+//@property (nonatomic, assign) long time;//NSString*time;
+@property (nonatomic, copy) NSString*time;
+@property (nonatomic, assign) long  size;
+@property (nonatomic, copy) NSString*type;
+@property (nonatomic, assign) NSInteger duration;
+
+//自定义
+@property (nonatomic, assign) BOOL isSelectType;
+@end
+
+@protocol searchDataModel;
+@interface searchListModel : SuperModel
+@property (nonatomic, strong) NSArray<searchDataModel>* data;
+@end
+
+NS_ASSUME_NONNULL_END

+ 16 - 0
创维盒子/code/NAS/model/searchListModel.m

@@ -0,0 +1,16 @@
+//
+//  searchListModel.m
+//  双子星云手机
+//
+//  Created by xd h on 2025/3/19.
+//
+
+#import "searchListModel.h"
+
+@implementation searchDataModel
+
+@end
+@implementation searchListModel
+
+@end
+

+ 1 - 1
创维盒子/code/NAS/search/searchBarSecondTypeView.m

@@ -122,7 +122,7 @@
         _didClickSearchFun(string);
     }
     
-    [_searchButton resignFirstResponder];
+    [_searchTF resignFirstResponder];
 }
 
 - (void)didClickWhiteViewFun

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

@@ -1334,6 +1334,10 @@
 		6BEA31762BB65606005167AA /* clearCacheAlretViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BEA31742BB65606005167AA /* clearCacheAlretViewController.m */; };
 		6BEA31772BB65606005167AA /* clearCacheAlretViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BEA31742BB65606005167AA /* clearCacheAlretViewController.m */; };
 		6BEA31782BB65606005167AA /* clearCacheAlretViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 6BEA31732BB65606005167AA /* clearCacheAlretViewController.h */; };
+		6BECEE632D8AC1D900CEC9A5 /* searchListModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BECEE622D8AC1D900CEC9A5 /* searchListModel.m */; };
+		6BECEE642D8AC1D900CEC9A5 /* searchListModel.h in Headers */ = {isa = PBXBuildFile; fileRef = 6BECEE612D8AC1D900CEC9A5 /* searchListModel.h */; };
+		6BECEE652D8AC1D900CEC9A5 /* searchListModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BECEE622D8AC1D900CEC9A5 /* searchListModel.m */; };
+		6BECEE662D8AC1D900CEC9A5 /* searchListModel.h in Headers */ = {isa = PBXBuildFile; fileRef = 6BECEE612D8AC1D900CEC9A5 /* searchListModel.h */; };
 		6BED888A2B4E819000F76DDC /* downloadFileRecordTableView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6BED88882B4E819000F76DDC /* downloadFileRecordTableView.h */; };
 		6BED888B2B4E819000F76DDC /* downloadFileRecordTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BED88892B4E819000F76DDC /* downloadFileRecordTableView.m */; };
 		6BED888E2B4E901900F76DDC /* downloadFileRecordCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 6BED888C2B4E901900F76DDC /* downloadFileRecordCell.h */; };
@@ -2197,6 +2201,8 @@
 		6BDB85BC2D57444400526D1F /* BoxHeartbeatReStartSucView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BoxHeartbeatReStartSucView.m; sourceTree = "<group>"; };
 		6BEA31732BB65606005167AA /* clearCacheAlretViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = clearCacheAlretViewController.h; sourceTree = "<group>"; };
 		6BEA31742BB65606005167AA /* clearCacheAlretViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = clearCacheAlretViewController.m; sourceTree = "<group>"; };
+		6BECEE612D8AC1D900CEC9A5 /* searchListModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = searchListModel.h; sourceTree = "<group>"; };
+		6BECEE622D8AC1D900CEC9A5 /* searchListModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = searchListModel.m; sourceTree = "<group>"; };
 		6BED88882B4E819000F76DDC /* downloadFileRecordTableView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = downloadFileRecordTableView.h; sourceTree = "<group>"; };
 		6BED88892B4E819000F76DDC /* downloadFileRecordTableView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = downloadFileRecordTableView.m; sourceTree = "<group>"; };
 		6BED888C2B4E901900F76DDC /* downloadFileRecordCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = downloadFileRecordCell.h; sourceTree = "<group>"; };
@@ -3767,6 +3773,8 @@
 				6BF62B172D55D9E400E7A98A /* queryHeartbeatModel.m */,
 				6B6C98012D82D8430095A4CA /* getInstalledAppListModel.h */,
 				6B6C98022D82D8430095A4CA /* getInstalledAppListModel.m */,
+				6BECEE612D8AC1D900CEC9A5 /* searchListModel.h */,
+				6BECEE622D8AC1D900CEC9A5 /* searchListModel.m */,
 			);
 			path = model;
 			sourceTree = "<group>";
@@ -4151,6 +4159,7 @@
 				6B2C1E862C070ADE00FDCF82 /* ZFPlayerConst.h in Headers */,
 				6BFF26992AFA16DA00FCB4F7 /* forgetSecretKeyViewController.h in Headers */,
 				6B45C4FD2B57BC87007E6911 /* cloudPhoneExtraFileListModel.h in Headers */,
+				6BECEE642D8AC1D900CEC9A5 /* searchListModel.h in Headers */,
 				6B2C1E642C070ADE00FDCF82 /* ZFLandscapeRotationManager_iOS15.h in Headers */,
 				6BF558C62C45247E00701854 /* audioPlayListView.h in Headers */,
 				6BFF26912AF9D88200FCB4F7 /* AuthCodeTextField.h in Headers */,
@@ -4459,6 +4468,7 @@
 				6B2C1E872C070ADE00FDCF82 /* ZFPlayerConst.h in Headers */,
 				6BD5069F2B9576A4006E7CB0 /* forgetSecretKeyViewController.h in Headers */,
 				6BD506A02B9576A4006E7CB0 /* cloudPhoneExtraFileListModel.h in Headers */,
+				6BECEE662D8AC1D900CEC9A5 /* searchListModel.h in Headers */,
 				6B2C1E652C070ADE00FDCF82 /* ZFLandscapeRotationManager_iOS15.h in Headers */,
 				6BF558C82C45247E00701854 /* audioPlayListView.h in Headers */,
 				6BD506A12B9576A4006E7CB0 /* AuthCodeTextField.h in Headers */,
@@ -5050,6 +5060,7 @@
 				6B6ABEE92BFF49C800480BAC /* receiveDownloadRecordTableView.m in Sources */,
 				6BD507272B9576A4006E7CB0 /* AJPhotoListView.m in Sources */,
 				6B2C1E592C070ADE00FDCF82 /* UIScrollView+ZFPlayer.m in Sources */,
+				6BECEE652D8AC1D900CEC9A5 /* searchListModel.m in Sources */,
 				6BD507282B9576A4006E7CB0 /* PwdInPutView.m in Sources */,
 				6B3AD68C2BF4AE630096D6B7 /* backupsOptionViewController.m in Sources */,
 				6B2C1EAB2C070ADE00FDCF82 /* ZFReachabilityManager.m in Sources */,
@@ -5440,6 +5451,7 @@
 				6B6ABEE72BFF49C800480BAC /* receiveDownloadRecordTableView.m in Sources */,
 				6B05819E2AFCF4E800D37290 /* AJPhotoListView.m in Sources */,
 				6B2C1E582C070ADE00FDCF82 /* UIScrollView+ZFPlayer.m in Sources */,
+				6BECEE632D8AC1D900CEC9A5 /* searchListModel.m in Sources */,
 				18E557292A3C60ED005CC84B /* PwdInPutView.m in Sources */,
 				6B3AD68B2BF4AE630096D6B7 /* backupsOptionViewController.m in Sources */,
 				6B2C1EAA2C070ADE00FDCF82 /* ZFReachabilityManager.m in Sources */,