// // YOUPAILZExposureWindow.m // MSYOUPAI // // Created by CY on 2022/3/14. // Copyright © 2022 MS. All rights reserved. // #import "YOUPAILZExposureWindow.h" @interface YOUPAILZExposureWindow () @end @implementation YOUPAILZExposureWindow - (void)viewDidLoad { [super viewDidLoad]; self.baseView.hidden = YES; [self youpaifinitUI]; } - (void)youpaifinitUI{ // window.youpaipvip = [LCSaveModel getUserModel].youpaipuserinfo.youpaipvip; UIImageView *bgImgV = [[UIImageView alloc] init]; bgImgV.image = [UIImage imageNamed:@"vqu_images_home_super_exposure_bg"]; bgImgV.userInteractionEnabled = YES; [self.view addSubview:bgImgV]; [bgImgV mas_makeConstraints:^(MASConstraintMaker *make) { make.center.equalTo(self.view); make.size.mas_offset(CGSizeMake(323.0f, 288.5f)); }]; UIImageView *headerImgV = [[UIImageView alloc] init]; headerImgV.image = [UIImage imageNamed:@"vqu_images_home_super_exposure_header"]; [self.view addSubview:headerImgV]; [headerImgV mas_makeConstraints:^(MASConstraintMaker *make) { make.centerX.equalTo(self.view); make.bottom.equalTo(bgImgV.mas_bottom).offset(-161.5f); make.size.mas_offset(CGSizeMake(349.5f, 205.0f)); }]; UILabel *titleL = [[UILabel alloc] init]; titleL.font = LCBoldFont(20.0f); [bgImgV addSubview:titleL]; [titleL mas_makeConstraints:^(MASConstraintMaker *make) { make.bottom.equalTo(bgImgV.mas_bottom).offset(-149.0f); make.centerX.equalTo(bgImgV); }]; UILabel *detailL = [[UILabel alloc] init]; detailL.font = LCFont14; [bgImgV addSubview:detailL]; [detailL mas_makeConstraints:^(MASConstraintMaker *make) { make.top.equalTo(titleL.mas_bottom).offset(10.0f); make.centerX.equalTo(bgImgV); }]; UIButton *confirmBtn = [UIButton buttonWithType:UIButtonTypeCustom]; [confirmBtn addTarget:self action:@selector(youpaifconfirmBtnClick) forControlEvents:UIControlEventTouchUpInside]; // [confirmBtn setTitle:self.youpaipbtnTitle forState:0]; [confirmBtn setTitleColor:HexColorFromRGB(0xA24800) forState:UIControlStateNormal]; [confirmBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateSelected]; confirmBtn.titleLabel.font = LCFont(18); [confirmBtn setBackgroundImage:[LCTools ColorImage:CGSizeMake(240.0f, 48.0f) FromColors:@[LZFFD099Color,LZFE9B4BColor] ByGradientType:GradientTopToBottom] forState:UIControlStateNormal]; confirmBtn.layer.cornerRadius = 24.0f; confirmBtn.clipsToBounds = YES; // confirmBtn.userInteractionEnabled = NO; confirmBtn.layer.borderColor = HexColorFromRGB(0xFEB257).CGColor; confirmBtn.layer.borderWidth = 1.5f; [bgImgV addSubview:confirmBtn]; [confirmBtn mas_makeConstraints:^(MASConstraintMaker *make) { make.centerX.equalTo(bgImgV); make.width.offset(240.0f); make.bottom.offset(-29.0f); make.height.offset(48.0f); }]; if ([LCSaveModel getUserModel].youpaipuserinfo.youpaipvip == 0) { // 未开通会员 titleL.text = @"超级曝光"; titleL.textColor = LZ273145Color; detailL.attributedText = [LCTools setRichTextWithTitle:@"开通贵族后,被“搭讪”的几率提升" subTitle:@"3倍" titleColor:LZ273145Color subTitleColor:LZFF5C4DColor titleFontSize:14.0f subTitleFontSize:14.0f]; [confirmBtn setTitle:@"立即开通贵族" forState:UIControlStateNormal]; }else{ titleL.text = @"3倍曝光"; titleL.textColor = HexColorFromRGB(0xA24800); detailL.attributedText = [LCTools setRichTextWithTitle:@"超级曝光已开启,被“搭讪”的几率提升" subTitle:@"3倍" titleColor:LZ273145Color subTitleColor:LZFF5C4DColor titleFontSize:14.0f subTitleFontSize:14.0f]; [confirmBtn setTitle:@"知道了" forState:UIControlStateNormal]; } UIButton *closeBtn = [UIButton buttonWithType:UIButtonTypeCustom]; [closeBtn setImage:[UIImage imageNamed:@"vqu_images_home_super_exposure_close"] forState:UIControlStateNormal]; [closeBtn addTarget:self action:@selector(youpaifcloseBtnClick) forControlEvents:UIControlEventTouchUpInside]; [self.view addSubview:closeBtn]; [closeBtn mas_makeConstraints:^(MASConstraintMaker *make) { make.top.equalTo(bgImgV.mas_bottom).offset(0); make.centerX.equalTo(bgImgV); make.size.mas_offset(CGSizeMake(34.0f, 34.0f)); }]; } - (void)youpaifconfirmBtnClick{ [self dismissViewControllerAnimated:YES completion:^{ if ([LCSaveModel getUserModel].youpaipuserinfo.youpaipvip == 0 && self.goVipPageBlock != nil) { // 未开通会员 self.goVipPageBlock(); } }]; } - (void)youpaifcloseBtnClick{ [self dismissViewControllerAnimated:YES completion:nil]; } @end