Browse Source

1.上传图片可以在图片浏览页选择路径

huangxiaodong 1 year ago
parent
commit
0d825b3b12

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

@@ -213,7 +213,7 @@
          
     }
     else if(model.curBackupsState == backupsStateUploading
-        //||model.curBackupsState == backupsStateSuspend
+          || model.curBackupsState == backupsStateSuspend
        ){
         [[iToast makeText:NSLocalizedString(@"File_backups_set_default_path_tip",nil)] show];
     }

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

@@ -203,7 +203,7 @@
         }];
     }
     else if(model.curUploadStateType == uploadStateUploading
-        //||model.curUploadStateType == uploadStateSuspend
+        ||model.curUploadStateType == uploadStateSuspend
        ){
         
         [[iToast makeText:NSLocalizedString(@"File_upload_set_default_path_tip",nil)] show];

+ 2 - 0
创维盒子/双子星云手机/Class/Set/uploadFile/fileTransfeSet/fileTransferPathCheckViewController.h

@@ -11,6 +11,8 @@ NS_ASSUME_NONNULL_BEGIN
 
 @interface fileTransferPathCheckViewController : BaseViewController
 @property(nonatomic,assign) NSInteger curType;// 1上传 2是备份
+
+@property (nonatomic,copy) void (^didChangeSavePathFun)(void);
 @end
 
 NS_ASSUME_NONNULL_END

+ 8 - 1
创维盒子/双子星云手机/Class/Set/uploadFile/fileTransfeSet/fileTransferPathCheckViewController.m

@@ -72,7 +72,7 @@
     [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
         make.left.mas_equalTo(0);
         make.right.mas_equalTo(0);
-        make.bottom.mas_equalTo(0);
+        make.bottom.mas_equalTo(-(safeArea -20));
         make.top.equalTo(self.navBarBGView.mas_bottom).offset(10.f);
     }];
     
@@ -122,6 +122,8 @@
         [_tableView setBackgroundColor:[UIColor clearColor]];
         [_tableView setTableFooterView:[UIView new]];
         [_tableView setBounces:YES];
+//        _tableView.layer.cornerRadius = 8;
+//        _tableView.layer.masksToBounds = YES;
         
         if (@available(iOS 15.0, *)) {
             _tableView.sectionHeaderTopPadding = 0;
@@ -264,6 +266,11 @@
         [HWDataManager setStringWithKey:Const_photo_upload_default_path value:cutPath];
     }
     
+    [[iToast makeText:NSLocalizedString(@"save_path_change_suc_tip",nil)] show];
+    if(_didChangeSavePathFun){
+        _didChangeSavePathFun();
+    }
+    
     [self.tableView reloadData];
     
 }

+ 3 - 0
创维盒子/双子星云手机/Class/Set/uploadFile/photoView/uploadFileBottomView.h

@@ -19,6 +19,9 @@ NS_ASSUME_NONNULL_BEGIN
 @property (nonatomic,assign) BOOL isExtraFileAndNotFindPathType;
 //点击上传
 @property (nonatomic,copy) void (^didClickUploadFile)(void);
+@property (nonatomic,copy) void (^didClickbottomFun)(void);
+
+- (void)setSavePathDataFun;
 @end
 
 NS_ASSUME_NONNULL_END

+ 45 - 21
创维盒子/双子星云手机/Class/Set/uploadFile/photoView/uploadFileBottomView.m

@@ -43,27 +43,8 @@
     _uploadFileRoutelabel = [[UILabel alloc] init];
     _uploadFileRoutelabel.font = [UIFont systemFontOfSize:14.0];
     _uploadFileRoutelabel.textColor = [UIColor hwColor:@"#959799" alpha:1.0];
-    
-    NSString *savePath = [HWDataManager getStringWithKey:Const_photo_upload_default_path];
-    if(!savePath||savePath.length == 0){
-        savePath = Const_default_upload_path;
-    }
-    
-    NSString *uploadDefaultPath = savePath;
-    
-    if([uploadDefaultPath containsString:@"mnt/media_rw"]){
-        uploadDefaultPath = [uploadDefaultPath stringByReplacingOccurrencesOfString:@"mnt/media_rw" withString:NSLocalizedString(@"disk_Extra_default_tip",nil)];
-    }
-    else if([uploadDefaultPath containsString:@"storage/emulated/0"]){
-        uploadDefaultPath = [uploadDefaultPath stringByReplacingOccurrencesOfString:@"storage/emulated/0" withString:NSLocalizedString(@"disk_phone_default_tip",nil)];
-    }
-    else if([uploadDefaultPath containsString:@"sdcard"]){
-        uploadDefaultPath = [uploadDefaultPath stringByReplacingOccurrencesOfString:@"sdcard" withString:NSLocalizedString(@"disk_phone_default_tip",nil)];
-    }
-    
-    _uploadFileRoutelabel.text = [[NSString alloc] initWithFormat:@"%@: %@",NSLocalizedString(@"File_upload_path_tip",nil),uploadDefaultPath];
-    
     [self addSubview:_uploadFileRoutelabel];
+    [self setSavePathDataFun];
     
     [_uploadFileRoutelabel mas_makeConstraints:^(MASConstraintMaker *make) {
         make.left.mas_equalTo(15);
@@ -72,6 +53,20 @@
         make.height.mas_equalTo(20);
     }];
     
