12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- //
- // RQHomePageSimulationExamCell.m
- // jiaPei
- //
- // Created by 张嵘 on 2022/6/10.
- // Copyright © 2022 JCZ. All rights reserved.
- //
- #import "RQHomePageSimulationExamCell.h"
- @interface RQHomePageSimulationExamCell ()
- @property (nonatomic, readwrite, strong) RQHomePageSimulationExamItemViewModel *viewModel;
- @property (weak, nonatomic) IBOutlet UIButton *oneBtn;
- @property (weak, nonatomic) IBOutlet UIButton *twoBtn;
- @property (weak, nonatomic) IBOutlet UIButton *tryBtn;
- @property (weak, nonatomic) IBOutlet UILabel *myTitleLabel;
- @end
- @implementation RQHomePageSimulationExamCell
- #pragma mark - PublicMethods
- + (instancetype)cellWithCollectionView:(UICollectionView *)collectionView forIndexPath:(NSIndexPath *)indexPath {
- static NSString *ID = @"RQHomePageSimulationExamCell";
- [collectionView registerNib:[UINib nibWithNibName:ID bundle:nil] forCellWithReuseIdentifier:ID];
- RQHomePageSimulationExamCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:ID forIndexPath:indexPath];
- if (!cell) cell = [self rq_viewFromXib];
- cell.oneBtn.layer.cornerRadius = RQ_FIT_HORIZONTAL(16.f) / 2.f;
- cell.twoBtn.layer.cornerRadius = RQ_FIT_HORIZONTAL(16.f) / 2.f;
- [cell.tryBtn setBackgroundImage:[UIImage imageWithGradualChangingColor:^(QQGradualChangingColor *graColor) {
- graColor.fromColor = [UIColor qmui_colorWithHexString:@"#498EF5"];
- graColor.toColor = [UIColor qmui_colorWithHexString:@"#4DA8E6"];
- graColor.type = QQGradualChangeTypeLeftToRight;
- } size:cell.tryBtn.size cornerRadius:QQRadiusMakeSame(RQ_FIT_HORIZONTAL(30.f) / 2.f)] forState:UIControlStateNormal];
- cell.tryBtn.layer.shadowColor = [UIColor qmui_colorWithHexString:@"#498EF5"].CGColor;
- return cell;
- }
- - (void)bindViewModel:(RQHomePageSimulationExamItemViewModel *)viewModel {
- _viewModel = viewModel;
- _myTitleLabel.text = (self.viewModel.homePageSubjectType == RQHomePageSubjectType_SubjectOne)? @"科一真实考场模拟" : @"科四真实考场模拟";
- }
- #pragma mark - SystemMethods
- - (void)awakeFromNib {
- [super awakeFromNib];
- // Initialization code
- }
- @end
|