// // PBNewVehicleTableViewCell.m // IphoneBIMe // // Created by ZhangJF on 2023/3/8. // Copyright © 2023 ProBIM. All rights reserved. // #import "PBNewVehicleTableViewCell.h" @interface PBNewVehicleTableViewCell() @property (nonatomic, weak) UILabel *nameL; @property (nonatomic, weak) UILabel *genderL; @property (nonatomic, weak) UILabel *unitL; @property (nonatomic, weak) UILabel *typeL; @property (nonatomic, weak) UILabel *idCardL; @property (nonatomic, weak) UILabel *telL; @property (nonatomic, weak) UILabel *lotL; @end @implementation PBNewVehicleTableViewCell - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) { [self setupUI]; } return self; } - (void)setupUI { UILabel *nameTitleL = [UILabel z_labelWithText:@"车牌号: " Color:[UIColor z_colorWithR:51 G:51 B:51] isBold:YES Font:14]; [self.contentView addSubview:nameTitleL]; [nameTitleL mas_makeConstraints:^(MASConstraintMaker *make) { make.top.equalTo(self.contentView).offset(8); make.left.equalTo(self.contentView).offset(12); make.height.equalTo(@44); make.width.equalTo(@74); }]; UILabel *nameL = [UILabel z_labelWithText:@"京A·374758" Color:[UIColor z_colorWithR:108 G:108 B:108] isBold:NO Font:14]; nameL.layer.cornerRadius = 4; nameL.layer.borderWidth = 1.f; nameL.layer.borderColor = [[UIColor z_colorWithR:108 G:108 B:108] CGColor]; [self.contentView addSubview:nameL]; [nameL mas_makeConstraints:^(MASConstraintMaker *make) { make.top.equalTo(nameTitleL); make.height.equalTo(@44); make.left.equalTo(nameTitleL.mas_right); make.right.equalTo(self.contentView).offset(-12); }]; UILabel *genderTitleL = [UILabel z_labelWithText:@"随车人员: " Color:[UIColor z_colorWithR:51 G:51 B:51] isBold:YES Font:14]; [self.contentView addSubview:genderTitleL]; [genderTitleL mas_makeConstraints:^(MASConstraintMaker *make) { make.top.equalTo(nameTitleL.mas_bottom).offset(8); make.left.equalTo(self.contentView).offset(12); make.height.equalTo(@44); make.width.equalTo(@74); }]; UILabel *genderL = [UILabel z_labelWithText:@"李八" Color:[UIColor z_colorWithR:108 G:108 B:108] isBold:NO Font:14]; genderL.layer.cornerRadius = 4; genderL.layer.borderWidth = 1.f; genderL.layer.borderColor = [[UIColor z_colorWithR:108 G:108 B:108] CGColor]; [self.contentView addSubview:genderL]; [genderL mas_makeConstraints:^(MASConstraintMaker *make) { make.top.equalTo(genderTitleL); make.height.equalTo(@44); make.left.equalTo(genderTitleL.mas_right); make.right.equalTo(self.contentView).offset(-12); }]; UILabel *unitTitleL = [UILabel z_labelWithText:@"车辆类型: " Color:[UIColor z_colorWithR:51 G:51 B:51] isBold:YES Font:14]; [self.contentView addSubview:unitTitleL]; [unitTitleL mas_makeConstraints:^(MASConstraintMaker *make) { make.top.equalTo(genderTitleL.mas_bottom).offset(8); make.left.equalTo(self.contentView).offset(12); make.height.equalTo(@44); make.width.equalTo(@74); }]; UILabel *unitL = [UILabel z_labelWithText:@"挖掘机" Color:[UIColor z_colorWithR:108 G:108 B:108] isBold:NO Font:14]; unitL.layer.cornerRadius = 4; unitL.layer.borderWidth = 1.f; unitL.layer.borderColor = [[UIColor z_colorWithR:108 G:108 B:108] CGColor]; [self.contentView addSubview:unitL]; [unitL mas_makeConstraints:^(MASConstraintMaker *make) { make.top.equalTo(unitTitleL); make.height.equalTo(@44); make.left.equalTo(unitTitleL.mas_right); make.right.equalTo(self.contentView).offset(-12); }]; UILabel *lotTitleL = [UILabel z_labelWithText:@"标段: " Color:[UIColor z_colorWithR:51 G:51 B:51] isBold:YES Font:14]; [self.contentView addSubview:lotTitleL]; [lotTitleL mas_makeConstraints:^(MASConstraintMaker *make) { make.top.equalTo(unitTitleL.mas_bottom).offset(8); make.left.equalTo(self.contentView).offset(12); make.height.equalTo(@44); make.width.equalTo(@74); make.bottom.equalTo(self.contentView); }]; UILabel *lotL = [UILabel z_labelWithText:@"" Color:[UIColor z_colorWithR:108 G:108 B:108] isBold:NO Font:14]; lotL.layer.cornerRadius = 4; lotL.layer.borderWidth = 1.f; lotL.layer.borderColor = [[UIColor z_colorWithR:108 G:108 B:108] CGColor]; [self.contentView addSubview:lotL]; [lotL mas_makeConstraints:^(MASConstraintMaker *make) { make.top.equalTo(lotTitleL); make.height.equalTo(@44); make.left.equalTo(lotTitleL.mas_right); make.right.equalTo(self.contentView).offset(-12); }]; self.nameL = nameL; self.genderL = genderL; self.unitL = unitL; self.lotL = lotL; } - (void)setDict:(NSDictionary *)dict { _dict = dict; self.nameL.text = [NSString stringWithFormat:@" %@", [dict valueForKey:@"CarNumber"]]; self.genderL.text = [NSString stringWithFormat:@" %@", [dict valueForKey:@"CarPersonnel"]]; self.unitL.text = [NSString stringWithFormat:@" %@", [dict valueForKey:@"CartType"]]; self.lotL.text = [NSString stringWithFormat:@" %@", [dict valueForKey:@"Tenders"]]; } - (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