Commit b692833d by lee

Merge branch 'master' of git.oschina.net:kollway-kollway/newcemarose

parents daacee49 b344e457
......@@ -15,7 +15,7 @@
@property (nonatomic) NSArray *variants;
@property (nonatomic) NSString *handle;
@property (nonatomic) NSArray *options;
@property (nonatomic) NSArray *images;
@property (nonatomic) NSDictionary *image;
@property (nonatomic) NSArray<Optional> *images;
@property (nonatomic) NSDictionary<Optional> *image;
@end
......@@ -21,11 +21,12 @@
if(data == nil){
return self;
}
for (int i = 0; i < data.count; ++i) {
for (int i = 0; i < data.count; i++) {
if(data[i] == nil){
break;
}
KWMDataProduct *dataProduct = [[KWMDataProduct alloc] initWithDictionary:data[i] error:nil];
NSError *error = nil;
KWMDataProduct *dataProduct = [[KWMDataProduct alloc] initWithDictionary:data[i] error:&error];
NSArray *dataArray = data[i][@"variants"];
......
......@@ -358,7 +358,7 @@ static NSString *idStr = @"KWMBrandCaramelCell";
if(self.isSale){
[tags addObject:@"sale"];
}
[self.tbvBrandCaramel.mj_footer resetNoMoreData];
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){
if (error) {
......
......@@ -303,10 +303,13 @@
[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){
weakSelf.cvRightProduct.mj_footer.hidden = reachedEnd;
weakSelf.cvRightProduct.mj_footer.hidden = false;
if (cmodel == self.selectedCategory) {
[weakSelf.refreshUtil hideLoading];
}
if(reachedEnd){
[weakSelf.cvRightProduct.mj_footer endRefreshingWithNoMoreData];
}
weakSelf.filterTab.userInteractionEnabled = true;
if(error){
......@@ -332,6 +335,7 @@
- (void)setSelectedCategory:(KWMCategoryModel *)selectedCategory {
_selectedCategory = selectedCategory;
[self.cvRightProduct.mj_footer resetNoMoreData];
self.refreshUtil.page = _selectedCategory.page;
self.refreshUtil.hasNextPage = YES;
self.refreshUtil.dataList = _selectedCategory.products;
......
......@@ -93,6 +93,7 @@
[weakSelf loadData];
});
}];
[footer setTitle:NO_MORE_DATA forState:MJRefreshStateNoMoreData];
footer.hidden = YES;
return footer;
}
......@@ -218,8 +219,11 @@
if ([self hasNextPage]) {
tableView.mj_footer.hidden = NO;
[tableView.mj_footer resetNoMoreData];
}else{
tableView.mj_footer.hidden = YES;
tableView.mj_footer.hidden = NO;
// tableView.mj_footer.hidden = YES;
[tableView.mj_footer endRefreshingWithNoMoreData];
}
[tableView reloadData];
......
......@@ -144,7 +144,9 @@ typedef enum{
[self.cvHome registerClass:[UICollectionReusableView class] forSupplementaryViewOfKind:CHTCollectionElementKindSectionHeader withReuseIdentifier:[KWMClothingSetsHeader kwmTag]];
[self.cvHome registerClass:[UICollectionReusableView class] forSupplementaryViewOfKind:CHTCollectionElementKindSectionHeader withReuseIdentifier:[KWMMenuHeader kwmTag]];
self.cvHome.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(loadMore)];
MJRefreshAutoNormalFooter *refreshFooter = [MJRefreshAutoNormalFooter footerWithRefreshingTarget:self refreshingAction:@selector(loadMore)];
[refreshFooter setTitle:NO_MORE_DATA forState:MJRefreshStateNoMoreData];
self.cvHome.mj_footer = refreshFooter;
}
- (void) loadMore {
......
......@@ -628,11 +628,13 @@
if(!customer || !self.variant){
return;
}
NSNumber *customerId = customer.identifier?:@(0);
NSString *customerName = customer.lastName?:@"";
BUYProduct *product = (self.color && self.color.product)?self.color.product:self.product;
NSDictionary *parament = @{
@"customer_id":customer.identifier.stringValue,
@"customer_id":customerId.stringValue,
@"customer_email":customer.email,
@"customer_name":customer.lastName ?: @"",
@"customer_name":customerName,
@"product_title":product.title,
@"product_id":product.identifier.stringValue,
@"variant_id":self.variant.identifier.stringValue,
......
......@@ -10,6 +10,7 @@
#import "KWMBrandCaramelCell.h"
#import "KWMSearchFeedBackView.h"
#import "KWMNewProductVC.h"
#import "MJRefresh.h"
@interface KWMSearchFeedbackVC ()<UITableViewDelegate,UITableViewDataSource,KWMSearchFeedBackViewDelegate,KWMBrandCaramelCellDelegate>
@property (nonatomic) KWMSearchFeedBackView *vSearchFB;
......@@ -197,6 +198,7 @@ static NSString *idStr = @"KWMBrandCaramelCell";
if (self.currentPage.integerValue == endPage && endPage != 0) {
[self showToast:@"已经是最后一页"];
[self hideLoading];
[self.tbvSearch.mj_footer endRefreshingWithNoMoreData];
return;
}
NSInteger tagetPage = self.currentPage.integerValue + 1;
......@@ -209,6 +211,10 @@ static NSString *idStr = @"KWMBrandCaramelCell";
[weakSelf hideLoading];
total = result.products.total.integerValue;
endPage = result.products.lastPage.integerValue;
weakSelf.hasNextPage = tagetPage != endPage;
if(tagetPage == 1){
[weakSelf.dataList removeAllObjects];
}
NSArray *products = [result.productList rx_filterWithBlock:^BOOL(BUYProduct *each) {
return each.availableValue;
......
......@@ -163,6 +163,7 @@
[weakSelf loadData];
});
}];
[footer setTitle:NO_MORE_DATA forState:MJRefreshStateNoMoreData];
footer.hidden = YES;
return footer;
}
......
......@@ -56,6 +56,8 @@
#define QQAppId @"##"
#define QQAppKey @"##"
#define NO_MORE_DATA @"------ 沒有啦 ------"
//正式的微信key
#define WechatAppKey @"wx355a497b2a2dd6d5"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment