|
@@ -19,8 +19,8 @@
|
|
|
#import "editTypeBottomView.h"
|
|
|
#import "editShareView.h"
|
|
|
#import "previewToUploadFileView.h"
|
|
|
-
|
|
|
#import "netWorkManager.h"
|
|
|
+#import "NASFileAudioModel.h"
|
|
|
|
|
|
@interface previewAudioOrDocumentViewController ()<UITableViewDelegate,UITableViewDataSource,DZNEmptyDataSetSource, DZNEmptyDataSetDelegate>
|
|
|
{
|
|
@@ -45,8 +45,8 @@
|
|
|
@property(nonatomic,strong) editTypeBottomView*curEditTypeBottomView;
|
|
|
@property(nonatomic,strong) UIButton*uploadFileButton;
|
|
|
|
|
|
-@property(nonatomic,strong) couldPhoneFileListModel *curCouldPhoneFileListMod;
|
|
|
@property (nonatomic, strong) NSMutableArray*didSelectListArr;//选中的数据
|
|
|
+@property (nonatomic, strong)NASFileAudioModel * curNASFileAudioMod;
|
|
|
@end
|
|
|
|
|
|
@implementation previewAudioOrDocumentViewController
|
|
@@ -301,11 +301,11 @@
|
|
|
&& ![self.defaultDiskPath isEqualToString:pathStr]){
|
|
|
//切换硬盘了 取消全选
|
|
|
|
|
|
- //_rightSelectAllButton.selected = YES;
|
|
|
- //[self didClickSelectAllButton:_rightSelectAllButton];
|
|
|
+ [_didSelectListArr removeAllObjects];
|
|
|
}
|
|
|
|
|
|
self.defaultDiskPath = pathStr;
|
|
|
+ [self getFileListFun];
|
|
|
[self setTitleAfterGetdiskFun];
|
|
|
[self hideDiskListVieFun];
|
|
|
}
|
|
@@ -316,10 +316,10 @@
|
|
|
}
|
|
|
|
|
|
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
|
|
- if(!_curCouldPhoneFileListMod){
|
|
|
+ if(!_curNASFileAudioMod){
|
|
|
return 0;
|
|
|
}
|
|
|
- return _curCouldPhoneFileListMod.data.list.count;
|
|
|
+ return _curNASFileAudioMod.data.list.count;
|
|
|
}
|
|
|
|
|
|
- (downLoadPreViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
|
@@ -343,15 +343,15 @@
|
|
|
|
|
|
}
|
|
|
|
|
|
- if(row < _curCouldPhoneFileListMod.data.list.count){
|
|
|
- couldPhoneFileModel* fileModel = _curCouldPhoneFileListMod.data.list[row];
|
|
|
- cell.curFileModel = fileModel;
|
|
|
+ if(row < _curNASFileAudioMod.data.list.count){
|
|
|
+ NASFileAudioDataModel* dataModel = _curNASFileAudioMod.data.list[row];
|
|
|
+ cell.curNASFileAudioDataModel = dataModel;
|
|
|
|
|
|
KWeakSelf
|
|
|
cell.didClickSwitch = ^(BOOL SwitchOn) {
|
|
|
- if([weakSelf userCheckFileModel:fileModel withShowTip:YES]){
|
|
|
- [weakSelf userCheckFilePreviewByRow:row];
|
|
|
- }
|
|
|
+// if([weakSelf userCheckFileModel:fileModel withShowTip:YES]){
|
|
|
+// [weakSelf userCheckFilePreviewByRow:row];
|
|
|
+// }
|
|
|
};
|
|
|
}
|
|
|
return cell;
|
|
@@ -364,13 +364,13 @@
|
|
|
#pragma mark 空数据
|
|
|
- (UIImage *)imageForEmptyDataSet:(UIScrollView *)scrollView {
|
|
|
|
|
|
- NSString *imageName = @"uploadFile_noData";
|
|
|
+ NSString *imageName = @"common_no_data_pic";
|
|
|
|
|
|
return [UIImage imageNamed:imageName];
|
|
|
}
|
|
|
|
|
|
- (NSAttributedString *)titleForEmptyDataSet:(UIScrollView *)scrollView {
|
|
|
- NSString *text = NSLocalizedString(@"File_download_file_no_data",nil);
|
|
|
+ NSString *text = NSLocalizedString(@"common_no_data_tip",nil);
|
|
|
|
|
|
NSDictionary *attributes = @{NSFontAttributeName: [UIFont systemFontOfSize:16.0f],
|
|
|
NSForegroundColorAttributeName: HW999999Color};
|
|
@@ -478,21 +478,21 @@
|
|
|
|
|
|
- (void)userCheckFilePreviewByRow:(NSInteger)row
|
|
|
{
|
|
|
- if(row < _curCouldPhoneFileListMod.data.list.count){
|
|
|
- couldPhoneFileModel* fileModel = _curCouldPhoneFileListMod.data.list[row];
|
|
|
-
|
|
|
- if(fileModel.isSelectType){
|
|
|
- [_didSelectListArr removeObject:fileModel];
|
|
|
- }
|
|
|
- else{
|
|
|
- [_didSelectListArr addObject:fileModel];
|
|
|
- }
|
|
|
-
|
|
|
- fileModel.isSelectType = !fileModel.isSelectType;
|
|
|
- //[self.tableView reloadData];
|
|
|
- //[self.dataCollectionView reloadData];
|
|
|
- [self setEditTypeTitleFun];
|
|
|
- }
|
|
|
+// if(row < _curCouldPhoneFileListMod.data.list.count){
|
|
|
+// couldPhoneFileModel* fileModel = _curCouldPhoneFileListMod.data.list[row];
|
|
|
+//
|
|
|
+// if(fileModel.isSelectType){
|
|
|
+// [_didSelectListArr removeObject:fileModel];
|
|
|
+// }
|
|
|
+// else{
|
|
|
+// [_didSelectListArr addObject:fileModel];
|
|
|
+// }
|
|
|
+//
|
|
|
+// fileModel.isSelectType = !fileModel.isSelectType;
|
|
|
+// //[self.tableView reloadData];
|
|
|
+// //[self.dataCollectionView reloadData];
|
|
|
+// [self setEditTypeTitleFun];
|
|
|
+// }
|
|
|
}
|
|
|
|
|
|
- (void)didClickSelectAllButton:(UIButton*)button
|
|
@@ -502,22 +502,22 @@
|
|
|
|
|
|
[_didSelectListArr removeAllObjects];
|
|
|
|
|
|
- for (couldPhoneFileModel* fileModel in _curCouldPhoneFileListMod.data.list) {
|
|
|
-
|
|
|
- if(!button.selected){
|
|
|
- fileModel.isSelectType = button.selected;
|
|
|
- }
|
|
|
- else{
|
|
|
- [_didSelectListArr addObject:fileModel];
|
|
|
- if([self userCheckFileModel:fileModel withShowTip:NO]){
|
|
|
- fileModel.isSelectType = button.selected;
|
|
|
- }
|
|
|
- else{
|
|
|
- isNeedShowTip = YES;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
+// for (couldPhoneFileModel* fileModel in _curCouldPhoneFileListMod.data.list) {
|
|
|
+//
|
|
|
+// if(!button.selected){
|
|
|
+// fileModel.isSelectType = button.selected;
|
|
|
+// }
|
|
|
+// else{
|
|
|
+// [_didSelectListArr addObject:fileModel];
|
|
|
+// if([self userCheckFileModel:fileModel withShowTip:NO]){
|
|
|
+// fileModel.isSelectType = button.selected;
|
|
|
+// }
|
|
|
+// else{
|
|
|
+// isNeedShowTip = YES;
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+// }
|
|
|
|
|
|
if(isNeedShowTip){
|
|
|
if(_isAudioType){
|
|
@@ -672,12 +672,10 @@
|
|
|
- (void)setTitleAfterGetdiskFun
|
|
|
{
|
|
|
if(_isAudioType){
|
|
|
- //self.titleLabel.text = NSLocalizedString(@"my_set_no_image_upload",nil) ;
|
|
|
- [self setTitleLabelText:NSLocalizedString(@"my_set_no_image_upload",nil)];
|
|
|
+ [self setTitleLabelText:NSLocalizedString(@"my_set_no_music",nil)];
|
|
|
}
|
|
|
else{
|
|
|
- //self.titleLabel.text = NSLocalizedString(@"my_set_no_video_upload",nil) ;
|
|
|
- [self setTitleLabelText:NSLocalizedString(@"my_set_no_video_upload",nil)];
|
|
|
+ [self setTitleLabelText:NSLocalizedString(@"my_set_no_file",nil)];
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -693,7 +691,9 @@
|
|
|
[self showDownloadTipFun];
|
|
|
[self checkFileTransferTask];
|
|
|
|
|
|
- [self getFileListFun];
|
|
|
+ if(!_curNASFileAudioMod){
|
|
|
+ [self getFileListFun];
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- (void)viewWillDisappear:(BOOL)animated{
|
|
@@ -795,12 +795,29 @@
|
|
|
[paraDict setValue:@"file" forKey:@"type"];
|
|
|
}
|
|
|
|
|
|
+ NSArray *diskNameArr = [_defaultDiskPath componentsSeparatedByString:@"/"];
|
|
|
+ if(diskNameArr && diskNameArr.count >= 2){
|
|
|
+
|
|
|
+ NSString *name = diskNameArr.lastObject;
|
|
|
+ if(name.length == 0)
|
|
|
+ {
|
|
|
+ name = diskNameArr[diskNameArr.count -2];
|
|
|
+ }
|
|
|
+
|
|
|
+ [paraDict setValue:name forKey:@"path"];
|
|
|
+ }
|
|
|
|
|
|
[self showNewIndicatorHaveStrWithCanBack:YES canTouch:NO showText:NSLocalizedString(@"common_loading_tip",nil)];
|
|
|
|
|
|
KWeakSelf
|
|
|
[[netWorkManager shareInstance] cloudPhoneGETCallBackCode:@"getFileList" Parameters:paraDict success:^(id _Nonnull responseObject) {
|
|
|
[weakSelf removeNewIndicatorHaveStr];
|
|
|
+ weakSelf.curNASFileAudioMod = [[NASFileAudioModel alloc] initWithDictionary:responseObject error:nil];
|
|
|
+
|
|
|
+ if(weakSelf.curNASFileAudioMod && weakSelf.curNASFileAudioMod.status == 0){
|
|
|
+ [weakSelf.tableView reloadData];
|
|
|
+ }
|
|
|
+
|
|
|
} failure:^(NSError * _Nonnull error) {
|
|
|
[weakSelf removeNewIndicatorHaveStr];
|
|
|
}];
|