Sfoglia il codice sorgente

1.视频预览页面添加搜索

huangxiaodong 2 mesi fa
parent
commit
66c54a5060

+ 32 - 7
创维盒子/code/NAS/NasPreviewVideoViewController.m

@@ -24,6 +24,8 @@
 //#import "audioPlayerViewController.h"
 #import "videoPlayByAVPlayerViewController.h"
 #import "MJRefresh.h"
+#import "searchBarThridTypeView.h"
+#import "NasSearchViewController.h"
 
 @interface NasPreviewVideoViewController ()<UITableViewDelegate,UITableViewDataSource,DZNEmptyDataSetSource, DZNEmptyDataSetDelegate>
 {
@@ -47,6 +49,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)  NSMutableArray*didSelectListArr;//选中的数据
@@ -125,13 +128,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.tableView];
     [self.tableView 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);
     }];
     
     //大+号
@@ -514,6 +534,7 @@
     _curEditTypeHeadView.hidden = NO;
     _curEditTypeBottomView.hidden = NO;
     _uploadFileButton.hidden = YES;
+    self.searchBarThridTypeV.hidden = YES;
     
     [self.tableView mas_remakeConstraints:^(MASConstraintMaker *make) {
         make.left.mas_equalTo(0);
@@ -538,12 +559,14 @@
     _curEditTypeHeadView.hidden = YES;
     _curEditTypeBottomView.hidden = YES;
     _uploadFileButton.hidden = NO;
+    self.searchBarThridTypeV.hidden = NO;
     
-    [self.tableView  mas_remakeConstraints:^(MASConstraintMaker *make) {
+    [self.tableView 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);
     }];
 }
 
@@ -762,10 +785,6 @@
     [self removeNewIndicatorHaveStr];
 }
 
-
-
-
-
 - (void)gotoDownloadloadFileRecordFun
 {
     uploadFileRecordViewController *vc = [uploadFileRecordViewController new];
@@ -1099,4 +1118,10 @@
     }];
 }
 
+#pragma mark 点击了搜索
+- (void)gotoSearchVCFun
+{
+    NasSearchViewController *vc = [NasSearchViewController new];
+    [self.navigationController pushViewController:vc animated:YES];
+}
 @end

+ 1 - 1
创维盒子/code/NAS/NasSearchViewController.m

@@ -33,7 +33,7 @@
 @property(nonatomic,assign) BOOL isEditType;
 @property(nonatomic,strong) editTypeHeadView*curEditTypeHeadView;
 @property(nonatomic,strong) editTypeBottomView*curEditTypeBottomView;
-@property(nonatomic,strong) searchBarSecondTypeView* searchBarSecondTypeV;//tab
+@property(nonatomic,strong) searchBarSecondTypeView* searchBarSecondTypeV;//
 @property (nonatomic, strong)  NSMutableArray*didSelectListArr;//选中的数据
 @property (nonatomic, strong) searchListModel *curSearchLisyMod;
 @property (nonatomic, copy) NSString *searchKeyWord;//搜索关键字

+ 16 - 0
创维盒子/code/NAS/search/searchBarThridTypeView.h

@@ -0,0 +1,16 @@
+//
+//  searchBarThridTypeView.h
+//  双子星云手机
+//
+//  Created by xd h on 2025/3/20.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface searchBarThridTypeView : UIView
+@property (nonatomic,copy) void (^didClickBgFun)(void);
+@end
+
+NS_ASSUME_NONNULL_END

+ 115 - 0
创维盒子/code/NAS/search/searchBarThridTypeView.m

