Pārlūkot izejas kodu

1.最近文件除了删除功能

huangxiaodong 11 mēneši atpakaļ
vecāks
revīzija
7681768518

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

@@ -174,6 +174,10 @@
 		6B07E0A72C3CD4AF004A3238 /* lastFileTableViewCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B07E0A42C3CD4AF004A3238 /* lastFileTableViewCell.h */; };
 		6B07E0A82C3CD4AF004A3238 /* lastFileTableViewCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B07E0A42C3CD4AF004A3238 /* lastFileTableViewCell.h */; };
 		6B07E0A92C3CD4AF004A3238 /* lastFileTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B07E0A52C3CD4AF004A3238 /* lastFileTableViewCell.m */; };
+		6B07E0AC2C3D1ED5004A3238 /* nasLastFileViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B07E0AB2C3D1ED5004A3238 /* nasLastFileViewController.m */; };
+		6B07E0AD2C3D1ED5004A3238 /* nasLastFileViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B07E0AA2C3D1ED5004A3238 /* nasLastFileViewController.h */; };
+		6B07E0AE2C3D1ED5004A3238 /* nasLastFileViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B07E0AA2C3D1ED5004A3238 /* nasLastFileViewController.h */; };
+		6B07E0AF2C3D1ED5004A3238 /* nasLastFileViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B07E0AB2C3D1ED5004A3238 /* nasLastFileViewController.m */; };
 		6B0D004B2BFE104B00F02719 /* queryOneShareModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B0D004A2BFE104B00F02719 /* queryOneShareModel.m */; };
 		6B0D004C2BFE104B00F02719 /* queryOneShareModel.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B0D00492BFE104B00F02719 /* queryOneShareModel.h */; };
 		6B0D004D2BFE104B00F02719 /* queryOneShareModel.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B0D00492BFE104B00F02719 /* queryOneShareModel.h */; };
@@ -1442,6 +1446,8 @@
 		6B07AC2A2BF8D38F005C2B0E /* NASFileAudioModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NASFileAudioModel.m; sourceTree = "<group>"; };
 		6B07E0A42C3CD4AF004A3238 /* lastFileTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = lastFileTableViewCell.h; sourceTree = "<group>"; };
 		6B07E0A52C3CD4AF004A3238 /* lastFileTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = lastFileTableViewCell.m; sourceTree = "<group>"; };
+		6B07E0AA2C3D1ED5004A3238 /* nasLastFileViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = nasLastFileViewController.h; sourceTree = "<group>"; };
+		6B07E0AB2C3D1ED5004A3238 /* nasLastFileViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = nasLastFileViewController.m; sourceTree = "<group>"; };
 		6B0D00492BFE104B00F02719 /* queryOneShareModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = queryOneShareModel.h; sourceTree = "<group>"; };
 		6B0D004A2BFE104B00F02719 /* queryOneShareModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = queryOneShareModel.m; sourceTree = "<group>"; };
 		6B1CC2C42B677F3D00AD4217 /* extraMediaEventModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = extraMediaEventModel.h; sourceTree = "<group>"; };
@@ -2884,6 +2890,8 @@
 				6B679DE92C252A4E00D0DC03 /* NASMySpaceViewController.m */,
 				6B39586D2C34FA25003FC6C3 /* NasPreviewVideoViewController.h */,
 				6B39586E2C34FA25003FC6C3 /* NasPreviewVideoViewController.m */,
+				6B07E0AA2C3D1ED5004A3238 /* nasLastFileViewController.h */,
+				6B07E0AB2C3D1ED5004A3238 /* nasLastFileViewController.m */,
 			);
 			path = NAS;
 			sourceTree = "<group>";
@@ -3735,6 +3743,7 @@
 				6B7EA7AA2BF72D3B002D5CC2 /* queryShareModel.h in Headers */,
 				6B93549B2BF369D000AA8D31 /* previewToUploadFileView.h in Headers */,
 				6B5D40272B4BC402000965CF /* couldPhoneFileListModel.h in Headers */,
+				6B07E0AD2C3D1ED5004A3238 /* nasLastFileViewController.h in Headers */,
 				6B5B606E2B3D7E3B009A2AE2 /* fileTransferPathCheckViewController.h in Headers */,
 				186820252AB9B5BF005702A6 /* SetPWDFirstViewController.h in Headers */,
 			);
@@ -3974,6 +3983,7 @@
 				6B7EA7AC2BF72D3B002D5CC2 /* queryShareModel.h in Headers */,
 				6B93549C2BF369D000AA8D31 /* previewToUploadFileView.h in Headers */,
 				6BD5070E2B9576A4006E7CB0 /* couldPhoneFileListModel.h in Headers */,
