|
@@ -13,7 +13,8 @@
|
|
|
|
|
|
@interface backupsFilerecordTableView()<UITableViewDataSource,UITableViewDelegate,DZNEmptyDataSetSource, DZNEmptyDataSetDelegate>
|
|
|
{
|
|
|
-
|
|
|
+ UIView* curTableHeadView;
|
|
|
+ UILabel *titleHeadLabel;
|
|
|
}
|
|
|
|
|
|
|
|
@@ -44,6 +45,8 @@
|
|
|
self.sectionHeaderTopPadding = 0;
|
|
|
}
|
|
|
|
|
|
+ self.scrollEnabled = NO;
|
|
|
+
|
|
|
//空数据引入第三方开源处理
|
|
|
self.emptyDataSetSource = self;
|
|
|
self.emptyDataSetDelegate = self;
|
|
@@ -58,6 +61,33 @@
|
|
|
[self reloadDataFun];
|
|
|
}
|
|
|
|
|
|
+- (void)setTableViewHeadTitleFun
|
|
|
+{
|
|
|
+ if(_curDataArr.count == 0){
|
|
|
+ titleHeadLabel.text = @"";
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ photosBackupsTaskModel *model = _curDataArr.firstObject;
|
|
|
+
|
|
|
+ NSString *text = @"";
|
|
|
+ if(model.curBackupsState == backupsStateUploading
|
|
|
+ ||model.curBackupsState == backupsStateSuspend){
|
|
|
+ text = NSLocalizedString(@"File_Transfer_List_head_title_ing",nil);
|
|
|
+ text = [[NSString alloc] initWithFormat:@"%@(%ld)",text,model.count - model.didBackupsCount - model.failCount];
|
|
|
+ }
|
|
|
+ else if(model.curBackupsState == backupsStateFail){
|
|
|
+ text = NSLocalizedString(@"File_Transfer_List_head_title_fail",nil);
|
|
|
+ text = [[NSString alloc] initWithFormat:@"%@(%ld)",text,model.didBackupsCount];
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ text = NSLocalizedString(@"File_Transfer_List_head_title_done",nil);
|
|
|
+ text = [[NSString alloc] initWithFormat:@"%@(%ld)",text,model.didBackupsCount];
|
|
|
+ }
|
|
|
+
|
|
|
+ titleHeadLabel.text = text;
|
|
|
+}
|
|
|
+
|
|
|
- (void)setCurDataArr:(NSArray *)curDataArr
|
|
|
{
|
|
|
_curDataArr = curDataArr;
|
|
@@ -132,33 +162,13 @@
|
|
|
|
|
|
UIView* headView = [UIView new];
|
|
|
headView.backgroundColor = [UIColor whiteColor];
|
|
|
- UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(15, 0, SCREEN_W -15, 50)];
|
|
|
- titleLabel.font = [UIFont systemFontOfSize:12.0];
|
|
|
- titleLabel.textColor = [UIColor hwColor:@"#666666" alpha:1.0];
|
|
|
- [headView addSubview:titleLabel];
|
|
|
+ titleHeadLabel = [[UILabel alloc] initWithFrame:CGRectMake(15, 0, SCREEN_W -15, 50)];
|
|
|
+ titleHeadLabel.font = [UIFont systemFontOfSize:12.0];
|
|
|
+ titleHeadLabel.textColor = [UIColor hwColor:@"#666666" alpha:1.0];
|
|
|
+ [headView addSubview:titleHeadLabel];
|
|
|
|
|
|
- if(_curDataArr.count == 0){
|
|
|
- return headView;
|
|
|
- }
|
|
|
+ [self setTableViewHeadTitleFun];
|
|
|
|
|
|
- photosBackupsTaskModel *model = _curDataArr.firstObject;
|
|
|
-
|
|
|
- NSString *text = @"";
|
|
|
- if(model.curBackupsState == backupsStateUploading
|
|
|
- ||model.curBackupsState == backupsStateSuspend){
|
|
|
- text = NSLocalizedString(@"File_Transfer_List_head_title_ing",nil);
|
|
|
- text = [[NSString alloc] initWithFormat:@"%@(%ld)",text,model.count - model.didBackupsCount - model.failCount];
|
|
|
- }
|
|
|
- else if(model.curBackupsState == backupsStateFail){
|
|
|
- text = NSLocalizedString(@"File_Transfer_List_head_title_fail",nil);
|
|
|
- text = [[NSString alloc] initWithFormat:@"%@(%ld)",text,model.didBackupsCount];
|
|
|
- }
|
|
|
- else{
|
|
|
- text = NSLocalizedString(@"File_Transfer_List_head_title_done",nil);
|
|
|
- text = [[NSString alloc] initWithFormat:@"%@(%ld)",text,model.didBackupsCount];
|
|
|
- }
|
|
|
-
|
|
|
- titleLabel.text = text;
|
|
|
return headView;
|
|
|
}
|
|
|
|
|
@@ -210,6 +220,7 @@
|
|
|
|
|
|
-(void)reloadDataFun{
|
|
|
mainBlock(^{
|
|
|
+ [self setTableViewHeadTitleFun];
|
|
|
[self reloadData];
|
|
|
});
|
|
|
}
|