//
//  Log2HeaderView.m
//  Open
//
//  Created by 雷俊博 on 2019/9/11.
//  Copyright © 2019 黄江涛 . All rights reserved.
//

#import "Log2HeaderView.h"
#import "LogBtnCollectionViewCell.h"
#import "Constants.h"

#import "Tools.h"
#import "LSLDecimalNumberTool.h"

#import <Masonry.h>

#import "UIImageView+WebCache.h"

@interface Log2HeaderView ()

@property (nonatomic, strong)UIImageView *img_Icon;

@property (nonatomic, strong)UILabel *lb_nickName;

@property (nonatomic, strong)UIButton *authBtn;

@property (nonatomic, strong)UILabel *lb_telPhone;

@property (nonatomic, strong)UIView *redView;

@property (nonatomic, strong)UIImageView *img_coins;

@property (nonatomic, strong)UILabel *lb_coins;

@property (nonatomic, strong)UIImageView *img_arrows;

@property (nonatomic, strong)UIButton *btn_redView;

@property (nonatomic, strong)UIView *whiteCardView;


@property (nonatomic, strong)UILabel *lb_allCoinsNumber;

@property (nonatomic, strong)UILabel *lb_allCoins;

@property (nonatomic, strong)UIButton *btn_left;

@property (nonatomic, strong)UIView *lineView;

@property (nonatomic, strong)UILabel *lb_todayProfit;

@property (nonatomic, strong)UILabel *lb_todayProfitTitle;

@property (nonatomic, strong)UIButton *btn_profit;

@property (nonatomic, strong)UIView *lineView2;

@property (nonatomic, strong)UILabel *lb_todayCoinsNumber;

@property (nonatomic, strong)UILabel *lb_todayCoins;

@property (nonatomic, strong)UIButton *btn_right;

@property (nonatomic, strong)NSArray  *arrayBtns;
@property (nonatomic, strong)NSArray *arrayImages;

@end

@implementation Log2HeaderView
#pragma mark - life cycle
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self addSubview:self.img_Icon];
        [self addSubview:self.lb_nickName];
        [self addSubview:self.authBtn];
        [self addSubview:self.lb_telPhone];
        [self addSubview:self.redView];
        [self addSubview:self.whiteCardView];
        
        
        self.backgroundColor = [UIColor whiteColor];
        
        
        [self setupUI];
    }
    return self;
}

