// // YOUPAILZSignWindow.m // VQU // // Created by CY on 2021/9/9. // Copyright © 2021 MS. All rights reserved. // #import "YOUPAILZSignWindow.h" @interface YOUPAILZSignWindow () @end @implementation YOUPAILZSignWindow - (void)viewDidLoad { [super viewDidLoad]; self.baseView.hidden = YES; [self youpaifinitUI]; } - (void)youpaifinitUI{ UIView *bgV = [[UIView alloc] init]; bgV.backgroundColor = [UIColor blackColor]; bgV.layer.cornerRadius = 2.5f; bgV.clipsToBounds = YES; bgV.layer.borderColor = HexColorFromRGB(0x00DCFF).CGColor; bgV.layer.borderWidth = 1.0f; [self.view addSubview:bgV]; [bgV mas_makeConstraints:^(MASConstraintMaker *make) { make.center.equalTo(self.view); make.size.mas_offset(CGSizeMake(ScaleSize(280.0f), ScaleSize(330.0f))); }]; UIImageView *successTopImgV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"vqu_images_H_home_sign_success"]]; [self.view addSubview:successTopImgV]; [successTopImgV mas_makeConstraints:^(MASConstraintMaker *make) { make.top.equalTo(bgV.mas_top).offset(-ScaleSize(10.5f)); make.centerX.equalTo(bgV); make.size.mas_offset(CGSizeMake(ScaleSize(216.0f), ScaleSize(39.0f))); }]; UILabel *timerL = [[UILabel alloc] init]; timerL.font = LCFont(ScaleSize(12.0f)); timerL.textColor = HexColorFromRGB(0xC3C3C3); timerL.textAlignment = NSTextAlignmentCenter; timerL.backgroundColor = [HexColorFromRGB(0x00A6C0) colorWithAlphaComponent:0.22f]; timerL.layer.cornerRadius = ScaleSize(10.0f); timerL.clipsToBounds = YES; timerL.text = self.youpaipmsg; [bgV addSubview:timerL]; [timerL mas_makeConstraints:^(MASConstraintMaker *make) { make.centerX.equalTo(bgV); make.top.equalTo(successTopImgV.mas_bottom).offset(ScaleSize(8.5f)); make.size.mas_offset(CGSizeMake(ScaleSize(181.0f), ScaleSize(20.0f))); }]; UIImageView *successImgV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"vqu_images_H_home_sign_success_center"]]; [self.view addSubview:successImgV]; [successImgV mas_makeConstraints:^(MASConstraintMaker *make) { make.top.equalTo(timerL.mas_bottom).offset(ScaleSize(18.0f)); make.centerX.equalTo(bgV); make.size.mas_offset(CGSizeMake(ScaleSize(124.0f), ScaleSize(124.0f))); }]; UILabel *countL = [[UILabel alloc] init]; countL.font = LCFont(ScaleSize(12.0f)); countL.textColor = HexColorFromRGB(0xffffff); countL.textAlignment = NSTextAlignmentCenter; countL.backgroundColor = [UIColor colorWithPatternImage:[LCTools ColorImage:CGSizeMake(ScaleSize(115.0f), ScaleSize(20.0f)) FromColors:@[HexColorFromRGB(0x01B676),HexColorFromRGB(0x039872)] ByGradientType:GradientLeftToRight]]; countL.layer.cornerRadius = ScaleSize(10.0f); countL.clipsToBounds = YES; countL.text = self.youpaipbeans; [bgV addSubview:countL]; [countL mas_makeConstraints:^(MASConstraintMaker *make) { make.centerX.equalTo(bgV); make.top.equalTo(successImgV.mas_bottom).offset(ScaleSize(16.0f)); make.size.mas_offset(CGSizeMake(ScaleSize(115.0f), ScaleSize(20.0f))); }]; UIButton *goSignBtn = [UIButton buttonWithType:UIButtonTypeCustom]; [goSignBtn setBackgroundImage:[UIImage imageNamed:@"vqu_images_H_home_go_sign_page"] forState:UIControlStateNormal]; [goSignBtn setBackgroundImage:[UIImage imageNamed:@"vqu_images_H_home_go_sign_page"] forState:UIControlStateHighlighted]; [goSignBtn addTarget:self action:@selector(youpaifgoSignBtnClick) forControlEvents:UIControlEventTouchUpInside]; [bgV addSubview:goSignBtn]; [goSignBtn mas_makeConstraints:^(MASConstraintMaker *make) { make.centerX.equalTo(bgV); make.top.equalTo(countL.mas_bottom).offset(ScaleSize(24.0f)); make.size.mas_offset(CGSizeMake(ScaleSize(212.0f), ScaleSize(45.5f))); }]; UIButton *closeBtn = [UIButton buttonWithType:UIButtonTypeCustom]; [closeBtn setBackgroundImage:[UIImage imageNamed:@"vqu_images_H_home_sign_close"] forState:UIControlStateNormal]; [closeBtn setBackgroundImage:[UIImage imageNamed:@"vqu_images_H_home_sign_close"] forState:UIControlStateHighlighted]; [closeBtn addTarget:self action:@selector(youpaifcloseBtnClick) forControlEvents:UIControlEventTouchUpInside]; [self.view addSubview:closeBtn]; [closeBtn mas_makeConstraints:^(MASConstraintMaker *make) { make.centerX.equalTo(bgV); make.top.equalTo(bgV.mas_bottom).offset(ScaleSize(24.0f)); make.size.mas_offset(CGSizeMake(ScaleSize(29), ScaleSize(29))); }]; } - (void)youpaifgoSignBtnClick{ [self dismissViewControllerAnimated:YES completion:^{ if (self.goSignBlock != nil) { self.goSignBlock(self.youpaiplink); } }]; } - (void)youpaifcloseBtnClick{ [self dismissViewControllerAnimated:YES completion:^{}]; } @end