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
3a6a3a66
Commit
3a6a3a66
authored
Aug 23, 2017
by
lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug
parent
4f1fd299
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
64 additions
and
15 deletions
+64
-15
KWMBasePageVC.m
iCemarose/Class/UI/KWMBasePageVC.m
+2
-2
KWMNewHomeVC.m
iCemarose/Class/UI/NewHome/KWMNewHomeVC.m
+4
-0
KWMSelectedGoodsVC.m
iCemarose/Class/UI/Product/KWMSelectedGoodsVC.m
+36
-3
KWMFilterView.h
iCemarose/Class/View/FilterView/KWMFilterView.h
+2
-0
KWMFilterView.m
iCemarose/Class/View/FilterView/KWMFilterView.m
+8
-8
KWMNormalFilterView.h
iCemarose/Class/View/FilterView/KWMNormalFilterView.h
+2
-0
KWMNormalFilterView.m
iCemarose/Class/View/FilterView/KWMNormalFilterView.m
+8
-0
Info.plist
iCemarose/Info.plist
+2
-2
No files found.
iCemarose/Class/UI/KWMBasePageVC.m
View file @
3a6a3a66
...
@@ -35,9 +35,9 @@
...
@@ -35,9 +35,9 @@
__weak
KWMBasePageVC
*
weakSelf
=
self
;
__weak
KWMBasePageVC
*
weakSelf
=
self
;
KWMLoadingHeader
*
header
=
[
KWMLoadingHeader
headerWithRefreshingBlock
:
^
{
KWMLoadingHeader
*
header
=
[
KWMLoadingHeader
headerWithRefreshingBlock
:
^
{
dispatch_after
(
dispatch_time
(
DISPATCH_TIME_NOW
,
(
int64_t
)(
2
.
0
*
NSEC_PER_SEC
)),
dispatch_get_main_queue
(),
^
{
//
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2.0 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[
weakSelf
reLoadData
];
[
weakSelf
reLoadData
];
});
//
});
}];
}];
// header.lastUpdatedTimeLabel.hidden = YES;
// header.lastUpdatedTimeLabel.hidden = YES;
// header.stateLabel.hidden = YES;
// header.stateLabel.hidden = YES;
...
...
iCemarose/Class/UI/NewHome/KWMNewHomeVC.m
View file @
3a6a3a66
...
@@ -187,7 +187,9 @@ typedef enum{
...
@@ -187,7 +187,9 @@ typedef enum{
}
}
-
(
void
)
kwm_onClickHotSalesAd
:
(
KWMAdvertisement
*
)
ad
{
-
(
void
)
kwm_onClickHotSalesAd
:
(
KWMAdvertisement
*
)
ad
{
if
(
!
[
KWMStringUtil
isBlank
:
ad
.
url
])
{
[
self
openURLWithString
:
ad
.
url
];
[
self
openURLWithString
:
ad
.
url
];
}
}
}
-
(
void
)
kwm_onClickFocusImage
{
-
(
void
)
kwm_onClickFocusImage
{
...
@@ -198,7 +200,9 @@ typedef enum{
...
@@ -198,7 +200,9 @@ typedef enum{
-
(
void
)
kwm_gotoClothingSetsPage
{
-
(
void
)
kwm_gotoClothingSetsPage
{
// [self openURLWithString:[NSString stringWithFormat:@"https://cemarose.myshopify.com/collections/%@",self.clotingSetsHandle]];
// [self openURLWithString:[NSString stringWithFormat:@"https://cemarose.myshopify.com/collections/%@",self.clotingSetsHandle]];
if
(
!
[
KWMStringUtil
isBlank
:
self
.
homeData
.
clothing_sets
.
url
])
{
[
self
openURLWithString
:
self
.
homeData
.
clothing_sets
.
url
];
[
self
openURLWithString
:
self
.
homeData
.
clothing_sets
.
url
];
}
}
}
#pragma mark - KWMRecommendDelegate KWMClothingSetsDelegate KWMHotSalesDelegate
#pragma mark - KWMRecommendDelegate KWMClothingSetsDelegate KWMHotSalesDelegate
...
...
iCemarose/Class/UI/Product/KWMSelectedGoodsVC.m
View file @
3a6a3a66
...
@@ -109,6 +109,36 @@ static NSString *idStr = @"KWMBrandCaramelCell";
...
@@ -109,6 +109,36 @@ static NSString *idStr = @"KWMBrandCaramelCell";
}
}
tags
=
[
NSArray
arrayWithObjects
:
tag
,
nil
];
tags
=
[
NSArray
arrayWithObjects
:
tag
,
nil
];
}
}
NSMutableDictionary
*
sf
=
[
NSMutableDictionary
new
];
for
(
NSString
*
tag
in
self
.
ctags
)
{
for
(
KWMFilter
*
kf
in
self
.
filterView
.
allTags
)
{
NSString
*
key
=
nil
;
for
(
NSString
*
it
in
kf
.
tags
)
{
if
([[
KWMFilterUtil
transformTag
:
nil
tag
:
it
]
isEqualToString
:
tag
])
{
key
=
it
;
break
;
}
}
if
(
key
)
{
if
(
sf
[
kf
.
group
])
{
[
sf
[
kf
.
group
]
addObject
:
key
];
}
else
{
[
sf
setValue
:[[
NSMutableArray
alloc
]
initWithObjects
:
key
,
nil
]
forKey
:
kf
.
group
];
}
break
;
}
}
}
if
([
sf
count
])
{
[
self
.
filterView
setSelectedTags
:[[[
sf
allKeys
]
rx_mapWithBlock
:
^
id
(
id
each
)
{
KWMFilter
*
r
=
[[
KWMFilter
alloc
]
init
];
r
.
group
=
each
;
r
.
tags
=
sf
[
each
];
return
r
;
}]
mutableCopy
]];
}
NSArray
*
products
=
[
self
.
userDao
getCollectionCache
:
collectionId
tags
:
tags
];
NSArray
*
products
=
[
self
.
userDao
getCollectionCache
:
collectionId
tags
:
tags
];
if
(
products
&&
products
.
count
>
0
){
if
(
products
&&
products
.
count
>
0
){
...
@@ -148,7 +178,7 @@ static NSString *idStr = @"KWMBrandCaramelCell";
...
@@ -148,7 +178,7 @@ static NSString *idStr = @"KWMBrandCaramelCell";
-
(
void
)
kwm_onFilterFinish
:
(
KWMFilterView
*
)
filterView
{
-
(
void
)
kwm_onFilterFinish
:
(
KWMFilterView
*
)
filterView
{
self
.
filterView
.
hidden
=
YES
;
self
.
filterView
.
hidden
=
YES
;
[
self
.
filterTab
close
];
[
self
.
filterTab
close
];
[
self
reLoadData
];
//
[self reLoadData];
[
self
.
tbvSelectedGoods
.
mj_header
beginRefreshing
];
[
self
.
tbvSelectedGoods
.
mj_header
beginRefreshing
];
[
self
.
tbvSelectedGoods
setContentOffset
:
CGPointMake
(
0
,
0
)
animated
:
YES
];
[
self
.
tbvSelectedGoods
setContentOffset
:
CGPointMake
(
0
,
0
)
animated
:
YES
];
}
}
...
@@ -270,7 +300,11 @@ static NSString *idStr = @"KWMBrandCaramelCell";
...
@@ -270,7 +300,11 @@ static NSString *idStr = @"KWMBrandCaramelCell";
};
};
if
(
self
.
handle
)
{
if
(
self
.
handle
)
{
[
self
.
client
getCollectionByHandle
:
self
.
handle
completion
:
^
(
BUYCollection
*
_Nullable
collection
,
NSError
*
_Nullable
error
)
{
[
self
.
client
getCollectionByHandle
:
self
.
handle
completion
:
^
(
BUYCollection
*
_Nullable
collection
,
NSError
*
_Nullable
error
)
{
[
self
.
client
getProductsPage
:
tagetPage
inCollection
:
collection
.
identifier
withTags
:
self
.
ctags
sortOrder
:
self
.
filterView
.
selectedSort
completion
:
completion
];
NSArray
*
tags
=
[
KWMFilterUtil
getTagsByFilterArray
:
self
.
filterView
.
selectedTags
];
if
([
tags
count
]
<=
0
)
{
tags
=
self
.
ctags
;
}
[
self
.
client
getProductsPage
:
tagetPage
inCollection
:
collection
.
identifier
withTags
:
tags
sortOrder
:
self
.
filterView
.
selectedSort
completion
:
completion
];
}];
}];
// [self.client getProductsPage:tagetPage inCollection:nil withTags:self.ctags sortOrder:self.filterView.selectedSort completion:completion];
// [self.client getProductsPage:tagetPage inCollection:nil withTags:self.ctags sortOrder:self.filterView.selectedSort completion:completion];
return
;
return
;
...
@@ -310,5 +344,4 @@ static NSString *idStr = @"KWMBrandCaramelCell";
...
@@ -310,5 +344,4 @@ static NSString *idStr = @"KWMBrandCaramelCell";
[
self
.
client
getProductsPage
:
tagetPage
inCollection
:
collectionId
withTags
:
tags
sortOrder
:
collectionSort
completion
:
completion
];
[
self
.
client
getProductsPage
:
tagetPage
inCollection
:
collectionId
withTags
:
tags
sortOrder
:
collectionSort
completion
:
completion
];
}
}
@end
@end
iCemarose/Class/View/FilterView/KWMFilterView.h
View file @
3a6a3a66
...
@@ -30,6 +30,8 @@ typedef NS_ENUM(NSInteger, KWMFilterMode) {
...
@@ -30,6 +30,8 @@ typedef NS_ENUM(NSInteger, KWMFilterMode) {
@interface
KWMFilterView
:
UIView
<
UICollectionViewDelegate
,
UICollectionViewDataSource
>
@interface
KWMFilterView
:
UIView
<
UICollectionViewDelegate
,
UICollectionViewDataSource
>
@property
(
nonatomic
)
NSArray
<
KWMFilter
*>*
filterData
;
@property
(
nonatomic
)
KWMFilterMode
filterMode
;
@property
(
nonatomic
)
KWMFilterMode
filterMode
;
@property
(
nonatomic
)
NSMutableArray
<
KWMFilter
*>
*
selectedTags
;
@property
(
nonatomic
)
NSMutableArray
<
KWMFilter
*>
*
selectedTags
;
...
...
iCemarose/Class/View/FilterView/KWMFilterView.m
View file @
3a6a3a66
...
@@ -26,7 +26,7 @@ static NSString *filterDataString = @"[{\"group\":\"SEASON\",\"tags\":[\"Autumn/
...
@@ -26,7 +26,7 @@ static NSString *filterDataString = @"[{\"group\":\"SEASON\",\"tags\":[\"Autumn/
@end
@end
@implementation
KWMFilterView
{
@implementation
KWMFilterView
{
NSArray
<
KWMFilter
*>*
filterData
;
NSArray
*
sortData
;
NSArray
*
sortData
;
...
@@ -82,7 +82,7 @@ static NSString *filterDataString = @"[{\"group\":\"SEASON\",\"tags\":[\"Autumn/
...
@@ -82,7 +82,7 @@ static NSString *filterDataString = @"[{\"group\":\"SEASON\",\"tags\":[\"Autumn/
[
mutableArray
addObject
:
result
];
[
mutableArray
addObject
:
result
];
}
}
}
}
filterData
=
[
mutableArray
copy
];
self
.
filterData
=
[
mutableArray
copy
];
}
}
-
(
void
)
initSortData
{
-
(
void
)
initSortData
{
...
@@ -157,12 +157,12 @@ static NSString *filterDataString = @"[{\"group\":\"SEASON\",\"tags\":[\"Autumn/
...
@@ -157,12 +157,12 @@ static NSString *filterDataString = @"[{\"group\":\"SEASON\",\"tags\":[\"Autumn/
#pragma mark - UICollectionViewDataSource
#pragma mark - UICollectionViewDataSource
-
(
NSInteger
)
numberOfSectionsInCollectionView
:
(
UICollectionView
*
)
collectionView
{
-
(
NSInteger
)
numberOfSectionsInCollectionView
:
(
UICollectionView
*
)
collectionView
{
NSInteger
count
=
self
.
filterMode
==
ModeFilter
?
filterData
.
count
:
1
;
NSInteger
count
=
self
.
filterMode
==
ModeFilter
?
self
.
filterData
.
count
:
1
;
return
count
;
return
count
;
}
}
-
(
NSInteger
)
collectionView
:
(
UICollectionView
*
)
collectionView
numberOfItemsInSection
:
(
NSInteger
)
section
{
-
(
NSInteger
)
collectionView
:
(
UICollectionView
*
)
collectionView
numberOfItemsInSection
:
(
NSInteger
)
section
{
NSUInteger
count
=
self
.
filterMode
==
ModeFilter
?
filterData
[
section
].
tags
.
count
:
4
;
NSUInteger
count
=
self
.
filterMode
==
ModeFilter
?
self
.
filterData
[
section
].
tags
.
count
:
4
;
return
count
;
return
count
;
}
}
...
@@ -170,7 +170,7 @@ static NSString *filterDataString = @"[{\"group\":\"SEASON\",\"tags\":[\"Autumn/
...
@@ -170,7 +170,7 @@ static NSString *filterDataString = @"[{\"group\":\"SEASON\",\"tags\":[\"Autumn/
KWMFilterViewCell
*
filterCell
=
[
collectionView
dequeueReusableCellWithReuseIdentifier
:
NSStringFromClass
([
KWMFilterViewCell
class
])
forIndexPath
:
indexPath
];
KWMFilterViewCell
*
filterCell
=
[
collectionView
dequeueReusableCellWithReuseIdentifier
:
NSStringFromClass
([
KWMFilterViewCell
class
])
forIndexPath
:
indexPath
];
//更新cell
//更新cell
if
(
self
.
filterMode
==
ModeFilter
){
if
(
self
.
filterMode
==
ModeFilter
){
KWMFilter
*
filter
=
filterData
[
indexPath
.
section
];
KWMFilter
*
filter
=
self
.
filterData
[
indexPath
.
section
];
NSString
*
tag
=
filter
.
tags
[
indexPath
.
row
];
NSString
*
tag
=
filter
.
tags
[
indexPath
.
row
];
filterCell
.
text
=
tag
;
filterCell
.
text
=
tag
;
filterCell
.
isSelectedFilter
=
[
self
isSelectedTag
:
filter
tag
:
tag
];
filterCell
.
isSelectedFilter
=
[
self
isSelectedTag
:
filter
tag
:
tag
];
...
@@ -189,7 +189,7 @@ static NSString *filterDataString = @"[{\"group\":\"SEASON\",\"tags\":[\"Autumn/
...
@@ -189,7 +189,7 @@ static NSString *filterDataString = @"[{\"group\":\"SEASON\",\"tags\":[\"Autumn/
//获得cell要显示的文字
//获得cell要显示的文字
NSString
*
text
=
@""
;
NSString
*
text
=
@""
;
if
(
self
.
filterMode
==
ModeFilter
){
if
(
self
.
filterMode
==
ModeFilter
){
KWMFilter
*
filter
=
filterData
[
indexPath
.
section
];
KWMFilter
*
filter
=
self
.
filterData
[
indexPath
.
section
];
text
=
filter
.
tags
[
indexPath
.
row
];
text
=
filter
.
tags
[
indexPath
.
row
];
}
}
//获得字体,计算文字显示所需高度
//获得字体,计算文字显示所需高度
...
@@ -225,7 +225,7 @@ static NSString *filterDataString = @"[{\"group\":\"SEASON\",\"tags\":[\"Autumn/
...
@@ -225,7 +225,7 @@ static NSString *filterDataString = @"[{\"group\":\"SEASON\",\"tags\":[\"Autumn/
}
}
//更新label
//更新label
if
(
self
.
filterMode
==
ModeFilter
){
if
(
self
.
filterMode
==
ModeFilter
){
KWMFilter
*
filter
=
filterData
[
indexPath
.
section
];
KWMFilter
*
filter
=
self
.
filterData
[
indexPath
.
section
];
headerLabel
.
text
=
filter
.
group
;
headerLabel
.
text
=
filter
.
group
;
}
else
{
}
else
{
headerLabel
.
text
=
@"排序"
;
headerLabel
.
text
=
@"排序"
;
...
@@ -236,7 +236,7 @@ static NSString *filterDataString = @"[{\"group\":\"SEASON\",\"tags\":[\"Autumn/
...
@@ -236,7 +236,7 @@ static NSString *filterDataString = @"[{\"group\":\"SEASON\",\"tags\":[\"Autumn/
-
(
void
)
collectionView
:
(
UICollectionView
*
)
collectionView
didSelectItemAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
-
(
void
)
collectionView
:
(
UICollectionView
*
)
collectionView
didSelectItemAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
if
(
self
.
filterMode
==
ModeFilter
){
if
(
self
.
filterMode
==
ModeFilter
){
KWMFilter
*
filter
=
filterData
[
indexPath
.
section
];
KWMFilter
*
filter
=
self
.
filterData
[
indexPath
.
section
];
NSString
*
tag
=
filter
.
tags
[
indexPath
.
row
];
NSString
*
tag
=
filter
.
tags
[
indexPath
.
row
];
[
self
refreshSelectedTags
:
filter
tag
:
tag
];
[
self
refreshSelectedTags
:
filter
tag
:
tag
];
...
...
iCemarose/Class/View/FilterView/KWMNormalFilterView.h
View file @
3a6a3a66
...
@@ -17,6 +17,8 @@
...
@@ -17,6 +17,8 @@
@property
(
nonatomic
)
NSMutableArray
<
KWMFilter
*>
*
selectedTags
;
@property
(
nonatomic
)
NSMutableArray
<
KWMFilter
*>
*
selectedTags
;
@property
(
nonatomic
)
NSArray
<
KWMFilter
*>
*
allTags
;
@property
(
nonatomic
)
BUYCollectionSort
selectedSort
;
@property
(
nonatomic
)
BUYCollectionSort
selectedSort
;
-
(
void
)
show
;
-
(
void
)
show
;
...
...
iCemarose/Class/View/FilterView/KWMNormalFilterView.m
View file @
3a6a3a66
...
@@ -65,6 +65,14 @@
...
@@ -65,6 +65,14 @@
return
self
.
filterView
.
selectedTags
;
return
self
.
filterView
.
selectedTags
;
}
}
-
(
void
)
setSelectedTags
:
(
NSMutableArray
<
KWMFilter
*>
*
)
selectedTags
{
self
.
filterView
.
selectedTags
=
selectedTags
;
}
-
(
NSArray
<
KWMFilter
*>
*
)
allTags
{
return
self
.
filterView
.
filterData
;
}
-
(
void
)
onClickBlank
:
(
id
)
sender
{
-
(
void
)
onClickBlank
:
(
id
)
sender
{
if
(
self
.
delegate
&&
[
self
.
delegate
respondsToSelector
:
@selector
(
kwm_onClickFilterBlank
:)]){
if
(
self
.
delegate
&&
[
self
.
delegate
respondsToSelector
:
@selector
(
kwm_onClickFilterBlank
:)]){
[
self
.
delegate
kwm_onClickFilterBlank
:
self
.
filterView
];
[
self
.
delegate
kwm_onClickFilterBlank
:
self
.
filterView
];
...
...
iCemarose/Info.plist
View file @
3a6a3a66
...
@@ -15,7 +15,7 @@
...
@@ -15,7 +15,7 @@
<
k
e
y
>
CFBundlePackageType
<
/k
e
y
>
<
k
e
y
>
CFBundlePackageType
<
/k
e
y
>
<
string
>
APPL
<
/string
>
<
string
>
APPL
<
/string
>
<
k
e
y
>
CFBundleShortVersionString
<
/k
e
y
>
<
k
e
y
>
CFBundleShortVersionString
<
/k
e
y
>
<
string
>
1.5.
4
<
/string
>
<
string
>
1.5.
5
<
/string
>
<
k
e
y
>
CFBundleSignature
<
/k
e
y
>
<
k
e
y
>
CFBundleSignature
<
/k
e
y
>
<
string
>
????
<
/string
>
<
string
>
????
<
/string
>
<
k
e
y
>
CFBundleURLTypes
<
/k
e
y
>
<
k
e
y
>
CFBundleURLTypes
<
/k
e
y
>
...
@@ -56,7 +56,7 @@
...
@@ -56,7 +56,7 @@
<
/
d
i
c
t
>
<
/
d
i
c
t
>
<
/
a
rr
a
y
>
<
/
a
rr
a
y
>
<
k
e
y
>
CFBundleVersion
<
/k
e
y
>
<
k
e
y
>
CFBundleVersion
<
/k
e
y
>
<
string
>
20170808
14
<
/string
>
<
string
>
20170808
21
<
/string
>
<
k
e
y
>
ITSAppUsesNonExemptEncryption
<
/k
e
y
>
<
k
e
y
>
ITSAppUsesNonExemptEncryption
<
/k
e
y
>
<
fa
ls
e
/
>
<
fa
ls
e
/
>
<
k
e
y
>
LSApplicationQueriesSchemes
<
/k
e
y
>
<
k
e
y
>
LSApplicationQueriesSchemes
<
/k
e
y
>
...
...
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