//
//  OrderProcessTableViewCell.m
//  Open
//
//  Created by 雷俊博 on 2019/10/18.
//  Copyright © 2019 黄江涛 . All rights reserved.
//

#import "OrderProcessTableViewCell.h"
#import "OrderProgressCellContentView.h"

@interface OrderProcessTableViewCell ()   

@property (strong, nonatomic)OrderProgressCellContentView *customView;


@end

@implementation OrderProcessTableViewCell
#pragma mark - life cylce
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
   self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self setupUI];
    }
    return self;
}
- (void)reloadDataWithModel:(OrderModel*)model {
    
    [self.customView reloadDataWithModel:model];
}

- (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)setupUI {
    
    OrderProgressCellContentView *custom = [[OrderProgressCellContentView alloc]init];
    custom.backgroundColor = [UIColor whiteColor];
    [self addSubview:custom];
    self.customView = custom;
    
    custom.currented = NO;
    custom.hasUpLine = YES;
    custom.hasDownLine = YES;
    [custom mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.mas_equalTo(self);
    }];
}

- (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
