浏览代码

1.接收路径设置

huangxiaodong 1 年之前
父节点
当前提交
59ddd32713

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

@@ -16,6 +16,7 @@
 @property (nonatomic, strong) UIView *tailView;
 @property (nonatomic, strong) UILabel *uploadFilePathLabel;
 @property (nonatomic, strong) UILabel *backupsFilePathLabel;
+@property (nonatomic, strong) UILabel *saveBoxFilePathLabel;
 @end
 
 @implementation fileTransfeSetViewController
@@ -84,7 +85,7 @@
 #pragma mark - 懒加载
 - (UIView *)tailView{
     if (!_tailView) {
-        _tailView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, 110 +15 + 110)];
+        _tailView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, 90 + 15 + 90 + 15 + 90 + 15)];
         
         UIView *tailBgView = [[UIView alloc] init];
         tailBgView.backgroundColor = [UIColor whiteColor];
@@ -200,6 +201,64 @@
         }];
         
         [self setBackupsFilePathLabelTitleFun];
+        
+        ////相册备份设置
+        UIView *tailBgView3 = [[UIView alloc] init];
+        tailBgView3.backgroundColor = [UIColor whiteColor];
+        tailBgView3.layer.cornerRadius = 8;
+        tailBgView3.tag = 3;
+        [_tailView addSubview:tailBgView3];
+        
+        UITapGestureRecognizer *tap3 = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didClickTailViewFun:)];
+        [tailBgView3 addGestureRecognizer:tap3];
+        
+        [tailBgView3 mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.left.mas_equalTo(15);
+            make.right.mas_equalTo(-15);
+            make.height.mas_equalTo(90);
+            make.top.mas_equalTo(tailBgView2.mas_bottom).offset(15.0);
+        }];
+        
+        UILabel *titleLab3 = [[UILabel alloc] init];
+        titleLab3.text = NSLocalizedString(@"File_save_to_box_path_set",nil);
+        titleLab3.font = [UIFont boldSystemFontOfSize:14.0];
+        titleLab3.textColor = [UIColor hwColor:@"#0A132B" alpha:1.0];
+        [tailBgView3 addSubview:titleLab3];
+        
+        [titleLab3 mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.left.mas_equalTo(10);
+            make.right.mas_equalTo(-50);
+            make.height.mas_equalTo(20);
+            make.top.mas_equalTo(20);
+        }];
+        
+        /*右侧箭头*/
+        UIImageView *rightImage3 = [[UIImageView alloc] init];
+        [rightImage3 setBackgroundColor:[UIColor clearColor]];
+        [rightImage3 setImage:[UIImage imageNamed:@"cell_right_access"]];
+        [tailBgView3 addSubview:rightImage3];
+        [rightImage3 mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.width.mas_equalTo(28);
+            make.right.mas_equalTo(-15.f);
+            make.height.mas_equalTo(28);
+            make.centerY.equalTo(titleLab3.mas_centerY);
+        }];
+        
+        _saveBoxFilePathLabel=[[UILabel alloc] init];
+        //titleLab.text = NSLocalizedString(@"File_upload_path_set",nil);
+        _saveBoxFilePathLabel.font = [UIFont systemFontOfSize:12.0];
+        _saveBoxFilePathLabel.textColor = [UIColor hwColor:@"#6A6A6A" alpha:1.0];
+        _saveBoxFilePathLabel.numberOfLines = 0;
+        [tailBgView3 addSubview:_saveBoxFilePathLabel];
+        
+        [_saveBoxFilePathLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.left.mas_equalTo(15);
+            make.right.mas_equalTo(-15);
+            make.bottom.mas_equalTo(-10);
+            make.top.mas_equalTo(titleLab3.mas_bottom).offset(10.0);
+        }];
+        
+        [self setSaveFileToBoxPathLabelTitleFun];
     }
     
     return _tailView;
@@ -281,6 +340,47 @@
     
     _backupsFilePathLabel.attributedText = noteStr;
 }
