// // KWMBarandSelectView.m // iCemarose // // Created by 陈荣科 on 16/8/29. // Copyright © 2016年 kollway. All rights reserved. // #import "KWMBarandSelectView.h" #import "KWMShopCartData.h" @implementation KWMBarandSelectView{ BOOL isShow; } - (instancetype)init{ if (self = [super init]) { [self initContentView]; } return self; } -(instancetype)initWithFrame:(CGRect)frame{ if (self = [super initWithFrame:frame]) { [self initContentView]; } return self; } -(instancetype)initWithCoder:(NSCoder *)aDecoder{ if (self = [super initWithCoder:aDecoder]) { [self initContentView]; } return self; } - (void)awakeFromNib{ [super awakeFromNib]; [self initContentView]; } - (void)initContentView{ [[NSBundle mainBundle] loadNibNamed:@"KWMBarandSelectView" owner:self options:nil]; [self addSubview:_vContent]; self.vContent.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height); isShow = NO; [self.lbBrand sizeToFit]; _lbCount.text = @"0"; } - (void)setCount:(NSInteger)count{ _count = count; if (count > 0) { _lbCount.text = [NSString stringWithFormat:@"%@",@(count).stringValue]; if (count > 9) { _lbCount.font = [UIFont systemFontOfSize:8]; } }else{ _lbCount.text = @"0"; } } //点击购物车 - (IBAction)onClickShopCartBtn:(id)sender { NSLog(@"点击了购物车"); if ([self.delegate respondsToSelector:@selector(kwm_HitShopCartBtn)]) { [self.delegate kwm_HitShopCartBtn]; } } - (IBAction)onClickBackBtn:(id)sender { NSLog(@"点击了返回按钮"); if ([self.delegate respondsToSelector:@selector(kwm_clickBackBtn)]) { [self.delegate kwm_clickBackBtn]; } } @end