- (void)setupUI
{
    [self.img_Icon mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.offset(cl_kStatusBarHeight +30);
        make.left.offset(25);
        make.width.height.offset(50);
    }];
    
    [self.lb_nickName mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.img_Icon.mas_centerY).offset(-12.5);
        make.left.equalTo(self.img_Icon.mas_right).offset(5);
        make.width.offset(165 * WIDTHRADIU);
        make.height.offset(17);
    }];
    
    [self.authBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.img_Icon.mas_centerY).offset(9.5);
        make.left.equalTo(self.img_Icon.mas_right).offset(5);
        make.width.offset(60);
        make.height.offset(20);
    }];
    
    [self layoutIfNeeded];
    
    self.authBtn.layer.cornerRadius = 10;
    
    [self.lb_telPhone mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.authBtn.mas_centerY);
        make.left.equalTo(self.authBtn.mas_right).offset(5);
        make.height.offset(13);
    }];
    
    [self.redView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.offset(-25);
        make.centerY.equalTo(self.img_Icon);
        make.width.offset(95);
        make.height.offset(30);
    }];
    
    [self.img_coins mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.redView);
        make.left.offset(5);
    }];
    
    [self.lb_coins mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.img_coins.mas_right).offset(5);
        make.centerY.equalTo(self.redView);
    }];
    
    [self.img_arrows mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.lb_coins.mas_right).offset(5);
        make.centerY.equalTo(self.redView);
    }];
    
    [self.btn_redView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.left.bottom.right.offset(0);
    }];
    
    [self.whiteCardView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.img_Icon.mas_bottom).offset(15);
        make.left.offset(15);
        make.right.offset(-15);
        make.height.offset(70);
    }];
    
    [self.btn_left mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.bottom.offset(0);
        make.width.offset((ScreenWidth - 30)/3);
    }];
    
    [self.lb_allCoinsNumber mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.btn_left);
        make.height.offset(20);
        make.top.offset(15);
    }];
    
    [self.lb_allCoins mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.lb_allCoinsNumber);
        make.bottom.offset(-15);
        make.height.offset(14);
    }];
    
    
    
    
    
    
    
    [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.whiteCardView);
        make.left.equalTo(self.btn_left.mas_right);
        make.width.offset(0.5);
        make.height.offset(54);
    }];
    
    [self.btn_profit mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.bottom.offset(0);
        make.left.offset((ScreenWidth - 30)/3);
        make.width.offset((ScreenWidth - 30)/3);
    }];
    
    [self.lb_todayProfit mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.btn_profit);
        make.height.offset(20);
        make.top.offset(15);
    }];
    
    [self.lb_todayProfitTitle mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.lb_todayProfit);
        make.bottom.offset(-15);
        make.height.offset(14);
    }];
    
    
   
    
    [self.lineView2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(self.whiteCardView);
        make.left.equalTo(self.btn_profit.mas_right);
        make.width.offset(0.5);
        make.height.offset(54);
    }];
    
    
    [self.btn_right mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.top.bottom.offset(0);
        make.width.offset((ScreenWidth - 30)/3);
    }];
    
    [self.lb_todayCoinsNumber mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.btn_right);
        make.height.offset(20);
        make.top.offset(15);
    }];
    
    [self.lb_todayCoins mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.lb_todayCoinsNumber);
        make.bottom.offset(-15);
        make.height.offset(14);
    }];
    
    
    
    
    
    
//    [self.collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.top.equalTo(self.whiteCardView.mas_bottom).offset(20);
//        make.left.right.offset(0);
//        make.height.offset(66);
//    }];
//
//    [self.bottomView mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.bottom.left.right.offset(0);
//        make.height.offset(10);
//    }];
    
}

#pragma mark - event response
- (void)btnClick:(UIButton *)sender
{
    NSLog(@"点击赚金币按钮");
    sender.backgroundColor = [UIColor clearColor];
    if (self.delegate &&[self.delegate respondsToSelector:@selector(selectedItemButton:)]) {
        [self.delegate selectedItemButton:sender.tag];
    }
}
-(void)touchDown:(UIButton *)sender{
    sender.backgroundColor = [UIColor colorWithHex:0x000000 alpha:0.1];
}
 
//按下拖出按钮松手还原
-(void)touchUpOutside:(UIButton *)sender{
    if (sender == _authBtn) {
        BOOL accountState = [getPeopleID accountState];
        
        self.accountState = accountState;
    }else{
        sender.backgroundColor = [UIColor clearColor];
    }
   
}



- (void)authBtnClick:(UIButton *)sender
{
    NSLog(@"点击实名按钮");
    BOOL accountState = [getPeopleID accountState];
    
    self.accountState = accountState;
    if (self.delegate &&[self.delegate respondsToSelector:@selector(selectedItemButton:)]) {
        [self.delegate selectedItemButton:sender.tag];
    }
}


