YOUPAILZVipCoinRechargeCell.m 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. //
  2. // YOUPAILZVipCoinRechargeCell.m
  3. // VQU
  4. //
  5. // Created by CY on 2021/8/26.
  6. // Copyright © 2021 MS. All rights reserved.
  7. //
  8. #import "YOUPAILZVipCoinRechargeCell.h"
  9. @interface YOUPAILZVipCoinRechargeCell ()
  10. @property (nonatomic,weak) UILabel *youpaipcoinL;
  11. @property (nonatomic,weak) UILabel *youpaipmoneyL;
  12. @property (nonatomic,weak) UIImageView *youpaipselectedImgV;
  13. @end
  14. @implementation YOUPAILZVipCoinRechargeCell
  15. - (instancetype)initWithFrame:(CGRect)frame{
  16. if (self = [super initWithFrame:frame]) {
  17. self.backgroundColor = [UIColor clearColor];
  18. [self youpaifinitUI];
  19. }
  20. return self;
  21. }
  22. - (void)youpaifinitUI{
  23. self.layer.cornerRadius = ScaleSize(5.0f);
  24. self.clipsToBounds = YES;
  25. self.layer.borderWidth = 1.0f;
  26. self.layer.borderColor = LZF5F4F7Color.CGColor;
  27. UILabel *coinL = [[UILabel alloc] init];
  28. coinL.font = LCFont(ScaleSize(11.0f));
  29. coinL.textColor = LZ273145Color;
  30. coinL.textAlignment = NSTextAlignmentCenter;
  31. [self.contentView addSubview:coinL];
  32. self.youpaipcoinL = coinL;
  33. [coinL mas_makeConstraints:^(MASConstraintMaker *make) {
  34. make.left.offset(ScaleSize(14.0f));
  35. make.top.offset(ScaleSize(18.0f));
  36. make.right.offset(ScaleSize(-14.0f));
  37. }];
  38. UILabel *moneyL = [[UILabel alloc] init];
  39. moneyL.font = LCFont(ScaleSize(14.0f));
  40. moneyL.textColor = LZA3AABEColor;
  41. moneyL.textAlignment = NSTextAlignmentCenter;
  42. [self.contentView addSubview:moneyL];
  43. self.youpaipmoneyL = moneyL;
  44. [moneyL mas_makeConstraints:^(MASConstraintMaker *make) {
  45. make.left.offset(ScaleSize(14.0f));
  46. make.bottom.offset(ScaleSize(-16.0f));
  47. make.right.offset(ScaleSize(-14.0f));
  48. }];
  49. UIImageView *selectedImgV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"vqu_images_ic_vip_coin_recharge_selected"]];
  50. selectedImgV.hidden = YES;
  51. [self.contentView addSubview:selectedImgV];
  52. self.youpaipselectedImgV = selectedImgV;
  53. [selectedImgV mas_makeConstraints:^(MASConstraintMaker *make) {
  54. make.right.bottom.offset(0.0f);
  55. make.size.mas_offset(CGSizeMake(ScaleSize(27.0f), ScaleSize(27.0f)));
  56. }];
  57. }
  58. - (void)youpaifreloadWithModel:(YOUPAILZVipCoinRechargeModel *)model{
  59. if (model.youpaipisSelected) {
  60. self.youpaipselectedImgV.hidden = NO;
  61. self.layer.borderColor = HexColorFromRGB(0xFDCC88).CGColor;
  62. }else{
  63. self.youpaipselectedImgV.hidden = YES;
  64. self.layer.borderColor = LZF5F4F7Color.CGColor;
  65. }
  66. self.youpaipmoneyL.text = [NSString stringWithFormat:@"¥%@",@([model.youpaipprice integerValue])];
  67. self.youpaipcoinL.attributedText = [LCTools setRichTextWithTitle:[NSString stringWithFormat:@"%@",@([model.youpaipnoble_coin integerValue])] subTitle:@"贵族币" titleColor:LZ273145Color subTitleColor:LZ273145Color titleFontSize:ScaleSize(19.0f) subTitleFontSize:ScaleSize(11.0f)];
  68. }
  69. @end