// // RQHomePageDriveMethodCell.m // jiaPei // // Created by 张嵘 on 2022/6/21. // Copyright © 2022 JCZ. All rights reserved. // #import "RQHomePageDriveMethodCell.h" @interface RQHomePageDriveMethodCell () @property (nonatomic, readwrite, strong) RQHomePageDriveMethodItemViewModel *viewModel; @property (weak, nonatomic) IBOutlet UIView *dangweicaozuoView; @property (weak, nonatomic) IBOutlet UIView *zhixingView; @property (weak, nonatomic) IBOutlet UIView *yushuaqiView; @property (weak, nonatomic) IBOutlet UIView *kaoshiliuchengView; @end @implementation RQHomePageDriveMethodCell #pragma mark - PublicMethods + (instancetype)cellWithCollectionView:(UICollectionView *)collectionView forIndexPath:(NSIndexPath *)indexPath { static NSString *ID = @"RQHomePageDriveMethodCell"; [collectionView registerNib:[UINib nibWithNibName:ID bundle:nil] forCellWithReuseIdentifier:ID]; RQHomePageDriveMethodCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:ID forIndexPath:indexPath]; if (!cell) cell = [self rq_viewFromXib]; return cell; } - (void)bindViewModel:(RQHomePageDriveMethodItemViewModel *)viewModel { _viewModel = viewModel; } #pragma mark - SystemMethods - (void)awakeFromNib { [super awakeFromNib]; [_dangweicaozuoView setTapActionWithBlock:^(UITapGestureRecognizer *tap) { NSURLRequest *request = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:@"https://ys.zzxcx.net/3dangweicaozong.html"]]; RQWebViewModel *viewModel = [[RQWebViewModel alloc] initWithServices:RQ_APPDELEGATE.services params:@{RQViewModelRequestKey : request}]; [RQ_APPDELEGATE.services pushViewModel:viewModel animated:YES]; }]; [_zhixingView setTapActionWithBlock:^(UITapGestureRecognizer *tap) { NSURLRequest *request = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:@"https://ys.zzxcx.net/3zhixing.html"]]; RQWebViewModel *viewModel = [[RQWebViewModel alloc] initWithServices:RQ_APPDELEGATE.services params:@{RQViewModelRequestKey : request}]; [RQ_APPDELEGATE.services pushViewModel:viewModel animated:YES]; }]; [_yushuaqiView setTapActionWithBlock:^(UITapGestureRecognizer *tap) { NSURLRequest *request = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:@"https://ys.zzxcx.net/yuguaqi.html"]]; RQWebViewModel *viewModel = [[RQWebViewModel alloc] initWithServices:RQ_APPDELEGATE.services params:@{RQViewModelRequestKey : request}]; [RQ_APPDELEGATE.services pushViewModel:viewModel animated:YES]; }]; [_kaoshiliuchengView setTapActionWithBlock:^(UITapGestureRecognizer *tap) { NSURLRequest *request = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:@"https://ys.zzxcx.net/3_rule.html"]]; RQWebViewModel *viewModel = [[RQWebViewModel alloc] initWithServices:RQ_APPDELEGATE.services params:@{RQViewModelRequestKey : request}]; [RQ_APPDELEGATE.services pushViewModel:viewModel animated:YES]; }]; } @end