|
|
@@ -7,11 +7,12 @@
|
|
|
|
|
|
#import "filePathCreatPopView.h"
|
|
|
#import "filePathCreatTableViewCell.h"
|
|
|
-
|
|
|
+#import "cloudPhoneExtraFileListModel.h"
|
|
|
|
|
|
@interface filePathCreatPopView ()<UITableViewDelegate,UITableViewDataSource,UITextFieldDelegate>
|
|
|
{
|
|
|
UIView *whiteBgView;
|
|
|
+ UILabel *titleLabel;
|
|
|
UITextField *filePathNameTF;
|
|
|
|
|
|
UIButton *canclButton;
|
|
|
@@ -19,6 +20,7 @@
|
|
|
}
|
|
|
|
|
|
@property (nonatomic, strong) UITableView *tableView;
|
|
|
+@property(nonatomic,copy) NSMutableArray *curDataArr;//磁盘数据 +默认
|
|
|
@end
|
|
|
|
|
|
@implementation filePathCreatPopView
|
|
|
@@ -46,8 +48,8 @@
|
|
|
[whiteBgView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
make.left.mas_equalTo(0);
|
|
|
make.right.mas_equalTo(0);
|
|
|
- //make.height.mas_equalTo(418+ 10 + safeArea);
|
|
|
- make.height.mas_equalTo(200+ 10 + safeArea);
|
|
|
+ make.height.mas_equalTo(418+ 10 + safeArea);
|
|
|
+ //make.height.mas_equalTo(200+ 10 + safeArea);
|
|
|
make.bottom.mas_equalTo(10);
|
|
|
}];
|
|
|
|
|
|
@@ -64,7 +66,7 @@
|
|
|
make.bottom.mas_equalTo(whiteBgView.mas_top);
|
|
|
}];
|
|
|
|
|
|
- UILabel *titleLabel = [[UILabel alloc] init];
|
|
|
+ titleLabel = [[UILabel alloc] init];
|
|
|
titleLabel.text = NSLocalizedString(@"File_upload_path_new",nil);
|
|
|
titleLabel.font = [UIFont boldSystemFontOfSize:18.0];
|
|
|
titleLabel.textColor = [UIColor hwColor:@"#0A132B" alpha:1.0];
|
|
|
@@ -81,11 +83,11 @@
|
|
|
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
make.left.mas_equalTo(15);
|
|
|
make.right.mas_equalTo(-15);
|
|
|
- //make.height.mas_equalTo(70*2+50);
|
|
|
- make.height.mas_equalTo(0.0);
|
|
|
+ make.height.mas_equalTo(70*2+50);
|
|
|
+ //make.height.mas_equalTo(0.0);
|
|
|
make.top.equalTo(titleLabel.mas_bottom).offset(15.f);
|
|
|
}];
|
|
|
- self.tableView.hidden = YES;
|
|
|
+ //self.tableView.hidden = YES;
|
|
|
|
|
|
UILabel *tipLabel = [[UILabel alloc] init];
|
|
|
tipLabel.text = NSLocalizedString(@"File_upload_path_new_name_tip",nil);
|
|
|
@@ -200,7 +202,7 @@
|
|
|
}
|
|
|
|
|
|
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
|
|
- return 2;
|
|
|
+ return _curDataArr.count;
|
|
|
}
|
|
|
|
|
|
- (filePathCreatTableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
|
|
|
@@ -224,24 +226,27 @@
|
|
|
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- if (row == 0){
|
|
|
- //[cell.titleLabel setText:NSLocalizedString(@"File_Transfer_set_Cellular",nil)];
|
|
|
- cell.titleLabel.text = @"云机系统名称";
|
|
|
-
|
|
|
- cell.checkButton.selected = YES;
|
|
|
-
|
|
|
- }else if (row == 1){
|
|
|
- //[cell.titleLabel setText:NSLocalizedString(@"File_Transfer_set_battery_level",nil)];
|
|
|
-
|
|
|
- cell.titleLabel.text = @"云机系统名称";
|
|
|
-
|
|
|
-
|
|
|
+ if(row < _curDataArr.count){
|
|
|
+ cloudPhoneExtraFileModel *model = _curDataArr[row];
|
|
|
+ cell.curModel = model;
|
|
|
}
|
|
|
+
|
|
|
+// if (row == 0){
|
|
|
+// //[cell.titleLabel setText:NSLocalizedString(@"File_Transfer_set_Cellular",nil)];
|
|
|
+// cell.titleLabel.text = @"云机系统名称";
|
|
|
+//
|
|
|
+// cell.checkButton.selected = YES;
|
|
|
+//
|
|
|
+// }else if (row == 1){
|
|
|
+// //[cell.titleLabel setText:NSLocalizedString(@"File_Transfer_set_battery_level",nil)];
|
|
|
+//
|
|
|
+// cell.titleLabel.text = @"云机系统名称";
|
|
|
+//
|
|
|
+// }
|
|
|
|
|
|
KWeakSelf
|
|
|
cell.didClickSwitch = ^(BOOL SwitchOn) {
|
|
|
-
|
|
|
+ [weakSelf setModelSelectInRow:row];
|
|
|
};
|
|
|
|
|
|
return cell;
|
|
|
@@ -277,6 +282,21 @@
|
|
|
return headView;
|
|
|
}
|
|
|
|
|
|
+- (void)setModelSelectInRow:(NSInteger)row
|
|
|
+{
|
|
|
+ for (int i=0; i<_curDataArr.count; i++) {
|
|
|
+ cloudPhoneExtraFileModel *model = _curDataArr[i];
|
|
|
+ model.isCheckType = NO;
|
|
|
+
|
|
|
+ if(i == row){
|
|
|
+ model.isCheckType = YES;
|
|
|
+ _defaultSaveDiskStr = model.extraPath;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ [self.tableView reloadData];
|
|
|
+}
|
|
|
+
|
|
|
//- (void)setFileTransferType:(NSInteger)fileTransferType
|
|
|
//{
|
|
|
// _fileTransferType = fileTransferType;
|
|
|
@@ -351,6 +371,43 @@
|
|
|
//}
|
|
|
|
|
|
|
|
|
+- (void)setOutSizeArr:(NSArray *)outSizeArr
|
|
|
+{
|
|
|
+ NSMutableArray *arr = [NSMutableArray new];
|
|
|
+ if(outSizeArr && outSizeArr.count >0){
|
|
|
+ [arr addObjectsFromArray:outSizeArr];
|
|
|
+ }
|
|
|
+
|
|
|
+ cloudPhoneExtraFileModel *defModel = [cloudPhoneExtraFileModel new];
|
|
|
+ //defModel
|
|
|
+ defModel.extraPath = @"sdcard";
|
|
|
+ //defModel.extraTotalSize = ksharedAppDelegate.couldPhoneBaseInfoMod;
|
|
|
+
|
|
|
+ [arr insertObject:defModel atIndex:0];
|
|
|
+
|
|
|
+ NSInteger tableRowHeight = 70;
|
|
|
+ NSInteger allRow = arr.count;
|
|
|
+
|
|
|
+ [whiteBgView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.left.mas_equalTo(0);
|
|
|
+ make.right.mas_equalTo(0);
|
|
|
+ make.height.mas_equalTo(278 +tableRowHeight*allRow + 10 + safeArea);
|
|
|
+ //make.height.mas_equalTo(418+ 10 + safeArea);
|
|
|
+ make.bottom.mas_equalTo(10);
|
|
|
+ }];
|
|
|
+
|
|
|
+ [self.tableView mas_remakeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.left.mas_equalTo(15);
|
|
|
+ make.right.mas_equalTo(-15);
|
|
|
+ make.height.mas_equalTo(tableRowHeight*allRow +50);
|
|
|
+ //make.height.mas_equalTo(0.0);
|
|
|
+ make.top.equalTo(titleLabel.mas_bottom).offset(15.f);
|
|
|
+ }];
|
|
|
+
|
|
|
+ _curDataArr = arr;
|
|
|
+ [self.tableView reloadData];
|
|
|
+}
|
|
|
+
|
|
|
- (void)tapUpFun:(UITapGestureRecognizer*)tap
|
|
|
{
|
|
|
//[self deleteFromSuperview];
|
|
|
@@ -384,7 +441,7 @@
|
|
|
|
|
|
if(_didClickOkBut)
|
|
|
{
|
|
|
- _didClickOkBut(folderName);
|
|
|
+ _didClickOkBut(folderName,_defaultSaveDiskStr);
|
|
|
}
|
|
|
}
|
|
|
|