Commit eecdb637 authored by 勾芒's avatar 勾芒

修复场景筛选,修复商品列表筛选

parent 8bf2169c
...@@ -255,7 +255,41 @@ ...@@ -255,7 +255,41 @@
self.indexPage = 1; self.indexPage = 1;
//搜索 //搜索
if (_selectedCode) { if (_selectedCode) {
switch (self.selectedIndex) {
case 0://风格
{
self.condtionModel.styleEquals = self.selectedCode;
}
break;
case 1://类型
{
self.condtionModel.categoryEquals = self.selectedCode;
}
break;
case 2://空间
{
self.condtionModel.spaceEquals = self.selectedCode;
}
break;
case 3://材质
{
self.condtionModel.materialEqueals = self.selectedCode;
}
break;
case 4://价格
{
//价格字符串切割
NSArray *spacrArray = [self.selectedCode componentsSeparatedByString:@"到"];
self.condtionModel.startprice = [NSNumber numberWithInteger:[[spacrArray objectAtIndex_opple:0] integerValue]];
self.condtionModel.endprice = [NSNumber numberWithInteger:[[spacrArray objectAtIndex_opple:1] integerValue]];
self.condtionModel.categoryEquals = _selectedCode; self.condtionModel.categoryEquals = _selectedCode;
}
break;
default:
break;
}
} }
[self.productCollectionView.mj_footer resetNoMoreData]; [self.productCollectionView.mj_footer resetNoMoreData];
[self getScreeningdatasisRemoveArray:YES]; [self getScreeningdatasisRemoveArray:YES];
...@@ -491,6 +525,7 @@ ...@@ -491,6 +525,7 @@
//监听Segmented菜单 //监听Segmented菜单
[self.screenView.sortingSegmented addTarget:self action:@selector(sortingSegmentedClick:) forControlEvents:UIControlEventValueChanged]; [self.screenView.sortingSegmented addTarget:self action:@selector(sortingSegmentedClick:) forControlEvents:UIControlEventValueChanged];
self.selectedIndex = 0;
[self CreateClassificationView]; [self CreateClassificationView];
[UIView animateWithDuration:0.2 animations:^{ [UIView animateWithDuration:0.2 animations:^{
...@@ -506,14 +541,14 @@ ...@@ -506,14 +541,14 @@
switch (sender.selectedSegmentIndex) { switch (sender.selectedSegmentIndex) {
case 0://分类 case 0://分类
{ {
NSLog(@"分类"); // self.selectedIndex = 0;
[self.screenSecondView removeFromSuperview]; [self.screenSecondView removeFromSuperview];
[self CreateClassificationView]; [self CreateClassificationView];
} }
break; break;
case 1://筛选 case 1://筛选
{ {
NSLog(@"筛选"); // self.selectedIndex = 0;
[self.screenFirstView removeFromSuperview]; [self.screenFirstView removeFromSuperview];
[self CreateScreenSubView]; [self CreateScreenSubView];
} }
...@@ -568,10 +603,15 @@ ...@@ -568,10 +603,15 @@
} }
#pragma mark -选中条件 #pragma mark -选中条件
- (void)selectedItem:(NSString *)typecode - (void)selectedItem:(NSString *)typecode withTitle:(NSString *)title
{ {
[self DismissScreenView]; [self DismissScreenView];
if (self.selectedIndex == 4) {
self.selectedCode = title;
}else
{
self.selectedCode = typecode; self.selectedCode = typecode;
}
[self.productCollectionView.mj_header beginRefreshing]; [self.productCollectionView.mj_header beginRefreshing];
} }
......
...@@ -40,6 +40,11 @@ ...@@ -40,6 +40,11 @@
@property (nonatomic,assign) int totalPages; @property (nonatomic,assign) int totalPages;
/**
* 搜索模型
*/
@property (nonatomic,strong) SceneCondition *conditionModel;
@end @end
@implementation SceneLibraryViewController @implementation SceneLibraryViewController
...@@ -69,6 +74,20 @@ ...@@ -69,6 +74,20 @@
} }
/**
* 上传模型
*/
- (SceneCondition *)conditionModel
{
if (!_conditionModel) {
_conditionModel = [[SceneCondition alloc]init];
}
return _conditionModel;
}
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
// Do any additional setup after loading the view. // Do any additional setup after loading the view.
...@@ -116,14 +135,13 @@ ...@@ -116,14 +135,13 @@
MjRefreshHeaderCustom *headerRefresh = [MjRefreshHeaderCustom headerWithRefreshingBlock:^{ MjRefreshHeaderCustom *headerRefresh = [MjRefreshHeaderCustom headerWithRefreshingBlock:^{
//默认数据 //默认数据
self.indexPage = 1; self.indexPage = 1;
SceneCondition *condition = [[SceneCondition alloc]init];
DataPage *page = [[DataPage alloc]init]; DataPage *page = [[DataPage alloc]init];
page.page = self.indexPage; page.page = self.indexPage;
page.rows = KROWS; page.rows = KROWS;
condition.page = page; self.conditionModel.page = page;
[self.seceneLibararyCollectionView.mj_footer resetNoMoreData]; [self.seceneLibararyCollectionView.mj_footer resetNoMoreData];
[self getSceneLibrarydatas:condition isRemove:YES]; [self getSceneLibrarydatas:self.conditionModel isRemove:YES];
}]; }];
headerRefresh.stateLabel.hidden = YES; headerRefresh.stateLabel.hidden = YES;
...@@ -138,12 +156,11 @@ ...@@ -138,12 +156,11 @@
}else }else
{ {
//默认数据 //默认数据
SceneCondition *condition = [[SceneCondition alloc]init];
DataPage *Newpage = [[DataPage alloc]init]; DataPage *Newpage = [[DataPage alloc]init];
Newpage.page = self.indexPage ++; Newpage.page = self.indexPage ++;
Newpage.rows = KROWS; Newpage.rows = KROWS;
condition.page = Newpage; self.conditionModel.page = Newpage;
[self getSceneLibrarydatas:condition isRemove:NO]; [self getSceneLibrarydatas:self.conditionModel isRemove:NO];
} }
}]; }];
...@@ -287,22 +304,19 @@ ...@@ -287,22 +304,19 @@
- (void)returnCellindexpathwithrow:(NSString *)Type WithcellTitle:(NSString *)title Withselected:(NSInteger)Selected - (void)returnCellindexpathwithrow:(NSString *)Type WithcellTitle:(NSString *)title Withselected:(NSInteger)Selected
{ {
[self dismissViewControllerAnimated:YES completion:nil]; [self dismissViewControllerAnimated:YES completion:nil];
SceneCondition *condition = [[SceneCondition alloc]init];
DataPage *page = [[DataPage alloc]init];
page.page = 1;
condition.page = page;
//空间code //空间code
if (Selected) { if (Selected) {
condition.spaceEquals = Type; self.conditionModel.spaceEquals = Type;
[self.SpaceButton setTitle:title forState:UIControlStateNormal]; [self.SpaceButton setTitle:[title isEqualToString:@"全部"]?@"空间":title forState:UIControlStateNormal];
}else }else
{//风格code {//风格code
condition.styleEquals = Type;
[self.StyleButton setTitle:title forState:UIControlStateNormal]; self.conditionModel.styleEquals = Type;
[self.StyleButton setTitle:[title isEqualToString:@"全部"]?@"风格":title forState:UIControlStateNormal];
} }
[self getSceneLibrarydatas:condition isRemove:YES]; [self.seceneLibararyCollectionView.mj_header beginRefreshing];
} }
......
...@@ -25,8 +25,6 @@ ...@@ -25,8 +25,6 @@
*/ */
@property (nonatomic,strong) ModifyShippingAddressView *addressView; @property (nonatomic,strong) ModifyShippingAddressView *addressView;
/** /**
* 数据源 * 数据源
*/ */
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
@protocol SelectedCollectionItemDelegate <NSObject> @protocol SelectedCollectionItemDelegate <NSObject>
//传回code //传回code
- (void)selectedItem:(NSString *)typecode; - (void)selectedItem:(NSString *)typecode withTitle:(NSString *)title;
@end @end
......
...@@ -85,15 +85,15 @@ ...@@ -85,15 +85,15 @@
#pragma mark -选中代理 #pragma mark -选中代理
- (void)SelectedButtonClickAction:(NSIndexPath *)indexpath - (void)SelectedButtonClickAction:(NSIndexPath *)indexpath
{ {
if ([self.delegate respondsToSelector:@selector(selectedItem:)]) { if ([self.delegate respondsToSelector:@selector(selectedItem:withTitle:)]) {
if (self.selectedIndex == 1 ) { if (self.selectedIndex == 1 ) {
[self.delegate selectedItem:[[[self.datasArray objectAtIndex_opple:indexpath.section] children][indexpath.row] fid]]; [self.delegate selectedItem:[[[self.datasArray objectAtIndex_opple:indexpath.section] children][indexpath.row] fid] withTitle:nil];
}else }else
{ {
[self.delegate selectedItem:[[self.datasArray objectAtIndex_opple:indexpath.row] typecode]]; [self.delegate selectedItem:[[self.datasArray objectAtIndex_opple:indexpath.row] typecode] withTitle:[[self.datasArray objectAtIndex_opple:indexpath.row] typename]];
} }
} }
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="10116" systemVersion="15E65" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES"> <document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="10116" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies> <dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/> <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies> </dependencies>
......
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
SelectedTableViewCell *cell = [self.screeningTableview cellForRowAtIndexPath:[NSIndexPath indexPathForRow:_selectedIndex inSection:0]]; SelectedTableViewCell *cell = [self.screeningTableview cellForRowAtIndexPath:[NSIndexPath indexPathForRow:_selectedIndex inSection:0]];
cell.titleLabe.backgroundColor = [UIColor whiteColor]; cell.titleLabe.backgroundColor = [UIColor whiteColor];
cell.titleLabe.textColor = kMainBlueColor; cell.titleLabe.textColor = kMainBlueColor;
[self.screeningCollectionView reloadData]; [self.screeningCollectionView reloadData];
} }
......
...@@ -1181,7 +1181,7 @@ ...@@ -1181,7 +1181,7 @@
</collectionViewFlowLayout> </collectionViewFlowLayout>
<cells> <cells>
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="productcell" id="J5m-0M-uqb" customClass="ProductCollectionViewCell"> <collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="productcell" id="J5m-0M-uqb" customClass="ProductCollectionViewCell">
<rect key="frame" x="0.0" y="0.0" width="300" height="300"/> <rect key="frame" x="0.0" y="64" width="300" height="300"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center"> <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="0.0" y="0.0" width="300" height="300"/> <rect key="frame" x="0.0" y="0.0" width="300" height="300"/>
...@@ -1263,7 +1263,7 @@ ...@@ -1263,7 +1263,7 @@
<color key="backgroundColor" red="0.93725490199999995" green="0.93725490199999995" blue="0.95686274510000002" alpha="1" colorSpace="calibratedRGB"/> <color key="backgroundColor" red="0.93725490199999995" green="0.93725490199999995" blue="0.95686274510000002" alpha="1" colorSpace="calibratedRGB"/>
<prototypes> <prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="productDetailscell" rowHeight="170" id="Sye-2R-IQf" customClass="ProductDetailsTableViewCell"> <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="productDetailscell" rowHeight="170" id="Sye-2R-IQf" customClass="ProductDetailsTableViewCell">
<rect key="frame" x="0.0" y="49.5" width="768" height="170"/> <rect key="frame" x="0.0" y="113.5" width="768" height="170"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Sye-2R-IQf" id="CXs-SR-gHP"> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Sye-2R-IQf" id="CXs-SR-gHP">
<rect key="frame" x="0.0" y="0.0" width="768" height="169.5"/> <rect key="frame" x="0.0" y="0.0" width="768" height="169.5"/>
......
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