Commit 27d221f0 authored by 勾芒's avatar 勾芒

caoyunxiao

parent 93d78f62
...@@ -21,6 +21,6 @@ ...@@ -21,6 +21,6 @@
/** /**
* title * title
*/ */
@property (nonatomic,strong) UILabel *titleLabe; @property (weak, nonatomic) IBOutlet UILabel *titleLabe;
@end @end
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
{ {
_responseDatas = responseDatas; _responseDatas = responseDatas;
self.titleLabe.text = _responseDatas.name; self.titleLabe.text = _responseDatas.name;
} }
......
...@@ -137,11 +137,11 @@ ...@@ -137,11 +137,11 @@
} WithFailureBlock:^(id error) { } WithFailureBlock:^(id error) {
NSLog(@"%@",error); NSLog(@"%@",error);
}]; }];
} }
#pragma mark -获取商品列表数据 #pragma mark -获取商品列表数据
- (void)getGoodsListdatas:(GoodsCondition *)conditon returnResponse:(void(^)(GoodsResponse *))finish - (void)getGoodsListdatas:(GoodsCondition *)conditon returnResponse:(void(^)(GoodsResponse *))finish
{ {
...@@ -163,8 +163,6 @@ ...@@ -163,8 +163,6 @@
} WithErrorCodeBlock:^(id errorCodeValue) { } WithErrorCodeBlock:^(id errorCodeValue) {
} WithFailureBlock:^(id error) { } WithFailureBlock:^(id error) {
[self RemoveMBProgressHUDLoding]; [self RemoveMBProgressHUDLoding];
...@@ -186,8 +184,17 @@ ...@@ -186,8 +184,17 @@
[self CreatescreeningButton]; [self CreatescreeningButton];
//搜索关键字 //搜索关键字
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(searchInputString:) name:@"SEARCHINPUTSTRING" object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(searchInputString:) name:SEARCHSTRING object:nil];
//返回根视图
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(popTorootviewController:) name:POPROOTCONTROLLER object:nil];
}
#pragma mark -返回根视图
- (void)popTorootviewController:(NSNotification *)not
{
[self.navigationController popViewControllerAnimated:YES];
} }
......
...@@ -93,9 +93,15 @@ ...@@ -93,9 +93,15 @@
page.page = 0; page.page = 0;
condition.page = page; condition.page = page;
[self getSceneLibrarydatas:condition]; [self getSceneLibrarydatas:condition];
} }
#pragma mark -获取场景筛选数据 #pragma mark -获取场景筛选数据
- (void)getdatasAction - (void)getdatasAction
{ {
......
...@@ -9,6 +9,8 @@ ...@@ -9,6 +9,8 @@
#import "SearchViewController.h" #import "SearchViewController.h"
#import "SearchCollectionViewCell.h" #import "SearchCollectionViewCell.h"
#import "HotCollectionViewCell.h" #import "HotCollectionViewCell.h"
#import "ProductLibraryViewController.h"
@interface SearchViewController ()<UICollectionViewDelegate,UICollectionViewDataSource> @interface SearchViewController ()<UICollectionViewDelegate,UICollectionViewDataSource>
...@@ -67,10 +69,35 @@ ...@@ -67,10 +69,35 @@
self.historyCollectionView.dataSource = self; self.historyCollectionView.dataSource = self;
self.hotCollectionView.dataSource = self; self.hotCollectionView.dataSource = self;
self.hotCollectionView.delegate = self; self.hotCollectionView.delegate = self;
self.hotCollectionView.backgroundColor = [UIColor redColor]; self.hotCollectionView.alwaysBounceVertical = YES;
self.historyCollectionView.backgroundColor = [UIColor greenColor]; self.historyCollectionView.alwaysBounceVertical = YES;
//保存输入内容
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(searchInputString:) name:SEARCHSTRING object:nil];
//返回根视图
// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(popTorootviewController:) name:POPROOTCONTROLLER object:nil];
}
#pragma mark -返回根视图
- (void)popTorootviewController:(NSNotification *)not
{
[self.navigationController popViewControllerAnimated:YES];
}
#pragma mark -输入内容
- (void)searchInputString:(NSNotification *)not
{
[self.localSearchArray addObject:not.object];
ProductLibraryViewController *productVC = [[self getStoryboardWithName] instantiateViewControllerWithIdentifier:@"productlibrary"];
UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:productVC];
[self.navigationController pushViewController:nav animated:YES];
} }
...@@ -124,7 +151,7 @@ ...@@ -124,7 +151,7 @@
if ([collectionView isEqual:self.historyCollectionView]) { if ([collectionView isEqual:self.historyCollectionView]) {
SearchCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"firstcell" forIndexPath:indexPath]; SearchCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"firstcell" forIndexPath:indexPath];
cell.searchLabe.text = [self.localSearchArray objectAtIndex_opple:indexPath.item];
return cell; return cell;
} }
if ([collectionView isEqual:self.hotCollectionView]) { if ([collectionView isEqual:self.hotCollectionView]) {
...@@ -145,7 +172,7 @@ ...@@ -145,7 +172,7 @@
return self.response.list.count; return self.response.list.count;
} }
return 20; return self.localSearchArray.count;
} }
......
...@@ -218,11 +218,19 @@ ...@@ -218,11 +218,19 @@
} }
#pragma mark -搜索框代理方法 #pragma mark -搜索框代理方法
- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField - (BOOL)textFieldShouldBeginEditing:(UITextField *)textField
{ {
if (textField.text.length != 0) {
//返回根视图
[[NSNotificationCenter defaultCenter] postNotificationName:POPROOTCONTROLLER object:nil];
}else
{
self.selectedIndex = 9; self.selectedIndex = 9;
}
return YES; return YES;
} }
...@@ -236,7 +244,9 @@ ...@@ -236,7 +244,9 @@
[textField resignFirstResponder]; [textField resignFirstResponder];
self.selectedIndex = 4; self.selectedIndex = 4;
[[NSNotificationCenter defaultCenter] postNotificationName:@"SEARCHINPUTSTRING" object:textField.text];
//搜索
[[NSNotificationCenter defaultCenter] postNotificationName:SEARCHSTRING object:textField.text];
} }
return YES; return YES;
} }
......
...@@ -1167,7 +1167,7 @@ ...@@ -1167,7 +1167,7 @@
TargetAttributes = { TargetAttributes = {
29706DA01CD082980003C412 = { 29706DA01CD082980003C412 = {
CreatedOnToolsVersion = 7.3; CreatedOnToolsVersion = 7.3;
DevelopmentTeam = 39XYE6VSP8; DevelopmentTeam = W54V2VB863;
}; };
}; };
}; };
...@@ -1517,7 +1517,7 @@ ...@@ -1517,7 +1517,7 @@
); );
PRODUCT_BUNDLE_IDENTIFIER = com.gomore.opple; PRODUCT_BUNDLE_IDENTIFIER = com.gomore.opple;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "f89bebf5-81e2-4c61-9052-8c7bb0f9ddd6"; PROVISIONING_PROFILE = "e9bd3600-5e9c-4cd0-a0d5-b7d8b0882ca8";
STRIP_PNG_TEXT = NO; STRIP_PNG_TEXT = NO;
USER_HEADER_SEARCH_PATHS = "$(PODS_ROOT)/**"; USER_HEADER_SEARCH_PATHS = "$(PODS_ROOT)/**";
}; };
...@@ -1569,7 +1569,7 @@ ...@@ -1569,7 +1569,7 @@
); );
PRODUCT_BUNDLE_IDENTIFIER = com.gomore.opple; PRODUCT_BUNDLE_IDENTIFIER = com.gomore.opple;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "f89bebf5-81e2-4c61-9052-8c7bb0f9ddd6"; PROVISIONING_PROFILE = "e9bd3600-5e9c-4cd0-a0d5-b7d8b0882ca8";
STRIP_PNG_TEXT = NO; STRIP_PNG_TEXT = NO;
USER_HEADER_SEARCH_PATHS = "$(PODS_ROOT)/**"; USER_HEADER_SEARCH_PATHS = "$(PODS_ROOT)/**";
}; };
......
...@@ -134,10 +134,15 @@ ...@@ -134,10 +134,15 @@
#define ServerAddress @"http://139.196.195.30:8090/opple-web/app" #define ServerAddress @"http://139.196.195.30:8090/opple-web/app"
/**
* 搜索框输入通知
*/
#define SEARCHSTRING @"SEARCHINPUTSTRING"
/**
* 搜索框返回根视图
*/
#define POPROOTCONTROLLER @"POPROOTCONTROLLER"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment