Bläddra i källkod

1.图片页面添加搜索

huangxiaodong 2 månader sedan
förälder
incheckning
f739a90dbe

+ 34 - 4
创维盒子/code/Class/Set/previewFile/previewImageOrVideoViewController.m

@@ -25,6 +25,8 @@
 #import "videoPlayViewController.h"
 #import "videoPlayByAVPlayerViewController.h"
 #import "MJRefresh.h"
+#import "searchBarThridTypeView.h"
+#import "NasSearchViewController.h"
 
 @interface previewImageOrVideoViewController ()<UICollectionViewDelegate,UICollectionViewDataSource,DZNEmptyDataSetSource, DZNEmptyDataSetDelegate>
 {
@@ -49,6 +51,7 @@
 @property(nonatomic,assign) BOOL isEditType;
 @property(nonatomic,strong) editTypeHeadView*curEditTypeHeadView;
 @property(nonatomic,strong) editTypeBottomView*curEditTypeBottomView;
+@property(nonatomic,strong) searchBarThridTypeView* searchBarThridTypeV;//
 @property(nonatomic,strong) UIButton*uploadFileButton;
 
 //@property(nonatomic,strong) couldPhoneFileListModel *curCouldPhoneFileListMod;
@@ -130,13 +133,30 @@
         }
     };
     
+    _searchBarThridTypeV = [[searchBarThridTypeView alloc] init];
+    [self.view addSubview:_searchBarThridTypeV];
+    
+    [_searchBarThridTypeV mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.top.equalTo(self.navBarBGView.mas_bottom).offset(10.f);
+        make.height.mas_equalTo(32.0);
+        make.left.mas_equalTo(20.0);
+        //make.right.mas_equalTo(-48.0);
+        make.right.mas_equalTo(-20.0);
+    }];
+    
+#pragma mark 点击搜索
+    _searchBarThridTypeV.didClickBgFun = ^{
+        [weakSelf gotoSearchVCFun];
+    };
+
     [self.view addSubview:self.dataCollectionView];
     [self.dataCollectionView mas_makeConstraints:^(MASConstraintMaker *make) {
         make.left.mas_equalTo(0);
         make.right.mas_equalTo(0);
         //make.bottom.mas_equalTo(-(safeArea));
         make.bottom.mas_equalTo(0);
-        make.top.equalTo(self.navBarBGView.mas_bottom).offset(10.f);
+        //make.top.equalTo(self.navBarBGView.mas_bottom).offset(10.f);
+        make.top.equalTo(self.searchBarThridTypeV.mas_bottom).offset(10.f);
     }];
     
     //大+号
@@ -567,7 +587,8 @@
     _curEditTypeHeadView.hidden = NO;
     _curEditTypeBottomView.hidden = NO;
     _uploadFileButton.hidden = YES;
-    
+    self.searchBarThridTypeV.hidden = YES;
+
     [self setEditTypeTitleFun];
     
     [self.dataCollectionView mas_remakeConstraints:^(MASConstraintMaker *make) {
@@ -608,12 +629,14 @@
     _curEditTypeHeadView.hidden = YES;
     _curEditTypeBottomView.hidden = YES;
     _uploadFileButton.hidden = NO;
-    
+    self.searchBarThridTypeV.hidden = NO;
+
     [self.dataCollectionView mas_remakeConstraints:^(MASConstraintMaker *make) {
         make.left.mas_equalTo(0);
         make.right.mas_equalTo(0);
         make.bottom.mas_equalTo(0);
-        make.top.equalTo(self.navBarBGView.mas_bottom).offset(10.f);
+        //make.top.equalTo(self.navBarBGView.mas_bottom).offset(10.f);
+        make.top.equalTo(self.searchBarThridTypeV.mas_bottom).offset(10.f);
     }];
 }
 
@@ -1356,4 +1379,11 @@
     [self.dataCollectionView reloadData];
 }
 
+#pragma mark 点击了搜索
+- (void)gotoSearchVCFun
+{
+    NasSearchViewController *vc = [NasSearchViewController new];
+    [self.navigationController pushViewController:vc animated:YES];
+}
+
 @end