// // YOUPAILZInfoImperfectView.m // MSYOUPAI // // Created by CY on 2022/3/9. // Copyright © 2022 MS. All rights reserved. // #import "YOUPAILZInfoImperfectView.h" @implementation YOUPAILZInfoImperfectView - (instancetype)initWithFrame:(CGRect)frame{ if (self = [super initWithFrame:frame]) { [self youpaifinitUI]; } return self; } - (void)youpaifinitUI{ self.layer.cornerRadius = 8.0f; self.clipsToBounds = YES; self.backgroundColor = HexColorFromRGB(0xF3F1FF); UIButton *closeBtn = [UIButton buttonWithType:UIButtonTypeCustom]; [closeBtn setImage:[UIImage imageNamed:@"vqu_images_L_info_close1"] forState:UIControlStateNormal]; [closeBtn addTarget:self action:@selector(closeBtnClick) forControlEvents:UIControlEventTouchUpInside]; [self addSubview:closeBtn]; [closeBtn mas_makeConstraints:^(MASConstraintMaker *make) { make.right.offset(-8.0f); make.centerY.equalTo(self); make.size.mas_offset(CGSizeMake(20.0f, 20.0f)); }]; UIButton *goEditBtn = [UIButton buttonWithType:UIButtonTypeCustom]; [goEditBtn setTitle:@"前往" forState:UIControlStateNormal]; [goEditBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; goEditBtn.titleLabel.font = LCFont12; goEditBtn.layer.cornerRadius = 12.0f; goEditBtn.clipsToBounds = YES; [goEditBtn setBackgroundImage:[LCTools ColorImage:CGSizeMake(48.0f, 24.0f) FromColors:@[LZBFB6FFColor,LZ7C69FEColor] ByGradientType:GradientLeftToRight] forState:UIControlStateNormal]; [goEditBtn addTarget:self action:@selector(goEditBtnClick) forControlEvents:UIControlEventTouchUpInside]; [self addSubview:goEditBtn]; [goEditBtn mas_makeConstraints:^(MASConstraintMaker *make) { make.right.equalTo(closeBtn.mas_left).offset(0.0f); make.centerY.equalTo(self); make.size.mas_offset(CGSizeMake(48.0f, 24.0f)); }]; UILabel *textL = [[UILabel alloc] init]; textL.textColor = LZ273145Color; textL.font = LCFont12; [self addSubview:textL]; NSMutableAttributedString *str = [[NSMutableAttributedString alloc]initWithString:@"完善资料送钻石,你有钻石待领取"]; [str addAttribute:NSForegroundColorAttributeName value:LZ7C69FEColor range:NSMakeRange(4, 3)]; [str addAttribute:NSForegroundColorAttributeName value:LZ7C69FEColor range:NSMakeRange(10, 2)]; textL.attributedText = str; [textL mas_makeConstraints:^(MASConstraintMaker *make) { make.left.offset(12.0f); make.top.bottom.offset(0.0f); }]; } - (void)goEditBtnClick{ if (self.goEditUserInfoPageBlock != nil) { self.goEditUserInfoPageBlock(); } } - (void)closeBtnClick{ [self removeFromSuperview]; } @end