+				6B07E0AE2C3D1ED5004A3238 /* nasLastFileViewController.h in Headers */,
 				6BD5070F2B9576A4006E7CB0 /* fileTransferPathCheckViewController.h in Headers */,
 				6BD507102B9576A4006E7CB0 /* SetPWDFirstViewController.h in Headers */,
 			);
@@ -4432,6 +4442,7 @@
 				6BD507412B9576A4006E7CB0 /* AudioSessionObject.m in Sources */,
 				6B6ABEDD2BFF3AA400480BAC /* receiveView.m in Sources */,
 				6BC7414F2C240A670049BA8D /* webSocketManager+downloadFile.m in Sources */,
+				6B07E0AF2C3D1ED5004A3238 /* nasLastFileViewController.m in Sources */,
 				6BD507422B9576A4006E7CB0 /* ChangeLogoViewController.m in Sources */,
 				6BD507432B9576A4006E7CB0 /* uploadFileRecordheadView.m in Sources */,
 				6BD507442B9576A4006E7CB0 /* HWAgreementViewController.m in Sources */,
@@ -4753,6 +4764,7 @@
 				6BBB35DE2AE76AD800E4A59B /* AudioSessionObject.m in Sources */,
 				6B6ABEDB2BFF3AA400480BAC /* receiveView.m in Sources */,
 				6BC7414D2C240A670049BA8D /* webSocketManager+downloadFile.m in Sources */,
+				6B07E0AC2C3D1ED5004A3238 /* nasLastFileViewController.m in Sources */,
 				181E84FC2A8F57A500292B96 /* ChangeLogoViewController.m in Sources */,
 				6B8FF6BA2B04E19600800981 /* uploadFileRecordheadView.m in Sources */,
 				A031DD7F27EC78C800909527 /* HWAgreementViewController.m in Sources */,

+ 1 - 1
创维盒子/双子星云手机/Class/Set/previewFile/previewAudioOrDocumentViewController.m

@@ -496,7 +496,7 @@
     [_didSelectListArr removeAllObjects];
     
     _isEditType = NO;
-    //[self.tableView  reloadData];
+    [self.tableView  reloadData];
     
     _curEditTypeHeadView.hidden = YES;
     _curEditTypeBottomView.hidden = YES;

+ 1 - 1
创维盒子/双子星云手机/Class/Set/previewFile/previewFileAndFolderSecondViewController.m

@@ -366,7 +366,7 @@
     [_didSelectListArr removeAllObjects];
     
     _isEditType = NO;
-    //[self.tableView  reloadData];
+    [self.tableView  reloadData];
     
     _curEditTypeHeadView.hidden = YES;
     _curEditTypeBottomView.hidden = YES;

+ 1 - 1
创维盒子/双子星云手机/Class/Set/previewFile/previewFileAndFolderViewController.m

@@ -488,7 +488,7 @@
     [_didSelectListArr removeAllObjects];
     
     _isEditType = NO;
-    //[self.tableView  reloadData];
+    [self.tableView  reloadData];
     
     _curEditTypeHeadView.hidden = YES;
     _curEditTypeBottomView.hidden = YES;

+ 18 - 0
创维盒子/双子星云手机/NAS/NASViewController.m

@@ -22,6 +22,7 @@
 #import "NasPreviewVideoViewController.h"
 #import "lastFileManager.h"
 #import "lastFileTableViewCell.h"
+#import "nasLastFileViewController.h"
 
 @interface NASViewController ()<UITableViewDelegate,UITableViewDataSource>
 @property (nonatomic,strong)UITableView*tableView;
@@ -271,6 +272,7 @@
     //            //[weakSelf userCheckFilePreviewByRow:row];
     //        };
             
+            cell.cellBgView.layer.mask = nil;
             if(row == _lastFileDataArr.count -1){
                 /*下圆角*/
                 UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_W-32 , 84)
@@ -393,6 +395,10 @@
     if(tag == 2){
         [self getLastFileDataFun];
     }
+    else if (tag ==1){
+        nasLastFileViewController *vc = [nasLastFileViewController new];
+        [self pushViewController:vc animated:YES];
+    }
 }
 
 #pragma mark 用户点击上传文件
@@ -501,6 +507,7 @@
         CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
         maskLayer.frame = self.NASLastFileV.bounds;
         maskLayer.path = maskPath.CGPath;
+        self.NASLastFileV.whiteBgView.layer.mask = nil;
         self.NASLastFileV.whiteBgView.layer.mask = maskLayer;
         
         _lastFileDataArr = [NSMutableArray new];
