NASViewController.m 43 KB

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