123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- //
- // RQHomePageSubjectModuleCell.m
- // jiaPei
- //
- // Created by 张嵘 on 2022/9/8.
- // Copyright © 2022 JCZ. All rights reserved.
- //
- #import "RQHomePageSubjectModuleCell.h"
- #import "LightingAndSoundVC.h"
- @interface RQHomePageSubjectModuleCell ()
- @property (nonatomic, readwrite, strong) RQHomePageSubjectModuleItemViewModel *viewModel;
- @property (weak, nonatomic) IBOutlet UIView *subjectThreeView;
- @property (weak, nonatomic) IBOutlet UIView *lightView;
- @property (weak, nonatomic) IBOutlet UIView *soundView;
- @end
- @implementation RQHomePageSubjectModuleCell
- #pragma mark - PublicMethods
- + (instancetype)cellWithCollectionView:(UICollectionView *)collectionView forIndexPath:(NSIndexPath *)indexPath {
- static NSString *ID = @"RQHomePageSubjectModuleCell";
- [collectionView registerNib:[UINib nibWithNibName:ID bundle:nil] forCellWithReuseIdentifier:ID];
- RQHomePageSubjectModuleCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:ID forIndexPath:indexPath];
- if (!cell) cell = [self rq_viewFromXib];
- return cell;
- }
- - (void)bindViewModel:(RQHomePageSubjectModuleItemViewModel *)viewModel {
- _viewModel = viewModel;
- _subjectThreeView.hidden = RQ_COMMON_MANAGER.APP_SWITCH;
- [_subjectThreeView setTapActionWithBlock:^(UITapGestureRecognizer *tap) {
- [RQ_VIP_Module isVipWithSubject:0 complete:^(BOOL isVip) {
- if (RQ_VIP_Module.isVip) {
- [RQ_VIP_Module gotoVipCenter];
- } else {
- [RQ_VIP_Module gotoBuyVipWithVipPageType:RQVIPPageType_Full];
- }
- }];
- }];
- [_lightView setTapActionWithBlock:^(UITapGestureRecognizer *tap) {
- LightingAndSoundViewModel *lightingAndSoundViewModel = [[LightingAndSoundViewModel alloc] initWithServices:RQ_APPDELEGATE.services params:nil];
- lightingAndSoundViewModel.styleTag = 4;
- [RQ_APPDELEGATE.services pushViewModel:lightingAndSoundViewModel animated:YES];
- }];
-
- [_soundView setTapActionWithBlock:^(UITapGestureRecognizer *tap) {
- LightingAndSoundViewModel *lightingAndSoundViewModel = [[LightingAndSoundViewModel alloc] initWithServices:RQ_APPDELEGATE.services params:nil];
- lightingAndSoundViewModel.styleTag = 5;
- [RQ_APPDELEGATE.services pushViewModel:lightingAndSoundViewModel animated:YES];
- }];
- }
- #pragma mark - SystemMethods
- - (void)awakeFromNib {
- [super awakeFromNib];
- // Initialization code
- }
- @end
|