previewAudioOrDocumentViewController.m 38 KB

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