@@ -519,6 +526,16 @@
         self.NASLastFileV.notDataImageV.hidden = YES;
         self.NASLastFileV.notDataLabel.hidden = YES;
         
+        /*上圆角*/
+        UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_W- 32 , 54)
+                                                       byRoundingCorners:UIRectCornerTopLeft|UIRectCornerTopRight
+                                                             cornerRadii:CGSizeMake(12, 12)];
+        CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
+        maskLayer.frame = CGRectMake(0, 0, SCREEN_W -32, 54);
+        maskLayer.path = maskPath.CGPath;
+        self.NASLastFileV.whiteBgView.layer.mask = nil;
+        self.NASLastFileV.whiteBgView.layer.mask = maskLayer;
+        
     }
     else{
         _tableHeadView.frame = CGRectMake(0, 0, SCREEN_W, 165+ 15 +120 +254 + 15);
@@ -540,6 +557,7 @@
         CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
         maskLayer.frame = self.NASLastFileV.bounds;
         maskLayer.path = maskPath.CGPath;
+        self.NASLastFileV.whiteBgView.layer.mask = nil;
         self.NASLastFileV.whiteBgView.layer.mask = maskLayer;
     }
     

+ 2 - 2
创维盒子/双子星云手机/NAS/NasPreviewVideoViewController.m

@@ -486,7 +486,7 @@
     [_didSelectListArr removeAllObjects];
     
     _isEditType = NO;
-    //[self.tableView  reloadData];
+    [self.tableView  reloadData];
     
     _curEditTypeHeadView.hidden = YES;
     _curEditTypeBottomView.hidden = YES;
