|
|
@@ -20,6 +20,8 @@
|
|
|
#import "editShareView.h"
|
|
|
#import "previewToUploadFileView.h"
|
|
|
|
|
|
+#import "netWorkManager.h"
|
|
|
+
|
|
|
@interface previewAudioOrDocumentViewController ()<UITableViewDelegate,UITableViewDataSource,DZNEmptyDataSetSource, DZNEmptyDataSetDelegate>
|
|
|
{
|
|
|
UIButton *tapBtn;
|
|
|
@@ -59,10 +61,6 @@
|
|
|
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];
|
|
|
|
|
|
_didSelectListArr = [NSMutableArray new];
|
|
|
@@ -308,7 +306,6 @@
|
|
|
}
|
|
|
|
|
|
self.defaultDiskPath = pathStr;
|
|
|
- //[self searchFileListFun];
|
|
|
[self setTitleAfterGetdiskFun];
|
|
|
[self hideDiskListVieFun];
|
|
|
}
|
|
|
@@ -678,20 +675,20 @@
|
|
|
[self setTitleLabelText:NSLocalizedString(@"my_set_no_video_upload",nil)];
|
|
|
}
|
|
|
|
|
|
- [self searchFileListFun];
|
|
|
}
|
|
|
|
|
|
- (void)viewWillAppear:(BOOL)animated
|
|
|
{
|
|
|
[super viewWillAppear:animated];
|
|
|
|
|
|
-
|
|
|
}
|
|
|
|
|
|
- (void)viewDidAppear:(BOOL)animated{
|
|
|
[super viewDidAppear:animated];
|
|
|
[self showDownloadTipFun];
|
|
|
[self checkFileTransferTask];
|
|
|
+
|
|
|
+ [self getFileListFun];
|
|
|
}
|
|
|
|
|
|
- (void)viewWillDisappear:(BOOL)animated{
|
|
|
@@ -701,62 +698,9 @@
|
|
|
[self removeNewIndicatorHaveStr];
|
|
|
}
|
|
|
|
|
|
-- (void)searchFileListFun
|
|
|
-{
|
|
|
- NSMutableDictionary *dict = [NSMutableDictionary new];
|
|
|
- NSNumber *curNum = [NSNumber numberWithBool:_isAudioType];
|
|
|
- [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
|
|
|
{
|
|
|
@@ -797,14 +741,6 @@
|
|
|
|
|
|
}
|
|
|
|
|
|
-- (void)didDownloadOneFileFun
|
|
|
-{
|
|
|
- mainBlock(^{
|
|
|
- [self.tableView reloadData];
|
|
|
- //[self.dataCollectionView reloadData];
|
|
|
- });
|
|
|
-}
|
|
|
-
|
|
|
|
|
|
- (void)checkFileTransferTask
|
|
|
{//有个偶现的闪退在BGFMDB
|
|
|
@@ -843,4 +779,25 @@
|
|
|
[self.navigationController pushViewController:vc animated:YES];
|
|
|
}
|
|
|
|
|
|
+#pragma mark 获取文件数据
|
|
|
+- (void)getFileListFun
|
|
|
+{
|
|
|
+ NSMutableDictionary*paraDict = [NSMutableDictionary new];
|
|
|
+ if(_isAudioType){
|
|
|
+ [paraDict setValue:@"audio" forKey:@"type"];
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ [paraDict setValue:@"file" forKey:@"type"];
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ [self showNewIndicatorHaveStrWithCanBack:YES canTouch:NO showText:NSLocalizedString(@"common_loading_tip",nil)];
|
|
|
+
|
|
|
+ KWeakSelf
|
|
|
+ [[netWorkManager shareInstance] cloudPhoneGETCallBackCode:@"getFileList" Parameters:paraDict success:^(id _Nonnull responseObject) {
|
|
|
+ [weakSelf removeNewIndicatorHaveStr];
|
|
|
+ } failure:^(NSError * _Nonnull error) {
|
|
|
+ [weakSelf removeNewIndicatorHaveStr];
|
|
|
+ }];
|
|
|
+}
|
|
|
@end
|