#pragma mark - public method
- (void)refreshData
{
    [self.img_Icon sd_setImageWithURL:[getPeopleID PeoplePhoto] placeholderImage:[UIImage imageNamed:@"my_information_headportrait_default"]];
    
    NSString *telPhone = @"";
    if ([Tools isMobileNumber:[getPeopleID PeopleIphoneNmber]]) {
        NSString * str = [getPeopleID PeopleIphoneNmber];
        telPhone = [NSString stringWithFormat:@"%@****%@",[str substringToIndex:3],[str substringFromIndex:7]];
        
    }else{
        telPhone = @"未绑定手机号";
    }
    self.lb_telPhone.text = telPhone;
    self.lb_nickName.text = [getPeopleID Peopletitle] ? [getPeopleID Peopletitle] :  @"";
    if ([getPeopleID totalCoins]) {
        NSDictionary *dic = [getPeopleID totalCoins];
        self.lb_allCoinsNumber.text = [NSString stringWithFormat:@"%@",[dic[@"totalScore"] stringValue]];
        
        NSString *currentotalProfit = [NSString stringWithFormat:@"%@",dic[@"currenttotalMoney"]];
        
        NSString *currenTodayProfit = [NSString stringWithFormat:@"%@",dic[@"currentDayProfit"]];
        if ([Tools isBlankString:currentotalProfit]) {
            self.lb_todayCoinsNumber.text = @"0";
        }else{
            self.lb_todayCoinsNumber.text = [LSLDecimalNumberTool stringWithDecimalNumber:currentotalProfit.doubleValue];
        }
        
//        if ([Tools isBlankString:currenTodayProfit]) {
//            _lb_todayProfit.text = @"0";
//        }else{
//            _lb_todayProfit.text = [LSLDecimalNumberTool stringWithDecimalNumber:currenTodayProfit.doubleValue];
//        }
        NSDictionary *params = @{@"userId":@([getPeopleID PeopleID]),
                                 @"userPhone":[getPeopleID PeopleIphoneNmber],
                                 @"os":@"iOS",
                                 @"phoneType":@"iphone"
        };
        [NetworkRequest Post12:@"https://walletservice.weface.com.cn/walletService/getAccountstatus" Params:params Success:^(id _Nonnull object) {
            NSString* state = [NSString stringWithFormat:@"%@",object[@"state"]];
            if ([state isEqualToString:@"200"]) {
                NSDictionary *result1 = object[@"result"];
                NSString *accountStatus=[NSString stringWithFormat:@"%@",result1[@"accountStatus"]];
                if (![accountStatus isEqualToString:@"0"]) {//已开户
                    NSString *url=[NSString stringWithFormat:@"https://walletndservice.weface.com.cn/granteggs/%@",[getPeopleID PeopleIphoneNmber]];
                    [NetworkRequest Get:url Params:params Success:^(id _Nonnull object) {
                        NSString* code = [NSString stringWithFormat:@"%@",object[@"code"]];
                        if ([code isEqualToString:@"200"]){
                            NSDictionary *data = object[@"data"];
                            double deposit= [data[@"deposit"] doubleValue];//本金
                            double amount=[data[@"amount"]doubleValue];//鸡蛋利息
                            double cum_amount=[data[@"cum_amount"]doubleValue];//累计总收益
                            double accumulated_amount=[data[@"accumulated_amount"]doubleValue];//总的活期收益
                            _lb_todayProfit.text=[NSString stringWithFormat:@"%.2f",deposit+amount+accumulated_amount];
                            //_lb_todayCoinsNumber.text=[NSString stringWithFormat:@"%.2f",amount+accumulated_amount];
                            _lb_todayCoinsNumber.text=[NSString stringWithFormat:@"%.2f",cum_amount];
                        }else{
                            _lb_todayProfit.text = @"0";
                        }
                    } Failure:^(id _Nonnull error) {
                        NSLog(@"error:%@",error);
                    }];
                }else{
                    _lb_todayProfit.text = @"0";
                }
            }else{
                _lb_todayProfit.text = @"0";
            }
            
        } Failure:^(id _Nonnull error) {
            NSLog(@"error:%@",error);
        }];
        
    }else{
        _lb_allCoinsNumber.text = @"0";
        _lb_todayCoinsNumber.text = @"0";
        _lb_todayProfit.text = @"0";
    }
    
    BOOL accountState = [getPeopleID accountState];
    
    self.accountState = accountState;
    
    self.redView.hidden = !self.showBtn;
    
}


