NASViewController.m 41 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195
  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. //无网 拿数据缓存
  609. if([AFNetworkReachabilityManager sharedManager].networkReachabilityStatus == AFNetworkReachabilityStatusNotReachable)
  610. {
  611. //数据缓存
  612. NSString *key = stringKeyAddSn(@"getExtra");
  613. NSDictionary *dataDict = [HWDataManager getObjectWithKey:key];
  614. if (dataDict) {
  615. cloudPhoneExtraFileListModel *model = [[cloudPhoneExtraFileListModel alloc] initWithDictionary:dataDict error:nil];
  616. if(model && model.status == 0){
  617. ksharedAppDelegate.cloudPhoneExtraFileListMod = model;
  618. [self setMySpaceDataFun];
  619. return;
  620. }
  621. }
  622. }
  623. NSMutableDictionary*paraDict = [NSMutableDictionary new];
  624. KWeakSelf
  625. [[netWorkManager shareInstance] cloudPhoneGETCallBackCode:@"getExtra" Parameters:paraDict success:^(id _Nonnull responseObject) {
  626. cloudPhoneExtraFileListModel *model = [[cloudPhoneExtraFileListModel alloc] initWithDictionary:responseObject error:nil];
  627. if(model && model.status == 0){
  628. NSMutableDictionary *IdDataDict = [[NSMutableDictionary alloc] initWithDictionary:responseObject];
  629. for (NSString *key in responseObject) {
  630. id object = IdDataDict[key];
  631. if(!object || [object isKindOfClass:[NSNull class]]){
  632. [IdDataDict removeObjectForKey:key];
  633. }
  634. }
  635. //数据缓存
  636. NSString *key = stringKeyAddSn(@"getExtra");
  637. [HWDataManager setObjectWithKey:key value:IdDataDict];
  638. ksharedAppDelegate.cloudPhoneExtraFileListMod = model;
  639. [weakSelf setMySpaceDataFun];
  640. }
  641. } failure:^(NSError * _Nonnull error) {
  642. [weakSelf setMySpaceDataFun];
  643. }];
  644. }
  645. #pragma mark 设置我的空间信息
  646. - (void)setMySpaceDataFun
  647. {
  648. if(ksharedAppDelegate.cloudPhoneExtraFileListMod){
  649. tryLinkFrpNum = 0;
  650. [_NASMySpaceV setProgressFun];
  651. }
  652. else{
  653. // tryLinkFrpNum ++;
  654. //
  655. // if(tryLinkFrpNum == 3){
  656. // tryLinkFrpNum = 0;
  657. // [self checkBoxHeartbeatFun];
  658. // }
  659. dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
  660. //[self setMySpaceDataFun];
  661. [self getExtraFilesByFrpHttpFun];
  662. });
  663. }
  664. }
  665. - (void)viewWillAppear:(BOOL)animated{
  666. [super viewWillAppear:animated];
  667. [self getLastFileDataFun];
  668. [self queryShareSwitchFunFun];
  669. [self queryShareBeMarkFun];
  670. dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
  671. [self checkFileTransferTask];
  672. });
  673. //[self beginShowAlertFun];
  674. [self handelAudioPlayingViewFun];
  675. [self showTabbarFun];
  676. //尝试修复偶现获取不到磁盘空间问题
  677. [self getExtraFilesByFrpHttpFun];
  678. }
  679. - (void)viewWillDisappear:(BOOL)animated{
  680. [super viewWillDisappear:animated];
  681. }
  682. - (void)pushViewController:(UIViewController*)vc animated:(BOOL)animated
  683. {
  684. [self.navigationController pushViewController:vc animated:animated];
  685. //[self hideTabbarFun];
  686. }
  687. - (void)showTabbarFun
  688. {
  689. // 显示 tab bar
  690. self.tabBarController.tabBar.hidden = NO;
  691. }
  692. - (void)hideTabbarFun
  693. {
  694. // 隐藏 tab bar
  695. self.tabBarController.tabBar.hidden = YES;
  696. }
  697. #pragma mark 获取最近文件数据
  698. - (void)getLastFileDataFun
  699. {
  700. _lastFileDataArr = [lastFileManager shareManager].lastFileListArr;
  701. //HLog(@"%@",_lastFileDataArr);
  702. BOOL isShowLastFileType = [HWDataManager getBoolWithKey:Const_last_file_show];
  703. if(!isShowLastFileType){
  704. _tableHeadView.frame = CGRectMake(0, 0, SCREEN_W,(42+ 14) + 165+ 15 +120 +54 + 15);
  705. [self.NASLastFileV mas_remakeConstraints:^(MASConstraintMaker *make) {
  706. make.top.equalTo(_NASCommonUsedV.mas_bottom).offset(15);
  707. make.left.mas_equalTo(0);
  708. make.right.mas_equalTo(0);
  709. make.height.mas_equalTo(54);
  710. }];
  711. self.NASLastFileV.notDataImageV.hidden = YES;
  712. self.NASLastFileV.notDataLabel.hidden = YES;
  713. //全圆角
  714. UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_W-32 , 54)
  715. byRoundingCorners:UIRectCornerAllCorners
  716. cornerRadii:CGSizeMake(12, 12)];
  717. CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
  718. maskLayer.frame = self.NASLastFileV.bounds;
  719. maskLayer.path = maskPath.CGPath;
  720. self.NASLastFileV.whiteBgView.layer.mask = nil;
  721. self.NASLastFileV.whiteBgView.layer.mask = maskLayer;
  722. _lastFileDataArr = [NSMutableArray new];
  723. }
  724. else if(_lastFileDataArr.count > 0){
  725. _tableHeadView.frame = CGRectMake(0, 0, SCREEN_W,(42+ 14) + 165+ 15 +120 +54 + 15);
  726. [self.NASLastFileV mas_remakeConstraints:^(MASConstraintMaker *make) {
  727. make.top.equalTo(_NASCommonUsedV.mas_bottom).offset(15);
  728. make.left.mas_equalTo(0);
  729. make.right.mas_equalTo(0);
  730. make.height.mas_equalTo(54);
  731. }];
  732. self.NASLastFileV.notDataImageV.hidden = YES;
  733. self.NASLastFileV.notDataLabel.hidden = YES;
  734. /*上圆角*/
  735. UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_W- 32 , 54)
  736. byRoundingCorners:UIRectCornerTopLeft|UIRectCornerTopRight
  737. cornerRadii:CGSizeMake(12, 12)];
  738. CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
  739. maskLayer.frame = CGRectMake(0, 0, SCREEN_W -32, 54);
  740. maskLayer.path = maskPath.CGPath;
  741. self.NASLastFileV.whiteBgView.layer.mask = nil;
  742. self.NASLastFileV.whiteBgView.layer.mask = maskLayer;
  743. }
  744. else{
  745. _tableHeadView.frame = CGRectMake(0, 0, SCREEN_W,(42+ 14) + 165+ 15 +120 +254 + 15);
  746. [self.NASLastFileV mas_remakeConstraints:^(MASConstraintMaker *make) {
  747. make.top.equalTo(_NASCommonUsedV.mas_bottom).offset(15);
  748. make.left.mas_equalTo(0);
  749. make.right.mas_equalTo(0);
  750. make.height.mas_equalTo(254);
  751. }];
  752. self.NASLastFileV.notDataImageV.hidden = NO;
  753. self.NASLastFileV.notDataLabel.hidden = NO;
  754. //全圆角
  755. UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_W-32 , 254)
  756. byRoundingCorners:UIRectCornerAllCorners
  757. cornerRadii:CGSizeMake(12, 12)];
  758. CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
  759. maskLayer.frame = self.NASLastFileV.bounds;
  760. maskLayer.path = maskPath.CGPath;
  761. self.NASLastFileV.whiteBgView.layer.mask = nil;
  762. self.NASLastFileV.whiteBgView.layer.mask = maskLayer;
  763. }
  764. KWeakSelf
  765. dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
  766. if(weakSelf.lastFileDataArr.count > 0){
  767. weakSelf.tableView.tableFooterView = self->tableFooterlabel;
  768. }
  769. else{
  770. weakSelf.tableView.tableFooterView = nil;
  771. }
  772. [weakSelf.tableView reloadData];
  773. });
  774. }
  775. #pragma mark 获取分享开关
  776. -(void)queryShareSwitchFunFun
  777. {
  778. NSMutableDictionary *paraDict = [NSMutableDictionary new];
  779. [paraDict setValue:@7 forKey:@"type"];
  780. //KWeakSelf
  781. [[netWorkManager shareInstance] CommonGetWithCallBackCode:queryShareSwitchFun Parameters:paraDict success:^(id _Nonnull responseObject){
  782. queryShareModel *queryShareMod = [[queryShareModel alloc] initWithDictionary:responseObject error:nil];
  783. if(queryShareMod){
  784. self->canShareType = queryShareMod.data.configValue;
  785. //[weakSelf.curEditTypeBottomView setCanShaewFunBy:queryShareMod.data.configValue];
  786. }
  787. } failure:^(NSError * _Nonnull error) {
  788. }];
  789. }
  790. - (void)checkFileTransferTask
  791. {//有个偶现的闪退在BGFMDB
  792. [[nasUploadFileManager shareInstance] checkHadUploadTaskWithComplete:^(BOOL isSuccess) {
  793. self->hadUploadTaskType = isSuccess;
  794. [self setRightButtonRedTypeFun];
  795. }];
  796. KWeakSelf
  797. dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
  798. [[nasDownloadFileManager shareInstance] checkHadDownloadTaskWithComplete:^(BOOL isSuccess) {
  799. self->hadDownloadTaskType = isSuccess;
  800. [weakSelf setRightButtonRedTypeFun];
  801. }];
  802. });
  803. }
  804. - (void)setRightButtonRedTypeFun
  805. {
  806. mainBlock(^{
  807. if(self->hadUploadTaskType || self->hadDownloadTaskType){
  808. self->rightRedView.hidden = NO;
  809. }
  810. else{
  811. self->rightRedView.hidden = YES;
  812. }
  813. });
  814. }
  815. #pragma mark 是否有新的分享被封禁
  816. -(void)queryShareBeMarkFun
  817. {
  818. NSMutableDictionary *paraDict = [NSMutableDictionary new];
  819. KWeakSelf
  820. [[netWorkManager shareInstance] CommonGetWithCallBackCode:queryShareReportMarkFun Parameters:paraDict success:^(id _Nonnull responseObject){
  821. queryShareReportMarkModel *ShareMarkMod = [[queryShareReportMarkModel alloc] initWithDictionary:responseObject error:nil];
  822. if(ShareMarkMod){
  823. [weakSelf.NASCommonUsedV setRedPointShow:ShareMarkMod.data.reportMark];
  824. }
  825. } failure:^(NSError * _Nonnull error) {
  826. }];
  827. }
  828. #pragma mark 修改分享被封禁的mark状态()
  829. -(void)updateShareBeMarkFun
  830. {
  831. NSMutableDictionary *paraDict = [NSMutableDictionary new];
  832. //KWeakSelf
  833. [[netWorkManager shareInstance] CommonPostCallBackCode:updateShareReportMarkFun Parameters:paraDict success:^(id _Nonnull responseObject){
  834. // SuperModel *ShareMarkMod = [[SuperModel alloc] initWithDictionary:responseObject error:nil];
  835. // if(ShareMarkMod){
  836. //
  837. // }
  838. } failure:^(NSError * _Nonnull error) {
  839. }];
  840. }
  841. #pragma mark 处理音频播放中的视图状态
  842. - (void)handelAudioPlayingViewFun
  843. {
  844. audioPlayingView * audioPlayingV = [audioPlayingView sharedInstance];
  845. if([DFPlayer sharedPlayer].state == DFPlayerStateBuffering
  846. ||[DFPlayer sharedPlayer].state == DFPlayerStatePlaying
  847. ||[DFPlayer sharedPlayer].state == DFPlayerStatePause){//播放中
  848. [self showAudioPlayingViewFun];
  849. }
  850. else{
  851. [self hideAudioPlayingViewFun];
  852. }
  853. KWeakSelf
  854. audioPlayingV.didClickButtonFun = ^(NSInteger tag) {
  855. if(tag == 1){
  856. [weakSelf hideAudioPlayingViewFun];
  857. }
  858. else if(tag == 5){
  859. [weakSelf AudioPlayingGotoAudioPlayerVCFun];
  860. }
  861. };
  862. }
  863. - (void)AudioPlayingGotoAudioPlayerVCFun{
  864. audioPlayerViewController *vc = [audioPlayerViewController new];
  865. vc.isfirstEnterType = NO;
  866. [self.navigationController pushViewController:vc animated:YES];
  867. }
  868. #pragma mark 显示音频播放中的视图
  869. - (void)showAudioPlayingViewFun
  870. {
  871. audioPlayingView * audioPlayingV = [audioPlayingView sharedInstance];
  872. [self.view addSubview:audioPlayingV];
  873. if([DFPlayer sharedPlayer].state == DFPlayerStatePlaying){
  874. [audioPlayingV startRotatingImage];
  875. }
  876. else if ([DFPlayer sharedPlayer].state == DFPlayerStatePause){
  877. [audioPlayingV stopRotatingImage];
  878. }
  879. [audioPlayingV mas_makeConstraints:^(MASConstraintMaker *make) {
  880. make.height.mas_equalTo(49);
  881. make.left.mas_equalTo(0);
  882. make.right.mas_equalTo(0);
  883. make.bottom.mas_equalTo(-TABBARHEIGHT);
  884. }];
  885. [self.tableView mas_remakeConstraints:^(MASConstraintMaker *make) {
  886. make.left.mas_equalTo(0);
  887. make.right.mas_equalTo(0);
  888. make.top.equalTo(welcomeImageV.mas_bottom).offset(20);
  889. make.bottom.mas_equalTo(-TABBARHEIGHT -49);
  890. }];
  891. }
  892. #pragma mark 隐藏音频播放中的视图
  893. - (void)hideAudioPlayingViewFun
  894. {
  895. // audioPlayingView * audioPlayingV = [audioPlayingView sharedInstance];
  896. // [audioPlayingV removeFromSuperview];
  897. [self.tableView mas_remakeConstraints:^(MASConstraintMaker *make) {
  898. make.left.mas_equalTo(0);
  899. make.right.mas_equalTo(0);
  900. make.top.equalTo(welcomeImageV.mas_bottom).offset(20);
  901. make.bottom.mas_equalTo(-TABBARHEIGHT);
  902. }];
  903. }
  904. - (void)applicationDidBecomeActive:(NSNotification *)notification
  905. {
  906. //[self beginShowAlertFun];
  907. //后台回来点击首页无效问题
  908. //self.tableView.userInteractionEnabled = YES;
  909. // [self checkBoxHeartbeatFun];
  910. }
  911. //#pragma mark 检测盒子的心跳情况
  912. //- (void)checkBoxHeartbeatFun
  913. //{
  914. // //2、点击系统升级弹框确定按钮后30分钟内不弹;
  915. // NSNumber *preSecondNum = [HWDataManager getNumberWithKey:stringKeyAddSn(@"disenable_type1_BoxHeartbeat")];
  916. // if(preSecondNum){
  917. // long seconds = [iTools getNowTimeStamp];
  918. // if(seconds - preSecondNum.longValue <= 60*30){
  919. // return;
  920. // }
  921. // }
  922. //
  923. // //3、重启、恢复出厂设备、首次设置密码 3个情况下8分钟之内不弹
  924. // NSNumber *preSecondNum2 = [HWDataManager getNumberWithKey:stringKeyAddSn(@"disenable_type2_BoxHeartbeat")];
  925. // if(preSecondNum2){
  926. // long seconds = [iTools getNowTimeStamp];
  927. // if(seconds - preSecondNum2.longValue <= 60*8){
  928. // return;
  929. // }
  930. // }
  931. //
  932. // if(ksharedAppDelegate.didShowBoxHeartbeatAlertType
  933. // ||[webRtcManager shareManager].isResetingType
  934. // ||[webRtcManager shareManager].isRebootIngType
  935. // || [ksharedAppDelegate didShowImageRenewViewFun]){
  936. // return;
  937. // }
  938. //
  939. // //1.隐私模式密码界面 3秒检测一次是否输入完成密码了
  940. // if(ksharedAppDelegate.isDidShowPwdType){
  941. // KWeakSelf
  942. // dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
  943. // [weakSelf checkBoxHeartbeatFun];
  944. // });
  945. //
  946. // return;
  947. // }
  948. //
  949. // //test code
  950. //// [[BoxHeartbeatAlertTool shareInstance] showBoxHeartbeatAlertFun:2 didClickBut:^(NSInteger tag) {
  951. ////
  952. //// }];
  953. //
  954. // if(ksharedAppDelegate.isWebSockLinkOKAginType && ksharedAppDelegate.cloudPhoneExtraFileListMod){
  955. // return;
  956. // }
  957. //
  958. // NSMutableDictionary *paraDict = [NSMutableDictionary new];
  959. //
  960. // KWeakSelf
  961. // [[netWorkManager shareInstance] CommonGetWithCallBackCode:queryHeartbeat Parameters:paraDict success:^(id _Nonnull responseObject){
  962. // queryHeartbeatModel *heartbeatMod = [[queryHeartbeatModel alloc] initWithDictionary:responseObject error:nil];
  963. // if(heartbeatMod && heartbeatMod.data){
  964. // [weakSelf checkBoxHeartbeatToShowPopViewFunBy:heartbeatMod];
  965. // }
  966. //
  967. // } failure:^(NSError * _Nonnull error) {
  968. // }];
  969. //
  970. //}
  971. //#pragma mark 根据盒子的心跳情况 显示异常谈了
  972. //- (void)checkBoxHeartbeatToShowPopViewFunBy:(queryHeartbeatModel*)heartbeatMod
  973. //{
  974. // if(!heartbeatMod || !heartbeatMod.data){
  975. // return;
  976. // }
  977. //
  978. // if (//!heartbeatMod.data.frpStatus&&
  979. // !heartbeatMod.data.hostAgentStatus
  980. // &&!heartbeatMod.data.containerAgentStatus) {//全部异常
  981. // [[BoxHeartbeatAlertTool shareInstance] showBoxHeartbeatAlertFun:1 didClickBut:^(NSInteger tag) {
  982. //
  983. // }];
  984. // }
  985. // else if (heartbeatMod.data.hostAgentStatus
  986. // //&& !heartbeatMod.data.frpStatus
  987. // && !heartbeatMod.data.containerAgentStatus) {//frp异常
  988. // [[BoxHeartbeatAlertTool shareInstance] showBoxHeartbeatAlertFun:2 didClickBut:^(NSInteger tag) {
  989. //
  990. // }];
  991. // }
  992. //}
  993. #pragma mark 输入密码完成
  994. - (void)didInpuPwdOkFun
  995. {
  996. KWeakSelf
  997. mainBlock(^{
  998. // weakSelf.tableView.userInteractionEnabled = YES;
  999. });
  1000. }
  1001. #pragma mark 点击了搜索
  1002. - (void)gotoSearchVCFun
  1003. {
  1004. NasSearchViewController *vc = [NasSearchViewController new];
  1005. [self pushViewController:vc animated:YES];
  1006. }
  1007. #pragma mark 文件上传跳转上传记录
  1008. - (void)gotoUploadFileRecordByFileAppWithUrls:(NSArray*)urls
  1009. {
  1010. uploadFileRecordViewController *vc = [uploadFileRecordViewController new];
  1011. [self.navigationController pushViewController:vc animated:YES];
  1012. vc.isUploadingType = YES;
  1013. [vc gotoUploadFileByFileApp:urls];
  1014. }
  1015. @end