@@ -0,0 +1,115 @@
+//
+//  searchBarThridTypeView.m
+//  双子星云手机
+//
+//  Created by xd h on 2025/3/20.
+//
+
+#import "searchBarThridTypeView.h"
+
+@interface searchBarThridTypeView ()
+@property(nonatomic,strong) UITextField*searchTF;
+@end
+
+@implementation searchBarThridTypeView
+
+- (id)initWithFrame:(CGRect)frame{
+    self = [super initWithFrame:frame];
+    
+    //self.backgroundColor = [UIColor clearColor];
+    [self drawAnyView];
+    
+    return self;
+}
+
+-(void)drawAnyView
+{
+    UIView *whiteBgView = [[UIView alloc] init];
+    whiteBgView.backgroundColor = [UIColor hwColor:@"#F9F9F9"];
+    [self addSubview:whiteBgView];
+    whiteBgView.layer.cornerRadius = 8;
+    whiteBgView.layer.masksToBounds = YES;
+    
+    [whiteBgView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.top.mas_equalTo(0);
+        make.left.mas_equalTo(0);
+        //make.right.mas_equalTo(0);
+        make.right.mas_equalTo(0);
+        make.bottom.mas_equalTo(0);
+    }];
+    
+    //添加手势事件
+    [whiteBgView addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didClickWhiteViewFun)]];
+    
+    //搜索小图标
+    UIImageView *imageView = [[UIImageView alloc] init];
+    imageView.image = [UIImage imageNamed:@"home_search_icon"];
+    [whiteBgView addSubview:imageView];
+    
+    [imageView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.width.mas_equalTo(24);
+        make.height.mas_equalTo(24);
+        make.left.mas_equalTo(9);
+        make.centerY.mas_equalTo(0);
+    }];
+    
+    //搜索TF
+    NSString *titleStr = NSLocalizedString(@"Search_nas_title",nil);
+    _searchTF = [[UITextField alloc] init];
+    _searchTF.backgroundColor = [UIColor clearColor];
+    _searchTF.placeholder = titleStr;
+    _searchTF.font = [UIFont systemFontOfSize:12];
+    //_searchTF.delegate = self;
+    _searchTF.userInteractionEnabled = NO;
+    [whiteBgView addSubview:_searchTF];
+
+    [_searchTF mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.equalTo(imageView.mas_right).offset(2);
+        make.top.mas_equalTo(0);
+        make.right.mas_equalTo(0);
+        make.bottom.mas_equalTo(0);
+    }];
+    
+}
+
+//#pragma mark UITextFieldDelegate
+//- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string {
+//      NSString *beString = [textField.text stringByReplacingCharactersInRange:range withString:string];
+//    
+//    if([beString length] >0){
+//        _searchButton.enabled = YES;
+//    }
+//    else{
+//        _searchButton.enabled = NO;
+//    }
+//    
+//    if ([beString length] > 16) {
+//      textField.text = [beString substringToIndex:16];
+//      return NO;
+//    }
+//    return YES;
+//}
+//
+//- (BOOL)textFieldShouldReturn:(UITextField *)textField{
+//    [textField resignFirstResponder];
+//    return YES;
+//}
+
+//- (void)didClickSearchButFun{
+//    if (_didClickSearchFun) {
+//        NSString *string = _searchTF.text;
+//        _didClickSearchFun(string);
+//    }
+//    
+//    [_searchTF resignFirstResponder];
+//}
+
+- (void)didClickWhiteViewFun
+{
+    if (_didClickBgFun) {
+        _didClickBgFun();
+    }
+}
+
+@end
+

+ 12 - 0
创维盒子/双子星云手机.xcodeproj/project.pbxproj

@@ -559,6 +559,10 @@
 		6B5394A02C81A99200195AA4 /* nasMixBackupsManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B53949D2C81A99200195AA4 /* nasMixBackupsManager.h */; };
 		6B5394A12C81A99200195AA4 /* nasMixBackupsManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B53949D2C81A99200195AA4 /* nasMixBackupsManager.h */; };
 		6B5394A22C81A99200195AA4 /* nasMixBackupsManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B53949E2C81A99200195AA4 /* nasMixBackupsManager.m */; };
+		6B5996402D8BE461009EE6FF /* searchBarThridTypeView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B59963F2D8BE461009EE6FF /* searchBarThridTypeView.m */; };
+		6B5996412D8BE461009EE6FF /* searchBarThridTypeView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B59963E2D8BE461009EE6FF /* searchBarThridTypeView.h */; };
+		6B5996422D8BE461009EE6FF /* searchBarThridTypeView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B59963F2D8BE461009EE6FF /* searchBarThridTypeView.m */; };
+		6B5996432D8BE461009EE6FF /* searchBarThridTypeView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B59963E2D8BE461009EE6FF /* searchBarThridTypeView.h */; };
 		6B5B60602B3BC8DE009A2AE2 /* fileTransferPopView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B5B605E2B3BC8DE009A2AE2 /* fileTransferPopView.h */; };
 		6B5B60612B3BC8DE009A2AE2 /* fileTransferPopView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B5B605F2B3BC8DE009A2AE2 /* fileTransferPopView.m */; };
 		6B5B60652B3D5FD8009A2AE2 /* fileTransfeSetViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B5B60632B3D5FD8009A2AE2 /* fileTransfeSetViewController.h */; };