#pragma mark - getters and setters
- (void)setAccountState:(BOOL)accountState {
    if (accountState) {
        [self.authBtn setBackgroundColor:K_MainColor];
        [self.authBtn setTitle:@"已实名" forState:UIControlStateNormal];
        [self.authBtn setImage:[UIImage imageNamed:@"auth_usericon"] forState:UIControlStateNormal];
        
    }else{
        [self.authBtn setBackgroundColor:[UIColor colorWithHex:0x000000 alpha:0.1]];
        [self.authBtn setTitle:@"未实名" forState:UIControlStateNormal];
        [self.authBtn setImage:[UIImage imageNamed:@""] forState:UIControlStateNormal];
    }
}

- (UIImageView *)img_Icon
{
    if (!_img_Icon) {
        _img_Icon = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 50, 50)];
        _img_Icon.backgroundColor = [UIColor whiteColor];
        _img_Icon.image = [UIImage imageNamed:@"my_information_headportrait_default"];
        _img_Icon.layer.cornerRadius = 25;
        _img_Icon.layer.masksToBounds = YES;
    }
    return _img_Icon;
}

- (UILabel *)lb_nickName
{
    if (!_lb_nickName) {
        _lb_nickName = [[UILabel alloc]init];
        _lb_nickName.text = @"";
        _lb_nickName.textColor = [UIColor colorWithHex:0x4d4d4d];
        _lb_nickName.font = [UIFont boldSystemFontOfSize:16];
    }
    return _lb_nickName;
}

- (UIButton *)authBtn {
    if (!_authBtn) {
        _authBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        //_authBtn.userInteractionEnabled = NO;
        [_authBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        _authBtn.titleLabel.font = [UIFont systemFontOfSize:10];
        _authBtn.tag = 204;
        [_authBtn addTarget:self action:@selector(authBtnClick:) forControlEvents:UIControlEventTouchUpInside];
        [_authBtn addTarget:self action:@selector(touchDown:) forControlEvents:UIControlEventTouchDown];
        [_authBtn addTarget:self action:@selector(touchUpOutside:) forControlEvents:UIControlEventTouchUpOutside];
        
        [_authBtn layoutButtonWithEdgeInsetsStyle:GLButtonEdgeInsetsStyleLeft imageTitleSpace:-1];
    }
    return _authBtn;
}


- (UILabel *)lb_telPhone
{
    if (!_lb_telPhone) {
        _lb_telPhone = [[UILabel alloc]init];
        _lb_telPhone.text = @"";
        _lb_telPhone.textColor = [UIColor colorWithHex:0x808080];
        _lb_telPhone.font = [UIFont systemFontOfSize:14];
    }
    return _lb_telPhone;
}

- (UIView *)redView
{
    if (!_redView) {
        _redView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, 95, 30)];
        _redView.backgroundColor = [UIColor colorWithHex:0xf8502c];
        _redView.layer.cornerRadius = 15;
        [_redView addSubview:self.img_coins];
        [_redView addSubview:self.lb_coins];
        [_redView addSubview:self.img_arrows];
        [_redView addSubview:self.btn_redView];
        _redView.hidden = YES;
    }
    return _redView;
}

- (UIImageView *)img_coins
{
    if (!_img_coins) {
        _img_coins = [[UIImageView alloc]init];
        _img_coins.image = [UIImage imageNamed:@"my_Earncoins_icon_normal"];
    }
    return _img_coins;
}

- (UILabel *)lb_coins
{
    if (!_lb_coins) {
        _lb_coins = [[UILabel alloc]init];
        _lb_coins.text = @"赚金币";
        _lb_coins.font = [UIFont systemFontOfSize:15];
        _lb_coins.textColor = [UIColor whiteColor];
    }
    return _lb_coins;
}

- (UIImageView *)img_arrows
{
    if (!_img_arrows) {
        _img_arrows = [[UIImageView alloc]init];
        _img_arrows.image = [UIImage imageNamed:@"my_Earncoins_arrow_normal"];
    }
    return _img_arrows;
}

