Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
ios1x
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cemarose
ios1x
Commits
da881b65
Commit
da881b65
authored
7 years ago
by
lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ucategory filter
parent
803ed47b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
18 deletions
+20
-18
KWMCategoryModel.h
iCemarose/Class/Model/KWMCategoryModel.h
+2
-0
KWMCategoryVC.m
iCemarose/Class/UI/Category/KWMCategoryVC.m
+17
-17
KWMProductFilterVC.m
iCemarose/Class/UI/Category/KWMProductFilterVC.m
+1
-1
No files found.
iCemarose/Class/Model/KWMCategoryModel.h
View file @
da881b65
...
...
@@ -17,5 +17,7 @@
@property
(
nonatomic
)
NSInteger
page
;
@property
(
nonatomic
)
NSMutableArray
*
products
;
@property
(
nonatomic
)
BUYCollectionSort
sort
;
@property
(
nonatomic
)
NSMutableArray
<
KWMFilter
*>
*
filters
;
@property
(
nonatomic
)
NSString
*
brand
;
@end
This diff is collapsed.
Click to expand it.
iCemarose/Class/UI/Category/KWMCategoryVC.m
View file @
da881b65
...
...
@@ -35,11 +35,11 @@
@property
(
nonatomic
)
NSArray
*
allBrands
;
@property
(
nonatomic
)
BUYCollectionSort
sort
;
//
@property(nonatomic) BUYCollectionSort sort;
@property
(
nonatomic
)
NSMutableArray
<
KWMFilter
*>
*
selectFilters
;
//
@property(nonatomic) NSMutableArray<KWMFilter *> *selectFilters;
@property
(
nonatomic
)
NSString
*
selectBrands
;
//
@property(nonatomic) NSString *selectBrands;
@property
(
nonatomic
)
NSArray
<
KWMCategoryModel
*>*
categories
;
...
...
@@ -108,8 +108,8 @@
[
self
initTbvLeft
];
[
self
initCvRight
];
self
.
sort
=
BUYCollectionSortCollectionDefault
;
self
.
selectBrands
=
@""
;
//
self.sort = BUYCollectionSortCollectionDefault;
//
self.selectBrands = @"";
}
-
(
void
)
initTbvLeft
{
...
...
@@ -195,14 +195,14 @@
KWMBrandFilterVC
*
brandFilterVC
=
(
KWMBrandFilterVC
*
)[
KWMBaseVC
findControllerBy
:[
KWMBrandFilterVC
kwmTag
]
fromStoryboard
:
@"Category"
];
brandFilterVC
.
brandArray
=
self
.
allBrands
;
brandFilterVC
.
delegate
=
self
;
brandFilterVC
.
selectBrand
=
self
.
select
Brands
;
brandFilterVC
.
selectBrand
=
self
.
select
edCategory
.
brand
;
tragetVC
=
brandFilterVC
;
}
else
{
KWMProductFilterVC
*
productFilterVC
=
(
KWMProductFilterVC
*
)[
KWMBaseVC
findControllerBy
:[
KWMProductFilterVC
kwmTag
]
fromStoryboard
:
@"Category"
];
productFilterVC
.
filterMode
=
filterMode
;
productFilterVC
.
delegate
=
self
;
productFilterVC
.
selectedSort
=
self
.
sort
;
productFilterVC
.
selectedTags
=
self
.
select
F
ilters
;
productFilterVC
.
selectedSort
=
self
.
s
electedCategory
.
s
ort
;
productFilterVC
.
selectedTags
=
self
.
select
edCategory
.
f
ilters
;
tragetVC
=
productFilterVC
;
}
CGSize
size
=
[
UIScreen
mainScreen
].
bounds
.
size
;
...
...
@@ -211,8 +211,8 @@
#pragma mark -
-
(
void
)
kwm_onCompleProductFilter
:
(
KWMFilterView
*
)
filterView
{
self
.
selectFilters
=
filterView
.
selectedTags
;
self
.
s
ort
=
filterView
.
selectedSort
;
//
self.selectFilters = filterView.selectedTags;
self
.
s
electedCategory
.
filters
=
filterView
.
selectedTags
;
self
.
selectedCategory
.
sort
=
filterView
.
selectedSort
;
[
self
.
filterTab
close
];
[
self
.
refreshUtil
reLoadData
];
...
...
@@ -226,7 +226,8 @@
#pragma mark -
-
(
void
)
kwm_onCompleteBrandFilter
:
(
NSString
*
)
selectBrand
{
self
.
selectBrands
=
selectBrand
;
// self.selectBrands = selectBrand;
self
.
selectedCategory
.
brand
=
selectBrand
;
[
self
.
filterTab
close
];
[
self
.
refreshUtil
reLoadData
];
[
self
.
cvRightProduct
.
mj_header
beginRefreshing
];
...
...
@@ -257,12 +258,12 @@
__weak
KWMCategoryVC
*
weakSelf
=
self
;
self
.
filterTab
.
userInteractionEnabled
=
false
;
NSMutableArray
*
tags
=
[
KWMFilterUtil
getTagsByFilterArray
:
self
.
selectFilters
];
if
(
!
[
KWMStringUtil
isEmpty
:
self
.
selectBrands
]){
[
tags
addObject
:
self
.
selectBrands
];
}
KWMCategoryModel
*
cmodel
=
self
.
selectedCategory
;
[
self
.
client
getProductsPage
:
cpage
inCollection
:
cmodel
.
collection_id
withTags
:
tags
sortOrder
:
self
.
sort
completion
:^
(
NSArray
*
products
,
NSUInteger
page
,
BOOL
reachedEnd
,
NSError
*
error
){
NSMutableArray
*
tags
=
[
KWMFilterUtil
getTagsByFilterArray
:
cmodel
.
filters
];
if
(
!
cmodel
.
brand
){
[
tags
addObject
:
cmodel
.
brand
];
}
[
self
.
client
getProductsPage
:
cpage
inCollection
:
cmodel
.
collection_id
withTags
:
tags
sortOrder
:
cmodel
.
sort
completion
:^
(
NSArray
*
products
,
NSUInteger
page
,
BOOL
reachedEnd
,
NSError
*
error
){
if
(
cmodel
==
self
.
selectedCategory
)
{
[
weakSelf
.
refreshUtil
hideLoading
];
}
...
...
@@ -292,7 +293,6 @@
-
(
void
)
setSelectedCategory
:
(
KWMCategoryModel
*
)
selectedCategory
{
_selectedCategory
=
selectedCategory
;
self
.
refreshUtil
.
page
=
_selectedCategory
.
page
;
self
.
sort
=
_selectedCategory
.
sort
;
self
.
refreshUtil
.
hasNextPage
=
YES
;
self
.
refreshUtil
.
dataList
=
_selectedCategory
.
products
;
[
self
.
cvRightProduct
reloadData
];
...
...
This diff is collapsed.
Click to expand it.
iCemarose/Class/UI/Category/KWMProductFilterVC.m
View file @
da881b65
...
...
@@ -44,7 +44,7 @@
case
BUYCollectionSortPriceAscending
:
return
3
;
default
:
return
0
;
return
-
1
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment