// // GuWenCell.m // jitao // // Created by 罗云飞 on 2018/8/19. // Copyright © 2018年 罗云飞. All rights reserved. // #import "GuWenCell.h" @implementation GuWenCell - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{ self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; if (self) { UILabel *line = [UILabel new]; line.backgroundColor = NewLineGrayColor; [self.contentView addSubview:line]; line.sd_layout .leftEqualToView(self.contentView) .heightIs(10) .rightEqualToView(self.contentView) .topEqualToView(self.contentView); _headimage = [UIImageView new]; ViewRadius(_headimage, 40); [self.contentView addSubview:_headimage]; _headimage.sd_layout .leftSpaceToView(self.contentView, 15) .heightIs(80) .widthIs(80) .topSpaceToView(line, 30); _name = [UILabel new]; _name.font = NewFont(15); [_name setSingleLineAutoResizeWithMaxWidth:0]; [self.contentView addSubview:_name]; _name.sd_layout .leftSpaceToView(_headimage, 15) .heightIs(15) .topSpaceToView(line, 35); _ZJtitile = [UILabel new]; _ZJtitile.font = NewFont(13); _ZJtitile.textColor = NewButtonColor; [_ZJtitile setSingleLineAutoResizeWithMaxWidth:0]; [self.contentView addSubview:_ZJtitile]; _ZJtitile.sd_layout .rightSpaceToView(self.contentView, 15) .heightIs(15) .topSpaceToView(line, 35); UILabel *line1 = [UILabel new]; line1.backgroundColor = NewLineGrayColor; [self.contentView addSubview:line1]; line1.sd_layout .leftEqualToView(_name) .heightIs(0.8) .rightSpaceToView(self.contentView, 15) .topSpaceToView(_name, 8); _neirong = [UILabel new]; _neirong.font = NewFont(14); _neirong.numberOfLines = 2; _neirong.lineBreakMode = NSLineBreakByTruncatingTail; _neirong.textColor = [UIColor colorWithString:@"#6C6C6C"]; [self.contentView addSubview:_neirong]; _neirong.sd_layout .leftEqualToView(line1) .maxHeightIs(35) .rightSpaceToView(self.contentView, 15) .topSpaceToView(line1, 10); _HPLtitle = [UILabel new]; _HPLtitle.textColor = [UIColor colorWithString:@"#FF9350"]; _HPLtitle.font = NewFont(12); [_HPLtitle setSingleLineAutoResizeWithMaxWidth:0]; [self.contentView addSubview:_HPLtitle]; _HPLtitle.sd_layout .leftEqualToView(_name) .heightIs(12) .bottomSpaceToView(self.contentView, 15); _guanzhu = [UIButton new]; [_guanzhu setBackgroundImage:NewImageNamed(@"pj") forState:UIControlStateNormal]; [self.contentView addSubview:_guanzhu]; _guanzhu.sd_layout .rightSpaceToView(self.contentView, 15) .heightIs(15) .widthIs(15) .centerYEqualToView(_HPLtitle); _guanzhuNumber = [UILabel new]; _guanzhuNumber.textColor = [UIColor colorWithString:@"#AEAEAE"]; _guanzhuNumber.font = NewFont(13); [_guanzhuNumber setSingleLineAutoResizeWithMaxWidth:0]; [self.contentView addSubview:_guanzhuNumber]; _guanzhuNumber.sd_layout .rightSpaceToView(_guanzhu, 5) .heightIs(15) .centerYEqualToView(_HPLtitle); } return self; } - (void)assignment:(GUWenlistModel *)model{ [_headimage sd_setImageWithURL:NewURL([model.personPortraitUrl mosaicUrlPrefix]) placeholderImage:NewImageNamed(@"顾问-6")]; _name.text = model.username; //顾问类型 0 专利代理人 1 专利顾问 2 版权顾问 3 商标顾问 if ([model.consultantType isEqualToString:@"0"]) { _ZJtitile.text = @"专利代理人"; }else if ([model.consultantType isEqualToString:@"1"]) { _ZJtitile.text = @"专利顾问"; }else if ([model.consultantType isEqualToString:@"2"]) { _ZJtitile.text = @"版权顾问"; }else if ([model.consultantType isEqualToString:@"3"]) { _ZJtitile.text = @"商标顾问"; } _neirong.text = model.introduction; _HPLtitle.text = [NSString stringWithFormat:@"好评率:%@",model.favorableRate]; _guanzhuNumber.text = model.countInterest; } - (void)awakeFromNib { [super awakeFromNib]; // Initialization code } - (void)setSelected:(BOOL)selected animated:(BOOL)animated { [super setSelected:selected animated:animated]; // Configure the view for the selected state } @end