|
|
@@ -31,6 +31,9 @@
|
|
|
#import "fileTransfeSetViewController.h"
|
|
|
#import "backupsSetViewController.h"
|
|
|
#import "downLoadPreviewViewController.h"
|
|
|
+#import "uploadFileDataModel.h"
|
|
|
+#import "uploadFileManager.h"
|
|
|
+#import "downloadManager.h"
|
|
|
|
|
|
@interface MySetViewController ()<HelpDownScrollViewDelegate,UITableViewDelegate,UITableViewDataSource,ComontAlretViewControllerDelegate>
|
|
|
{
|
|
|
@@ -253,34 +256,86 @@
|
|
|
[[self customTableHeadView] closeImageBackupsFun];
|
|
|
}
|
|
|
|
|
|
+- (void)checkDidHadUploadTaskFunWith:(NSInteger)tag
|
|
|
+{
|
|
|
+ KWeakSelf
|
|
|
+ [[uploadFileManager shareInstance] getDataInDatabaseFun:YES complete:^(NSMutableArray * _Nonnull Arr) {
|
|
|
+ mainBlock(^{
|
|
|
+ if(Arr && Arr.count== 3){
|
|
|
+ NSArray *uploadingArr = Arr.firstObject;
|
|
|
+ if(uploadingArr.count == 0){
|
|
|
+ [weakSelf gotoUploadFileFunWith:tag];
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ [[iToast makeText:NSLocalizedString(@"upload_task_not_done_tip",nil)] show];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ [weakSelf gotoUploadFileFunWith:tag];
|
|
|
+ };
|
|
|
+ });
|
|
|
+
|
|
|
+ }];
|
|
|
+}
|
|
|
+
|
|
|
+- (void)gotoUploadFileFunWith:(NSInteger)tag
|
|
|
+{
|
|
|
+ if(self->_getBaseInfo){
|
|
|
+ self->_getBaseInfo();
|
|
|
+ }
|
|
|
+
|
|
|
+ uploadImageOrVideoViewController *vc = [uploadImageOrVideoViewController new];
|
|
|
+ if(tag ==11){
|
|
|
+ vc.isPhotoType = YES;
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ vc.isPhotoType = NO;
|
|
|
+ }
|
|
|
+ [self.navigationController pushViewController:vc animated:YES];
|
|
|
+}
|
|
|
+
|
|
|
+- (void)checkDidHadDownloadTaskFunWith:(NSInteger)tag
|
|
|
+{
|
|
|
+ KWeakSelf
|
|
|
+ [[downloadManager shareInstance] getDataInDatabaseFun:YES complete:^(NSMutableArray * _Nonnull Arr) {
|
|
|
+ mainBlock(^{
|
|
|
+ if(Arr && Arr.count== 3){
|
|
|
+ NSArray *downloadingArr = Arr.firstObject;
|
|
|
+ if(downloadingArr.count == 0){
|
|
|
+ [weakSelf gotoDownloadFileFunWith:tag];
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ [[iToast makeText:NSLocalizedString(@"download_task_not_done_tip",nil)] show];
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ [weakSelf gotoDownloadFileFunWith:tag];
|
|
|
+ };
|
|
|
+ });
|
|
|
+
|
|
|
+ }];
|
|
|
+}
|
|
|
+- (void)gotoDownloadFileFunWith:(NSInteger)tag
|
|
|
+{
|
|
|
+ downLoadPreviewViewController *vc = [downLoadPreviewViewController new];
|
|
|
+ if(tag ==12){
|
|
|
+ vc.isPhotoType = YES;
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ vc.isPhotoType = NO;
|
|
|
+ }
|
|
|
+
|
|
|
+ [self.navigationController pushViewController:vc animated:YES];
|
|
|
+}
|
|
|
+
|
|
|
#pragma mark 点击图片或者视频
|
|
|
- (void)gotoFileTransferFunBy:(NSInteger)tag
|
|
|
{
|
|
|
if(tag == 11 ||tag == 21){
|
|
|
- if(self->_getBaseInfo){
|
|
|
- self->_getBaseInfo();
|
|
|
- }
|
|
|
-
|
|
|
- uploadImageOrVideoViewController *vc = [uploadImageOrVideoViewController new];
|
|
|
- if(tag ==11){
|
|
|
- vc.isPhotoType = YES;
|
|
|
- }
|
|
|
- else{
|
|
|
- vc.isPhotoType = NO;
|
|
|
- }
|
|
|
- [self.navigationController pushViewController:vc animated:YES];
|
|
|
+ [self checkDidHadUploadTaskFunWith:tag];
|
|
|
}
|
|
|
else if(tag == 12 ||tag == 22){
|
|
|
-
|
|
|
-
|
|
|
- downLoadPreviewViewController *vc = [downLoadPreviewViewController new];
|
|
|
- if(tag ==12){
|
|
|
- vc.isPhotoType = YES;
|
|
|
- }
|
|
|
- else{
|
|
|
- vc.isPhotoType = NO;
|
|
|
- }
|
|
|
- [self.navigationController pushViewController:vc animated:YES];
|
|
|
+ [self checkDidHadDownloadTaskFunWith:tag];
|
|
|
}
|
|
|
}
|
|
|
|