Commit 50dec2ec by lee

u hide soldout product

parent fb2ff498
...@@ -29,5 +29,6 @@ pod 'SFFocusViewLayout', '~> 2.0' ...@@ -29,5 +29,6 @@ pod 'SFFocusViewLayout', '~> 2.0'
pod 'YYWebImage' pod 'YYWebImage'
pod 'MagicalRecord','~> 2.2' pod 'MagicalRecord','~> 2.2'
pod 'Mobile-Buy-SDK',:git => 'https://github.com/houweibin/mobile-buy-sdk-ios' pod 'Mobile-Buy-SDK',:git => 'https://github.com/houweibin/mobile-buy-sdk-ios'
#pod 'Mobile-Buy-SDK',:path => '../Pods/mobile-buy-sdk-ios'
end end
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#import "KWMFilterVC.h" #import "KWMFilterVC.h"
#import "KWMImageBlurUtil.h" #import "KWMImageBlurUtil.h"
#import "KWMShoppingCart.h" #import "KWMShoppingCart.h"
#import <RXCollections/RXCollection.h>
@interface KWMBrandCaramelVC ()<UITableViewDelegate,UITableViewDataSource,KWMBrandCaramelCellDelegate> @interface KWMBrandCaramelVC ()<UITableViewDelegate,UITableViewDataSource,KWMBrandCaramelCellDelegate>
@property (nonatomic) KWMBarandSelectView *barandSelectView; @property (nonatomic) KWMBarandSelectView *barandSelectView;
...@@ -413,6 +414,9 @@ static NSString *idStr = @"KWMBrandCaramelCell"; ...@@ -413,6 +414,9 @@ static NSString *idStr = @"KWMBrandCaramelCell";
} }
[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:^(NSArray *products,NSUInteger page, BOOL reachedEnd, NSError *error){
products = [products rx_filterWithBlock:^BOOL(BUYProduct *each) {
return each.availableValue;
}];
if (error != nil) { if (error != nil) {
[self showError:error]; [self showError:error];
NSLog(@"Error fetching products: %@", error); NSLog(@"Error fetching products: %@", error);
......
...@@ -62,8 +62,9 @@ ...@@ -62,8 +62,9 @@
fulfilledCount += 1; fulfilledCount += 1;
} }
}]; }];
NSString *fulfillmentStatus = fulfilledCount == 0 ? @"待发货" : fulfilledCount == order.lineItems.count ? @"已发货" : @"部分发货"; // TODO: 加入取消订单的状态
self.lbOrderStatus.text = fulfillmentStatus; NSString *orderStatus = order.cancelled ? @"已取消" : fulfilledCount == 0 ? @"待发货" : fulfilledCount == order.lineItems.count ? @"已发货" : @"部分发货";
self.lbOrderStatus.text = orderStatus;
} }
} }
......
...@@ -211,6 +211,7 @@ ...@@ -211,6 +211,7 @@
[self showLoading]; [self showLoading];
__weak KWMOrderVC *weakSelf = self; __weak KWMOrderVC *weakSelf = self;
self.client.customerToken = [BUYCustomerToken customerTokenWithJSONDictionary:[[NSUserDefaults standardUserDefaults] objectForKey:@"token"]]; self.client.customerToken = [BUYCustomerToken customerTokenWithJSONDictionary:[[NSUserDefaults standardUserDefaults] objectForKey:@"token"]];
[self.client getOrdersForCustomerCallback:^(NSArray<BUYOrder *> * _Nullable orders, NSError * _Nullable error) { [self.client getOrdersForCustomerCallback:^(NSArray<BUYOrder *> * _Nullable orders, NSError * _Nullable error) {
[weakSelf hideLoading]; [weakSelf hideLoading];
if (error == nil && orders != nil ) { if (error == nil && orders != nil ) {
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#import "UIColor+SAMAdditions.h" #import "UIColor+SAMAdditions.h"
#import "KWMProductDetailVC.h" #import "KWMProductDetailVC.h"
#import "KWMShoppingCart.h" #import "KWMShoppingCart.h"
#import <RXCollections/RXCollection.h>
@interface KWMNewVC () @interface KWMNewVC ()
...@@ -418,6 +419,9 @@ static NSString * idStr = @"KWMNewGoodsCell"; ...@@ -418,6 +419,9 @@ static NSString * idStr = @"KWMNewGoodsCell";
[self.client getProductsPage:tagetPage inCollection:identify withTags:tags sortOrder:collectionSort completion:^(NSArray *products,NSUInteger page, BOOL reachedEnd, NSError *error){ [self.client getProductsPage:tagetPage inCollection:identify withTags:tags sortOrder:collectionSort completion:^(NSArray *products,NSUInteger page, BOOL reachedEnd, NSError *error){
[weakSelf hideLoading]; [weakSelf hideLoading];
loadStatus.isLoading = NO; loadStatus.isLoading = NO;
products = [products rx_filterWithBlock:^BOOL(BUYProduct *each) {
return each.availableValue;
}];
if (error == nil && products) { if (error == nil && products) {
if(tagetPage == 1){ if(tagetPage == 1){
[weakSelf.userDao saveCollectionCache:products collectionId:identify tags:tags]; [weakSelf.userDao saveCollectionCache:products collectionId:identify tags:tags];
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
#import <JRSwizzle/JRSwizzle.h> #import <JRSwizzle/JRSwizzle.h>
@implementation UIViewController (AppearLog) @implementation UIViewController (AppearLog)
#if DEBUG
+ (void)load + (void)load
{ {
[self jr_swizzleMethod:@selector(viewWillAppear:) withMethod:@selector(logViewWillAppear:) error:nil]; [self jr_swizzleMethod:@selector(viewWillAppear:) withMethod:@selector(logViewWillAppear:) error:nil];
...@@ -21,4 +21,5 @@ ...@@ -21,4 +21,5 @@
NSLog(@"logViewWillAppear: %@",NSStringFromClass([self class])); NSLog(@"logViewWillAppear: %@",NSStringFromClass([self class]));
[self logViewWillAppear:animated]; [self logViewWillAppear:animated];
} }
#endif
@end @end
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