|
|
@@ -13,10 +13,18 @@
|
|
|
#import "downloadManager.h"
|
|
|
#import "uploadFileRecordViewController.h"
|
|
|
#import "UIScrollView+EmptyDataSet.h"
|
|
|
+#import "diskListBgView.h"
|
|
|
+#import "diskListTableView.h"
|
|
|
|
|
|
@interface downLoadPreviewViewController ()<UITableViewDelegate,UITableViewDataSource,DZNEmptyDataSetSource, DZNEmptyDataSetDelegate>
|
|
|
@property (nonatomic, strong) UITableView *tableView;
|
|
|
+
|
|
|
+@property (strong, nonatomic) UILabel *MytitleLabel;
|
|
|
+@property (strong, nonatomic) UIImageView *selectTip;
|
|
|
@property (nonatomic, strong) UIButton *rightButton;
|
|
|
+@property (nonatomic, strong) diskListBgView *diskListBgV;
|
|
|
+@property (nonatomic, strong) diskListTableView *diskListTableV;
|
|
|
+
|
|
|
@property (nonatomic, strong) downloadFileBottomView *downloadFileBottomV;
|
|
|
@property (nonatomic,assign) BOOL didGetType;
|
|
|
|
|
|
@@ -42,24 +50,7 @@
|
|
|
|
|
|
- (void)drawAnyView{
|
|
|
|
|
|
- _rightButton = [[UIButton alloc] init];
|
|
|
- [_rightButton setTitle:NSLocalizedString(@"File_upload_Record_select_all",nil) forState:UIControlStateNormal];
|
|
|
- [_rightButton setTitle:NSLocalizedString(@"File_upload_cancel_select_all",nil) forState:UIControlStateSelected];
|
|
|
-
|
|
|
- [_rightButton setTitleColor:[UIColor hwColor:@"#01B7EA" alpha:1.0] forState:UIControlStateNormal];
|
|
|
- _rightButton.titleLabel.font = [UIFont systemFontOfSize:18.0];
|
|
|
- _rightButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentRight;
|
|
|
- [_rightButton addTarget:self action:@selector(didClickSelectAllButton:) forControlEvents:UIControlEventTouchUpInside];
|
|
|
- [self.navBarBGView addSubview:_rightButton];
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- [_rightButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
- make.width.mas_equalTo(120);
|
|
|
- make.height.mas_equalTo(40);
|
|
|
- make.right.mas_equalTo(-15);
|
|
|
- make.centerY.mas_equalTo(self.titleLabel.mas_centerY);
|
|
|
- }];
|
|
|
+ [self initNavHeadUIFun];
|
|
|
|
|
|
[self.view addSubview:self.tableView];
|
|
|
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
@@ -88,6 +79,60 @@
|
|
|
|
|
|
}
|
|
|
|
|
|
+- (void)initNavHeadUIFun
|
|
|
+{
|
|
|
+ //title
|
|
|
+ UILabel *titleLabel = [[UILabel alloc] init];
|
|
|
+ titleLabel.textAlignment = NSTextAlignmentCenter;
|
|
|
+ titleLabel.font = [UIFont boldSystemFontOfSize:18.0];
|
|
|
+ titleLabel.textColor = [UIColor blackColor];
|
|
|
+ titleLabel.translatesAutoresizingMaskIntoConstraints = NO;
|
|
|
+ [self.navBarBGView addSubview:titleLabel];
|
|
|
+
|
|
|
+ self.MytitleLabel = titleLabel;
|
|
|
+
|
|
|
+ //selectTipImageView
|
|
|
+ UIImageView *selectTip = [[UIImageView alloc] init];
|
|
|
+ selectTip.image = [UIImage imageNamed:@"upload_image_arrow"];
|
|
|
+ selectTip.translatesAutoresizingMaskIntoConstraints = NO;
|
|
|
+ [self.navBarBGView addSubview:selectTip];
|
|
|
+ self.selectTip = selectTip;
|
|
|
+
|
|
|
+ UIButton *tapBtn = [UIButton buttonWithType:UIButtonTypeCustom];
|
|
|
+ tapBtn.backgroundColor = [UIColor clearColor];
|
|
|
+ tapBtn.translatesAutoresizingMaskIntoConstraints = NO;
|
|
|
+ [tapBtn addTarget:self action:@selector(selectDiskAction:) forControlEvents:UIControlEventTouchUpInside];
|
|
|
+ [self.navBarBGView addSubview:tapBtn];
|
|
|
+
|
|
|
+ [tapBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.centerX.mas_equalTo(self.navBarBGView.mas_centerX);
|
|
|
+ make.centerY.mas_equalTo(self.backBtn.mas_centerY);
|
|
|
+ make.width.mas_equalTo(100);
|
|
|
+ make.height.mas_equalTo(30);
|
|
|
+ }];
|
|
|
+
|
|
|
+ [self setTitleLabelText:@""];
|
|
|
+
|
|
|
+ _rightButton = [[UIButton alloc] init];
|
|
|
+ [_rightButton setTitle:NSLocalizedString(@"File_upload_Record_select_all",nil) forState:UIControlStateNormal];
|
|
|
+ [_rightButton setTitle:NSLocalizedString(@"File_upload_cancel_select_all",nil) forState:UIControlStateSelected];
|
|
|
+
|
|
|
+ [_rightButton setTitleColor:[UIColor hwColor:@"#01B7EA" alpha:1.0] forState:UIControlStateNormal];
|
|
|
+ _rightButton.titleLabel.font = [UIFont systemFontOfSize:18.0];
|
|
|
+ _rightButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentRight;
|
|
|
+ [_rightButton addTarget:self action:@selector(didClickSelectAllButton:) forControlEvents:UIControlEventTouchUpInside];
|
|
|
+ [self.navBarBGView addSubview:_rightButton];
|
|
|
+
|
|
|
+
|
|
|
+ [_rightButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.width.mas_equalTo(120);
|
|
|
+ make.height.mas_equalTo(40);
|
|
|
+ make.right.mas_equalTo(-15);
|
|
|
+ make.centerY.mas_equalTo(self.titleLabel.mas_centerY);
|
|
|
+ }];
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
#pragma mark - 懒加载
|
|
|
- (UITableView *)tableView{
|
|
|
if (!_tableView) {
|
|
|
@@ -115,6 +160,33 @@
|
|
|
return _tableView;
|
|
|
}
|
|
|
|
|
|
+- (diskListBgView*)diskListBgV
|
|
|
+{
|
|
|
+ if(!_diskListBgV){
|
|
|
+ _diskListBgV = [[diskListBgView alloc] initWithFrame:CGRectMake(0, 0, 0, 0)];
|
|
|
+ _diskListBgV.hidden = YES;
|
|
|
+ [self.view addSubview:_diskListBgV];
|
|
|
+
|
|
|
+ [_diskListBgV mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.left.mas_equalTo(0);
|
|
|
+ make.bottom.mas_equalTo(0);
|
|
|
+ make.right.mas_equalTo(0);
|
|
|
+ make.top.mas_equalTo(self.navBarBGView.mas_bottom);
|
|
|
+ }];
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ return _diskListBgV;
|
|
|
+}
|
|
|
+
|
|
|
+- (UITableView *)diskListTableV{
|
|
|
+ if (!_diskListTableV) {
|
|
|
+ _diskListTableV = [[diskListTableView alloc] init];
|
|
|
+//
|
|
|
+ }
|
|
|
+
|
|
|
+ return _tableView;
|
|
|
+}
|
|
|
|
|
|
#pragma mark - 列表委托
|
|
|
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
|
|
|
@@ -211,6 +283,39 @@
|
|
|
[self RefreshBottomViewUIFun];
|
|
|
}
|
|
|
|
|
|
+#pragma mark 设置标题
|
|
|
+- (void)setTitleLabelText:(NSString*)title
|
|
|
+{
|
|
|
+ self.MytitleLabel.text = title;
|
|
|
+
|
|
|
+ CGFloat curWidth = [title boundingRectWithSize:CGSizeMake(SCREEN_W, 30) options:(NSStringDrawingUsesLineFragmentOrigin) attributes:@{NSFontAttributeName:[UIFont boldSystemFontOfSize:18.f]} context:nil].size.width;
|
|
|
+
|
|
|
+ curWidth += 20;
|
|
|
+ //HLog(@"title w:%f",curWidth);
|
|
|
+ [self.MytitleLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.centerX.mas_equalTo(self.navBarBGView.mas_centerX).offset(-10);
|
|
|
+ make.centerY.mas_equalTo(self.backBtn.mas_centerY);
|
|
|
+ make.width.mas_equalTo(curWidth);
|
|
|
+ make.height.mas_equalTo(30);
|
|
|
+ }];
|
|
|
+ //self.MytitleLabel.backgroundColor = [UIColor greenColor];
|
|
|
+
|
|
|
+ [self.selectTip mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.left.mas_equalTo(self.MytitleLabel.mas_right).offset(2);
|
|
|
+ make.centerY.mas_equalTo(self.backBtn.mas_centerY);
|
|
|
+ make.width.mas_equalTo(15);
|
|
|
+ make.height.mas_equalTo(15);
|
|
|
+ }];
|
|
|
+}
|
|
|
+
|
|
|
+#pragma mark 选择硬盘
|
|
|
+- (void)selectDiskAction:(UIButton*)but
|
|
|
+{
|
|
|
+ if(self.diskListBgV.hidden){
|
|
|
+ self.diskListBgV.hidden = NO;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
#pragma mark 刷新底部
|
|
|
- (void)RefreshBottomViewUIFun
|
|
|
{
|
|
|
@@ -232,10 +337,12 @@
|
|
|
|
|
|
if(!_didGetType){
|
|
|
if(_isPhotoType){
|
|
|
- self.titleLabel.text = NSLocalizedString(@"my_set_no_image_upload",nil) ;
|
|
|
+ //self.titleLabel.text = NSLocalizedString(@"my_set_no_image_upload",nil) ;
|
|
|
+ [self setTitleLabelText:NSLocalizedString(@"my_set_no_image_upload",nil)];
|
|
|
}
|
|
|
else{
|
|
|
- self.titleLabel.text = NSLocalizedString(@"my_set_no_video_upload",nil) ;
|
|
|
+ //self.titleLabel.text = NSLocalizedString(@"my_set_no_video_upload",nil) ;
|
|
|
+ [self setTitleLabelText:NSLocalizedString(@"my_set_no_video_upload",nil)];
|
|
|
}
|
|
|
|
|
|
[self searchFileListFun];
|
|
|
@@ -263,7 +370,9 @@
|
|
|
|
|
|
NSMutableArray *filterArr = [NSMutableArray new];
|
|
|
for (couldPhoneFileModel*model in _curCouldPhoneFileListMod.data.list) {
|
|
|
- if(model.length > 1024){
|
|
|
+ //if(model.length > 1024)
|
|
|
+ if(model.length > 1024*50)
|
|
|
+ {
|
|
|
[filterArr addObject:model];
|
|
|
}
|
|
|
}
|