previewAudioOrDocumentViewController.m 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185
  1. //
  2. // previewAudioOrDocumentViewController.m
  3. // 双子星云手机
  4. //
  5. // Created by xd h on 2024/5/14.
  6. //
  7. #import "previewAudioOrDocumentViewController.h"
  8. #import "couldPhoneFileListModel.h"
  9. #import "downloadManager.h"
  10. #import "uploadFileRecordViewController.h"
  11. #import "UIScrollView+EmptyDataSet.h"
  12. #import "diskListBgView.h"
  13. #import "diskListTableView.h"
  14. #import "downLoadPreViewCell.h"
  15. #import "editTypeHeadView.h"
  16. #import "editTypeBottomView.h"
  17. #import "editShareView.h"
  18. #import "previewToUploadFileView.h"
  19. #import "netWorkManager.h"
  20. #import "NASFileAudioModel.h"
  21. #import "queryShareModel.h"
  22. #import "audioPlayerViewController.h"
  23. #import "videoPlayByAVPlayerViewController.h"
  24. #import "MJRefresh.h"
  25. #import "searchBarThridTypeView.h"
  26. #import "NasSearchViewController.h"
  27. #import "DocumentPickerManager.h"
  28. @interface previewAudioOrDocumentViewController ()<UITableViewDelegate,UITableViewDataSource,DZNEmptyDataSetSource, DZNEmptyDataSetDelegate>
  29. {
  30. UIButton *tapBtn;
  31. UIButton* rightTransferListButton;//传输列表
  32. UIView* rightRedView;
  33. BOOL hadUploadTaskType;
  34. BOOL hadDownloadTaskType;
  35. BOOL canShareType;
  36. }
  37. @property (nonatomic, strong) UITableView *tableView;
  38. @property (strong, nonatomic) UILabel *MytitleLabel;
  39. @property (strong, nonatomic) UIImageView *selectTip;
  40. @property (nonatomic, strong) diskListBgView *diskListBgV;
  41. @property (nonatomic, strong) diskListTableView *diskListTableV;
  42. @property (nonatomic, strong) NSMutableArray*diskListArr;
  43. @property (nonatomic, copy) NSString *defaultDiskPath;
  44. @property(nonatomic,assign) BOOL isEditType;
  45. @property(nonatomic,strong) editTypeHeadView*curEditTypeHeadView;
  46. @property(nonatomic,strong) editTypeBottomView*curEditTypeBottomView;
  47. @property(nonatomic,strong) searchBarThridTypeView* searchBarThridTypeV;//
  48. @property(nonatomic,strong) UIButton*uploadFileButton;
  49. @property (nonatomic, strong) NSMutableArray*didSelectListArr;//选中的数据
  50. @property (nonatomic, strong)NASFileAudioModel * curNASFileAudioMod;
  51. @end
  52. @implementation previewAudioOrDocumentViewController
  53. - (void)viewDidLoad {
  54. [super viewDidLoad];
  55. // Do any additional setup after loading the view.
  56. [self.toolBar setHidden:YES];
  57. [self.navigationBar setHidden:YES];
  58. [self.navBarBGView setHidden:NO];
  59. self.navBarBGView.backgroundColor = [UIColor whiteColor];
  60. [self.view setBackgroundColor:[UIColor whiteColor]];
  61. [self drawAnyView];
  62. _didSelectListArr = [NSMutableArray new];
  63. //数据埋点
  64. [[netWorkManager shareInstance] DataEmbeddingPointBy:2 withEventValue:@"Music"];
  65. }
  66. - (void)drawAnyView{
  67. [self initNavHeadUIFun];
  68. _curEditTypeHeadView = [[editTypeHeadView alloc] init];
  69. _curEditTypeHeadView.hidden = YES;
  70. [self.navBarBGView addSubview:_curEditTypeHeadView];
  71. [_curEditTypeHeadView mas_makeConstraints:^(MASConstraintMaker *make) {
  72. make.left.mas_equalTo(0);
  73. make.right.mas_equalTo(0);
  74. make.bottom.mas_equalTo(0);
  75. make.height.mas_equalTo(NAVIHEIGHT - AdaptNaviHeight);
  76. }];
  77. #pragma mark 编辑状态的 取消 和全选按钮 响应事件
  78. KWeakSelf
  79. _curEditTypeHeadView.didClickButtonFun = ^(NSInteger tag) {
  80. if(tag==1){
  81. [weakSelf userCancelEditTypeFun];
  82. }
  83. };
  84. _curEditTypeHeadView.didClickSelectAllFun = ^(UIButton * _Nonnull but) {
  85. [weakSelf didClickSelectAllButton:but];
  86. };
  87. _curEditTypeBottomView = [[editTypeBottomView alloc] init];
  88. _curEditTypeBottomView.hidden = YES;
  89. [self.view addSubview:_curEditTypeBottomView];
  90. [_curEditTypeBottomView mas_makeConstraints:^(MASConstraintMaker *make) {
  91. make.left.mas_equalTo(0);
  92. make.right.mas_equalTo(0);
  93. make.bottom.mas_equalTo(0);
  94. make.height.mas_equalTo(60 + AdaptTabHeight);
  95. }];
  96. #pragma mark 编辑状态的 下载 分享 删除 响应事件
  97. _curEditTypeBottomView.didClickButtonFun = ^(NSInteger tag) {
  98. if(tag==1){
  99. [weakSelf gotoDownLoadFileFun];
  100. }
  101. else if(tag==2){
  102. [weakSelf gotoShareViewFun];
  103. }
  104. else if(tag==3){
  105. [weakSelf showDeleteAlearViewFun];
  106. }
  107. };
  108. _searchBarThridTypeV = [[searchBarThridTypeView alloc] init];
  109. [self.view addSubview:_searchBarThridTypeV];
  110. [_searchBarThridTypeV mas_makeConstraints:^(MASConstraintMaker *make) {
  111. make.top.equalTo(self.navBarBGView.mas_bottom).offset(10.f);
  112. make.height.mas_equalTo(32.0);
  113. make.left.mas_equalTo(20.0);
  114. //make.right.mas_equalTo(-48.0);
  115. make.right.mas_equalTo(-20.0);
  116. }];
  117. #pragma mark 点击搜索
  118. _searchBarThridTypeV.didClickBgFun = ^{
  119. [weakSelf gotoSearchVCFun];
  120. };
  121. [self.view addSubview:self.tableView];
  122. [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
  123. make.left.mas_equalTo(0);
  124. make.right.mas_equalTo(0);
  125. //make.bottom.mas_equalTo(-(safeArea));
  126. make.bottom.mas_equalTo(0);
  127. //make.top.equalTo(self.navBarBGView.mas_bottom).offset(10.f);
  128. make.top.equalTo(self.searchBarThridTypeV.mas_bottom).offset(10.f);
  129. }];
  130. //大+号
  131. _uploadFileButton = [[UIButton alloc] init];
  132. [_uploadFileButton setBackgroundImage:[UIImage imageNamed:@"add_file_icon"] forState:UIControlStateNormal];
  133. [_uploadFileButton addTarget:self action:@selector(userDidClickUploadViewFun) forControlEvents:UIControlEventTouchUpInside];
  134. [self.view addSubview:_uploadFileButton];
  135. [_uploadFileButton mas_makeConstraints:^(MASConstraintMaker *make) {
  136. make.right.mas_equalTo(-15);
  137. make.width.mas_equalTo(52);
  138. make.height.mas_equalTo(52);
  139. make.bottom.mas_equalTo(-30 - AdaptTabHeight);
  140. }];
  141. NSMutableArray *arr = [NSMutableArray new];
  142. NSArray *diskList = ksharedAppDelegate.cloudPhoneExtraFileListMod.data;
  143. if(diskList && [diskList isKindOfClass:[NSArray class]]){
  144. for (cloudPhoneExtraFileModel *model in diskList) {
  145. model.isCheckType = NO;
  146. [arr addObject:model];
  147. }
  148. }
  149. if(arr.count >0){
  150. //上一次选中的磁盘
  151. NSString*preChekDiskStr = [HWDataManager getStringWithKey:Const_audio_pre_disk_check];
  152. //1.没有选择过 默认选择第一次(云机)
  153. if(!preChekDiskStr || preChekDiskStr.length == 0){
  154. cloudPhoneExtraFileModel *model = arr.firstObject;
  155. model.isCheckType = YES;
  156. _defaultDiskPath = model.extraPath;
  157. }
  158. else{//2.选择过 查询磁盘是否还存在
  159. BOOL didCheckDisk = NO;
  160. for (cloudPhoneExtraFileModel *model in arr) {
  161. HLog(@"磁盘路径比较 pre:%@---%@",preChekDiskStr,model.extraPath)
  162. if([model.extraPath isEqualToString:preChekDiskStr]){
  163. model.isCheckType = YES;
  164. _defaultDiskPath = model.extraPath;
  165. didCheckDisk = YES;
  166. break;
  167. }
  168. }
  169. //3.选择过 查询磁盘不存在
  170. if(!didCheckDisk){
  171. cloudPhoneExtraFileModel *model = arr.firstObject;
  172. model.isCheckType = YES;
  173. _defaultDiskPath = model.extraPath;
  174. }
  175. }
  176. }
  177. _diskListArr = arr;
  178. [self setTitleAfterGetdiskFun];
  179. }
  180. - (void)initNavHeadUIFun
  181. {
  182. //title
  183. UILabel *titleLabel = [[UILabel alloc] init];
  184. titleLabel.textAlignment = NSTextAlignmentCenter;
  185. titleLabel.font = [UIFont boldSystemFontOfSize:16.0];
  186. titleLabel.textColor = [UIColor blackColor];
  187. titleLabel.translatesAutoresizingMaskIntoConstraints = NO;
  188. [self.navBarBGView addSubview:titleLabel];
  189. self.MytitleLabel = titleLabel;
  190. //selectTipImageView
  191. UIImageView *selectTip = [[UIImageView alloc] init];
  192. selectTip.image = [UIImage imageNamed:@"upload_image_arrow"];
  193. selectTip.translatesAutoresizingMaskIntoConstraints = NO;
  194. [self.navBarBGView addSubview:selectTip];
  195. self.selectTip = selectTip;
  196. tapBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  197. tapBtn.backgroundColor = [UIColor clearColor];
  198. tapBtn.translatesAutoresizingMaskIntoConstraints = NO;
  199. [tapBtn addTarget:self action:@selector(selectDiskAction:) forControlEvents:UIControlEventTouchUpInside];
  200. [self.navBarBGView addSubview:tapBtn];
  201. [tapBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  202. make.centerX.mas_equalTo(self.navBarBGView.mas_centerX);
  203. make.centerY.mas_equalTo(self.backBtn.mas_centerY);
  204. make.width.mas_equalTo(100);
  205. make.height.mas_equalTo(30);
  206. }];
  207. [self setTitleLabelText:@""];
  208. rightTransferListButton = [[UIButton alloc] init];
  209. [rightTransferListButton setImage:[UIImage imageNamed:@"icon_file_transfer"] forState:UIControlStateNormal];
  210. [rightTransferListButton addTarget:self action:@selector(didiClikRightButGotoTransferListFun:) forControlEvents:UIControlEventTouchUpInside];
  211. [self.navBarBGView addSubview:rightTransferListButton];
  212. [rightTransferListButton mas_makeConstraints:^(MASConstraintMaker *make) {
  213. make.width.mas_equalTo(40);
  214. make.height.mas_equalTo(40);
  215. make.right.mas_equalTo(-15);
  216. make.centerY.mas_equalTo(self.titleLabel.mas_centerY);
  217. }];
  218. rightRedView = [[UIView alloc] init];
  219. rightRedView.backgroundColor = [UIColor hwColor:@"#DD4E4E" alpha:1.0];
  220. [rightTransferListButton addSubview:rightRedView];
  221. rightRedView.layer.cornerRadius = 7;
  222. rightRedView.hidden = YES;
  223. [rightRedView mas_makeConstraints:^(MASConstraintMaker *make) {
  224. make.width.mas_equalTo(14);
  225. make.height.mas_equalTo(14);
  226. make.right.mas_equalTo(0);
  227. make.top.mas_equalTo(6);
  228. }];
  229. }
  230. #pragma mark - 懒加载
  231. - (UITableView *)tableView{
  232. if (!_tableView) {
  233. _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, SCREEN_H - TABBARHEIGHT) style:UITableViewStylePlain];
  234. _tableView.delegate = self;
  235. _tableView.dataSource = self;
  236. _tableView.showsVerticalScrollIndicator = NO;
  237. _tableView.showsHorizontalScrollIndicator = NO;
  238. // _tableView.contentInset = UIEdgeInsetsMake(-H_STATE_BAR, 0, 0, 0);
  239. [_tableView setSeparatorStyle:(UITableViewCellSeparatorStyleNone)];
  240. [_tableView setSeparatorColor:[UIColor clearColor]];
  241. [_tableView setBackgroundColor:[UIColor clearColor]];
  242. [_tableView setTableFooterView:[UIView new]];
  243. [_tableView setBounces:YES];
  244. if (@available(iOS 15.0, *)) {
  245. _tableView.sectionHeaderTopPadding = 0;
  246. }
  247. //空数据引入第三方开源处理
  248. _tableView.emptyDataSetSource = self;
  249. _tableView.emptyDataSetDelegate = self;
  250. // 下拉追加
  251. // MJRefreshAutoNormalFooter *footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
  252. // [self getMoreNetWorkData];
  253. // }];
  254. //
  255. // NSString *text = NSLocalizedString(@"NAS_bottom_tip",nil);
  256. // [footer setTitle:text forState:MJRefreshStateNoMoreData];
  257. // _tableView.mj_footer = footer;
  258. }
  259. return _tableView;
  260. }
  261. - (diskListBgView*)diskListBgV
  262. {
  263. if(!_diskListBgV){
  264. _diskListBgV = [[diskListBgView alloc] initWithFrame:CGRectMake(0, 0, 0, 0)];
  265. _diskListBgV.hidden = YES;
  266. [self.view addSubview:_diskListBgV];
  267. KWeakSelf
  268. _diskListBgV.didTapWhitePlace = ^{
  269. [weakSelf hideDiskListVieFun];
  270. };
  271. [_diskListBgV mas_makeConstraints:^(MASConstraintMaker *make) {
  272. make.left.mas_equalTo(0);
  273. make.bottom.mas_equalTo(0);
  274. make.right.mas_equalTo(0);
  275. make.top.mas_equalTo(self.navBarBGView.mas_bottom);
  276. }];
  277. [self.view addSubview:self.diskListTableV];
  278. self.diskListTableV.hidden = YES;
  279. [self.diskListTableV mas_makeConstraints:^(MASConstraintMaker *make) {
  280. make.left.mas_equalTo(0);
  281. make.height.mas_equalTo(3*70);
  282. make.right.mas_equalTo(0);
  283. make.top.mas_equalTo(self.navBarBGView.mas_bottom);
  284. }];
  285. self.diskListTableV.diskListArr = _diskListArr;
  286. self.diskListTableV.didClickDiskModel = ^(NSString * _Nonnull checkPath) {
  287. [weakSelf didCheckDiskFunByPath:checkPath];
  288. };
  289. }
  290. return _diskListBgV;
  291. }
  292. - (UITableView *)diskListTableV{
  293. if (!_diskListTableV) {
  294. _diskListTableV = [[diskListTableView alloc] init];
  295. //
  296. }
  297. return _diskListTableV;
  298. }
  299. #pragma mark 选中磁盘
  300. - (void)didCheckDiskFunByPath:(NSString*)pathStr
  301. {
  302. if(self.defaultDiskPath
  303. && self.defaultDiskPath.length>0
  304. && ![self.defaultDiskPath isEqualToString:pathStr]){
  305. //切换硬盘了 取消全选
  306. [_didSelectListArr removeAllObjects];
  307. }
  308. //保存选中的磁盘
  309. if(pathStr){
  310. [HWDataManager setStringWithKey:Const_audio_pre_disk_check value:pathStr];
  311. }
  312. self.defaultDiskPath = pathStr;
  313. _curNASFileAudioMod = nil;
  314. [self getFileListFun:NO];
  315. [self setTitleAfterGetdiskFun];
  316. [self hideDiskListVieFun];
  317. }
  318. #pragma mark - 列表委托
  319. - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
  320. return 1;
  321. }
  322. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
  323. if(!_curNASFileAudioMod){
  324. return 0;
  325. }
  326. return _curNASFileAudioMod.data.list.count;
  327. }
  328. - (downLoadPreViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
  329. __block NSInteger row = indexPath.row;
  330. static NSString *identifier = @"downLoadPreViewCell";
  331. downLoadPreViewCell * cell = [tableView dequeueReusableCellWithIdentifier:identifier];
  332. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  333. if (!cell){
  334. cell = [[downLoadPreViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier];
  335. [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
  336. [cell setBackgroundColor:[UIColor clearColor]];
  337. [cell setAccessoryType:(UITableViewCellAccessoryNone)];
  338. [cell.bgViewLayer removeFromSuperlayer];
  339. [cell.titleLabel2 setHidden:NO];
  340. [cell.rightImage setHidden:YES];
  341. [cell.lineView setHidden:YES];
  342. [cell.checkButton setHidden:NO];
  343. }
  344. if(row < _curNASFileAudioMod.data.list.count){
  345. NASFileAudioDataModel* dataModel = _curNASFileAudioMod.data.list[row];
  346. cell.curNASFileAudioDataModel = dataModel;
  347. KWeakSelf
  348. cell.didClickSwitch = ^(BOOL SwitchOn) {
  349. //if([weakSelf userCheckFileModel:dataModel withShowTip:YES]){
  350. [weakSelf userCheckFilePreviewByRow:row];
  351. //}
  352. };
  353. }
  354. return cell;
  355. }
  356. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
  357. return 70;
  358. }
  359. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
  360. {
  361. NSInteger row = indexPath.row;
  362. if(row < _curNASFileAudioMod.data.list.count){
  363. // NASFileAudioDataModel*dataModel = _curNASFileAudioMod.data.list[row];
  364. // videoPlayByAVPlayerViewController *vc = [videoPlayByAVPlayerViewController new];
  365. // NASFilePicDataArrModel *VideoDataMode = [NASFilePicDataArrModel new];
  366. // VideoDataMode.size = dataModel.size;
  367. // VideoDataMode.path = dataModel.path;
  368. // VideoDataMode.name = dataModel.name;
  369. // VideoDataMode.time = dataModel.time;
  370. // vc.VideoDataMode = VideoDataMode;
  371. // [self.navigationController pushViewController:vc animated:YES];
  372. NASFileAudioDataModel*dataModel = _curNASFileAudioMod.data.list[row];
  373. audioPlayerViewController * vc = [audioPlayerViewController new];
  374. vc.isfirstEnterType = YES;
  375. vc.outSideDataModel = dataModel;
  376. [self.navigationController pushViewController:vc animated:YES];
  377. KWeakSelf
  378. vc.didNeedDeleteFile = ^(NSString * _Nonnull filePath) {
  379. [weakSelf deleteNetDataByFilePath:filePath];
  380. };
  381. }
  382. }
  383. #pragma mark 空数据
  384. - (UIImage *)imageForEmptyDataSet:(UIScrollView *)scrollView {
  385. NSString *imageName = @"common_no_data_pic";
  386. return [UIImage imageNamed:imageName];
  387. }
  388. - (NSAttributedString *)titleForEmptyDataSet:(UIScrollView *)scrollView {
  389. NSString *text = NSLocalizedString(@"common_no_data_tip",nil);
  390. NSDictionary *attributes = @{NSFontAttributeName: [UIFont systemFontOfSize:16.0f],
  391. NSForegroundColorAttributeName: HW999999Color};
  392. return [[NSAttributedString alloc] initWithString:text attributes:attributes];
  393. }
  394. //调整图片位置
  395. - (CGFloat)verticalOffsetForEmptyDataSet:(UIScrollView *)scrollView {
  396. return -150;
  397. }
  398. //ios端:
  399. //1、需求说明:解决除MP4 MOV 3GP M4V 总计4种格式外,其他格式下载失败的问题;
  400. //2、交互说明:下载列表勾选文件中含有其他格式,toast提示“IOS系统仅支持MP4、MOV、3GP、M4V 的视频格式,其他格式无法下载”。点击下载按钮,过滤其他格式文件,仅下载MP4、MOV、3GP、M4V 的视频格式文件;
  401. //ios支持图片格式: (SVG 不支持)
  402. //需求说明:解决除JPG PNG GIF TIFF BMP总计5种格式外,其他格式下载失败的问题
  403. //视觉交互:选择文件中含有其他格式,toast提示“IOS系统仅支持JPG 、PNG、GIF、TIFF、BMP的图片格式,其他格式无法下载”。点击下载按钮,过滤其他格式文件,仅下载JPG 、PNG、GIF、TIFF、BMP的图片格式文件;
  404. - (BOOL)userCheckFileModel:(couldPhoneFileModel*)fileModel withShowTip:(BOOL)canShow{
  405. NSString*name = [fileModel.name lowercaseString];
  406. NSArray *nameArr = [name componentsSeparatedByString:@"."];
  407. if(nameArr.count >0 && !_isAudioType){
  408. BOOL canDownLoadType = NO;
  409. NSString *lastName = nameArr.lastObject;
  410. if([lastName isEqualToString:@"mp4"]
  411. ||[lastName isEqualToString:@"mov"]
  412. ||[lastName isEqualToString:@"3gp"]
  413. ||[lastName isEqualToString:@"m4v"]){
  414. canDownLoadType = YES;
  415. }
  416. if(!canDownLoadType){
  417. if(canShow){
  418. [[iToast makeText:NSLocalizedString(@"download_video_disable_state",nil)] show];
  419. }
  420. return NO;
  421. }
  422. }
  423. if(nameArr.count >0 && _isAudioType){
  424. BOOL canDownLoadType = NO;
  425. //JPG 、PNG、GIF、TIFF、BMP
  426. NSString *lastName = nameArr.lastObject;
  427. if([lastName isEqualToString:@"jpg"]
  428. ||[lastName isEqualToString:@"png"]
  429. ||[lastName isEqualToString:@"gif"]
  430. ||[lastName isEqualToString:@"tiff"]
  431. ||[lastName isEqualToString:@"bmp"]
  432. ||[lastName isEqualToString:@"heic"]
  433. ||[lastName isEqualToString:@"jpeg"]
  434. ||[lastName isEqualToString:@"heif"]){
  435. canDownLoadType = YES;
  436. }
  437. if(!canDownLoadType){
  438. if(canShow){
  439. [[iToast makeText:NSLocalizedString(@"download_image_disable_state",nil)] show];
  440. }
  441. return NO;
  442. }
  443. }
  444. return YES;
  445. }
  446. #pragma mark 用户长按图片进入编辑
  447. - (void)setViewEditTypeFun
  448. {
  449. _isEditType = YES;
  450. //[self.tableView reloadData];
  451. _curEditTypeHeadView.hidden = NO;
  452. _curEditTypeBottomView.hidden = NO;
  453. _uploadFileButton.hidden = YES;
  454. self.searchBarThridTypeV.hidden = YES;
  455. [self.tableView mas_remakeConstraints:^(MASConstraintMaker *make) {
  456. make.left.mas_equalTo(0);
  457. make.right.mas_equalTo(0);
  458. make.bottom.mas_equalTo(_curEditTypeBottomView.mas_top);
  459. make.top.equalTo(self.navBarBGView.mas_bottom).offset(10.f);
  460. }];
  461. }
  462. #pragma mark 用户取消编辑编辑
  463. - (void)userCancelEditTypeFun
  464. {
  465. //数据还原
  466. for (NASFileAudioDataModel*model in _didSelectListArr) {
  467. model.isSelectType = NO;
  468. }
  469. [_didSelectListArr removeAllObjects];
  470. _isEditType = NO;
  471. [self.tableView reloadData];
  472. _curEditTypeHeadView.hidden = YES;
  473. _curEditTypeBottomView.hidden = YES;
  474. _uploadFileButton.hidden = NO;
  475. self.searchBarThridTypeV.hidden = NO;
  476. [self.tableView mas_remakeConstraints:^(MASConstraintMaker *make) {
  477. make.left.mas_equalTo(0);
  478. make.right.mas_equalTo(0);
  479. make.bottom.mas_equalTo(0);
  480. //make.top.equalTo(self.navBarBGView.mas_bottom).offset(10.f);
  481. make.top.equalTo(self.searchBarThridTypeV.mas_bottom).offset(10.f);
  482. }];
  483. }
  484. - (void)userCheckFilePreviewByRow:(NSInteger)row
  485. {
  486. if(row < _curNASFileAudioMod.data.list.count){
  487. NASFileAudioDataModel* dataModel = _curNASFileAudioMod.data.list[row];
  488. if(dataModel.isSelectType){
  489. [_didSelectListArr removeObject:dataModel];
  490. }
  491. else{
  492. [_didSelectListArr addObject:dataModel];
  493. }
  494. dataModel.isSelectType = !dataModel.isSelectType;
  495. [self setEditTypeTitleFun];
  496. }
  497. }
  498. - (void)didClickSelectAllButton:(UIButton*)button
  499. {
  500. //button.selected = !button.selected;
  501. [_didSelectListArr removeAllObjects];
  502. for (NASFileAudioDataModel* dataModel in _curNASFileAudioMod.data.list) {
  503. if(!button.selected){
  504. dataModel.isSelectType = button.selected;
  505. }
  506. else{
  507. [_didSelectListArr addObject:dataModel];
  508. dataModel.isSelectType = button.selected;
  509. }
  510. }
  511. [self.tableView reloadData];
  512. //[self.dataCollectionView reloadData];
  513. [self setEditTypeTitleFun];
  514. }
  515. #pragma mark 设置选中标题
  516. - (void)setEditTypeTitleFun
  517. {
  518. [_curEditTypeHeadView setTitleLabetextByNumbers:_didSelectListArr.count];
  519. if(_didSelectListArr.count > 0){
  520. [self setViewEditTypeFun];
  521. }
  522. else{
  523. [self userCancelEditTypeFun];
  524. }
  525. }
  526. #pragma mark 用户点击分享
  527. - (void)gotoShareViewFun
  528. {
  529. if (_didSelectListArr.count > 50) {
  530. [[iToast makeText:NSLocalizedString(@"share_max_count_tip1",nil)] show];
  531. return;
  532. }
  533. editShareView *editShareV = [[editShareView alloc] init];
  534. editShareV.didSelectListArr = _didSelectListArr;
  535. editShareV.shareFileType = @"4";
  536. [self.view addSubview:editShareV];
  537. [editShareV mas_makeConstraints:^(MASConstraintMaker *make) {
  538. make.left.mas_equalTo(0);
  539. make.right.mas_equalTo(0);
  540. make.bottom.mas_equalTo(0);
  541. make.top.mas_equalTo(0);
  542. }];
  543. }
  544. #pragma mark 用户点击上传文件
  545. - (void)userDidClickUploadViewFun
  546. {
  547. previewToUploadFileView *previewToUploadFileV = [[previewToUploadFileView alloc] init];
  548. [self.view addSubview:previewToUploadFileV];
  549. [previewToUploadFileV mas_makeConstraints:^(MASConstraintMaker *make) {
  550. make.left.mas_equalTo(0);
  551. make.right.mas_equalTo(0);
  552. make.bottom.mas_equalTo(0);
  553. make.top.mas_equalTo(0);
  554. }];
  555. KWeakSelf
  556. previewToUploadFileV.didClickButtonFun = ^(NSInteger tag) {
  557. [weakSelf gotoUploadFileFunWith:tag];
  558. };
  559. }
  560. #pragma mark 设置标题
  561. - (void)setTitleLabelText:(NSString*)title
  562. {
  563. NSArray *diskNameArr = [_defaultDiskPath componentsSeparatedByString:@"/"];
  564. if(diskNameArr && diskNameArr.count >= 2){
  565. NSString *name = diskNameArr.lastObject;
  566. if(name.length == 0)
  567. {
  568. name = diskNameArr[diskNameArr.count -2];
  569. }
  570. //name = [name stringByReplacingOccurrencesOfString:@"sdcard" withString:NSLocalizedString(@"disk_phone_default_tip",nil)];
  571. name = [iTools changePathToShowPathBy:name];
  572. title = [[NSString alloc] initWithFormat:@"[%@]%@",name,title];
  573. }
  574. self.MytitleLabel.text = title;
  575. CGFloat curWidth = [title boundingRectWithSize:CGSizeMake(SCREEN_W, 30) options:(NSStringDrawingUsesLineFragmentOrigin) attributes:@{NSFontAttributeName:[UIFont boldSystemFontOfSize:16.f]} context:nil].size.width;
  576. curWidth += 20;
  577. //HLog(@"title w:%f",curWidth);
  578. [self.MytitleLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
  579. make.centerX.mas_equalTo(self.navBarBGView.mas_centerX).offset(-10);
  580. make.centerY.mas_equalTo(self.backBtn.mas_centerY);
  581. make.width.mas_equalTo(curWidth);
  582. make.height.mas_equalTo(30);
  583. }];
  584. //self.MytitleLabel.backgroundColor = [UIColor greenColor];
  585. [self.selectTip mas_makeConstraints:^(MASConstraintMaker *make) {
  586. make.left.mas_equalTo(self.MytitleLabel.mas_right).offset(0);
  587. make.centerY.mas_equalTo(self.backBtn.mas_centerY);
  588. make.width.mas_equalTo(15);
  589. make.height.mas_equalTo(15);
  590. }];
  591. [tapBtn mas_remakeConstraints:^(MASConstraintMaker *make) {
  592. make.centerX.mas_equalTo(self.navBarBGView.mas_centerX);
  593. make.centerY.mas_equalTo(self.backBtn.mas_centerY);
  594. make.width.mas_equalTo(curWidth+15);
  595. make.height.mas_equalTo(30);
  596. }];
  597. }
  598. #pragma mark 选择硬盘
  599. - (void)selectDiskAction:(UIButton*)but
  600. {
  601. if(self.diskListBgV.hidden){
  602. [self showDiskListVieFun];
  603. }
  604. else{
  605. [self hideDiskListVieFun];
  606. }
  607. }
  608. - (void)showDiskListVieFun
  609. {
  610. self.diskListBgV.hidden = NO;
  611. self.diskListTableV.hidden = NO;
  612. [UIView animateWithDuration:0.3 animations:^{
  613. CGRect rect = self.diskListTableV.frame;
  614. rect.origin.y = CGRectGetMaxY(self.navBarBGView.frame);
  615. self.diskListTableV.frame = rect;
  616. self.selectTip.transform = CGAffineTransformMakeRotation(M_PI);
  617. }];
  618. }
  619. - (void)hideDiskListVieFun
  620. {
  621. self.diskListBgV.hidden = YES;
  622. [UIView animateWithDuration:0.3 animations:^{
  623. self.diskListTableV.hidden = YES;
  624. self.selectTip.transform = CGAffineTransformIdentity;
  625. }completion:^(BOOL finished) {
  626. CGRect rect = self.diskListTableV.frame;
  627. rect.origin.y = 0;
  628. self.diskListTableV.frame = rect;
  629. }];
  630. }
  631. #pragma mark 设置标题
  632. - (void)setTitleAfterGetdiskFun
  633. {
  634. if(_isAudioType){
  635. [self setTitleLabelText:NSLocalizedString(@"my_set_no_music",nil)];
  636. }
  637. else{
  638. [self setTitleLabelText:NSLocalizedString(@"my_set_no_file",nil)];
  639. }
  640. }
  641. - (void)viewWillAppear:(BOOL)animated
  642. {
  643. [super viewWillAppear:animated];
  644. }
  645. - (void)viewDidAppear:(BOOL)animated{
  646. [super viewDidAppear:animated];
  647. [self showDownloadTipFun];
  648. [self checkFileTransferTask];
  649. if(!_curNASFileAudioMod){
  650. [self getFileListFun:NO];
  651. [self queryShareSwitchFunFun];
  652. }
  653. }
  654. - (void)viewWillDisappear:(BOOL)animated{
  655. [super viewWillDisappear:animated];
  656. //[self removeNewIndicator];
  657. [self removeNewIndicatorHaveStr];
  658. }
  659. - (void)gotoDownloadloadFileRecordFun
  660. {
  661. uploadFileRecordViewController *vc = [uploadFileRecordViewController new];
  662. [self.navigationController pushViewController:vc animated:YES];
  663. vc.isDownloadingType = YES;
  664. //[vc gotoDownloadFile:_downloadFileBottomV.indexPathsForSelectedItems];
  665. }
  666. - (void)showDownloadTipFun
  667. {
  668. BOOL didReadUploadTipType = [HWDataManager getBoolWithKey:Const_file_downLoad_need_read];
  669. if(didReadUploadTipType){
  670. return;
  671. }
  672. //KWeakSelf
  673. /*弹窗提示恢复出厂*/
  674. ComontAlretViewController *nextVC = [[ComontAlretViewController alloc] initWithTiTle:nil
  675. msg:NSLocalizedString(@"upload_download_need_read_msg",nil)
  676. imageStr:nil
  677. cancelTitle:NSLocalizedString(@"guide_set_pwd_guide_know",nil)
  678. okTitle:nil
  679. isOkBtnHighlight:NO
  680. didClickOk:^{
  681. } didClickCancel:^{
  682. [HWDataManager setBoolWithKey:Const_file_downLoad_need_read value:YES];
  683. }];
  684. nextVC.modalPresentationStyle = UIModalPresentationCustom;
  685. [self presentViewController:nextVC animated:YES completion:^{
  686. nextVC.view.superview.backgroundColor = [UIColor clearColor];
  687. }];
  688. }
  689. - (void)checkFileTransferTask
  690. {//有个偶现的闪退在BGFMDB
  691. [[nasUploadFileManager shareInstance] checkHadUploadTaskWithComplete:^(BOOL isSuccess) {
  692. self->hadUploadTaskType = isSuccess;
  693. [self setRightButtonRedTypeFun];
  694. }];
  695. KWeakSelf
  696. dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
  697. [[nasDownloadFileManager shareInstance] checkHadDownloadTaskWithComplete:^(BOOL isSuccess) {
  698. self->hadDownloadTaskType = isSuccess;
  699. [weakSelf setRightButtonRedTypeFun];
  700. }];
  701. });
  702. }
  703. - (void)setRightButtonRedTypeFun
  704. {
  705. mainBlock(^{
  706. if(self->hadUploadTaskType || self->hadDownloadTaskType){
  707. self->rightRedView.hidden = NO;
  708. }
  709. else{
  710. self->rightRedView.hidden = YES;
  711. }
  712. });
  713. }
  714. - (void)didiClikRightButGotoTransferListFun:(UIButton*)but
  715. {
  716. uploadFileRecordViewController *vc = [uploadFileRecordViewController new];
  717. [self.navigationController pushViewController:vc animated:YES];
  718. }
  719. #pragma mark 获取文件数据
  720. - (void)getFileListFun:(BOOL)isMoreDataType
  721. {
  722. NSMutableDictionary*paraDict = [NSMutableDictionary new];
  723. if(_isAudioType){
  724. [paraDict setValue:@"audio" forKey:@"type"];
  725. }
  726. else{
  727. [paraDict setValue:@"file" forKey:@"type"];
  728. }
  729. // if(!isMoreDataType){
  730. // self.pageIndex = 0;
  731. // }
  732. // else{
  733. // self.pageIndex ++;
  734. // }
  735. //
  736. // [paraDict setValue:[NSNumber numberWithInteger:self.pageIndex] forKey:@"index"];
  737. // [paraDict setValue:[NSNumber numberWithInteger:pageSizeNum] forKey:@"pageSize"];
  738. NSArray *diskNameArr = [_defaultDiskPath componentsSeparatedByString:@"/"];
  739. if(diskNameArr && diskNameArr.count >= 2){
  740. NSString *name = diskNameArr.lastObject;
  741. if(name.length == 0)
  742. {
  743. name = diskNameArr[diskNameArr.count -2];
  744. }
  745. [paraDict setValue:name forKey:@"path"];
  746. }
  747. [self showNewIndicatorHaveStrWithCanBack:YES canTouch:NO showText:NSLocalizedString(@"common_loading_tip",nil)];
  748. KWeakSelf
  749. [[netWorkManager shareInstance] cloudPhoneGETCallBackCode:@"getFileList" Parameters:paraDict success:^(id _Nonnull responseObject) {
  750. [weakSelf removeNewIndicatorHaveStr];
  751. //[weakSelf.tableView.mj_footer endRefreshing];
  752. NASFileAudioModel*NASFileAudioMod = [[NASFileAudioModel alloc] initWithDictionary:responseObject error:nil];
  753. // if(NASFileAudioMod.data.list.count < pageSizeNum){
  754. // [weakSelf.tableView.mj_footer endRefreshingWithNoMoreData];
  755. // }
  756. [weakSelf handelNetDataAfterFilterDataBy:NASFileAudioMod];
  757. if(weakSelf.curNASFileAudioMod && weakSelf.curNASFileAudioMod.status == 0){
  758. [weakSelf.tableView reloadData];
  759. }
  760. } failure:^(NSError * _Nonnull error) {
  761. [weakSelf removeNewIndicatorHaveStr];
  762. //[weakSelf.tableView.mj_footer endRefreshing];
  763. if([AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == AFNetworkReachabilityStatusNotReachable)
  764. {
  765. [[iToast makeText:NSLocalizedString(@"phone_network_fail_Tips",nil)] show];
  766. }
  767. else{
  768. [[iToast makeText:NSLocalizedString(@"netWork_error_show_tip",nil)] show];
  769. }
  770. }];
  771. }
  772. #pragma mark 上拉或者点击更多数据
  773. - (void)getMoreNetWorkData
  774. {
  775. [self getFileListFun:YES];
  776. }
  777. #pragma mark 分页数据组装
  778. - (void)handelNetDataAfterFilterDataBy:(NASFileAudioModel*)NASFileAudioMod
  779. {
  780. if(_curNASFileAudioMod && _curNASFileAudioMod.data && _curNASFileAudioMod.data.list){
  781. NSMutableArray *handelDataArr = [NSMutableArray arrayWithArray:_curNASFileAudioMod.data.list];//旧数据
  782. [handelDataArr addObjectsFromArray:NASFileAudioMod.data.list];//新数据
  783. _curNASFileAudioMod.data.list = (NSArray<NASFileAudioDataModel>*)handelDataArr;
  784. }
  785. else{
  786. _curNASFileAudioMod = NASFileAudioMod;
  787. }
  788. // if(_curNASFileAudioMod.data.list.count == 0 ){
  789. // self.tableView.mj_footer.hidden = YES;
  790. // }
  791. // else{
  792. // self.tableView.mj_footer.hidden = NO;
  793. // }
  794. }
  795. #pragma mark 调整文件上传
  796. - (void)gotoUploadFileFunWith:(NSInteger)tag
  797. {
  798. if(tag == 10 || tag == 11){
  799. uploadImageOrVideoViewController *vc = [uploadImageOrVideoViewController new];
  800. if(tag ==10){
  801. vc.isPhotoType = YES;
  802. }
  803. else{
  804. vc.isPhotoType = NO;
  805. }
  806. [self.navigationController pushViewController:vc animated:YES];
  807. }
  808. else{
  809. KWeakSelf
  810. [[DocumentPickerManager shareManager] openDocumentPickerSuccess:^(NSArray * _Nonnull urls) {
  811. [weakSelf gotoUploadFileRecordByFileAppWithUrls:urls];
  812. }];
  813. }
  814. }
  815. #pragma mark 文件下载
  816. - (void)gotoDownLoadFileFun
  817. {
  818. if(_didSelectListArr.count == 0){
  819. [[iToast makeText:@""] show];
  820. return;
  821. }
  822. NSMutableArray *arr = [NSMutableArray new];
  823. for (NASFilePicDataArrModel *dataModel in _didSelectListArr) {
  824. couldPhoneFileModel* fileModel = [couldPhoneFileModel new];
  825. fileModel.fileType = dataModel.type;
  826. fileModel.path = dataModel.path;
  827. fileModel.name = dataModel.name;
  828. fileModel.length = dataModel.size;
  829. fileModel.time = dataModel.duration;
  830. [arr addObject:fileModel];
  831. }
  832. uploadFileRecordViewController *vc = [uploadFileRecordViewController new];
  833. [self.navigationController pushViewController:vc animated:YES];
  834. vc.isDownloadingType = YES;
  835. [vc gotoDownloadFile:arr];
  836. }
  837. #pragma mark 删除图片
  838. - (void)showDeleteAlearViewFun
  839. {
  840. NSString *titleStr = NSLocalizedString(@"delete_file_title_msg",nil);
  841. NSString *tipStr = NSLocalizedString(@"delete_file_tip_msg",nil);
  842. KWeakSelf
  843. ComontAlretViewController *curAlretVC= [[ComontAlretViewController alloc] initWithTiTle:titleStr
  844. msg:tipStr
  845. imageStr:nil
  846. cancelTitle:NSLocalizedString(@"other_cancel",nil)
  847. okTitle:NSLocalizedString(@"other_confirm",nil) isOkBtnHighlight:YES
  848. didClickOk:^{
  849. [weakSelf delFileListFun];
  850. } didClickCancel:^{
  851. }];
  852. curAlretVC.modalPresentationStyle = UIModalPresentationCustom;
  853. [self presentViewController:curAlretVC animated:YES completion:^{
  854. curAlretVC.view.superview.backgroundColor = [UIColor clearColor];
  855. }];
  856. }
  857. #pragma mark 删除文件数据
  858. - (void)delFileListFun
  859. {
  860. NSMutableDictionary*paraDict = [NSMutableDictionary new];
  861. NSMutableArray *pathArr = [NSMutableArray new];
  862. for (NASFilePicDataArrModel *dataModel in _didSelectListArr) {
  863. [pathArr addObject:dataModel.path];
  864. }
  865. [paraDict setValue:pathArr forKey:@"path"];
  866. [self showNewIndicatorWithCanBack:YES canTouch:NO];
  867. //NSString*code = [[NSString alloc] initWithFormat:@"delFile?path=%@",paraDict[@"path"]]; //delFile?path=[/storage/emulated/0/Download/IMG_6464.HEIC]
  868. KWeakSelf //@"delFile"
  869. [[netWorkManager shareInstance] cloudPhonePostCallBackCode:@"delFile" Parameters:paraDict success:^(id _Nonnull responseObject) {
  870. [weakSelf removeNewIndicator];
  871. SuperModel *model = [[SuperModel alloc] initWithDictionary:responseObject error:nil];
  872. if(model && model.status == 0){
  873. [[iToast makeText:NSLocalizedString(@"delete_file_suc_msg",nil)] show];
  874. [weakSelf didDeleteSucFun];
  875. }
  876. else{
  877. }
  878. } failure:^(NSError * _Nonnull error) {
  879. [weakSelf removeNewIndicator];
  880. }];
  881. //数据埋点
  882. [[netWorkManager shareInstance] DataEmbeddingPointBy:3 withEventValue:@"Music_delete"];
  883. }
  884. #pragma mark 删除成功
  885. - (void)didDeleteSucFun
  886. {
  887. //删除最近文件
  888. for (NASFilePicDataArrModel *dataModel in _didSelectListArr) {
  889. [[lastFileManager shareManager] deleteFileInfoWithUrl:dataModel.path];
  890. }
  891. //2.删除已经获取到的网络数据
  892. [self deleteNetDataByDeleteSucFun];
  893. [_didSelectListArr removeAllObjects];
  894. [self setEditTypeTitleFun];
  895. }
  896. #pragma mark 删除成功后 对应删除原来获取的网络数据
  897. - (void)deleteNetDataByDeleteSucFun
  898. {
  899. NSMutableArray *afterFilterArr = [NSMutableArray new];
  900. for (NASFileAudioDataModel *model in _curNASFileAudioMod.data.list) {
  901. if (!model.isSelectType) {
  902. [afterFilterArr addObject:model];
  903. }
  904. }
  905. _curNASFileAudioMod.data.list = (NSArray<NASFileAudioDataModel>*)afterFilterArr;
  906. [self.tableView reloadData];
  907. }
  908. #pragma mark 图片详情删除成功后 对应删除原来获取的网络数据
  909. - (void)deleteNetDataByFilePath:(NSString*)filePath
  910. {
  911. if(!filePath || filePath.length == 0){
  912. return;
  913. }
  914. NSMutableArray *afterFilterArr = [NSMutableArray new];
  915. for (NASFileAudioDataModel *model in _curNASFileAudioMod.data.list) {
  916. if (![model.path isEqualToString:filePath]) {
  917. [afterFilterArr addObject:model];
  918. }
  919. }
  920. _curNASFileAudioMod.data.list = (NSArray<NASFileAudioDataModel>*)afterFilterArr;
  921. [self.tableView reloadData];
  922. }
  923. #pragma mark 获取分享开关
  924. -(void)queryShareSwitchFunFun
  925. {
  926. NSMutableDictionary *paraDict = [NSMutableDictionary new];
  927. [paraDict setValue:@4 forKey:@"type"];
  928. KWeakSelf
  929. [[netWorkManager shareInstance] CommonGetWithCallBackCode:queryShareSwitchFun Parameters:paraDict success:^(id _Nonnull responseObject){
  930. queryShareModel *queryShareMod = [[queryShareModel alloc] initWithDictionary:responseObject error:nil];
  931. if(queryShareMod){
  932. self->canShareType = queryShareMod.data.configValue;
  933. [weakSelf.curEditTypeBottomView setCanShaewFunBy:queryShareMod.data.configValue];
  934. }
  935. } failure:^(NSError * _Nonnull error) {
  936. }];
  937. }
  938. #pragma mark 点击了搜索
  939. - (void)gotoSearchVCFun
  940. {
  941. NasSearchViewController *vc = [NasSearchViewController new];
  942. vc.fileType = @"audio";
  943. [self.navigationController pushViewController:vc animated:YES];
  944. }
  945. #pragma mark 文件上传跳转上传记录
  946. - (void)gotoUploadFileRecordByFileAppWithUrls:(NSArray*)urls
  947. {
  948. uploadFileRecordViewController *vc = [uploadFileRecordViewController new];
  949. [self.navigationController pushViewController:vc animated:YES];
  950. vc.isUploadingType = YES;
  951. [vc gotoUploadFileByFileApp:urls];
  952. }
  953. @end