| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289 |
- //
- // BHomeResumeDetailIntentionCell.m
- // HappyJob
- //
- // Created by 张晓光 on 2019/7/3.
- // Copyright © 2019 Bob. All rights reserved.
- //
- #import "BHomeResumeDetailIntentionCell.h"
- #import "BHomeResumeDetailModel.h"
- @interface BHomeResumeDetailIntentionCell ()
- @property (nonatomic, strong) UIView *bgView;
- @property (nonatomic, strong) UIButton *blueView;
- @property (nonatomic, strong) UIButton *iconBtn;
- @property (nonatomic, strong) UILabel *positionTitleLabel;
- @property (nonatomic, strong) UILabel *positionLabel;
- @property (nonatomic, strong) UILabel *addressTitleLabel;
- @property (nonatomic, strong) UILabel *addressLabel;
- @property (nonatomic, strong) UILabel *salaryTitleLabel;
- @property (nonatomic, strong) UILabel *salaryLabel;
- @property (nonatomic, strong) UIView *lineView;
- @end
- @implementation BHomeResumeDetailIntentionCell
- - (void)awakeFromNib {
- [super awakeFromNib];
- // Initialization code
- }
- - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
-
- if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])
- {
- self.selectionStyle = UITableViewCellSelectionStyleNone;
- self.backgroundColor = COLOR_GRAYFA;
- [self initViews];
- [self autoLayOutViews];
- }
- return self;
- }
- - (void)initViews {
-
- [self.contentView addSubview:self.bgView];
- [self.bgView addSubview:self.blueView];
- [self.blueView addSubview:self.iconBtn];
-
- [self.bgView addSubview:self.positionTitleLabel];
- [self.bgView addSubview:self.positionLabel];
- [self.bgView addSubview:self.addressTitleLabel];
- [self.bgView addSubview:self.addressLabel];
- [self.bgView addSubview:self.salaryTitleLabel];
- [self.bgView addSubview:self.salaryLabel];
- [self.bgView addSubview:self.lineView];
- }
- - (void)bHomeResumeDetailIntentionCellDict:(NSDictionary *)dict {
-
- if (dict)
- {
- BHomeResumeDetailModel *model = [BHomeResumeDetailModel yy_modelWithJSON:dict];
- NSArray *positionArray = @[@"普工", @"客服", @"销售", @"服务员", @"物流仓储", @"司机", @"才艺技能", @"文员助理", @"快递配送", @"促销导购", @"展会演出", @"家教培训", @"模特", @"贸易采购", @"厨师", @"编辑", @"线上推广", @"设计", @"技工", @"保洁", @"其它"];
- NSString *positionStr;
- if (model.expectationPosition.length > 0)
- {
- NSArray *expectationPositionArray = [model.expectationPosition componentsSeparatedByString:@","];
- for (int i = 0; i <expectationPositionArray.count ; i ++ )
- {
- if (positionStr.length > 0)
- {
- positionStr = [NSString stringWithFormat:@"%@,%@",positionStr,positionArray[[expectationPositionArray[i] integerValue]]];
- }
- else
- {
- positionStr = [NSString stringWithFormat:@"%@",positionArray[[expectationPositionArray[i] integerValue]]];
- }
- }
- }
- self.positionLabel.text = positionStr ? positionStr :@"无";
- self.addressLabel.text = model.expectationAddress ? model.expectationAddress :@"无";
- NSArray *moneyArray = @[@"1000~2000元/月", @"2001~3000元/月", @"3001~4000元/月", @"4001~5000元/月", @"5001~6000元/月", @"6001~7000元/月", @"7001~8000元/月", @"8001~9000元/月", @"9001~10000元/月", @"10000以上元/月"];
- if (model.expectationSalary.length > 0 && [model.expectationSalary integerValue] >= 0)
- {
- self.salaryLabel.text = moneyArray[[model.expectationSalary integerValue]];
- }
- else
- {
- self.salaryLabel.text = @"不限";
- }
- }
- }
- #pragma mark - 布局
- - (void)autoLayOutViews {
-
- __weak typeof(self) weakSelf = self;
- [_bgView mas_makeConstraints:^(MASConstraintMaker *make) {
-
- make.leading.equalTo(weakSelf.contentView.mas_leading).offset(15);
- make.trailing.equalTo(weakSelf.contentView.mas_trailing).offset(-15);
- make.top.equalTo(weakSelf.contentView.mas_top).offset(20);
- make.bottom.equalTo(weakSelf.contentView.mas_bottom).offset(0);
- }];
- [_blueView mas_makeConstraints:^(MASConstraintMaker *make) {
-
- make.leading.equalTo(weakSelf.bgView.mas_leading).offset(0);
- make.trailing.equalTo(weakSelf.bgView.mas_trailing).offset(0);
- make.top.equalTo(weakSelf.bgView.mas_top).offset(0);
- }];
-
-
- [_iconBtn mas_makeConstraints:^(MASConstraintMaker *make) {
-
- make.leading.equalTo(weakSelf.blueView.mas_leading).offset(20);
- make.top.equalTo(weakSelf.blueView.mas_top).offset(10);
- make.bottom.equalTo(weakSelf.blueView.mas_bottom).offset(-10);
- }];
-
- [_positionTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
-
- make.leading.equalTo(weakSelf.bgView.mas_leading).offset(50);
- make.top.equalTo(weakSelf.blueView.mas_bottom).offset(17);
- make.width.mas_equalTo(65);
- }];
- [_positionLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.leading.equalTo(weakSelf.positionTitleLabel.mas_trailing).offset(30);
- make.top.equalTo(weakSelf.blueView.mas_bottom).offset(17);
- make.trailing.equalTo(weakSelf.bgView.mas_trailing).offset(-30);
-
- }];
-
- [_addressTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
-
- make.leading.equalTo(weakSelf.bgView.mas_leading).offset(50);
- make.top.equalTo(weakSelf.positionLabel.mas_bottom).offset(10);
- make.width.mas_equalTo(65);
- }];
- [_addressLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.leading.equalTo(weakSelf.addressTitleLabel.mas_trailing).offset(30);
- make.top.equalTo(weakSelf.positionLabel.mas_bottom).offset(10);
- make.trailing.equalTo(weakSelf.bgView.mas_trailing).offset(-30);
- }];
-
- [_salaryTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
-
- make.leading.equalTo(weakSelf.bgView.mas_leading).offset(50);
- make.top.equalTo(weakSelf.addressLabel.mas_bottom).offset(12);
- make.width.mas_equalTo(65);
- }];
- [_salaryLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.leading.equalTo(weakSelf.addressTitleLabel.mas_trailing).offset(30);
- make.top.equalTo(weakSelf.addressLabel.mas_bottom).offset(10);
- make.trailing.equalTo(weakSelf.bgView.mas_trailing).offset(-30);
- make.bottom.equalTo(weakSelf.bgView.mas_bottom).offset(-24);
- }];
- [_lineView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.leading.equalTo(weakSelf.bgView.mas_leading).offset(0);
- make.trailing.equalTo(weakSelf.bgView.mas_trailing).offset(0);
- make.bottom.equalTo(weakSelf.bgView.mas_bottom).offset(0);
- make.height.mas_equalTo(1);
- }];
- }
- #pragma mark - setter&getter
- - (UIView *)bgView {
-
- if (_bgView == nil)
- {
- _bgView = [[UIView alloc]init];
- _bgView.backgroundColor = [UIColor whiteColor];
- _bgView.layer.cornerRadius = 5;
- _bgView.layer.masksToBounds = YES;
- _bgView.clipsToBounds = YES;
- }
- return _bgView;
- }
- - (UIButton *)blueView {
-
- if (_blueView == nil)
- {
- _blueView = [[UIButton alloc]init];
- [_blueView az_setGradientBackgroundWithColors:@[[UIColor colorFromHexString:@"219BEE"],[UIColor colorFromHexString:@"2BB0F5"]] locations:@[@(0.0),@(1.0f)] startPoint:CGPointMake(0, 0) endPoint:CGPointMake(1, 0)];
- }
- return _blueView;
- }
- - (UIButton *)iconBtn {
-
- if (_iconBtn == nil)
- {
- _iconBtn = [UIButton buttonWithType:UIButtonTypeCustom];
- [_iconBtn setTitle:@"求职意向" forState:UIControlStateNormal];
- [_iconBtn setImage:[UIImage imageNamed:@"b_message_white"] forState:UIControlStateNormal];
- [_iconBtn layoutButtonWithEdgeInsetsStyle:MKButtonEdgeInsetsStyleLeft imageTitleSpace:5];
- _iconBtn.titleLabel.font = [UIFont systemFontOfSize:12];
- }
- return _iconBtn;
- }
- - (UILabel *)positionTitleLabel {
-
- if (_positionTitleLabel == nil)
- {
- _positionTitleLabel = [[UILabel alloc]init];
- _positionTitleLabel.text = @"期望岗位:";
- _positionTitleLabel.font = [UIFont systemFontOfSize:12];
- _positionTitleLabel.textColor = COLOR_BACK6;
- }
- return _positionTitleLabel;
- }
- - (UILabel *)positionLabel {
-
- if (_positionLabel == nil)
- {
- _positionLabel = [[UILabel alloc]init];
- _positionLabel.font = [UIFont systemFontOfSize:12];
- _positionLabel.textColor = COLOR_BACK6;
- _positionLabel.numberOfLines = 0;
- }
- return _positionLabel;
- }
- - (UILabel *)addressTitleLabel {
-
- if (_addressTitleLabel == nil)
- {
- _addressTitleLabel = [[UILabel alloc]init];
- _addressTitleLabel.text = @"期望地点:";
- _addressTitleLabel.font = [UIFont systemFontOfSize:12];
- _addressTitleLabel.textColor = COLOR_BACK6;
- }
- return _addressTitleLabel;
- }
- - (UILabel *)addressLabel {
-
- if (_addressLabel == nil)
- {
- _addressLabel = [[UILabel alloc]init];
- _addressLabel.font = [UIFont systemFontOfSize:12];
- _addressLabel.textColor = COLOR_BACK6;
- _addressLabel.numberOfLines = 0;
- }
- return _addressLabel;
- }
- - (UILabel *)salaryTitleLabel {
-
- if (_salaryTitleLabel == nil)
- {
- _salaryTitleLabel = [[UILabel alloc]init];
- _salaryTitleLabel.text = @"期望薪资:";
- _salaryTitleLabel.font = [UIFont systemFontOfSize:12];
- _salaryTitleLabel.textColor = COLOR_BACK6;
- }
- return _salaryTitleLabel;
- }
- - (UILabel *)salaryLabel {
-
- if (_salaryLabel == nil)
- {
- _salaryLabel = [[UILabel alloc]init];
- _salaryLabel.font = [UIFont systemFontOfSize:12];
- _salaryLabel.textColor = COLOR_BACK6;
- _salaryLabel.numberOfLines = 0;
- }
- return _salaryLabel;
- }
- - (UIView *)lineView {
-
- if (_lineView== nil)
- {
- _lineView = [[UIView alloc]init];
- _lineView.backgroundColor = COLOR_BACKE;
- }
- return _lineView;
-
- }
- - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
- [super setSelected:selected animated:animated];
- // Configure the view for the selected state
- }
- @end
|