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

#import "CTPrizeDetailProcessTableViewCell.h"
#import "CTPrizeDetailProcessTableCellContentView.h"

@interface CTPrizeDetailProcessTableViewCell ()

@property (nonatomic, strong)CTPrizeDetailProcessTableCellContentView *customView;

@end

@implementation CTPrizeDetailProcessTableViewCell
#pragma mark  life cycle
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        
        [self setupUI];
    }
    
    return self;
}

- (void)setupUI {
    
    CTPrizeDetailProcessTableCellContentView *custom = [[CTPrizeDetailProcessTableCellContentView alloc]init];
    custom.backgroundColor=[UIColor clearColor];
    [self.contentView addSubview:custom];
    self.customView = custom;
    
    custom.currented = NO;
    custom.hasUpLine = NO;
    custom.hasDownLine = NO;
    [custom mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.mas_equalTo(self);
    }];
}


#pragma mark - public methods
- (void)reloadUIWithData:(NSDictionary *)dic type:(CTListPrizeType)type state:(CTListPrizeState)state Index:(NSInteger)index
{
    [self.customView reloadUIWithData:dic type:type state:state Index:index];
}


#pragma mark - gettrs and setters
- (void)setHasUpLine:(BOOL)hasUpLine {
    
    self.customView.hasUpLine = hasUpLine;
}

- (void)setHasDownLine:(BOOL)hasDownLine {
    
    self.customView.hasDownLine = hasDownLine;
}

- (void)setCurrented:(BOOL)currented {
    
    self.customView.currented = currented;
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

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

    // Configure the view for the selected state
}

@end
