//
//  AdBottomView.m
//  Open
//
//  Created by 雷俊博 on 2019/9/18.
//  Copyright © 2019 黄江涛 . All rights reserved.
//

#import "AdBottomView.h"


@interface AdBottomView ()

@property (nonatomic, strong)UIImageView *img_icon;

@property (nonatomic, strong)UILabel *lb_title;

@property (nonatomic, strong)UILabel *lb_subTitle;

@end

@implementation AdBottomView
#pragma mark - life cycle
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self addSubview:self.img_icon];
        [self addSubview:self.lb_title];
        [self addSubview:self.lb_subTitle];
        [self setupUI];
    }
    return self;
}

- (void)setupUI
{
    [self.img_icon mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self);
        make.centerX.equalTo(self.mas_centerX).offset(-50 -15);
        make.width.height.offset(50);
    }];
    
    [self.lb_title mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.img_icon.mas_top).offset(3);
        make.left.equalTo(self.img_icon.mas_right).offset(14);
        make.height.offset(29);
    }];
    
    [self.lb_subTitle mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.lb_title);
        make.top.equalTo(self.lb_title.mas_bottom).offset(5);
        make.height.offset(13);
    }];
    
}

#pragma mark - getters and setters
- (UIImageView *)img_icon
{
    if (!_img_icon) {
        _img_icon = [[UIImageView alloc]init];
        _img_icon.image = [UIImage imageNamed:@"login_icon"];
    }
    return _img_icon;
}

- (UILabel *)lb_title
{
    if (!_lb_title) {
        _lb_title = [[UILabel alloc]init];
        _lb_title.text = @"看看生活";
        _lb_title.font = [UIFont boldSystemFontOfSize:29];
        _lb_title.textColor = K_MainColor;
    }
    return _lb_title;
}

- (UILabel *)lb_subTitle
{
    if (!_lb_subTitle) {
        _lb_subTitle = [[UILabel alloc]init];
        _lb_subTitle.text = @"安全认证  放心领钱";
        _lb_subTitle.font = [UIFont systemFontOfSize:13];
        _lb_subTitle.textColor = [UIColor colorWithHex:0x808080];
    }
    return _lb_subTitle;
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
