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

caoyunxiao

parent 93d78f62
......@@ -21,6 +21,6 @@
/**
* title
*/
@property (nonatomic,strong) UILabel *titleLabe;
@property (weak, nonatomic) IBOutlet UILabel *titleLabe;
@end
......@@ -37,6 +37,7 @@
{
_responseDatas = responseDatas;
self.titleLabe.text = _responseDatas.name;
}
......
......@@ -137,15 +137,15 @@
} WithFailureBlock:^(id error) {
NSLog(@"%@",error);
}];
}
#pragma mark -获取商品列表数据
- (void)getGoodsListdatas:(GoodsCondition *)conditon returnResponse:(void(^)(GoodsResponse *))finish
{
[self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:[NSString stringWithFormat:@"%@%@",ServerAddress,@"/goods/query"] WithRequestType:0 WithParameter:conditon WithReturnValueBlock:^(id returnValue) {
......@@ -163,8 +163,6 @@
} WithErrorCodeBlock:^(id errorCodeValue) {
} WithFailureBlock:^(id error) {
[self RemoveMBProgressHUDLoding];
......@@ -186,8 +184,17 @@
[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 @@
page.page = 0;
condition.page = page;
[self getSceneLibrarydatas:condition];
}
#pragma mark -获取场景筛选数据
- (void)getdatasAction
{
......
......@@ -9,6 +9,8 @@
#import "SearchViewController.h"
#import "SearchCollectionViewCell.h"
#import "HotCollectionViewCell.h"
#import "ProductLibraryViewController.h"
@interface SearchViewController ()<UICollectionViewDelegate,UICollectionViewDataSource>
......@@ -67,10 +69,35 @@
self.historyCollectionView.dataSource = self;
self.hotCollectionView.dataSource = self;
self.hotCollectionView.delegate = self;
self.hotCollectionView.backgroundColor = [UIColor redColor];
self.historyCollectionView.backgroundColor = [UIColor greenColor];
self.hotCollectionView.alwaysBounceVertical = YES;
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 @@
if ([collectionView isEqual:self.historyCollectionView]) {
SearchCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"firstcell" forIndexPath:indexPath];
cell.searchLabe.text = [self.localSearchArray objectAtIndex_opple:indexPath.item];
return cell;
}
if ([collectionView isEqual:self.hotCollectionView]) {
......@@ -145,7 +172,7 @@
return self.response.list.count;
}
return 20;
return self.localSearchArray.count;
}
......
......@@ -218,11 +218,19 @@
}
#pragma mark -搜索框代理方法
- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField
{
self.selectedIndex = 9;
if (textField.text.length != 0) {
//返回根视图
[[NSNotificationCenter defaultCenter] postNotificationName:POPROOTCONTROLLER object:nil];
}else
{
self.selectedIndex = 9;
}
return YES;
}
......@@ -236,7 +244,9 @@
[textField resignFirstResponder];
self.selectedIndex = 4;
[[NSNotificationCenter defaultCenter] postNotificationName:@"SEARCHINPUTSTRING" object:textField.text];
//搜索
[[NSNotificationCenter defaultCenter] postNotificationName:SEARCHSTRING object:textField.text];
}
return YES;
}
......
......@@ -1167,7 +1167,7 @@
TargetAttributes = {
29706DA01CD082980003C412 = {
CreatedOnToolsVersion = 7.3;
DevelopmentTeam = 39XYE6VSP8;
DevelopmentTeam = W54V2VB863;
};
};
};
......@@ -1517,7 +1517,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = com.gomore.opple;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "f89bebf5-81e2-4c61-9052-8c7bb0f9ddd6";
PROVISIONING_PROFILE = "e9bd3600-5e9c-4cd0-a0d5-b7d8b0882ca8";
STRIP_PNG_TEXT = NO;
USER_HEADER_SEARCH_PATHS = "$(PODS_ROOT)/**";
};
......@@ -1569,7 +1569,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = com.gomore.opple;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "f89bebf5-81e2-4c61-9052-8c7bb0f9ddd6";
PROVISIONING_PROFILE = "e9bd3600-5e9c-4cd0-a0d5-b7d8b0882ca8";
STRIP_PNG_TEXT = NO;
USER_HEADER_SEARCH_PATHS = "$(PODS_ROOT)/**";
};
......
......@@ -134,10 +134,15 @@
#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