//
|
// PBPersonTableViewCell.m
|
// IphoneBIMe
|
//
|
// Created by ZhangJF on 2023/2/1.
|
// Copyright © 2023 ProBIM. All rights reserved.
|
//
|
|
#import "PBNewPersonTableViewCell.h"
|
@interface PBNewPersonTableViewCell()
|
@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 PBNewPersonTableViewCell
|
- (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:@"张三" 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);
|
}];
|
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);
|
}];
|
UILabel *typeTitleL = [UILabel z_labelWithText:@"工种: " Color:[UIColor z_colorWithR:51 G:51 B:51] isBold:YES Font:14];
|
[self.contentView addSubview:typeTitleL];
|
[typeTitleL mas_makeConstraints:^(MASConstraintMaker *make) {
|
make.top.equalTo(lotTitleL.mas_bottom).offset(8);
|
make.left.equalTo(self.contentView).offset(12);
|
make.height.equalTo(@44);
|
make.width.equalTo(@74);
|
}];
|
UILabel *typeL = [UILabel z_labelWithText:@"瓦工" Color:[UIColor z_colorWithR:108 G:108 B:108] isBold:NO Font:14];
|
typeL.layer.cornerRadius = 4;
|
typeL.layer.borderWidth = 1.f;
|
typeL.layer.borderColor = [[UIColor z_colorWithR:108 G:108 B:108] CGColor];
|
[self.contentView addSubview:typeL];
|
[typeL mas_makeConstraints:^(MASConstraintMaker *make) {
|
make.top.equalTo(typeTitleL);
|
make.height.equalTo(@44);
|
make.left.equalTo(typeTitleL.mas_right);
|
make.right.equalTo(self.contentView).offset(-12);
|
}];
|
UILabel *idCardTitleL = [UILabel z_labelWithText:@"身份证号: " Color:[UIColor z_colorWithR:51 G:51 B:51] isBold:YES Font:14];
|
[self.contentView addSubview:idCardTitleL];
|
[idCardTitleL mas_makeConstraints:^(MASConstraintMaker *make) {
|
make.top.equalTo(typeTitleL.mas_bottom).offset(8);
|
make.left.equalTo(self.contentView).offset(12);
|
make.height.equalTo(@44);
|
make.width.equalTo(@74);
|
}];
|
UILabel *idCardL = [UILabel z_labelWithText:@"11029985985984698496894689648" Color:[UIColor z_colorWithR:108 G:108 B:108] isBold:NO Font:14];
|
idCardL.layer.cornerRadius = 4;
|
idCardL.layer.borderWidth = 1.f;
|
idCardL.layer.borderColor = [[UIColor z_colorWithR:108 G:108 B:108] CGColor];
|
[self.contentView addSubview:idCardL];
|
[idCardL mas_makeConstraints:^(MASConstraintMaker *make) {
|
make.top.equalTo(idCardTitleL);
|
make.height.equalTo(@44);
|
make.left.equalTo(idCardTitleL.mas_right);
|
make.right.equalTo(self.contentView).offset(-12);
|
}];
|
UILabel *telTitleL = [UILabel z_labelWithText:@"联系方式: " Color:[UIColor z_colorWithR:51 G:51 B:51] isBold:YES Font:14];
|
[self.contentView addSubview:telTitleL];
|
[telTitleL mas_makeConstraints:^(MASConstraintMaker *make) {
|
make.top.equalTo(idCardTitleL.mas_bottom).offset(8);
|
make.left.equalTo(self.contentView).offset(12);
|
make.height.equalTo(@44);
|
make.bottom.equalTo(self.contentView);
|
make.width.equalTo(@74);
|
}];
|
UILabel *telL = [UILabel z_labelWithText:@"1102998598598469849" Color:[UIColor z_colorWithR:108 G:108 B:108] isBold:NO Font:14];
|
telL.layer.cornerRadius = 4;
|
telL.layer.borderWidth = 1.f;
|
telL.layer.borderColor = [[UIColor z_colorWithR:108 G:108 B:108] CGColor];
|
[self.contentView addSubview:telL];
|
[telL mas_makeConstraints:^(MASConstraintMaker *make) {
|
make.top.equalTo(telTitleL);
|
make.height.equalTo(@44);
|
make.left.equalTo(telTitleL.mas_right);
|
make.right.equalTo(self.contentView).offset(-12);
|
}];
|
self.nameL = nameL;
|
self.genderL = genderL;
|
self.unitL = unitL;
|
self.typeL = typeL;
|
self.idCardL = idCardL;
|
self.telL = telL;
|
self.lotL = lotL;
|
}
|
- (void)setDict:(NSDictionary *)dict {
|
_dict = dict;
|
self.nameL.text = [NSString stringWithFormat:@" %@", [dict valueForKey:@"UserName"]];
|
self.genderL.text = [NSString stringWithFormat:@" %@", [[dict valueForKey:@"Sex"] intValue] == 0 ? @"男" : @"女"];
|
self.unitL.text = [NSString stringWithFormat:@" %@", [dict valueForKey:@"Unit"]];
|
self.typeL.text = [NSString stringWithFormat:@" %@", [dict valueForKey:@"WorkType"]];
|
self.idCardL.text = [NSString stringWithFormat:@" %@", [dict valueForKey:@"IdentityNumber"]];
|
self.telL.text = [NSString stringWithFormat:@" %@", [dict valueForKey:@"Mobile"]];
|
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
|