zjf
2023-03-06 392b76515f40376b6d36f40a114850ef63650384
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
//
//  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