//
//  SSCardCollectOtherInfoCell.m
//  Open
//
//  Created by 雷俊博 on 2019/11/22.
//  Copyright © 2019 黄江涛 . All rights reserved.
//

#import "SSCardCollectOtherInfoCell.h"

@interface SSCardCollectOtherInfoCell ()

@property (weak, nonatomic) IBOutlet UIButton *btn_onjob;
@property (weak, nonatomic) IBOutlet UIButton *btn_retire;
@property (weak, nonatomic) IBOutlet UIButton *btn_other;

@end

@implementation SSCardCollectOtherInfoCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    [self Btn:_btn_retire select:NO];
    [self Btn:_btn_onjob select:NO];
    [self Btn:_btn_other select:NO];
}

- (void)clickBtn
{
    [self btnClick:self.btn_retire];
}
- (IBAction)btnClick:(UIButton *)sender {
    
    
    [self Btn:sender select:YES];
    if (sender == _btn_onjob) {
        [self Btn:_btn_retire select:NO];
        [self Btn:_btn_other select:NO];
    }else if (sender == _btn_retire){
        [self Btn:_btn_onjob select:NO];
        [self Btn:_btn_other select:NO];
    }else if (sender == _btn_other){
        [self Btn:_btn_onjob select:NO];
        [self Btn:_btn_retire select:NO];
    }
    
}

- (void)Btn:(UIButton *)sender select:(BOOL)selected
{
    if (selected) {
        [sender setBackgroundColor:K_MainColor];
        [sender setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        
        sender.layer.borderColor = K_MainColor.CGColor;
        
    }else{
        [sender setBackgroundColor:[UIColor whiteColor]];
        [sender setTitleColor:[UIColor colorWithHex:0x808080] forState:UIControlStateNormal];
        sender.layer.borderColor = [UIColor colorWithHex:0xcccccc].CGColor;
        sender.layer.borderWidth = 1.0;
    }
    
    
    if (self.delegate && [self.delegate respondsToSelector:@selector(btnClickWithButton:)]) {
        [self.delegate btnClickWithButton:sender];
    }
}



- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
