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