Procházet zdrojové kódy

1.上传下载任务未完成 禁止更换路径

huangxiaodong před 1 rokem
rodič
revize
17629782d3

+ 34 - 2
创维盒子/双子星云手机/Class/Set/uploadFile/fileTransfeSet/backupsSetViewController.m

@@ -169,13 +169,45 @@
 #pragma mark 尾部事件
 - (void)didClickTailViewFun
 {
+    
     photosBackupsTaskModel* model = [backupsFileManager shareInstance].curPhotosBackupsTaskMod;
     
-    if(model && model.curBackupsState == backupsStateUploading){
+    if(!model){
+        KWeakSelf
+        [photosBackupsTaskModel bg_findAsync:backups_photos_tableName limit:1 orderBy:nil desc:YES complete:^(NSArray * _Nullable array) {
+            mainBlock(^{
+                if(array && array.count > 0){
+                    photosBackupsTaskModel *preModel = array.lastObject;
+                    if(preModel.curBackupsState == backupsStateUploading
+                        ||preModel.curBackupsState == backupsStateSuspend
+                       ){
+                        [[iToast makeText:NSLocalizedString(@"File_backups_set_default_path_tip",nil)] show];
+                    }
+                    else{
+                        [self gotofileTransferPathCheckVCFun];
+                    }
+                }
+                else{
+                    [self gotofileTransferPathCheckVCFun];
+                }
+            });
+                
+        }];
+         
+    }
+    else if(model.curBackupsState == backupsStateUploading
+        ||model.curBackupsState == backupsStateSuspend
+       ){
         [[iToast makeText:NSLocalizedString(@"File_backups_set_default_path_tip",nil)] show];
-        return;
+    }
+    else{
+        [self gotofileTransferPathCheckVCFun];
     }
     
+}
+
+- (void)gotofileTransferPathCheckVCFun
+{
     fileTransferPathCheckViewController *vc = [fileTransferPathCheckViewController new];
     vc.curType = 2;
     [self.navigationController pushViewController:vc animated:YES];

+ 33 - 0
创维盒子/双子星云手机/Class/Set/uploadFile/fileTransfeSet/fileTransfeSetViewController.m

@@ -8,6 +8,7 @@
 #import "fileTransfeSetViewController.h"
 #import "fileSetTableViewCell.h"
 #import "fileTransferPathCheckViewController.h"
+#import "uploadFileManager.h"
 
 @interface fileTransfeSetViewController ()<UITableViewDelegate,UITableViewDataSource>
 @property (nonatomic, strong) UITableView *tableView;
@@ -166,6 +167,38 @@
 #pragma mark 尾部事件
 - (void)didClickTailViewFun
 {
+    uploadFileDataModel* model = [uploadFileManager shareInstance].curUploadFileDataModel;
+    
+    if(!model){
+        [[uploadFileManager shareInstance] getDataInDatabaseFun:YES complete:^(NSMutableArray * _Nonnull Arr) {
+            mainBlock(^{
+                if(Arr && Arr.count== 3){
+                    NSArray *uploadingArr = Arr.firstObject;
+                    if(uploadingArr.count == 0){
+                        [self gotofileTransferPathCheckVCFun];
+                    }
+                    else{
+                        [[iToast makeText:NSLocalizedString(@"File_upload_set_default_path_tip",nil)] show];
+                    }
+                }
+            });
+            
+        }];
+    }
+    else if(model.curUploadStateType == uploadStateUploading
+        ||model.curUploadStateType == uploadStateSuspend
+       ){
+        
+        [[iToast makeText:NSLocalizedString(@"File_upload_set_default_path_tip",nil)] show];
+    }
+    else{
+        [self gotofileTransferPathCheckVCFun];
+    }
+
+}
+
+- (void)gotofileTransferPathCheckVCFun
+{
     fileTransferPathCheckViewController *vc = [fileTransferPathCheckViewController new];
     vc.curType = 1;
     [self.navigationController pushViewController:vc animated:YES];

+ 1 - 1
创维盒子/双子星云手机/en.lproj/Localizable.strings

@@ -359,7 +359,7 @@
 "File_Transfer_List_head_title_fail"   = "Transfer failed";
 "File_Transfer_List_head_title_done"   = "completed";
 "File_backups_Record_tip_Suspend"   = "Paused";
-"File_backups_set_default_path_tip"   = "Please stop the backup operation before changing the path";
+"File_backups_set_default_path_tip"   = "Please complete the backup operation before changing the path";
 "File_download_Path_default"   = "Download path  album";
 "File_download_Path_default_done"   = "Download to: Album";
 "File_download_file_no_data"   = "No files to download yet";

+ 1 - 1
创维盒子/双子星云手机/ja.lproj/Localizable.strings

@@ -358,7 +358,7 @@
 "File_Transfer_List_head_title_fail"   = "転送に失敗しました";
 "File_Transfer_List_head_title_done"   = "完成した";
 "File_backups_Record_tip_Suspend"   = "一時停止中";
-"File_backups_set_default_path_tip"   = "パスを変更する前にバックアップ操作を停止してください";
+"File_backups_set_default_path_tip"   = "パスを変更するには、バックアップ操作を完了してください";
 "File_download_Path_default"   = "ダウンロードパス   アルバム";
 "File_download_Path_default_done"   = "ダウンロード先: アルバム";
 "File_download_file_no_data"   = "ダウンロードするファイルはまだありません";

+ 2 - 1
创维盒子/双子星云手机/zh-Hans.lproj/Localizable.strings

@@ -358,7 +358,7 @@
 "File_Transfer_List_head_title_fail"   = "传输失败";
 "File_Transfer_List_head_title_done"   = "已完成";
 "File_backups_Record_tip_Suspend"   = "已暂停";
-"File_backups_set_default_path_tip"   = "请停止备份操作后再更改路径";
+"File_backups_set_default_path_tip"   = "请完成备份操作后再更改路径";
 "File_download_Path_default"   = "下载路径  相册";
 "File_download_Path_default_done"   = "下载到:相册";
 "File_download_file_no_data"   = "暂无文件下载";
@@ -374,3 +374,4 @@
 "File_upload_path_tip"   = "上传路径";
 "File_upload_to_tip"   = "上传到";
 "disk_not_find_tip"   = "找不到对应的外挂磁盘";
+"File_upload_set_default_path_tip"   = "请完成上传操作后再更改路径";

+ 1 - 1
创维盒子/双子星云手机/zh-Hant.lproj/Localizable.strings

@@ -358,7 +358,7 @@
 "File_Transfer_List_head_title_fail"   = "傳輸失敗";
 "File_Transfer_List_head_title_done"   = "已完成";
 "File_backups_Record_tip_Suspend"   = "已暫停";
-"File_backups_set_default_path_tip"   = "請停止備份作業後再更改路徑";
+"File_backups_set_default_path_tip"   = "請完成備份操作後再更改路徑";
 "File_download_Path_default"   = "下載路徑 相簿";
 "File_download_Path_default_done"   = "下載到:相簿";
 "File_download_file_no_data"   = "暫無檔案下載";