//
//  WithDrawAmountOneSelectCell.m
//  Open
//
//  Created by 雷俊博 on 2021/5/25.
//  Copyright © 2021 黄江涛 . All rights reserved.
//

#import "WithDrawAmountOneSelectCell.h"

@implementation WithDrawAmountOneSelectCell
#pragma mark - life cycle
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        [self.contentView addSubview:self.iconImg];
        [self.contentView addSubview:self.lb_money];
        [self.contentView addSubview:self.lb_message];
        [self slayoutMyUI];
        
        self.contentView.layer.borderWidth = 1;
        self.contentView.layer.borderColor = [UIColor colorWithHex:0xcccccc].CGColor;
        self.contentView.layer.cornerRadius = 5;
        self.backgroundColor = [UIColor whiteColor];
        self.cellSelected = NO;
    }
    return self;
}

- (void)slayoutMyUI
{
    [self.iconImg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.offset(0);
    }];
    
    [self.lb_money mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.offset(8 * WIDTHRADIU);
        
        make.centerX.equalTo(self.contentView);
        
    }];
    [self.lb_message mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.contentView);
        make.top.equalTo(self.lb_money.mas_bottom).offset(6 * WIDTHRADIU);
    }];
    
}

#pragma mark - getters and setters

- (void)setCellSelected:(BOOL)cellSelected
{
    if (cellSelected) {
         self.contentView.layer.borderColor = [UIColor colorWithHex:0xf98505].CGColor;
        self.iconImg.hidden = NO;
    }else{
        self.contentView.layer.borderColor = [UIColor colorWithHex:0xcccccc].CGColor;
        self.iconImg.hidden = YES;
    }
}



- (UIImageView *)iconImg
{
    if (!_iconImg) {
        _iconImg = [[UIImageView alloc]init];
        _iconImg.image = [UIImage imageNamed:@"my_wallet_Withdrawaloffunds_Selected"];
    }
    return _iconImg;
}

- (UILabel *)lb_money
{
    if (!_lb_money) {
        _lb_money = [[UILabel alloc]init];
        _lb_money.text = @"5元";
        //_lb_money.backgroundColor = [UIColor redColor];
        _lb_money.textAlignment = NSTextAlignmentCenter;
        _lb_money.textColor = [UIColor colorWithHex:0x4d4d4d];
        _lb_money.font = [UIFont systemFontOfSize:17* WIDTHRADIU];
    }
    return _lb_money;
}

- (UILabel *)lb_message
{
    if (!_lb_message) {
        _lb_message = [[UILabel alloc]init];
        _lb_message.text = @"仅限首次提现";
        _lb_message.textAlignment = NSTextAlignmentCenter;
        _lb_message.textColor = [UIColor colorWithHex:0x808080];
        _lb_message.font = [UIFont systemFontOfSize:13* WIDTHRADIU];
    }
    return _lb_message;
}

@end
