//
//  XVHealthCardTypeView.m
//  fastservice
//
//  Created by xuning on 4/29/25.
//  Copyright © 2025 FastService. All rights reserved.
//

#import "XVHealthCardTypeView.h"

@interface XVHealthCardTypeView()


@property (nonatomic, strong) UILabel *titleLabel;



@property (nonatomic, strong) UILabel *subTitleLabel;


@property (nonatomic, strong) UIImageView *healthImageView;

@end

@implementation XVHealthCardTypeView

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        self.userInteractionEnabled = YES;
        [self setupUI];
    }
    return self;
}

- (void)title:(NSString *)title subTitle:(NSString *)subTitle {
    self.titleLabel.text = title;
    self.subTitleLabel.text = subTitle;
}

- (void)setupUI {
    
    [self addSubview:self.titleLabel];
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self).mas_offset(22);
        make.left.mas_equalTo(self).mas_offset(22);
    }];
    
    [self addSubview:self.subTitleLabel];
    [self.subTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.mas_equalTo(self).mas_offset(-15);
        make.left.mas_equalTo(self).mas_offset(22);
    }];
    
    [self addSubview:self.healthImageView];
    [self.healthImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self);
        make.size.mas_equalTo(CGSizeMake(53, 53));
        make.right.mas_equalTo(self).mas_offset(-26);
    }];
    
    

    
}

- (UILabel *)titleLabel {
    if (_titleLabel == nil) {
        _titleLabel = [[UILabel alloc]initWithText:@"标题" textColor:F_101010_COLOR textAlignment:(NSTextAlignmentLeft) fontSize:24];
    }
    return _titleLabel;
}

- (UILabel *)subTitleLabel {
    if (_subTitleLabel == nil) {
        _subTitleLabel = [[UILabel alloc]initWithText:@"副标题" textColor:F_101010_COLOR textAlignment:(NSTextAlignmentLeft) fontSize:14];
    }
    return _subTitleLabel;
}




- (UIImageView *)healthImageView {
    if (_healthImageView == nil) {
        _healthImageView = [[UIImageView alloc]initWithImageName:@"图标 1"];
    }
    return _healthImageView;
}

@end
