zjf
2023-03-10 abac8765bf6a1f400c2377b9999ce7495ba34a3f
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
//
//  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