|
|
@@ -8,10 +8,17 @@
|
|
|
#import "NASViewController.h"
|
|
|
#import "NASMySpaceView.h"
|
|
|
#import "NASCommonUsedView.h"
|
|
|
+#import "shareSecretTableViewCell.h"
|
|
|
+#import "NASLastFileView.h"
|
|
|
|
|
|
-@interface NASViewController ()
|
|
|
+@interface NASViewController ()<UITableViewDelegate,UITableViewDataSource>
|
|
|
+@property (nonatomic,strong)UITableView*tableView;
|
|
|
+
|
|
|
+@property (nonatomic, strong) UIView*tableHeadView;
|
|
|
@property (nonatomic, strong) NASMySpaceView* NASMySpaceV;
|
|
|
@property (nonatomic, strong) NASCommonUsedView* NASCommonUsedV;
|
|
|
+
|
|
|
+@property (nonatomic,strong)NASLastFileView*NASLastFileV;
|
|
|
@end
|
|
|
|
|
|
@implementation NASViewController
|
|
|
@@ -101,12 +108,27 @@
|
|
|
make.height.mas_equalTo(24);
|
|
|
}];
|
|
|
|
|
|
+
|
|
|
+ [self.view addSubview:self.tableView];
|
|
|
+ [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.left.mas_equalTo(0);
|
|
|
+ make.right.mas_equalTo(0);
|
|
|
+ make.top.equalTo(welcomeImageV.mas_bottom).offset(20);
|
|
|
+ make.bottom.mas_equalTo(-TABBARHEIGHT);
|
|
|
+ }];
|
|
|
+
|
|
|
+ _tableHeadView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, 165+ 15 +120 + 15)];
|
|
|
+ //_tableHeadView.backgroundColor = [UIColor hwColor:@"#F6F8FA"];
|
|
|
+ _tableHeadView.backgroundColor = [UIColor clearColor];
|
|
|
+ self.tableView.tableHeaderView = _tableHeadView;
|
|
|
+
|
|
|
//我的空间
|
|
|
_NASMySpaceV = [[NASMySpaceView alloc] init];
|
|
|
- [self.view addSubview:_NASMySpaceV];
|
|
|
+ [_tableHeadView addSubview:_NASMySpaceV];
|
|
|
|
|
|
[_NASMySpaceV mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
- make.top.equalTo(welcomeImageV.mas_bottom).offset(20);
|
|
|
+ //make.top.equalTo(welcomeImageV.mas_bottom).offset(20);
|
|
|
+ make.top.mas_equalTo(0);;
|
|
|
make.left.mas_equalTo(0);
|
|
|
make.right.mas_equalTo(0);
|
|
|
make.height.mas_equalTo(165);
|
|
|
@@ -114,7 +136,7 @@
|
|
|
|
|
|
//常用功能
|
|
|
_NASCommonUsedV = [[NASCommonUsedView alloc] init];
|
|
|
- [self.view addSubview:_NASCommonUsedV];
|
|
|
+ [_tableHeadView addSubview:_NASCommonUsedV];
|
|
|
|
|
|
[_NASCommonUsedV mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
make.top.equalTo(_NASMySpaceV.mas_bottom).offset(15);
|
|
|
@@ -123,8 +145,97 @@
|
|
|
make.height.mas_equalTo(120);
|
|
|
}];
|
|
|
|
|
|
+}
|
|
|
+
|
|
|
+#pragma mark - 懒加载
|
|
|
+- (UITableView *)tableView{
|
|
|
+ if (!_tableView) {
|
|
|
+ _tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, 0, 0) style:UITableViewStylePlain];
|
|
|
+ _tableView.delegate = self;
|
|
|
+ _tableView.dataSource = self;
|
|
|
+ _tableView.showsVerticalScrollIndicator = NO;
|
|
|
+ _tableView.showsHorizontalScrollIndicator = NO;
|
|
|
+// _tableView.contentInset = UIEdgeInsetsMake(-H_STATE_BAR, 0, 0, 0);
|
|
|
+ [_tableView setSeparatorStyle:(UITableViewCellSeparatorStyleNone)];
|
|
|
+ [_tableView setSeparatorColor:[UIColor clearColor]];
|
|
|
+ //[_tableView setBackgroundColor:[UIColor hwColor:@"#FFFFFF"]];
|
|
|
+ [_tableView setBackgroundColor:[UIColor clearColor]];
|
|
|
+ //[_tableView setTableFooterView:[UIView new]];
|
|
|
+ [_tableView setBounces:YES];
|
|
|
+
|
|
|
+ if (@available(iOS 15.0, *)) {
|
|
|
+ _tableView.sectionHeaderTopPadding = 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ _tableView.layer.cornerRadius = 8;
|
|
|
+ _tableView.layer.masksToBounds = YES;
|
|
|
+ }
|
|
|
+
|
|
|
+ return _tableView;
|
|
|
+}
|
|
|
+
|
|
|
+- (NASLastFileView*)NASLastFileV
|
|
|
+{
|
|
|
+ if(!_NASLastFileV){
|
|
|
+ _NASLastFileV = [NASLastFileView new];
|
|
|
+ }
|
|
|
+ return _NASLastFileV;
|
|
|
+}
|
|
|
+
|
|
|
+#pragma mark - 列表委托
|
|
|
+- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
|
|
|
+ return 1;
|
|
|
+}
|
|
|
+
|
|
|
+- (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(row < _didSelectListArr.count){
|
|
|
+// NASFilePicDataArrModel*dataModel = _didSelectListArr[row];
|
|
|
+// cell.dataModel = dataModel;
|
|
|
+// }
|
|
|
+ return cell;
|
|
|
+}
|
|
|
+
|
|
|
+- (UIView*)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
|
|
|
+ return self.NASLastFileV;
|
|
|
+}
|
|
|
+
|
|
|
+- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
|
|
|
+ //return 54;//隐藏
|
|
|
|
|
|
+ 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;
|
|
|
+
|
|
|
+ return label;
|
|
|
+}
|
|
|
|
|
|
+- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
|
|
|
+ return 60.0;
|
|
|
+}
|
|
|
@end
|