downLoadPreviewViewController.m 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638
  1. //
  2. // downLoadPreviewViewController.m
  3. // 隐私保护
  4. //
  5. // Created by xd h on 2024/1/7.
  6. //
  7. #import "downLoadPreviewViewController.h"
  8. #import "couldPhoneFileListModel.h"
  9. #import "downLoadPreViewCell.h"
  10. #import "downloadFileBottomView.h"
  11. #import "downloadThumbnailManager.h"
  12. #import "downloadManager.h"
  13. #import "uploadFileRecordViewController.h"
  14. #import "UIScrollView+EmptyDataSet.h"
  15. #import "diskListBgView.h"
  16. #import "diskListTableView.h"
  17. @interface downLoadPreviewViewController ()<UITableViewDelegate,UITableViewDataSource,DZNEmptyDataSetSource, DZNEmptyDataSetDelegate>
  18. {
  19. UIButton *tapBtn;
  20. }
  21. @property (nonatomic, strong) UITableView *tableView;
  22. @property (strong, nonatomic) UILabel *MytitleLabel;
  23. @property (strong, nonatomic) UIImageView *selectTip;
  24. @property (nonatomic, strong) UIButton *rightButton;
  25. @property (nonatomic, strong) diskListBgView *diskListBgV;
  26. @property (nonatomic, strong) diskListTableView *diskListTableV;
  27. @property (nonatomic, strong) NSMutableArray*diskListArr;
  28. @property (nonatomic, copy) NSString *defaultDiskPath;
  29. @property (nonatomic, strong) downloadFileBottomView *downloadFileBottomV;
  30. @property(nonatomic,strong) couldPhoneFileListModel *curCouldPhoneFileListMod;
  31. @end
  32. @implementation downLoadPreviewViewController
  33. - (void)viewDidLoad {
  34. [super viewDidLoad];
  35. // Do any additional setup after loading the view.
  36. [self.toolBar setHidden:YES];
  37. [self.navigationBar setHidden:YES];
  38. [self.navBarBGView setHidden:NO];
  39. self.navBarBGView.backgroundColor = [UIColor whiteColor];
  40. [self.view setBackgroundColor:[UIColor whiteColor]];
  41. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(searchFileListDoneFun:) name:searchFileListDoneNotification object:nil];
  42. [self drawAnyView];
  43. }
  44. - (void)drawAnyView{
  45. [self initNavHeadUIFun];
  46. [self.view addSubview:self.tableView];
  47. [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
  48. make.left.mas_equalTo(0);
  49. make.right.mas_equalTo(0);
  50. make.bottom.mas_equalTo(-(60 + safeArea));
  51. make.top.equalTo(self.navBarBGView.mas_bottom).offset(10.f);
  52. }];
  53. _downloadFileBottomV = [[downloadFileBottomView alloc] init];
  54. [self.view insertSubview:_downloadFileBottomV atIndex:0];
  55. [_downloadFileBottomV mas_makeConstraints:^(MASConstraintMaker *make) {
  56. make.left.mas_equalTo(0);
  57. make.right.mas_equalTo(0);
  58. make.bottom.mas_equalTo(0);
  59. make.height.mas_equalTo(60 + safeArea);
  60. }];
  61. [self RefreshBottomViewUIFun];
  62. KWeakSelf
  63. _downloadFileBottomV.didClickDownloadFile = ^{
  64. [weakSelf gotoDownloadloadFileRecordFun];
  65. };
  66. NSMutableArray *arr = [NSMutableArray new];
  67. NSArray *diskList = ksharedAppDelegate.cloudPhoneExtraFileListMod.data;
  68. if(diskList && [diskList isKindOfClass:[NSArray class]]){
  69. for (cloudPhoneExtraFileModel *model in diskList) {
  70. model.isCheckType = NO;
  71. [arr addObject:model];
  72. }
  73. }
  74. if(arr.count >0){
  75. cloudPhoneExtraFileModel *model = arr.firstObject;
  76. model.isCheckType = YES;
  77. _defaultDiskPath = model.extraPath;
  78. }
  79. _diskListArr = arr;
  80. [self setTitleAfterGetdiskFun];
  81. }
  82. - (void)initNavHeadUIFun
  83. {
  84. //title
  85. UILabel *titleLabel = [[UILabel alloc] init];
  86. titleLabel.textAlignment = NSTextAlignmentCenter;
  87. titleLabel.font = [UIFont boldSystemFontOfSize:18.0];
  88. titleLabel.textColor = [UIColor blackColor];
  89. titleLabel.translatesAutoresizingMaskIntoConstraints = NO;
  90. [self.navBarBGView addSubview:titleLabel];
  91. self.MytitleLabel = titleLabel;
  92. //selectTipImageView
  93. UIImageView *selectTip = [[UIImageView alloc] init];
  94. selectTip.image = [UIImage imageNamed:@"upload_image_arrow"];
  95. selectTip.translatesAutoresizingMaskIntoConstraints = NO;
  96. [self.navBarBGView addSubview:selectTip];
  97. self.selectTip = selectTip;
  98. tapBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  99. tapBtn.backgroundColor = [UIColor clearColor];
  100. tapBtn.translatesAutoresizingMaskIntoConstraints = NO;
  101. [tapBtn addTarget:self action:@selector(selectDiskAction:) forControlEvents:UIControlEventTouchUpInside];
  102. [self.navBarBGView addSubview:tapBtn];
  103. [tapBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  104. make.centerX.mas_equalTo(self.navBarBGView.mas_centerX);
  105. make.centerY.mas_equalTo(self.backBtn.mas_centerY);
  106. make.width.mas_equalTo(100);
  107. make.height.mas_equalTo(30);
  108. }];
  109. [self setTitleLabelText:@""];
  110. _rightButton = [[UIButton alloc] init];
  111. [_rightButton setTitle:NSLocalizedString(@"File_upload_Record_select_all",nil) forState:UIControlStateNormal];
  112. [_rightButton setTitle:NSLocalizedString(@"File_upload_cancel_select_all",nil) forState:UIControlStateSelected];
  113. [_rightButton setTitleColor:[UIColor hwColor:@"#01B7EA" alpha:1.0] forState:UIControlStateNormal];
  114. _rightButton.titleLabel.font = [UIFont systemFontOfSize:18.0];
  115. _rightButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentRight;
  116. [_rightButton addTarget:self action:@selector(didClickSelectAllButton:) forControlEvents:UIControlEventTouchUpInside];
  117. [self.navBarBGView addSubview:_rightButton];
  118. //多国语言适配
  119. NSString *languageCode = [NSLocale preferredLanguages][0];
  120. if([languageCode rangeOfString:@"ja-"].location != NSNotFound)
  121. {
  122. _rightButton.titleLabel.font = [UIFont systemFontOfSize:13.0];
  123. }
  124. [_rightButton mas_makeConstraints:^(MASConstraintMaker *make) {
  125. make.width.mas_equalTo(90);
  126. make.height.mas_equalTo(40);
  127. make.right.mas_equalTo(-15);
  128. make.centerY.mas_equalTo(self.titleLabel.mas_centerY);
  129. }];
  130. //_rightButton.backgroundColor = [UIColor redColor];
  131. }
  132. #pragma mark - 懒加载
  133. - (UITableView *)tableView{
  134. if (!_tableView) {
  135. _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, SCREEN_H - TABBARHEIGHT) style:UITableViewStylePlain];
  136. _tableView.delegate = self;
  137. _tableView.dataSource = self;
  138. _tableView.showsVerticalScrollIndicator = NO;
  139. _tableView.showsHorizontalScrollIndicator = NO;
  140. // _tableView.contentInset = UIEdgeInsetsMake(-H_STATE_BAR, 0, 0, 0);
  141. [_tableView setSeparatorStyle:(UITableViewCellSeparatorStyleNone)];
  142. [_tableView setSeparatorColor:[UIColor clearColor]];
  143. [_tableView setBackgroundColor:[UIColor clearColor]];
  144. [_tableView setTableFooterView:[UIView new]];
  145. [_tableView setBounces:YES];
  146. if (@available(iOS 15.0, *)) {
  147. _tableView.sectionHeaderTopPadding = 0;
  148. }
  149. //空数据引入第三方开源处理
  150. _tableView.emptyDataSetSource = self;
  151. _tableView.emptyDataSetDelegate = self;
  152. }
  153. return _tableView;
  154. }
  155. - (diskListBgView*)diskListBgV
  156. {
  157. if(!_diskListBgV){
  158. _diskListBgV = [[diskListBgView alloc] initWithFrame:CGRectMake(0, 0, 0, 0)];
  159. _diskListBgV.hidden = YES;
  160. [self.view addSubview:_diskListBgV];
  161. KWeakSelf
  162. _diskListBgV.didTapWhitePlace = ^{
  163. [weakSelf hideDiskListVieFun];
  164. };
  165. [_diskListBgV mas_makeConstraints:^(MASConstraintMaker *make) {
  166. make.left.mas_equalTo(0);
  167. make.bottom.mas_equalTo(0);
  168. make.right.mas_equalTo(0);
  169. make.top.mas_equalTo(self.navBarBGView.mas_bottom);
  170. }];
  171. [self.view addSubview:self.diskListTableV];
  172. self.diskListTableV.hidden = YES;
  173. [self.diskListTableV mas_makeConstraints:^(MASConstraintMaker *make) {
  174. make.left.mas_equalTo(0);
  175. make.height.mas_equalTo(3*70);
  176. make.right.mas_equalTo(0);
  177. make.top.mas_equalTo(self.navBarBGView.mas_bottom);
  178. }];
  179. self.diskListTableV.diskListArr = _diskListArr;
  180. self.diskListTableV.didClickDiskModel = ^(NSString * _Nonnull checkPath) {
  181. [weakSelf didCheckDiskFunByPath:checkPath];
  182. };
  183. }
  184. return _diskListBgV;
  185. }
  186. - (UITableView *)diskListTableV{
  187. if (!_diskListTableV) {
  188. _diskListTableV = [[diskListTableView alloc] init];
  189. //
  190. }
  191. return _diskListTableV;
  192. }
  193. #pragma mark 选中磁盘
  194. - (void)didCheckDiskFunByPath:(NSString*)pathStr
  195. {
  196. self.defaultDiskPath = pathStr;
  197. //[self searchFileListFun];
  198. [self setTitleAfterGetdiskFun];
  199. [self hideDiskListVieFun];
  200. }
  201. #pragma mark - 列表委托
  202. - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
  203. return 1;
  204. }
  205. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
  206. if(!_curCouldPhoneFileListMod){
  207. return 0;
  208. }
  209. return _curCouldPhoneFileListMod.data.list.count;
  210. }
  211. - (downLoadPreViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
  212. __block NSInteger row = indexPath.row;
  213. static NSString *identifier = @"downLoadPreViewCell";
  214. downLoadPreViewCell * cell = [tableView dequeueReusableCellWithIdentifier:identifier];
  215. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  216. if (!cell){
  217. cell = [[downLoadPreViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier];
  218. [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
  219. [cell setBackgroundColor:[UIColor clearColor]];
  220. [cell setAccessoryType:(UITableViewCellAccessoryNone)];
  221. [cell.bgViewLayer removeFromSuperlayer];
  222. [cell.titleLabel2 setHidden:NO];
  223. [cell.rightImage setHidden:YES];
  224. [cell.lineView setHidden:YES];
  225. [cell.checkButton setHidden:NO];
  226. }
  227. if(row < _curCouldPhoneFileListMod.data.list.count){
  228. couldPhoneFileModel* fileModel = _curCouldPhoneFileListMod.data.list[row];
  229. cell.curFileModel = fileModel;
  230. KWeakSelf
  231. cell.didClickSwitch = ^(BOOL SwitchOn) {
  232. if([weakSelf userCheckFileModel:fileModel withShowTip:YES]){
  233. [weakSelf userCheckFilePreviewByRow:row];
  234. }
  235. };
  236. }
  237. return cell;
  238. }
  239. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
  240. return 70;
  241. }
  242. #pragma mark 空数据
  243. - (UIImage *)imageForEmptyDataSet:(UIScrollView *)scrollView {
  244. NSString *imageName = @"uploadFile_noData";
  245. return [UIImage imageNamed:imageName];
  246. }
  247. - (NSAttributedString *)titleForEmptyDataSet:(UIScrollView *)scrollView {
  248. NSString *text = NSLocalizedString(@"File_download_file_no_data",nil);
  249. NSDictionary *attributes = @{NSFontAttributeName: [UIFont systemFontOfSize:16.0f],
  250. NSForegroundColorAttributeName: HW999999Color};
  251. return [[NSAttributedString alloc] initWithString:text attributes:attributes];
  252. }
  253. //调整图片位置
  254. - (CGFloat)verticalOffsetForEmptyDataSet:(UIScrollView *)scrollView {
  255. return -150;
  256. }
  257. //ios端:
  258. //1、需求说明:解决除MP4 MOV 3GP M4V 总计4种格式外,其他格式下载失败的问题;
  259. //2、交互说明:下载列表勾选文件中含有其他格式,toast提示“IOS系统仅支持MP4、MOV、3GP、M4V 的视频格式,其他格式无法下载”。点击下载按钮,过滤其他格式文件,仅下载MP4、MOV、3GP、M4V 的视频格式文件;
  260. //ios支持图片格式: (SVG 不支持)
  261. //需求说明:解决除JPG PNG GIF TIFF BMP总计5种格式外,其他格式下载失败的问题
  262. //视觉交互:选择文件中含有其他格式,toast提示“IOS系统仅支持JPG 、PNG、GIF、TIFF、BMP的图片格式,其他格式无法下载”。点击下载按钮,过滤其他格式文件,仅下载JPG 、PNG、GIF、TIFF、BMP的图片格式文件;
  263. - (BOOL)userCheckFileModel:(couldPhoneFileModel*)fileModel withShowTip:(BOOL)canShow{
  264. NSString*name = [fileModel.name lowercaseString];
  265. NSArray *nameArr = [name componentsSeparatedByString:@"."];
  266. if(nameArr.count >0 && !_isPhotoType){
  267. BOOL canDownLoadType = NO;
  268. NSString *lastName = nameArr.lastObject;
  269. if([lastName isEqualToString:@"mp4"]
  270. ||[lastName isEqualToString:@"mov"]
  271. ||[lastName isEqualToString:@"3gp"]
  272. ||[lastName isEqualToString:@"m4v"]){
  273. canDownLoadType = YES;
  274. }
  275. if(!canDownLoadType){
  276. if(canShow){
  277. [[iToast makeText:NSLocalizedString(@"download_video_disable_state",nil)] show];
  278. }
  279. return NO;
  280. }
  281. }
  282. if(nameArr.count >0 && _isPhotoType){
  283. BOOL canDownLoadType = NO;
  284. //JPG 、PNG、GIF、TIFF、BMP
  285. NSString *lastName = nameArr.lastObject;
  286. if([lastName isEqualToString:@"jpg"]
  287. ||[lastName isEqualToString:@"png"]
  288. ||[lastName isEqualToString:@"gif"]
  289. ||[lastName isEqualToString:@"tiff"]
  290. ||[lastName isEqualToString:@"bmp"]
  291. ||[lastName isEqualToString:@"heic"]
  292. ||[lastName isEqualToString:@"jpeg"]
  293. ||[lastName isEqualToString:@"heif"]){
  294. canDownLoadType = YES;
  295. }
  296. if(!canDownLoadType){
  297. if(canShow){
  298. [[iToast makeText:NSLocalizedString(@"download_image_disable_state",nil)] show];
  299. }
  300. return NO;
  301. }
  302. }
  303. return YES;
  304. }
  305. - (void)userCheckFilePreviewByRow:(NSInteger)row
  306. {
  307. if(row < _curCouldPhoneFileListMod.data.list.count){
  308. couldPhoneFileModel* fileModel = _curCouldPhoneFileListMod.data.list[row];
  309. fileModel.isSelectType = !fileModel.isSelectType;
  310. [self.tableView reloadData];
  311. [self RefreshBottomViewUIFun];
  312. }
  313. }
  314. - (void)didClickSelectAllButton:(UIButton*)button
  315. {
  316. button.selected = !button.selected;
  317. BOOL isNeedShowTip = NO;
  318. for (couldPhoneFileModel* fileModel in _curCouldPhoneFileListMod.data.list) {
  319. if(!button.selected){
  320. fileModel.isSelectType = button.selected;
  321. }
  322. else{
  323. if([self userCheckFileModel:fileModel withShowTip:NO]){
  324. fileModel.isSelectType = button.selected;
  325. }
  326. else{
  327. isNeedShowTip = YES;
  328. }
  329. }
  330. }
  331. if(isNeedShowTip){
  332. if(_isPhotoType){
  333. [[iToast makeText:NSLocalizedString(@"download_image_disable_state",nil)] show];
  334. }
  335. else{
  336. [[iToast makeText:NSLocalizedString(@"download_video_disable_state",nil)] show];
  337. }
  338. }
  339. [self.tableView reloadData];
  340. [self RefreshBottomViewUIFun];
  341. }
  342. #pragma mark 设置标题
  343. - (void)setTitleLabelText:(NSString*)title
  344. {
  345. NSArray *diskNameArr = [_defaultDiskPath componentsSeparatedByString:@"/"];
  346. if(diskNameArr && diskNameArr.count >= 2){
  347. NSString *name = diskNameArr.lastObject;
  348. if(name.length == 0)
  349. {
  350. name = diskNameArr[diskNameArr.count -2];
  351. }
  352. title = [[NSString alloc] initWithFormat:@"[%@]%@",name,title];
  353. }
  354. self.MytitleLabel.text = title;
  355. CGFloat curWidth = [title boundingRectWithSize:CGSizeMake(SCREEN_W, 30) options:(NSStringDrawingUsesLineFragmentOrigin) attributes:@{NSFontAttributeName:[UIFont boldSystemFontOfSize:18.f]} context:nil].size.width;
  356. curWidth += 20;
  357. //HLog(@"title w:%f",curWidth);
  358. [self.MytitleLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
  359. make.centerX.mas_equalTo(self.navBarBGView.mas_centerX).offset(-10);
  360. make.centerY.mas_equalTo(self.backBtn.mas_centerY);
  361. make.width.mas_equalTo(curWidth);
  362. make.height.mas_equalTo(30);
  363. }];
  364. //self.MytitleLabel.backgroundColor = [UIColor greenColor];
  365. [self.selectTip mas_makeConstraints:^(MASConstraintMaker *make) {
  366. make.left.mas_equalTo(self.MytitleLabel.mas_right).offset(0);
  367. make.centerY.mas_equalTo(self.backBtn.mas_centerY);
  368. make.width.mas_equalTo(15);
  369. make.height.mas_equalTo(15);
  370. }];
  371. [tapBtn mas_remakeConstraints:^(MASConstraintMaker *make) {
  372. make.centerX.mas_equalTo(self.navBarBGView.mas_centerX);
  373. make.centerY.mas_equalTo(self.backBtn.mas_centerY);
  374. make.width.mas_equalTo(curWidth+15);
  375. make.height.mas_equalTo(30);
  376. }];
  377. }
  378. #pragma mark 选择硬盘
  379. - (void)selectDiskAction:(UIButton*)but
  380. {
  381. if(self.diskListBgV.hidden){
  382. [self showDiskListVieFun];
  383. }
  384. else{
  385. [self hideDiskListVieFun];
  386. }
  387. }
  388. - (void)showDiskListVieFun
  389. {
  390. self.diskListBgV.hidden = NO;
  391. self.diskListTableV.hidden = NO;
  392. [UIView animateWithDuration:0.3 animations:^{
  393. CGRect rect = self.diskListTableV.frame;
  394. rect.origin.y = CGRectGetMaxY(self.navBarBGView.frame);
  395. self.diskListTableV.frame = rect;
  396. self.selectTip.transform = CGAffineTransformMakeRotation(M_PI);
  397. }];
  398. }
  399. - (void)hideDiskListVieFun
  400. {
  401. self.diskListBgV.hidden = YES;
  402. [UIView animateWithDuration:0.3 animations:^{
  403. self.diskListTableV.hidden = YES;
  404. self.selectTip.transform = CGAffineTransformIdentity;
  405. }completion:^(BOOL finished) {
  406. CGRect rect = self.diskListTableV.frame;
  407. rect.origin.y = 0;
  408. self.diskListTableV.frame = rect;
  409. }];
  410. }
  411. #pragma mark 刷新底部
  412. - (void)RefreshBottomViewUIFun
  413. {
  414. NSMutableArray *selectArr = [NSMutableArray new];
  415. for (couldPhoneFileModel* fileModel in _curCouldPhoneFileListMod.data.list) {
  416. if(fileModel.isSelectType){
  417. [selectArr addObject:fileModel];
  418. }
  419. }
  420. _downloadFileBottomV.indexPathsForSelectedItems = selectArr;
  421. }
  422. #pragma mark 设置标题
  423. - (void)setTitleAfterGetdiskFun
  424. {
  425. if(_isPhotoType){
  426. //self.titleLabel.text = NSLocalizedString(@"my_set_no_image_upload",nil) ;
  427. [self setTitleLabelText:NSLocalizedString(@"my_set_no_image_upload",nil)];
  428. }
  429. else{
  430. //self.titleLabel.text = NSLocalizedString(@"my_set_no_video_upload",nil) ;
  431. [self setTitleLabelText:NSLocalizedString(@"my_set_no_video_upload",nil)];
  432. }
  433. [self searchFileListFun];
  434. }
  435. - (void)viewWillAppear:(BOOL)animated
  436. {
  437. [super viewWillAppear:animated];
  438. }
  439. - (void)searchFileListFun
  440. {
  441. NSMutableDictionary *dict = [NSMutableDictionary new];
  442. NSNumber *curNum = [NSNumber numberWithBool:_isPhotoType];
  443. [dict setObject:curNum forKey:@"type"];
  444. if(!_defaultDiskPath){
  445. _defaultDiskPath = @"";
  446. }
  447. [dict setObject:_defaultDiskPath forKey:@"path"];
  448. [[NSNotificationCenter defaultCenter] postNotificationName:searchFileListBeginNotification object:dict];/*发送通知*/
  449. }
  450. - (void)searchFileListDoneFun:(NSNotification*)notification
  451. {
  452. NSDictionary *dataDict = [notification object];
  453. if(!dataDict || ![dataDict isKindOfClass:[NSDictionary class]]){
  454. return;
  455. }
  456. _curCouldPhoneFileListMod = [[couldPhoneFileListModel alloc] initWithDictionary:dataDict error:nil];
  457. NSMutableArray *filterArr = [NSMutableArray new];
  458. for (couldPhoneFileModel*model in _curCouldPhoneFileListMod.data.list) {
  459. //if(model.length > 1024)
  460. if(model.length > 1024*50)
  461. {
  462. [filterArr addObject:model];
  463. }
  464. }
  465. _curCouldPhoneFileListMod.data.list = filterArr;
  466. [self.tableView reloadData];
  467. //这个要做判断 不能为空
  468. //[self gotoDownThumbnailManagerFun];
  469. }
  470. #pragma mark 去下载缩略图
  471. - (void)gotoDownThumbnailManagerFun
  472. {
  473. [[downloadThumbnailManager shareInstance] handlToDownloadThumbnailWith:_curCouldPhoneFileListMod.data.list];
  474. }
  475. - (void)gotoDownloadloadFileRecordFun
  476. {
  477. uploadFileRecordViewController *vc = [uploadFileRecordViewController new];
  478. [self.navigationController pushViewController:vc animated:YES];
  479. vc.isDownloadingType = YES;
  480. [vc gotoDownloadFile:_downloadFileBottomV.indexPathsForSelectedItems];
  481. }
  482. - (void)viewDidAppear:(BOOL)animated{
  483. [super viewDidAppear:animated];
  484. [self showDownloadTipFun];
  485. }
  486. - (void)showDownloadTipFun
  487. {
  488. BOOL didReadUploadTipType = [HWDataManager getBoolWithKey:Const_file_downLoad_need_read];
  489. if(didReadUploadTipType){
  490. return;
  491. }
  492. //KWeakSelf
  493. /*弹窗提示恢复出厂*/
  494. ComontAlretViewController *nextVC = [[ComontAlretViewController alloc] initWithTiTle:nil
  495. msg:NSLocalizedString(@"upload_download_need_read_msg",nil)
  496. imageStr:nil
  497. cancelTitle:NSLocalizedString(@"guide_set_pwd_guide_know",nil)
  498. okTitle:nil
  499. isOkBtnHighlight:NO
  500. didClickOk:^{
  501. } didClickCancel:^{
  502. [HWDataManager setBoolWithKey:Const_file_downLoad_need_read value:YES];
  503. }];
  504. nextVC.modalPresentationStyle = UIModalPresentationCustom;
  505. [self presentViewController:nextVC animated:YES completion:^{
  506. nextVC.view.superview.backgroundColor = [UIColor clearColor];
  507. }];
  508. }
  509. @end