|
@@ -4,13 +4,14 @@
|
|
//
|
|
//
|
|
// Created by Ning.ge on 2024/2/4.
|
|
// Created by Ning.ge on 2024/2/4.
|
|
// Copyright © 2024 JCZ. All rights reserved.
|
|
// Copyright © 2024 JCZ. All rights reserved.
|
|
-//
|
|
|
|
|
|
+// (怎么快,怎么来,先不抽取MVVM)
|
|
|
|
|
|
#import "NYClassRoomPeiCell.h"
|
|
#import "NYClassRoomPeiCell.h"
|
|
#import "NYClassRoomPeiViewModel.h"
|
|
#import "NYClassRoomPeiViewModel.h"
|
|
#import "MapManager.h"
|
|
#import "MapManager.h"
|
|
#import "TZImagePickerController.h"//第三方相册
|
|
#import "TZImagePickerController.h"//第三方相册
|
|
#import "NYClassRoomPeiPhotoCell.h"
|
|
#import "NYClassRoomPeiPhotoCell.h"
|
|
|
|
+#import "RQQRCodeViewController.h"
|
|
|
|
|
|
@interface NYClassRoomPeiCell ()<TZImagePickerControllerDelegate,UICollectionViewDelegate,UICollectionViewDataSource>{
|
|
@interface NYClassRoomPeiCell ()<TZImagePickerControllerDelegate,UICollectionViewDelegate,UICollectionViewDataSource>{
|
|
CGFloat _itemWH;
|
|
CGFloat _itemWH;
|
|
@@ -26,6 +27,9 @@
|
|
|
|
|
|
@property (nonatomic ,strong) CultivateInfoModel *cultivateInfo;
|
|
@property (nonatomic ,strong) CultivateInfoModel *cultivateInfo;
|
|
|
|
|
|
|
|
+// 在头文件中定义一个属性来跟踪扫描状态
|
|
|
|
+@property (nonatomic, assign) BOOL isScanning;
|
|
|
|
+@property (nonatomic, assign) int gotoType;
|
|
|
|
|
|
@end
|
|
@end
|
|
|
|
|
|
@@ -49,6 +53,14 @@
|
|
self.collectionView.backgroundColor = [UIColor colorWithHexString:@"#F2F3F5" alpha:1.0];
|
|
self.collectionView.backgroundColor = [UIColor colorWithHexString:@"#F2F3F5" alpha:1.0];
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+//获取本地 classIdStr 绑定账号
|
|
|
|
+-(void)createClassIdStr{
|
|
|
|
+ NSInteger timeStamp = [[NSDate date] timeIntervalSince1970] * 1000;
|
|
|
|
+ NSString *timeStampStr = [NSString stringWithFormat:@"%@",[NSNumber numberWithInteger:timeStamp]];
|
|
|
|
+ self.viewModel.cultivateInfoModel = NULL;
|
|
|
|
+ self.viewModel.classIdStr = timeStampStr;
|
|
|
|
+}
|
|
|
|
+
|
|
//详细
|
|
//详细
|
|
- (void)setCultivateInfoModel:(CultivateInfoModel *)cultInfoModel{
|
|
- (void)setCultivateInfoModel:(CultivateInfoModel *)cultInfoModel{
|
|
self.viewModel.cultivateInfoModel = cultInfoModel;
|
|
self.viewModel.cultivateInfoModel = cultInfoModel;
|
|
@@ -60,13 +72,46 @@
|
|
RAC(self.course_ptime_label, text) = [[RACObserve(cultInfoModel, timeAll) takeUntil:self.rac_prepareForReuseSignal] deliverOnMainThread];
|
|
RAC(self.course_ptime_label, text) = [[RACObserve(cultInfoModel, timeAll) takeUntil:self.rac_prepareForReuseSignal] deliverOnMainThread];
|
|
RAC(self.sign_time_label, text) = [[RACObserve(cultInfoModel, signTime) takeUntil:self.rac_prepareForReuseSignal] deliverOnMainThread];
|
|
RAC(self.sign_time_label, text) = [[RACObserve(cultInfoModel, signTime) takeUntil:self.rac_prepareForReuseSignal] deliverOnMainThread];
|
|
RAC(self.exit_ptime_label, text) = [[RACObserve(cultInfoModel, nextDate) takeUntil:self.rac_prepareForReuseSignal] deliverOnMainThread];
|
|
RAC(self.exit_ptime_label, text) = [[RACObserve(cultInfoModel, nextDate) takeUntil:self.rac_prepareForReuseSignal] deliverOnMainThread];
|
|
|
|
+ RAC(self.stu_subject_label, text) = [[RACObserve(cultInfoModel, subject) takeUntil:self.rac_prepareForReuseSignal] deliverOnMainThread];
|
|
|
|
+ if(self.viewModel.isSimulationRoom){
|
|
|
|
+ self.submit_btn.hidden = !cultInfoModel.isTrainPhotoGc;
|
|
|
|
+ [self updateUIBarButtonItem:0];
|
|
|
|
+ }
|
|
|
|
+ if(_cultivateInfo){
|
|
|
|
+ //修改 签到状态
|
|
|
|
+ self.not_data_view.hidden = YES;
|
|
|
|
+ }
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+- (void)updateUIBarButtonItem:(int)code{
|
|
|
|
+ if (@available(iOS 16.0, *)) {
|
|
|
|
+ self.signInOrsignOutItem.hidden = NO;
|
|
|
|
+ } else {
|
|
|
|
+ [self.signInOrsignOutItem setHidden:NO];
|
|
|
|
+ // Fallback on earlier versions
|
|
|
|
+ }
|
|
|
|
+ if(code==99){
|
|
|
|
+ if (@available(iOS 16.0, *)) {
|
|
|
|
+ self.signInOrsignOutItem.hidden = YES;
|
|
|
|
+ } else {
|
|
|
|
+ [self.signInOrsignOutItem setHidden:YES];
|
|
|
|
+ // Fallback on earlier versions
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ self.signInOrsignOutItem.title = @"签到";
|
|
|
|
+ if(_cultivateInfo){
|
|
|
|
+ self.signInOrsignOutItem.title = @"签退";
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
- (void)bindViewModel:(NYClassRoomPeiViewModel *)viewModel {
|
|
- (void)bindViewModel:(NYClassRoomPeiViewModel *)viewModel {
|
|
self.viewModel = viewModel;
|
|
self.viewModel = viewModel;
|
|
|
|
+ self.viewModel.photoType = @"19";
|
|
|
|
+ self.viewModel.pxkm = RQ_USER_MANAGER.currentUser.pxjd;//用户阶段
|
|
[self getClassRoomInfo];
|
|
[self getClassRoomInfo];
|
|
//定位功能
|
|
//定位功能
|
|
|
|
+ __weak typeof(self) weakSelf = self;
|
|
[MBProgressHUD rq_showProgressHUD:@"正在获取当前位置..."];
|
|
[MBProgressHUD rq_showProgressHUD:@"正在获取当前位置..."];
|
|
[[MapManager sharedManager] updateLocationWithCompleteBlock:^(BOOL success, CLLocation * _Nonnull location, BMKLocation * _Nullable bmkLocation) {
|
|
[[MapManager sharedManager] updateLocationWithCompleteBlock:^(BOOL success, CLLocation * _Nonnull location, BMKLocation * _Nullable bmkLocation) {
|
|
[MBProgressHUD rq_hideHUD];
|
|
[MBProgressHUD rq_hideHUD];
|
|
@@ -74,18 +119,22 @@
|
|
_myLocation = location.coordinate;
|
|
_myLocation = location.coordinate;
|
|
}
|
|
}
|
|
}];
|
|
}];
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
//获取 课堂 信息
|
|
//获取 课堂 信息
|
|
- (void)getClassRoomInfo{
|
|
- (void)getClassRoomInfo{
|
|
|
|
+ NSString *type = self.viewModel.classType;
|
|
NSMutableArray *arr = [NSMutableArray array];
|
|
NSMutableArray *arr = [NSMutableArray array];
|
|
[arr property:RQ_USER_MANAGER.currentUser.outId forKey:@"outid"];
|
|
[arr property:RQ_USER_MANAGER.currentUser.outId forKey:@"outid"];
|
|
- [arr property:@"1" forKey:@"type"];//1课堂 2模拟
|
|
|
|
|
|
+ [arr property:type forKey:@"type"];//1课堂 2模拟
|
|
[arr property:RQ_USER_MANAGER.currentUser.city forKey:@"dqbh"];
|
|
[arr property:RQ_USER_MANAGER.currentUser.city forKey:@"dqbh"];
|
|
NSString* method = @"getStunocarSignInfo";
|
|
NSString* method = @"getStunocarSignInfo";
|
|
[jiaPeiManager requestAnythingWithURL:method array:arr data:nil completion:^(NSDictionary * dict) {
|
|
[jiaPeiManager requestAnythingWithURL:method array:arr data:nil completion:^(NSDictionary * dict) {
|
|
if (dict==nil||[dict[@"code"] intValue]!=0) {
|
|
if (dict==nil||[dict[@"code"] intValue]!=0) {
|
|
self.not_data_view.hidden = NO;
|
|
self.not_data_view.hidden = NO;
|
|
|
|
+ self.cultivateInfo = nil;
|
|
|
|
+ [self updateUIBarButtonItem:[dict[@"code"] intValue]];
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
CultivateInfoModel *cultInfoModel = [CultivateInfoModel modelWithDictionary:[NSMutableDictionary dictionaryWithDictionary:dict[@"body"]]];
|
|
CultivateInfoModel *cultInfoModel = [CultivateInfoModel modelWithDictionary:[NSMutableDictionary dictionaryWithDictionary:dict[@"body"]]];
|
|
@@ -97,9 +146,10 @@
|
|
//获取课堂 照片
|
|
//获取课堂 照片
|
|
- (void)getPhotoArray{
|
|
- (void)getPhotoArray{
|
|
NSString *classid = self.cultivateInfo.classid;
|
|
NSString *classid = self.cultivateInfo.classid;
|
|
|
|
+ NSString *type = self.viewModel.classType;
|
|
NSMutableArray *arr = [NSMutableArray array];
|
|
NSMutableArray *arr = [NSMutableArray array];
|
|
[arr property:RQ_USER_MANAGER.currentUser.outId forKey:@"outid"];
|
|
[arr property:RQ_USER_MANAGER.currentUser.outId forKey:@"outid"];
|
|
- [arr property:@"1" forKey:@"type"];//1课堂 2模拟
|
|
|
|
|
|
+ [arr property:type forKey:@"type"];//1课堂 2模拟
|
|
[arr property:RQ_USER_MANAGER.currentUser.city forKey:@"dqbh"];
|
|
[arr property:RQ_USER_MANAGER.currentUser.city forKey:@"dqbh"];
|
|
[arr property:classid forKey:@"classid"];
|
|
[arr property:classid forKey:@"classid"];
|
|
[self.photosArray removeAllObjects];
|
|
[self.photosArray removeAllObjects];
|
|
@@ -118,12 +168,31 @@
|
|
}];
|
|
}];
|
|
}
|
|
}
|
|
|
|
|
|
-
|
|
|
|
|
|
+//过程照片
|
|
- (IBAction)submit_clickdo:(UIButton *)sender {
|
|
- (IBAction)submit_clickdo:(UIButton *)sender {
|
|
|
|
+ self.submit_btn.userInteractionEnabled = NO;
|
|
|
|
+ //定位功能
|
|
|
|
+ __weak typeof(self) weakSelf = self;
|
|
|
|
+ [MBProgressHUD rq_showProgressHUD:@"正在获取当前位置..."];
|
|
|
|
+ [[MapManager sharedManager] updateLocationWithCompleteBlock:^(BOOL success, CLLocation * _Nonnull location, BMKLocation * _Nullable bmkLocation) {
|
|
|
|
+ [MBProgressHUD rq_hideHUD];
|
|
|
|
+ if (success) {
|
|
|
|
+ _myLocation = location.coordinate;
|
|
|
|
+ NSString *photoType = @"19";
|
|
|
|
+ if(weakSelf.photosArray.count==0){//如果没有签到记录
|
|
|
|
+ photoType = @"17";
|
|
|
|
+ }
|
|
|
|
+ [weakSelf photoCoursedo:photoType];
|
|
|
|
+ }
|
|
|
|
+ }];
|
|
|
|
+}
|
|
|
|
+//拍照过程
|
|
|
|
+- (void)photoCoursedo:(NSString *)photoType{
|
|
if(_myLocation.latitude<=0){
|
|
if(_myLocation.latitude<=0){
|
|
ShowMsg(@"定位失败!请重新定位!");
|
|
ShowMsg(@"定位失败!请重新定位!");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+ self.viewModel.photoType = photoType;
|
|
CultivateInfoModel *cultInfoModel = self.viewModel.cultivateInfoModel;
|
|
CultivateInfoModel *cultInfoModel = self.viewModel.cultivateInfoModel;
|
|
|
|
|
|
// roomLat roomLng maxDistance
|
|
// roomLat roomLng maxDistance
|
|
@@ -157,7 +226,6 @@
|
|
//直接-进入人脸-签到流程
|
|
//直接-进入人脸-签到流程
|
|
[self beginCheckBodyHumanface];
|
|
[self beginCheckBodyHumanface];
|
|
}
|
|
}
|
|
-
|
|
|
|
}
|
|
}
|
|
|
|
|
|
//人脸比对流程
|
|
//人脸比对流程
|
|
@@ -166,10 +234,11 @@
|
|
/// 1.本地活体检测
|
|
/// 1.本地活体检测
|
|
[RQ_CHECKBODY_MANAGER beginCheckBodyWithCheckNum:RQ_USER_MANAGER.ycbdFaceCount completeBlock:^(BOOL success, NSDictionary * _Nullable dic) {
|
|
[RQ_CHECKBODY_MANAGER beginCheckBodyWithCheckNum:RQ_USER_MANAGER.ycbdFaceCount completeBlock:^(BOOL success, NSDictionary * _Nullable dic) {
|
|
if (success) {
|
|
if (success) {
|
|
|
|
+ NSString *type = self.viewModel.classType;
|
|
//上传-课堂照片
|
|
//上传-课堂照片
|
|
__block NSMutableArray *arr = [NSMutableArray array];
|
|
__block NSMutableArray *arr = [NSMutableArray array];
|
|
NSData *imageData = [[NSData alloc] initWithBase64EncodedString:dic[@"normalImg"] options:NSDataBase64DecodingIgnoreUnknownCharacters];
|
|
NSData *imageData = [[NSData alloc] initWithBase64EncodedString:dic[@"normalImg"] options:NSDataBase64DecodingIgnoreUnknownCharacters];
|
|
- NSString *method = [NSString stringWithFormat:@"education/imageup/%@/1/%@/nocar",RQ_USER_MANAGER.currentUser.city,RQ_USER_MANAGER.currentUser.outId];
|
|
|
|
|
|
+ NSString *method = [NSString stringWithFormat:@"education/imageup/%@/%@/%@/nocar",RQ_USER_MANAGER.currentUser.city,type,RQ_USER_MANAGER.currentUser.outId];
|
|
[jiaPeiManager requestAnythingImageWithURL:method array:arr data:imageData completion:^(NSDictionary *dict) {
|
|
[jiaPeiManager requestAnythingImageWithURL:method array:arr data:imageData completion:^(NSDictionary *dict) {
|
|
NSLog(@"%@",dict);
|
|
NSLog(@"%@",dict);
|
|
int code = [dict[@"code"] intValue];
|
|
int code = [dict[@"code"] intValue];
|
|
@@ -179,6 +248,7 @@
|
|
/// 2.线上活体检测
|
|
/// 2.线上活体检测
|
|
[self stunocarfaceTofacedo:photoid];
|
|
[self stunocarfaceTofacedo:photoid];
|
|
}else{
|
|
}else{
|
|
|
|
+ self.submit_btn.userInteractionEnabled = YES;
|
|
if (!RQObjectIsNil(dict[@"msg"])) {
|
|
if (!RQObjectIsNil(dict[@"msg"])) {
|
|
ShowMsg(dict[@"msg"]);
|
|
ShowMsg(dict[@"msg"]);
|
|
return;
|
|
return;
|
|
@@ -209,6 +279,7 @@
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
|
|
+ self.submit_btn.userInteractionEnabled = YES;
|
|
if (!RQObjectIsNil(dict[@"msg"])) {
|
|
if (!RQObjectIsNil(dict[@"msg"])) {
|
|
ShowMsg(dict[@"msg"]);
|
|
ShowMsg(dict[@"msg"]);
|
|
return;
|
|
return;
|
|
@@ -223,22 +294,175 @@
|
|
|
|
|
|
// 过程上传
|
|
// 过程上传
|
|
-(void)updateStunocarPhoto:(NSString *)photoid{
|
|
-(void)updateStunocarPhoto:(NSString *)photoid{
|
|
- NSString *classid = self.cultivateInfo.classid;
|
|
|
|
|
|
+ NSString *classIdStr = self.viewModel.classIdStr;
|
|
|
|
+ NSString *type = self.viewModel.classType;
|
|
|
|
+ NSString *photoType = self.viewModel.photoType;
|
|
NSString *lat = [NSString stringWithFormat:@"%.6f",_myLocation.latitude];
|
|
NSString *lat = [NSString stringWithFormat:@"%.6f",_myLocation.latitude];
|
|
NSString *lng = [NSString stringWithFormat:@"%.6f",_myLocation.longitude];
|
|
NSString *lng = [NSString stringWithFormat:@"%.6f",_myLocation.longitude];
|
|
NSMutableArray *arr = [NSMutableArray array];
|
|
NSMutableArray *arr = [NSMutableArray array];
|
|
[arr property:RQ_USER_MANAGER.currentUser.outId forKey:@"stuId"];
|
|
[arr property:RQ_USER_MANAGER.currentUser.outId forKey:@"stuId"];
|
|
- [arr property:@"1" forKey:@"type"];//1课堂 2模拟
|
|
|
|
|
|
+ [arr property:type forKey:@"type"];//1课堂 2模拟
|
|
[arr property:RQ_USER_MANAGER.currentUser.city forKey:@"dqbh"];
|
|
[arr property:RQ_USER_MANAGER.currentUser.city forKey:@"dqbh"];
|
|
- [arr property:classid forKey:@"classid"];
|
|
|
|
|
|
+ [arr property:classIdStr forKey:@"classid"];
|
|
[arr property:photoid forKey:@"photo"];
|
|
[arr property:photoid forKey:@"photo"];
|
|
[arr property:lng forKey:@"lng"];
|
|
[arr property:lng forKey:@"lng"];
|
|
[arr property:lat forKey:@"lat"];
|
|
[arr property:lat forKey:@"lat"];
|
|
|
|
+ [arr property:photoType forKey:@"photoType"];//17签到照片18签退照片19过程照片
|
|
NSString* method = @"updateStunocarPhoto";
|
|
NSString* method = @"updateStunocarPhoto";
|
|
[jiaPeiManager requestAnythingWithURL:method array:arr data:nil completion:^(NSDictionary * dict) {
|
|
[jiaPeiManager requestAnythingWithURL:method array:arr data:nil completion:^(NSDictionary * dict) {
|
|
|
|
+ self.submit_btn.userInteractionEnabled = YES;
|
|
if ([dict[@"code"] intValue] == 0) {
|
|
if ([dict[@"code"] intValue] == 0) {
|
|
ShowMsg(@"上传照片成功!");
|
|
ShowMsg(@"上传照片成功!");
|
|
- [self getClassRoomInfo];
|
|
|
|
|
|
+ if(self.gotoType==1){//签退
|
|
|
|
+ if(self.cultivateInfo.isQrcodeQt){
|
|
|
|
+ [self QRCodeScanningdo];
|
|
|
|
+ }else{
|
|
|
|
+ [self gotoSignOutdo:self.cultivateInfo.qrcodeData];//签退
|
|
|
|
+ }
|
|
|
|
+ }else{
|
|
|
|
+ [self getClassRoomInfo];
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ if (!RQObjectIsNil(dict[@"msg"])) {
|
|
|
|
+ ShowMsg(dict[@"msg"]);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if (!RQObjectIsNil(dict[@"body"])) {
|
|
|
|
+ ShowMsg(dict[@"body"]);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }];
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+// 签到 签退
|
|
|
|
+- (void)gotoSignInOrsignOut{
|
|
|
|
+
|
|
|
|
+ self.gotoType = 0;
|
|
|
|
+ if(self.cultivateInfo){//已经有课堂-签退
|
|
|
|
+ self.gotoType = 1;
|
|
|
|
+ //定位功能
|
|
|
|
+ __weak typeof(self) weakSelf = self;
|
|
|
|
+ [MBProgressHUD rq_showProgressHUD:@"正在获取当前位置..."];
|
|
|
|
+ [[MapManager sharedManager] updateLocationWithCompleteBlock:^(BOOL success, CLLocation * _Nonnull location, BMKLocation * _Nullable bmkLocation) {
|
|
|
|
+ [MBProgressHUD rq_hideHUD];
|
|
|
|
+ if (success) {
|
|
|
|
+ _myLocation = location.coordinate;
|
|
|
|
+ //签退-距离提示
|
|
|
|
+ [weakSelf photoCoursedo:@"18"];
|
|
|
|
+ }
|
|
|
|
+ }];
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ [self createClassIdStr];
|
|
|
|
+ //弹出选择
|
|
|
|
+ if(self.viewModel.isSimulationRoom){
|
|
|
|
+ __weak typeof(self) weakSelf = self;
|
|
|
|
+ UIAlertController *alertFind = [UIAlertController alertControllerWithTitle:nil message:@"请选择训练科目" preferredStyle:UIAlertControllerStyleAlert];
|
|
|
|
+
|
|
|
|
+ [alertFind addAction:[UIAlertAction actionWithTitle:@"科二" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
|
|
|
|
+ weakSelf.viewModel.pxkm = @"2";
|
|
|
|
+ [weakSelf QRCodeScanningdo];
|
|
|
|
+ }]];
|
|
|
|
+ [alertFind addAction:[UIAlertAction actionWithTitle:@"科三" style:UIAlertActionStyleDefault handler:^(UIAlertAction * action) {
|
|
|
|
+ weakSelf.viewModel.pxkm = @"3";
|
|
|
|
+ [weakSelf QRCodeScanningdo];
|
|
|
|
+ }]];
|
|
|
|
+ [[RQ_SHARE_FUNCTION topViewController] presentViewController:alertFind animated:true completion:nil];
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+//扫码
|
|
|
|
+- (void)QRCodeScanningdo{
|
|
|
|
+ __weak typeof(self) weakSelf = self;
|
|
|
|
+ // 检查是否正在扫描,如果是,则直接返回
|
|
|
|
+ if (self.isScanning) {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ NSLog(@"点击了 扫码");
|
|
|
|
+ // 设置扫描状态为正在进行
|
|
|
|
+ self.isScanning = YES;
|
|
|
|
+ RQQRCodeViewController *vc = [[RQQRCodeViewController alloc] init];
|
|
|
|
+ vc.modalPresentationStyle = UIModalPresentationFullScreen;
|
|
|
|
+ [vc initBlock:^(NSString * _Nonnull result, BOOL isSuccess) {
|
|
|
|
+ if (isSuccess) {
|
|
|
|
+ NSLog(@"二维码扫码成功");
|
|
|
|
+ if(weakSelf.gotoType==1){
|
|
|
|
+ [weakSelf gotoSignOutdo:result];//签退
|
|
|
|
+ }else{
|
|
|
|
+ [weakSelf gotoSignIndo:result];//签到
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ weakSelf.isScanning = NO;
|
|
|
|
+ }
|
|
|
|
+ }];
|
|
|
|
+ [[RQ_SHARE_FUNCTION topViewController] presentViewController:vc
|
|
|
|
+ animated:YES
|
|
|
|
+ completion:nil];
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+//签到
|
|
|
|
+- (void)gotoSignIndo:(NSString *)qrcodeData {
|
|
|
|
+ NSLog(@"调用签到--gotoSignIndogotoSignIndogotoSignIndo==========");
|
|
|
|
+ self.viewModel.photoType = @"17";
|
|
|
|
+ NSString *classIdStr = self.viewModel.classIdStr;
|
|
|
|
+ NSString *type = self.viewModel.classType;
|
|
|
|
+ NSString *pxkm = self.viewModel.pxkm;
|
|
|
|
+ NSMutableArray *arr = [NSMutableArray array];
|
|
|
|
+ [arr property:RQ_USER_MANAGER.currentUser.outId forKey:@"stuId"];
|
|
|
|
+ [arr property:RQ_USER_MANAGER.currentUser.city forKey:@"dqbh"];
|
|
|
|
+ [arr property:type forKey:@"type"];//培训类型 2模拟
|
|
|
|
+ [arr property:classIdStr forKey:@"classid"];//课堂ID
|
|
|
|
+ [arr property:qrcodeData forKey:@"qrcodeData"];//二维码数据
|
|
|
|
+ [arr property:pxkm forKey:@"subject"];//模拟: 2科目二 3科目三
|
|
|
|
+ NSString* method = @"uploadStunocarSignIn";
|
|
|
|
+ [jiaPeiManager requestAnythingWithURL:method array:arr data:nil completion:^(NSDictionary * dict) {
|
|
|
|
+ self.isScanning = NO;
|
|
|
|
+ if ([dict[@"code"] intValue] == 0)
|
|
|
|
+ {
|
|
|
|
+ //签到成功
|
|
|
|
+ //直接-进入人脸-签到流程
|
|
|
|
+ [self beginCheckBodyHumanface];
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ [self getClassRoomInfo];//刷新一次
|
|
|
|
+ if (!RQObjectIsNil(dict[@"msg"])) {
|
|
|
|
+ ShowMsg(dict[@"msg"]);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if (!RQObjectIsNil(dict[@"body"])) {
|
|
|
|
+ ShowMsg(dict[@"body"]);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }];
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+//签退
|
|
|
|
+- (void)gotoSignOutdo:(NSString *)qrcodeData {
|
|
|
|
+ NSLog(@"调用签退--gotoSignOutdogotoSignOutdogotoSignOutdogotoSignOutdogotoSignOutdo==========");
|
|
|
|
+ __weak typeof(self) weakSelf = self;
|
|
|
|
+ NSString *classIdStr = self.viewModel.classIdStr;
|
|
|
|
+ NSString *type = self.viewModel.classType;
|
|
|
|
+ NSMutableArray *arr = [NSMutableArray array];
|
|
|
|
+ [arr property:RQ_USER_MANAGER.currentUser.outId forKey:@"stuId"];
|
|
|
|
+ [arr property:RQ_USER_MANAGER.currentUser.city forKey:@"dqbh"];
|
|
|
|
+ [arr property:type forKey:@"type"];//培训类型 2模拟
|
|
|
|
+ [arr property:classIdStr forKey:@"classid"];//课堂ID
|
|
|
|
+ [arr property:qrcodeData forKey:@"qrcodeData"];//二维码数据
|
|
|
|
+ NSString* method = @"uploadStunocarSignOut";
|
|
|
|
+ [jiaPeiManager requestAnythingWithURL:method array:arr data:nil completion:^(NSDictionary * dict) {
|
|
|
|
+ weakSelf.isScanning = NO;
|
|
|
|
+ if ([dict[@"code"] intValue] == 0)
|
|
|
|
+ {
|
|
|
|
+ //签退成功-获取课堂
|
|
|
|
+// [NYTools delateClassIdStr:RQ_USER_MANAGER.currentUser.outId];
|
|
|
|
+ ShowMsg(@"签退成功");
|
|
|
|
+ [weakSelf getClassRoomInfo];
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
@@ -330,4 +554,5 @@
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
@end
|
|
@end
|