Merge remote-tracking branch 'origin/main'
						commit
						dbfc4a3ec4
					
				|  | @ -537,6 +537,10 @@ U6Hzm1ninpWeE+awIDAQAB | |||
|   static Future<Map<String, dynamic>> getUserFace( | ||||
|     String imagePath, | ||||
|     String studentId, | ||||
|       String VIDEOCOURSEWARE_ID, | ||||
|       String CURRICULUM_ID, | ||||
|       String CHAPTER_ID, | ||||
|       String CLASS_ID, | ||||
|   ) async { | ||||
|     final file = File(imagePath); | ||||
|     if (!await file.exists()) { | ||||
|  | @ -551,6 +555,12 @@ U6Hzm1ninpWeE+awIDAQAB | |||
|         'USER_ID': SessionService.instance.loginUserId, | ||||
|         'STUDENT_ID': studentId, | ||||
|         'CORPINFO_ID': SessionService.instance.corpinfoId, | ||||
| 
 | ||||
|         "CLASS_ID":CLASS_ID, | ||||
|         "VIDEOCOURSEWARE_ID": VIDEOCOURSEWARE_ID, | ||||
|         "CURRICULUM_ID": CURRICULUM_ID, | ||||
|         "CHAPTER_ID": CHAPTER_ID, | ||||
| 
 | ||||
|         'FFILE': await MultipartFile.fromFile(file.path, filename: fileName), | ||||
|       }, | ||||
|     ); | ||||
|  |  | |||
|  | @ -109,14 +109,18 @@ class _ScanPageState extends State<ScanPage> { | |||
|   void goToFace(Map<String, dynamic> stuInfo) async { | ||||
|     print('navigate to face with $stuInfo'); | ||||
|     final passed = await pushPage<bool>( | ||||
|       FaceRecognitionPage(studentId: stuInfo['STUDENT_ID'], mode: FaceMode.auto), | ||||
|       FaceRecognitionPage(studentId: stuInfo['STUDENT_ID'], | ||||
|           VIDEOCOURSEWARE_ID: stuInfo['VIDEOCOURSEWARE_ID'],CURRICULUM_ID: stuInfo['CURRICULUM_ID'], | ||||
|           CHAPTER_ID: stuInfo['CHAPTER_ID'],CLASS_ID: stuInfo['CLASS_ID'], | ||||
|           mode: FaceMode.auto), | ||||
|       context, | ||||
|     ); | ||||
|     if (passed == true) { | ||||
|       ToastUtil.showSuccess(context, '验证成功'); | ||||
| 
 | ||||
|       Navigator.pop(context); | ||||
|     } else { | ||||
|       ToastUtil.showError(context, '验证失败'); | ||||
|       Navigator.pop(context); | ||||
|     } | ||||
|   } | ||||
| 
 | ||||
|  |  | |||
|  | @ -21,11 +21,23 @@ enum FaceMode { auto, manual } | |||
| 
 | ||||
| class FaceRecognitionPage extends StatefulWidget { | ||||
|   final String studentId; | ||||
| 
 | ||||
|   final String VIDEOCOURSEWARE_ID; | ||||
|   final String CURRICULUM_ID; | ||||
|   final String CHAPTER_ID; | ||||
|   final String CLASS_ID; | ||||
| 
 | ||||
|   final FaceMode mode; | ||||
| 
 | ||||
|   const FaceRecognitionPage({ | ||||
|     Key? key, | ||||
|     required this.studentId, | ||||
| 
 | ||||
|     required this.VIDEOCOURSEWARE_ID, | ||||
|     required this.CURRICULUM_ID, | ||||
|     required this.CHAPTER_ID, | ||||
|     required this.CLASS_ID, | ||||
| 
 | ||||
|     this.mode = FaceMode.auto, | ||||
|   }) : super(key: key); | ||||
| 
 | ||||
|  | @ -259,7 +271,8 @@ class _FaceRecognitionPageState extends State<FaceRecognitionPage> | |||
|       } catch (_) {} | ||||
| 
 | ||||
|       final XFile pic = await _cameraController!.takePicture(); | ||||
|       final res = await ApiService.getUserFace(pic.path, widget.studentId); | ||||
|       final res = await ApiService.getUserFace(pic.path, widget.studentId, | ||||
|         widget.VIDEOCOURSEWARE_ID,widget.CURRICULUM_ID,widget.CHAPTER_ID,widget.CLASS_ID,); | ||||
| 
 | ||||
|       if (res['result'] == 'success') { | ||||
|         _onSuccess(); | ||||
|  |  | |||
|  | @ -46,7 +46,7 @@ class _StudyClassListPageState extends State<StudyClassListPage> { | |||
|     final result = await ApiService.getVideoPermissions(); | ||||
|     if (result['result'] == 'success') { | ||||
|       SessionService.instance.setStudyToken(result['token'] ?? ''); | ||||
|       pushPage(StudyDetailPage(item, widget.studyData['STUDENT_ID']), context); | ||||
|       pushPage(StudyDetailPage(item, widget.studyData['STUDENT_ID'],widget.studyData), context); | ||||
|     } | ||||
|   } | ||||
|   @override | ||||
|  |  | |||
|  | @ -25,8 +25,9 @@ enum TakeExamType { video_study, strengththen, list } | |||
| class StudyDetailPage extends StatefulWidget { | ||||
|   final Map studyDetailDetail; | ||||
|   final String studentId; | ||||
|   final Map studyData; | ||||
| 
 | ||||
|   const StudyDetailPage(this.studyDetailDetail, this.studentId, {super.key}); | ||||
|   const StudyDetailPage(this.studyDetailDetail, this.studentId, this.studyData,{super.key}); | ||||
| 
 | ||||
|   @override | ||||
|   State<StudyDetailPage> createState() => _StudyDetailPageState(); | ||||
|  | @ -284,7 +285,10 @@ class _StudyDetailPageState extends State<StudyDetailPage> | |||
|         await _exitTopRouteAndWait(); | ||||
|         await _lockPortrait(); | ||||
|         final passed = await pushPage<bool>( | ||||
|           FaceRecognitionPage(studentId: widget.studentId, mode: FaceMode.auto), | ||||
|           FaceRecognitionPage(studentId: widget.studentId, | ||||
|               VIDEOCOURSEWARE_ID:"",CURRICULUM_ID:"", | ||||
|               CHAPTER_ID: "",CLASS_ID: "", | ||||
|               mode: FaceMode.auto), | ||||
|           context, | ||||
|         ); | ||||
|         await _restoreDefaultOrientations(); | ||||
|  | @ -307,7 +311,10 @@ class _StudyDetailPageState extends State<StudyDetailPage> | |||
|           await _exitTopRouteAndWait(); | ||||
|           await _lockPortrait(); | ||||
|           await pushPage( | ||||
|             const FaceRecognitionPage(studentId: '', mode: FaceMode.manual), | ||||
|             const FaceRecognitionPage(studentId: '', | ||||
|                 VIDEOCOURSEWARE_ID: '',CURRICULUM_ID: '', | ||||
|                 CHAPTER_ID: '',CLASS_ID: '', | ||||
|                 mode: FaceMode.manual), | ||||
|             context, | ||||
|           ); | ||||
|           await _restoreDefaultOrientations(); | ||||
|  | @ -718,7 +725,10 @@ class _StudyDetailPageState extends State<StudyDetailPage> | |||
|     await _lockPortrait(); | ||||
| 
 | ||||
|     final passed = await pushPage<bool>( | ||||
|       FaceRecognitionPage(studentId: widget.studentId, mode: FaceMode.auto), | ||||
|       FaceRecognitionPage(studentId: widget.studentId, | ||||
|           VIDEOCOURSEWARE_ID: "",CURRICULUM_ID: "", | ||||
|           CHAPTER_ID: "",CLASS_ID: "", | ||||
|           mode: FaceMode.auto), | ||||
|       context, | ||||
|     ); | ||||
| 
 | ||||
|  |  | |||
|  | @ -68,7 +68,10 @@ class _MineSetPageState extends State<MineSetPage> { | |||
|             child: _setItemWidget("更新人脸信息"), | ||||
|             onTap: () { | ||||
|               pushPage( | ||||
|                 const FaceRecognitionPage(studentId: '', mode: FaceMode.manual), | ||||
|                 const FaceRecognitionPage(studentId: '', | ||||
|                     VIDEOCOURSEWARE_ID: '',CURRICULUM_ID: '', | ||||
|                     CHAPTER_ID: '',CLASS_ID: '', | ||||
|                     mode: FaceMode.manual), | ||||
|                 context, | ||||
|               ); | ||||
|             }, | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue