// // AchievementsdetailCell.m // jitao // // Created by 罗云飞 on 2017/12/16. // Copyright © 2017年 罗云飞. All rights reserved. // #import "AchievementsdetailCell.h" @implementation AchievementsdetailCell - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{ self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; if (self) { UILabel *line = [UILabel new]; line.backgroundColor = NewButtonColor; ViewRadius(line, 1); [self.contentView addSubview:line]; line.sd_layout .leftSpaceToView(self.contentView, 15) .topSpaceToView(self.contentView, 15) .heightIs(18) .widthIs(3); _title = [UILabel new]; _title.font = NewFont(fitScreenWidth(14)); [self.contentView addSubview:_title]; _title.sd_layout .leftSpaceToView(self.contentView, 24) .heightIs(14) .rightSpaceToView(self.contentView, 15) .centerYEqualToView(line); UILabel *line1 = [UILabel new]; line1.backgroundColor = NewLineGrayColor; [self.contentView addSubview:line1]; line1.sd_layout .leftEqualToView(self.contentView) .rightEqualToView(self.contentView) .heightIs(0.8) .topSpaceToView(self.contentView, 44); _technicaltype = [UILabel new]; _technicaltype.font = NewFont(fitScreenWidth(11)); _technicaltype.textColor = NewButtonColor; [_technicaltype setSingleLineAutoResizeWithMaxWidth:0]; [self.contentView addSubview:_technicaltype]; _technicaltype.sd_layout .leftSpaceToView(self.contentView, 15) .topSpaceToView(line1, 15) .heightIs(11); _industry = [UILabel new]; _industry.font = NewFont(fitScreenWidth(11)); [_industry setSingleLineAutoResizeWithMaxWidth:0]; [self.contentView addSubview:_industry]; _industry.sd_layout .leftSpaceToView(self.contentView, 15) .topSpaceToView(_technicaltype, 15) .heightIs(11); _maturity = [UILabel new]; [_maturity setSingleLineAutoResizeWithMaxWidth:0]; _maturity.font = NewFont(fitScreenWidth(11)); [self.contentView addSubview:_maturity]; _maturity.sd_layout .leftEqualToView(_industry) .heightIs(11) .topSpaceToView(_industry, 15); _transactionmode = [UILabel new]; _transactionmode.font = NewFont(fitScreenWidth(11)); [_transactionmode setSingleLineAutoResizeWithMaxWidth:0]; [self.contentView addSubview:_transactionmode]; _transactionmode.sd_layout .leftSpaceToView(_maturity, fitScreenWidth(27)) .heightIs(11) .topEqualToView(_maturity); _price = [UILabel new]; _price.font = NewFont(11); [_price setSingleLineAutoResizeWithMaxWidth:0]; [self.contentView addSubview:_price]; _price.sd_layout .leftSpaceToView(_transactionmode, fitScreenWidth(27)) .heightIs(11) .topEqualToView(_transactionmode); UIView *view = [UIView new]; view.backgroundColor = [UIColor colorWithString:@"#f8f8f8"]; [self.contentView addSubview:view]; view.sd_layout .leftEqualToView(self.contentView) .heightIs(104) .rightEqualToView(self.contentView) .topSpaceToView(_price, 15); _fieldapplication = [UILabel new]; _fieldapplication.font = NewFont(fitScreenWidth(11)); [_fieldapplication setSingleLineAutoResizeWithMaxWidth:0]; [view addSubview:_fieldapplication]; _fieldapplication.sd_layout .leftSpaceToView(view, 15) .heightIs(11) .topSpaceToView(view, 15); _label = [UILabel new]; _label.font = NewFont(11); [_label setSingleLineAutoResizeWithMaxWidth:0]; [view addSubview:_label]; _label.sd_layout .leftEqualToView(_fieldapplication) .heightIs(11) .topSpaceToView(_fieldapplication, 15); _place = [UILabel new]; _place.font = NewFont(fitScreenWidth(11)); [_place setSingleLineAutoResizeWithMaxWidth:70]; _place.textColor = [UIColor colorWithString:@"#9A9A9A"]; // [view addSubview:_place]; _place.sd_layout .rightSpaceToView(view, 10) .heightIs(11) .centerYEqualToView(_label); UIImageView *image = [UIImageView new]; image.backgroundColor = NewClearColor; [image setImage:[UIImage imageNamed:@"Check"]]; [view addSubview:image]; image.sd_layout .leftSpaceToView(view, 15) .heightIs(16) .widthIs(16) .topSpaceToView(_label, 18); _follow = [UILabel new]; _follow.textColor = [UIColor colorWithString:@"#9A9A9A"]; _follow.font = NewFont(fitScreenWidth(11)); [_follow setSingleLineAutoResizeWithMaxWidth:0]; [view addSubview:_follow]; _follow.sd_layout .leftSpaceToView(image, 5) .heightIs(11) .centerYEqualToView(image); UIImageView *image1 = [UIImageView new]; image1.backgroundColor = NewClearColor; [image1 setImage:[UIImage imageNamed:@"Check"]]; [view addSubview:image1]; image1.sd_layout .leftSpaceToView(_follow, 15) .heightIs(16) .widthIs(16) .centerYEqualToView(image); _orderintention = [UILabel new]; _orderintention.textColor = [UIColor colorWithString:@"#9A9A9A"]; _orderintention.font = NewFont(fitScreenWidth(11)); [_orderintention setSingleLineAutoResizeWithMaxWidth:0]; [view addSubview:_orderintention]; _orderintention.sd_layout .leftSpaceToView(image1, 5) .heightIs(11) .centerYEqualToView(image); UIImageView *image2 = [UIImageView new]; image2.backgroundColor = NewClearColor; [image2 setImage:[UIImage imageNamed:@"Check"]]; [view addSubview:image2]; image2.sd_layout .leftSpaceToView(_orderintention, 15) .heightIs(16) .widthIs(16) .centerYEqualToView(image); _ordersnumber = [UILabel new]; _ordersnumber.textColor = [UIColor colorWithString:@"#9A9A9A"]; _ordersnumber.font = NewFont(fitScreenWidth(11)); [_ordersnumber setSingleLineAutoResizeWithMaxWidth:0]; [view addSubview:_ordersnumber]; _ordersnumber.sd_layout .leftSpaceToView(image2, 5) .heightIs(11) .centerYEqualToView(image); _place1 = [UILabel new]; _place1.font = NewFont(fitScreenWidth(11)); [_place1 setSingleLineAutoResizeWithMaxWidth:70]; _place1.textColor = [UIColor colorWithString:@"#9A9A9A"]; [view addSubview:_place1]; _place1.sd_layout .rightSpaceToView(view, 10) .heightIs(11) .centerYEqualToView(image); } return self; } - (void)assignment:(ResultsDetailsModel *)model { _title.text = model.name; /* (0--专利, 1--软著, 2--项目, 3--版权, 4--工业设计, 5--配方, 6--非标) */ if ([model.category isEqualToString:@"0"]) { _technicaltype.text = [NSString stringWithFormat:@"技术类型:%@",@"专利"]; }else if ([model.category isEqualToString:@"1"]){ _technicaltype.text = [NSString stringWithFormat:@"技术类型:%@",@"软著"]; }else if ([model.category isEqualToString:@"2"]){ _technicaltype.text = [NSString stringWithFormat:@"技术类型:%@",@"项目"]; }else if ([model.category isEqualToString:@"3"]){ _technicaltype.text = [NSString stringWithFormat:@"技术类型:%@",@"版权"]; }else if ([model.category isEqualToString:@"4"]){ _technicaltype.text = [NSString stringWithFormat:@"技术类型:%@",@"工业设计"]; }else if ([model.category isEqualToString:@"5"]){ _technicaltype.text = [NSString stringWithFormat:@"技术类型:%@",@"配方"]; }else if ([model.category isEqualToString:@"6"]){ _technicaltype.text = [NSString stringWithFormat:@"技术类型:%@",@"非标"]; } /* (0--正在研发, 1-- 已有样品, 2-- 通过小试, 3-- 通过中试, 4-- 可以量产) */ if ([model.maturity isEqualToString:@"0"]) { _maturity.text = [NSString stringWithFormat:@"成熟度:%@",@"正在研发"]; }else if ([model.maturity isEqualToString:@"1"]){ _maturity.text = [NSString stringWithFormat:@"成熟度:%@",@"已有样品"]; }else if ([model.maturity isEqualToString:@"2"]){ _maturity.text = [NSString stringWithFormat:@"成熟度:%@",@"通过小试"]; }else if ([model.maturity isEqualToString:@"3"]){ _maturity.text = [NSString stringWithFormat:@"成熟度:%@",@"通过中试"]; }else if ([model.maturity isEqualToString:@"4"]){ _maturity.text = [NSString stringWithFormat:@"成熟度:%@",@"可以量产"]; }else{ _maturity.text = [NSString stringWithFormat:@"成熟度:%@",@""]; } if (model.field1 == NULL&&model.field2 == NULL) { _industry.text = @""; _fieldapplication.text = @""; }else if (model.field1 == NULL){ _industry.text = [NSString stringWithFormat:@"行业:%@",model.field2]; _fieldapplication.text = [NSString stringWithFormat:@"行业:%@",model.field2]; }else if(model.field2 == NULL){ _industry.text = [NSString stringWithFormat:@"行业:%@",model.field1]; _fieldapplication.text = [NSString stringWithFormat:@"行业:%@",model.field1]; }else{ _industry.text = [NSString stringWithFormat:@"行业:%@ %@",model.field1,model.field2]; _fieldapplication.text = [NSString stringWithFormat:@"适用领域:%@/%@",model.field1,model.field2]; } if ([model.cooperationMode isEqualToString:@"0"]) { _transactionmode.text = [NSString stringWithFormat:@"交易方式:%@",@"技术转让"]; }else{ _transactionmode.text = [NSString stringWithFormat:@"交易方式:%@",@"授权生产"]; } if ([model.bargainingMode isEqualToString:@"0"]) { _price.text = [NSString stringWithFormat:@"价格:%@",@"面议"]; }else{ if (model.transferPrice == NULL) { _price.text = [NSString stringWithFormat:@"价格:%@",@""]; }else{ _price.text = [NSString stringWithFormat:@"价格:%@万",model.transferPrice]; } } NSString *keyword = [model.keyword stringByReplacingOccurrencesOfString:@"," withString:@" "]; _label.text = [NSString stringWithFormat:@"标签:%@",keyword]; _place.text = model.ownerPostalAddress; _place1.text = model.ownerPostalAddress; _follow.text = [NSString stringWithFormat:@"%@次关注",model.countInterest]; if (model.orderIntentionCount == NULL) { _orderintention.text = [NSString stringWithFormat:@"%@次接单意向",@"0"]; }else{ _orderintention.text = [NSString stringWithFormat:@"%@次接单意向",model.orderIntentionCount]; } if (model.orderCount == NULL) { _ordersnumber.text = [NSString stringWithFormat:@"%@次接单",@"0"]; }else{ _ordersnumber.text = [NSString stringWithFormat:@"%@次接单",model.orderCount]; } } - (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