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
7edd04d3
Commit
7edd04d3
authored
Jul 10, 2017
by
lee
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
deeplink
parent
6c19ff05
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
57 additions
and
34 deletions
+57
-34
AppDelegate+Deeplink.m
iCemarose/Class/AppDelegate+Deeplink.m
+7
-3
KWMProductDetailVC.m
iCemarose/Class/UI/Product/KWMProductDetailVC.m
+2
-2
KWMSelectedGoodsVC.h
iCemarose/Class/UI/Product/KWMSelectedGoodsVC.h
+3
-0
KWMSelectedGoodsVC.m
iCemarose/Class/UI/Product/KWMSelectedGoodsVC.m
+36
-28
Header-Prefix.h
iCemarose/Header-Prefix.h
+1
-1
Info.plist
iCemarose/Info.plist
+8
-0
No files found.
iCemarose/Class/AppDelegate+Deeplink.m
View file @
7edd04d3
...
@@ -19,14 +19,18 @@
...
@@ -19,14 +19,18 @@
[
routes
addRoute
:
@"/collections/*"
handler
:
^
BOOL
(
NSDictionary
<
NSString
*
,
id
>
*
_Nonnull
parameters
)
{
[
routes
addRoute
:
@"/collections/*"
handler
:
^
BOOL
(
NSDictionary
<
NSString
*
,
id
>
*
_Nonnull
parameters
)
{
NSArray
*
tags
=
parameters
[
JLRouteWildcardComponentsKey
];
NSArray
*
tags
=
parameters
[
JLRouteWildcardComponentsKey
];
NSLog
(
@"trace tags %@"
,[
tags
componentsJoinedByString
:
@","
]);
NSLog
(
@"trace tags %@"
,[
tags
componentsJoinedByString
:
@","
]);
KWMSelectedGoodsVC
*
selectedGoodsVC
=
(
KWMSelectedGoodsVC
*
)[
KWMBaseVC
findControllerBy
:[
KWMSelectedGoodsVC
kwmTag
]
fromStoryboard
:
@"New"
];
selectedGoodsVC
.
ctags
=
tags
;
[[
AppDelegate
mainViewController
].
selectedViewController
pushViewController
:
selectedGoodsVC
animated
:
YES
];
return
YES
;
return
YES
;
}];
}];
[
routes
addRoute
:
@"/products/:id"
handler
:
^
BOOL
(
NSDictionary
<
NSString
*
,
id
>
*
_Nonnull
parameters
)
{
[
routes
addRoute
:
@"/products/:id"
handler
:
^
BOOL
(
NSDictionary
<
NSString
*
,
id
>
*
_Nonnull
parameters
)
{
NSLog
(
@"product id %@"
,
parameters
[
@"id"
]);
NSLog
(
@"product id %@"
,
parameters
[
@"id"
]);
//
KWMProductDetailVC *productDetailVC = (KWMProductDetailVC*)[KWMBaseVC findControllerBy:[KWMProductDetailVC kwmTag] fromStoryboard:@"New"];
KWMProductDetailVC
*
productDetailVC
=
(
KWMProductDetailVC
*
)[
KWMBaseVC
findControllerBy
:[
KWMProductDetailVC
kwmTag
]
fromStoryboard
:
@"New"
];
// productDetailVC.product = brandCell.leftProduct;
// productDetailVC.product = brandCell.leftProduct;
// productDetailVC.handle = parameters[@"id"];
productDetailVC
.
handle
=
parameters
[
@"id"
];
// [[AppDelegate mainViewController].selectedViewController.navigationController pushViewController:productDetailVC animated:YES];
NSLog
(
@"%@"
,[
AppDelegate
mainViewController
].
selectedViewController
);
[[
AppDelegate
mainViewController
].
selectedViewController
pushViewController
:
productDetailVC
animated
:
YES
];
return
YES
;
return
YES
;
}];
}];
}
}
...
...
iCemarose/Class/UI/Product/KWMProductDetailVC.m
View file @
7edd04d3
...
@@ -64,7 +64,7 @@
...
@@ -64,7 +64,7 @@
[
self
initRecommendProduct
];
[
self
initRecommendProduct
];
// [self initShopCartCount];
// [self initShopCartCount];
//刷新product,如果是缓存的product,因为没有字典,所以会发生错误,需要重新请求一个有字典的product
//刷新product,如果是缓存的product,因为没有字典,所以会发生错误,需要重新请求一个有字典的product
if
(
!
self
.
handle
||
(
self
.
product
&&
self
.
product
.
identifier
&&
!
self
.
product
.
JSONDictionary
)){
if
(
self
.
handle
||
(
self
.
product
&&
self
.
product
.
identifier
&&
!
self
.
product
.
JSONDictionary
)){
[
self
getProductBy
:
nil
product
:
self
.
product
];
[
self
getProductBy
:
nil
product
:
self
.
product
];
}
}
NSArray
*
types
=
@[
@"baby"
,
@"girls"
,
@"boys"
,
@"shoes"
,
@"newborn"
];
NSArray
*
types
=
@[
@"baby"
,
@"girls"
,
@"boys"
,
@"shoes"
,
@"newborn"
];
...
@@ -449,6 +449,7 @@
...
@@ -449,6 +449,7 @@
[
self
hideLoading
];
[
self
hideLoading
];
if
(
product
!=
nil
&&
error
==
nil
)
{
if
(
product
!=
nil
&&
error
==
nil
)
{
self
.
product
=
product
;
self
.
product
=
product
;
[
self
.
productDetailView
setData
:
product
];
if
(
productId
){
if
(
productId
){
[
self
kwm_clickCollectionCell
:
product
];
[
self
kwm_clickCollectionCell
:
product
];
}
}
...
@@ -464,5 +465,4 @@
...
@@ -464,5 +465,4 @@
}
}
}
}
@end
@end
iCemarose/Class/UI/Product/KWMSelectedGoodsVC.h
View file @
7edd04d3
...
@@ -32,6 +32,9 @@
...
@@ -32,6 +32,9 @@
@property
(
nonatomic
)
BOOL
isLoading
;
@property
(
nonatomic
)
BOOL
isLoading
;
/**
* deeplink tags
*/
@property
(
strong
,
nonatomic
)
NSArray
*
ctags
;
@property
(
strong
,
nonatomic
)
NSArray
*
ctags
;
@property
(
nonatomic
)
KWMProductType
*
productType
;
@property
(
nonatomic
)
KWMProductType
*
productType
;
...
...
iCemarose/Class/UI/Product/KWMSelectedGoodsVC.m
View file @
7edd04d3
...
@@ -52,6 +52,9 @@ static NSString *idStr = @"KWMBrandCaramelCell";
...
@@ -52,6 +52,9 @@ static NSString *idStr = @"KWMBrandCaramelCell";
self
.
hasNextPage
=
NO
;
self
.
hasNextPage
=
NO
;
self
.
collectionSort
=
BUYCollectionSortCreatedDescending
;
self
.
collectionSort
=
BUYCollectionSortCreatedDescending
;
if
(
self
.
ctags
)
{
self
.
title
=
self
.
ctags
.
firstObject
;
}
else
if
(
self
.
productType
!=
nil
){
if
(
self
.
productType
!=
nil
){
//初始化双行标题栏
//初始化双行标题栏
NSString
*
mTitle
;
NSString
*
mTitle
;
...
@@ -239,6 +242,38 @@ static NSString *idStr = @"KWMBrandCaramelCell";
...
@@ -239,6 +242,38 @@ static NSString *idStr = @"KWMBrandCaramelCell";
}
}
-
(
void
)
requestProductList
{
-
(
void
)
requestProductList
{
__weak
KWMSelectedGoodsVC
*
weakSelf
=
self
;
NSInteger
tagetPage
=
self
.
currentPage
.
integerValue
+
1
;
void
(
^
completion
)(
NSArray
<
BUYProduct
*>
*
,
NSUInteger
,
BOOL
,
NSError
*
)
=
^
(
NSArray
*
products
,
NSUInteger
page
,
BOOL
reachedEnd
,
NSError
*
error
){
[
weakSelf
hideLoading
];
if
(
tagetPage
==
1
){
if
(
!
products
||
products
.
count
==
0
){
self
.
vNoData
.
hidden
=
NO
;
[
weakSelf
.
dataList
removeAllObjects
];
[
weakSelf
.
tbvSelectedGoods
reloadData
];
return
;
}
}
weakSelf
.
isLoading
=
NO
;
if
(
error
==
nil
&&
products
)
{
self
.
vNoData
.
hidden
=
YES
;
weakSelf
.
hasNextPage
=
!
reachedEnd
;
[
weakSelf
appendDataList
:
products
setPage
:
page
];
}
else
{
[
self
showError
:
error
];
NSLog
(
@"Error fetching products: %@"
,
error
);
}
};
if
(
self
.
ctags
)
{
[
self
.
client
getCollectionByHandle
:
self
.
ctags
.
lastObject
completion
:
^
(
BUYCollection
*
_Nullable
collection
,
NSError
*
_Nullable
error
)
{
[
self
.
client
getProductsPage
:
tagetPage
inCollection
:
collection
.
identifier
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
;
}
NSNumber
*
collectionId
;
NSNumber
*
collectionId
;
if
(
self
.
collection
!=
nil
){
if
(
self
.
collection
!=
nil
){
collectionId
=
self
.
collection
.
identifier
;
collectionId
=
self
.
collection
.
identifier
;
...
@@ -269,36 +304,9 @@ static NSString *idStr = @"KWMBrandCaramelCell";
...
@@ -269,36 +304,9 @@ static NSString *idStr = @"KWMBrandCaramelCell";
}
}
self
.
isLoading
=
YES
;
self
.
isLoading
=
YES
;
__weak
KWMSelectedGoodsVC
*
weakSelf
=
self
;
NSInteger
tagetPage
=
self
.
currentPage
.
integerValue
+
1
;
[
self
.
client
getProductsPage
:
tagetPage
inCollection
:
collectionId
withTags
:
tags
sortOrder
:
collectionSort
completion
:^
(
NSArray
*
products
,
NSUInteger
page
,
BOOL
reachedEnd
,
NSError
*
error
){
[
self
.
client
getProductsPage
:
tagetPage
inCollection
:
collectionId
withTags
:
tags
sortOrder
:
collectionSort
completion
:
completion
];
[
weakSelf
hideLoading
];
if
(
tagetPage
==
1
){
if
(
tags
.
count
==
1
){
[
weakSelf
.
userDao
saveCollectionCache
:
products
collectionId
:
collectionId
tags
:
tags
];
}
if
(
!
products
||
products
.
count
==
0
){
self
.
vNoData
.
hidden
=
NO
;
[
weakSelf
.
dataList
removeAllObjects
];
[
weakSelf
.
tbvSelectedGoods
reloadData
];
return
;
}
}
weakSelf
.
isLoading
=
NO
;
if
(
error
==
nil
&&
products
)
{
self
.
vNoData
.
hidden
=
YES
;
weakSelf
.
hasNextPage
=
!
reachedEnd
;
[
weakSelf
appendDataList
:
products
setPage
:
page
];
}
else
{
[
self
showError
:
error
];
NSLog
(
@"Error fetching products: %@"
,
error
);
}
}];
}
}
...
...
iCemarose/Header-Prefix.h
View file @
7edd04d3
...
@@ -60,7 +60,7 @@
...
@@ -60,7 +60,7 @@
#define User_Pay_KEY @"bd3f58f5cd3d7a217ac8c8e655ab52f8"
#define User_Pay_KEY @"bd3f58f5cd3d7a217ac8c8e655ab52f8"
#if DEBUG &&
1
#if DEBUG &&
0
//测试
//测试
#define TestModel @"YES"
#define TestModel @"YES"
...
...
iCemarose/Info.plist
View file @
7edd04d3
...
@@ -46,6 +46,14 @@
...
@@ -46,6 +46,14 @@
<
string
>
cemarose
<
/string
>
<
string
>
cemarose
<
/string
>
<
/
a
rr
a
y
>
<
/
a
rr
a
y
>
<
/
d
i
c
t
>
<
/
d
i
c
t
>
<
d
i
c
t
>
<
k
e
y
>
CFBundleTypeRole
<
/k
e
y
>
<
string
>
Editor
<
/string
>
<
k
e
y
>
CFBundleURLSchemes
<
/k
e
y
>
<
a
rr
a
y
>
<
string
>
I
<
/string
>
<
/
a
rr
a
y
>
<
/
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
>
2017070509
<
/string
>
<
string
>
2017070509
<
/string
>
...
...
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