// // KDPShopView.m // KuDianProject // // Created by 学丽 on 2019/7/9. // Copyright © 2019 KDP. All rights reserved. // #import "KDPShopView.h" @implementation KDPShopView -(instancetype)initWithFrame:(CGRect)frame { self=[super initWithFrame:frame]; if (self) { self.shopimgV=[[UIImageView alloc]initWithFrame:CGRectMake(10, 10, 50, 50)]; self.shopimgV.backgroundColor=[UIColor colorWithHexString:LineColor]; [self addSubview:self.shopimgV]; self.shopLabel=[[UILabel alloc]initWithFrame:CGRectMake(self.shopimgV.right+10, 15, self.width-self.shopimgV.right-10, 20)]; self.shopLabel.textColor=[UIColor colorWithHexString:fontColor]; self.shopLabel.font=[UIFont systemFontOfSize:14]; [self addSubview:self.shopLabel]; self.desclabel=[[UILabel alloc]initWithFrame:CGRectMake(self.shopimgV.right+10, self.shopLabel.bottom+5, self.width-self.shopimgV.right-10, 20)]; self.desclabel.font=[UIFont systemFontOfSize:12]; self.desclabel.textColor=[UIColor colorWithHexString:@"#999999"]; [self addSubview:self.desclabel]; UIView *lineV=[[UIView alloc]init]; lineV.backgroundColor=[UIColor colorWithHexString:LineColor]; [self addSubview:lineV]; [lineV mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(0); make.right.mas_equalTo(0); make.top.mas_equalTo(self.mas_bottom).offset(-5); make.height.mas_equalTo(5); }]; } return self; } -(void)setShopDic:(NSDictionary *)shopDic { _shopDic = shopDic; [self.shopimgV sd_setImageWithURL:[NSURL URLWithString:shopDic[@"pic_path"]]placeholderImage:[UIImage imageNamed:placholderImg]]; self.shopLabel.text=shopDic[@"title"]; self.desclabel.text=[NSString stringWithFormat:@"商品描述:%@ 服务态度:%@ 发货速度:%@",shopDic[@"item_score"],shopDic[@"service_score"],shopDic[@"delivery_score"]]; } @end