Browse Source

1.app页面添加搜索

huangxiaodong 2 months ago
parent
commit
21215f1ee7
1 changed files with 48 additions and 5 deletions
  1. 48 5
      创维盒子/code/NAS/NasPreviewAPPViewController.m

+ 48 - 5
创维盒子/code/NAS/NasPreviewAPPViewController.m

@@ -26,6 +26,8 @@
 #import "MJRefresh.h"
 #import "MJRefresh.h"
 #import "getInstalledAppListModel.h"
 #import "getInstalledAppListModel.h"
 #import "appInstallTypeView.h"
 #import "appInstallTypeView.h"
+#import "searchBarThridTypeView.h"
+#import "NasSearchViewController.h"
 
 
 @interface NasPreviewAPPViewController ()<UITableViewDelegate,UITableViewDataSource,DZNEmptyDataSetSource, DZNEmptyDataSetDelegate>
 @interface NasPreviewAPPViewController ()<UITableViewDelegate,UITableViewDataSource,DZNEmptyDataSetSource, DZNEmptyDataSetDelegate>
 {
 {
@@ -52,6 +54,7 @@
 @property(nonatomic,assign) BOOL isEditType;
 @property(nonatomic,assign) BOOL isEditType;
 @property(nonatomic,strong) editTypeHeadView*curEditTypeHeadView;
 @property(nonatomic,strong) editTypeHeadView*curEditTypeHeadView;
 @property(nonatomic,strong) editAPPBottomView*curEditTypeBottomView;
 @property(nonatomic,strong) editAPPBottomView*curEditTypeBottomView;
+@property(nonatomic,strong) searchBarThridTypeView* searchBarThridTypeV;//
 @property(nonatomic,strong) UIButton*uploadFileButton;
 @property(nonatomic,strong) UIButton*uploadFileButton;
 
 
 @property(nonatomic,strong) appInstallTypeView* appInstallTypeV;//tab
 @property(nonatomic,strong) appInstallTypeView* appInstallTypeV;//tab
@@ -153,6 +156,24 @@
         [weakSelf didClickHeadTabButtonFun:tag];
         [weakSelf didClickHeadTabButtonFun:tag];
     };
     };
     
     
+    
+    _searchBarThridTypeV = [[searchBarThridTypeView alloc] init];
+    [self.view addSubview:_searchBarThridTypeV];
+    
+    [_searchBarThridTypeV mas_makeConstraints:^(MASConstraintMaker *make) {
+        //make.top.equalTo(self.navBarBGView.mas_bottom).offset(10.f);
+        make.top.equalTo(self.appInstallTypeV.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.tableView];
     [self.view addSubview:self.tableView];
     [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
     [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
         make.left.mas_equalTo(0);
         make.left.mas_equalTo(0);
@@ -160,7 +181,8 @@
         //make.bottom.mas_equalTo(-(safeArea));
         //make.bottom.mas_equalTo(-(safeArea));
         make.bottom.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.appInstallTypeV.mas_bottom).offset(10.f);
+        //make.top.equalTo(self.appInstallTypeV.mas_bottom).offset(10.f);
+        make.top.equalTo(self.searchBarThridTypeV.mas_bottom).offset(10.f);
     }];
     }];
     
     
     //大+号
     //大+号
@@ -549,7 +571,8 @@
     _curEditTypeBottomView.hidden = NO;
     _curEditTypeBottomView.hidden = NO;
     _uploadFileButton.hidden = YES;
     _uploadFileButton.hidden = YES;
     _appInstallTypeV.userInteractionEnabled = NO;
     _appInstallTypeV.userInteractionEnabled = NO;
-    
+    self.searchBarThridTypeV.hidden = YES;
+
     [self RefreshAllUIFun];
     [self RefreshAllUIFun];
 }
 }
 
 
@@ -569,7 +592,8 @@
     _curEditTypeBottomView.hidden = YES;
     _curEditTypeBottomView.hidden = YES;
     _uploadFileButton.hidden = NO;
     _uploadFileButton.hidden = NO;
     _appInstallTypeV.userInteractionEnabled = YES;
     _appInstallTypeV.userInteractionEnabled = YES;
-    
+    self.searchBarThridTypeV.hidden = NO;
+
     [self RefreshAllUIFun];
     [self RefreshAllUIFun];
 }
 }
 
 
@@ -601,10 +625,21 @@
         }
         }
         
         
         if(isDefaultTabType){
         if(isDefaultTabType){
-            make.top.equalTo(self.appInstallTypeV.mas_bottom).offset(10.f);
+            if(self.searchBarThridTypeV.hidden){
+                make.top.equalTo(self.appInstallTypeV.mas_bottom).offset(10.f);
+            }
+            else{
+                make.top.equalTo(self.searchBarThridTypeV.mas_bottom).offset(10.f);
+            }
+            
         }
         }
         else{
         else{
-            make.top.equalTo(self.navBarBGView.mas_bottom).offset(10.f);
+            if(self.searchBarThridTypeV.hidden){
+                make.top.equalTo(self.navBarBGView.mas_bottom).offset(10.f);
+            }
+            else{
+                make.top.equalTo(self.searchBarThridTypeV.mas_bottom).offset(10.f);
+            }
         }
         }
     }];
     }];
 }
 }
@@ -1274,5 +1309,13 @@
      }];
      }];
 }
 }
 
 
+
+#pragma mark 点击了搜索
+- (void)gotoSearchVCFun
+{
+    NasSearchViewController *vc = [NasSearchViewController new];
+    [self.navigationController pushViewController:vc animated:YES];
+}
+
 @end
 @end