|
@@ -37,9 +37,15 @@
|
|
|
|
|
|
@interface MySetViewController ()<HelpDownScrollViewDelegate,UITableViewDelegate,UITableViewDataSource,ComontAlretViewControllerDelegate>
|
|
|
{
|
|
|
+ UIButton* rightButton;
|
|
|
+ UIView* rightRedView;
|
|
|
+
|
|
|
UILabel *phoneLabel;
|
|
|
UILabel *vipTypeTipsLabel;
|
|
|
UIButton *tvP2PBtn;
|
|
|
+
|
|
|
+ BOOL hadUploadTaskType;
|
|
|
+ BOOL hadDownloadTaskType;
|
|
|
}
|
|
|
@property (nonatomic, strong, nullable) UITableView *tableView;
|
|
|
@property (nonatomic, strong, nullable) mySetHeadView *customTableHeadView;
|
|
@@ -53,6 +59,10 @@
|
|
|
|
|
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(getCouldPhoneTvStatusFun:) name:getCouldPhoneTvStatusNotification object:nil];
|
|
|
|
|
|
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(uploadFileAllTaskDoneNot:) name:uploadFileAllTaskDoneNotification object:nil];
|
|
|
+
|
|
|
+ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(downloadFileAllTaskDoneNot:) name:downloadFileAllTaskDoneNotification object:nil];
|
|
|
+
|
|
|
[self drawAnyView];
|
|
|
}
|
|
|
|
|
@@ -64,6 +74,8 @@
|
|
|
if(_getTvStatus){
|
|
|
_getTvStatus();
|
|
|
}
|
|
|
+
|
|
|
+ [self checkFileTransferTask];
|
|
|
}
|
|
|
|
|
|
- (void)drawAnyView{
|
|
@@ -74,7 +86,7 @@
|
|
|
[self.navBarBGView setHidden:NO];
|
|
|
[self.titleLabel setText:NSLocalizedString(@"more_set",nil)];
|
|
|
|
|
|
- UIButton* rightButton = [[UIButton alloc] init];
|
|
|
+ rightButton = [[UIButton alloc] init];
|
|
|
[rightButton setImage:[UIImage imageNamed:@"icon_file_transfer"] forState:UIControlStateNormal];
|
|
|
[rightButton addTarget:self action:@selector(didiClikRightButFun:) forControlEvents:UIControlEventTouchUpInside];
|
|
|
[self.navBarBGView addSubview:rightButton];
|
|
@@ -86,6 +98,19 @@
|
|
|
make.centerY.mas_equalTo(self.titleLabel.mas_centerY);
|
|
|
}];
|
|
|
|
|
|
+ rightRedView = [[UIView alloc] init];
|
|
|
+ rightRedView.backgroundColor = [UIColor redColor];
|
|
|
+ [rightButton addSubview:rightRedView];
|
|
|
+ rightRedView.layer.cornerRadius = 6;
|
|
|
+ rightRedView.hidden = YES;
|
|
|
+
|
|
|
+ [rightRedView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.width.mas_equalTo(12);
|
|
|
+ make.height.mas_equalTo(12);
|
|
|
+ make.right.mas_equalTo(-10);
|
|
|
+ make.top.mas_equalTo(8);
|
|
|
+ }];
|
|
|
+
|
|
|
[self.view addSubview:self.tableView];
|
|
|
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
make.left.mas_equalTo(0);
|
|
@@ -782,4 +807,43 @@
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+- (void)uploadFileAllTaskDoneNot:(NSNotification*)not
|
|
|
+{
|
|
|
+ hadUploadTaskType = NO;
|
|
|
+ [self setRightButtonRedTypeFun];
|
|
|
+}
|
|
|
+
|
|
|
+- (void)downloadFileAllTaskDoneNot:(NSNotification*)not
|
|
|
+{
|
|
|
+ hadDownloadTaskType = NO;
|
|
|
+ [self setRightButtonRedTypeFun];
|
|
|
+}
|
|
|
+
|
|
|
+- (void)checkFileTransferTask
|
|
|
+{
|
|
|
+ KWeakSelf
|
|
|
+ [[uploadFileManager shareInstance] checkHadUploadTaskWithComplete:^(BOOL isSuccess) {
|
|
|
+ self->hadUploadTaskType = isSuccess;
|
|
|
+ [weakSelf setRightButtonRedTypeFun];
|
|
|
+ }];
|
|
|
+
|
|
|
+ [[downloadManager shareInstance] checkHadDownloadTaskWithComplete:^(BOOL isSuccess) {
|
|
|
+ self->hadDownloadTaskType = isSuccess;
|
|
|
+ [weakSelf setRightButtonRedTypeFun];
|
|
|
+ }];
|
|
|
+}
|
|
|
+
|
|
|
+- (void)setRightButtonRedTypeFun
|
|
|
+{
|
|
|
+ //mainBlock(^{
|
|
|
+ if(hadUploadTaskType || hadDownloadTaskType){
|
|
|
+ rightRedView.hidden = NO;
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ rightRedView.hidden = YES;
|
|
|
+ }
|
|
|
+
|
|
|
+ //});
|
|
|
+}
|
|
|
@end
|