//
//  JoinPartGuideViewController.m
//  Open
//
//  Created by 雷俊博 on 2020/4/30.
//  Copyright © 2020 黄江涛 . All rights reserved.
//

#import "JoinPartGuideViewController.h"
#import "JoinPartGuide2ViewController.h"

@interface JoinPartGuideViewController ()

@property (nonatomic, strong)UIScrollView* scrollView;

@property (nonatomic, strong)UIButton* bottomButton;

@end

@implementation JoinPartGuideViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
    [self.view addSubview:self.scrollView];
    
    UIView*view = [[UIView alloc]initWithFrame:CGRectMake(0, ScreenHeight - 45, ScreenWidth, 45)];
    [view addSubview:self.bottomButton];
    [self.view addSubview:view];
}
- (void)btnClick:(UIButton *)sender {
    
    JoinPartGuide2ViewController *vc = [JoinPartGuide2ViewController new];
    vc.title = @"加入合伙人";
    [self.navigationController pushViewController:vc animated:YES];
    
}

- (CGFloat)getContentHeight
{
    UIImage* image = [UIImage imageNamed:@"partnerBg1"];
    CGFloat height = image.size.height * WIDTHRADIU;
    
    return height;
}

#pragma mark - getters and setters
- (UIScrollView *)scrollView
{
    if (!_scrollView) {
         _scrollView = [[UIScrollView alloc]initWithFrame:CGRectMake(0, cl_kNavigationBarHeight, ScreenWidth, ScreenHeight - cl_kNavigationBarHeight - 45)];
         _scrollView.backgroundColor = [UIColor whiteColor];
        
        
         _scrollView.contentSize = CGSizeMake(ScreenWidth, [self getContentHeight]);
               
         _scrollView.showsHorizontalScrollIndicator = NO;
        _scrollView.showsVerticalScrollIndicator = NO;
        
        UIImageView*imageView = [[UIImageView alloc]init];
        imageView.frame = CGRectMake(0, 0, ScreenWidth, [self getContentHeight]);
        imageView.image = [UIImage imageNamed:@"partnerBg1"];
        
        [_scrollView addSubview:imageView];
        
        
    }
    return _scrollView;
}

- (UIButton *)bottomButton
{
    if (!_bottomButton) {
        _bottomButton = [UIButton buttonWithType:UIButtonTypeCustom];
        _bottomButton.frame = CGRectMake(0, 0, ScreenWidth, 45);
        _bottomButton.backgroundColor = [UIColor colorWithHex:0x1C7DE8];
        _bottomButton.titleLabel.font = [UIFont systemFontOfSize:15];
        _bottomButton.titleLabel.hidden = NO;
        [_bottomButton setTitle:@"下一步" forState:UIControlStateNormal];
        //[_bottomButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        [_bottomButton addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
    }
    return _bottomButton;
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