@@ -1943,6 +1947,8 @@
 		6B4D23B02B33DDBB005B718A /* imageVersionRenewTipView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = imageVersionRenewTipView.m; sourceTree = "<group>"; };
 		6B53949D2C81A99200195AA4 /* nasMixBackupsManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = nasMixBackupsManager.h; sourceTree = "<group>"; };
 		6B53949E2C81A99200195AA4 /* nasMixBackupsManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = nasMixBackupsManager.m; sourceTree = "<group>"; };
+		6B59963E2D8BE461009EE6FF /* searchBarThridTypeView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = searchBarThridTypeView.h; sourceTree = "<group>"; };
+		6B59963F2D8BE461009EE6FF /* searchBarThridTypeView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = searchBarThridTypeView.m; sourceTree = "<group>"; };
 		6B5B605E2B3BC8DE009A2AE2 /* fileTransferPopView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = fileTransferPopView.h; sourceTree = "<group>"; };
 		6B5B605F2B3BC8DE009A2AE2 /* fileTransferPopView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = fileTransferPopView.m; sourceTree = "<group>"; };
 		6B5B60632B3D5FD8009A2AE2 /* fileTransfeSetViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = fileTransfeSetViewController.h; sourceTree = "<group>"; };
@@ -3430,6 +3436,8 @@
 				6B5ECC922D76FB5D0069CB86 /* searchBarView.m */,
 				6B61F5972D89652300C01A8A /* searchBarSecondTypeView.h */,
 				6B61F5982D89652300C01A8A /* searchBarSecondTypeView.m */,
+				6B59963E2D8BE461009EE6FF /* searchBarThridTypeView.h */,
+				6B59963F2D8BE461009EE6FF /* searchBarThridTypeView.m */,
 			);
 			path = search;
 			sourceTree = "<group>";
@@ -4336,6 +4344,7 @@
 				6B2C1E562C070ADE00FDCF82 /* UIScrollView+ZFPlayer.h in Headers */,
 				6B0581AF2AFCF57300D37290 /* AJPhotoGroupCell.h in Headers */,
 				6B5D401A2B4A9850000965CF /* couldPhoneFolderListModel.h in Headers */,
+				6B5996432D8BE461009EE6FF /* searchBarThridTypeView.h in Headers */,
 				6B1CC2CA2B67A5FC00AD4217 /* USBInsertPopView.h in Headers */,
 				6B1B0AE32D1AA1EF0044FC55 /* webRtcPingManager.h in Headers */,
 				6B833A832C48F3B300F9F1D0 /* customToastVew.h in Headers */,
@@ -4645,6 +4654,7 @@
 				6B2C1E572C070ADE00FDCF82 /* UIScrollView+ZFPlayer.h in Headers */,
 				6BD506E62B9576A4006E7CB0 /* AJPhotoGroupCell.h in Headers */,
 				6BD506E72B9576A4006E7CB0 /* couldPhoneFolderListModel.h in Headers */,
+				6B5996412D8BE461009EE6FF /* searchBarThridTypeView.h in Headers */,
 				6BD506E82B9576A4006E7CB0 /* USBInsertPopView.h in Headers */,
 				6B1B0AE52D1AA1EF0044FC55 /* webRtcPingManager.h in Headers */,
 				6B833A842C48F3B300F9F1D0 /* customToastVew.h in Headers */,
@@ -5262,6 +5272,7 @@
 				6B6ABEF52BFF6B4C00480BAC /* boxSaveFileManager.m in Sources */,
 				6BD5078E2B9576A4006E7CB0 /* MineViewCell.m in Sources */,
 				6BD5078F2B9576A4006E7CB0 /* PlayerViewController+AdjustBtnFrame.m in Sources */,
+				6B5996402D8BE461009EE6FF /* searchBarThridTypeView.m in Sources */,
 				6BD507902B9576A4006E7CB0 /* cachesFileManager.m in Sources */,
 				6BDB85BE2D57444400526D1F /* BoxHeartbeatReStartSucView.m in Sources */,
 				6BD780732C2BF7F10014912F /* customerServiceViewController.m in Sources */,
@@ -5653,6 +5664,7 @@
 				6B6ABEF32BFF6B4C00480BAC /* boxSaveFileManager.m in Sources */,
 				181E84F62A8F451D00292B96 /* MineViewCell.m in Sources */,
 				18FCE5412AD136670020F623 /* PlayerViewController+AdjustBtnFrame.m in Sources */,
+				6B5996422D8BE461009EE6FF /* searchBarThridTypeView.m in Sources */,
 				6B7272542B0CABC600C03F87 /* cachesFileManager.m in Sources */,
 				6BDB85C02D57444400526D1F /* BoxHeartbeatReStartSucView.m in Sources */,
 				6BD780712C2BF7F10014912F /* customerServiceViewController.m in Sources */,