// // DemandCell.m // jitao // // Created by 罗云飞 on 2017/12/16. // Copyright © 2017年 罗云飞. All rights reserved. // #import "DemandCell.h" @implementation DemandCell{ UILabel *xuansan; } - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{ self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; if (self) { UILabel *line10 = [UILabel new]; line10.backgroundColor = NewLineGrayColor; [self.contentView addSubview:line10]; line10.sd_layout .leftEqualToView(self.contentView) .heightIs(10) .rightEqualToView(self.contentView); UILabel *line = [UILabel new]; line.backgroundColor = NewButtonColor; ViewRadius(line, 1); [self.contentView addSubview:line]; line.sd_layout .leftSpaceToView(self.contentView, 15) .topSpaceToView(line10, 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(line10, 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); _qiatan = [UILabel new]; _qiatan.text = @"加急:"; [_qiatan setSingleLineAutoResizeWithMaxWidth:0]; _qiatan.font = NewFont(fitScreenWidth(12)); [self.contentView addSubview:_qiatan]; _daynumber = [UILabel new]; _daynumber.font = NewBFont(fitScreenWidth(12)); _daynumber.textColor = [UIColor colorWithString:@"#FF8523"]; [_daynumber setSingleLineAutoResizeWithMaxWidth:0]; [self.contentView addSubview:_daynumber]; xuansan = [UILabel new]; xuansan.text = @"悬赏:"; xuansan.font = NewFont(fitScreenWidth(12)); [xuansan setSingleLineAutoResizeWithMaxWidth:0]; [self.contentView addSubview:xuansan]; xuansan.sd_layout .leftSpaceToView(self.contentView, 15) .heightIs(12) .topSpaceToView(_technicaltype, 15); _rewardamount = [UILabel new]; _rewardamount.font = NewBFont(fitScreenWidth(12)); _rewardamount.textColor = [UIColor colorWithString:@"#FF8523"]; [_rewardamount setSingleLineAutoResizeWithMaxWidth:0]; [self.contentView addSubview:_rewardamount]; _rewardamount.sd_layout .leftSpaceToView(xuansan, 5) .heightIs(11) .centerYEqualToView(xuansan); UIView *view = [UIView new]; view.backgroundColor = [UIColor colorWithString:@"#f8f8f8"]; [self.contentView addSubview:view]; view.sd_layout .leftEqualToView(self.contentView) .rightEqualToView(self.contentView) .bottomEqualToView(self.contentView) .topSpaceToView(xuansan, 15); _fieldapplication = [UILabel new]; _fieldapplication.font = NewFont(fitScreenWidth(12)); [_fieldapplication setSingleLineAutoResizeWithMaxWidth:0]; [view addSubview:_fieldapplication]; _fieldapplication.sd_layout .leftSpaceToView(view, 15) .heightIs(11) .topSpaceToView(view, 15); _label = [UILabel new]; _label.font = NewFont(fitScreenWidth(11)); [_label setSingleLineAutoResizeWithMaxWidth:0]; [view addSubview:_label]; _label.sd_layout .leftEqualToView(_fieldapplication) .heightIs(11) .topSpaceToView(_fieldapplication, 15); _place = [UILabel new]; // _place.text = @"湖南长沙"; _place.font = NewFont(fitScreenWidth(11)); [_place setSingleLineAutoResizeWithMaxWidth:80]; _place.textColor = [UIColor colorWithString:@"#9A9A9A"]; [view addSubview:_place]; _place.sd_layout .leftSpaceToView(_label, 36) .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) .bottomSpaceToView(view, 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:80]; _place1.textColor = [UIColor colorWithString:@"#9A9A9A"]; [view addSubview:_place1]; _place1.sd_layout .rightSpaceToView(view, 15) .heightIs(11) .centerYEqualToView(image); } return self; } - (void)assignment:(DemanddetailModel *)model { _title.text = model.name; if ([model.demandType isEqualToString:@"0"]) { _technicaltype.text = [NSString stringWithFormat:@"需求类型:%@",@"技术购买需求"]; }else if ([model.demandType isEqualToString:@"1"]){ _technicaltype.text = [NSString stringWithFormat:@"需求类型:%@",@"技术设备类需求"]; }else if ([model.demandType isEqualToString:@"2"]){ _technicaltype.text = [NSString stringWithFormat:@"需求类型:%@",@"技术方案型需求"]; }else if ([model.demandType isEqualToString:@"3"]){ _technicaltype.text = [NSString stringWithFormat:@"需求类型:%@",@"技术攻关型需求"]; }else if ([model.demandType isEqualToString:@"4"]){ _technicaltype.text = [NSString stringWithFormat:@"需求类型:%@",@"技术咨询型需求"]; }else if ([model.demandType isEqualToString:@"5"]){ _technicaltype.text = [NSString stringWithFormat:@"需求类型:%@",@"技术人才型需求"]; } if (model.urgentMoney == NULL) { _rewardamount.text = @""; xuansan.hidden = YES; _qiatan.sd_layout .leftSpaceToView(self.contentView, 15) .heightIs(12) .topSpaceToView(_technicaltype, 15); }else{ xuansan.hidden = NO; _rewardamount.text = [NSString stringWithFormat:@"%@万",model.urgentMoney]; _qiatan.sd_layout .leftSpaceToView(_rewardamount, 20) .heightIs(12) .topSpaceToView(_technicaltype, 15); } if (model.urgentDays == NULL) { _daynumber.text = @""; _qiatan.hidden = YES; }else{ _daynumber.text = [NSString stringWithFormat:@"%@天",model.urgentDays]; _qiatan.hidden = NO; } _daynumber.sd_layout .leftSpaceToView(_qiatan, 5) .heightIs(11) .centerYEqualToView(_qiatan); _fieldapplication.text = [NSString stringWithFormat:@"行业:%@/%@",model.industryCategory1,model.industryCategory2]; if (model.budgetCost == NULL||[model.budgetCost isEqualToString:@""]) { _label.text = [NSString stringWithFormat:@"价格:%@",@"面议"]; }else{ _label.text = [NSString stringWithFormat:@"价格:%@万",model.budgetCost]; } _follow.text = [NSString stringWithFormat:@"%@次关注",model.countInterest]; _place1.text = model.employerAddress; _orderintention.text = [NSString stringWithFormat:@"%@次接单意向",model.orderIntentionCount]; _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