@@ -939,7 +939,7 @@
 {
     NSMutableDictionary *paraDict = [NSMutableDictionary new];
     
-    [paraDict setValue:@4 forKey:@"type"];
+    [paraDict setValue:@3 forKey:@"type"];
     
     KWeakSelf
     [[netWorkManager shareInstance] CommonGetWithCallBackCode:queryShareSwitchFun Parameters:paraDict success:^(id  _Nonnull responseObject){

+ 16 - 0
创维盒子/双子星云手机/NAS/nasLastFileViewController.h

@@ -0,0 +1,16 @@
+//
+//  nasLastFileViewController.h
+//  双子星云手机
+//
+//  Created by xd h on 2024/7/9.
+//
+
+#import "BaseViewController.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface nasLastFileViewController : BaseViewController
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 468 - 0
创维盒子/双子星云手机/NAS/nasLastFileViewController.m

@@ -0,0 +1,468 @@
+//
+//  nasLastFileViewController.m
+//  双子星云手机
+//
+//  Created by xd h on 2024/7/9.
+//
+
+#import "nasLastFileViewController.h"
+#import "lastFileTableViewCell.h"
+#import "editTypeHeadView.h"
+#import "editTypeBottomView.h"
+#import "downloadManager.h"
+#import "uploadFileRecordViewController.h"
+#import "queryShareModel.h"
+#import "audioPlayerViewController.h"
+#import "videoPlayByAVPlayerViewController.h"
+#import "editShareView.h"
+
+@interface nasLastFileViewController ()<UITableViewDelegate,UITableViewDataSource,DZNEmptyDataSetSource, DZNEmptyDataSetDelegate>
+@property(nonatomic,strong) UITableView*tableView;
+@property (nonatomic,strong) NSMutableArray *lastFileDataArr;
+
+@property(nonatomic,assign) BOOL isEditType;
+@property(nonatomic,strong) editTypeHeadView*curEditTypeHeadView;
+@property(nonatomic,strong) editTypeBottomView*curEditTypeBottomView;
+
+@property (nonatomic, strong)  NSMutableArray*didSelectListArr;//选中的数据
+
+@end
+
+@implementation nasLastFileViewController
+
+- (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 hwColor:@"#F6F8FA"]];
+    [self.view setBackgroundColor:[UIColor whiteColor]];
+    
+    self.titleLabel.text = NSLocalizedString(@"NAS_last_file",nil);
+    
+    [self drawAnyView];
+    
+    _didSelectListArr = [NSMutableArray new];
+}
+
+- (void)drawAnyView{
+    
+    [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);
+    }];
+    
+    _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 编辑状态的 取消 和全选按钮 响应事件
+    KWeakSelf
+    _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, 0, 0) 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;
+    }
+    
+    return _tableView;
+}
+
+#pragma mark - 列表委托
+- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
+    return 1;
+}
+
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
+    if(!_lastFileDataArr){
+        return 0;
+    }
+    return _lastFileDataArr.count;
+}
+
+- (lastFileTableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
+    
+        __block NSInteger row = indexPath.row;
+        static NSString *identifier = @"lastFileTableViewCell";
+    
+        lastFileTableViewCell * cell =  [tableView dequeueReusableCellWithIdentifier:identifier];
+        cell.selectionStyle = UITableViewCellSelectionStyleNone;
+        if (!cell){
+            cell = [[lastFileTableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier];
+            [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
+            [cell setBackgroundColor:[UIColor clearColor]];
+            [cell setAccessoryType:(UITableViewCellAccessoryNone)];
+            [cell hideCheckButtonBy:NO];
+        }
+    
+        if(row < _lastFileDataArr.count){
+            lastFileModel* dataModel = _lastFileDataArr[row];
+            cell.curLastFileModel = dataModel;
+    
+            KWeakSelf
+            cell.didClickSwitch = ^(BOOL SwitchOn) {
+                [weakSelf userCheckFilePreviewByRow:row];
+            };
+        }
+    
+    return cell;
+}
+
+- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
+    return 84;
+}
+
+- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
+{
+    NSInteger row = indexPath.row;
+//    if(row < _curNASFileAudioMod.data.list.count){
+//        
+//        NASFilePicDataArrModel *dataModel = _curNASFileAudioMod.data.list[row];
+//        //videoPlayViewController *vc = [videoPlayViewController new];
+//        videoPlayByAVPlayerViewController *vc = [videoPlayByAVPlayerViewController new];
+//        vc.VideoDataMode = dataModel;
+//        [self.navigationController pushViewController:vc animated:YES];
+//        
+//    }
+}
+
+#pragma mark 空数据
+- (UIImage *)imageForEmptyDataSet:(UIScrollView *)scrollView {
+    
+    NSString *imageName = @"nas_not_data";
+    
+    return [UIImage imageNamed:imageName];
+}
+
+- (NSAttributedString *)titleForEmptyDataSet:(UIScrollView *)scrollView {
+    NSString *text = NSLocalizedString(@"NAS_last_file_not_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;
+}
+
+#pragma mark 用户长按图片进入编辑
+- (void)setViewEditTypeFun
+{
+    _isEditType = YES;
+    //[self.tableView  reloadData];
+    
+    _curEditTypeHeadView.hidden = NO;
+    _curEditTypeBottomView.hidden = NO;
+    
+    [self.tableView mas_remakeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(0);
+        make.right.mas_equalTo(0);
+        make.bottom.mas_equalTo(_curEditTypeBottomView.mas_top);
+        make.top.equalTo(self.navBarBGView.mas_bottom).offset(10.f);
+    }];
+}
+
+
+#pragma mark 用户取消编辑编辑
+- (void)userCancelEditTypeFun
+{
+    //数据还原
+    for (lastFileModel*model in _didSelectListArr) {
+        model.isSelectType = NO;
+    }
+    [_didSelectListArr removeAllObjects];
+    
+    _isEditType = NO;
+    [self.tableView  reloadData];
+    
+    _curEditTypeHeadView.hidden = YES;
+    _curEditTypeBottomView.hidden = YES;
+    
+    [self.tableView  mas_remakeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(0);
+        make.right.mas_equalTo(0);
+        make.bottom.mas_equalTo(0);
+        make.top.equalTo(self.navBarBGView.mas_bottom).offset(10.f);
+    }];
+}
+
+- (void)userCheckFilePreviewByRow:(NSInteger)row
+{
+    if(row < _lastFileDataArr.count){
+        lastFileModel* dataModel = _lastFileDataArr[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 (lastFileModel* dataModel in _lastFileDataArr) {
+        
+        if(!button.selected){
+            dataModel.isSelectType = button.selected;
+        }
+        else{
+            [_didSelectListArr addObject:dataModel];
+            dataModel.isSelectType = button.selected;
+        }
+    }
+    
+    [self.tableView reloadData];
+    [self setEditTypeTitleFun];
+}
+
+#pragma mark 设置选中标题
+- (void)setEditTypeTitleFun
+{
+    [_curEditTypeHeadView setTitleLabetextByNumbers:_didSelectListArr.count];
+    
+    if(_didSelectListArr.count > 0){
+        [self  setViewEditTypeFun];
+    }
+    else{
+        [self userCancelEditTypeFun];
+    }
+}
+
+#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:nil
+                                                                              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];
+    }];
+}
+
+#pragma  mark 删除成功
+- (void)didDeleteSucFun
+{
+    [_didSelectListArr removeAllObjects];
+    [self setEditTypeTitleFun];
+    
+    [self getLastFileDataFun];
+}
+
+#pragma mark 文件下载
+- (void)gotoDownLoadFileFun
+{
+    if(_didSelectListArr.count == 0){
+        [[iToast makeText:@""] show];
+        return;
+    }
+    
+    NSMutableArray *arr = [NSMutableArray new];
+    for (lastFileModel *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)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 = @"6";
+    [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);
+    }];
+}
+
+#pragma mark 获取分享开关
+-(void)queryShareSwitchFunFun
+{
+    NSMutableDictionary *paraDict = [NSMutableDictionary new];
+    
+    [paraDict setValue:@7 forKey:@"type"];
+    
+    KWeakSelf
+    [[netWorkManager shareInstance] CommonGetWithCallBackCode:queryShareSwitchFun Parameters:paraDict success:^(id  _Nonnull responseObject){
+        queryShareModel *queryShareMod = [[queryShareModel alloc] initWithDictionary:responseObject error:nil];
+        if(queryShareMod){
+            [weakSelf.curEditTypeBottomView setCanShaewFunBy:queryShareMod.data.configValue];
+        }
+        
+    } failure:^(NSError * _Nonnull error) {
+    }];
+}
+
+
+- (void)viewWillAppear:(BOOL)animated{
+    [super viewWillAppear:animated];
+    [self getLastFileDataFun];
+    
+    [self queryShareSwitchFunFun];
+}
+
+#pragma mark 获取最近文件数据
+- (void)getLastFileDataFun
+{
+    _lastFileDataArr = [lastFileManager shareManager].lastFileListArr;
+    //HLog(@"%@",_lastFileDataArr);
+    [self.tableView reloadData];
+}
+@end

