//
//  MyWalletRankHeaderView.m
//  Open
//
//  Created by 雷俊博 on 2021/7/21.
//  Copyright © 2021 黄江涛 . All rights reserved.
//

#import "MyWalletRankHeaderView.h"

@implementation MyWalletRankHeaderView
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = [UIColor whiteColor];
        [self setupUI];
    }
    return self;
}

- (void)setupUI
{
    UIView *headerView = [[UIView alloc]initWithFrame:CGRectMake(0, 5 * WIDTHRADIU, ScreenWidth, 32 * WIDTHRADIU)];
    [self addSubview:headerView];
    
    //rank
    UILabel *lb_rank = [UILabel new];
    lb_rank.text = @"排名";
    lb_rank.textColor = [UIColor colorWithHex:0x808080];
    lb_rank.font = [UIFont systemFontOfSize:13 * WIDTHRADIU];
    [headerView addSubview:lb_rank];
    [lb_rank mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(15 * WIDTHRADIU);
        make.centerY.equalTo(headerView);
    }];
    
    //user
    UILabel *lb_user = [UILabel new];
    lb_user.text = @"用户";
    lb_user.textColor = [UIColor colorWithHex:0x808080];
    lb_user.font = [UIFont systemFontOfSize:13 * WIDTHRADIU];
    [headerView addSubview:lb_user];
    [lb_user mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(lb_rank.mas_right).offset(80 * WIDTHRADIU);
        make.centerY.equalTo(headerView);
    }];
    
    
    //累计收益
    UILabel *lb_profitSum = [UILabel new];
    lb_profitSum.text = @"累计收益";
    lb_profitSum.textColor = [UIColor colorWithHex:0x808080];
    lb_profitSum.font = [UIFont systemFontOfSize:13 * WIDTHRADIU];
    [headerView addSubview:lb_profitSum];
    [lb_profitSum mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.offset(- 30 * WIDTHRADIU);
        make.centerY.equalTo(headerView);
    }];
    
    self.lb_profitSum = lb_profitSum;
    
    UIView *lineView = [UIView new];
    lineView.backgroundColor = [UIColor colorWithHex:0x999999];
    [self addSubview:lineView];
    [lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.right.offset(0);
        make.bottom.offset(0);
        make.height.offset(0.5);
    }];
    
    
    
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
