// // RQVipAuthorityCell.m // jiaPei // // Created by 张嵘 on 2022/3/1. // Copyright © 2022 JCZ. All rights reserved. // #import "RQVipAuthorityCell.h" @interface RQVipAuthorityCell () @property (nonatomic, readwrite, strong) RQVipAuthorityItemViewModel *viewModel; @property (weak, nonatomic) IBOutlet UILabel *fourTitleLabel; @property (weak, nonatomic) IBOutlet UILabel *fourContentLabel; @property (weak, nonatomic) IBOutlet UIImageView *rightHeaderIcon; @property (weak, nonatomic) IBOutlet UIImageView *leftHeaderIcon; @end @implementation RQVipAuthorityCell #pragma mark - PublicMethods + (instancetype)cellWithCollectionView:(UICollectionView *)collectionView forIndexPath:(NSIndexPath *)indexPath { static NSString *ID = @"RQVipAuthorityCell"; [collectionView registerNib:[UINib nibWithNibName:ID bundle:nil] forCellWithReuseIdentifier:ID]; RQVipAuthorityCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:ID forIndexPath:indexPath]; if (!cell) cell = [self rq_viewFromXib]; [cell borderColor:RQColorFromHexString(@"#E0B279") width:1 cornorRadius:5]; return cell; } - (void)bindViewModel:(RQVipAuthorityItemViewModel *)viewModel { _viewModel = viewModel; if (viewModel.isCenter) { self.leftHeaderIcon.image = RQImageNamed(@"标题左4"); self.rightHeaderIcon.image = RQImageNamed(@"标题右4"); self.backgroundColor = RQColorFromHexString(@"#FFFAF5"); self.oneTitleLabel.textColor = RQColorFromHexString(@"#0A1A33"); self.oneContentLabel.textColor = RQColorFromHexString(@"#8A9099"); self.twoTitleLabel.textColor = RQColorFromHexString(@"#0A1A33"); self.twoContentLabel.textColor = RQColorFromHexString(@"#8A9099"); self.threeTitleLabel.textColor = RQColorFromHexString(@"#0A1A33"); self.threeContentLabel.textColor = RQColorFromHexString(@"#8A9099"); self.fourTitleLabel.textColor = RQColorFromHexString(@"#0A1A33"); self.fourContentLabel.textColor = RQColorFromHexString(@"#8A9099"); if (viewModel.homePageSubjectType == RQHomePageSubjectType_SubjectOne || viewModel.homePageSubjectType == RQHomePageSubjectType_SubjectFour) { self.oneIconImageView.image = RQImageNamed(@"精选500题-VIP"); self.oneTitleLabel.text = @"精选500题"; self.oneContentLabel.text = @"精准覆盖核心考点,快速提分"; self.twoIconImageView.image = RQImageNamed(@"真实模拟考试"); self.twoTitleLabel.text = @"真实考试模拟"; self.twoContentLabel.text = @"模拟真实考试,心中有底,考试不惧"; self.threeIconImageView.image = RQImageNamed(@"冲刺考前卷"); self.threeTitleLabel.text = @"冲刺考前卷"; self.threeContentLabel.text = @"精准覆盖核心考点,快速提分"; } else if (viewModel.homePageSubjectType == RQHomePageSubjectType_SubjectTwo || viewModel.homePageSubjectType == RQHomePageSubjectType_SubjectThree) { self.oneIconImageView.image = RQImageNamed(@"考试项目讲解"); self.oneTitleLabel.text = @"考试项目讲解"; self.oneContentLabel.text = @"突破难点,掌握技巧,考试有信心"; self.twoIconImageView.image = RQImageNamed(@"考试点位讲解"); self.twoTitleLabel.text = @"考试点位讲解"; self.twoContentLabel.text = @"掌握看点位技巧,实操轻松过"; self.threeIconImageView.image = RQImageNamed(@"基础操作讲解"); self.threeTitleLabel.text = @"基础操作讲解"; self.threeContentLabel.text = @"基础操作视频全部解锁,提高学习效率"; } } else { self.leftHeaderIcon.image = RQImageNamed(@"标题左"); self.rightHeaderIcon.image = RQImageNamed(@"标题右"); self.backgroundColor = RQColorFromHexString(@"#252531"); self.oneTitleLabel.textColor = RQColorFromHexString(@"#DEA461"); self.oneContentLabel.textColor = RQColorFromHexString(@"#F8DEB8"); self.twoTitleLabel.textColor = RQColorFromHexString(@"#DEA461"); self.twoContentLabel.textColor = RQColorFromHexString(@"#F8DEB8"); self.threeTitleLabel.textColor = RQColorFromHexString(@"#DEA461"); self.threeContentLabel.textColor = RQColorFromHexString(@"#F8DEB8"); self.fourTitleLabel.textColor = RQColorFromHexString(@"#DEA461"); self.fourContentLabel.textColor = RQColorFromHexString(@"#F8DEB8"); if ([viewModel.typeModel.dictLabel containsString:@"一"] || [viewModel.typeModel.dictLabel containsString:@"四"]) { self.oneIconImageView.image = RQImageNamed(@"精选500题-VIP"); self.oneTitleLabel.text = @"精选500题"; self.oneContentLabel.text = @"精准覆盖核心考点,快速提分"; self.twoIconImageView.image = RQImageNamed(@"真实模拟考试"); self.twoTitleLabel.text = @"真实考试模拟"; self.twoContentLabel.text = @"模拟真实考试,心中有底,考试不惧"; self.threeIconImageView.image = RQImageNamed(@"冲刺考前卷"); self.threeTitleLabel.text = @"冲刺考前卷"; self.threeContentLabel.text = @"精准覆盖核心考点,快速提分"; } else { self.oneIconImageView.image = RQImageNamed(@"考试项目讲解"); self.oneTitleLabel.text = @"考试项目讲解"; self.oneContentLabel.text = @"突破难点,掌握技巧,考试有信心"; self.twoIconImageView.image = RQImageNamed(@"考试点位讲解"); self.twoTitleLabel.text = @"考试点位讲解"; self.twoContentLabel.text = @"掌握看点位技巧,实操轻松过"; self.threeIconImageView.image = RQImageNamed(@"基础操作讲解"); self.threeTitleLabel.text = @"基础操作讲解"; self.threeContentLabel.text = @"基础操作视频全部解锁,提高学习效率"; } } } #pragma mark - SystemMethods - (void)awakeFromNib { [super awakeFromNib]; } #pragma mark - PrivateMethods @end