// // YOUPAIZYRechargeBtn.m // SIYE // // Created by Elaine on 2020/10/29. // Copyright © 2020 leo. All rights reserved. // #import "YOUPAIZYRechargeBtn.h" @implementation YOUPAIZYRechargeBtn - (instancetype)initWithFrame:(CGRect)frame model:(YOUPAILCRechargeModel*)model{ if (self = [super initWithFrame:frame]) { self.youpaipreModel = model; [self youpaifsetupView]; } return self; } - (void)youpaifsetupView{ self.layer.cornerRadius = 6.0; self.layer.masksToBounds = YES; self.layer.borderColor = LZF5F4F7Color.CGColor; self.layer.borderWidth = 1; [self setAdjustsImageWhenHighlighted:NO]; UIImageView *selectimgV = [[UIImageView alloc] initWithFrame:CGRectMake(self.frame.size.width - 28, self.frame.size.height-25,28,25)]; selectimgV.image = [UIImage imageNamed:@"vqu_images_mani_select"]; self.youpaipselectImgV = selectimgV; self.youpaipselectImgV.hidden = YES; [self addSubview:selectimgV]; UILabel* goodLabel = [[UILabel alloc]initWithFrame:CGRectMake(0,7, self.frame.size.width,20)]; goodLabel.textColor = LZ273145Color; goodLabel.font = LZDinFont(19.0f); goodLabel.textAlignment = NSTextAlignmentCenter; self.youpaipgoodLabel = goodLabel; [self addSubview:goodLabel]; UILabel *giveLabel = [[UILabel alloc] init]; giveLabel.textColor = LZA3AABEColor; giveLabel.font = LCFont(11); self.youpaipgiveLabel = giveLabel; [self addSubview:giveLabel]; [giveLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.top.equalTo(goodLabel.mas_bottom).offset(5); make.centerX.offset(0); }]; UILabel* priceL = [[UILabel alloc]init]; [self addSubview:priceL]; [priceL mas_makeConstraints:^(MASConstraintMaker *make) { make.centerX.mas_equalTo(0); make.top.mas_equalTo(giveLabel.mas_bottom).offset(5); }]; priceL.textColor = LZA3AABEColor; priceL.font = LCFont(14); priceL.textAlignment = NSTextAlignmentCenter; self.youpaippriceLabel = priceL; // NSString *string = [self.reModel.btn_text componentsJoinedByString:@"\n"]; // NSLog(@"%@",string); // priceL.text = string; // [priceL setValue:@(14) forKey:@"lineSpacing"]; } - (void)setSelected:(BOOL)selected{ [self bringSubviewToFront:self.youpaipselectImgV]; self.youpaipselectImgV.hidden = !selected; } @end