123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- //
- // NYLIHomePageSimulationExamCell.m
- // jiaPei
- //
- // Created by Ning.ge on 2025/2/14.
- // Copyright © 2025 JCZ. All rights reserved.
- //
- #import "NYLIHomePageSimulationExamCell.h"
- @interface NYLIHomePageSimulationExamCell ()
- @property (nonatomic, readwrite, strong) NYLIHomePageSimulationExamItemViewModel *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;
- @property (weak, nonatomic) IBOutlet UIButton *li_image_btn;
- @end
- @implementation NYLIHomePageSimulationExamCell
- #pragma mark - PublicMethods
- + (instancetype)cellWithCollectionView:(UICollectionView *)collectionView forIndexPath:(NSIndexPath *)indexPath {
- static NSString *ID = @"NYLIHomePageSimulationExamCell";
- [collectionView registerNib:[UINib nibWithNibName:ID bundle:nil] forCellWithReuseIdentifier:ID];
- NYLIHomePageSimulationExamCell *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;
- NSString *filePath = [[NSBundle mainBundle] pathForResource:@"JSJPXLI" ofType:@"gif"];
- cell.li_image_btn.layer.cornerRadius = 4.f;
- [cell.li_image_btn sd_setImageWithURL:[NSURL fileURLWithPath:filePath] forState:UIControlStateNormal];
- cell.li_image_btn.layer.masksToBounds = YES;
- return cell;
- }
- - (void)bindViewModel:(NYLIHomePageSimulationExamItemViewModel *)viewModel {
- _viewModel = viewModel;
- _myTitleLabel.text = (self.viewModel.homePageSubjectType == RQHomePageSubjectType_SubjectOne)? @"科一真实考场模拟" : @"科四真实考场模拟";
- }
- //小李
- - (IBAction)callLIActiondo:(UIButton *)sender {
- if(self.viewModel.operationLI){
- self.viewModel.operationLI();
- }
- }
- //真实考场
- - (IBAction)callExmActiondo:(UIButton *)sender {
-
- }
- #pragma mark - SystemMethods
- - (void)awakeFromNib {
- [super awakeFromNib];
- // Initialization code
- }
- @end
|