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
//
// KWMSuitCell.m
// iCemarose
//
// Created by HouWeiBin on 2017/6/5.
// Copyright © 2017年 kollway. All rights reserved.
//
#import "KWMClothingSetsCell.h"
#import "KWMStringUtil.h"
#import "KWMImageUtil.h"
#import "UIImageView+WebCache.h"
@interface KWMClothingSetsCell()
@property(nonatomic,weak) IBOutlet UILabel *lbName;
@property(nonatomic,weak) IBOutlet UILabel *lbPrice;
@property(nonatomic,weak) IBOutlet UIImageView *ivProduct;
@end
@implementation KWMClothingSetsCell
- (void)awakeFromNib {
[super awakeFromNib];
}
-(void)setProduct:(BUYProduct *)product{
_product = product;
if(product){
NSString *imageUrl = [KWMImageUtil getProductImageUrl:product ImageSize:SmallImage];
NSURL *imageURL = [NSURL URLWithString:imageUrl];
[self.ivProduct sd_setImageWithURL:imageURL placeholderImage:[UIImage imageNamed:@"ic_loading"]];
self.lbName.text = product.title;
if(product.variantsArray.count>0){
BUYProductVariant *variant = product.variantsArray.firstObject;
self.lbPrice.text = [KWMStringUtil price:variant.price];
}
}
}
@end