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
e01dbf27
Commit
e01dbf27
authored
Dec 14, 2017
by
houweibin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复了下拉刷新及加载更多时出现的问题
parent
5bcdb8f1
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
16 additions
and
34 deletions
+16
-34
KWMOrderListResult.h
iCemarose/Class/Api/Cemarose/KWMOrderListResult.h
+1
-1
KWMOrderListResult.m
iCemarose/Class/Api/Cemarose/KWMOrderListResult.m
+2
-2
KWMCategoryModel.h
iCemarose/Class/Model/KWMCategoryModel.h
+2
-0
KWMCategoryVC.m
iCemarose/Class/UI/Category/KWMCategoryVC.m
+8
-20
KWMBasePageVC.m
iCemarose/Class/UI/KWMBasePageVC.m
+1
-4
KWMOrderVC.m
iCemarose/Class/UI/Mine/KWMOrderVC.m
+1
-7
KWMSearchFeedbackVC.m
iCemarose/Class/UI/Product/KWMSearchFeedbackVC.m
+1
-0
No files found.
iCemarose/Class/Api/Cemarose/KWMOrderListResult.h
View file @
e01dbf27
...
...
@@ -23,6 +23,6 @@
@property
(
nonatomic
)
NSString
<
Optional
>
*
message
;
//数据--存放解析后的model。
@property
(
nonatomic
)
id
<
Ignore
>
data
;
@property
(
nonatomic
)
NSArray
<
Ignore
>
*
data
;
@end
iCemarose/Class/Api/Cemarose/KWMOrderListResult.m
View file @
e01dbf27
...
...
@@ -23,8 +23,8 @@
return
self
;
}
-
(
id
)
buildData
:(
NSDictionary
*
)
jsonDictionary
{
id
result
=
nil
;
-
(
NSArray
*
)
buildData
:(
NSDictionary
*
)
jsonDictionary
{
NSArray
*
result
=
nil
;
if
(
jsonDictionary
){
@try
{
NSArray
*
array
=
(
NSArray
*
)
jsonDictionary
;
...
...
iCemarose/Class/Model/KWMCategoryModel.h
View file @
e01dbf27
...
...
@@ -24,5 +24,7 @@
@property
(
nonatomic
)
CGFloat
offsetY
;
//切换分类后,如果原来有选中筛选规则的需要清除并重新刷新,以此字段标识
@property
(
nonatomic
)
BOOL
isNeedReload
;
//是否滑到底
@property
(
nonatomic
)
BOOL
reachedEnd
;
@end
iCemarose/Class/UI/Category/KWMCategoryVC.m
View file @
e01dbf27
...
...
@@ -39,12 +39,6 @@
@property
(
nonatomic
)
NSArray
*
allBrands
;
//@property(nonatomic) BUYCollectionSort sort;
//@property(nonatomic) NSMutableArray<KWMFilter *> *selectFilters;
//@property(nonatomic) NSString *selectBrands;
@property
(
nonatomic
)
NSArray
<
KWMCategoryModel
*>*
categories
;
@property
(
nonatomic
)
KWMCategoryModel
*
selectedCategory
;
...
...
@@ -398,8 +392,8 @@
}
[
self
.
client
getProductsPage
:
cpage
inCollection
:
cmodel
.
collection_id
withTags
:
tags
sortOrder
:
cmodel
.
sort
completion
:^
(
NSArray
*
products
,
NSUInteger
page
,
BOOL
reachedEnd
,
NSError
*
error
){
weakSelf
.
cvRightProduct
.
mj_footer
.
hidden
=
false
;
weakSelf
.
filterTab
.
userInteractionEnabled
=
true
;
if
(
cmodel
==
self
.
selectedCategory
)
{
// [weakSelf.refreshUtil hideLoading];
if
([
weakSelf
.
cvRightProduct
.
mj_header
isRefreshing
])
{
[
weakSelf
.
cvRightProduct
.
mj_header
endRefreshing
];
}
...
...
@@ -407,21 +401,14 @@
[
weakSelf
.
cvRightProduct
.
mj_footer
endRefreshing
];
}
}
if
(
reachedEnd
){
[
weakSelf
.
cvRightProduct
.
mj_footer
endRefreshingWithNoMoreData
];
}
weakSelf
.
filterTab
.
userInteractionEnabled
=
true
;
if
(
error
){
[
weakSelf
showError
:
error
];
}
else
{
}
else
{
//保存缓存
[
KWMPPCacheUtil
saveDataToCache
:
parameters
urlKey
:
CACHE_KEY_SDK_getProductsPage
products
:
products
];
// weakSelf.refreshUtil.page = page;
cmodel
.
page
=
page
;
// weakSelf.refreshUtil.hasNextPage = !
reachedEnd;
// [weakSelf.refreshUtil appendDataList:products]
;
cmodel
.
reachedEnd
=
reachedEnd
;
weakSelf
.
cvRightProduct
.
mj_footer
.
hidden
=
reachedEnd
;
if
(
cpage
==
1
)
{
[
cmodel
.
products
removeAllObjects
];
}
...
...
@@ -447,9 +434,9 @@
self
.
refreshUtil
.
hasNextPage
=
YES
;
self
.
refreshUtil
.
dataList
=
_selectedCategory
.
products
;
[
self
.
cvRightProduct
reloadData
];
self
.
refreshUtil
.
hasNextPage
=
_selectedCategory
.
reachedEnd
;
self
.
cvRightProduct
.
mj_footer
.
hidden
=
_selectedCategory
.
reachedEnd
;
if
(
_selectedCategory
.
products
.
count
==
0
)
{
// [self requestProducts:1];
// [self.refreshUtil reLoadData];
if
([
self
.
cvRightProduct
.
mj_header
isRefreshing
])
{
[
self
requestProducts
:
1
];
}
else
{
...
...
@@ -460,7 +447,6 @@
}
else
if
([
self
.
cvRightProduct
.
mj_header
isRefreshing
])
{
[
self
.
cvRightProduct
.
mj_header
endRefreshing
];
}
// [self.cvRightProduct reloadData];
}
#pragma mark -cache
...
...
@@ -476,6 +462,8 @@
[
self
.
cvRightProduct
.
mj_footer
endRefreshing
];
}
cmodel
.
page
=
page
;
cmodel
.
reachedEnd
=
NO
;
self
.
cvRightProduct
.
mj_footer
.
hidden
=
NO
;
if
(
page
==
1
)
{
[
cmodel
.
products
removeAllObjects
];
}
...
...
iCemarose/Class/UI/KWMBasePageVC.m
View file @
e01dbf27
...
...
@@ -216,16 +216,13 @@
if
(
result
!=
nil
&&
result
.
count
>
0
)
{
[
self
.
dataList
addObjectsFromArray
:
result
];
}
else
{
[
self
removeFooterView
];
}
if
([
self
hasNextPage
])
{
tableView
.
mj_footer
.
hidden
=
NO
;
[
tableView
.
mj_footer
resetNoMoreData
];
}
else
{
tableView
.
mj_footer
.
hidden
=
NO
;
// tableView.mj_footer.hidden = YES;
tableView
.
mj_footer
.
hidden
=
YES
;
[
tableView
.
mj_footer
endRefreshingWithNoMoreData
];
}
[
tableView
reloadData
];
...
...
iCemarose/Class/UI/Mine/KWMOrderVC.m
View file @
e01dbf27
...
...
@@ -231,19 +231,13 @@
}
return
;
}
weakSelf
.
hasNextPage
=
result
.
data
&&
result
.
data
.
count
>
0
;
if
(
result
.
data
)
{
NSMutableArray
*
showOrders
=
[
NSMutableArray
arrayWithArray
:
result
.
data
];
BUYOrder
*
paidOrder
=
[
self
getPaidOrder
];
if
(
paidOrder
&&
targetPage
==
1
){
[
showOrders
insertObject
:
paidOrder
atIndex
:
0
];
}
// if(showOrders.count <= 50){
// weakSelf.hasNextPage = false;
// weakSelf.tbvOrder.mj_footer.hidden = YES;
// }else{
// weakSelf.hasNextPage = true;
// weakSelf.tbvOrder.mj_footer.hidden = NO;
// }
if
(
targetPage
==
1
){
[
weakSelf
.
dataList
removeAllObjects
];
[
self
.
expandOrderId
removeAllObjects
];
...
...
iCemarose/Class/UI/Product/KWMSearchFeedbackVC.m
View file @
e01dbf27
...
...
@@ -234,6 +234,7 @@ static NSString *idStr = @"KWMBrandCaramelCell";
}
_vSearchFB
.
lbGoodsNum
.
hidden
=
NO
;
}
failure
:^
(
NSURLSessionDataTask
*
task
,
NSError
*
error
)
{
[
weakSelf
hideLoading
];
_vSearchFB
.
lbGoodsNum
.
hidden
=
NO
;
[
weakSelf
showError
:
error
];
NSLog
(
@"error = %@"
,
error
);
...
...
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