// // RQHomePageOneOrFourSmallCell.m // jiaPei // // Created by 张嵘 on 2022/6/10. // Copyright © 2022 JCZ. All rights reserved. // #import "RQHomePageOneOrFourSmallCell.h" @interface RQHomePageOneOrFourSmallCell () @property (nonatomic, readwrite, strong) RQHomePageOneOrFourSmallItemViewModel *viewModel; @property (weak, nonatomic) IBOutlet UIView *myContentView; @property (weak, nonatomic) IBOutlet UIButton *simulationBtn; @property (weak, nonatomic) IBOutlet UILabel *myTitleLabel; @property (weak, nonatomic) IBOutlet YYAnimatedImageView *myIconImageView; @end @implementation RQHomePageOneOrFourSmallCell #pragma mark - PublicMethods + (instancetype)cellWithCollectionView:(UICollectionView *)collectionView forIndexPath:(NSIndexPath *)indexPath { static NSString *ID = @"RQHomePageOneOrFourSmallCell"; [collectionView registerNib:[UINib nibWithNibName:ID bundle:nil] forCellWithReuseIdentifier:ID]; RQHomePageOneOrFourSmallCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:ID forIndexPath:indexPath]; if (!cell) cell = [self rq_viewFromXib]; cell.simulationBtn.layer.cornerRadius = RQ_FIT_HORIZONTAL(13.f) / 2.f; return cell; } - (void)bindViewModel:(RQHomePageOneOrFourSmallItemViewModel *)viewModel { _viewModel = viewModel; _simulationBtn.hidden = ![viewModel.title isEqualToString:@"真实考场"]; _myTitleLabel.text = viewModel.title; _myIconImageView.image = RQImageNamed(viewModel.icon); self.myContentView.backgroundColor = viewModel.isLeft? [UIColor qmui_colorWithHexString:@"#E0F8F1"] : [UIColor qmui_colorWithHexString:@"#E8F2FD"]; } #pragma mark - SystemMethods - (void)awakeFromNib { [super awakeFromNib]; // Initialization code } @end