//
//  HomeMiddleNewsCell.m
//  Open
//
//  Created by 雷俊博 on 2021/2/4.
//  Copyright © 2021 黄江涛 . All rights reserved.
//

#import "HomeMiddleNewsCell.h"

@implementation HomeMiddleNewsCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    
    self.lb_content1 = [[YYLabel alloc]init];
    self.lb_content2 = [[YYLabel alloc]init];
    self.lb_content1.textColor = [UIColor colorWithHex:0x808080];
    self.lb_content2.textColor = [UIColor colorWithHex:0x808080];
    self.lb_content1.textAlignment = NSTextAlignmentLeft;
    self.lb_content2.textAlignment = NSTextAlignmentLeft;
    [self.contentView addSubview:self.lb_content1];
    [self.contentView addSubview:self.lb_content2];
    
    [self.helpBtn addTarget:self action:@selector(helpBtnClick:) forControlEvents:UIControlEventTouchUpInside];
    
//    UIButton *btn1 = [UIButton buttonWithType:UIButtonTypeCustom];
//    btn1.tag = 200;
//    [btn1 addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
//    [self.contentView addSubview:btn1];
//
//    UIButton *btn2 = [UIButton buttonWithType:UIButtonTypeCustom];
//    btn2.tag = 201;
//    [btn2 addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
//    [self.contentView addSubview:btn2];
    
    [self.lb_content1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.view1);
        make.left.equalTo(self.view1.mas_right).offset(15);
        make.right.offset(-45);
    }];
    
    [self.lb_content2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.view2);
        make.left.right.equalTo(self.lb_content1);
    }];
    
//    [btn1 mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.center.width.height.equalTo(self.lb_content1);
//    }];
//
//    [btn2 mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.center.width.height.equalTo(self.lb_content2);
//    }];
//
   
    
    
}




#pragma mark - event response
- (void)btnClick:(UIButton *)sender {
    
    
    if (self.delegate && [self.delegate respondsToSelector:@selector(clickNewsBtn:)]) {
        [self.delegate clickNewsBtn:sender];
    }
}

- (void)helpBtnClick:(UIButton *)sender {
    
    if (self.delegate && [self.delegate respondsToSelector:@selector(clickHelpBtn:)]) {
        [self.delegate clickHelpBtn:sender];
    }
}

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

    // Configure the view for the selected state
}

@end
