RQHomePageJiaoGuan12123Cell.m 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. //
  2. // RQHomePageJiaoGuan12123Cell.m
  3. // jiaPei
  4. //
  5. // Created by 张嵘 on 2022/6/21.
  6. // Copyright © 2022 JCZ. All rights reserved.
  7. //
  8. #import "RQHomePageJiaoGuan12123Cell.h"
  9. @interface RQHomePageJiaoGuan12123Cell ()
  10. @property (nonatomic, readwrite, strong) RQHomePageJiaoGuan12123ItemViewModel *viewModel;
  11. @property (weak, nonatomic) IBOutlet UIView *useGuideView;
  12. @property (weak, nonatomic) IBOutlet UIView *yuyuekaoshiView;
  13. @property (weak, nonatomic) IBOutlet UIView *chengjichaxunView;
  14. @end
  15. @implementation RQHomePageJiaoGuan12123Cell
  16. #pragma mark - PublicMethods
  17. + (instancetype)cellWithCollectionView:(UICollectionView *)collectionView forIndexPath:(NSIndexPath *)indexPath {
  18. static NSString *ID = @"RQHomePageJiaoGuan12123Cell";
  19. [collectionView registerNib:[UINib nibWithNibName:ID bundle:nil] forCellWithReuseIdentifier:ID];
  20. RQHomePageJiaoGuan12123Cell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:ID forIndexPath:indexPath];
  21. if (!cell) cell = [self rq_viewFromXib];
  22. return cell;
  23. }
  24. - (void)bindViewModel:(RQHomePageJiaoGuan12123ItemViewModel *)viewModel {
  25. _viewModel = viewModel;
  26. }
  27. #pragma mark - SystemMethods
  28. - (void)awakeFromNib {
  29. [super awakeFromNib];
  30. [_useGuideView setTapActionWithBlock:^(UITapGestureRecognizer *tap) {
  31. NSURL *url = [NSURL URLWithString:@"itms-apps://itunes.apple.com/cn/app/jiao-guan-12123/id1039727169?l=en&mt=8"];
  32. if (@available(iOS 10.0, *)) {
  33. [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];
  34. } else {
  35. // Fallback on earlier versions
  36. [[UIApplication sharedApplication] openURL:url];
  37. }
  38. }];
  39. [_yuyuekaoshiView setTapActionWithBlock:^(UITapGestureRecognizer *tap) {
  40. NSURLRequest *request = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:@"https://t1-1305573081.file.myqcloud.com/jiaoxue/12123zhuce.mp4"]];
  41. RQWebViewModel *viewModel = [[RQWebViewModel alloc] initWithServices:RQ_APPDELEGATE.services params:@{RQViewModelRequestKey : request}];
  42. viewModel.title = @"用户注册";
  43. [RQ_APPDELEGATE.services pushViewModel:viewModel animated:YES];
  44. }];
  45. [_chengjichaxunView setTapActionWithBlock:^(UITapGestureRecognizer *tap) {
  46. NSURLRequest *request = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:@"https://t1-1305573081.file.myqcloud.com/jiaoxue/12123yuyue.mp4"]];
  47. RQWebViewModel *viewModel = [[RQWebViewModel alloc] initWithServices:RQ_APPDELEGATE.services params:@{RQViewModelRequestKey : request}];
  48. viewModel.title = @"预约考试";
  49. [RQ_APPDELEGATE.services pushViewModel:viewModel animated:YES];
  50. }];
  51. }
  52. @end