|
@@ -20,6 +20,8 @@
|
|
|
#import "previewToUploadFileView.h"
|
|
#import "previewToUploadFileView.h"
|
|
|
#import "NASMySpaceViewController.h"
|
|
#import "NASMySpaceViewController.h"
|
|
|
#import "NasPreviewVideoViewController.h"
|
|
#import "NasPreviewVideoViewController.h"
|
|
|
|
|
+#import "lastFileManager.h"
|
|
|
|
|
+#import "lastFileTableViewCell.h"
|
|
|
|
|
|
|
|
@interface NASViewController ()<UITableViewDelegate,UITableViewDataSource>
|
|
@interface NASViewController ()<UITableViewDelegate,UITableViewDataSource>
|
|
|
@property (nonatomic,strong)UITableView*tableView;
|
|
@property (nonatomic,strong)UITableView*tableView;
|
|
@@ -29,6 +31,7 @@
|
|
|
@property (nonatomic, strong) NASCommonUsedView* NASCommonUsedV;
|
|
@property (nonatomic, strong) NASCommonUsedView* NASCommonUsedV;
|
|
|
|
|
|
|
|
@property (nonatomic,strong)NASLastFileView*NASLastFileV;
|
|
@property (nonatomic,strong)NASLastFileView*NASLastFileV;
|
|
|
|
|
+@property (nonatomic,strong) NSMutableArray *lastFileDataArr;
|
|
|
@end
|
|
@end
|
|
|
|
|
|
|
|
@implementation NASViewController
|
|
@implementation NASViewController
|
|
@@ -132,7 +135,7 @@
|
|
|
make.bottom.mas_equalTo(-TABBARHEIGHT);
|
|
make.bottom.mas_equalTo(-TABBARHEIGHT);
|
|
|
}];
|
|
}];
|
|
|
|
|
|
|
|
- _tableHeadView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, 165+ 15 +120 + 15)];
|
|
|
|
|
|
|
+ _tableHeadView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, 165+ 15 +120 +54 + 15)];
|
|
|
//_tableHeadView.backgroundColor = [UIColor hwColor:@"#F6F8FA"];
|
|
//_tableHeadView.backgroundColor = [UIColor hwColor:@"#F6F8FA"];
|
|
|
_tableHeadView.backgroundColor = [UIColor clearColor];
|
|
_tableHeadView.backgroundColor = [UIColor clearColor];
|
|
|
self.tableView.tableHeaderView = _tableHeadView;
|
|
self.tableView.tableHeaderView = _tableHeadView;
|
|
@@ -160,6 +163,23 @@
|
|
|
make.height.mas_equalTo(120);
|
|
make.height.mas_equalTo(120);
|
|
|
}];
|
|
}];
|
|
|
|
|
|
|
|
|
|
+ //最近文件
|
|
|
|
|
+ [_tableHeadView addSubview:self.NASLastFileV];
|
|
|
|
|
+ [self.NASLastFileV mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
+ make.top.equalTo(_NASCommonUsedV.mas_bottom).offset(15);
|
|
|
|
|
+ make.left.mas_equalTo(0);
|
|
|
|
|
+ make.right.mas_equalTo(0);
|
|
|
|
|
+ make.height.mas_equalTo(54);
|
|
|
|
|
+ }];
|
|
|
|
|
+
|
|
|
|
|
+ //tableFooterView
|
|
|
|
|
+ NSString *text = NSLocalizedString(@"NAS_bottom_tip",nil);
|
|
|
|
|
+ UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, 50)];
|
|
|
|
|
+ label.text = [[NSString alloc] initWithFormat:@"- %@ -",text];
|
|
|
|
|
+ label.textColor = [UIColor hwColor:@"#959799"];
|
|
|
|
|
+ label.font = [UIFont systemFontOfSize:12];
|
|
|
|
|
+ label.textAlignment = NSTextAlignmentCenter;
|
|
|
|
|
+ self.tableView.tableFooterView = label;
|
|
|
|
|
|
|
|
KWeakSelf
|
|
KWeakSelf
|
|
|
_NASMySpaceV.didClickButtonFun = ^(NSInteger tag) {
|
|
_NASMySpaceV.didClickButtonFun = ^(NSInteger tag) {
|
|
@@ -218,55 +238,53 @@
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
|
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
|
|
- return 0;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-- (shareSecretTableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
|
|
|
|
-
|
|
|
|
|
- __block NSInteger row = indexPath.row;
|
|
|
|
|
- static NSString *identifier = @"shareSecretTableViewCell";
|
|
|
|
|
-
|
|
|
|
|
- shareSecretTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:identifier];
|
|
|
|
|
- cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
|
|
|
|
- if (!cell){
|
|
|
|
|
- cell = [[shareSecretTableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier];
|
|
|
|
|
- [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
|
|
|
|
|
- [cell setBackgroundColor:[UIColor clearColor]];
|
|
|
|
|
- [cell setAccessoryType:(UITableViewCellAccessoryNone)];
|
|
|
|
|
|
|
+ if(!_lastFileDataArr){
|
|
|
|
|
+ return 0;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-// if(row < _didSelectListArr.count){
|
|
|
|
|
-// NASFilePicDataArrModel*dataModel = _didSelectListArr[row];
|
|
|
|
|
-// cell.dataModel = dataModel;
|
|
|
|
|
-// }
|
|
|
|
|
- return cell;
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-- (UIView*)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
|
|
|
|
|
- return self.NASLastFileV;
|
|
|
|
|
|
|
+ return _lastFileDataArr.count;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
|
|
|
|
|
- //return 54;//隐藏
|
|
|
|
|
|
|
+- (lastFileTableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
|
|
|
|
+
|
|
|
|
|
+ __block NSInteger row = indexPath.row;
|
|
|
|
|
+ static NSString *identifier = @"lastFileTableViewCell";
|
|
|
|
|
+
|
|
|
|
|
+ lastFileTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:identifier];
|
|
|
|
|
+ cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
|
|
|
|
+ if (!cell){
|
|
|
|
|
+ cell = [[lastFileTableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier];
|
|
|
|
|
+ [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
|
|
|
|
|
+ [cell setBackgroundColor:[UIColor clearColor]];
|
|
|
|
|
+ [cell setAccessoryType:(UITableViewCellAccessoryNone)];
|
|
|
|
|
+ [cell hideCheckButtonBy:YES];
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- return 54 + 200;//无数据
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-- (UIView*)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
|
|
|
|
|
-{
|
|
|
|
|
- NSString *text = NSLocalizedString(@"NAS_bottom_tip",nil);
|
|
|
|
|
- UILabel *label = [[UILabel alloc] init];
|
|
|
|
|
- label.text = [[NSString alloc] initWithFormat:@"- %@ -",text];
|
|
|
|
|
- label.textColor = [UIColor hwColor:@"#959799"];
|
|
|
|
|
- label.font = [UIFont systemFontOfSize:12];
|
|
|
|
|
- label.textAlignment = NSTextAlignmentCenter;
|
|
|
|
|
|
|
+ if(row < _lastFileDataArr.count){
|
|
|
|
|
+ lastFileModel* dataModel = _lastFileDataArr[row];
|
|
|
|
|
+ cell.curLastFileModel = dataModel;
|
|
|
|
|
+
|
|
|
|
|
+ // KWeakSelf
|
|
|
|
|
+ // cell.didClickSwitch = ^(BOOL SwitchOn) {
|
|
|
|
|
+ // //[weakSelf userCheckFilePreviewByRow:row];
|
|
|
|
|
+ // };
|
|
|
|
|
+
|
|
|
|
|
+ if(row == _lastFileDataArr.count -1){
|
|
|
|
|
+ /*下圆角*/
|
|
|
|
|
+ UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_W-32 , 84)
|
|
|
|
|
+ byRoundingCorners:UIRectCornerBottomLeft | UIRectCornerBottomRight
|
|
|
|
|
+ cornerRadii:CGSizeMake(12, 12)];
|
|
|
|
|
+ CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
|
|
|
|
|
+ maskLayer.frame = cell.cellBgView.bounds;
|
|
|
|
|
+ maskLayer.path = maskPath.CGPath;
|
|
|
|
|
+ cell.cellBgView.layer.mask = maskLayer;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- return label;
|
|
|
|
|
|
|
+ return cell;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
|
|
|
|
|
- return 60.0;
|
|
|
|
|
|
|
+- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
|
|
|
|
|
+ return 84;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
#pragma mark 点击头部
|
|
#pragma mark 点击头部
|
|
@@ -426,7 +444,7 @@
|
|
|
|
|
|
|
|
- (void)viewWillAppear:(BOOL)animated{
|
|
- (void)viewWillAppear:(BOOL)animated{
|
|
|
[super viewWillAppear:animated];
|
|
[super viewWillAppear:animated];
|
|
|
-
|
|
|
|
|
|
|
+ [self getLastFileDataFun];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- (void)viewWillDisappear:(BOOL)animated{
|
|
- (void)viewWillDisappear:(BOOL)animated{
|
|
@@ -450,4 +468,59 @@
|
|
|
// 隐藏 tab bar
|
|
// 隐藏 tab bar
|
|
|
self.tabBarController.tabBar.hidden = YES;
|
|
self.tabBarController.tabBar.hidden = YES;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+#pragma mark 获取最近文件数据
|
|
|
|
|
+- (void)getLastFileDataFun
|
|
|
|
|
+{
|
|
|
|
|
+ _lastFileDataArr = [lastFileManager shareManager].lastFileListArr;
|
|
|
|
|
+ //HLog(@"%@",_lastFileDataArr);
|
|
|
|
|
+
|
|
|
|
|
+ if(_lastFileDataArr.count > 0){
|
|
|
|
|
+ _tableHeadView.frame = CGRectMake(0, 0, SCREEN_W, 165+ 15 +120 +54 + 15);
|
|
|
|
|
+
|
|
|
|
|
+ [self.NASLastFileV mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
+ make.top.equalTo(_NASCommonUsedV.mas_bottom).offset(15);
|
|
|
|
|
+ make.left.mas_equalTo(0);
|
|
|
|
|
+ make.right.mas_equalTo(0);
|
|
|
|
|
+ make.height.mas_equalTo(54);
|
|
|
|
|
+ }];
|
|
|
|
|
+
|
|
|
|
|
+ self.NASLastFileV.notDataImageV.hidden = YES;
|
|
|
|
|
+ self.NASLastFileV.notDataLabel.hidden = YES;
|
|
|
|
|
+
|
|
|
|
|
+// /*上圆角*/
|
|
|
|
|
+// UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_W- 32 , 54)
|
|
|
|
|
+// byRoundingCorners:UIRectCornerAllCorners
|
|
|
|
|
+// cornerRadii:CGSizeMake(12, 12)];
|
|
|
|
|
+// CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
|
|
|
|
|
+// //maskLayer.frame = self.NASLastFileV.bounds;
|
|
|
|
|
+// maskLayer.frame = CGRectMake(0, 0, SCREEN_W -32, 54);
|
|
|
|
|
+// maskLayer.path = maskPath.CGPath;
|
|
|
|
|
+// self.NASLastFileV.layer.mask = maskLayer;
|
|
|
|
|
+ }
|
|
|
|
|
+ else{
|
|
|
|
|
+ _tableHeadView.frame = CGRectMake(0, 0, SCREEN_W, 165+ 15 +120 +254 + 15);
|
|
|
|
|
+
|
|
|
|
|
+ [self.NASLastFileV mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
+ make.top.equalTo(_NASCommonUsedV.mas_bottom).offset(15);
|
|
|
|
|
+ make.left.mas_equalTo(0);
|
|
|
|
|
+ make.right.mas_equalTo(0);
|
|
|
|
|
+ make.height.mas_equalTo(254);
|
|
|
|
|
+ }];
|
|
|
|
|
+
|
|
|
|
|
+ self.NASLastFileV.notDataImageV.hidden = NO;
|
|
|
|
|
+ self.NASLastFileV.notDataLabel.hidden = NO;
|
|
|
|
|
+
|
|
|
|
|
+ //全圆角
|
|
|
|
|
+ UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_W-32 , 254)
|
|
|
|
|
+ byRoundingCorners:UIRectCornerAllCorners
|
|
|
|
|
+ cornerRadii:CGSizeMake(12, 12)];
|
|
|
|
|
+ CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
|
|
|
|
|
+ maskLayer.frame = self.NASLastFileV.bounds;
|
|
|
|
|
+ maskLayer.path = maskPath.CGPath;
|
|
|
|
|
+ self.NASLastFileV.whiteBgView.layer.mask = maskLayer;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ [self.tableView reloadData];
|
|
|
|
|
+}
|
|
|
@end
|
|
@end
|