123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- //
- // NYLIHomePageVideoExamCell.m
- // jiaPei
- //
- // Created by Ning.ge on 2025/2/27.
- // Copyright © 2025 JCZ. All rights reserved.
- //
- #import "NYLIHomePageVideoExamCell.h"
- @interface NYLIHomePageVideoExamCell ()
- @property (nonatomic, readwrite, strong) NYLIHomePageVideoExamItemViewModel *viewModel;
- @property (weak, nonatomic) IBOutlet UIButton *tryBtn;
- @property (weak, nonatomic) IBOutlet UILabel *title_label01;
- @property (weak, nonatomic) IBOutlet UILabel *title_label02;
- @end
- @implementation NYLIHomePageVideoExamCell
- #pragma mark - PublicMethods
- + (instancetype)cellWithCollectionView:(UICollectionView *)collectionView forIndexPath:(NSIndexPath *)indexPath {
- static NSString *ID = @"NYLIHomePageVideoExamCell";
- [collectionView registerNib:[UINib nibWithNibName:ID bundle:nil] forCellWithReuseIdentifier:ID];
- NYLIHomePageVideoExamCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:ID forIndexPath:indexPath];
- if (!cell) cell = [self rq_viewFromXib];
- [cell.tryBtn setBackgroundImage:[UIImage imageWithGradualChangingColor:^(QQGradualChangingColor *graColor) {
- graColor.fromColor = [UIColor qmui_colorWithHexString:@"#FF4D53"];
- graColor.toColor = [UIColor qmui_colorWithHexString:@"#FF776D"];
- 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:@"#FF4D53"].CGColor;
- return cell;
- }
- - (void)bindViewModel:(NYLIHomePageVideoExamItemViewModel *)viewModel {
- _viewModel = viewModel;
- _title_label01.text = (self.viewModel.homePageSubjectType == RQHomePageSubjectType_SubjectOne)? @"科一精选500" : @"科四精选300";
- }
- #pragma mark - SystemMethods
- - (void)awakeFromNib {
- [super awakeFromNib];
- // Initialization code
- }
- @end
|