// // QXRealNamePopView.m // QXLive // // Created by 启星 on 2025/5/14. // #import "QXRealNamePopView.h" @interface QXRealNamePopView() @property (nonatomic,strong)UIImageView *bgImageView; @property (nonatomic,strong)UILabel *titleLabel; @property (nonatomic,strong)UILabel *messageLabel; @property (nonatomic,strong)UIButton *goBtn; @property (nonatomic,strong)UIButton *closeBtn; @end @implementation QXRealNamePopView - (instancetype)init { self = [super init]; if (self) { self.frame = CGRectMake(0, 0, ScaleWidth(275), ScaleWidth(300+48)); [self initSubViews]; } return self; } -(void)initSubViews{ self.bgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"a_pop_realname"]]; self.bgImageView.contentMode = UIViewContentModeScaleToFill; [self addSubview:self.bgImageView]; self.titleLabel = [[UILabel alloc] init]; self.titleLabel.font = [UIFont boldSystemFontOfSize:16]; self.titleLabel.text = QXText(@"实名认证"); self.titleLabel.textColor = RGB16(0x000000); [self addSubview:self.titleLabel]; [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.centerX.equalTo(self); make.top.equalTo(self.bgImageView).offset(ScaleWidth(150)); make.height.mas_equalTo(24); }]; self.goBtn = [[UIButton alloc] init]; [self.goBtn addRoundedCornersWithRadius:21]; self.goBtn.backgroundColor = QXConfig.themeColor; [self.goBtn setTitle:QXText(@"立即认证") forState:(UIControlStateNormal)]; [self.goBtn setTitleColor:QXConfig.btnTextColor forState:(UIControlStateNormal)]; self.goBtn.titleLabel.font = [UIFont systemFontOfSize:14]; [self.goBtn addTarget:self action:@selector(gotoAction) forControlEvents:(UIControlEventTouchUpInside)]; [self addSubview:self.goBtn]; [self.goBtn mas_makeConstraints:^(MASConstraintMaker *make) { make.bottom.equalTo(self.bgImageView).offset(-12); make.height.mas_equalTo(42); make.width.mas_equalTo(178); make.centerX.equalTo(self.bgImageView); }]; self.messageLabel = [[UILabel alloc] init]; self.messageLabel.font = [UIFont boldSystemFontOfSize:14]; self.messageLabel.text = QXText(@"根据国家相关要求,开启直播需要实名认证,是否进行认证?"); self.messageLabel.textColor = RGB16(0x000000); self.messageLabel.numberOfLines = 0; [self addSubview:self.messageLabel]; [self.messageLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.left.mas_equalTo(13); make.right.mas_equalTo(-13); make.bottom.equalTo(self.goBtn.mas_top).offset(-10); make.top.equalTo(self.titleLabel.mas_bottom).offset(8); }]; self.closeBtn = [[UIButton alloc] init]; [self.closeBtn setBackgroundImage:[UIImage imageNamed:@"home_white_close"] forState:(UIControlStateNormal)]; [self.closeBtn addTarget:self action:@selector(closeAction) forControlEvents:(UIControlEventTouchUpInside)]; [self addSubview:self.closeBtn]; [self.closeBtn mas_makeConstraints:^(MASConstraintMaker *make) { make.centerX.equalTo(self); make.top.equalTo(self.bgImageView.mas_bottom).offset(8); make.height.width.mas_equalTo(30); }]; } -(void)gotoAction{ if (self.authActionBlock) { self.authActionBlock(); } } -(void)closeAction{ if (self.closeActionBlock) { self.closeActionBlock(); } } @end