YOUPAIZYRechargeBtn.m 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. //
  2. // YOUPAIZYRechargeBtn.m
  3. // SIYE
  4. //
  5. // Created by Elaine on 2020/10/29.
  6. // Copyright © 2020 leo. All rights reserved.
  7. //
  8. #import "YOUPAIZYRechargeBtn.h"
  9. @implementation YOUPAIZYRechargeBtn
  10. - (instancetype)initWithFrame:(CGRect)frame model:(YOUPAILCRechargeModel*)model{
  11. if (self = [super initWithFrame:frame]) {
  12. self.youpaipreModel = model;
  13. [self youpaifsetupView];
  14. }
  15. return self;
  16. }
  17. - (void)youpaifsetupView{
  18. self.layer.cornerRadius = 6.0;
  19. self.layer.masksToBounds = YES;
  20. self.layer.borderColor = LZF5F4F7Color.CGColor;
  21. self.layer.borderWidth = 1;
  22. [self setAdjustsImageWhenHighlighted:NO];
  23. UIImageView *selectimgV = [[UIImageView alloc] initWithFrame:CGRectMake(self.frame.size.width - 28, self.frame.size.height-25,28,25)];
  24. selectimgV.image = [UIImage imageNamed:@"vqu_images_mani_select"];
  25. self.youpaipselectImgV = selectimgV;
  26. self.youpaipselectImgV.hidden = YES;
  27. [self addSubview:selectimgV];
  28. UILabel* goodLabel = [[UILabel alloc]initWithFrame:CGRectMake(0,7, self.frame.size.width,20)];
  29. goodLabel.textColor = LZ273145Color;
  30. goodLabel.font = LZDinFont(19.0f);
  31. goodLabel.textAlignment = NSTextAlignmentCenter;
  32. self.youpaipgoodLabel = goodLabel;
  33. [self addSubview:goodLabel];
  34. UILabel *giveLabel = [[UILabel alloc] init];
  35. giveLabel.textColor = LZA3AABEColor;
  36. giveLabel.font = LCFont(11);
  37. self.youpaipgiveLabel = giveLabel;
  38. [self addSubview:giveLabel];
  39. [giveLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  40. make.top.equalTo(goodLabel.mas_bottom).offset(5);
  41. make.centerX.offset(0);
  42. }];
  43. UILabel* priceL = [[UILabel alloc]init];
  44. [self addSubview:priceL];
  45. [priceL mas_makeConstraints:^(MASConstraintMaker *make) {
  46. make.centerX.mas_equalTo(0);
  47. make.top.mas_equalTo(giveLabel.mas_bottom).offset(5);
  48. }];
  49. priceL.textColor = LZA3AABEColor;
  50. priceL.font = LCFont(14);
  51. priceL.textAlignment = NSTextAlignmentCenter;
  52. self.youpaippriceLabel = priceL;
  53. // NSString *string = [self.reModel.btn_text componentsJoinedByString:@"\n"];
  54. // NSLog(@"%@",string);
  55. // priceL.text = string;
  56. // [priceL setValue:@(14) forKey:@"lineSpacing"];
  57. }
  58. - (void)setSelected:(BOOL)selected{
  59. [self bringSubviewToFront:self.youpaipselectImgV];
  60. self.youpaipselectImgV.hidden = !selected;
  61. }
  62. @end