ProductCollectionViewCell.m 1.16 KB
Newer Older
曹云霄's avatar
曹云霄 committed
1 2 3 4 5 6 7 8 9 10 11 12
//
//  ProductCollectionViewCell.m
//  Lighting
//
//  Created by 曹云霄 on 16/5/4.
//  Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//

#import "ProductCollectionViewCell.h"

@implementation ProductCollectionViewCell

勾芒's avatar
勾芒 committed
13 14 15 16 17 18 19 20 21 22





/**
 *  加入购物车点击
 */
- (IBAction)AddShoppingcarButtonClick:(UIButton *)sender {

23
    CGPoint carButtonCenter = self.productImageView.center;
勾芒's avatar
勾芒 committed
24 25 26 27 28 29
    //把button在cell坐标转化为在tableView上的坐标
    CGPoint point = [self convertPoint:carButtonCenter toView:self.superview.window];
    
    //回调
    if (_ReturnCellCgpoint)
    {
30
        _ReturnCellCgpoint(point,_cellindex,self.productImageView.frame.size);
勾芒's avatar
勾芒 committed
31 32 33 34
    }
}


35 36 37 38 39 40 41 42 43 44
- (void)setModel:(TOGoodsEntity *)model
{
    NSArray *imageArray = [model.pictures componentsSeparatedByString:@","];
    [self.productImageView sd_setImageWithURL:[NSURL URLWithString:[imageArray firstObject]] placeholderImage:REPLACEIMAGE];
    self.productPrice.text = [NSString stringWithFormat:@"¥%.2f",[model.tagPrice floatValue]];
    self.productParameter.text = model.name;
    self.specifications.text = [NSString stringWithFormat:@"%@(%@)",model.code,model.size];
}


曹云霄's avatar
曹云霄 committed
45
@end