// // YOUPAIZYFirstRechargeWindow.m // VQU // // Created by 肖浩然的mac on 2021/9/9. // Copyright © 2021 MS. All rights reserved. // #import "YOUPAIZYFirstRechargeWindow.h" @interface YOUPAIZYFirstRechargeWindow () @end @implementation YOUPAIZYFirstRechargeWindow - (void)viewDidLoad { [super viewDidLoad]; // [self.view setFrame:CGRectMake(0, 0, _vWith, _vHeight)]; // CAShapeLayer *maskLayer = [CAShapeLayer layer]; // UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:self.view.bounds cornerRadius:25]; // maskLayer.path = path.CGPath; // self.view.layer.mask = maskLayer; // [self.view setBackgroundColor:[UIColor whiteColor]]; self.baseView.backgroundColor = [UIColor clearColor]; _youpaipimgV = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, self.vWidth,self.vHeight)]; _youpaipimgV.layer.cornerRadius = 25; _youpaipimgV.contentMode = UIViewContentModeScaleAspectFill; _youpaipimgV.layer.masksToBounds = YES; [_youpaipimgV sd_setImageWithURL:[LCTools getImageUrlWithAddress:_youpaipimageurl]]; [self.baseView addSubview:self.youpaipimgV]; _youpaipimgV.userInteractionEnabled = YES; UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(youpaifclickImgAction)]; [_youpaipimgV addGestureRecognizer:tap]; UIImageView *closeImage = [UIImageView new]; [_youpaipimgV addSubview:closeImage]; [closeImage mas_makeConstraints:^(MASConstraintMaker *make) { make.right.mas_equalTo(-10); make.top.mas_equalTo(5); make.size.mas_equalTo(CGSizeMake(32, 32)); }]; closeImage.image = [UIImage imageNamed:@"vqu_images_H_home_re_close"]; closeImage.userInteractionEnabled = YES; UITapGestureRecognizer *tap1 = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(youpaifcloseImageClick)]; [closeImage addGestureRecognizer:tap1]; self.closeImage = closeImage; // //title // UIView *titleBgView = [UIView new]; // [_imgV addSubview:titleBgView]; // [titleBgView mas_makeConstraints:^(MASConstraintMaker *make) { // make.top.mas_equalTo(37); // make.centerX.mas_equalTo(0); // make.left.mas_equalTo(49.5); // make.width.mas_equalTo(self.vWidth-99); // make.height.mas_equalTo(20); // }]; // titleBgView.backgroundColor = HexColorFromRGB(0x00A6C0); // titleBgView.layer.cornerRadius = 10; // titleBgView.layer.masksToBounds = YES; // // UILabel *titleLabel = [UILabel new]; // [titleBgView addSubview:titleLabel]; // [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { // make.center.mas_equalTo(0); // }]; // titleLabel.font = [UIFont systemFontOfSize:12]; // titleLabel.textColor = HexColorFromRGB(0xC3C3C3); // titleLabel.text = @"这个月你已经打卡8天!"; // //领糖豆 // UIImageView *contentBgView = [UIImageView new]; // [_imgV addSubview:contentBgView]; // [contentBgView mas_makeConstraints:^(MASConstraintMaker *make) { // make.top.mas_equalTo(titleLabel.mas_bottom).offset(158); // make.centerX.mas_equalTo(0); // make.width.mas_equalTo(ScaleSize(115)); // make.height.mas_equalTo(20); // }]; // // // [contentBgView setImage:[LCTools ColorImage:CGSizeMake(ScaleSize(115), 20) FromColors:@[HexColorFromRGB(0x01B676),HexColorFromRGB(0x039872)] ByGradientType:1]]; // contentBgView.layer.cornerRadius = 10; // contentBgView.layer.masksToBounds = YES; // // UILabel *contentLabel = [UILabel new]; // [contentBgView addSubview:contentLabel]; // [contentLabel mas_makeConstraints:^(MASConstraintMaker *make) { // make.center.mas_equalTo(0); // }]; // contentLabel.font = [UIFont systemFontOfSize:12]; // contentLabel.textColor = HexColorFromRGB(0xffffff); // contentLabel.text = @"+20萌豆"; } -(void)youpaifcloseImageClick{ [self dismissViewControllerAnimated:YES completion:nil]; } -(void)youpaifclickImgAction { [self.youpaipdelegate youpaifLZFirstRechargeClickAdverImage:self.youpaiplink_type andUrl:self.youpaiplink_url]; [self dismissViewControllerAnimated:YES completion:nil]; } @end