//
//  FindRecommendBookCell.m
//  Open
//
//  Created by 雷俊博 on 2020/6/2.
//  Copyright © 2020 黄江涛 . All rights reserved.
//

#import "FindRecommendBookCell.h"

@interface FindRecommendBookCell ()

@property (weak, nonatomic) IBOutlet NSLayoutConstraint *topViewHeightLayout;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *iconLeftLayout;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *titleLeftLayout;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *moreBtnRightLayout;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *leftLeadingLayout;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *middleLeadingLayout;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *rightLeadingLayout;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *topLeadingLayout;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *bottomLeadingLayout;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *iconImgWidthLayout;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *iconImgHeightLayout;


@end

@implementation FindRecommendBookCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    
    self.topViewHeightLayout.constant = 48 * WIDTHRADIU;
    self.iconLeftLayout.constant = 15 * WIDTHRADIU;
    self.titleLeftLayout.constant = 5 * WIDTHRADIU;
    self.moreBtnRightLayout.constant = 10 * WIDTHRADIU;
    self.leftLeadingLayout.constant = 15 * WIDTHRADIU;
    self.middleLeadingLayout.constant = 10 * WIDTHRADIU;
    self.rightLeadingLayout.constant = 15 * WIDTHRADIU;
    self.topLeadingLayout.constant = 10 * WIDTHRADIU;
    self.bottomLeadingLayout.constant = 15 * WIDTHRADIU;
    self.iconImgWidthLayout.constant = 19 * WIDTHRADIU;
    self.iconImgHeightLayout.constant = 18 * WIDTHRADIU;
    
    self.lb_title.attributedText = [[NSMutableAttributedString alloc] initWithString:@"听书推荐" attributes:@{NSFontAttributeName: [UIFont fontWithName:@"PingFangSC-Semibold" size: 16 * WIDTHRADIU],NSForegroundColorAttributeName: [UIColor colorWithHex:0x333333]}];
    
    self.moreBtn.titleLabel.font = [UIFont fontWithName:@"PingFang  SC" size: 14 * WIDTHRADIU];
    [self.moreBtn layoutButtonWithEdgeInsetsStyle:GLButtonEdgeInsetsStyleRight imageTitleSpace:5];
}
- (IBAction)BtnClick:(UIButton *)sender {
    FindRecommendBookCellType type;
    if (sender == self.btn1) {
        type = FindRecommendBookCellTypeEverything;
    }else if (sender == self.btn2){
        type = FindRecommendBookCellTypeAllListen;
    }else if (sender == self.btn3){
        type = FindRecommendBookCellTypeSleep;
    }else if (sender == self.moreBtn){
        type = FindRecommendBookCellTypeMore;
    }
    
    if (self.delegate && [self.delegate respondsToSelector:@selector(clickItemWithType:)]) {
        [self.delegate clickItemWithType:type];
    }
    
}

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

    // Configure the view for the selected state
}

@end
