NASViewController.m 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164
  1. //
  2. // NASViewController.m
  3. // 双子星云手机
  4. //
  5. // Created by xd h on 2024/6/19.
  6. //
  7. #import "NASViewController.h"
  8. #import "NASMySpaceView.h"
  9. #import "NASCommonUsedView.h"
  10. #import "shareSecretTableViewCell.h"
  11. #import "NASLastFileView.h"
  12. #import "previewImageOrVideoViewController.h"
  13. #import "previewAudioOrDocumentViewController.h"
  14. #import "previewFileAndFolderViewController.h"
  15. #import "shareRecordViewController.h"
  16. #import "backupsOptionViewController.h"
  17. #import "fileTransfeSetViewController.h"
  18. #import "uploadFileRecordViewController.h"
  19. #import "previewToUploadFileView.h"
  20. #import "NASMySpaceViewController.h"
  21. #import "NasPreviewVideoViewController.h"
  22. #import "lastFileManager.h"
  23. #import "lastFileTableViewCell.h"
  24. #import "nasLastFileViewController.h"
  25. #import "audioPlayerViewController.h"
  26. #import "videoPlayByAVPlayerViewController.h"
  27. #import "imageDetailsScrollViewController.h"
  28. #import "queryShareModel.h"
  29. #import "imageVersionRenewTipView.h"
  30. #import "HWVersionModel.h"
  31. #import "HaveNewVersionView.h"
  32. #import "newerGuideView.h"
  33. #import "CustomerWebViewController.h"
  34. #import "noticeModel.h"
  35. #import "HaveNoticeView.h"
  36. #import "audioPlayingView.h"
  37. #import "DFPlayer.h"
  38. #import "queryShareReportMarkModel.h"
  39. #import "UpgradeInfoModel.h"
  40. #import "imageVersionUpdateDoneView.h"
  41. #import "imageVersionUpdateFailView.h"
  42. #import "queryHeartbeatModel.h"
  43. #import "BoxHeartbeatAlertTool.h"
  44. #import "searchBarView.h"
  45. #import "NasPreviewAPPViewController.h"
  46. #import "NasSearchViewController.h"
  47. #import "DocumentPickerManager.h"
  48. @interface NASViewController ()<UITableViewDelegate,UITableViewDataSource>
  49. {
  50. BOOL canShareType;
  51. UIImageView *welcomeImageV;//弃用
  52. UIView* rightRedView;//
  53. BOOL hadUploadTaskType;
  54. BOOL hadDownloadTaskType;
  55. NSInteger tryLinkNum;
  56. NSInteger tryLinkFrpNum;//frp接口连接次数
  57. imageVersionRenewTipView * RenewTipView;
  58. imageVersionUpdateDoneView* imageVersionUpdateDoneV;
  59. imageVersionUpdateFailView* imageVersionUpdateFailV;
  60. UILabel * tableFooterlabel;//
  61. }
  62. @property (nonatomic,strong)UITableView*tableView;
  63. @property (nonatomic, strong) UIView*tableHeadView;
  64. @property (nonatomic, strong) searchBarView* searchBarV;
  65. @property (nonatomic, strong) NASMySpaceView* NASMySpaceV;
  66. @property (nonatomic, strong) NASCommonUsedView* NASCommonUsedV;
  67. @property (nonatomic,strong)NASLastFileView*NASLastFileV;
  68. @property (nonatomic,strong) NSMutableArray *lastFileDataArr;
  69. @property (nonatomic,strong)UpgradeInfoModel*otaUpgradeInfoModel;
  70. @end
  71. @implementation NASViewController
  72. - (void)viewDidLoad {
  73. [super viewDidLoad];
  74. // Do any additional setup after loading the view.
  75. [self.view setBackgroundColor:HWF5F7FAColor];
  76. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(getExtraFilesDoneFun:) name:getExtraFilesDoneNotification object:nil];
  77. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationDidBecomeActive:) name:UIApplicationDidBecomeActiveNotification object:nil];
  78. //输入密码完成
  79. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didInpuPwdOkFun) name:didInputPWDNotification object:nil];
  80. [self.toolBar setHidden:YES];
  81. [self.navigationBar setHidden:YES];
  82. [self.navBarBGView setHidden:YES];
  83. [self drawAnyView];
  84. // CGFloat second = 0.1;
  85. // BOOL haveOpenMask = [HWDataManager getBoolWithKey:Const_cloudPhone_Model_Open];
  86. // if(haveOpenMask){
  87. // second = 5;
  88. // }
  89. // dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(second * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
  90. // [self beginShowAlertFun];
  91. // });
  92. //[self beginShowAlertFun];
  93. }
  94. - (void)drawAnyView{
  95. //顶底底部图片
  96. UIImageView *topImageV = [UIImageView new];
  97. topImageV.image = [UIImage imageNamed:@"Nas_top_img"];
  98. [self.view addSubview:topImageV];
  99. [topImageV mas_makeConstraints:^(MASConstraintMaker *make) {
  100. make.top.mas_equalTo(0);
  101. make.left.mas_equalTo(0);
  102. make.right.mas_equalTo(0);
  103. make.height.mas_equalTo(280.0*AUTOSCALE);
  104. }];
  105. // NSString *welcomeImageStr = @"nas_welcome_cs";
  106. // //欢迎
  107. // //en-US 英文 ja-JP 日文
  108. // NSArray *arLanguages = [[NSUserDefaults standardUserDefaults] objectForKey:@"AppleLanguages"];
  109. // NSLog(@"arLanguages:%@",arLanguages);
  110. // ///获取设备当前地区的代码和APP语言环境
  111. // NSString *languageCode = [NSLocale preferredLanguages][0];
  112. //
  113. // //目前支持 中文(简体 繁体) 英文 日语
  114. // if([languageCode rangeOfString:@"zh-Hans"].location != NSNotFound)
  115. // {
  116. // welcomeImageStr = @"nas_welcome_cs";
  117. // }
  118. // else if([languageCode rangeOfString:@"zh-Hant"].location != NSNotFound)
  119. // {
  120. // welcomeImageStr = @"nas_welcome_ct";
  121. // }
  122. // else{
  123. // welcomeImageStr = @"nas_welcome_en";
  124. // }
  125. CGFloat imageTopY = 54.0;
  126. welcomeImageV = [UIImageView new];
  127. welcomeImageV.hidden = YES;
  128. //welcomeImageV.image = [UIImage imageNamed:welcomeImageStr];
  129. [self.view addSubview:welcomeImageV];
  130. [welcomeImageV mas_makeConstraints:^(MASConstraintMaker *make) {
  131. make.top.mas_equalTo(imageTopY);
  132. make.left.mas_equalTo(16);
  133. make.width.mas_equalTo(210);
  134. make.height.mas_equalTo(24);
  135. }];
  136. UILabel *welcomelabel = [[UILabel alloc] init];
  137. welcomelabel.text = NSLocalizedString(@"NAS_top_welcome_title",nil);
  138. welcomelabel.textColor = [UIColor hwColor:@"#0A132B"];
  139. welcomelabel.font = [UIFont boldSystemFontOfSize:18.0];
  140. [self.view addSubview:welcomelabel];
  141. [welcomelabel mas_makeConstraints:^(MASConstraintMaker *make) {
  142. make.top.mas_equalTo(imageTopY);
  143. make.left.mas_equalTo(16);
  144. make.width.mas_equalTo(240);
  145. make.height.mas_equalTo(24);
  146. }];
  147. //添加按钮
  148. UIButton *addButton = [[UIButton alloc] init];
  149. [addButton setImage:[UIImage imageNamed:@"nas_add_icon"] forState:UIControlStateNormal];
  150. addButton.tag = 1;
  151. [addButton addTarget:self action:@selector(didClickHeadButtonFun:) forControlEvents:UIControlEventTouchUpInside];
  152. [self.view addSubview:addButton];
  153. [addButton mas_makeConstraints:^(MASConstraintMaker *make) {
  154. make.centerY.equalTo(welcomeImageV.mas_centerY).offset(0);
  155. make.right.mas_equalTo(-10);
  156. make.width.mas_equalTo(40);
  157. make.height.mas_equalTo(40);
  158. }];
  159. UIButton *rightTransferListButton = [[UIButton alloc] init];
  160. //[rightTransferListButton setImage:[UIImage imageNamed:@"icon_file_transfer"] forState:UIControlStateNormal];
  161. [rightTransferListButton setImage:[UIImage imageNamed:@"icon_file_transfer"] forState:UIControlStateNormal];
  162. rightTransferListButton.tag = 2;
  163. [rightTransferListButton addTarget:self action:@selector(didClickHeadButtonFun:) forControlEvents:UIControlEventTouchUpInside];
  164. [self.view addSubview:rightTransferListButton];
  165. [rightTransferListButton mas_makeConstraints:^(MASConstraintMaker *make) {
  166. //make.top.mas_equalTo(imageTopY);
  167. make.centerY.equalTo(welcomeImageV.mas_centerY).offset(0);
  168. make.right.equalTo(addButton.mas_left).offset(0);
  169. make.width.mas_equalTo(40);
  170. make.height.mas_equalTo(40);
  171. }];
  172. rightRedView = [[UIView alloc] init];
  173. rightRedView.backgroundColor = [UIColor hwColor:@"#DD4E4E" alpha:1.0];
  174. [rightTransferListButton addSubview:rightRedView];
  175. rightRedView.layer.cornerRadius = 7;
  176. rightRedView.hidden = YES;
  177. [rightRedView mas_makeConstraints:^(MASConstraintMaker *make) {
  178. make.width.mas_equalTo(14);
  179. make.height.mas_equalTo(14);
  180. make.right.mas_equalTo(0);
  181. make.top.mas_equalTo(6);
  182. }];
  183. [self.view addSubview:self.tableView];
  184. [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
  185. make.left.mas_equalTo(0);
  186. make.right.mas_equalTo(0);
  187. make.top.equalTo(welcomeImageV.mas_bottom).offset(20);
  188. make.bottom.mas_equalTo(-TABBARHEIGHT);
  189. }];
  190. self.tableView.userInteractionEnabled = NO;
  191. _tableHeadView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, (42+ 14) + 165+ 15 +120 +54 + 15)];
  192. //_tableHeadView.backgroundColor = [UIColor hwColor:@"#F6F8FA"];
  193. _tableHeadView.backgroundColor = [UIColor clearColor];
  194. self.tableView.tableHeaderView = _tableHeadView;
  195. //1.4.5 新加搜索 (高度 42+14)
  196. _searchBarV = [[searchBarView alloc] init];
  197. [_tableHeadView addSubview:_searchBarV];
  198. [_searchBarV mas_makeConstraints:^(MASConstraintMaker *make) {
  199. //make.top.equalTo(welcomeImageV.mas_bottom).offset(20);
  200. make.top.mas_equalTo(0);
  201. make.left.mas_equalTo(0);
  202. make.right.mas_equalTo(0);
  203. make.height.mas_equalTo(42);
  204. }];
  205. //我的空间
  206. _NASMySpaceV = [[NASMySpaceView alloc] init];
  207. [_tableHeadView addSubview:_NASMySpaceV];
  208. [_NASMySpaceV mas_makeConstraints:^(MASConstraintMaker *make) {
  209. //make.top.equalTo(welcomeImageV.mas_bottom).offset(20);
  210. make.top.equalTo(_searchBarV.mas_bottom).offset(14);
  211. //make.top.mas_equalTo(0);
  212. make.left.mas_equalTo(0);
  213. make.right.mas_equalTo(0);
  214. make.height.mas_equalTo(165);
  215. }];
  216. //常用功能
  217. _NASCommonUsedV = [[NASCommonUsedView alloc] init];
  218. [_tableHeadView addSubview:_NASCommonUsedV];
  219. [_NASCommonUsedV mas_makeConstraints:^(MASConstraintMaker *make) {
  220. make.top.equalTo(_NASMySpaceV.mas_bottom).offset(15);
  221. make.left.mas_equalTo(0);
  222. make.right.mas_equalTo(0);
  223. make.height.mas_equalTo(120);
  224. }];
  225. //最近文件
  226. [_tableHeadView addSubview:self.NASLastFileV];
  227. [self.NASLastFileV mas_makeConstraints:^(MASConstraintMaker *make) {
  228. make.top.equalTo(_NASCommonUsedV.mas_bottom).offset(15);
  229. make.left.mas_equalTo(0);
  230. make.right.mas_equalTo(0);
  231. make.height.mas_equalTo(54);
  232. }];
  233. BOOL isShowLastFileType = [HWDataManager getBoolWithKey:Const_last_file_show];
  234. self.NASLastFileV.eyeButton.selected = !isShowLastFileType;
  235. //tableFooterView
  236. NSString *text = NSLocalizedString(@"NAS_bottom_tip",nil);
  237. UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, 50)];
  238. label.text = [[NSString alloc] initWithFormat:@"- %@ -",text];
  239. label.textColor = [UIColor hwColor:@"#959799"];
  240. label.font = [UIFont systemFontOfSize:12];
  241. label.textAlignment = NSTextAlignmentCenter;
  242. self.tableView.tableFooterView = label;
  243. tableFooterlabel = label;
  244. KWeakSelf
  245. _NASMySpaceV.didClickButtonFun = ^(NSInteger tag) {
  246. [weakSelf didClickMySpaceFunBy:tag];
  247. };
  248. _NASCommonUsedV.didClickButtonFun = ^(NSInteger tag) {
  249. [weakSelf didClickCommonUsedFunBy:tag];
  250. };
  251. self.NASLastFileV.didClickButtonFun = ^(NSInteger tag) {
  252. [weakSelf didClickLastFileFunBy:tag];
  253. };
  254. _searchBarV.didClickBgFun = ^{
  255. [weakSelf gotoSearchVCFun];
  256. };
  257. [self setMySpaceDataFun];
  258. }
  259. #pragma mark - 懒加载
  260. - (UITableView *)tableView{
  261. if (!_tableView) {
  262. _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, 0, 0) style:UITableViewStylePlain];
  263. _tableView.delegate = self;
  264. _tableView.dataSource = self;
  265. _tableView.showsVerticalScrollIndicator = NO;
  266. _tableView.showsHorizontalScrollIndicator = NO;
  267. // _tableView.contentInset = UIEdgeInsetsMake(-H_STATE_BAR, 0, 0, 0);
  268. [_tableView setSeparatorStyle:(UITableViewCellSeparatorStyleNone)];
  269. [_tableView setSeparatorColor:[UIColor clearColor]];
  270. //[_tableView setBackgroundColor:[UIColor hwColor:@"#FFFFFF"]];
  271. [_tableView setBackgroundColor:[UIColor clearColor]];
  272. //[_tableView setTableFooterView:[UIView new]];
  273. [_tableView setBounces:YES];
  274. if (@available(iOS 15.0, *)) {
  275. _tableView.sectionHeaderTopPadding = 0;
  276. }
  277. _tableView.layer.cornerRadius = 8;
  278. _tableView.layer.masksToBounds = YES;
  279. }
  280. return _tableView;
  281. }
  282. - (NASLastFileView*)NASLastFileV
  283. {
  284. if(!_NASLastFileV){
  285. _NASLastFileV = [NASLastFileView new];
  286. }
  287. return _NASLastFileV;
  288. }
  289. #pragma mark - 列表委托
  290. - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
  291. return 1;
  292. }
  293. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
  294. if(!_lastFileDataArr){
  295. return 0;
  296. }
  297. return _lastFileDataArr.count;
  298. }
  299. - (lastFileTableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
  300. __block NSInteger row = indexPath.row;
  301. static NSString *identifier = @"lastFileTableViewCell";
  302. lastFileTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:identifier];
  303. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  304. if (!cell){
  305. cell = [[lastFileTableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier];
  306. [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
  307. [cell setBackgroundColor:[UIColor clearColor]];
  308. [cell setAccessoryType:(UITableViewCellAccessoryNone)];
  309. [cell hideCheckButtonBy:YES];
  310. }
  311. if(row < _lastFileDataArr.count){
  312. lastFileModel* dataModel = _lastFileDataArr[row];
  313. cell.curLastFileModel = dataModel;
  314. // KWeakSelf
  315. // cell.didClickSwitch = ^(BOOL SwitchOn) {
  316. // //[weakSelf userCheckFilePreviewByRow:row];
  317. // };
  318. cell.cellBgView.layer.mask = nil;
  319. if(row == _lastFileDataArr.count -1){
  320. /*下圆角*/
  321. UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_W-32 , 84)
  322. byRoundingCorners:UIRectCornerBottomLeft | UIRectCornerBottomRight
  323. cornerRadii:CGSizeMake(12, 12)];
  324. CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
  325. maskLayer.frame = cell.cellBgView.bounds;
  326. maskLayer.path = maskPath.CGPath;
  327. cell.cellBgView.layer.mask = maskLayer;
  328. }
  329. }
  330. return cell;
  331. }
  332. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
  333. return 84;
  334. }
  335. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
  336. {
  337. NSInteger row = indexPath.row;
  338. if(row < _lastFileDataArr.count){
  339. lastFileModel* dataModel = _lastFileDataArr[row];
  340. if([dataModel.type isEqualToString:@"video"]){
  341. videoPlayByAVPlayerViewController *vc = [videoPlayByAVPlayerViewController new];
  342. vc.VideoDataMode = (NASFileAndFolderDataModel*)dataModel;
  343. [self.navigationController pushViewController:vc animated:YES];
  344. }
  345. else if([dataModel.type isEqualToString:@"audio"]){
  346. // NSMutableArray *audioDataArr = [NSMutableArray new];
  347. // NSInteger index = 0;
  348. //
  349. // for (int i=0; i<_lastFileDataArr.count; i++) {
  350. // lastFileModel* audioDataModel = _lastFileDataArr[i];
  351. // if([audioDataModel.type isEqualToString:@"audio"]){
  352. //
  353. // if(i == row){
  354. // index = audioDataArr.count;
  355. // }
  356. //
  357. // [audioDataArr addObject:audioDataModel];
  358. // }
  359. // }
  360. audioPlayerViewController *vc = [audioPlayerViewController new];
  361. vc.isfirstEnterType = YES;
  362. vc.outSideDataModel = (NASFileAudioDataModel *)dataModel;
  363. [self.navigationController pushViewController:vc animated:YES];
  364. KWeakSelf
  365. vc.didNeedDeleteFile = ^(NSString * _Nonnull filePath) {
  366. [weakSelf getLastFileDataFun];
  367. };
  368. }
  369. else if([dataModel.type containsString:@"jpg"]){
  370. NSMutableArray *jpgDataArr = [NSMutableArray new];
  371. NSInteger index = 0;
  372. for (int i=0; i<_lastFileDataArr.count; i++) {
  373. lastFileModel* jpgDataModel = _lastFileDataArr[i];
  374. if([jpgDataModel.type containsString:@"jpg"]){
  375. if(i == row){
  376. index = jpgDataArr.count;
  377. }
  378. [jpgDataArr addObject:jpgDataModel];
  379. }
  380. }
  381. imageDetailsScrollViewController *vc = [imageDetailsScrollViewController new];
  382. vc.index = index;
  383. vc.totalDataArr = jpgDataArr;
  384. [self.navigationController pushViewController:vc animated:YES];
  385. vc.canShareType = canShareType;
  386. }
  387. }
  388. }
  389. #pragma mark 点击头部
  390. - (void)didClickHeadButtonFun:(UIButton*)but
  391. {
  392. if([AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == AFNetworkReachabilityStatusNotReachable)
  393. {
  394. [[iToast makeText:NSLocalizedString(@"phone_network_fail_Tips",nil)] show];
  395. return;
  396. }
  397. NSInteger tag = but.tag;
  398. switch (tag) {
  399. case 1:
  400. {
  401. if(ksharedAppDelegate.DisabledFileTransferType){
  402. if(ksharedAppDelegate.isImageNewFor130){
  403. [[iToast makeText:NSLocalizedString(@"File_Transfer_Disable_tip",nil)] show];
  404. }
  405. else{
  406. [[iToast makeText:NSLocalizedString(@"File_Transfer_Disable_tip2",nil)] show];
  407. }
  408. return;
  409. }
  410. [self userDidClickUploadViewFun];
  411. }
  412. break;
  413. case 2:
  414. {
  415. uploadFileRecordViewController *vc = [uploadFileRecordViewController new];
  416. [self pushViewController:vc animated:YES];
  417. }
  418. break;
  419. default:
  420. break;
  421. }
  422. }
  423. #pragma mark 点击我的空间模块
  424. - (void)didClickMySpaceFunBy:(NSInteger)tag
  425. {
  426. // if(tag ==1 ){
  427. // if(!ksharedAppDelegate.cloudPhoneExtraFileListMod){
  428. // //链接了
  429. // tryLinkNum ++;
  430. // [[webSocketManager shareInstance] getExtraFilesListFun];
  431. //
  432. // if(tryLinkNum >= 3){
  433. // tryLinkNum = 0;
  434. // [[iToast makeText:NSLocalizedString(@"box_link_error_show_tip",nil)] show];
  435. // return;
  436. // }
  437. //
  438. // KWeakSelf
  439. // dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
  440. // [weakSelf didClickMySpaceFunBy:tag];
  441. // });
  442. // return;
  443. // }
  444. // }
  445. if([AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == AFNetworkReachabilityStatusNotReachable)
  446. {
  447. [[iToast makeText:NSLocalizedString(@"phone_network_fail_Tips",nil)] show];
  448. //return;
  449. }
  450. // if (!ksharedAppDelegate.isWebSockLinkOKAginType) {//未链接
  451. // [[iToast makeText:NSLocalizedString(@"box_link_error_show_tip",nil)] show];
  452. // return;
  453. // }
  454. // if(ksharedAppDelegate.DisabledFileTransferType){
  455. // if(ksharedAppDelegate.isImageNewFor130){
  456. // [[iToast makeText:NSLocalizedString(@"File_Transfer_Disable_tip",nil)] show];
  457. // }
  458. // else{
  459. // [[iToast makeText:NSLocalizedString(@"File_Transfer_Disable_tip2",nil)] show];
  460. // }
  461. // return;
  462. // }
  463. tryLinkNum = 0;
  464. switch (tag)
  465. {
  466. case 1:
  467. {
  468. NASMySpaceViewController *vc = [NASMySpaceViewController new];
  469. [self pushViewController:vc animated:YES];
  470. }
  471. break;
  472. case 9:{
  473. NasPreviewAPPViewController *vc = [NasPreviewAPPViewController new];
  474. [self pushViewController:vc animated:YES];
  475. }
  476. break;
  477. case 10:{
  478. previewImageOrVideoViewController *vc = [previewImageOrVideoViewController new];
  479. vc.isPhotoType = YES;
  480. [self pushViewController:vc animated:YES];
  481. }
  482. break;
  483. case 11:{
  484. // previewImageOrVideoViewController *vc = [previewImageOrVideoViewController new];
  485. // vc.isPhotoType = NO;
  486. // [self pushViewController:vc animated:YES];
  487. NasPreviewVideoViewController *vc = [NasPreviewVideoViewController new];
  488. [self pushViewController:vc animated:YES];
  489. }
  490. break;
  491. case 12:{
  492. previewAudioOrDocumentViewController *vc = [previewAudioOrDocumentViewController new];
  493. vc.isAudioType = YES;
  494. [self pushViewController:vc animated:YES];
  495. }
  496. break;
  497. case 13:{
  498. previewFileAndFolderViewController *vc = [previewFileAndFolderViewController new];
  499. [self pushViewController:vc animated:YES];
  500. }
  501. break;
  502. default:
  503. break;
  504. }
  505. }
  506. #pragma mark 点击常用模块模块
  507. - (void)didClickCommonUsedFunBy:(NSInteger)tag
  508. {
  509. if([AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == AFNetworkReachabilityStatusNotReachable)
  510. {
  511. [[iToast makeText:NSLocalizedString(@"phone_network_fail_Tips",nil)] show];
  512. return;
  513. }
  514. // if (!ksharedAppDelegate.isWebSockLinkOKAginType) {//未链接
  515. // [[iToast makeText:NSLocalizedString(@"box_link_error_show_tip",nil)] show];
  516. // return;
  517. // }
  518. switch (tag)
  519. {
  520. case 10:{
  521. backupsOptionViewController *vc = [backupsOptionViewController new];
  522. [self pushViewController:vc animated:YES];
  523. }
  524. break;
  525. case 11:
  526. {
  527. // if(!ksharedAppDelegate.isWebSockLinkOKAginType){
  528. // [[iToast makeText:NSLocalizedString(@"check_could_phone_state",nil)] show];
  529. // return;
  530. // }
  531. fileTransfeSetViewController *nextVC = [fileTransfeSetViewController new];
  532. [self pushViewController:nextVC animated:YES];
  533. }
  534. break;
  535. case 12:{
  536. shareRecordViewController *vc = [shareRecordViewController new];
  537. [self pushViewController:vc animated:YES];
  538. [self.NASCommonUsedV setRedPointShow:NO];
  539. [self updateShareBeMarkFun];
  540. }
  541. break;
  542. default:
  543. break;
  544. }
  545. }
  546. #pragma mark 点击最近文件模块
  547. - (void)didClickLastFileFunBy:(NSInteger)tag
  548. {
  549. if(tag == 2){
  550. [self getLastFileDataFun];
  551. }
  552. else if (tag ==1){
  553. nasLastFileViewController *vc = [nasLastFileViewController new];
  554. [self pushViewController:vc animated:YES];
  555. }
  556. }
  557. #pragma mark 用户点击上传文件
  558. - (void)userDidClickUploadViewFun
  559. {
  560. [self hideTabbarFun];
  561. previewToUploadFileView *previewToUploadFileV = [[previewToUploadFileView alloc] init];
  562. [self.view addSubview:previewToUploadFileV];
  563. [previewToUploadFileV mas_makeConstraints:^(MASConstraintMaker *make) {
  564. make.left.mas_equalTo(0);
  565. make.right.mas_equalTo(0);
  566. make.bottom.mas_equalTo(10);
  567. make.top.mas_equalTo(0);
  568. }];
  569. KWeakSelf
  570. previewToUploadFileV.didClickButtonFun = ^(NSInteger tag) {
  571. [weakSelf gotoUploadFileFunWith:tag];
  572. };
  573. previewToUploadFileV.didClickCloseFun = ^{
  574. [weakSelf showTabbarFun];
  575. };
  576. }
  577. #pragma mark 调整文件上传
  578. - (void)gotoUploadFileFunWith:(NSInteger)tag
  579. {
  580. if(tag == 10 || tag == 11){
  581. uploadImageOrVideoViewController *vc = [uploadImageOrVideoViewController new];
  582. if(tag ==10){
  583. vc.isPhotoType = YES;
  584. }
  585. else{
  586. vc.isPhotoType = NO;
  587. }
  588. [self pushViewController:vc animated:YES];
  589. }
  590. else{
  591. KWeakSelf
  592. [[DocumentPickerManager shareManager] openDocumentPickerSuccess:^(NSArray * _Nonnull urls) {
  593. [weakSelf gotoUploadFileRecordByFileAppWithUrls:urls];
  594. }];
  595. }
  596. }
  597. #pragma mark 获取到云机磁盘相关信息
  598. - (void)getExtraFilesDoneFun:(NSNotification*)not
  599. {
  600. // mainBlock(^{
  601. // [self setMySpaceDataFun];
  602. // });
  603. [self getExtraFilesByFrpHttpFun];
  604. }
  605. #pragma mark 走frp方案 获取云机磁盘信息
  606. - (void)getExtraFilesByFrpHttpFun
  607. {
  608. NSMutableDictionary*paraDict = [NSMutableDictionary new];
  609. KWeakSelf
  610. [[netWorkManager shareInstance] cloudPhoneGETCallBackCode:@"getExtra" Parameters:paraDict success:^(id _Nonnull responseObject) {
  611. cloudPhoneExtraFileListModel *model = [[cloudPhoneExtraFileListModel alloc] initWithDictionary:responseObject error:nil];
  612. if(model && model.status == 0){
  613. ksharedAppDelegate.cloudPhoneExtraFileListMod = model;
  614. [weakSelf setMySpaceDataFun];
  615. }
  616. } failure:^(NSError * _Nonnull error) {
  617. [weakSelf setMySpaceDataFun];
  618. }];
  619. }
  620. #pragma mark 设置我的空间信息
  621. - (void)setMySpaceDataFun
  622. {
  623. if(ksharedAppDelegate.cloudPhoneExtraFileListMod){
  624. tryLinkFrpNum = 0;
  625. [_NASMySpaceV setProgressFun];
  626. }
  627. else{
  628. // tryLinkFrpNum ++;
  629. //
  630. // if(tryLinkFrpNum == 3){
  631. // tryLinkFrpNum = 0;
  632. // [self checkBoxHeartbeatFun];
  633. // }
  634. dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
  635. //[self setMySpaceDataFun];
  636. [self getExtraFilesByFrpHttpFun];
  637. });
  638. }
  639. }
  640. - (void)viewWillAppear:(BOOL)animated{
  641. [super viewWillAppear:animated];
  642. [self getLastFileDataFun];
  643. [self queryShareSwitchFunFun];
  644. [self queryShareBeMarkFun];
  645. dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
  646. [self checkFileTransferTask];
  647. });
  648. //[self beginShowAlertFun];
  649. [self handelAudioPlayingViewFun];
  650. [self showTabbarFun];
  651. //尝试修复偶现获取不到磁盘空间问题
  652. [self getExtraFilesByFrpHttpFun];
  653. }
  654. - (void)viewWillDisappear:(BOOL)animated{
  655. [super viewWillDisappear:animated];
  656. }
  657. - (void)pushViewController:(UIViewController*)vc animated:(BOOL)animated
  658. {
  659. [self.navigationController pushViewController:vc animated:animated];
  660. //[self hideTabbarFun];
  661. }
  662. - (void)showTabbarFun
  663. {
  664. // 显示 tab bar
  665. self.tabBarController.tabBar.hidden = NO;
  666. }
  667. - (void)hideTabbarFun
  668. {
  669. // 隐藏 tab bar
  670. self.tabBarController.tabBar.hidden = YES;
  671. }
  672. #pragma mark 获取最近文件数据
  673. - (void)getLastFileDataFun
  674. {
  675. _lastFileDataArr = [lastFileManager shareManager].lastFileListArr;
  676. //HLog(@"%@",_lastFileDataArr);
  677. BOOL isShowLastFileType = [HWDataManager getBoolWithKey:Const_last_file_show];
  678. if(!isShowLastFileType){
  679. _tableHeadView.frame = CGRectMake(0, 0, SCREEN_W,(42+ 14) + 165+ 15 +120 +54 + 15);
  680. [self.NASLastFileV mas_remakeConstraints:^(MASConstraintMaker *make) {
  681. make.top.equalTo(_NASCommonUsedV.mas_bottom).offset(15);
  682. make.left.mas_equalTo(0);
  683. make.right.mas_equalTo(0);
  684. make.height.mas_equalTo(54);
  685. }];
  686. self.NASLastFileV.notDataImageV.hidden = YES;
  687. self.NASLastFileV.notDataLabel.hidden = YES;
  688. //全圆角
  689. UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_W-32 , 54)
  690. byRoundingCorners:UIRectCornerAllCorners
  691. cornerRadii:CGSizeMake(12, 12)];
  692. CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
  693. maskLayer.frame = self.NASLastFileV.bounds;
  694. maskLayer.path = maskPath.CGPath;
  695. self.NASLastFileV.whiteBgView.layer.mask = nil;
  696. self.NASLastFileV.whiteBgView.layer.mask = maskLayer;
  697. _lastFileDataArr = [NSMutableArray new];
  698. }
  699. else if(_lastFileDataArr.count > 0){
  700. _tableHeadView.frame = CGRectMake(0, 0, SCREEN_W,(42+ 14) + 165+ 15 +120 +54 + 15);
  701. [self.NASLastFileV mas_remakeConstraints:^(MASConstraintMaker *make) {
  702. make.top.equalTo(_NASCommonUsedV.mas_bottom).offset(15);
  703. make.left.mas_equalTo(0);
  704. make.right.mas_equalTo(0);
  705. make.height.mas_equalTo(54);
  706. }];
  707. self.NASLastFileV.notDataImageV.hidden = YES;
  708. self.NASLastFileV.notDataLabel.hidden = YES;
  709. /*上圆角*/
  710. UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_W- 32 , 54)
  711. byRoundingCorners:UIRectCornerTopLeft|UIRectCornerTopRight
  712. cornerRadii:CGSizeMake(12, 12)];
  713. CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
  714. maskLayer.frame = CGRectMake(0, 0, SCREEN_W -32, 54);
  715. maskLayer.path = maskPath.CGPath;
  716. self.NASLastFileV.whiteBgView.layer.mask = nil;
  717. self.NASLastFileV.whiteBgView.layer.mask = maskLayer;
  718. }
  719. else{
  720. _tableHeadView.frame = CGRectMake(0, 0, SCREEN_W,(42+ 14) + 165+ 15 +120 +254 + 15);
  721. [self.NASLastFileV mas_remakeConstraints:^(MASConstraintMaker *make) {
  722. make.top.equalTo(_NASCommonUsedV.mas_bottom).offset(15);
  723. make.left.mas_equalTo(0);
  724. make.right.mas_equalTo(0);
  725. make.height.mas_equalTo(254);
  726. }];
  727. self.NASLastFileV.notDataImageV.hidden = NO;
  728. self.NASLastFileV.notDataLabel.hidden = NO;
  729. //全圆角
  730. UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_W-32 , 254)
  731. byRoundingCorners:UIRectCornerAllCorners
  732. cornerRadii:CGSizeMake(12, 12)];
  733. CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
  734. maskLayer.frame = self.NASLastFileV.bounds;
  735. maskLayer.path = maskPath.CGPath;
  736. self.NASLastFileV.whiteBgView.layer.mask = nil;
  737. self.NASLastFileV.whiteBgView.layer.mask = maskLayer;
  738. }
  739. KWeakSelf
  740. dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
  741. if(weakSelf.lastFileDataArr.count > 0){
  742. weakSelf.tableView.tableFooterView = self->tableFooterlabel;
  743. }
  744. else{
  745. weakSelf.tableView.tableFooterView = nil;
  746. }
  747. [weakSelf.tableView reloadData];
  748. });
  749. }
  750. #pragma mark 获取分享开关
  751. -(void)queryShareSwitchFunFun
  752. {
  753. NSMutableDictionary *paraDict = [NSMutableDictionary new];
  754. [paraDict setValue:@7 forKey:@"type"];
  755. //KWeakSelf
  756. [[netWorkManager shareInstance] CommonGetWithCallBackCode:queryShareSwitchFun Parameters:paraDict success:^(id _Nonnull responseObject){
  757. queryShareModel *queryShareMod = [[queryShareModel alloc] initWithDictionary:responseObject error:nil];
  758. if(queryShareMod){
  759. self->canShareType = queryShareMod.data.configValue;
  760. //[weakSelf.curEditTypeBottomView setCanShaewFunBy:queryShareMod.data.configValue];
  761. }
  762. } failure:^(NSError * _Nonnull error) {
  763. }];
  764. }
  765. - (void)checkFileTransferTask
  766. {//有个偶现的闪退在BGFMDB
  767. [[nasUploadFileManager shareInstance] checkHadUploadTaskWithComplete:^(BOOL isSuccess) {
  768. self->hadUploadTaskType = isSuccess;
  769. [self setRightButtonRedTypeFun];
  770. }];
  771. KWeakSelf
  772. dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
  773. [[nasDownloadFileManager shareInstance] checkHadDownloadTaskWithComplete:^(BOOL isSuccess) {
  774. self->hadDownloadTaskType = isSuccess;
  775. [weakSelf setRightButtonRedTypeFun];
  776. }];
  777. });
  778. }
  779. - (void)setRightButtonRedTypeFun
  780. {
  781. mainBlock(^{
  782. if(self->hadUploadTaskType || self->hadDownloadTaskType){
  783. self->rightRedView.hidden = NO;
  784. }
  785. else{
  786. self->rightRedView.hidden = YES;
  787. }
  788. });
  789. }
  790. #pragma mark 是否有新的分享被封禁
  791. -(void)queryShareBeMarkFun
  792. {
  793. NSMutableDictionary *paraDict = [NSMutableDictionary new];
  794. KWeakSelf
  795. [[netWorkManager shareInstance] CommonGetWithCallBackCode:queryShareReportMarkFun Parameters:paraDict success:^(id _Nonnull responseObject){
  796. queryShareReportMarkModel *ShareMarkMod = [[queryShareReportMarkModel alloc] initWithDictionary:responseObject error:nil];
  797. if(ShareMarkMod){
  798. [weakSelf.NASCommonUsedV setRedPointShow:ShareMarkMod.data.reportMark];
  799. }
  800. } failure:^(NSError * _Nonnull error) {
  801. }];
  802. }
  803. #pragma mark 修改分享被封禁的mark状态()
  804. -(void)updateShareBeMarkFun
  805. {
  806. NSMutableDictionary *paraDict = [NSMutableDictionary new];
  807. //KWeakSelf
  808. [[netWorkManager shareInstance] CommonPostCallBackCode:updateShareReportMarkFun Parameters:paraDict success:^(id _Nonnull responseObject){
  809. // SuperModel *ShareMarkMod = [[SuperModel alloc] initWithDictionary:responseObject error:nil];
  810. // if(ShareMarkMod){
  811. //
  812. // }
  813. } failure:^(NSError * _Nonnull error) {
  814. }];
  815. }
  816. #pragma mark 处理音频播放中的视图状态
  817. - (void)handelAudioPlayingViewFun
  818. {
  819. audioPlayingView * audioPlayingV = [audioPlayingView sharedInstance];
  820. if([DFPlayer sharedPlayer].state == DFPlayerStateBuffering
  821. ||[DFPlayer sharedPlayer].state == DFPlayerStatePlaying
  822. ||[DFPlayer sharedPlayer].state == DFPlayerStatePause){//播放中
  823. [self showAudioPlayingViewFun];
  824. }
  825. else{
  826. [self hideAudioPlayingViewFun];
  827. }
  828. KWeakSelf
  829. audioPlayingV.didClickButtonFun = ^(NSInteger tag) {
  830. if(tag == 1){
  831. [weakSelf hideAudioPlayingViewFun];
  832. }
  833. else if(tag == 5){
  834. [weakSelf AudioPlayingGotoAudioPlayerVCFun];
  835. }
  836. };
  837. }
  838. - (void)AudioPlayingGotoAudioPlayerVCFun{
  839. audioPlayerViewController *vc = [audioPlayerViewController new];
  840. vc.isfirstEnterType = NO;
  841. [self.navigationController pushViewController:vc animated:YES];
  842. }
  843. #pragma mark 显示音频播放中的视图
  844. - (void)showAudioPlayingViewFun
  845. {
  846. audioPlayingView * audioPlayingV = [audioPlayingView sharedInstance];
  847. [self.view addSubview:audioPlayingV];
  848. if([DFPlayer sharedPlayer].state == DFPlayerStatePlaying){
  849. [audioPlayingV startRotatingImage];
  850. }
  851. else if ([DFPlayer sharedPlayer].state == DFPlayerStatePause){
  852. [audioPlayingV stopRotatingImage];
  853. }
  854. [audioPlayingV mas_makeConstraints:^(MASConstraintMaker *make) {
  855. make.height.mas_equalTo(49);
  856. make.left.mas_equalTo(0);
  857. make.right.mas_equalTo(0);
  858. make.bottom.mas_equalTo(-TABBARHEIGHT);
  859. }];
  860. [self.tableView mas_remakeConstraints:^(MASConstraintMaker *make) {
  861. make.left.mas_equalTo(0);
  862. make.right.mas_equalTo(0);
  863. make.top.equalTo(welcomeImageV.mas_bottom).offset(20);
  864. make.bottom.mas_equalTo(-TABBARHEIGHT -49);
  865. }];
  866. }
  867. #pragma mark 隐藏音频播放中的视图
  868. - (void)hideAudioPlayingViewFun
  869. {
  870. // audioPlayingView * audioPlayingV = [audioPlayingView sharedInstance];
  871. // [audioPlayingV removeFromSuperview];
  872. [self.tableView mas_remakeConstraints:^(MASConstraintMaker *make) {
  873. make.left.mas_equalTo(0);
  874. make.right.mas_equalTo(0);
  875. make.top.equalTo(welcomeImageV.mas_bottom).offset(20);
  876. make.bottom.mas_equalTo(-TABBARHEIGHT);
  877. }];
  878. }
  879. - (void)applicationDidBecomeActive:(NSNotification *)notification
  880. {
  881. //[self beginShowAlertFun];
  882. //后台回来点击首页无效问题
  883. self.tableView.userInteractionEnabled = YES;
  884. [self checkBoxHeartbeatFun];
  885. }
  886. #pragma mark 检测盒子的心跳情况
  887. - (void)checkBoxHeartbeatFun
  888. {
  889. //2、点击系统升级弹框确定按钮后30分钟内不弹;
  890. NSNumber *preSecondNum = [HWDataManager getNumberWithKey:stringKeyAddSn(@"disenable_type1_BoxHeartbeat")];
  891. if(preSecondNum){
  892. long seconds = [iTools getNowTimeStamp];
  893. if(seconds - preSecondNum.longValue <= 60*30){
  894. return;
  895. }
  896. }
  897. //3、重启、恢复出厂设备、首次设置密码 3个情况下8分钟之内不弹
  898. NSNumber *preSecondNum2 = [HWDataManager getNumberWithKey:stringKeyAddSn(@"disenable_type2_BoxHeartbeat")];
  899. if(preSecondNum2){
  900. long seconds = [iTools getNowTimeStamp];
  901. if(seconds - preSecondNum2.longValue <= 60*8){
  902. return;
  903. }
  904. }
  905. if(ksharedAppDelegate.didShowBoxHeartbeatAlertType
  906. ||[webRtcManager shareManager].isResetingType
  907. ||[webRtcManager shareManager].isRebootIngType
  908. || [ksharedAppDelegate didShowImageRenewViewFun]){
  909. return;
  910. }
  911. //1.隐私模式密码界面 3秒检测一次是否输入完成密码了
  912. if(ksharedAppDelegate.isDidShowPwdType){
  913. KWeakSelf
  914. dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
  915. [weakSelf checkBoxHeartbeatFun];
  916. });
  917. return;
  918. }
  919. //test code
  920. // [[BoxHeartbeatAlertTool shareInstance] showBoxHeartbeatAlertFun:2 didClickBut:^(NSInteger tag) {
  921. //
  922. // }];
  923. if(ksharedAppDelegate.isWebSockLinkOKAginType && ksharedAppDelegate.cloudPhoneExtraFileListMod){
  924. return;
  925. }
  926. NSMutableDictionary *paraDict = [NSMutableDictionary new];
  927. KWeakSelf
  928. [[netWorkManager shareInstance] CommonGetWithCallBackCode:queryHeartbeat Parameters:paraDict success:^(id _Nonnull responseObject){
  929. queryHeartbeatModel *heartbeatMod = [[queryHeartbeatModel alloc] initWithDictionary:responseObject error:nil];
  930. if(heartbeatMod && heartbeatMod.data){
  931. [weakSelf checkBoxHeartbeatToShowPopViewFunBy:heartbeatMod];
  932. }
  933. } failure:^(NSError * _Nonnull error) {
  934. }];
  935. }
  936. #pragma mark 根据盒子的心跳情况 显示异常谈了
  937. - (void)checkBoxHeartbeatToShowPopViewFunBy:(queryHeartbeatModel*)heartbeatMod
  938. {
  939. if(!heartbeatMod || !heartbeatMod.data){
  940. return;
  941. }
  942. if (//!heartbeatMod.data.frpStatus&&
  943. !heartbeatMod.data.hostAgentStatus
  944. &&!heartbeatMod.data.containerAgentStatus) {//全部异常
  945. [[BoxHeartbeatAlertTool shareInstance] showBoxHeartbeatAlertFun:1 didClickBut:^(NSInteger tag) {
  946. }];
  947. }
  948. else if (heartbeatMod.data.hostAgentStatus
  949. //&& !heartbeatMod.data.frpStatus
  950. && !heartbeatMod.data.containerAgentStatus) {//frp异常
  951. [[BoxHeartbeatAlertTool shareInstance] showBoxHeartbeatAlertFun:2 didClickBut:^(NSInteger tag) {
  952. }];
  953. }
  954. }
  955. #pragma mark 输入密码完成
  956. - (void)didInpuPwdOkFun
  957. {
  958. KWeakSelf
  959. mainBlock(^{
  960. weakSelf.tableView.userInteractionEnabled = YES;
  961. });
  962. }
  963. #pragma mark 点击了搜索
  964. - (void)gotoSearchVCFun
  965. {
  966. NasSearchViewController *vc = [NasSearchViewController new];
  967. [self pushViewController:vc animated:YES];
  968. }
  969. #pragma mark 文件上传跳转上传记录
  970. - (void)gotoUploadFileRecordByFileAppWithUrls:(NSArray*)urls
  971. {
  972. uploadFileRecordViewController *vc = [uploadFileRecordViewController new];
  973. [self.navigationController pushViewController:vc animated:YES];
  974. vc.isUploadingType = YES;
  975. [vc gotoUploadFileByFileApp:urls];
  976. }
  977. @end