1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//
// KWMShopCarCell.m
// iCemarose
//
// Created by HouWeiBin on 16/8/31.
// Copyright © 2016年 kollway. All rights reserved.
//
#import "KWMShopCarCell.h"
#import "UIImageView+WebCache.h"
#import "KWMStringUtil.h"
#import "KWMImageUtil.h"
@implementation KWMShopCarCell
- (void)awakeFromNib {
[super awakeFromNib];
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
}
- (void)setShopCartModel:(KWMShopCartModel *)shopCartModel{
_shopCartModel = shopCartModel;
if (shopCartModel != nil) {
_lbName.text = shopCartModel.name;
_lbBrand.text = shopCartModel.brand;
_lbSize.text = shopCartModel.size;
_lbCount.text = [NSString stringWithFormat:@"%ld",(long)shopCartModel.quantity];
// NSInteger totalPrice = shopCartModel.price*shopCartModel.quantity;
// _lbPrice.text = [NSString stringWithFormat:@"¥%@",[KWMStringUtil getEUR2CNYstring:@(totalPrice)]];
_lbPrice.text = shopCartModel.totalPrice;
NSURL *imageURL = [NSURL URLWithString: shopCartModel.imageStr];
[_ivImage sd_setImageWithURL:imageURL placeholderImage:[UIImage imageNamed:@"ic_loading"]];
}
}
-(void)onClickEdit:(id)sender{
if(self.delegate !=nil){
[self.delegate kwm_onClickEdit:_shopCartModel];
}
}
-(void)onClickDelete:(id)sender{
if(self.delegate !=nil){
[self.delegate kwm_onClickDelete:_shopCartModel];
}
}
@end