12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- //
- // RQVipAuthoritySmallCell.m
- // jiaPei
- //
- // Created by 张嵘 on 2022/3/1.
- // Copyright © 2022 JCZ. All rights reserved.
- //
- #import "RQVipAuthoritySmallCell.h"
- @interface RQVipAuthoritySmallCell ()
- @property (nonatomic, readwrite, strong) RQVipAuthoritySmallItemViewModel *viewModel;
- @property (weak, nonatomic) IBOutlet UIStackView *adView;
- @end
- @implementation RQVipAuthoritySmallCell
- #pragma mark - PublicMethods
- + (instancetype)cellWithCollectionView:(UICollectionView *)collectionView forIndexPath:(NSIndexPath *)indexPath {
- static NSString *ID = @"RQVipAuthoritySmallCell";
- [collectionView registerNib:[UINib nibWithNibName:ID bundle:nil] forCellWithReuseIdentifier:ID];
- RQVipAuthoritySmallCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:ID forIndexPath:indexPath];
- if (!cell) cell = [self rq_viewFromXib];
- return cell;
- }
- - (void)bindViewModel:(RQVipAuthoritySmallItemViewModel *)viewModel {
- // @weakify(self)
- _viewModel = viewModel;
- if ([viewModel.typeModel.remark containsString:@"1"]) {
- self.adView.hidden = NO;
- self.oneIconImageView.image = RQImageNamed(@"科目一永久");
- self.oneTitleLabel.text = @"科一专项VIP";
-
- self.twoIconImageView.image = RQImageNamed(@"科目二永久");
- self.twoTitleLabel.text = @"科二专项VIP";
-
- self.threeIconImageView.image = RQImageNamed(@"科目三永久");
- self.threeTitleLabel.text = @"科三专项VIP";
-
- self.fourIconImageView.image = RQImageNamed(@"科目四永久");
- self.fourTitleLabel.text = @"科四专项VIP";
- } else {
- self.adView.hidden = YES;
- if ([viewModel.typeModel.dictLabel containsString:@"一"] || [viewModel.typeModel.dictLabel containsString:@"四"]) {
- self.oneIconImageView.image = RQImageNamed(@"精选500题-Alert");
- self.oneTitleLabel.text = @"精选500题";
-
- self.twoIconImageView.image = RQImageNamed(@"真实考试模拟-Alert");
- self.twoTitleLabel.text = @"真实考试模拟";
-
- self.threeIconImageView.image = RQImageNamed(@"冲刺考前券-Alert");
- self.threeTitleLabel.text = @"冲刺考前卷";
-
- self.fourIconImageView.image = RQImageNamed(@"去广告-Alert");
- self.fourTitleLabel.text = @"去广告";
- } else {
- self.oneIconImageView.image = RQImageNamed(@"考试项目讲解-Alert");
- self.oneTitleLabel.text = @"考试项目讲解";
-
- self.twoIconImageView.image = RQImageNamed(@"考试点位讲解-Alert");
- self.twoTitleLabel.text = @"考试点位讲解";
-
- self.threeIconImageView.image = RQImageNamed(@"基础操作讲解-Alert");
- self.threeTitleLabel.text = @"基础操作讲解";
-
- self.fourIconImageView.image = RQImageNamed(@"去广告-Alert");
- self.fourTitleLabel.text = @"去广告";
- }
- }
- }
- - (void)setIndexPath:(NSIndexPath *)indexPath rowsInSection:(NSInteger)rows {
- self.backgroundColor = UIColor.clearColor;
- }
- #pragma mark - SystemMethods
- - (void)awakeFromNib {
- [super awakeFromNib];
- }
- #pragma mark - PrivateMethods
- @end
|