Commit 50dec2ec by lee

u hide soldout product

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