123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523 |
- //
- // TimingBaseVC.m
- // jiaPei
- //
- // Created by EchoShacolee on 2017/3/20.
- // Copyright © 2017年 JCZ. All rights reserved.
- //
- #import "TimingBaseVC.h"
- #import "AdvertisingColumn.h"
- #import "ThirdLoginBindYunGuanVC.h"
- #import "PeriodVC.h"//理论计时
- #import "ImitatePeriodVC.h"//模拟计时
- #import "TrainInfoVC.h"//我的学时
- #import "ShiCaoPeriodVC.h"//实操计时
- #import "ScanVC.h"
- #import "RQCollectionSectionModel.h"
- #import "TimingCommonCell.h"
- #import "RQCustomWebViewViewController.h"
- #import "RQCycleScrollView.h"
- @interface TimingBaseVC () <UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout>
- {
- PeriodVC *KVOPeriodVC;
- ShiCaoPeriodVC *KVOSCPeriodVC;
-
- NSString *orderId; // 订单ID
- NSString *classCode; // 课程编码
- NSString *subject; // 科目
- NSString *coachOrderId; // 教练订单ID
- NSDictionary *coachQRCodeDic;
- }
- @property (nonatomic, readonly, strong) RQTimeViewModel *viewModel;
- @property (nonatomic, readwrite, strong) UICollectionView *collectionView;
- @property (nonatomic, readwrite, strong) UICollectionViewFlowLayout *collectionViewFlowLayout;
- @property (nonatomic, readwrite, copy) NSArray *collectionDataArr;
- @property (nonatomic, readwrite, copy) NSDictionary *sourceDataDic;
- @property (nonatomic, readwrite, copy) NSString *noteStr;
- @property (nonatomic, readwrite, strong) RQCycleScrollView *cycleScrollView;
- @end
- @implementation TimingBaseVC
- @dynamic viewModel;
- #pragma mark - Public Methods
- - (void)viewDidLoad {
- [super viewDidLoad];
-
- [self.view setBackgroundColor:backGroundColor];
- self.navigationController.navigationBar.translucent = NO;
- self.navigationItem.title = @"学车计时";
- [self myInit];
- }
- #pragma mark - UICollectionViewDatasource
- - (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView {
- return self.collectionDataArr.count;
- }
- - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
- return ((RQCollectionSectionModel *)self.collectionDataArr[section]).sectionDataArr.count;
- }
- - (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
- TimingCommonCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"TimingCommonCell" forIndexPath:indexPath];
- RQCollectionSectionModel *collectionSectionModel = self.collectionDataArr[indexPath.section];
- cell.collectionItemModel = collectionSectionModel.sectionDataArr[indexPath.row];
-
- return cell;
- }
- - (UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind atIndexPath:(NSIndexPath *)indexPath {
- if ([kind isEqualToString:UICollectionElementKindSectionHeader]) {
- UICollectionReusableView *headerView = [collectionView dequeueReusableSupplementaryViewOfKind:kind withReuseIdentifier:@"UICollectionViewHeader" forIndexPath:indexPath];
- headerView.backgroundColor = backGroundColor;
- AdvertisingColumn *adView = [[AdvertisingColumn alloc]initWithFrame:CGRectMake(0, 0, headerView.width, headerView.height)];
- //广告
- NSMutableArray *newAD = [NSMutableArray array];
- for (NSDictionary *dic in myDelegate.adArray) {
- if ([dic[@"LOCATION"] isEqualToString:@"3"]) {
- [newAD addObject:dic];
- }
- }
- [adView setImgArray:newAD];
- adView.supVC = self;
- self.cycleScrollView = [[RQCycleScrollView alloc] initWithFrame:CGRectMake(16, 8, RQ_SCREEN_WIDTH - 32.f, (RQ_SCREEN_WIDTH - 32.f) * (150 / 600.f)) dataArr:newAD];
- self.cycleScrollView.layer.cornerRadius = 10.f;
- self.cycleScrollView.layer.masksToBounds = 10.f;
- [headerView addSubview:self.cycleScrollView];
- return headerView;;
- } else if ([kind isEqualToString:UICollectionElementKindSectionFooter]) {
- UICollectionReusableView *footerView = [collectionView dequeueReusableSupplementaryViewOfKind:kind withReuseIdentifier:@"UICollectionViewFooter" forIndexPath:indexPath];
- footerView.backgroundColor = backGroundColor;
- UILabel *noteLabel = [[UILabel alloc] initWithFrame:CGRectMake(16, 0, footerView.width - 32, footerView.height)];
- noteLabel.backgroundColor = backGroundColor;
- noteLabel.textColor = RQ_MAIN_COLOR;
- noteLabel.numberOfLines = 0;
- noteLabel.font = [UIFont systemFontOfSize:NormalFont];
- noteLabel.text = self.noteStr;
- [footerView addSubview:noteLabel];
- return footerView;;
- }
- return nil;
- }
- #pragma mark - UICollectionViewDelegateFlowLayout
- - (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
- return CGSizeMake((RQ_SCREEN_WIDTH - 2 - 32) / 2.f, ((RQ_SCREEN_WIDTH - 2 - 32) / 2.f) * 0.8);
- }
- - (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout referenceSizeForHeaderInSection:(NSInteger)section {
- return CGSizeMake(RQ_SCREEN_WIDTH, (RQ_SCREEN_WIDTH - 32.f) * (150 / 600.f) + 16.f);
- }
- - (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout referenceSizeForFooterInSection:(NSInteger)section {
- return CGSizeMake(RQ_SCREEN_WIDTH, [self.noteStr heightForWid:RQ_SCREEN_WIDTH Font:NormalFont] - 64);
- }
- #pragma mark - UICollectionViewDelegate
- - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
- [collectionView deselectItemAtIndexPath:indexPath animated:YES];
- RQCollectionSectionModel *collectionSectionModel = self.collectionDataArr[indexPath.section];
- RQCollectionItemModel *collectionItemModel = collectionSectionModel.sectionDataArr[indexPath.row];
- NSString *itemTitle = collectionItemModel.itemTitle;
- if ([itemTitle isEqualToString:@"理论计时"]) {
- [self theoryTimingAction];
- }else if ([itemTitle isEqualToString:@"实操计时"]) {
- [self tureTimingAction];
- }else if ([itemTitle isEqualToString:@"模拟计时"]) {
- [self simulationTimingAction];
- }else if ([itemTitle isEqualToString:@"我的学时"]) {
- [self myTrainInfoAction];
- }else {
-
- }
- }
- #pragma mark - PrivateMethods
- - (void)myInit {
- [self.view addSubview:self.collectionView];
- [RACObserve(RQ_USER_MANAGER, currentUser) subscribeNext:^(id _Nullable x) {
- NSLog(@"%@",x);
- [self.collectionView reloadData];
- }];
- }
- // 理论计时
- - (void)theoryTimingAction {
- @weakify(self)
- if (RQ_USER_MANAGER.currentUser.outId && [RQ_USER_MANAGER.currentUser.outId length] > 0) {
- [RQ_VIP_Module isActiveWithCcomplete:^(RQActivationModel * _Nullable activationModel, BOOL isSuccess) {
- @strongify(self)
- if (isSuccess) {
- if (activationModel.isShare) {
- if (activationModel.isActive == 1) {
- [self gotoPeriod];
- } else {
- [RQ_VIP_Module gotoVipViewWithDictType:RQ_USER_MANAGER.currentUser.city];
- }
- } else {
- [self gotoPeriod];
- }
- }
- }];
- }else {
- [self judgeLoginType];
- }
- }
- - (void)gotoPeriod {
- PeriodVC *vc = nil;
- if (myDelegate.tPeriodVC) {
- vc = myDelegate.tPeriodVC;
- }else {
- KVOPeriodVC = [[PeriodVC alloc] init];
- vc = KVOPeriodVC;
- }
- [self navPushHideTabbarToVC:vc];
- }
- // 实操计时
- - (void)tureTimingAction {
- @weakify(self)
- if (RQ_USER_MANAGER.currentUser.outId && [RQ_USER_MANAGER.currentUser.outId length] > 0) {
- [RQ_VIP_Module isActiveWithCcomplete:^(RQActivationModel * _Nullable activationModel, BOOL isSuccess) {
- @strongify(self)
- if (isSuccess) {
- if (activationModel.isShare) {
- if (activationModel.isActive == 1) {
- [self gotoTimi];
- } else {
- [RQ_VIP_Module gotoVipViewWithDictType:RQ_USER_MANAGER.currentUser.city];
- }
- } else {
- [self gotoTimi];
- }
- }
- }];
-
- }else {
- [self judgeLoginType];
- }
- }
- - (void)gotoTimi {
- SCLAlertView *alert = [[SCLAlertView alloc] initWithNewWindowWidth:RQ_SCREEN_WIDTH - 32];
- alert.backgroundViewColor = backGroundColor;
- alert.customViewColor = RQ_MAIN_COLOR;
-
- UITextView *view = [[UITextView alloc] initWithFrame:CGRectMake(0, 0, RQ_SCREEN_WIDTH - 64, RQ_SCREEN_HEIGHT * 0.5)];
- view.font = [UIFont systemFontOfSize:15];
- NSMutableString *content = [NSMutableString string];
- content.string = @"请注意:\n\n 本系统是按照2016驾驶员培训新国标要求,严格照规范设计,终端上传分钟学时来计算,在计时过程中请注意以下几点: \n\n1、如果所在地市有开启围栏,请注意确保您当前的位置在规定的围栏内训练,否则分钟学时无效 \n\n2、如果所在地市有开启培训时段,请确保您当前训练时间符合规定,比如早上6:00-20:00 \n\n3、确保教练手机是正常联网且安装支持3G以上的移动,联通和电信的SIM,否则无法采集到手机终端的位置,系统会判定分钟学时无效 \n\n4、系统为防止特殊情况,教练带教过程接到电话,允许断网一段时间,默认15分钟,如果超过15分钟,所带教学员的分钟学时无效 \n\n5、学员和教练的有效距离不能超过规定距离,否则分钟学时无效,详情请咨询教练或您所在的驾校 \n\n6、系统默认在2分钟及以上时间段内,如果移动距离为0米,视为无效分钟学时 \n\n7、根据规定,学员科目二和科目三1分钟内移动距离不能低于规定的数值,否则分钟学时无效,具体询问驾校或教练 \n\n8、如果您选择计时收费训练,您可以在训练结束且支付完成后对教练进行评价和投诉,如果训练完成后不支付,您的学时将无效且无法进行下一次训练 \n\n 为了保证您的合法利益,请遵守规定,同时也请提醒您的教练,手机不能断网或在带教过程中长时间接听电话,否则会影响您的学时有效性判断,导致学时无效";
- view.text = content.mutableCopy;
- view.backgroundColor = backGroundColor;
- CGFloat textHeight = [view.text heightForWid:view.width Font:15];
- view.height = (textHeight > RQ_SCREEN_HEIGHT/2)? RQ_SCREEN_HEIGHT/2 : textHeight;
- [alert addCustomView:view];
-
-
- [alert addButton:@"不再显示" actionBlock:^(void) {
- [[NSUserDefaults standardUserDefaults] setValue:@"doNotShowNotice" forKey:@"isShowNotice"];
- [self gotoScanVCAction];
- }];
- [alert addButton:@"同意" actionBlock:^(void) {
- [self gotoScanVCAction];
- }];
- if ([[[NSUserDefaults standardUserDefaults] objectForKey:@"isShowNotice"] isKindOfClass:[NSString class]] && [[[NSUserDefaults standardUserDefaults] objectForKey:@"isShowNotice"] isEqualToString:@"doNotShowNotice"]) {
- [self gotoScanVCAction];
- }else {
- [alert showInfo:self title:@"" subTitle:@"" closeButtonTitle:@"不同意" duration:0.0f];
- }
- /// RQ-MARK:计时修改
- // //判断是否绑定 如果绑定了 直接跳转 如果没有 跳转到绑定页面
- // if ([RQ_USER_MANAGER.currentUser.imei length] > 0) {
- //
- // if (![RQ_USER_MANAGER.currentUser.imei isEqualToString:[Tools getIDFV]]) {
- // ShowMsg(@"账号与绑定手机不匹配,请用本人手机计时");
- // [Tools playAudioWithString:@"账号与绑定手机不匹配,请用本人手机计时"];
- // [self.navigationController popViewControllerAnimated:YES];
- // }else{
- // //绑定且成功匹配
- // ShiCaoPeriodVC *vc = nil;
- // if (myDelegate.scPeriodVC) {
- // vc = myDelegate.scPeriodVC;
- // }else{
- // KVOSCPeriodVC = [[ShiCaoPeriodVC alloc] init];
- // vc = KVOSCPeriodVC;
- // //NSLog(@"创建kvo");
- // }
- // [self navPushHideTabbarToVC:vc];
- // }
- // }else{
- // [RQ_SHARE_FUNCTION showAlertWithTitle:@"温馨提示" message:@"您的账号暂未绑定手机,不能进行此操作,可以在“我的-绑定申请”中申请绑定" alertControllerStyle:UIAlertControllerStyleAlert cancelButtonTitle:@"确定" otherButtonTitles:nil otherButtonStyles:nil showInWindow:NO completion:nil];
- // }
- // }else{
- // [self judgeLoginType];
- }
- // 模拟计时
- - (void)simulationTimingAction {
- @weakify(self)
- if(RQ_USER_MANAGER.currentUser.outId && [RQ_USER_MANAGER.currentUser.outId length] > 0){
- [RQ_VIP_Module isActiveWithCcomplete:^(RQActivationModel * _Nullable activationModel, BOOL isSuccess) {
- @strongify(self)
- if (isSuccess) {
- if (activationModel.isShare) {
- if (activationModel.isActive == 1) {
- ImitatePeriodVC *imitVC = [[ImitatePeriodVC alloc] init];
- [self navPushHideTabbarToVC:imitVC];
- } else {
- [RQ_VIP_Module gotoVipViewWithDictType:RQ_USER_MANAGER.currentUser.city];
- }
- } else {
- ImitatePeriodVC *imitVC = [[ImitatePeriodVC alloc] init];
- [self navPushHideTabbarToVC:imitVC];
- }
- }
- }];
-
- }else {
- [self judgeLoginType];
- }
- }
- // 我的学时
- - (void)myTrainInfoAction {
- @weakify(self)
- if(RQ_USER_MANAGER.currentUser.outId && [RQ_USER_MANAGER.currentUser.outId length] > 0){
- [RQ_VIP_Module isActiveWithCcomplete:^(RQActivationModel * _Nullable activationModel, BOOL isSuccess) {
- @strongify(self)
- if (isSuccess) {
- if (activationModel.isShare) {
- if (activationModel.isActive == 1) {
- [self gotoTrainInfo];
- } else {
- [RQ_VIP_Module gotoVipViewWithDictType:RQ_USER_MANAGER.currentUser.city];
- }
- } else {
- [self gotoTrainInfo];
- }
- }
- }];
- }else{
- [self judgeLoginType];
- }
- }
- - (void)gotoTrainInfo {
- if (RQ_USER_MANAGER.isycbd == 1 && RQ_USER_MANAGER.ycbdFaceCount == 0) {
- NSURL *URL = [NSURL URLWithString:[NSString stringWithFormat:@"http://fj.jppt.com.cn/jsjp/wechat/toClassHourQueryByStuId.html?stuId=%@&dqbh=%@&app=ios",RQ_USER_MANAGER.currentUser.outId, RQ_USER_MANAGER.currentUser.city]];
- RQCustomWebViewViewController *vc = [[RQCustomWebViewViewController alloc] init];
- vc.url = URL.absoluteString;
- vc.webView.scrollView.bounces = NO;
-
- RQBaseNavigationController *nav = [[RQBaseNavigationController alloc] initWithRootViewController:vc];
- [RQControllerHelper.topViewController presentViewController:nav animated:YES completion:nil];
- } else {
- TrainInfoVC * tvc = [[TrainInfoVC alloc]init];
- [self navPushHideTabbarToVC:tvc];
- }
- }
- // 跳转至扫码页面
- - (void)gotoScanVCAction {
- ScanVC *scan = [[ScanVC alloc] init];
- scan.type = 1;
- scan.homeVC = self;
- [scan scanBlock:^(NSDictionary *scanQRCodeResultDic) {
- coachQRCodeDic = scanQRCodeResultDic;
- if ([scanQRCodeResultDic[@"scanType"] isEqualToString:@"allSignOut"]) {
- [self updateReserveEnd];
- }else if ([scanQRCodeResultDic[@"scanType"] isEqualToString:@"jhPeriod"]) {
- [self uploadReserveOrder];
- }
- }];
- [self navPushHideTabbarToVC:scan];
- }
- - (void)judgeLoginType {
- NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
- NSDictionary *udDic = [ud objectForKey:@"jiaPeiLoginTest"];
- if ([udDic[@"loginType"] isEqualToString:@"1"]){
- //身份证登录 说明不需要在这里计时
- ShowMsg(@"您的账号暂未在运管系统受理,无法计时!");
- }else {
- [RQ_SHARE_FUNCTION showAlertWithTitle:nil message:@"您的账号还未绑定运管系统账号" alertControllerStyle:UIAlertControllerStyleAlert cancelButtonTitle:@"取消" otherButtonTitles:@[@"绑定"] otherButtonStyles:nil showInWindow:NO completion:^(NSUInteger selectedOtherButtonIndex) {
- if (selectedOtherButtonIndex == 0) {
- //第三方登录 提示到绑定运管账号页面
- ThirdLoginBindYunGuanVC *vc = [[ThirdLoginBindYunGuanVC alloc] init];
- [self navPushHideTabbarToVC:vc];
- }
- }];
- }
- }
- #pragma mark - Net Methodds
- //生成订单
- - (void)uploadReserveOrder {
- [LoadingView showHUD];
- if (![Util connectedToNetWork]) {
- showMsgUnconnect();
- return;
- }
- NSMutableArray *arr=[NSMutableArray array];
- [arr addPro:@"reserveId" Value:[coachQRCodeDic[@"dataString"] componentsSeparatedByString:@";"][3]];
- [arr addPro:@"userId" Value:RQ_USER_MANAGER.currentUser._id];
- [arr addPro:@"dqbh" Value:RQ_USER_MANAGER.currentUser.city];
- [arr addPro:@"coachId" Value:[coachQRCodeDic[@"dataString"] componentsSeparatedByString:@";"].lastObject];
- [arr addPro:@"sim" Value:RQ_USER_MANAGER.currentUser.telphone];
- [arr addPro:@"stuOutId" Value:RQ_USER_MANAGER.currentUser.outId];
- [arr addPro:@"coachOutId" Value:[coachQRCodeDic[@"dataString"] componentsSeparatedByString:@";"][0]];
- NSString* method = @"uploadReserveOrder";
- [jiaPeiManager requestAnythingWithURL:method array:arr data:nil completion:^(NSDictionary * root) {
- RemoveHUD();
- if (!root) {
- ShowMsg(@"开始计时失败,请重试!");
- [Tools playAudioWithString:@"开始计时失败,请崇试!"];
- return;
- }
- if ([root[@"code"] isEqualToString:@"1"]) {
- ShowMsg(root[@"body"]);
- [Tools playAudioWithString:root[@"body"]];
- return;
- }
- orderId = [root[@"body"] objectForKey:@"id"];
- subject = [root[@"body"] objectForKey:@"subject"];
- ShowMsg(@"签到成功!");
- [Tools playAudioWithString:@"签到成功,开始实操计时,请系好安全带"];
- }];
- }
- - (void)updateReserveEnd {
- [LoadingView showHUD];
- if (![Util connectedToNetWork]) {
- showMsgUnconnect();
- return;
- }
-
- NSMutableArray *arr = [NSMutableArray array];
- [arr addPro:@"orderId" Value:[coachQRCodeDic[@"dataString"] componentsSeparatedByString:@";"].lastObject];
- [arr addPro:@"userId" Value:RQ_USER_MANAGER.currentUser._id];
- [arr addPro:@"coachId" Value:[coachQRCodeDic[@"dataString"] componentsSeparatedByString:@";"][0]];
-
-
- NSString* method = @"updateReserveEnd";
- [jiaPeiManager requestAnythingWithURL:method array:arr data:nil completion:^(NSDictionary * root) {
- RemoveHUD();
-
- if (!root) {
- ShowMsg(@"签退失败!");
- [Tools playAudioWithString:@"签退失败!"];
- return;
- }
- if ([root[@"code"] isEqualToString:@"1"]) {
- ShowMsg(root[@"body"]);
- [Tools playAudioWithString:root[@"body"]];
- return;
- }
-
- ShowMsg(@"签退成功!");
- [Tools playAudioWithString:@"签退成功!"];
- }];
- }
- #pragma mark - LazyLoad
- - (UICollectionView *)collectionView {
- if (!_collectionView) {
- _collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(0, 0, RQ_SCREEN_WIDTH, RQ_SCREEN_HEIGHT) collectionViewLayout:self.collectionViewFlowLayout];
- _collectionView.backgroundColor = RQlineColor;
- _collectionView.delegate = self;
- _collectionView.dataSource = self;
- _collectionView.bounces = YES;
- _collectionView.showsVerticalScrollIndicator = NO;
- _collectionView.showsHorizontalScrollIndicator = NO;
- _collectionView.contentInset = UIEdgeInsetsMake(0, 0, 0, 0);
- // 注册
- [_collectionView registerNib:[UINib nibWithNibName:@"TimingCommonCell" bundle:[NSBundle mainBundle]] forCellWithReuseIdentifier:@"TimingCommonCell"];
- [_collectionView registerClass:[UICollectionReusableView class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:@"UICollectionViewHeader"];
- [_collectionView registerClass:[UICollectionReusableView class] forSupplementaryViewOfKind:UICollectionElementKindSectionFooter withReuseIdentifier:@"UICollectionViewFooter"];
- }
- return _collectionView;
- }
- - (UICollectionViewFlowLayout *)collectionViewFlowLayout {
- if (!_collectionViewFlowLayout) {
- _collectionViewFlowLayout = [[UICollectionViewFlowLayout alloc] init];
- // 设置最小行间距
- _collectionViewFlowLayout.minimumLineSpacing = 2;
- // 最小列间距
- _collectionViewFlowLayout.minimumInteritemSpacing = 2;
- /**
- * 设置自动滚动的方向 垂直或者横向
- */
- _collectionViewFlowLayout.scrollDirection = UICollectionViewScrollDirectionVertical;
- /**
- * 设置集合视图内边距的大小
- *
- * @param 20 上
- * @param 20 左
- * @param 20 下
- * @param 20 右
- *
- * @return UIEdgeInsetsMake 与下面的方法相同 -(UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout insetForSectionAtIndex:(NSInteger)section
- */
- _collectionViewFlowLayout.sectionInset = UIEdgeInsetsMake(16, 16, 16, 16);
- }
- return _collectionViewFlowLayout;
- }
- - (NSArray *)collectionDataArr {
- if ([RQ_SHARE_FUNCTION.timingTypeOneCityCodeArr containsObject:RQ_USER_MANAGER.currentUser.city]) {
- return [RQCollectionSectionModel arrayOfModelsFromData:[NSJSONSerialization dataWithJSONObject:self.sourceDataDic[@"1"] options:0 error:nil] error:nil];
- } else if ([RQ_SHARE_FUNCTION.timingTypeTwoCityCodeArr containsObject:RQ_USER_MANAGER.currentUser.city]) {
- return [RQCollectionSectionModel arrayOfModelsFromData:[NSJSONSerialization dataWithJSONObject:self.sourceDataDic[@"1"] options:0 error:nil] error:nil];
- } else {
- return [RQCollectionSectionModel arrayOfModelsFromData:[NSJSONSerialization dataWithJSONObject:self.sourceDataDic[@"1"] options:0 error:nil] error:nil];
- }
- }
- - (NSDictionary *)sourceDataDic {
- return @{
- @"0" : @[@{@"sectionTitle" : @"",
- @"sectionDataArr" : @[@{@"itemTitle" : @"理论计时",
- @"itemSubTitle" : @"",
- @"itemImageName" : @"Time_lilun.png"},
- @{@"itemTitle" : @"实操计时",
- @"itemSubTitle" : @"",
- @"itemImageName" : @"Time_shicao.png"},
- @{@"itemTitle" : @"模拟计时",
- @"itemSubTitle" : @"",
- @"itemImageName" : @"Time_moni.png"},
- @{@"itemTitle" : @"我的学时",
- @"itemSubTitle" : @"",
- @"itemImageName" : @"Time_xueshi.png"}]}],
- @"1" : @[@{@"sectionTitle" : @"",
- @"sectionDataArr" : @[@{@"itemTitle" : @"理论计时",
- @"itemSubTitle" : @"",
- @"itemImageName" : @"Time_lilun.png"},
- @{@"itemTitle" : @"我的学时",
- @"itemSubTitle" : @"",
- @"itemImageName" : @"Time_xueshi.png"}]}],
- };
- }
- - (NSString *)noteStr {
- return @"请注意:\n\n 本系统是按照2016驾驶员培训新国标要求,严格照规范设计,终端上传分钟学时来计算,在计时过程中请注意以下几点: \n\n1、如果所在地市有开启围栏,请注意确保您当前的位置在规定的围栏内训练,否则分钟学时无效 \n\n2、如果所在地市有开启培训时段,请确保您当前训练时间符合规定,比如早上6:00-20:00 \n\n3、确保教练手机是正常联网且安装支持3G以上的移动,联通和电信的SIM,否则无法采集到手机终端的位置,系统会判定分钟学时无效 \n\n4、系统为防止特殊情况,教练带教过程接到电话,允许断网一段时间,默认15分钟,如果超过15分钟,所带教学员的分钟学时无效 \n\n5、学员和教练的有效距离不能超过规定距离,否则分钟学时无效,详情请咨询教练或您所在的驾校 \n\n6、系统默认在2分钟及以上时间段内,如果移动距离为0米,视为无效分钟学时 \n\n7、根据规定,学员科目二和科目三1分钟内移动距离不能低于规定的数值,否则分钟学时无效,具体询问驾校或教练 \n\n8、如果您选择计时收费训练,您可以在训练结束且支付完成后对教练进行评价和投诉,如果训练完成后不支付,您的学时将无效且无法进行下一次训练 \n\n 为了保证您的合法利益,请遵守规定,同时也请提醒您的教练,手机不能断网或在带教过程中长时间接听电话,否则会影响您的学时有效性判断,导致学时无效";
- }
- @end
|