// // YOUPAILPYoungCloseWindow.m // livePro // // Created by leo on 2019/12/26. // Copyright © 2019 caiPro. All rights reserved. // #import "YOUPAILPYoungCloseWindow.h" #import "YOUPAILPYoungPwdVC.h" #import "NSString+YYAdd.h" @interface YOUPAILPYoungCloseWindow () @property(nonatomic,assign)CGFloat youpaiplefpadding,youpaipimgVHeight,youpaipimgVWidth,youpaiptitleHeight; @property(nonatomic,strong)UIImageView *youpaipimgV; @property(nonatomic,strong)UIButton *youpaipcloseBtn; @property(nonatomic,strong)UILabel *youpaiptitleLab; @end @implementation YOUPAILPYoungCloseWindow - (void)viewDidLoad { [super viewDidLoad]; [self.baseView addSubview:self.youpaipimgV]; [self.baseView addSubview:self.youpaiptitleLab]; [self.baseView addSubview:self.youpaipcloseBtn]; NSString *titleStr = @"你已开启未成年模式\n所有功能关闭"; [_youpaiptitleLab setText:titleStr]; CGSize titleSize = [titleStr sizeForFont:LCBoldFont(16) size:CGSizeMake(self.vWidth, 200) mode:NSLineBreakByWordWrapping]; _youpaiptitleHeight = titleSize.height; [_youpaipcloseBtn setTitle:@"关闭未成年模式" forState:UIControlStateNormal]; [_youpaiptitleLab mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.baseView).with.offset(25); make.right.equalTo(self.baseView).with.offset(-25); make.top.equalTo(_youpaipimgV.mas_bottom).with.offset(24); make.height.mas_equalTo(_youpaiptitleHeight); }]; [_youpaipcloseBtn mas_makeConstraints:^(MASConstraintMaker *make) { make.centerX.equalTo(self.baseView); make.top.equalTo(_youpaiptitleLab.mas_bottom).with.offset(20); make.size.mas_equalTo(CGSizeMake(240.0f, 48)); }]; UIButton *youpaipForgetPasswordBtn = [UIButton buttonWithType:UIButtonTypeCustom]; [youpaipForgetPasswordBtn setImage:[UIImage imageNamed:@"vqu_images_home_tv_desc_n"] forState:UIControlStateNormal]; [youpaipForgetPasswordBtn setTitle:@"忘记密码" forState:UIControlStateNormal]; [youpaipForgetPasswordBtn setTitleColor:LZA3AABEColor forState:UIControlStateNormal]; youpaipForgetPasswordBtn.titleLabel.font = LCFont(13.0f); [youpaipForgetPasswordBtn addTarget:self action:@selector(youpaifforgetPWD) forControlEvents:UIControlEventTouchUpInside]; [youpaipForgetPasswordBtn setSemanticContentAttribute:UISemanticContentAttributeForceRightToLeft]; [self.baseView addSubview:youpaipForgetPasswordBtn]; [youpaipForgetPasswordBtn mas_makeConstraints:^(MASConstraintMaker *make) { make.centerX.equalTo(self.baseView); make.top.equalTo(_youpaipcloseBtn.mas_bottom).offset(16); make.size.mas_offset(CGSizeMake(70.0f, 18.0f)); }]; } -(UIImageView *)youpaipimgV { if(!_youpaipimgV) { _youpaipimgV = [[UIImageView alloc]initWithFrame:CGRectMake((self.vWidth-135)/2, 20, 135, 135)]; [_youpaipimgV setImage:[UIImage imageNamed:@"vqu_images_juvenile_2"]]; } return _youpaipimgV; } -(UILabel *)youpaiptitleLab { if(!_youpaiptitleLab) { _youpaiptitleLab = [[UILabel alloc]init]; [_youpaiptitleLab setTextColor:LZ273145Color]; [_youpaiptitleLab setFont:LCBoldFont(16)]; _youpaiptitleLab.numberOfLines = 0; _youpaiptitleLab.lineBreakMode = NSLineBreakByWordWrapping; [_youpaiptitleLab setTextAlignment:NSTextAlignmentCenter]; } return _youpaiptitleLab; } -(UIButton *)youpaipcloseBtn { if(!_youpaipcloseBtn) { _youpaipcloseBtn = [[UIButton alloc]init]; [_youpaipcloseBtn.titleLabel setFont:LCFont16]; _youpaipcloseBtn.layer.cornerRadius = 24; _youpaipcloseBtn.layer.borderColor = LZ7C69FEColor.CGColor; _youpaipcloseBtn.layer.borderWidth = 1.0f; [_youpaipcloseBtn addTarget:self action:@selector(youpaifcancelWindow) forControlEvents:UIControlEventTouchUpInside]; [_youpaipcloseBtn setBackgroundColor:[UIColor whiteColor]]; [_youpaipcloseBtn setTitleColor:LZ7C69FEColor forState:UIControlStateNormal]; } return _youpaipcloseBtn; } -(void)youpaifforgetPWD { [self dismissViewControllerAnimated:YES completion:^{ if ([self.youpaipdelegate respondsToSelector:@selector(youpaifyoungForgetPwd)]) { [self.youpaipdelegate youpaifyoungForgetPwd]; } }]; } -(void)youpaifcancelWindow{ [self dismissViewControllerAnimated:YES completion:^{ if ([self.youpaipdelegate respondsToSelector:@selector(youpaifyoungClose)]) { [self.youpaipdelegate youpaifyoungClose]; } }]; } @end