NASViewController.m 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655
  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. @interface NASViewController ()<UITableViewDelegate,UITableViewDataSource>
  30. {
  31. BOOL canShareType;
  32. }
  33. @property (nonatomic,strong)UITableView*tableView;
  34. @property (nonatomic, strong) UIView*tableHeadView;
  35. @property (nonatomic, strong) NASMySpaceView* NASMySpaceV;
  36. @property (nonatomic, strong) NASCommonUsedView* NASCommonUsedV;
  37. @property (nonatomic,strong)NASLastFileView*NASLastFileV;
  38. @property (nonatomic,strong) NSMutableArray *lastFileDataArr;
  39. @end
  40. @implementation NASViewController
  41. - (void)viewDidLoad {
  42. [super viewDidLoad];
  43. // Do any additional setup after loading the view.
  44. [self.view setBackgroundColor:HWF5F7FAColor];
  45. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(getExtraFilesDoneFun:) name:getExtraFilesDoneNotification object:nil];
  46. [self.toolBar setHidden:YES];
  47. [self.navigationBar setHidden:YES];
  48. [self.navBarBGView setHidden:YES];
  49. [self drawAnyView];
  50. }
  51. - (void)drawAnyView{
  52. //顶底底部图片
  53. UIImageView *topImageV = [UIImageView new];
  54. topImageV.image = [UIImage imageNamed:@"Nas_top_img"];
  55. [self.view addSubview:topImageV];
  56. [topImageV mas_makeConstraints:^(MASConstraintMaker *make) {
  57. make.top.mas_equalTo(0);
  58. make.left.mas_equalTo(0);
  59. make.right.mas_equalTo(0);
  60. make.height.mas_equalTo(280.0*AUTOSCALE);
  61. }];
  62. NSString *welcomeImageStr = @"nas_welcome_cs";
  63. //欢迎
  64. //en-US 英文 ja-JP 日文
  65. NSArray *arLanguages = [[NSUserDefaults standardUserDefaults] objectForKey:@"AppleLanguages"];
  66. NSLog(@"arLanguages:%@",arLanguages);
  67. ///获取设备当前地区的代码和APP语言环境
  68. NSString *languageCode = [NSLocale preferredLanguages][0];
  69. //目前支持 中文(简体 繁体) 英文 日语
  70. if([languageCode rangeOfString:@"zh-Hans"].location != NSNotFound)
  71. {
  72. welcomeImageStr = @"nas_welcome_cs";
  73. }
  74. else if([languageCode rangeOfString:@"zh-Hant"].location != NSNotFound)
  75. {
  76. welcomeImageStr = @"nas_welcome_ct";
  77. }
  78. else{
  79. welcomeImageStr = @"nas_welcome_en";
  80. }
  81. CGFloat imageTopY = 54.0;
  82. UIImageView *welcomeImageV = [UIImageView new];
  83. welcomeImageV.image = [UIImage imageNamed:welcomeImageStr];
  84. [self.view addSubview:welcomeImageV];
  85. [welcomeImageV mas_makeConstraints:^(MASConstraintMaker *make) {
  86. make.top.mas_equalTo(imageTopY);
  87. make.left.mas_equalTo(16);
  88. make.width.mas_equalTo(210);
  89. make.height.mas_equalTo(24);
  90. }];
  91. //添加按钮
  92. UIButton *addButton = [[UIButton alloc] init];
  93. [addButton setBackgroundImage:[UIImage imageNamed:@"nas_add_icon"] forState:UIControlStateNormal];
  94. addButton.tag = 1;
  95. [addButton addTarget:self action:@selector(didClickHeadButtonFun:) forControlEvents:UIControlEventTouchUpInside];
  96. [self.view addSubview:addButton];
  97. [addButton mas_makeConstraints:^(MASConstraintMaker *make) {
  98. make.top.mas_equalTo(imageTopY);
  99. make.right.mas_equalTo(-16);
  100. make.width.mas_equalTo(24);
  101. make.height.mas_equalTo(24);
  102. }];
  103. UIButton *rightTransferListButton = [[UIButton alloc] init];
  104. //[rightTransferListButton setImage:[UIImage imageNamed:@"icon_file_transfer"] forState:UIControlStateNormal];
  105. [rightTransferListButton setBackgroundImage:[UIImage imageNamed:@"icon_file_transfer"] forState:UIControlStateNormal];
  106. rightTransferListButton.tag = 2;
  107. [rightTransferListButton addTarget:self action:@selector(didClickHeadButtonFun:) forControlEvents:UIControlEventTouchUpInside];
  108. [self.view addSubview:rightTransferListButton];
  109. [rightTransferListButton mas_makeConstraints:^(MASConstraintMaker *make) {
  110. make.top.mas_equalTo(imageTopY);
  111. make.right.equalTo(addButton.mas_left).offset(-24);
  112. make.width.mas_equalTo(24);
  113. make.height.mas_equalTo(24);
  114. }];
  115. [self.view addSubview:self.tableView];
  116. [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
  117. make.left.mas_equalTo(0);
  118. make.right.mas_equalTo(0);
  119. make.top.equalTo(welcomeImageV.mas_bottom).offset(20);
  120. make.bottom.mas_equalTo(-TABBARHEIGHT);
  121. }];
  122. _tableHeadView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, 165+ 15 +120 +54 + 15)];
  123. //_tableHeadView.backgroundColor = [UIColor hwColor:@"#F6F8FA"];
  124. _tableHeadView.backgroundColor = [UIColor clearColor];
  125. self.tableView.tableHeaderView = _tableHeadView;
  126. //我的空间
  127. _NASMySpaceV = [[NASMySpaceView alloc] init];
  128. [_tableHeadView addSubview:_NASMySpaceV];
  129. [_NASMySpaceV mas_makeConstraints:^(MASConstraintMaker *make) {
  130. //make.top.equalTo(welcomeImageV.mas_bottom).offset(20);
  131. make.top.mas_equalTo(0);;
  132. make.left.mas_equalTo(0);
  133. make.right.mas_equalTo(0);
  134. make.height.mas_equalTo(165);
  135. }];
  136. //常用功能
  137. _NASCommonUsedV = [[NASCommonUsedView alloc] init];
  138. [_tableHeadView addSubview:_NASCommonUsedV];
  139. [_NASCommonUsedV mas_makeConstraints:^(MASConstraintMaker *make) {
  140. make.top.equalTo(_NASMySpaceV.mas_bottom).offset(15);
  141. make.left.mas_equalTo(0);
  142. make.right.mas_equalTo(0);
  143. make.height.mas_equalTo(120);
  144. }];
  145. //最近文件
  146. [_tableHeadView addSubview:self.NASLastFileV];
  147. [self.NASLastFileV mas_makeConstraints:^(MASConstraintMaker *make) {
  148. make.top.equalTo(_NASCommonUsedV.mas_bottom).offset(15);
  149. make.left.mas_equalTo(0);
  150. make.right.mas_equalTo(0);
  151. make.height.mas_equalTo(54);
  152. }];
  153. BOOL isShowLastFileType = [HWDataManager getBoolWithKey:Const_last_file_show];
  154. self.NASLastFileV.eyeButton.selected = !isShowLastFileType;
  155. //tableFooterView
  156. NSString *text = NSLocalizedString(@"NAS_bottom_tip",nil);
  157. UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, 50)];
  158. label.text = [[NSString alloc] initWithFormat:@"- %@ -",text];
  159. label.textColor = [UIColor hwColor:@"#959799"];
  160. label.font = [UIFont systemFontOfSize:12];
  161. label.textAlignment = NSTextAlignmentCenter;
  162. self.tableView.tableFooterView = label;
  163. KWeakSelf
  164. _NASMySpaceV.didClickButtonFun = ^(NSInteger tag) {
  165. [weakSelf didClickMySpaceFunBy:tag];
  166. };
  167. _NASCommonUsedV.didClickButtonFun = ^(NSInteger tag) {
  168. [weakSelf didClickCommonUsedFunBy:tag];
  169. };
  170. self.NASLastFileV.didClickButtonFun = ^(NSInteger tag) {
  171. [weakSelf didClickLastFileFunBy:tag];
  172. };
  173. [self setMySpaceDataFun];
  174. }
  175. #pragma mark - 懒加载
  176. - (UITableView *)tableView{
  177. if (!_tableView) {
  178. _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, 0, 0) style:UITableViewStylePlain];
  179. _tableView.delegate = self;
  180. _tableView.dataSource = self;
  181. _tableView.showsVerticalScrollIndicator = NO;
  182. _tableView.showsHorizontalScrollIndicator = NO;
  183. // _tableView.contentInset = UIEdgeInsetsMake(-H_STATE_BAR, 0, 0, 0);
  184. [_tableView setSeparatorStyle:(UITableViewCellSeparatorStyleNone)];
  185. [_tableView setSeparatorColor:[UIColor clearColor]];
  186. //[_tableView setBackgroundColor:[UIColor hwColor:@"#FFFFFF"]];
  187. [_tableView setBackgroundColor:[UIColor clearColor]];
  188. //[_tableView setTableFooterView:[UIView new]];
  189. [_tableView setBounces:YES];
  190. if (@available(iOS 15.0, *)) {
  191. _tableView.sectionHeaderTopPadding = 0;
  192. }
  193. _tableView.layer.cornerRadius = 8;
  194. _tableView.layer.masksToBounds = YES;
  195. }
  196. return _tableView;
  197. }
  198. - (NASLastFileView*)NASLastFileV
  199. {
  200. if(!_NASLastFileV){
  201. _NASLastFileV = [NASLastFileView new];
  202. }
  203. return _NASLastFileV;
  204. }
  205. #pragma mark - 列表委托
  206. - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
  207. return 1;
  208. }
  209. - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
  210. if(!_lastFileDataArr){
  211. return 0;
  212. }
  213. return _lastFileDataArr.count;
  214. }
  215. - (lastFileTableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
  216. __block NSInteger row = indexPath.row;
  217. static NSString *identifier = @"lastFileTableViewCell";
  218. lastFileTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:identifier];
  219. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  220. if (!cell){
  221. cell = [[lastFileTableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier];
  222. [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
  223. [cell setBackgroundColor:[UIColor clearColor]];
  224. [cell setAccessoryType:(UITableViewCellAccessoryNone)];
  225. [cell hideCheckButtonBy:YES];
  226. }
  227. if(row < _lastFileDataArr.count){
  228. lastFileModel* dataModel = _lastFileDataArr[row];
  229. cell.curLastFileModel = dataModel;
  230. // KWeakSelf
  231. // cell.didClickSwitch = ^(BOOL SwitchOn) {
  232. // //[weakSelf userCheckFilePreviewByRow:row];
  233. // };
  234. cell.cellBgView.layer.mask = nil;
  235. if(row == _lastFileDataArr.count -1){
  236. /*下圆角*/
  237. UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_W-32 , 84)
  238. byRoundingCorners:UIRectCornerBottomLeft | UIRectCornerBottomRight
  239. cornerRadii:CGSizeMake(12, 12)];
  240. CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
  241. maskLayer.frame = cell.cellBgView.bounds;
  242. maskLayer.path = maskPath.CGPath;
  243. cell.cellBgView.layer.mask = maskLayer;
  244. }
  245. }
  246. return cell;
  247. }
  248. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
  249. return 84;
  250. }
  251. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
  252. {
  253. NSInteger row = indexPath.row;
  254. if(row < _lastFileDataArr.count){
  255. lastFileModel* dataModel = _lastFileDataArr[row];
  256. if([dataModel.type isEqualToString:@"video"]){
  257. videoPlayByAVPlayerViewController *vc = [videoPlayByAVPlayerViewController new];
  258. vc.VideoDataMode = (NASFileAndFolderDataModel*)dataModel;
  259. [self.navigationController pushViewController:vc animated:YES];
  260. }
  261. else if([dataModel.type isEqualToString:@"audio"]){
  262. NSMutableArray *audioDataArr = [NSMutableArray new];
  263. NSInteger index = 0;
  264. for (int i=0; i<_lastFileDataArr.count; i++) {
  265. lastFileModel* audioDataModel = _lastFileDataArr[i];
  266. if([audioDataModel.type isEqualToString:@"audio"]){
  267. if(i == row){
  268. index = audioDataArr.count;
  269. }
  270. [audioDataArr addObject:audioDataModel];
  271. }
  272. }
  273. audioPlayerViewController *vc = [audioPlayerViewController new];
  274. vc.index = index;
  275. vc.audioOutSidedataArray = audioDataArr;
  276. [self.navigationController pushViewController:vc animated:YES];
  277. }
  278. else if([dataModel.type isEqualToString:@"jpg"]){
  279. NSMutableArray *jpgDataArr = [NSMutableArray new];
  280. NSInteger index = 0;
  281. for (int i=0; i<_lastFileDataArr.count; i++) {
  282. lastFileModel* jpgDataModel = _lastFileDataArr[i];
  283. if([jpgDataModel.type isEqualToString:@"jpg"]){
  284. if(i == row){
  285. index = jpgDataArr.count;
  286. }
  287. [jpgDataArr addObject:jpgDataModel];
  288. }
  289. }
  290. imageDetailsScrollViewController *vc = [imageDetailsScrollViewController new];
  291. vc.index = index;
  292. vc.totalDataArr = jpgDataArr;
  293. [self.navigationController pushViewController:vc animated:YES];
  294. vc.canShareType = canShareType;
  295. }
  296. }
  297. }
  298. #pragma mark 点击头部
  299. - (void)didClickHeadButtonFun:(UIButton*)but
  300. {
  301. NSInteger tag = but.tag;
  302. switch (tag) {
  303. case 1:
  304. {
  305. [self userDidClickUploadViewFun];
  306. }
  307. break;
  308. case 2:
  309. {
  310. uploadFileRecordViewController *vc = [uploadFileRecordViewController new];
  311. [self pushViewController:vc animated:YES];
  312. }
  313. break;
  314. default:
  315. break;
  316. }
  317. }
  318. #pragma mark 点击我的空间模块
  319. - (void)didClickMySpaceFunBy:(NSInteger)tag
  320. {
  321. switch (tag)
  322. {
  323. case 1:
  324. {
  325. NASMySpaceViewController *vc = [NASMySpaceViewController new];
  326. [self pushViewController:vc animated:YES];
  327. }
  328. break;
  329. case 10:{
  330. previewImageOrVideoViewController *vc = [previewImageOrVideoViewController new];
  331. vc.isPhotoType = YES;
  332. [self pushViewController:vc animated:YES];
  333. }
  334. break;
  335. case 11:{
  336. // previewImageOrVideoViewController *vc = [previewImageOrVideoViewController new];
  337. // vc.isPhotoType = NO;
  338. // [self pushViewController:vc animated:YES];
  339. NasPreviewVideoViewController *vc = [NasPreviewVideoViewController new];
  340. [self pushViewController:vc animated:YES];
  341. }
  342. break;
  343. case 12:{
  344. previewAudioOrDocumentViewController *vc = [previewAudioOrDocumentViewController new];
  345. vc.isAudioType = YES;
  346. [self pushViewController:vc animated:YES];
  347. }
  348. break;
  349. case 13:{
  350. previewFileAndFolderViewController *vc = [previewFileAndFolderViewController new];
  351. [self pushViewController:vc animated:YES];
  352. }
  353. break;
  354. default:
  355. break;
  356. }
  357. }
  358. #pragma mark 点击常用模块模块
  359. - (void)didClickCommonUsedFunBy:(NSInteger)tag
  360. {
  361. switch (tag)
  362. {
  363. case 10:{
  364. backupsOptionViewController *vc = [backupsOptionViewController new];
  365. [self pushViewController:vc animated:YES];
  366. }
  367. break;
  368. case 11:
  369. {
  370. if(!ksharedAppDelegate.isWebSockLinkOKAginType){
  371. [[iToast makeText:NSLocalizedString(@"check_could_phone_state",nil)] show];
  372. return;
  373. }
  374. fileTransfeSetViewController *nextVC = [fileTransfeSetViewController new];
  375. [self pushViewController:nextVC animated:YES];
  376. }
  377. break;
  378. case 12:{
  379. shareRecordViewController *vc = [shareRecordViewController new];
  380. [self pushViewController:vc animated:YES];
  381. }
  382. break;
  383. default:
  384. break;
  385. }
  386. }
  387. #pragma mark 点击最近文件模块
  388. - (void)didClickLastFileFunBy:(NSInteger)tag
  389. {
  390. if(tag == 2){
  391. [self getLastFileDataFun];
  392. }
  393. else if (tag ==1){
  394. nasLastFileViewController *vc = [nasLastFileViewController new];
  395. [self pushViewController:vc animated:YES];
  396. }
  397. }
  398. #pragma mark 用户点击上传文件
  399. - (void)userDidClickUploadViewFun
  400. {
  401. [self hideTabbarFun];
  402. previewToUploadFileView *previewToUploadFileV = [[previewToUploadFileView alloc] init];
  403. [self.view addSubview:previewToUploadFileV];
  404. [previewToUploadFileV mas_makeConstraints:^(MASConstraintMaker *make) {
  405. make.left.mas_equalTo(0);
  406. make.right.mas_equalTo(0);
  407. make.bottom.mas_equalTo(10);
  408. make.top.mas_equalTo(0);
  409. }];
  410. KWeakSelf
  411. previewToUploadFileV.didClickButtonFun = ^(NSInteger tag) {
  412. [weakSelf gotoUploadFileFunWith:tag];
  413. };
  414. previewToUploadFileV.didClickCloseFun = ^{
  415. [weakSelf showTabbarFun];
  416. };
  417. }
  418. #pragma mark 调整文件上传
  419. - (void)gotoUploadFileFunWith:(NSInteger)tag
  420. {
  421. uploadImageOrVideoViewController *vc = [uploadImageOrVideoViewController new];
  422. if(tag ==10){
  423. vc.isPhotoType = YES;
  424. }
  425. else{
  426. vc.isPhotoType = NO;
  427. }
  428. [self pushViewController:vc animated:YES];
  429. }
  430. #pragma mark 获取到云机基本新
  431. - (void)getExtraFilesDoneFun:(NSNotification*)not
  432. {
  433. [self setMySpaceDataFun];
  434. }
  435. #pragma mark 设置我的空间信息
  436. - (void)setMySpaceDataFun
  437. {
  438. if(ksharedAppDelegate.cloudPhoneExtraFileListMod){
  439. [_NASMySpaceV setProgressFun];
  440. }
  441. }
  442. - (void)viewWillAppear:(BOOL)animated{
  443. [super viewWillAppear:animated];
  444. [self getLastFileDataFun];
  445. [self queryShareSwitchFunFun];
  446. }
  447. - (void)viewWillDisappear:(BOOL)animated{
  448. [super viewWillDisappear:animated];
  449. }
  450. - (void)pushViewController:(UIViewController*)vc animated:(BOOL)animated
  451. {
  452. [self.navigationController pushViewController:vc animated:animated];
  453. //[self hideTabbarFun];
  454. }
  455. - (void)showTabbarFun
  456. {
  457. // 显示 tab bar
  458. self.tabBarController.tabBar.hidden = NO;
  459. }
  460. - (void)hideTabbarFun
  461. {
  462. // 隐藏 tab bar
  463. self.tabBarController.tabBar.hidden = YES;
  464. }
  465. #pragma mark 获取最近文件数据
  466. - (void)getLastFileDataFun
  467. {
  468. _lastFileDataArr = [lastFileManager shareManager].lastFileListArr;
  469. //HLog(@"%@",_lastFileDataArr);
  470. BOOL isShowLastFileType = [HWDataManager getBoolWithKey:Const_last_file_show];
  471. if(!isShowLastFileType){
  472. _tableHeadView.frame = CGRectMake(0, 0, SCREEN_W, 165+ 15 +120 +54 + 15);
  473. [self.NASLastFileV mas_remakeConstraints:^(MASConstraintMaker *make) {
  474. make.top.equalTo(_NASCommonUsedV.mas_bottom).offset(15);
  475. make.left.mas_equalTo(0);
  476. make.right.mas_equalTo(0);
  477. make.height.mas_equalTo(54);
  478. }];
  479. self.NASLastFileV.notDataImageV.hidden = YES;
  480. self.NASLastFileV.notDataLabel.hidden = YES;
  481. //全圆角
  482. UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_W-32 , 54)
  483. byRoundingCorners:UIRectCornerAllCorners
  484. cornerRadii:CGSizeMake(12, 12)];
  485. CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
  486. maskLayer.frame = self.NASLastFileV.bounds;
  487. maskLayer.path = maskPath.CGPath;
  488. self.NASLastFileV.whiteBgView.layer.mask = nil;
  489. self.NASLastFileV.whiteBgView.layer.mask = maskLayer;
  490. _lastFileDataArr = [NSMutableArray new];
  491. }
  492. else if(_lastFileDataArr.count > 0){
  493. _tableHeadView.frame = CGRectMake(0, 0, SCREEN_W, 165+ 15 +120 +54 + 15);
  494. [self.NASLastFileV mas_remakeConstraints:^(MASConstraintMaker *make) {
  495. make.top.equalTo(_NASCommonUsedV.mas_bottom).offset(15);
  496. make.left.mas_equalTo(0);
  497. make.right.mas_equalTo(0);
  498. make.height.mas_equalTo(54);
  499. }];
  500. self.NASLastFileV.notDataImageV.hidden = YES;
  501. self.NASLastFileV.notDataLabel.hidden = YES;
  502. /*上圆角*/
  503. UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_W- 32 , 54)
  504. byRoundingCorners:UIRectCornerTopLeft|UIRectCornerTopRight
  505. cornerRadii:CGSizeMake(12, 12)];
  506. CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
  507. maskLayer.frame = CGRectMake(0, 0, SCREEN_W -32, 54);
  508. maskLayer.path = maskPath.CGPath;
  509. self.NASLastFileV.whiteBgView.layer.mask = nil;
  510. self.NASLastFileV.whiteBgView.layer.mask = maskLayer;
  511. }
  512. else{
  513. _tableHeadView.frame = CGRectMake(0, 0, SCREEN_W, 165+ 15 +120 +254 + 15);
  514. [self.NASLastFileV mas_remakeConstraints:^(MASConstraintMaker *make) {
  515. make.top.equalTo(_NASCommonUsedV.mas_bottom).offset(15);
  516. make.left.mas_equalTo(0);
  517. make.right.mas_equalTo(0);
  518. make.height.mas_equalTo(254);
  519. }];
  520. self.NASLastFileV.notDataImageV.hidden = NO;
  521. self.NASLastFileV.notDataLabel.hidden = NO;
  522. //全圆角
  523. UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_W-32 , 254)
  524. byRoundingCorners:UIRectCornerAllCorners
  525. cornerRadii:CGSizeMake(12, 12)];
  526. CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
  527. maskLayer.frame = self.NASLastFileV.bounds;
  528. maskLayer.path = maskPath.CGPath;
  529. self.NASLastFileV.whiteBgView.layer.mask = nil;
  530. self.NASLastFileV.whiteBgView.layer.mask = maskLayer;
  531. }
  532. [self.tableView reloadData];
  533. }
  534. #pragma mark 获取分享开关
  535. -(void)queryShareSwitchFunFun
  536. {
  537. NSMutableDictionary *paraDict = [NSMutableDictionary new];
  538. [paraDict setValue:@7 forKey:@"type"];
  539. KWeakSelf
  540. [[netWorkManager shareInstance] CommonGetWithCallBackCode:queryShareSwitchFun Parameters:paraDict success:^(id _Nonnull responseObject){
  541. queryShareModel *queryShareMod = [[queryShareModel alloc] initWithDictionary:responseObject error:nil];
  542. if(queryShareMod){
  543. self->canShareType = queryShareMod.data.configValue;
  544. //[weakSelf.curEditTypeBottomView setCanShaewFunBy:queryShareMod.data.configValue];
  545. }
  546. } failure:^(NSError * _Nonnull error) {
  547. }];
  548. }
  549. @end