|
@@ -24,9 +24,11 @@
|
|
|
@property (nonatomic, strong) UIButton *rightButton;
|
|
|
@property (nonatomic, strong) diskListBgView *diskListBgV;
|
|
|
@property (nonatomic, strong) diskListTableView *diskListTableV;
|
|
|
+@property (nonatomic, strong) NSMutableArray*diskListArr;
|
|
|
+@property (nonatomic, copy) NSString *defaultDiskPath;
|
|
|
+
|
|
|
|
|
|
@property (nonatomic, strong) downloadFileBottomView *downloadFileBottomV;
|
|
|
-@property (nonatomic,assign) BOOL didGetType;
|
|
|
|
|
|
@property(nonatomic,strong) couldPhoneFileListModel *curCouldPhoneFileListMod;
|
|
|
@end
|
|
@@ -77,6 +79,23 @@
|
|
|
[weakSelf gotoDownloadloadFileRecordFun];
|
|
|
};
|
|
|
|
|
|
+
|
|
|
+ NSMutableArray *arr = [NSMutableArray new];
|
|
|
+ NSArray *diskList = ksharedAppDelegate.cloudPhoneExtraFileListMod.data;
|
|
|
+ if(diskList && [diskList isKindOfClass:[NSArray class]]){
|
|
|
+ for (cloudPhoneExtraFileModel *model in diskList) {
|
|
|
+ model.isCheckType = NO;
|
|
|
+ [arr addObject:model];
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(arr.count >0){
|
|
|
+ cloudPhoneExtraFileModel *model = arr.firstObject;
|
|
|
+ model.isCheckType = YES;
|
|
|
+ _defaultDiskPath = model.extraPath;
|
|
|
+ }
|
|
|
+ _diskListArr = arr;
|
|
|
+ [self setTitleAfterGetdiskFun];
|
|
|
}
|
|
|
|
|
|
- (void)initNavHeadUIFun
|
|
@@ -167,13 +186,32 @@
|
|
|
_diskListBgV.hidden = YES;
|
|
|
[self.view addSubview:_diskListBgV];
|
|
|
|
|
|
+ KWeakSelf
|
|
|
+ _diskListBgV.didTapWhitePlace = ^{
|
|
|
+ [weakSelf hideDiskListVieFun];
|
|
|
+ };
|
|
|
+
|
|
|
[_diskListBgV mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
make.left.mas_equalTo(0);
|
|
|
make.bottom.mas_equalTo(0);
|
|
|
make.right.mas_equalTo(0);
|
|
|
make.top.mas_equalTo(self.navBarBGView.mas_bottom);
|
|
|
}];
|
|
|
+
|
|
|
+ [self.view addSubview:self.diskListTableV];
|
|
|
+ self.diskListTableV.hidden = YES;
|
|
|
+ [self.diskListTableV mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.left.mas_equalTo(0);
|
|
|
+ make.height.mas_equalTo(3*70);
|
|
|
+ make.right.mas_equalTo(0);
|
|
|
+ make.top.mas_equalTo(self.navBarBGView.mas_bottom);
|
|
|
+ }];
|
|
|
|
|
|
+ self.diskListTableV.diskListArr = _diskListArr;
|
|
|
+
|
|
|
+ self.diskListTableV.didClickDiskModel = ^(NSString * _Nonnull checkPath) {
|
|
|
+ [weakSelf didCheckDiskFunByPath:checkPath];
|
|
|
+ };
|
|
|
}
|
|
|
|
|
|
return _diskListBgV;
|
|
@@ -184,8 +222,15 @@
|
|
|
_diskListTableV = [[diskListTableView alloc] init];
|
|
|
//
|
|
|
}
|
|
|
-
|
|
|
- return _tableView;
|
|
|
+ return _diskListTableV;
|
|
|
+}
|
|
|
+
|
|
|
+#pragma mark 选中磁盘
|
|
|
+- (void)didCheckDiskFunByPath:(NSString*)pathStr
|
|
|
+{
|
|
|
+ self.defaultDiskPath = pathStr;
|
|
|
+ [self searchFileListFun];
|
|
|
+ [self hideDiskListVieFun];
|
|
|
}
|
|
|
|
|
|
#pragma mark - 列表委托
|
|
@@ -312,10 +357,44 @@
|
|
|
- (void)selectDiskAction:(UIButton*)but
|
|
|
{
|
|
|
if(self.diskListBgV.hidden){
|
|
|
- self.diskListBgV.hidden = NO;
|
|
|
+ [self showDiskListVieFun];
|
|
|
}
|
|
|
+ else{
|
|
|
+ [self hideDiskListVieFun];
|
|
|
+
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+- (void)showDiskListVieFun
|
|
|
+{
|
|
|
+ self.diskListBgV.hidden = NO;
|
|
|
+ self.diskListTableV.hidden = NO;
|
|
|
+
|
|
|
+ [UIView animateWithDuration:0.3 animations:^{
|
|
|
+ CGRect rect = self.diskListTableV.frame;
|
|
|
+ rect.origin.y = CGRectGetMaxY(self.navBarBGView.frame);
|
|
|
+ self.diskListTableV.frame = rect;
|
|
|
+
|
|
|
+ self.selectTip.transform = CGAffineTransformMakeRotation(M_PI);
|
|
|
+ }];
|
|
|
+}
|
|
|
+
|
|
|
+- (void)hideDiskListVieFun
|
|
|
+{
|
|
|
+ self.diskListBgV.hidden = YES;
|
|
|
+
|
|
|
+ [UIView animateWithDuration:0.3 animations:^{
|
|
|
+ self.diskListTableV.hidden = YES;
|
|
|
+ self.selectTip.transform = CGAffineTransformIdentity;
|
|
|
+
|
|
|
+ }completion:^(BOOL finished) {
|
|
|
+ CGRect rect = self.diskListTableV.frame;
|
|
|
+ rect.origin.y = 0;
|
|
|
+ self.diskListTableV.frame = rect;
|
|
|
+ }];
|
|
|
}
|
|
|
|
|
|
+
|
|
|
#pragma mark 刷新底部
|
|
|
- (void)RefreshBottomViewUIFun
|
|
|
{
|
|
@@ -331,31 +410,40 @@
|
|
|
_downloadFileBottomV.indexPathsForSelectedItems = selectArr;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+#pragma mark 设置标题
|
|
|
+- (void)setTitleAfterGetdiskFun
|
|
|
+{
|
|
|
+ if(_isPhotoType){
|
|
|
+ //self.titleLabel.text = NSLocalizedString(@"my_set_no_image_upload",nil) ;
|
|
|
+ [self setTitleLabelText:NSLocalizedString(@"my_set_no_image_upload",nil)];
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ //self.titleLabel.text = NSLocalizedString(@"my_set_no_video_upload",nil) ;
|
|
|
+ [self setTitleLabelText:NSLocalizedString(@"my_set_no_video_upload",nil)];
|
|
|
+ }
|
|
|
+
|
|
|
+ [self searchFileListFun];
|
|
|
+}
|
|
|
+
|
|
|
- (void)viewWillAppear:(BOOL)animated
|
|
|
{
|
|
|
[super viewWillAppear:animated];
|
|
|
|
|
|
- if(!_didGetType){
|
|
|
- if(_isPhotoType){
|
|
|
- //self.titleLabel.text = NSLocalizedString(@"my_set_no_image_upload",nil) ;
|
|
|
- [self setTitleLabelText:NSLocalizedString(@"my_set_no_image_upload",nil)];
|
|
|
- }
|
|
|
- else{
|
|
|
- //self.titleLabel.text = NSLocalizedString(@"my_set_no_video_upload",nil) ;
|
|
|
- [self setTitleLabelText:NSLocalizedString(@"my_set_no_video_upload",nil)];
|
|
|
- }
|
|
|
-
|
|
|
- [self searchFileListFun];
|
|
|
-
|
|
|
- _didGetType = YES;
|
|
|
- }
|
|
|
|
|
|
}
|
|
|
|
|
|
- (void)searchFileListFun
|
|
|
{
|
|
|
+ NSMutableDictionary *dict = [NSMutableDictionary new];
|
|
|
NSNumber *curNum = [NSNumber numberWithBool:_isPhotoType];
|
|
|
- [[NSNotificationCenter defaultCenter] postNotificationName:searchFileListBeginNotification object:curNum];/*发送通知*/
|
|
|
+ [dict setObject:curNum forKey:@"type"];
|
|
|
+ if(!_defaultDiskPath){
|
|
|
+ _defaultDiskPath = @"";
|
|
|
+ }
|
|
|
+ [dict setObject:_defaultDiskPath forKey:@"path"];
|
|
|
+
|
|
|
+ [[NSNotificationCenter defaultCenter] postNotificationName:searchFileListBeginNotification object:dict];/*发送通知*/
|
|
|
}
|
|
|
|
|
|
- (void)searchFileListDoneFun:(NSNotification*)notification
|