+ 6 - 3
创维盒子/双子星云手机/NAS/recenFile/lastFileManager.m

@@ -97,10 +97,10 @@
                        NSTimeInterval time1 = obj1.lastPreTime;
                         NSTimeInterval time2 = obj2.lastPreTime;
                        if (time1 < time2) {
-                           return NSOrderedAscending;
+                           return NSOrderedDescending;
                        }
                        if (time1 > time2) {
-                           return NSOrderedDescending;
+                           return NSOrderedAscending;
                        }
                        return NSOrderedSame;
                    }];
@@ -141,8 +141,11 @@
         BOOL isNewObj = YES;
         for (lastFileModel*preModel in self.lastFileListArr) {
             if([preModel.path isEqualToString:lastFileMod.path]){
-                isNewObj = NO;
+                //isNewObj = NO;
                 preModel.lastPreTime = lastFileMod.lastPreTime;
+                
+                //删除掉 后面在添加到首位
+                [self.lastFileListArr removeObject:preModel];
                 break;
             }
         }

+ 0 - 8
创维盒子/双子星云手机/NAS/view/NASLastFileView.m

@@ -31,14 +31,6 @@
 //    whiteBgView.layer.cornerRadius = 12;
 //    whiteBgView.layer.masksToBounds = YES;
     
-    /*上圆角*/
-    UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_W- 32 , 54)
-                                                   byRoundingCorners:UIRectCornerTopLeft|UIRectCornerTopRight
-                                                         cornerRadii:CGSizeMake(12, 12)];
-    CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
-    maskLayer.frame = CGRectMake(0, 0, SCREEN_W -32, 54);
-    maskLayer.path = maskPath.CGPath;
-    _whiteBgView.layer.mask = maskLayer;
     
     [_whiteBgView mas_makeConstraints:^(MASConstraintMaker *make) {
         make.top.mas_equalTo(0);

+ 8 - 0
创维盒子/双子星云手机/NAS/view/lastFileTableViewCell.m

@@ -262,6 +262,14 @@
             make.top.equalTo(_titleLabel.mas_bottom).offset(5.0);
         }];
     }
+    else{
+        [_cellBgView mas_remakeConstraints:^(MASConstraintMaker *make) {
+            make.left.mas_equalTo(0.f);
+            make.top.mas_equalTo(0);
+            make.bottom.mas_equalTo(0);
+            make.width.mas_equalTo(SCREEN_W);
+        }];
+    }
 }
 
 @end

+ 1 - 1
创维盒子/双子星云手机/netWork/newWorkInterface.h

@@ -71,7 +71,7 @@
 #define getIpFun  @"/box/ip/allocation/getIp"
 
 /*10 分享开关接口  GET请求
-输入参数    type 1=应用;2=图片;3=视频;4=音频;5=文档;6=文件
+输入参数    type 1=应用;2=图片;3=视频;4=音频;5=文档;6=文件 7=最近文件
  
  返回数据模型 */
 #define queryShareSwitchFun  @"/box/share/info/queryShareSwitch"