1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- //
- // RQHomePageJiaoGuan12123Cell.m
- // jiaPei
- //
- // Created by 张嵘 on 2022/6/21.
- // Copyright © 2022 JCZ. All rights reserved.
- //
- #import "RQHomePageJiaoGuan12123Cell.h"
- @interface RQHomePageJiaoGuan12123Cell ()
- @property (nonatomic, readwrite, strong) RQHomePageJiaoGuan12123ItemViewModel *viewModel;
- @property (weak, nonatomic) IBOutlet UIView *useGuideView;
- @property (weak, nonatomic) IBOutlet UIView *yuyuekaoshiView;
- @property (weak, nonatomic) IBOutlet UIView *chengjichaxunView;
- @end
- @implementation RQHomePageJiaoGuan12123Cell
- #pragma mark - PublicMethods
- + (instancetype)cellWithCollectionView:(UICollectionView *)collectionView forIndexPath:(NSIndexPath *)indexPath {
- static NSString *ID = @"RQHomePageJiaoGuan12123Cell";
- [collectionView registerNib:[UINib nibWithNibName:ID bundle:nil] forCellWithReuseIdentifier:ID];
- RQHomePageJiaoGuan12123Cell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:ID forIndexPath:indexPath];
- if (!cell) cell = [self rq_viewFromXib];
- return cell;
- }
- - (void)bindViewModel:(RQHomePageJiaoGuan12123ItemViewModel *)viewModel {
- _viewModel = viewModel;
- }
- #pragma mark - SystemMethods
- - (void)awakeFromNib {
- [super awakeFromNib];
- [_useGuideView setTapActionWithBlock:^(UITapGestureRecognizer *tap) {
- NSURL *url = [NSURL URLWithString:@"itms-apps://itunes.apple.com/cn/app/jiao-guan-12123/id1039727169?l=en&mt=8"];
- if (@available(iOS 10.0, *)) {
- [[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];
- } else {
- // Fallback on earlier versions
- [[UIApplication sharedApplication] openURL:url];
- }
- }];
-
- [_yuyuekaoshiView setTapActionWithBlock:^(UITapGestureRecognizer *tap) {
- NSURLRequest *request = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:@"https://t1-1305573081.file.myqcloud.com/jiaoxue/12123zhuce.mp4"]];
- RQWebViewModel *viewModel = [[RQWebViewModel alloc] initWithServices:RQ_APPDELEGATE.services params:@{RQViewModelRequestKey : request}];
- viewModel.title = @"用户注册";
- [RQ_APPDELEGATE.services pushViewModel:viewModel animated:YES];
- }];
-
- [_chengjichaxunView setTapActionWithBlock:^(UITapGestureRecognizer *tap) {
- NSURLRequest *request = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:@"https://t1-1305573081.file.myqcloud.com/jiaoxue/12123yuyue.mp4"]];
- RQWebViewModel *viewModel = [[RQWebViewModel alloc] initWithServices:RQ_APPDELEGATE.services params:@{RQViewModelRequestKey : request}];
- viewModel.title = @"预约考试";
- [RQ_APPDELEGATE.services pushViewModel:viewModel animated:YES];
- }];
- }
- @end
|