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

#import "XVHealthCardStatusView.h"

@interface XVHealthCardStatusView()


@property (nonatomic, strong) UILabel *titleLabel;

@property (nonatomic, strong) UIImageView *rightImageView;

@property (nonatomic, strong) UIImageView *healthImageView;

@property (nonatomic, strong) UIImageView *statusImageView;


@property (nonatomic, strong) UILabel *dateLabel;

@property (nonatomic, strong) UIButton *submitButton;


@end

@implementation XVHealthCardStatusView




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

- (void)setupUI {
    
    [self addSubview:self.titleLabel];
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self).mas_offset(30);
        make.left.mas_equalTo(self).mas_offset(22);
    }];
    
    [self addSubview:self.rightImageView];
    [self.rightImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.titleLabel);
        make.size.mas_equalTo(CGSizeMake(24, 24));
        make.left.mas_equalTo(self.titleLabel.mas_right).mas_offset(5);
    }];
    
    [self addSubview:self.healthImageView];
    [self.healthImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.titleLabel);
        make.size.mas_equalTo(CGSizeMake(53, 53));
        make.right.mas_equalTo(self).mas_offset(-26);
    }];
    
    [self addSubview:self.statusImageView];
    [self.statusImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self).mas_offset(16);
        make.bottom.mas_equalTo(self).mas_offset(-16);
        make.size.mas_equalTo(CGSizeMake(65, 27));
    }];
    
    
    [self addSubview:self.submitButton];
    [self.submitButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.mas_equalTo(CGSizeMake(80, 30));
        make.right.mas_equalTo(self).mas_offset(-26);
        make.centerY.mas_equalTo(self.statusImageView);
    }];
    kViewBorderRadius(self.submitButton, 4, 0, [UIColor whiteColor]);
    
    [self addSubview:self.dateLabel];
    [self.dateLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.statusImageView);
        make.left.mas_equalTo(self.statusImageView.mas_right).mas_offset(9);
        make.height.mas_equalTo(27);
        make.right.mas_equalTo(self.submitButton.mas_left).mas_offset(-25);
    }];
    
    kViewBorderRadius(self.dateLabel, 10, 0, [UIColor whiteColor]);

    
}


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

- (UIImageView *)rightImageView {
    if (_rightImageView == nil) {
        _rightImageView = [[UIImageView alloc]initWithImageName:@"arcoDesign-right 1"];
    }
    return _rightImageView;
}

- (UIImageView *)statusImageView {
    if (_statusImageView == nil) {
        _statusImageView = [[UIImageView alloc]initWithImageName:@"图标 3"];
    }
    return _statusImageView;
}

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

- (UILabel *)dateLabel {
    if (_dateLabel == nil) {
        _dateLabel = [[UILabel alloc]initWithText:@"" textColor:F_101010_COLOR textAlignment:(NSTextAlignmentCenter) fontSize:12];
    }
    return _dateLabel;
}

- (UIButton *)submitButton {
    if (_submitButton == nil) {
        _submitButton = [[UIButton alloc]initWithTitle:@"重新提交" fontSize:14 titleColor:[UIColor whiteColor] bgColor:kHexRGB(0xA4ADB3)];
    }
    return _submitButton;
}
@end
