| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148 |
- //
- // BHomeInvitationCompanyView.m
- // HappyJob
- //
- // Created by 张晓光 on 2019/7/3.
- // Copyright © 2019 Bob. All rights reserved.
- //
- #import "BHomeInvitationCompanyView.h"
- @interface BHomeInvitationCompanyView ()
- @property (nonatomic, strong) UIImageView *iconImageV;
- @property (nonatomic, strong) UIButton *sendBtn;
- @property (nonatomic, strong) UILabel *detailLabel;
- @end
- @implementation BHomeInvitationCompanyView
- - (instancetype)initWithFrame:(CGRect)frame {
-
- if (self = [super initWithFrame:frame])
- {
- [self initViews];
- [self autoLayOutViews];
- }
- return self;
- }
- - (void)initViews {
-
- [self addSubview:self.iconImageV];
- [self addSubview:self.companyNameLabel];
- [self addSubview:self.sendBtn];
- [self addSubview:self.nameLabel];
- [self addSubview:self.detailLabel];
-
- }
- - (void)autoLayOutViews {
-
- __weak typeof(self) weakSelf = self;
-
- [_iconImageV mas_makeConstraints:^(MASConstraintMaker *make) {
-
- make.leading.equalTo(weakSelf.mas_leading).offset(45);
- make.top.equalTo(weakSelf.mas_top).offset(30);
- make.size.mas_offset(CGSizeMake(21, 21));
- }];
- [_companyNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.leading.equalTo(weakSelf.iconImageV.mas_trailing).offset(10);
- make.centerY.equalTo(weakSelf.iconImageV);
-
- }];
- [_sendBtn mas_makeConstraints:^(MASConstraintMaker *make) {
- make.trailing.equalTo(weakSelf.mas_trailing).offset(-45);
- make.centerY.equalTo(weakSelf.iconImageV);
- make.size.mas_offset(CGSizeMake(50, 20));
- }];
- _sendBtn.layer.cornerRadius = 20/2;
-
- [_nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
-
- make.leading.equalTo(weakSelf.mas_leading).offset(45);
- make.top.equalTo(weakSelf.iconImageV.mas_bottom).offset(55);
- }];
- [_detailLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.leading.equalTo(weakSelf.mas_leading).offset(45);
- make.top.equalTo(weakSelf.nameLabel.mas_bottom).offset(23);
- make.trailing.equalTo(weakSelf.mas_trailing).offset(-45);
- make.bottom.equalTo(weakSelf.mas_bottom).offset(-10);
- }];
-
- self.companyNameLabel.text = @"公司";
- self.nameLabel.text = @"先生:";
- self.detailLabel.text = @"您好,\n我们已经查阅过您的简历并对您很感兴趣,希望您能来我司进行面试,具体内容与时间安排如下:";
-
- }
- - (void)sendButtonClick {
-
- self.sendInvitationBlock(self.sendBtn);
-
- }
- #pragma mark - setter&getter
- - (UIImageView *)iconImageV {
-
- if (_iconImageV == nil)
- {
- _iconImageV = [[UIImageView alloc]init];
- _iconImageV.image = [UIImage imageNamed:@"b_invitation_company"];
- }
- return _iconImageV;
- }
- - (UILabel *)companyNameLabel {
-
- if (_companyNameLabel == nil)
- {
- _companyNameLabel = [[UILabel alloc]init];
- _companyNameLabel.font = [UIFont systemFontOfSize:12];
- _companyNameLabel.textColor = COLOR_BACK3;
- }
- return _companyNameLabel;
- }
- - (UIButton *)sendBtn {
-
- if (_sendBtn == nil)
- {
- _sendBtn = [UIButton buttonWithType:UIButtonTypeCustom];
- [_sendBtn setTitle:@"发送" forState:UIControlStateNormal];
- _sendBtn.layer.borderWidth = 1;
- _sendBtn.layer.borderColor = COLOR_BLUE_4183E1.CGColor;
- [_sendBtn setTitleColor:COLOR_BLUE_4183E1 forState:UIControlStateNormal];
- _sendBtn.titleLabel.font = [UIFont systemFontOfSize:12];
- [_sendBtn addTarget:self action:@selector(sendButtonClick) forControlEvents:UIControlEventTouchUpInside];
-
- }
- return _sendBtn;
- }
- - (UILabel *)nameLabel {
-
- if (_nameLabel == nil)
- {
- _nameLabel = [[UILabel alloc]init];
- _nameLabel.font = [UIFont systemFontOfSize:18];
- _nameLabel.textColor = COLOR_BACK3;
- }
- return _nameLabel;
- }
- - (UILabel *)detailLabel {
-
- if (_detailLabel == nil)
- {
- _detailLabel = [[UILabel alloc]init];
- _detailLabel.font = [UIFont systemFontOfSize:12];
- _detailLabel.textColor = COLOR_BACK3;
- _detailLabel.numberOfLines = 0;
- }
- return _detailLabel;
- }
- /*
- // Only override drawRect: if you perform custom drawing.
- // An empty implementation adversely affects performance during animation.
- - (void)drawRect:(CGRect)rect {
- // Drawing code
- }
- */
- @end
|