YOUPAILZVipPrivilegeCell.m 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. //
  2. // YOUPAILZVipPrivilegeCell.m
  3. // VQU
  4. //
  5. // Created by CY on 2021/8/21.
  6. // Copyright © 2021 MS. All rights reserved.
  7. //
  8. #import "YOUPAILZVipPrivilegeCell.h"
  9. @interface YOUPAILZVipPrivilegeCell ()
  10. @property (nonatomic, weak) UIImageView *youpaipiconImgV;
  11. @property (nonatomic, weak) UILabel *youpaiptitleL;
  12. @property (nonatomic, weak) UILabel *youpaipdetailL;
  13. @end
  14. @implementation YOUPAILZVipPrivilegeCell
  15. - (instancetype)initWithFrame:(CGRect)frame{
  16. if (self = [super initWithFrame:frame]) {
  17. [self youpaifinitUI];
  18. }
  19. return self;
  20. }
  21. - (void)youpaifinitUI{
  22. UIImageView *iconImgV = [[UIImageView alloc] init];
  23. iconImgV.contentMode = UIViewContentModeScaleAspectFill;
  24. [self.contentView addSubview:iconImgV];
  25. self.youpaipiconImgV = iconImgV;
  26. [iconImgV mas_makeConstraints:^(MASConstraintMaker *make) {
  27. make.top.offset(ScaleSize(5.0f));
  28. make.centerX.equalTo(self.contentView.mas_centerX);
  29. make.size.mas_offset(CGSizeMake(ScaleSize(34.0f), ScaleSize(34.0f)));
  30. }];
  31. UILabel *titleL = [[UILabel alloc] init];
  32. titleL.textColor = HexColorFromRGB(0x8A8990);
  33. titleL.font = LCFont13;
  34. titleL.textAlignment = NSTextAlignmentCenter;
  35. [self.contentView addSubview:titleL];
  36. self.youpaiptitleL = titleL;
  37. [titleL mas_makeConstraints:^(MASConstraintMaker *make) {
  38. make.left.right.offset(0.0f);
  39. make.top.equalTo(iconImgV.mas_bottom).offset(ScaleSize(10.0f));
  40. }];
  41. UILabel *detailL = [[UILabel alloc] init];
  42. detailL.textColor = [[UIColor whiteColor] colorWithAlphaComponent:0.65f];
  43. detailL.font = LCFont(11.0f);
  44. detailL.textAlignment = NSTextAlignmentCenter;
  45. detailL.numberOfLines = 0;
  46. [self.contentView addSubview:detailL];
  47. self.youpaipdetailL = detailL;
  48. [detailL mas_makeConstraints:^(MASConstraintMaker *make) {
  49. make.left.right.offset(0.0f);
  50. make.top.equalTo(titleL.mas_bottom).offset(ScaleSize(10.0f));
  51. }];
  52. }
  53. - (void)youpaifreloadWithModel:(YOUPAILZVipPrivilegeModel *)model{
  54. [self.youpaipiconImgV sd_setImageWithURL:[LCTools getImageUrlWithAddress:model.youpaipimg]];
  55. if (model.youpaipis_has) {
  56. self.youpaiptitleL.textColor = HexColorFromRGB(0xFDCC88);
  57. }else{
  58. self.youpaiptitleL.textColor = HexColorFromRGB(0x8A8990);
  59. }
  60. self.youpaiptitleL.text = model.youpaipname;
  61. self.youpaipdetailL.text = [NSString stringWithFormat:@"%@",model.youpaipdes];
  62. }
  63. @end