+    UIView *tapView = [[UIView alloc] init];
+    //tapView.backgroundColor = [UIColor redColor];
+    [self addSubview:tapView];
+    
+    [tapView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(0);
+        make.top.mas_equalTo(0);
+        make.right.mas_equalTo(-110);
+        make.bottom.mas_equalTo(10);
+    }];
+    
+    UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapBottomViewFun)];
+    [tapView addGestureRecognizer:tap];
+    
     //图片上传
     NSString* curImgUploadStr = [[NSString alloc] initWithFormat:@"%@ %@",@"  ",NSLocalizedString(@"my_set_no_File_upload",nil)];
     
@@ -201,11 +196,32 @@
     }
 }
 
+- (void)setSavePathDataFun
+{
+    NSString *savePath = [HWDataManager getStringWithKey:Const_photo_upload_default_path];
+    if(!savePath||savePath.length == 0){
+        savePath = Const_default_upload_path;
+    }
+    
+    NSString *uploadDefaultPath = savePath;
+    
+    if([uploadDefaultPath containsString:@"mnt/media_rw"]){
+        uploadDefaultPath = [uploadDefaultPath stringByReplacingOccurrencesOfString:@"mnt/media_rw" withString:NSLocalizedString(@"disk_Extra_default_tip",nil)];
+    }
+    else if([uploadDefaultPath containsString:@"storage/emulated/0"]){
+        uploadDefaultPath = [uploadDefaultPath stringByReplacingOccurrencesOfString:@"storage/emulated/0" withString:NSLocalizedString(@"disk_phone_default_tip",nil)];
+    }
+    else if([uploadDefaultPath containsString:@"sdcard"]){
+        uploadDefaultPath = [uploadDefaultPath stringByReplacingOccurrencesOfString:@"sdcard" withString:NSLocalizedString(@"disk_phone_default_tip",nil)];
+    }
+    
+    _uploadFileRoutelabel.text = [[NSString alloc] initWithFormat:@"%@: %@",NSLocalizedString(@"File_upload_path_tip",nil),uploadDefaultPath];
+}
 #pragma mark 按钮点击
 - (void)didClickButFun:(UIButton*)but
 {
     if(_isExtraFileAndNotFindPathType){
-        [[iToast makeAttrText:NSLocalizedString(@"upload_file_and_not_path_tip",nil)] show];
+        [[iToast makeText:NSLocalizedString(@"upload_file_and_not_path_tip",nil)] show];
         return;
     }
     
@@ -215,4 +231,12 @@
     }
 }
 
+- (void)tapBottomViewFun
+{
+    if(_didClickbottomFun)
+    {
+        _didClickbottomFun();
+    }
+    
+}
 @end

+ 26 - 2
创维盒子/双子星云手机/Class/Set/uploadFile/uploadImageOrVideoViewController.m

@@ -16,9 +16,12 @@
 #import "TZAssetModel+imageData.h"
 #import "uploadFileRecordViewController.h"
 #import "couldPhoneBaseInfoModel.h"
+#import "fileTransferPathCheckViewController.h"
 
 @interface uploadImageOrVideoViewController ()<AJPhotoGroupViewProtocol,UICollectionViewDataSource,UICollectionViewDelegate,UICollectionViewDelegateFlowLayout>
-
+{
+    couldPhoneBaseInfoModel *baseInfoModel;
+}
 @property (strong, nonatomic) AJPhotoGroupView *photoGroupView;
 @property (strong, nonatomic) UILabel *MytitleLabel;
 @property (strong, nonatomic) UIImageView *selectTip;
@@ -251,6 +254,10 @@
     bottomView.didClickUploadFile = ^{
         [weakSelf gotoUploadFileRecordFun];
     };
+    
+    bottomView.didClickbottomFun = ^{
+        [weakSelf gotofileTransferPathCheckVCFun];
+    };
 }
 
 /**
@@ -557,9 +564,14 @@
 
 - (void)getCouldPhoneBaseInfoFun:(NSNotification*)not
 {
-    couldPhoneBaseInfoModel *baseInfoModel = [not object];
+    baseInfoModel = [not object];
     //HLog(@"%@",baseInfoModel);
     
+    [self handelAfterGetBaseInfoModelData];
+}
+
+- (void)handelAfterGetBaseInfoModelData
+{
     if(!baseInfoModel || ![baseInfoModel isKindOfClass:[couldPhoneBaseInfoModel class]]){
         return;
     }
@@ -615,4 +627,16 @@
     
     [self setDataToBottomViewFun];
 }
+
+- (void)gotofileTransferPathCheckVCFun
+{
+    fileTransferPathCheckViewController *vc = [fileTransferPathCheckViewController new];
+    vc.curType = 1;
+    [self.navigationController pushViewController:vc animated:YES];
+    
+    KWeakSelf
+    vc.didChangeSavePathFun = ^{
+        [weakSelf.uploadFileBottomV setSavePathDataFun];
+    };
+}
 @end

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

@@ -388,3 +388,4 @@
 "disk_insertion_pop_tip_sub2" = "02文件管理";
 "disk_insertion_pop_tip_sub3" = "03文件设置";
 "upload_file_and_not_path_tip" = "磁盘路径不存在,请检查磁盘是否正常连接";
+"save_path_change_suc_tip" = "路径更改已成功";