RQVipAuthorityCell.m 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. //
  2. // RQVipAuthorityCell.m
  3. // jiaPei
  4. //
  5. // Created by 张嵘 on 2022/3/1.
  6. // Copyright © 2022 JCZ. All rights reserved.
  7. //
  8. #import "RQVipAuthorityCell.h"
  9. @interface RQVipAuthorityCell ()
  10. @property (nonatomic, readwrite, strong) RQVipAuthorityItemViewModel *viewModel;
  11. @property (weak, nonatomic) IBOutlet UILabel *fourTitleLabel;
  12. @property (weak, nonatomic) IBOutlet UILabel *fourContentLabel;
  13. @property (weak, nonatomic) IBOutlet UIImageView *rightHeaderIcon;
  14. @property (weak, nonatomic) IBOutlet UIImageView *leftHeaderIcon;
  15. @end
  16. @implementation RQVipAuthorityCell
  17. #pragma mark - PublicMethods
  18. + (instancetype)cellWithCollectionView:(UICollectionView *)collectionView forIndexPath:(NSIndexPath *)indexPath {
  19. static NSString *ID = @"RQVipAuthorityCell";
  20. [collectionView registerNib:[UINib nibWithNibName:ID bundle:nil] forCellWithReuseIdentifier:ID];
  21. RQVipAuthorityCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:ID forIndexPath:indexPath];
  22. if (!cell) cell = [self rq_viewFromXib];
  23. [cell borderColor:RQColorFromHexString(@"#E0B279") width:1 cornorRadius:5];
  24. return cell;
  25. }
  26. - (void)bindViewModel:(RQVipAuthorityItemViewModel *)viewModel {
  27. _viewModel = viewModel;
  28. if (viewModel.isCenter) {
  29. self.leftHeaderIcon.image = RQImageNamed(@"标题左4");
  30. self.rightHeaderIcon.image = RQImageNamed(@"标题右4");
  31. self.backgroundColor = RQColorFromHexString(@"#FFFAF5");
  32. self.oneTitleLabel.textColor = RQColorFromHexString(@"#0A1A33");
  33. self.oneContentLabel.textColor = RQColorFromHexString(@"#8A9099");
  34. self.twoTitleLabel.textColor = RQColorFromHexString(@"#0A1A33");
  35. self.twoContentLabel.textColor = RQColorFromHexString(@"#8A9099");
  36. self.threeTitleLabel.textColor = RQColorFromHexString(@"#0A1A33");
  37. self.threeContentLabel.textColor = RQColorFromHexString(@"#8A9099");
  38. self.fourTitleLabel.textColor = RQColorFromHexString(@"#0A1A33");
  39. self.fourContentLabel.textColor = RQColorFromHexString(@"#8A9099");
  40. if (viewModel.homePageSubjectType == RQHomePageSubjectType_SubjectOne || viewModel.homePageSubjectType == RQHomePageSubjectType_SubjectFour) {
  41. self.oneIconImageView.image = RQImageNamed(@"精选500题-VIP");
  42. self.oneTitleLabel.text = @"精选500题";
  43. self.oneContentLabel.text = @"精准覆盖核心考点,快速提分";
  44. self.twoIconImageView.image = RQImageNamed(@"真实模拟考试");
  45. self.twoTitleLabel.text = @"真实考试模拟";
  46. self.twoContentLabel.text = @"模拟真实考试,心中有底,考试不惧";
  47. self.threeIconImageView.image = RQImageNamed(@"冲刺考前卷");
  48. self.threeTitleLabel.text = @"冲刺考前卷";
  49. self.threeContentLabel.text = @"精准覆盖核心考点,快速提分";
  50. } else if (viewModel.homePageSubjectType == RQHomePageSubjectType_SubjectTwo || viewModel.homePageSubjectType == RQHomePageSubjectType_SubjectThree) {
  51. self.oneIconImageView.image = RQImageNamed(@"考试项目讲解");
  52. self.oneTitleLabel.text = @"考试项目讲解";
  53. self.oneContentLabel.text = @"突破难点,掌握技巧,考试有信心";
  54. self.twoIconImageView.image = RQImageNamed(@"考试点位讲解");
  55. self.twoTitleLabel.text = @"考试点位讲解";
  56. self.twoContentLabel.text = @"掌握看点位技巧,实操轻松过";
  57. self.threeIconImageView.image = RQImageNamed(@"基础操作讲解");
  58. self.threeTitleLabel.text = @"基础操作讲解";
  59. self.threeContentLabel.text = @"基础操作视频全部解锁,提高学习效率";
  60. }
  61. } else {
  62. self.leftHeaderIcon.image = RQImageNamed(@"标题左");
  63. self.rightHeaderIcon.image = RQImageNamed(@"标题右");
  64. self.backgroundColor = RQColorFromHexString(@"#252531");
  65. self.oneTitleLabel.textColor = RQColorFromHexString(@"#DEA461");
  66. self.oneContentLabel.textColor = RQColorFromHexString(@"#F8DEB8");
  67. self.twoTitleLabel.textColor = RQColorFromHexString(@"#DEA461");
  68. self.twoContentLabel.textColor = RQColorFromHexString(@"#F8DEB8");
  69. self.threeTitleLabel.textColor = RQColorFromHexString(@"#DEA461");
  70. self.threeContentLabel.textColor = RQColorFromHexString(@"#F8DEB8");
  71. self.fourTitleLabel.textColor = RQColorFromHexString(@"#DEA461");
  72. self.fourContentLabel.textColor = RQColorFromHexString(@"#F8DEB8");
  73. if ([viewModel.typeModel.dictLabel containsString:@"一"] || [viewModel.typeModel.dictLabel containsString:@"四"]) {
  74. self.oneIconImageView.image = RQImageNamed(@"精选500题-VIP");
  75. self.oneTitleLabel.text = @"精选500题";
  76. self.oneContentLabel.text = @"精准覆盖核心考点,快速提分";
  77. self.twoIconImageView.image = RQImageNamed(@"真实模拟考试");
  78. self.twoTitleLabel.text = @"真实考试模拟";
  79. self.twoContentLabel.text = @"模拟真实考试,心中有底,考试不惧";
  80. self.threeIconImageView.image = RQImageNamed(@"冲刺考前卷");
  81. self.threeTitleLabel.text = @"冲刺考前卷";
  82. self.threeContentLabel.text = @"精准覆盖核心考点,快速提分";
  83. } else {
  84. self.oneIconImageView.image = RQImageNamed(@"考试项目讲解");
  85. self.oneTitleLabel.text = @"考试项目讲解";
  86. self.oneContentLabel.text = @"突破难点,掌握技巧,考试有信心";
  87. self.twoIconImageView.image = RQImageNamed(@"考试点位讲解");
  88. self.twoTitleLabel.text = @"考试点位讲解";
  89. self.twoContentLabel.text = @"掌握看点位技巧,实操轻松过";
  90. self.threeIconImageView.image = RQImageNamed(@"基础操作讲解");
  91. self.threeTitleLabel.text = @"基础操作讲解";
  92. self.threeContentLabel.text = @"基础操作视频全部解锁,提高学习效率";
  93. }
  94. }
  95. }
  96. #pragma mark - SystemMethods
  97. - (void)awakeFromNib {
  98. [super awakeFromNib];
  99. }
  100. #pragma mark - PrivateMethods
  101. @end