// // YOUPAILZVipCoinRechargeCell.m // VQU // // Created by CY on 2021/8/26. // Copyright © 2021 MS. All rights reserved. // #import "YOUPAILZVipCoinRechargeCell.h" @interface YOUPAILZVipCoinRechargeCell () @property (nonatomic,weak) UILabel *youpaipcoinL; @property (nonatomic,weak) UILabel *youpaipmoneyL; @property (nonatomic,weak) UIImageView *youpaipselectedImgV; @end @implementation YOUPAILZVipCoinRechargeCell - (instancetype)initWithFrame:(CGRect)frame{ if (self = [super initWithFrame:frame]) { self.backgroundColor = [UIColor clearColor]; [self youpaifinitUI]; } return self; } - (void)youpaifinitUI{ self.layer.cornerRadius = ScaleSize(5.0f); self.clipsToBounds = YES; self.layer.borderWidth = 1.0f; self.layer.borderColor = LZF5F4F7Color.CGColor; UILabel *coinL = [[UILabel alloc] init]; coinL.font = LCFont(ScaleSize(11.0f)); coinL.textColor = LZ273145Color; coinL.textAlignment = NSTextAlignmentCenter; [self.contentView addSubview:coinL]; self.youpaipcoinL = coinL; [coinL mas_makeConstraints:^(MASConstraintMaker *make) { make.left.offset(ScaleSize(14.0f)); make.top.offset(ScaleSize(18.0f)); make.right.offset(ScaleSize(-14.0f)); }]; UILabel *moneyL = [[UILabel alloc] init]; moneyL.font = LCFont(ScaleSize(14.0f)); moneyL.textColor = LZA3AABEColor; moneyL.textAlignment = NSTextAlignmentCenter; [self.contentView addSubview:moneyL]; self.youpaipmoneyL = moneyL; [moneyL mas_makeConstraints:^(MASConstraintMaker *make) { make.left.offset(ScaleSize(14.0f)); make.bottom.offset(ScaleSize(-16.0f)); make.right.offset(ScaleSize(-14.0f)); }]; UIImageView *selectedImgV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"vqu_images_ic_vip_coin_recharge_selected"]]; selectedImgV.hidden = YES; [self.contentView addSubview:selectedImgV]; self.youpaipselectedImgV = selectedImgV; [selectedImgV mas_makeConstraints:^(MASConstraintMaker *make) { make.right.bottom.offset(0.0f); make.size.mas_offset(CGSizeMake(ScaleSize(27.0f), ScaleSize(27.0f))); }]; } - (void)youpaifreloadWithModel:(YOUPAILZVipCoinRechargeModel *)model{ if (model.youpaipisSelected) { self.youpaipselectedImgV.hidden = NO; self.layer.borderColor = HexColorFromRGB(0xFDCC88).CGColor; }else{ self.youpaipselectedImgV.hidden = YES; self.layer.borderColor = LZF5F4F7Color.CGColor; } self.youpaipmoneyL.text = [NSString stringWithFormat:@"¥%@",@([model.youpaipprice integerValue])]; self.youpaipcoinL.attributedText = [LCTools setRichTextWithTitle:[NSString stringWithFormat:@"%@",@([model.youpaipnoble_coin integerValue])] subTitle:@"贵族币" titleColor:LZ273145Color subTitleColor:LZ273145Color titleFontSize:ScaleSize(19.0f) subTitleFontSize:ScaleSize(11.0f)]; } @end