|
@@ -6,7 +6,7 @@
|
|
|
//
|
|
|
|
|
|
#import "receiveSaveRecordTableView.h"
|
|
|
-#import "downloadFileRecordCell.h"
|
|
|
+#import "boxReceiveFileRecordCell.h"
|
|
|
#import "UIScrollView+EmptyDataSet.h"
|
|
|
#import "uploadFileRecordTableViewHeadView.h"
|
|
|
|
|
@@ -59,9 +59,13 @@
|
|
|
|
|
|
_outSideDataArr = outSideDataArr;
|
|
|
|
|
|
- _downloadingArr = outSideDataArr[0];
|
|
|
- _downloadDoneArr = outSideDataArr[1];
|
|
|
- _downloadfailArr = outSideDataArr[2];
|
|
|
+ _boxSaveingArr = outSideDataArr[0];
|
|
|
+ _boxSaveDoneArr = outSideDataArr[1];
|
|
|
+ _boxSavefailArr = outSideDataArr[2];
|
|
|
+
|
|
|
+ //test code
|
|
|
+ _boxSaveDoneArr = outSideDataArr[0];
|
|
|
+ _boxSavefailArr = outSideDataArr[0];
|
|
|
|
|
|
[self RefreshAllDataFun];
|
|
|
}
|
|
@@ -70,16 +74,16 @@
|
|
|
{
|
|
|
NSMutableArray *totalArr = [NSMutableArray new];
|
|
|
|
|
|
- if(_downloadingArr.count>0){
|
|
|
- [totalArr addObject:_downloadingArr];
|
|
|
+ if(_boxSaveingArr.count>0){
|
|
|
+ [totalArr addObject:_boxSaveingArr];
|
|
|
}
|
|
|
|
|
|
- if(_downloadfailArr.count>0){
|
|
|
- [totalArr addObject:_downloadfailArr];
|
|
|
+ if(_boxSavefailArr.count>0){
|
|
|
+ [totalArr addObject:_boxSavefailArr];
|
|
|
}
|
|
|
|
|
|
- if(_downloadDoneArr.count>0){
|
|
|
- [totalArr addObject:_downloadDoneArr];
|
|
|
+ if(_boxSaveDoneArr.count>0){
|
|
|
+ [totalArr addObject:_boxSaveDoneArr];
|
|
|
}
|
|
|
|
|
|
_curDataArr = totalArr;
|
|
@@ -107,12 +111,12 @@
|
|
|
|
|
|
NSInteger row = indexPath.row;
|
|
|
NSInteger section = indexPath.section;
|
|
|
- static NSString *identifier = @"downloadFileRecordCell";
|
|
|
+ static NSString *identifier = @"boxReceiveFileRecordCell";
|
|
|
|
|
|
- downloadFileRecordCell * cell = [tableView dequeueReusableCellWithIdentifier:identifier];
|
|
|
+ boxReceiveFileRecordCell * cell = [tableView dequeueReusableCellWithIdentifier:identifier];
|
|
|
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
|
|
if (!cell){
|
|
|
- cell = [[downloadFileRecordCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier];
|
|
|
+ cell = [[boxReceiveFileRecordCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:identifier];
|
|
|
[cell setSelectionStyle:UITableViewCellSelectionStyleNone];
|
|
|
[cell setBackgroundColor:[UIColor clearColor]];
|
|
|
[cell setAccessoryType:(UITableViewCellAccessoryNone)];
|
|
@@ -122,8 +126,8 @@
|
|
|
NSMutableArray *curArr = _curDataArr[section];
|
|
|
|
|
|
if(row < curArr.count){
|
|
|
- couldPhoneFileModel *model = curArr[row];
|
|
|
- cell.curCouldPhoneFileModel = model;
|
|
|
+ ShareFileDataModel *model = curArr[row];
|
|
|
+ cell.curShareFileDataModel = model;
|
|
|
cell.isEditType = _isEditType;
|
|
|
|
|
|
if(_isEditType){
|
|
@@ -137,25 +141,25 @@
|
|
|
|
|
|
KWeakSelf
|
|
|
cell.didLongPressClick = ^{
|
|
|
- [weakSelf didLongPressClickFun];
|
|
|
+ //[weakSelf didLongPressClickFun];
|
|
|
};
|
|
|
|
|
|
cell.didClckSelectBut = ^(BOOL isSelect) {
|
|
|
- [weakSelf selectModelOneByOne:model BySelect:isSelect];
|
|
|
+ // [weakSelf selectModelOneByOne:model BySelect:isSelect];
|
|
|
};
|
|
|
|
|
|
cell.didTapPressClick = ^{
|
|
|
- if(model.curDownloadStateType == downloadStateUploading){
|
|
|
- model.curDownloadStateType = downloadStateSuspend;
|
|
|
- [weakSelf handleDownloadingStateTapFunBy:YES with:model];
|
|
|
- }
|
|
|
- else if(model.curDownloadStateType == downloadStateSuspend){
|
|
|
- model.curDownloadStateType = downloadStateUploading;
|
|
|
- [weakSelf handleDownloadingStateTapFunBy:NO with:model];
|
|
|
- }
|
|
|
- else if(model.curDownloadStateType == downloadStateFail){
|
|
|
- [weakSelf handleUploadFailStateWith:model];
|
|
|
- }
|
|
|
+// if(model.curDownloadStateType == downloadStateUploading){
|
|
|
+// model.curDownloadStateType = downloadStateSuspend;
|
|
|
+// [weakSelf handleDownloadingStateTapFunBy:YES with:model];
|
|
|
+// }
|
|
|
+// else if(model.curDownloadStateType == downloadStateSuspend){
|
|
|
+// model.curDownloadStateType = downloadStateUploading;
|
|
|
+// [weakSelf handleDownloadingStateTapFunBy:NO with:model];
|
|
|
+// }
|
|
|
+// else if(model.curDownloadStateType == downloadStateFail){
|
|
|
+// [weakSelf handleUploadFailStateWith:model];
|
|
|
+// }
|
|
|
};
|
|
|
}
|
|
|
}
|
|
@@ -174,10 +178,10 @@
|
|
|
curType = 2;
|
|
|
}
|
|
|
else if(section == 1){
|
|
|
- if(_downloadingArr.count == 0){
|
|
|
+ if(_boxSaveingArr.count == 0){
|
|
|
curType = 2;
|
|
|
}
|
|
|
- else if(_downloadfailArr.count == 0){
|
|
|
+ else if(_boxSavefailArr.count == 0){
|
|
|
curType = 2;
|
|
|
}
|
|
|
else{
|
|
@@ -185,10 +189,10 @@
|
|
|
}
|
|
|
}
|
|
|
else{
|
|
|
- if(_downloadingArr.count > 0){
|
|
|
+ if(_boxSaveingArr.count > 0){
|
|
|
curType = 0;
|
|
|
}
|
|
|
- else if(_downloadfailArr.count > 0){
|
|
|
+ else if(_boxSavefailArr.count > 0){
|
|
|
curType = 1;
|
|
|
}
|
|
|
else{
|
|
@@ -199,16 +203,15 @@
|
|
|
|
|
|
[self RefresHeadUIFun];
|
|
|
|
|
|
- return [UIView new];
|
|
|
-// if(curType == 2){
|
|
|
-// return _doneHeadView;
|
|
|
-// }
|
|
|
-// else if(curType == 1){
|
|
|
-// return _failHeadView;
|
|
|
-// }
|
|
|
-// else{
|
|
|
-// return _downloadingHeadView;
|
|
|
-// }
|
|
|
+ if(curType == 2){
|
|
|
+ return _doneHeadView;
|
|
|
+ }
|
|
|
+ else if(curType == 1){
|
|
|
+ return _failHeadView;
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ return _boxSaveingHeadView;
|
|
|
+ }
|
|
|
|
|
|
}
|
|
|
|
|
@@ -268,58 +271,62 @@
|
|
|
- (void)initTableHeaderInSectionFun
|
|
|
{
|
|
|
KWeakSelf
|
|
|
-// if(!_downloadingHeadView){
|
|
|
-// _downloadingHeadView = [[uploadFileRecordTableViewHeadView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, 40)];
|
|
|
-// //headView.backgroundColor = [UIColor greenColor];
|
|
|
-//
|
|
|
-// NSString *leftStr = NSLocalizedString(@"File_upload_Record_downloading",nil);
|
|
|
-// NSString *rightStr = NSLocalizedString(@"File_upload_Record_all_suspend",nil);
|
|
|
-// NSString *rightSelectStr = NSLocalizedString(@"File_upload_Record_all_open",nil);
|
|
|
-// NSString *titleStr = [[NSString alloc] initWithFormat:@"%@ (%ld)",leftStr,_downloadingArr.count];
|
|
|
-//
|
|
|
-// _downloadingHeadView.titleLabel.text = titleStr;
|
|
|
-// [_downloadingHeadView.rightButton setTitle:rightStr forState:UIControlStateNormal];
|
|
|
-// [_downloadingHeadView.rightButton setTitle:rightSelectStr forState:UIControlStateSelected];
|
|
|
-//
|
|
|
-// _downloadingHeadView.didClickButFun = ^{
|
|
|
-// [weakSelf didClickRightButtonFun:0];
|
|
|
-// };
|
|
|
-// }
|
|
|
-//
|
|
|
-//
|
|
|
-// if(!_failHeadView){
|
|
|
-// _failHeadView = [[uploadFileRecordTableViewHeadView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, 40)];
|
|
|
-// //headView.backgroundColor = [UIColor greenColor];
|
|
|
-//
|
|
|
-// NSString *leftStr = NSLocalizedString(@"File_upload_Record_download_fail",nil);
|
|
|
-// NSString *rightStr = NSLocalizedString(@"File_upload_Record_clear_Record",nil);
|
|
|
-// NSString *titleStr = [[NSString alloc] initWithFormat:@"%@ (%ld)",leftStr,_downloadfailArr.count];
|
|
|
-//
|
|
|
-// _failHeadView.titleLabel.text = titleStr;
|
|
|
-// [_failHeadView.rightButton setTitle:rightStr forState:UIControlStateNormal];
|
|
|
-//
|
|
|
-// _failHeadView.didClickButFun = ^{
|
|
|
-// [weakSelf didClickRightButtonFun:2];
|
|
|
-// };
|
|
|
-// }
|
|
|
-//
|
|
|
-// if(!_doneHeadView){
|
|
|
-// _doneHeadView = [[uploadFileRecordTableViewHeadView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, 40)];
|
|
|
-// //headView.backgroundColor = [UIColor greenColor];
|
|
|
-//
|
|
|
-// NSString *leftStr = NSLocalizedString(@"File_upload_Record_did_download",nil);
|
|
|
-// NSString *rightStr = NSLocalizedString(@"File_upload_Record_clear_Record",nil);
|
|
|
-// NSString *titleStr = [[NSString alloc] initWithFormat:@"%@ (%ld)",leftStr,_downloadDoneArr.count];
|
|
|
-//
|
|
|
-// _doneHeadView.titleLabel.text = titleStr;
|
|
|
-// [_doneHeadView.rightButton setTitle:rightStr forState:UIControlStateNormal];
|
|
|
-//
|
|
|
-// _doneHeadView.didClickButFun = ^{
|
|
|
-// [weakSelf didClickRightButtonFun:1];
|
|
|
-// };
|
|
|
-// }
|
|
|
-//
|
|
|
-//
|
|
|
+ if(!_boxSaveingHeadView){
|
|
|
+ _boxSaveingHeadView = [[uploadFileRecordTableViewHeadView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, 40)];
|
|
|
+ //headView.backgroundColor = [UIColor greenColor];
|
|
|
+
|
|
|
+ NSString *leftStr = NSLocalizedString(@"box_receive_Record_receiveing",nil);
|
|
|
+ NSString *rightStr = NSLocalizedString(@"File_upload_Record_all_suspend",nil);
|
|
|
+ NSString *rightSelectStr = NSLocalizedString(@"File_upload_Record_all_open",nil);
|
|
|
+ NSString *titleStr = [[NSString alloc] initWithFormat:@"%@ (%ld)",leftStr,_boxSaveingArr.count];
|
|
|
+
|
|
|
+ _boxSaveingHeadView.titleLabel.text = titleStr;
|
|
|
+// [_boxSaveingHeadView.rightButton setTitle:rightStr forState:UIControlStateNormal];
|
|
|
+// [_boxSaveingHeadView.rightButton setTitle:rightSelectStr forState:UIControlStateSelected];
|
|
|
+
|
|
|
+ _boxSaveingHeadView.rightButton.hidden = YES;
|
|
|
+
|
|
|
+ _boxSaveingHeadView.didClickButFun = ^{
|
|
|
+ [weakSelf didClickRightButtonFun:0];
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if(!_failHeadView){
|
|
|
+ _failHeadView = [[uploadFileRecordTableViewHeadView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, 40)];
|
|
|
+ //headView.backgroundColor = [UIColor greenColor];
|
|
|
+
|
|
|
+ NSString *leftStr = NSLocalizedString(@"box_receive_Record_fail",nil);
|
|
|
+ //NSString *rightStr = NSLocalizedString(@"File_upload_Record_clear_Record",nil);
|
|
|
+ NSString *titleStr = [[NSString alloc] initWithFormat:@"%@ (%ld)",leftStr,_boxSavefailArr.count];
|
|
|
+
|
|
|
+ _failHeadView.titleLabel.text = titleStr;
|
|
|
+ //[_failHeadView.rightButton setTitle:rightStr forState:UIControlStateNormal];
|
|
|
+ _failHeadView.rightButton.hidden = YES;
|
|
|
+
|
|
|
+ _failHeadView.didClickButFun = ^{
|
|
|
+ [weakSelf didClickRightButtonFun:2];
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+ if(!_doneHeadView){
|
|
|
+ _doneHeadView = [[uploadFileRecordTableViewHeadView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, 40)];
|
|
|
+ //headView.backgroundColor = [UIColor greenColor];
|
|
|
+
|
|
|
+ NSString *leftStr = NSLocalizedString(@"box_receive_Record_suc",nil);
|
|
|
+ //NSString *rightStr = NSLocalizedString(@"File_upload_Record_clear_Record",nil);
|
|
|
+ NSString *titleStr = [[NSString alloc] initWithFormat:@"%@ (%ld)",leftStr,_boxSaveDoneArr.count];
|
|
|
+
|
|
|
+ _doneHeadView.titleLabel.text = titleStr;
|
|
|
+ //[_doneHeadView.rightButton setTitle:rightStr forState:UIControlStateNormal];
|
|
|
+ _doneHeadView.rightButton.hidden = YES;
|
|
|
+
|
|
|
+ _doneHeadView.didClickButFun = ^{
|
|
|
+ [weakSelf didClickRightButtonFun:1];
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
|
|
|
#pragma mark 点击头部右边按钮
|
|
@@ -334,56 +341,56 @@
|
|
|
-(void)RefresHeadUIFun
|
|
|
{
|
|
|
|
|
|
-// if(_downloadingHeadView){
|
|
|
-// NSString *leftStr = NSLocalizedString(@"File_upload_Record_downloading",nil);
|
|
|
-// NSString *rightStr = NSLocalizedString(@"File_upload_Record_all_suspend",nil);
|
|
|
-// NSString *rightSelectStr = NSLocalizedString(@"File_upload_Record_all_open",nil);
|
|
|
-// NSString *titleStr = [[NSString alloc] initWithFormat:@"%@ (%ld)",leftStr,_downloadingArr.count];
|
|
|
-//
|
|
|
-// _downloadingHeadView.titleLabel.text = titleStr;
|
|
|
-// [_downloadingHeadView.rightButton setTitle:rightStr forState:UIControlStateNormal];
|
|
|
-// [_downloadingHeadView.rightButton setTitle:rightSelectStr forState:UIControlStateSelected];
|
|
|
-//
|
|
|
-// if(_downloadingArr.count == 0){
|
|
|
-// _downloadingHeadView.hidden = YES;
|
|
|
-// }
|
|
|
-// else{
|
|
|
-// _downloadingHeadView.hidden = NO;
|
|
|
-// }
|
|
|
-// }
|
|
|
-//
|
|
|
-//
|
|
|
-// if(_failHeadView){
|
|
|
-// NSString *leftStr = NSLocalizedString(@"File_upload_Record_download_fail",nil);
|
|
|
-// NSString *rightStr = NSLocalizedString(@"File_upload_Record_clear_Record",nil);
|
|
|
-// NSString *titleStr = [[NSString alloc] initWithFormat:@"%@ (%ld)",leftStr,_downloadfailArr.count];
|
|
|
-//
|
|
|
-// _failHeadView.titleLabel.text = titleStr;
|
|
|
-// [_failHeadView.rightButton setTitle:rightStr forState:UIControlStateNormal];
|
|
|
-//
|
|
|
-// if(_downloadfailArr.count == 0){
|
|
|
-// _failHeadView.hidden = YES;
|
|
|
-// }
|
|
|
-// else{
|
|
|
-// _failHeadView.hidden = NO;
|
|
|
-// }
|
|
|
-// }
|
|
|
-//
|
|
|
-// if(_doneHeadView){
|
|
|
-// NSString *leftStr = NSLocalizedString(@"File_upload_Record_did_download",nil);
|
|
|
-// NSString *rightStr = NSLocalizedString(@"File_upload_Record_clear_Record",nil);
|
|
|
-// NSString *titleStr = [[NSString alloc] initWithFormat:@"%@ (%ld)",leftStr,_downloadDoneArr.count];
|
|
|
-//
|
|
|
-// _doneHeadView.titleLabel.text = titleStr;
|
|
|
-// [_doneHeadView.rightButton setTitle:rightStr forState:UIControlStateNormal];
|
|
|
-//
|
|
|
-// if(_downloadDoneArr.count == 0){
|
|
|
-// _doneHeadView.hidden = YES;
|
|
|
-// }
|
|
|
-// else{
|
|
|
-// _doneHeadView.hidden = NO;
|
|
|
-// }
|
|
|
-// }
|
|
|
+ if(_boxSaveingHeadView){
|
|
|
+ NSString *leftStr = NSLocalizedString(@"File_upload_Record_downloading",nil);
|
|
|
+ NSString *rightStr = NSLocalizedString(@"File_upload_Record_all_suspend",nil);
|
|
|
+ NSString *rightSelectStr = NSLocalizedString(@"File_upload_Record_all_open",nil);
|
|
|
+ NSString *titleStr = [[NSString alloc] initWithFormat:@"%@ (%ld)",leftStr,_boxSaveingArr.count];
|
|
|
+
|
|
|
+ _boxSaveingHeadView.titleLabel.text = titleStr;
|
|
|
+ [_boxSaveingHeadView.rightButton setTitle:rightStr forState:UIControlStateNormal];
|
|
|
+ [_boxSaveingHeadView.rightButton setTitle:rightSelectStr forState:UIControlStateSelected];
|
|
|
+
|
|
|
+ if(_boxSavefailArr.count == 0){
|
|
|
+ _boxSaveingHeadView.hidden = YES;
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ _boxSaveingHeadView.hidden = NO;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if(_failHeadView){
|
|
|
+ NSString *leftStr = NSLocalizedString(@"File_upload_Record_download_fail",nil);
|
|
|
+ NSString *rightStr = NSLocalizedString(@"File_upload_Record_clear_Record",nil);
|
|
|
+ NSString *titleStr = [[NSString alloc] initWithFormat:@"%@ (%ld)",leftStr,_boxSavefailArr.count];
|
|
|
+
|
|
|
+ _failHeadView.titleLabel.text = titleStr;
|
|
|
+ [_failHeadView.rightButton setTitle:rightStr forState:UIControlStateNormal];
|
|
|
+
|
|
|
+ if(_boxSavefailArr.count == 0){
|
|
|
+ _failHeadView.hidden = YES;
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ _failHeadView.hidden = NO;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(_doneHeadView){
|
|
|
+ NSString *leftStr = NSLocalizedString(@"File_upload_Record_did_download",nil);
|
|
|
+ NSString *rightStr = NSLocalizedString(@"File_upload_Record_clear_Record",nil);
|
|
|
+ NSString *titleStr = [[NSString alloc] initWithFormat:@"%@ (%ld)",leftStr,_boxSaveDoneArr.count];
|
|
|
+
|
|
|
+ _doneHeadView.titleLabel.text = titleStr;
|
|
|
+ [_doneHeadView.rightButton setTitle:rightStr forState:UIControlStateNormal];
|
|
|
+
|
|
|
+ if(_boxSaveDoneArr.count == 0){
|
|
|
+ _doneHeadView.hidden = YES;
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ _doneHeadView.hidden = NO;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
#pragma mark 点击全选
|
|
@@ -393,9 +400,9 @@
|
|
|
|
|
|
_selectModelArr = [NSMutableArray new];
|
|
|
|
|
|
- [_selectModelArr addObjectsFromArray:_downloadingArr];
|
|
|
- [_selectModelArr addObjectsFromArray:_downloadfailArr];
|
|
|
- [_selectModelArr addObjectsFromArray:_downloadDoneArr];
|
|
|
+ [_selectModelArr addObjectsFromArray:_boxSaveingArr];
|
|
|
+ [_selectModelArr addObjectsFromArray:_boxSavefailArr];
|
|
|
+ [_selectModelArr addObjectsFromArray:_boxSaveDoneArr];
|
|
|
|
|
|
[self reloadDataFun];
|
|
|
}
|