NYLIHomePageSimulationExamCell.m 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. //
  2. // NYLIHomePageSimulationExamCell.m
  3. // jiaPei
  4. //
  5. // Created by Ning.ge on 2025/2/14.
  6. // Copyright © 2025 JCZ. All rights reserved.
  7. //
  8. #import "NYLIHomePageSimulationExamCell.h"
  9. @interface NYLIHomePageSimulationExamCell ()
  10. @property (nonatomic, readwrite, strong) NYLIHomePageSimulationExamItemViewModel *viewModel;
  11. @property (weak, nonatomic) IBOutlet UIButton *oneBtn;
  12. @property (weak, nonatomic) IBOutlet UIButton *twoBtn;
  13. @property (weak, nonatomic) IBOutlet UIButton *tryBtn;
  14. @property (weak, nonatomic) IBOutlet UILabel *myTitleLabel;
  15. @property (weak, nonatomic) IBOutlet UIButton *li_image_btn;
  16. @end
  17. @implementation NYLIHomePageSimulationExamCell
  18. #pragma mark - PublicMethods
  19. + (instancetype)cellWithCollectionView:(UICollectionView *)collectionView forIndexPath:(NSIndexPath *)indexPath {
  20. static NSString *ID = @"NYLIHomePageSimulationExamCell";
  21. [collectionView registerNib:[UINib nibWithNibName:ID bundle:nil] forCellWithReuseIdentifier:ID];
  22. NYLIHomePageSimulationExamCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:ID forIndexPath:indexPath];
  23. if (!cell) cell = [self rq_viewFromXib];
  24. cell.oneBtn.layer.cornerRadius = RQ_FIT_HORIZONTAL(16.f) / 2.f;
  25. cell.twoBtn.layer.cornerRadius = RQ_FIT_HORIZONTAL(16.f) / 2.f;
  26. [cell.tryBtn setBackgroundImage:[UIImage imageWithGradualChangingColor:^(QQGradualChangingColor *graColor) {
  27. graColor.fromColor = [UIColor qmui_colorWithHexString:@"#498EF5"];
  28. graColor.toColor = [UIColor qmui_colorWithHexString:@"#4DA8E6"];
  29. graColor.type = QQGradualChangeTypeLeftToRight;
  30. } size:cell.tryBtn.size cornerRadius:QQRadiusMakeSame(RQ_FIT_HORIZONTAL(30.f) / 2.f)] forState:UIControlStateNormal];
  31. cell.tryBtn.layer.shadowColor = [UIColor qmui_colorWithHexString:@"#498EF5"].CGColor;
  32. NSString *filePath = [[NSBundle mainBundle] pathForResource:@"JSJPXLI" ofType:@"gif"];
  33. cell.li_image_btn.layer.cornerRadius = 4.f;
  34. [cell.li_image_btn sd_setImageWithURL:[NSURL fileURLWithPath:filePath] forState:UIControlStateNormal];
  35. cell.li_image_btn.layer.masksToBounds = YES;
  36. return cell;
  37. }
  38. - (void)bindViewModel:(NYLIHomePageSimulationExamItemViewModel *)viewModel {
  39. _viewModel = viewModel;
  40. _myTitleLabel.text = (self.viewModel.homePageSubjectType == RQHomePageSubjectType_SubjectOne)? @"科一真实考场模拟" : @"科四真实考场模拟";
  41. }
  42. //小李
  43. - (IBAction)callLIActiondo:(UIButton *)sender {
  44. if(self.viewModel.operationLI){
  45. self.viewModel.operationLI();
  46. }
  47. }
  48. //真实考场
  49. - (IBAction)callExmActiondo:(UIButton *)sender {
  50. }
  51. #pragma mark - SystemMethods
  52. - (void)awakeFromNib {
  53. [super awakeFromNib];
  54. // Initialization code
  55. }
  56. @end