- (UIButton *)btn_redView
{
    if (!_btn_redView) {
        _btn_redView = [UIButton buttonWithType:UIButtonTypeCustom];
        _btn_redView.backgroundColor = [UIColor clearColor];
        [_btn_redView addTarget:self action:@selector(touchDown:) forControlEvents:UIControlEventTouchDown];
        [_btn_redView addTarget:self action:@selector(touchUpOutside:) forControlEvents:UIControlEventTouchUpOutside];
        [_btn_redView addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
        _btn_redView.tag = 200;
    }
    return _btn_redView;
}

- (UIView *)whiteCardView
{
    if (!_whiteCardView) {
        _whiteCardView = [[UIView alloc]init];
        _whiteCardView.backgroundColor = [UIColor whiteColor];
        _whiteCardView.layer.cornerRadius = 5;
        _whiteCardView.layer.shadowColor = [UIColor colorWithHex:0xd9d9d9].CGColor;
        // 阴影偏移，默认(0, -3)
        _whiteCardView.layer.shadowOffset = CGSizeMake(0,0);
        // 阴影透明度，默认0
        _whiteCardView.layer.shadowOpacity = 0.5;
        // 阴影半径，默认3
        _whiteCardView.layer.shadowRadius = 2;
        
        
        [_whiteCardView addSubview:self.lb_allCoinsNumber];
        [_whiteCardView addSubview:self.lb_allCoins];
        
        [_whiteCardView addSubview:self.btn_left];
        
        [_whiteCardView addSubview:self.lineView];
        
        [_whiteCardView addSubview:self.lb_todayProfit];
        [_whiteCardView addSubview:self.lb_todayProfitTitle];
        
        [_whiteCardView addSubview:self.btn_profit];
        
        [_whiteCardView addSubview:self.lineView2];
        
        
        [_whiteCardView addSubview:self.lb_todayCoinsNumber];
        [_whiteCardView addSubview:self.lb_todayCoins];
        [_whiteCardView addSubview:self.btn_right];
        
        
      
    }
    return _whiteCardView;
}

- (UILabel *)lb_allCoinsNumber
{
    if (!_lb_allCoinsNumber) {
        _lb_allCoinsNumber = [[UILabel alloc]init];
        _lb_allCoinsNumber.text = @"0";
        _lb_allCoinsNumber.font = [UIFont systemFontOfSize:18 * WIDTHRADIU];
        _lb_allCoinsNumber.textColor = [UIColor colorWithHex:0x4d4d4d];
        _lb_allCoinsNumber.textAlignment = NSTextAlignmentCenter;
    }
    return _lb_allCoinsNumber;
}

- (UILabel *)lb_allCoins
{
    if (!_lb_allCoins) {
        _lb_allCoins = [[UILabel alloc]init];
        _lb_allCoins.text = @"可用金币";
        _lb_allCoins.textColor = [UIColor colorWithHex:0x808080];
        _lb_allCoins.font = [UIFont systemFontOfSize:14*WIDTHRADIU];
        _lb_allCoins.textAlignment = NSTextAlignmentCenter;
    }
    return _lb_allCoins;
}

- (UIButton *)btn_left
{
    if (!_btn_left) {
        _btn_left = [UIButton buttonWithType:UIButtonTypeCustom];
        _btn_left.backgroundColor = [UIColor clearColor];
        [_btn_left addTarget:self action:@selector(touchDown:) forControlEvents:UIControlEventTouchDown];
        [_btn_left addTarget:self action:@selector(touchUpOutside:) forControlEvents:UIControlEventTouchUpOutside];
        [_btn_left addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
        _btn_left.tag = 201;
    }
    return _btn_left;
}



- (UIView *)lineView
{
    if (!_lineView) {
        _lineView = [[UIView alloc]init];
        _lineView.backgroundColor = [UIColor colorWithHex:0xcccccc];
    }
    return _lineView;
}


- (UILabel *)lb_todayProfit
{
    if (!_lb_todayProfit) {
        _lb_todayProfit = [[UILabel alloc]init];
        _lb_todayProfit.text = @"0.0";
        _lb_todayProfit.font = [UIFont systemFontOfSize:18 * WIDTHRADIU];
        _lb_todayProfit.textColor = [UIColor colorWithHex:0x4d4d4d];
        _lb_todayProfit.textAlignment = NSTextAlignmentCenter;
    }
    return _lb_todayProfit;
}

- (UILabel *)lb_todayProfitTitle
{
    if (!_lb_todayProfitTitle) {
        _lb_todayProfitTitle = [[UILabel alloc]init];
        _lb_todayProfitTitle.text = @"养老钱包";
        _lb_todayProfitTitle.textColor = [UIColor colorWithHex:0x808080];
        _lb_todayProfitTitle.font = [UIFont systemFontOfSize:14*WIDTHRADIU];
        _lb_todayProfitTitle.textAlignment = NSTextAlignmentCenter;
    }
    return _lb_todayProfitTitle;
}

- (UIButton *)btn_profit
{
    if (!_btn_profit) {
        _btn_profit = [UIButton buttonWithType:UIButtonTypeCustom];
        _btn_profit.backgroundColor = [UIColor clearColor];
        [_btn_profit addTarget:self action:@selector(touchDown:) forControlEvents:UIControlEventTouchDown];
        [_btn_profit addTarget:self action:@selector(touchUpOutside:) forControlEvents:UIControlEventTouchUpOutside];
        [_btn_profit addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
        _btn_profit.tag = 203;
    }
    return _btn_profit;
}

- (UIView *)lineView2
{
    if (!_lineView2) {
        _lineView2 = [[UIView alloc]init];
        _lineView2.backgroundColor = [UIColor colorWithHex:0xcccccc];
    }
    return _lineView2;
}



- (UILabel *)lb_todayCoinsNumber
{
    if (!_lb_todayCoinsNumber) {
        _lb_todayCoinsNumber = [[UILabel alloc]init];
        _lb_todayCoinsNumber.text = @"0.0";
        _lb_todayCoinsNumber.font = [UIFont systemFontOfSize:18 * WIDTHRADIU];
        _lb_todayCoinsNumber.textColor = [UIColor colorWithHex:0x4d4d4d];
        _lb_todayCoinsNumber.textAlignment = NSTextAlignmentCenter;
    }
    return _lb_todayCoinsNumber;
}

- (UILabel *)lb_todayCoins
{
    if (!_lb_todayCoins) {
        _lb_todayCoins = [[UILabel alloc]init];
        _lb_todayCoins.text = @"累计收益";
        _lb_todayCoins.textColor = [UIColor colorWithHex:0x808080];
        _lb_todayCoins.font = [UIFont systemFontOfSize:14*WIDTHRADIU];
        _lb_todayCoins.textAlignment = NSTextAlignmentCenter;
    }
    return _lb_todayCoins;
}

- (UIButton *)btn_right
{
    if (!_btn_right) {
        _btn_right = [UIButton buttonWithType:UIButtonTypeCustom];
        _btn_right.backgroundColor = [UIColor clearColor];
        [_btn_right addTarget:self action:@selector(touchDown:) forControlEvents:UIControlEventTouchDown];
        [_btn_right addTarget:self action:@selector(touchUpOutside:) forControlEvents:UIControlEventTouchUpOutside];
        [_btn_right addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
        _btn_right.tag = 202;
    }
    return _btn_right;
}


- (NSArray *)arrayBtns
{
    if (!_arrayBtns) {
        _arrayBtns = @[
                       @"健康统计",@"金币抽奖",@"我的奖品",@"邀请好友"
                       ];
    }
    return _arrayBtns;
}

- (NSArray *)arrayImages
{
    if (!_arrayImages) {
        _arrayImages = @[
                       @"my_statics_normal",@"my_lottery_normal",@"my_prize_normal",@"my_invite_normal"
                       ];
    }
    return _arrayImages;
}



/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
