Bläddra i källkod

1.音频记住上传旋转的磁盘路径

huangxiaodong 8 månader sedan
förälder
incheckning
0d67483266

+ 4 - 0
创维盒子/双子星云手机/AppDelegate/Config/Const.h

@@ -168,6 +168,10 @@ UIKIT_EXTERN NSString *const Const_image_pre_disk_check;
 
 /*记录上一次的视频预览磁盘*/
 UIKIT_EXTERN NSString *const Const_video_pre_disk_check;
+
+/*记录上一次的音频预览磁盘*/
+UIKIT_EXTERN NSString *const Const_audio_pre_disk_check;
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 4 - 1
创维盒子/双子星云手机/AppDelegate/Config/Const.m

@@ -164,5 +164,8 @@ NSString *const Const_audio_playMode_record = @"audio_playMode_record";
 NSString *const Const_image_pre_disk_check = @"image_pre_disk_check";
 
 /*记录上一次的视频预览磁盘*/
-NSString *const Const_video_pre_disk_check = @"video_pre_disk_check";;
+NSString *const Const_video_pre_disk_check = @"video_pre_disk_check";
+
+/*记录上一次的音频预览磁盘*/
+NSString *const Const_audio_pre_disk_check = @"audio_pre_disk_check";
 @end

+ 33 - 3
创维盒子/双子星云手机/Class/Set/previewFile/previewAudioOrDocumentViewController.m

@@ -155,9 +155,34 @@
     }
     
     if(arr.count >0){
-        cloudPhoneExtraFileModel *model = arr.firstObject;
-        model.isCheckType = YES;
-        _defaultDiskPath = model.extraPath;
+        //上一次选中的磁盘
+        NSString*preChekDiskStr =  [HWDataManager getStringWithKey:Const_audio_pre_disk_check];
+        
+        //1.没有选择过 默认选择第一次(云机)
+        if(!preChekDiskStr || preChekDiskStr.length == 0){
+            cloudPhoneExtraFileModel *model = arr.firstObject;
+            model.isCheckType = YES;
+            _defaultDiskPath = model.extraPath;
+        }
+        else{//2.选择过 查询磁盘是否还存在
+            BOOL didCheckDisk = NO;
+            for (cloudPhoneExtraFileModel *model in arr) {
+                HLog(@"磁盘路径比较 pre:%@---%@",preChekDiskStr,model.extraPath)
+                if([model.extraPath isEqualToString:preChekDiskStr]){
+                    model.isCheckType = YES;
+                    _defaultDiskPath = model.extraPath;
+                    didCheckDisk = YES;
+                    break;
+                }
+            }
+            
+            //3.选择过 查询磁盘不存在
+            if(!didCheckDisk){
+                cloudPhoneExtraFileModel *model = arr.firstObject;
+                model.isCheckType = YES;
+                _defaultDiskPath = model.extraPath;
+            }
+        }
     }
     _diskListArr = arr;
     [self setTitleAfterGetdiskFun];
@@ -310,6 +335,11 @@
         [_didSelectListArr removeAllObjects];
     }
     
+    //保存选中的磁盘
+    if(pathStr){
+        [HWDataManager setStringWithKey:Const_audio_pre_disk_check value:pathStr];
+    }
+    
     self.defaultDiskPath = pathStr;
     [self getFileListFun];
     [self setTitleAfterGetdiskFun];