IVTEndLiveViewController.m 4.84 KB
//
//  IVTEndLiveViewController.m
//  IVTMeLiveTwo
//
//  Created by xrg on 16/8/22.
//  Copyright © 2016年 QLQ. All rights reserved.
//

#import "IVTEndLiveViewController.h"
#import "IVTHotAndFollowLiveVC.h"
@interface IVTEndLiveViewController ()
{
    UILabel *endLive;
    UILabel *lookNum;
    UILabel *miTang;
    UILabel *shortTips;
    UIButton *backHome;
}
@end

@implementation IVTEndLiveViewController

- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    
    self.navigationController.navigationBarHidden = YES;
}

- (void)viewWillDisappear:(BOOL)animated {
    [super viewWillDisappear:animated];
    
    self.navigationController.navigationBarHidden = NO;
}

- (void)viewDidLoad {
    [super viewDidLoad];

    [self initView];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


#pragma mark - 初始化控件
-(void)initView{
    
    __unsafe_unretained typeof (self) wself = self;
    // 半透的遮罩
    UIImageView *bgImageView = [[UIImageView alloc] initWithFrame:self.view.frame];
    bgImageView.backgroundColor = [UIColor blackColor];
    bgImageView.alpha = 0.8;
    [self.view addSubview:bgImageView];
    
    
    
    endLive = [[UILabel alloc]init];
    [self.view addSubview:endLive];
    endLive.text = @"直播结束";
    endLive.textColor = [UIColor IVTLightRedColor];
    endLive.font = [UIFont YXFontOfSize:32];
    [endLive mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(wself.view);
        make.top.equalTo(wself.view).with.offset(130);
        
    }];
    
    lookNum =  [[UILabel alloc]init];
    [self.view addSubview:lookNum];
    lookNum.text = [NSString stringWithFormat:@"%@ 人看过",self.audienceTotle];
    lookNum.textColor = [UIColor whiteColor];
    lookNum.font = [UIFont YXFontOfSize:18];
    [lookNum mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(wself.view);
        make.top.equalTo(endLive.mas_bottom).with.offset(23);
        
    }];
    //    [_lookNum setColor:[UIColor IVTLightRedColor] fromIndex:0 length:self.lookNum.text.length];
    
    
    miTang =  [[UILabel alloc]init];
    [self.view addSubview:miTang];
    miTang.text = [NSString stringWithFormat:@"收获 %@ 蜜糖",self.mitangTotle];
    miTang.textColor = [UIColor whiteColor];
    miTang.font = [UIFont YXFontOfSize:18];
    [miTang mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(wself.view);
        make.top.equalTo(lookNum.mas_bottom).with.offset(11);
        
    }];
    
    
    shortTips =  [[UILabel alloc]init];
    [self.view addSubview: shortTips];
    //     _shortTips.text = @"时长较短的直播不予保存";
    shortTips.textColor = [UIColor YXColorWithHexCode:@"#8c8c8c"];
    shortTips.font = [UIFont YXFontOfSize:18];
    [ shortTips mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(wself.view);
        make.top.equalTo(miTang.mas_bottom).with.offset(23);
    }];
    
    //  返回首页btn
    backHome = [UIButton buttonWithType:UIButtonTypeCustom];
    [backHome setBackgroundImage:[UIImage imageNamed:@"返回首页"] forState:UIControlStateNormal];
    [backHome setTitle:@"返回首页" forState:UIControlStateNormal];
    [backHome setTitleColor:[UIColor IVTLightRedColor] forState:UIControlStateNormal];
    backHome.titleLabel.font = [UIFont YXFontOfSize:17];
    [self.view addSubview:backHome];
    [backHome mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(wself.view.mas_centerX);
        make.bottom.equalTo(wself.view.mas_bottom).offset(-145);
        make.size.mas_equalTo(CGSizeMake(252, 44));
    }];
    
    [backHome addTarget:self action:@selector(backClickFunc:) forControlEvents:UIControlEventTouchUpInside];
    
    
    UILabel *label =  [[UILabel alloc]init];
    [self.view addSubview:label];
    label.text = @"未抢的红包,将在24小时后退还";
    label.textColor = [UIColor whiteColor];
    label.font = [UIFont YXFontOfSize:18];
//    label.backgroundColor = [UIColor greenColor];
    [label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(wself.view.mas_bottom).offset(-105);
        make.centerX.equalTo(wself.view.mas_centerX);
    }];
}


//返回首页
-(void)backClickFunc:(UIButton *)button
{
    [self dismissViewControllerAnimated:YES completion:^{
    
    }];
    
    [self.navigationController popToRootViewControllerAnimated:YES];
}
/*
#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