NYLiVipContentNewCell02.m 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. //
  2. // NYLiVipContentNewCell02.m
  3. // jiaPei
  4. //
  5. // Created by Ning.ge on 2025/2/15.
  6. // Copyright © 2025 JCZ. All rights reserved.
  7. //
  8. #import "NYLiVipContentNewCell02.h"
  9. @interface NYLiVipContentNewCell02 ()
  10. @property (nonatomic, readwrite, strong) NYLIVipContentItemViewModel *viewModel;
  11. @property (weak, nonatomic) IBOutlet UIImageView *bgImageView;
  12. @property (weak, nonatomic) IBOutlet UIImageView *bgImageView01;
  13. @property (weak, nonatomic) IBOutlet UIStackView *skview01;
  14. @property (weak, nonatomic) IBOutlet UIStackView *skview02;
  15. @property (weak, nonatomic) IBOutlet UIStackView *skview03;
  16. //@property (weak, nonatomic) IBOutlet NSLayoutConstraint *lay_aspect;
  17. @end
  18. @implementation NYLiVipContentNewCell02
  19. #pragma mark - PublicMethods
  20. + (instancetype)cellWithCollectionView:(UICollectionView *)collectionView forIndexPath:(NSIndexPath *)indexPath {
  21. static NSString *ID = @"NYLiVipContentNewCell02";
  22. [collectionView registerNib:[UINib nibWithNibName:ID bundle:nil] forCellWithReuseIdentifier:ID];
  23. NYLiVipContentNewCell02 *cell = [collectionView dequeueReusableCellWithReuseIdentifier:ID forIndexPath:indexPath];
  24. if (!cell) cell = [self rq_viewFromXib];
  25. [cell borderColor:RQColorFromHexString(@"#E0B279") width:1 cornorRadius:5];
  26. return cell;
  27. }
  28. - (void)bindViewModel:(NYLIVipContentItemViewModel *)viewModel {
  29. // @weakify(self)
  30. _viewModel = viewModel;
  31. self.bgImageView.hidden = YES;
  32. self.bgImageView01.hidden = YES;
  33. if(viewModel.type==0){
  34. self.skview01.hidden = NO;
  35. self.skview02.hidden = YES;
  36. self.skview03.hidden = YES;
  37. self.myTitleLabel.text = @"专业实力";
  38. self.mySubTitleLabel.text = @"精准解读驾考要点";
  39. // self.lay_aspect.multiplier = 393.0/529.0;
  40. }else if(viewModel.type==1){
  41. self.skview01.hidden = YES;
  42. self.skview02.hidden = NO;
  43. self.skview03.hidden = YES;
  44. self.myTitleLabel.text = @"教学特点";
  45. self.mySubTitleLabel.text = @"生动有趣,轻松掌握";
  46. }else if(viewModel.type==2){
  47. self.skview01.hidden = YES;
  48. self.skview02.hidden = YES;
  49. self.skview03.hidden = NO;
  50. self.myTitleLabel.text = @"教学成果";
  51. self.mySubTitleLabel.text = @"高通过率,成果斐然";
  52. }else if(viewModel.type==3){
  53. self.skview01.hidden = YES;
  54. self.skview02.hidden = YES;
  55. self.skview03.hidden = YES;
  56. self.myTitleLabel.text = @"学员评价";
  57. self.mySubTitleLabel.text = @"口碑爆棚,信赖之选";
  58. self.bgImageView01.hidden = NO;
  59. self.bgImageView01.image = RQImageNamed(@"li_say_up_h");
  60. }
  61. }
  62. - (void)setIndexPath:(NSIndexPath *)indexPath rowsInSection:(NSInteger)rows {
  63. // self.backgroundColor = RQColorFromHexString(@"#252531");
  64. }
  65. #pragma mark - SystemMethods
  66. - (void)awakeFromNib {
  67. [super awakeFromNib];
  68. // self.oneStepLabel.backgroundColor = [UIColor rq_colorGradientChangeWithFrame:CGRectMake(0, 0, RQ_FIT_HORIZONTAL(69.f), RQ_FIT_HORIZONTAL(25.f)) startPoint:CGPointMake(0.98, 0.5) endPoint:CGPointMake(0, 0.5) startColor:RQColorFromHexString(@"#F97467") endColor:RQColorFromHexString(@"#F9A192")];
  69. // [self.oneStepLabel updateCornerRadius:^(QQCorner *corner) {
  70. // corner.radius = QQRadiusMake(0.f, 25 / 2.f, 0.f, 25 / 2.f);
  71. // }];
  72. //
  73. // self.twoStepLabel.backgroundColor = [UIColor rq_colorGradientChangeWithFrame:CGRectMake(0, 0, RQ_FIT_HORIZONTAL(69.f), RQ_FIT_HORIZONTAL(25.f)) startPoint:CGPointMake(0.98, 0.5) endPoint:CGPointMake(0, 0.5) startColor:RQColorFromHexString(@"#F97467") endColor:RQColorFromHexString(@"#F9A192")];
  74. // [self.twoStepLabel updateCornerRadius:^(QQCorner *corner) {
  75. // corner.radius = QQRadiusMake(0.f, 25 / 2.f, 0.f, 25 / 2.f);
  76. // }];
  77. //
  78. // self.threeStepLabel.backgroundColor = [UIColor rq_colorGradientChangeWithFrame:CGRectMake(0, 0, RQ_FIT_HORIZONTAL(69.f), RQ_FIT_HORIZONTAL(25.f)) startPoint:CGPointMake(0.98, 0.5) endPoint:CGPointMake(0, 0.5) startColor:RQColorFromHexString(@"#F97467") endColor:RQColorFromHexString(@"#F9A192")];
  79. // [self.threeStepLabel updateCornerRadius:^(QQCorner *corner) {
  80. // corner.radius = QQRadiusMake(0.f, 25 / 2.f, 0.f, 25 / 2.f);
  81. // }];
  82. }
  83. #pragma mark - PrivateMethods
  84. @end