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

#import "XVPersonalHeaderView.h"
#import "XVPersonalHeaderItemView.h"

@interface XVPersonalHeaderView()

@property (nonatomic, strong) XVPersonalHeaderItemView *orderView;

@property (nonatomic, strong) XVPersonalHeaderItemView *moneyView;

@property (nonatomic, strong) XVPersonalHeaderItemView *scoreView;


@end

@implementation XVPersonalHeaderView

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

    [self addSubview:self.orderView];
    [self addSubview:self.moneyView];
    [self addSubview:self.scoreView];
    
}


- (XVPersonalHeaderItemView *)orderView {
    if (_orderView == nil) {
        _orderView = [[XVPersonalHeaderItemView alloc]initWithFrame:CGRectMake(0, 0, self.width/3, self.height)];
        _orderView.titleLabel.text = @"今日完成（单）";
        _orderView.numberLabel.text = @"0";
        [_orderView.button setTitle:@"接单统计" forState:(UIControlStateNormal)];
    }
    return _orderView;
}

- (XVPersonalHeaderItemView *)moneyView {
    if (_moneyView == nil) {
        _moneyView = [[XVPersonalHeaderItemView alloc]initWithFrame:CGRectMake(self.width/3, 0, self.width/3, self.height)];
        _moneyView.titleLabel.text = @"今日收入（元）";
        _moneyView.numberLabel.text = @"0";
        [_moneyView.button setTitle:@"我的钱包" forState:(UIControlStateNormal)];
    }
    return _moneyView;
}


- (XVPersonalHeaderItemView *)scoreView {
    if (_scoreView == nil) {
        _scoreView = [[XVPersonalHeaderItemView alloc]initWithFrame:CGRectMake(self.width/3*2, 0, self.width/3, self.height)];
        _scoreView.titleLabel.text = @"服务分";
        _scoreView.numberLabel.text = @"0";
        [_scoreView.button setTitle:@"接单排行" forState:(UIControlStateNormal)];
    }
    return _scoreView;
}


@end