+
+#pragma mark 设置 盒子的接收路径
+- (void)setSaveFileToBoxPathLabelTitleFun
+{
+    NSString * leftStr = NSLocalizedString(@"File_upload_path_way",nil);
+    
+    NSString * boxSaveDefaultPath = [HWDataManager getStringWithKey:stringKeyAddSn(Const_box_save_default_path)];
+    
+    if(!boxSaveDefaultPath || boxSaveDefaultPath.length == 0){
+        boxSaveDefaultPath = Const_default_save_path;
+        [HWDataManager setStringWithKey:stringKeyAddSn(Const_box_save_default_path) value:boxSaveDefaultPath];
+    }
+    
+    if([boxSaveDefaultPath containsString:@"mnt/media_rw"]){
+        boxSaveDefaultPath = [boxSaveDefaultPath stringByReplacingOccurrencesOfString:@"mnt/media_rw" withString:NSLocalizedString(@"disk_Extra_default_tip",nil)];
+    }
+    else if([boxSaveDefaultPath containsString:@"storage/emulated/0"]){
+        boxSaveDefaultPath = [boxSaveDefaultPath stringByReplacingOccurrencesOfString:@"storage/emulated/0" withString:NSLocalizedString(@"disk_phone_default_tip",nil)];
+    }
+    else if([boxSaveDefaultPath containsString:@"sdcard"]){
+        boxSaveDefaultPath = [boxSaveDefaultPath stringByReplacingOccurrencesOfString:@"sdcard" withString:NSLocalizedString(@"disk_phone_default_tip",nil)];
+    }
+    
+    NSString * rightStr = boxSaveDefaultPath;
+    
+    NSString *totalStr = [[NSString alloc] initWithFormat:@"%@%@",leftStr,rightStr];
+    
+    NSMutableAttributedString *noteStr = [[NSMutableAttributedString alloc] initWithString:totalStr];
+    
+    NSRange redRange = NSMakeRange([totalStr rangeOfString:rightStr].location, [totalStr rangeOfString:rightStr].length);
+    [noteStr addAttribute:NSForegroundColorAttributeName value:[UIColor hwColor:@"#01B7EA" alpha:0.8] range:redRange];
+    [noteStr addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:12.0] range:redRange];
+    // 设置行间距
+    NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
+    [paragraphStyle setLineSpacing:5];        //设置行间距
+    
+    [noteStr addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, [totalStr  length])];
+    
+    _saveBoxFilePathLabel.attributedText = noteStr;
+}
+
 #pragma mark 尾部事件
 - (void)didClickTailViewFun:(UITapGestureRecognizer*)tap
 {
@@ -292,6 +392,9 @@
     else if (curView.tag == 2){
         [self gotoSetBackupsPathFun];
     }
+    else if (curView.tag == 3){
+        [self gotofileTransferPathCheckVCFunWithType:3];
+    }
 }
 
 -(void)gotoSetUploadPathFun

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

@@ -11,7 +11,7 @@
 NS_ASSUME_NONNULL_BEGIN
 
 @interface fileTransferPathCheckViewController : BaseViewController
-@property(nonatomic,assign) NSInteger curType;// 1上传 2是备份
+@property(nonatomic,assign) NSInteger curType;// 1上传 2是备份 3.盒子接收路径
 
 @property (nonatomic,copy) void (^didChangeSavePathFun)(void);
 @end

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

@@ -88,6 +88,9 @@
     if(_curType == 2){
         [self.titleLabel setText:NSLocalizedString(@"File_upload_path_new_check_title",nil)];
     }
+    else if(_curType == 3){
+        [self.titleLabel setText:NSLocalizedString(@"File_save_to_box_check_title",nil)];
+    }
     else{
         [self.titleLabel setText:NSLocalizedString(@"File_upload_path_check",nil)];
     }
@@ -265,6 +268,9 @@
     else if(_curType == 1){
         [HWDataManager setStringWithKey:stringKeyAddSn(Const_photo_upload_default_path) value:cutPath];
     }
+    else if(_curType == 3){
+        [HWDataManager setStringWithKey:stringKeyAddSn(Const_box_save_default_path) value:cutPath];
+    }
     
     [[iToast makeText:NSLocalizedString(@"save_path_change_suc_tip",nil)] show];
     if(_didChangeSavePathFun){
@@ -298,6 +304,10 @@
     else if(_curType == 1){
         [HWDataManager setStringWithKey:stringKeyAddSn(Const_photo_upload_default_path) value:curbackupsDefaultPath];
     }
+    else if(_curType == 3){
+        [HWDataManager setStringWithKey:stringKeyAddSn(Const_box_save_default_path) value:curbackupsDefaultPath];
+    }
+    
     
     [[NSNotificationCenter defaultCenter] postNotificationName:createFolderBeginNotification object:curbackupsDefaultPath];/*发送通知*/
 }
@@ -347,6 +357,9 @@
         if(_curType == 1){
             backupsDefaultPath = [HWDataManager getStringWithKey:stringKeyAddSn(Const_photo_upload_default_path)];
         }
+        else if(_curType == 3){
+            backupsDefaultPath = [HWDataManager getStringWithKey:stringKeyAddSn(Const_box_save_default_path)];
+        }
         
         NSString *lastbackupsStr = [backupsDefaultPath substringFromIndex:backupsDefaultPath.length -1];
         

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

@@ -507,3 +507,6 @@
 "delete_file_title_msg"   = "确认删除";
 "delete_file_tip_msg"   = "确认后将永久删除无法找回,\n是否删除所选的文件?";
 "delete_file_suc_msg"   = "删除成功";
+"File_save_to_box_path_set"   = "接收路径设置";
+"File_save_to_box_check_title"   = "选择接收路径设置";
+