123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243 |
- //
- // YOUPAILPYoungSettingVC.m
- // livePro
- //
- // Created by leo on 2019/12/25.
- // Copyright © 2019 caiPro. All rights reserved.
- //
- #import "YOUPAILPYoungSettingVC.h"
- #import "YOUPAILPYoungPwdVC.h"
- #import "YOUPAILPYoungCloseWindow.h"
- #import "UIViewController+TFPresent.h"
- #import "YOUPAILCTabBarVC.h"
- #import "AppDelegate.h"
- @interface YOUPAILPYoungSettingVC ()<LPYoungPwdDelegate,LPYoungCloseDelegate>
- //@property(nonatomic,assign)CGFloat lefpadding,imgVHeight,imgVWidth;
- //@property(nonatomic,strong)UIImageView *imgV;
- @property(nonatomic,strong)UIButton *youpaipopenBtn;
- //@property(nonatomic,strong)UILabel *titleLab,*noticeLab;
- @end
- @implementation YOUPAILPYoungSettingVC
- -(void)viewWillAppear:(BOOL)animated
- {
- [super viewWillAppear:animated];
-
- }
- - (void)viewDidLoad {
- [super viewDidLoad];
- self.title = @"青少年模式";
- self.view.backgroundColor = [UIColor whiteColor];
-
- // UIView *whiteView = [[UIView alloc] initWithFrame:CGRectMake(35.5,80.5+NavBarHeight,KScreenWidth-71, (KScreenWidth-71)*(172/304.0)+248)];
- // [self.view addSubview:whiteView];
- // whiteView.backgroundColor = UIColor.whiteColor;
- // whiteView.layer.cornerRadius = 10;
- // whiteView.layer.masksToBounds = NO;
- // UIBezierPath *shadowPath = [UIBezierPath
- // bezierPathWithRect:whiteView.bounds];
- // whiteView.layer.shadowColor = HexColorFromRGB(0xA7A9FD).CGColor;
- // whiteView.layer.shadowOffset = CGSizeMake(0.0f, 5.0f);
- // whiteView.layer.shadowOpacity = 0.22f;
- // whiteView.layer.shadowPath = shadowPath.CGPath;
- //
- //
- // UIView *view = [[UIView alloc] initWithFrame:CGRectMake(31,0,KScreenWidth-71-64, (KScreenWidth-71)*(172/304.0)+248-31)];
- // view.backgroundColor = HexColorFromRGB(0xE9E9FF);
- // view.layer.cornerRadius = 8;
- // view.layer.masksToBounds = YES;
- // [whiteView addSubview:view];
- UIImageView *imgView = [[UIImageView alloc] init];
- [self.view addSubview:imgView];
- [imgView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.mas_equalTo(85 + NavBarHeight);
- make.centerX.mas_equalTo(0);
- make.size.mas_equalTo(CGSizeMake(169, 168));
- }];
- imgView.image = [UIImage imageNamed:@"vqu_images_young_Mode_Bg"];
-
- UILabel *label1 = [[UILabel alloc] init];
- [self.view addSubview:label1];
- [label1 mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.mas_equalTo(imgView.mas_bottom).offset(24);
- make.centerX.mas_equalTo(0);
- }];
- label1.text = @"青少年保护模式";
- label1.textColor = LZ273145Color;
- label1.textAlignment = NSTextAlignmentCenter;
- label1.font = LCBoldFont(18);
-
-
-
- UILabel *label2 = [[UILabel alloc] init];
- [self.view addSubview:label2];
- [label2 mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.mas_equalTo(label1.mas_bottom).offset(2);
- make.centerX.mas_equalTo(0);
- }];
- label2.text = @"开启未成年模式,防止未成年使用";
- label2.textColor = LZA3AABEColor;
- label2.textAlignment = NSTextAlignmentCenter;
- label2.numberOfLines = 0;
- label2.font = LCFont(14);
-
-
-
-
-
-
-
- // _imgVWidth = 251.5;
- // _imgVHeight = 156.5;
- // _lefpadding = (KScreenWidth-_imgVWidth)/2.0;
- //
- // [self.view addSubview:self.imgV];
- // [self.view addSubview:self.titleLab];
- // [self.view addSubview:self.noticeLab];
- [self.view addSubview:self.youpaipopenBtn];
- // [_titleLab setText:@"未成年模式已关闭"];
- // [_noticeLab setText:@"开启未成年模式,防止未成年使用"];
- [_youpaipopenBtn setTitle:@"开启青少年模式" forState:UIControlStateNormal];
- //
- // [_titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
- // make.left.equalTo(self.view).with.offset(0);
- // make.right.equalTo(self.view).with.offset(0);
- // make.top.equalTo(_imgV.mas_bottom).with.offset(40);
- // make.height.mas_equalTo(20);
- //
- // }];
- // [_noticeLab mas_makeConstraints:^(MASConstraintMaker *make) {
- // make.left.equalTo(self.view).with.offset(0);
- // make.right.equalTo(self.view).with.offset(0);
- // make.top.equalTo(_titleLab.mas_bottom).with.offset(20);
- // make.height.mas_equalTo(25);
- // }];
- //
- [_youpaipopenBtn mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.equalTo(self.view).with.offset(40);
- make.right.equalTo(self.view).with.offset(-40);
- make.bottom.offset(-SafeHeight - 30);
- make.height.mas_equalTo(49);
- }];
- [_youpaipopenBtn setBackgroundImage:[LCTools ColorImage:CGSizeMake(KScreenWidth - 80, 49) FromColors:@[LZBFB6FFColor,LZ7C69FEColor] ByGradientType:(GradientLeftToRight)] forState:(UIControlStateNormal)];
- }
- //
- //-(UIImageView *)imgV
- //{
- // if(!_imgV)
- // {
- // _imgV = [[UIImageView alloc]initWithFrame:CGRectMake(_lefpadding, NavBarHeight+60, _imgVWidth, _imgVHeight)];
- // [_imgV setImage:[UIImage imageNamed:@"vqu_images_juvenile_2"]];
- // }
- // return _imgV;
- //}
- //-(UILabel *)titleLab
- //{
- // if(!_titleLab)
- // {
- // _titleLab = [[UILabel alloc]init];
- // [_titleLab setTextColor:HexColorFromRGB(0x666666)];
- // [_titleLab setFont:[UIFont systemFontOfSize:18]];
- // [_titleLab setTextAlignment:NSTextAlignmentCenter];
- // }
- // return _titleLab;
- //}
- //-(UILabel *)noticeLab
- //{
- // if(!_noticeLab)
- // {
- // _noticeLab = [[UILabel alloc]init];
- // [_noticeLab setTextColor:HexColorFromRGB(0x666666)];
- // [_noticeLab setFont:[UIFont systemFontOfSize:14]];
- // [_noticeLab setTextAlignment:NSTextAlignmentCenter];
- // }
- // return _noticeLab;
- //}
- //
- -(UIButton *)youpaipopenBtn
- {
- if(!_youpaipopenBtn)
- {
- _youpaipopenBtn = [[UIButton alloc]init];
- [_youpaipopenBtn.titleLabel setFont:[UIFont systemFontOfSize:16]];
- _youpaipopenBtn.layer.cornerRadius = 49/2;
- _youpaipopenBtn.layer.masksToBounds = YES;
- [_youpaipopenBtn addTarget:self action:@selector(youpaifopenYound) forControlEvents:UIControlEventTouchUpInside];
- [_youpaipopenBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
- }
- return _youpaipopenBtn;
- }
- -(void)youpaifopenYound
- {
- YOUPAILPYoungPwdVC *vc = [[YOUPAILPYoungPwdVC alloc]init];
- vc.youpaippwdStatus = TFPWDSETTING;
- vc.youpaipdelegate = self;
- [self.navigationController pushViewController:vc animated:YES];
- }
- -(void)youpaifswitchYounModel:(NSInteger)isopen
- {
- // NSLog(@"hello isopen is %d",isopen);
- if(isopen ==1)
- {
- //
- [LCSaveData saveYoungMode:YES];
- kAppDelegate.kadolescentStatus =1;
- dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)1*NSEC_PER_SEC), dispatch_get_main_queue(), ^{
- YOUPAILCTabBarVC *tab = (YOUPAILCTabBarVC *)kAppDelegate.window.rootViewController;
- [tab setSelectedIndex:0];
- });
-
-
- }
- else
- {
- [LCSaveData saveYoungMode:NO];
- kAppDelegate.kadolescentStatus = 0;
- }
- }
- -(void)youpaifshowYoungCloseWindow
- {
- YOUPAILPYoungCloseWindow *VC= [[YOUPAILPYoungCloseWindow alloc]init];
- VC.vWidth = KScreenWidth - 47.5f * 2.0f;
- VC.vHeight = 342.0f;
- VC.youpaipdelegate = self;
- VC.isTouchDismiss = NO;
- [kAppDelegate.window.rootViewController TFPresentVC:VC completion:^{
- }];
- }
- #pragma mark LPYoungCloseDelegate
- //忘记密码
- -(void)youpaifyoungForgetPwd
- {
- //关闭或打开 发通知 或者回调
- /*
- YOUPAILPYoungPwdVC *vc = [[YOUPAILPYoungPwdVC alloc]init];
- vc.pwdStatus = TFPWDCLOSE;
- [self.navigationController pushViewController:vc animated:YES];
- */
- }
- -(void)youpaifyoungClose
- {
- YOUPAILPYoungPwdVC *vc = [[YOUPAILPYoungPwdVC alloc]init];
- vc.youpaippwdStatus = TFPWDCLOSE;
- vc.youpaipdelegate = self;
- [self.navigationController pushViewController:vc animated: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
|