KWMShoppingCart.h 1.17 KB
Newer Older
lee committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
//
//  KWMShoppingCart.h
//  iCemarose
//
//  Created by lee on 2017/5/18.
//  Copyright © 2017年 kollway. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "KWMShopCartModel.h"
#import "KWMCartResult.h"

typedef void(^ShoppingCartCallBack) (NSError *error,KWMCartResult *cart);

@interface KWMShoppingCart : NSObject

@property (nonatomic, strong) NSMutableArray<KWMShopCartModel *> * items;

lee committed
19 20
@property (nonatomic, assign) BOOL sync;

lee committed
21 22
@property (nonatomic, strong) NSNumber *count;

lee committed
23 24 25 26 27 28
+ (instancetype)sharedInstance;

- (void)allItemsWithCallback:(ShoppingCartCallBack) callback;

- (void)increaseProductWithVariantId:(NSNumber *) variantId  quantity:(NSInteger) quantity callback:(ShoppingCartCallBack) callback;

lee committed
29 30 31
- (void)changeProductWithVariantId:(NSNumber *) variantId quantity:(NSInteger) quantity callback:(ShoppingCartCallBack) callback;

- (void)updateProductWithVariantIds:(NSArray<NSNumber *> *) variantIds quantitties:(NSArray<NSNumber *> *) quantites callback:(ShoppingCartCallBack) callback;
lee committed
32 33 34

- (void)deleteProductWithVariantId:(NSNumber *) variantId callback:(ShoppingCartCallBack) callback;

u  
lee committed
35 36
- (void)clearCartWithCallback:(ShoppingCartCallBack) callback;

lee committed
37
@end