RQHomePageDriveMethodCell.m 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. //
  2. // RQHomePageDriveMethodCell.m
  3. // jiaPei
  4. //
  5. // Created by 张嵘 on 2022/6/21.
  6. // Copyright © 2022 JCZ. All rights reserved.
  7. //
  8. #import "RQHomePageDriveMethodCell.h"
  9. @interface RQHomePageDriveMethodCell ()
  10. @property (nonatomic, readwrite, strong) RQHomePageDriveMethodItemViewModel *viewModel;
  11. @property (weak, nonatomic) IBOutlet UIView *dangweicaozuoView;
  12. @property (weak, nonatomic) IBOutlet UIView *zhixingView;
  13. @property (weak, nonatomic) IBOutlet UIView *yushuaqiView;
  14. @property (weak, nonatomic) IBOutlet UIView *kaoshiliuchengView;
  15. @end
  16. @implementation RQHomePageDriveMethodCell
  17. #pragma mark - PublicMethods
  18. + (instancetype)cellWithCollectionView:(UICollectionView *)collectionView forIndexPath:(NSIndexPath *)indexPath {
  19. static NSString *ID = @"RQHomePageDriveMethodCell";
  20. [collectionView registerNib:[UINib nibWithNibName:ID bundle:nil] forCellWithReuseIdentifier:ID];
  21. RQHomePageDriveMethodCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:ID forIndexPath:indexPath];
  22. if (!cell) cell = [self rq_viewFromXib];
  23. return cell;
  24. }
  25. - (void)bindViewModel:(RQHomePageDriveMethodItemViewModel *)viewModel {
  26. _viewModel = viewModel;
  27. }
  28. #pragma mark - SystemMethods
  29. - (void)awakeFromNib {
  30. [super awakeFromNib];
  31. [_dangweicaozuoView setTapActionWithBlock:^(UITapGestureRecognizer *tap) {
  32. NSURLRequest *request = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:@"https://ys.zzxcx.net/3dangweicaozong.html"]];
  33. RQWebViewModel *viewModel = [[RQWebViewModel alloc] initWithServices:RQ_APPDELEGATE.services params:@{RQViewModelRequestKey : request}];
  34. [RQ_APPDELEGATE.services pushViewModel:viewModel animated:YES];
  35. }];
  36. [_zhixingView setTapActionWithBlock:^(UITapGestureRecognizer *tap) {
  37. NSURLRequest *request = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:@"https://ys.zzxcx.net/3zhixing.html"]];
  38. RQWebViewModel *viewModel = [[RQWebViewModel alloc] initWithServices:RQ_APPDELEGATE.services params:@{RQViewModelRequestKey : request}];
  39. [RQ_APPDELEGATE.services pushViewModel:viewModel animated:YES];
  40. }];
  41. [_yushuaqiView setTapActionWithBlock:^(UITapGestureRecognizer *tap) {
  42. NSURLRequest *request = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:@"https://ys.zzxcx.net/yuguaqi.html"]];
  43. RQWebViewModel *viewModel = [[RQWebViewModel alloc] initWithServices:RQ_APPDELEGATE.services params:@{RQViewModelRequestKey : request}];
  44. [RQ_APPDELEGATE.services pushViewModel:viewModel animated:YES];
  45. }];
  46. [_kaoshiliuchengView setTapActionWithBlock:^(UITapGestureRecognizer *tap) {
  47. NSURLRequest *request = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:@"https://ys.zzxcx.net/3_rule.html"]];
  48. RQWebViewModel *viewModel = [[RQWebViewModel alloc] initWithServices:RQ_APPDELEGATE.services params:@{RQViewModelRequestKey : request}];
  49. [RQ_APPDELEGATE.services pushViewModel:viewModel animated:YES];
  50. }];
  51. }
  52. @end