//
//  XVOrderInfoViewCell.m
//  fastservice
//
//  Created by xuning on 2/23/24.
//  Copyright © 2024 FastService. All rights reserved.
//

#import "XVOrderInfoViewCell.h"

@interface XVOrderInfoViewCell()

@property (nonatomic, strong) UILabel *titleLabel;

@property (nonatomic, strong) UILabel *detailLabel;


@end

@implementation XVOrderInfoViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self setupUI];
    }
    return self;
}

- (void)setupUI {
 
    self.contentView.backgroundColor = [UIColor whiteColor];
    [self.contentView addSubview:self.titleLabel];
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.contentView).mas_offset(0);
        make.left.mas_equalTo(self.contentView).mas_offset(26);
        make.height.mas_equalTo(44);
//        make.bottom.mas_equalTo(self.contentView).mas_offset(-3.5);
        
    }];
    [self.contentView addSubview:self.detailLabel];
    [self.detailLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.contentView).mas_offset(0);
        make.right.mas_equalTo(self.contentView).mas_offset(-20);
        make.left.mas_equalTo(self.titleLabel.mas_right).mas_offset(27);
        make.bottom.mas_equalTo(self.contentView).mas_offset(0);
    }];

}

- (UILabel *)titleLabel {
    if(_titleLabel == nil) {
        _titleLabel = [[UILabel alloc]initWithText:@"标题" textColor:kHexRGB(0x606060) textAlignment:(NSTextAlignmentLeft) fontSize:16];
    }
    return _titleLabel;
}
- (UILabel *)detailLabel {
    if(_detailLabel == nil) {
        _detailLabel = [[UILabel alloc]init];
        _detailLabel.text = @"副标题";
        _detailLabel.textColor = kHexRGB(0x606060);
        _detailLabel.textAlignment = NSTextAlignmentRight;
        _detailLabel.font = [UIFont systemFontOfSize:16];
        _detailLabel.numberOfLines = 0;
        _detailLabel.lineBreakMode = NSLineBreakByWordWrapping;
        [_detailLabel sizeToFit];
        
    }
    return _detailLabel;
}

@end
