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
2fb9f93c
Commit
2fb9f93c
authored
7 years ago
by
houweibin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix
parent
387d5843
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
12 deletions
+12
-12
KWMNewHomeVC.m
iCemarose/Class/UI/NewHome/KWMNewHomeVC.m
+12
-12
No files found.
iCemarose/Class/UI/NewHome/KWMNewHomeVC.m
View file @
2fb9f93c
...
...
@@ -354,19 +354,19 @@ typedef enum{
BOOL
isHome
=
[
handle
isEqualToString
:
@"products-list-app-homepage"
];
NSInteger
cpage
=
isHome
?
self
.
page
:
1
;
NSDictionary
*
parameters
=
[
self
getProductCacheKeyDictionary
:
cpage
tags
:
tags
handle
:
handle
];
if
([
self
isUseProductDataCache
:
parameters
valueKeyPath
:
valueKeyPath
page
:
cpage
isHome
:
isHome
]){
return
;
}
BOOL
isUseCache
=
[
self
isUseProductDataCache
:
parameters
valueKeyPath
:
valueKeyPath
page
:
cpage
isHome
:
isHome
];
[
self
.
client
getCollectionByHandle
:
handle
completion
:
^
(
BUYCollection
*
_Nullable
collection
,
NSError
*
_Nullable
error
)
{
[
self
hideLoading
];
if
(
!
error
)
{
[
self
.
client
getProductsPage
:
cpage
inCollection
:
collection
.
identifier
withTags
:
tags
sortOrder
:
BUYCollectionSortCollectionDefault
completion
:^
(
NSArray
<
BUYProduct
*>
*
_Nullable
products
,
NSUInteger
page
,
BOOL
reachedEnd
,
NSError
*
_Nullable
error
)
{
if
(
!
error
)
{
[
KWMPPCacheUtil
saveDataToCache
:
parameters
urlKey
:
CACHE_KEY_SDK_getCollectionByHandle_getProductsPage
products
:
products
];
[
self
setValue
:
products
forKeyPath
:
valueKeyPath
];
[
self
.
cvHome
reloadData
];
if
(
!
isUseCache
){
[
self
setValue
:
products
forKeyPath
:
valueKeyPath
];
[
self
.
cvHome
reloadData
];
}
}
else
{
[
self
showError
:
error
];
//
[self showError:error];
}
if
(
isHome
)
{
self
.
page
=
self
.
page
+
1
;
...
...
@@ -399,15 +399,15 @@ typedef enum{
-
(
void
)
loadHomeData
{
[
self
requestProductWithHandle
:
@"hot-sell-app"
tags
:
nil
valueKeyPath
:
@"recommendHeader.productArray"
];
if
([
self
isUseHomeDataCache
]){
return
;
}
BOOL
isUseCache
=
[
self
isUseHomeDataCache
];
[
self
.
api
getHomeDataWithSuccess
:
^
(
NSURLSessionDataTask
*
task
,
KWMHomeDataResult
*
result
)
{
[
KWMPPCacheUtil
saveDataToCache
:
nil
urlKey
:
CACHE_KEY_getHomeDataWithSuccess
homeData
:
result
.
data
];
self
.
homeData
=
result
.
data
;
[
self
.
cvHome
reloadData
];
if
(
!
isUseCache
){
self
.
homeData
=
result
.
data
;
[
self
.
cvHome
reloadData
];
}
}
failure
:
^
(
NSURLSessionDataTask
*
task
,
NSError
*
error
)
{
[
self
showError
:
error
];
//
[self showError:error];
}];
}
...
...
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