feat: 1. [我的]菜单,添加人脸认证的人脸录制的操作入口

2. 调试入班二维码进入,根据 classId 的条件进行逻辑提示进入
3. 调试考试二维码进入,根据 classId 的条件进行逻辑提示进入
4. 签到信息页面内, 字段校对
5. 入班人脸识别接口逻辑和考试人脸识别接口逻辑的调试
xgf-training-dev
mengfanliang 2025-02-21 18:08:09 +08:00
parent 661458ac6c
commit 7c245ffe68
12 changed files with 599 additions and 501 deletions

View File

@ -74,7 +74,14 @@ export const getHistoricalApprovalRecords = (params) => post('/app/Task/getHis',
export const getIsUploadFace = (params) => post('/app/user/getUserFace', params) // 获取是否上传人脸信息 export const getIsUploadFace = (params) => post('/app/user/getUserFace', params) // 获取是否上传人脸信息
export const getClassList = (params) => post('/app/stagestudentrelation/pageTaskByUser', params) //获取班级列表 export const getClassList = (params) => post('/app/stagestudentrelation/pageTaskByUser', params) //获取班级列表
export const joinClass = (params) => uploads('/app/student/joinClass', params) // 实名认证信息提交 export const joinClass = (params) => uploads('/app/student/joinClass', params) // 实名认证信息提交
export const getTaskScoreInfo = (params) => post('/app/stageexam/findResult', params) // 考试成绩详情 export const getSignInfo = (params) => post('/app/student/signinfo', params) // 获取签到信息
export const getTaskScoreInfo = (params) => post('/app/stageexam/findResult', params) // 考试成绩记录详情
export const getExamExercises = (params) => post('/app/stageexam/getExam', params) // 考试习题 export const getExamExercises = (params) => post('/app/stageexam/getExam', params) // 考试习题
export const setTestPaperSubmission = (params) => post('/app/stageexam/submit', params) // 考试交卷 export const setTestPaperSubmission = (params) => post('/app/stageexam/submit', params) // 考试交卷
export const submitEditUserFace = (params) => post('/app/user/editUserFace', params) // 提交照片人脸
export const submitEditUserVideoFace = (params) => post('/app/user/editUserVideoFace', params) // 提交视频人脸
export const compareUserFaceCertify = (params) => post('/app/user/compareFace', params) // 照片人脸认证
export const compareUserVideoFaceCertify = (params) => post('/app/user/compareVideoFace', params) // 视频人脸验证
export const compareUserExamFaceCertify = (params) => post('/app/user/compareExamFace', params) // 考试照片人脸认证
export const compareUserExamVideoFaceCertify = (params) => post('/app/user/compareExamVideoFace', params) // 考试视频人脸认证
// ********************* end *********************** // ********************* end ***********************

View File

@ -26,20 +26,27 @@
</view> </view>
</view> </view>
</view> </view>
<u-modal :show="updateVersion.modalShow" title="温馨提示" :showConfirmButton="updateVersion.showConfirmButton" <u-modal
:showCancelButton="updateVersion.showCancelButton" :confirmText="updateVersion.confirmText" :show="updateVersion.modalShow"
title="温馨提示"
:showConfirmButton="updateVersion.showConfirmButton"
:showCancelButton="updateVersion.showCancelButton"
:confirmText="updateVersion.confirmText"
:cancelText="updateVersion.cancelText" :cancelText="updateVersion.cancelText"
@cancel="modalCancel" @confirm="modalConfirm"> @cancel="modalCancel"
@confirm="modalConfirm"
>
<view style="text-align: center; color: #606266"> <view style="text-align: center; color: #606266">
<rich-text :nodes="updateVersion.modalContent"></rich-text> <rich-text :nodes="updateVersion.modalContent"></rich-text>
</view> </view>
</u-modal> </u-modal>
</view> </view>
</template> </template>
<script> <script>
import updateVersion from "../../utils/updateVersion"; import updateVersion from '../../utils/updateVersion'
import {setEntry} from "../../api"; import { setEntry, getIsUploadFace } from '../../api'
export default { export default {
mixins: [updateVersion], mixins: [updateVersion],
@ -80,8 +87,8 @@ export default {
img: require('../../static/icon-apps/app_icons8.png'), img: require('../../static/icon-apps/app_icons8.png'),
title: '培训管理', title: '培训管理',
url: '/pages/train_management/index' url: '/pages/train_management/index'
}, }
], ]
} }
}, },
computed: { computed: {
@ -91,6 +98,7 @@ export default {
}, },
onLoad() { onLoad() {
this.fnUpdateVersion(false) this.fnUpdateVersion(false)
this.getUserFaceCompleted()
}, },
methods: { methods: {
async fnScan() { async fnScan() {
@ -103,13 +111,12 @@ export default {
USER_ID: this.userInfo.USER_ID, USER_ID: this.userInfo.USER_ID,
CORPINFO_ID: obj[0].CORPINFO_ID, CORPINFO_ID: obj[0].CORPINFO_ID,
RELEVANT_UNIT_NAME: obj[0].RELEVANT_UNIT_NAME RELEVANT_UNIT_NAME: obj[0].RELEVANT_UNIT_NAME
}); })
if (info.code === 200) { if (info.code === 200) {
uni.$u.toast('入职成功') uni.$u.toast('入职成功')
} else { } else {
uni.$u.toast('入职失败,请联系管理员') uni.$u.toast('入职失败,请联系管理员')
} }
} else if (type === '1') { } else if (type === '1') {
// type=1 // type=1
uni.$u.route({ uni.$u.route({
@ -121,7 +128,7 @@ export default {
}) })
} }
} }
}); })
}, },
fnIsShow(index) { fnIsShow(index) {
if (index === 5) return !!this.userInfo.CORPINFO_ID if (index === 5) return !!this.userInfo.CORPINFO_ID
@ -132,7 +139,36 @@ export default {
url: this.baseList[e].url url: this.baseList[e].url
}) })
}, },
}, /**
* 获取是否已经完成上传人脸信息
*/
async getUserFaceCompleted() {
const userFaceData = await getIsUploadFace()
// userFaceData.authentication --> 0:
// userFaceData.authentication --> 1:
this.$store.dispatch('setVerification', userFaceData.authentication ? userFaceData.authentication : "0"); //
const isPassedVerification = userFaceData.authentication === '0'
if (isPassedVerification) {
uni.showModal({
title: '温馨提示',
content: '为了能够得到更好的体验,我们会获取您个人信息,请完成人脸信息认证!',
success: function (res) {
if (res.confirm) {
uni.$u.route({
url: '/pages/train_management/face_authentication',
params: {
type: 'facial_input'
}
})
}
if (res.cancel) {
uni.$u.toast("您可进入[我的]-[人脸认证]完成信息认证")
}
}
})
}
}
}
} }
</script> </script>

View File

@ -64,6 +64,11 @@ export default {
name: '个人信息', name: '个人信息',
url: '/pages/mine/information/index' url: '/pages/mine/information/index'
}, },
{
img: require('../../../static/images/my_ico2.png'),
name: '人脸认证',
url: '/pages/train_management/face_authentication?type=update_facial_input'
},
{ {
img: require('../../../static/images/my_ico3.png'), img: require('../../../static/images/my_ico3.png'),
name: '问题反馈', name: '问题反馈',

View File

@ -18,19 +18,19 @@
</text> </text>
</view> </view>
<view v-show="options[current].QUESTIONTYPE === '1'" class="options"> <view v-show="options[current].QUESTIONTYPE === '1'" class="options">
<view class="item" :class="{ active: options[current].checked === 'A' }" @click="fnChooseTopic('radio', 'A')"> <view class="item" :class="{ 'active': options[current].checked === 'A' }" @click="fnChooseTopic('radio', 'A')">
<text class="option">A</text> <text class="option">A</text>
<text class="text">{{ options[current].OPTIONA }}</text> <text class="text">{{ options[current].OPTIONA }}</text>
</view> </view>
<view class="item" :class="{ active: options[current].checked === 'B' }" @click="fnChooseTopic('radio', 'B')"> <view class="item" :class="{ 'active': options[current].checked === 'B' }" @click="fnChooseTopic('radio', 'B')">
<text class="option">B</text> <text class="option">B</text>
<text class="text">{{ options[current].OPTIONB }}</text> <text class="text">{{ options[current].OPTIONB }}</text>
</view> </view>
<view class="item" :class="{ active: options[current].checked === 'C' }" @click="fnChooseTopic('radio', 'C')"> <view class="item" :class="{ 'active': options[current].checked === 'C' }" @click="fnChooseTopic('radio', 'C')">
<text class="option">C</text> <text class="option">C</text>
<text class="text">{{ options[current].OPTIONC }}</text> <text class="text">{{ options[current].OPTIONC }}</text>
</view> </view>
<view class="item" :class="{ active: options[current].checked === 'D' }" @click="fnChooseTopic('radio', 'D')"> <view class="item" :class="{ 'active': options[current].checked === 'D' }" @click="fnChooseTopic('radio', 'D')">
<text class="option">D</text> <text class="option">D</text>
<text class="text">{{ options[current].OPTIOND }}</text> <text class="text">{{ options[current].OPTIOND }}</text>
</view> </view>
@ -39,7 +39,7 @@
<view <view
class="item" class="item"
:class="{ :class="{
active: options[current].checked && options[current].checked.indexOf('A') !== -1 'active': options[current].checked && options[current].checked.indexOf('A') !== -1
}" }"
@click="fnChooseTopic('multiple', 'A')" @click="fnChooseTopic('multiple', 'A')"
> >
@ -49,7 +49,7 @@
<view <view
class="item" class="item"
:class="{ :class="{
active: options[current].checked && options[current].checked.indexOf('B') !== -1 'active': options[current].checked && options[current].checked.indexOf('B') !== -1
}" }"
@click="fnChooseTopic('multiple', 'B')" @click="fnChooseTopic('multiple', 'B')"
> >
@ -59,7 +59,7 @@
<view <view
class="item" class="item"
:class="{ :class="{
active: options[current].checked && options[current].checked.indexOf('C') !== -1 'active': options[current].checked && options[current].checked.indexOf('C') !== -1
}" }"
@click="fnChooseTopic('multiple', 'C')" @click="fnChooseTopic('multiple', 'C')"
> >
@ -69,7 +69,7 @@
<view <view
class="item" class="item"
:class="{ :class="{
active: options[current].checked && options[current].checked.indexOf('D') !== -1 'active': options[current].checked && options[current].checked.indexOf('D') !== -1
}" }"
@click="fnChooseTopic('multiple', 'D')" @click="fnChooseTopic('multiple', 'D')"
> >
@ -78,11 +78,11 @@
</view> </view>
</view> </view>
<view v-show="options[current].QUESTIONTYPE === '3'" class="options"> <view v-show="options[current].QUESTIONTYPE === '3'" class="options">
<view class="item" :class="{ active: options[current].checked === 'A' }" @click="fnChooseTopic('judge', 'A')"> <view class="item" :class="{ 'active': options[current].checked === 'A' }" @click="fnChooseTopic('judge', 'A')">
<text class="option">{{ options[current].OPTIONA }}</text> <text class="option">{{ options[current].OPTIONA }}</text>
<text class="text"></text> <text class="text"></text>
</view> </view>
<view class="item" :class="{ active: options[current].checked === 'B' }" @click="fnChooseTopic('judge', 'B')"> <view class="item" :class="{ 'active': options[current].checked === 'B' }" @click="fnChooseTopic('judge', 'B')">
<text class="option">{{ options[current].OPTIONB }}</text> <text class="option">{{ options[current].OPTIONB }}</text>
<text class="text"></text> <text class="text"></text>
</view> </view>
@ -108,7 +108,7 @@ import {
getExamExercises, getExamExercises,
// getStrengthenExam, // getStrengthenExam,
setTestPaperSubmission, setTestPaperSubmission,
} from '../../api' } from '@/api';
export default { export default {
data() { data() {
@ -133,7 +133,6 @@ export default {
} }
}, },
onLoad(query) { onLoad(query) {
console.log('query :>> ', query);
this.routeQuery = query this.routeQuery = query
// this.STAGEEXAMPAPER_ID = query.STAGEEXAMPAPER_ID; // this.STAGEEXAMPAPER_ID = query.STAGEEXAMPAPER_ID;
// this.entrySite = query.entrySite; // this.entrySite = query.entrySite;

View File

@ -17,8 +17,7 @@
</view> </view>
<view class="counter"> <view class="counter">
当前试题: <text style="color: orange">{{ current + 1 }}</text 当前试题: <text style="color: orange">{{ current + 1 }}</text>/{{ questionList.length }}
>/{{ questionList.length }}
</view> </view>
<view class="topic"> <view class="topic">
@ -92,7 +91,7 @@
</template> </template>
<script> <script>
import { getTaskScoreInfo } from "../../api"; import { getTaskScoreInfo } from "@/api";
export default { export default {
data() { data() {
@ -125,7 +124,7 @@ export default {
// stagestudentrelationId, // stagestudentrelationId,
// classId // classId
// }) // })
// console.log('resData :>> ', resData); // this.questionList = resData.list
this.questionList = [ this.questionList = [
{ {
stageexamrecordId: '7cea826c3c974cb69028dd0624b632ba', stageexamrecordId: '7cea826c3c974cb69028dd0624b632ba',

View File

@ -4,27 +4,8 @@
<text class="fatt">请将人脸置于圆圈内</text> <text class="fatt">请将人脸置于圆圈内</text>
</view> </view>
<view class="livefater"> <view class="livefater">
<view <view style="width: 700upx; height: 700upx; border-radius: 700upx; overflow: hidden">
style=" <live-pusher id="livePusher" ref="livePusher" class="livePusher" url="" mode="SD" :muted="true" :enable-camera="true" :auto-focus="true" :beauty="1" whiteness="2" aspect="1:1" />
width: 700upx;
height: 700upx;
border-radius: 700upx;
overflow: hidden;
"
>
<live-pusher
id="livePusher"
ref="livePusher"
class="livePusher"
url=""
mode="SD"
:muted="true"
:enable-camera="true"
:auto-focus="true"
:beauty="1"
whiteness="2"
aspect="1:1"
/>
</view> </view>
<cover-image src="/static/images/gaiz.png" class="gaiimg"></cover-image> <cover-image src="/static/images/gaiz.png" class="gaiimg"></cover-image>
</view> </view>
@ -37,73 +18,75 @@
<script> <script>
// import {setMeetingFace, setScanCodeToVerifyFace, setUserFace, setVerifyFace} from "@/api"; // import {setMeetingFace, setScanCodeToVerifyFace, setUserFace, setVerifyFace} from "@/api";
import { submitEditUserFace, compareUserFaceCertify, compareUserExamFaceCertify } from '@/api';
export default { export default {
data() { data() {
return { return {
startPreviewTimer: null, // 开始预览计时器实例 startPreviewTimer: null, // 开始预览计时器实例
isFirst: "", // 是否为第一次开启摄像头 isFirst: '', // 是否为第一次开启摄像头
type: "", // 摄像头使用类别 type: '', // 摄像头使用类别
// showButton: "yes", // showButton: "yes",
routeQueryparams: {}, // 额外携带的参数 routeQueryparams: {}, // 额外携带的参数
btnTextStr: "拍照" btnTextStr: '拍照'
}; }
}, },
onReady() { onReady() {
this.context = uni.createLivePusherContext("livePusher", this); this.context = uni.createLivePusherContext('livePusher', this)
this.startPreviewTimer = setInterval(() => { this.startPreviewTimer = setInterval(() => {
this.startPreview(); this.startPreview()
}, 1000); }, 1000)
}, },
onLoad(query) { onLoad(query) {
// facial_input 更新人脸 isFirst 1 第一次登录添加人脸 // facial_input 人脸认证 isFirst 1 第一次登录添加人脸
// scan_face 扫码 // scan_face 扫码
// update_facial_input 更新人脸
// learning_certification 学习认证 // learning_certification 学习认证
// meeting_attendance 会议签到 // meeting_attendance 会议签到
const typeKey = ["facial_input", "scan_face", "learning_certification"]; const typeKey = ['facial_input', 'scan_face', 'learning_certification', 'update_facial_input']
if (!typeKey.includes(query.type)) { if (!typeKey.includes(query.type)) {
uni.$u.toast("type参数错误"); uni.$u.toast('type参数错误')
return; return
} }
this.isFirst = query.isFirst || ""; this.isFirst = query.isFirst || ''
if (query.type === "facial_input") this.btnTextStr = "人脸认证"; if (query.type === 'facial_input' || 'update_facial_input') this.btnTextStr = '人脸认证'
if (query.type === "scan_face") this.btnTextStr = "签到"; if (query.type === 'scan_face') this.btnTextStr = '签到'
if (query.type === "learning_certification") this.btnTextStr = "开始考试"; if (query.type === 'learning_certification') this.btnTextStr = '开始考试'
this.type = query.type; this.type = query.type
// this.showButton = query.showButton || "yes"; // this.showButton = query.showButton || "yes";
this.routeQueryparams = query ?? {}; this.routeQueryparams = query ?? {}
}, },
onBackPress(event) { onBackPress(event) {
if (event.from === "backbutton") { if (event.from === 'backbutton') {
if (this.type === "facial_input" || if ((this.type === 'scan_face' && this.isFirst === '1') || this.type === 'learning_certification' || this.type === 'facial_input') {
(this.type === "scan_face" && this.isFirst === "1") || uni.$u.toast('请完成人脸验证')
this.type === "learning_certification" return true
) {
uni.$u.toast("请完成人脸验证");
return true;
} }
} }
return false; return false
},
onUnload() {
this.startPreviewTimer && clearInterval(this.startPreviewTimer)
}, },
methods: { methods: {
snapshot() { snapshot() {
uni.showLoading({ uni.showLoading({
title: "加载中", title: '加载中'
}); })
this.context.snapshot({ this.context.snapshot({
success: (e) => { success: (e) => {
this.getMinImage(e.message.tempImagePath); this.getMinImage(e.message.tempImagePath)
}, }
}); })
}, },
startPreview() { startPreview() {
this.context.stopPreview(); this.context.stopPreview()
this.context.startPreview({ this.context.startPreview({
success: () => { success: () => {
this.startPreviewTimer && clearInterval(this.startPreviewTimer); this.startPreviewTimer && clearInterval(this.startPreviewTimer)
// this.showButton === "no" && this.snapshot(); // this.showButton === "no" && this.snapshot();
}, }
}); })
}, },
getMinImage(imgPath) { getMinImage(imgPath) {
plus.zip.compressImage( plus.zip.compressImage(
@ -115,66 +98,81 @@ export default {
}, },
(zipRes) => { (zipRes) => {
setTimeout(() => { setTimeout(() => {
const reader = new plus.io.FileReader(); const reader = new plus.io.FileReader()
reader.onloadend = async (res) => { reader.onloadend = async (res) => {
const speech = res.target.result; const speech = res.target.result
// 获取 base 64 图片编码的前缀 // 获取 base 64 图片编码的前缀
const USERAVATARPREFIX = speech.substring( const USERAVATARPREFIX = speech.substring(0, speech.indexOf('base64,') + 7)
0,
speech.indexOf("base64,") + 7,
);
// 获取 base 64 图片的二进制到文本 // 获取 base 64 图片的二进制到文本
const USERAVATARURL = speech.substring( const USERAVATARURL = speech.substring(speech.indexOf('base64,') + 7)
speech.indexOf("base64,") + 7,
);
try { try {
if (this.type === "facial_input") { const otherParams = {
uni.$u.toast("人脸认证成功"); ...this.routeQueryparams
uni.navigateBack({ delta: 1 }); }
} else if (this.type === "scan_face") { delete otherParams.type
// await setScanCodeToVerifyFace({ if (this.type === 'facial_input' || this.type === 'update_facial_input') {
// USERAVATARPREFIX, await submitEditUserFace({
// USERAVATARURL, ...otherParams,
// ...this.params, USERAVATARPREFIX,
// }); USERAVATARURL
uni.$u.toast("认证成功"); })
uni.navigateBack({ delta: 2 }); await this.$store.dispatch('setVerification', '1')
} else if (this.type === "learning_certification") { uni.$u.toast('人脸信息认证成功')
// await setVerifyFace({ setTimeout(() => {
// USERAVATARPREFIX, uni.navigateBack({
// USERAVATARURL, delta: 1
// ...this.params, })
// }); }, 1000)
// await this.$store.dispatch("setVerification", true); } else if (this.type === 'scan_face') {
uni.$u.toast("认证成功"); await compareUserFaceCertify({
// uni.navigateBack(); ...otherParams,
USERAVATARPREFIX,
USERAVATARURL
})
uni.$u.toast('人脸认证成功')
setTimeout(() => {
uni.navigateBack({
delta: 2
})
}, 1000)
} else if (this.type === 'learning_certification') {
const res = await compareUserExamFaceCertify({
...otherParams,
USERAVATARPREFIX,
USERAVATARURL
})
await uni.$u.toast('人脸认证成功, 请进入考试答题')
setTimeout(() => {
uni.$u.route({ uni.$u.route({
url: '/pages/train_management/course_exam', url: '/pages/train_management/course_exam',
params: { ...this.routeQueryparams } params: {
...this.routeQueryparams
}
}) })
}, 1000)
} }
} catch (e) { } catch (e) {
console.log('扫描人脸过程中捕获的错误 :>>> ', e)
if (e && e.msg) { if (e && e.msg) {
uni.$u.toast(e.msg,); uni.$u.toast(e.msg)
} }
// this.showButton === "no" && this.snapshot(); // this.showButton === "no" && this.snapshot();
} }
}; }
reader.readAsDataURL( reader.readAsDataURL(plus.io.convertLocalFileSystemURL(zipRes.target))
plus.io.convertLocalFileSystemURL(zipRes.target), }, 4000)
); }
}, 4000); )
}, }
); }
}, }
},
};
</script> </script>
<style scoped> <style scoped>
.container { .container {
background-color: #fff; background-color: #fff;
} }
.livePusher { .livePusher {
width: 700upx; width: 700upx;
height: 700upx; height: 700upx;

View File

@ -45,11 +45,13 @@
</template> </template>
<script> <script>
import { getClassList, getIsUploadFace } from '../../api' import { getClassList, getIsUploadFace } from '@/api';
import store from '@/store/index';
export default { export default {
data() { data() {
return { return {
verification: store.state.verification, //
pageSize: 10, pageSize: 10,
currentPage: 1, currentPage: 1,
totalPage: 0, totalPage: 0,
@ -65,27 +67,32 @@ export default {
/* 监听页面显示,页面每次出现在屏幕上都触发,包括从下级页面点返回露出当前页面 */ /* 监听页面显示,页面每次出现在屏幕上都触发,包括从下级页面点返回露出当前页面 */
onShow() { onShow() {
this.resetList() // this.resetList();
}, },
async onLoad(query) { async onLoad(query) {
await this.getUserFaceCompleted() await this.getUserFaceCompleted()
await this.resetList()
}, },
methods: { methods: {
async resetList() {
this.pageSize = 10
this.currentPage = 1
this.trainList = []
await this.getData()
},
async getData() { async getData() {
// verification --> 0:
// verification --> 1:
if (this.verification === '1') {
let resData = await getClassList({ let resData = await getClassList({
showCount: this.pageSize, showCount: this.pageSize,
currentPage: this.currentPage currentPage: this.currentPage
}) })
this.trainList = [...this.trainList, ...resData.page.list] this.trainList = [...this.trainList, ...resData.page.list]
this.totalPage = resData.page.totalPage this.totalPage = resData.page.totalPage
}, }
resetList() {
this.pageSize = 10
this.currentPage = 1
this.trainList = []
this.getData()
}, },
scrolltolower() { scrolltolower() {
this.currentPage++ this.currentPage++
@ -100,10 +107,12 @@ export default {
// scanType: ['qrCode'], // // scanType: ['qrCode'], //
onlyFromCamera: false, // onlyFromCamera: false, //
hideAlbum: false, // , hideAlbum: false, // ,
success: function (response) { success: (response) => {
const { stageexampaperinputId, classId, postId, studentId, numberofexams, type } = JSON.parse(response.result) const { stageexampaperinputId, classId, postId, studentId, numberofexams, type } = JSON.parse(response.result)
const findClassId = this.trainList.some((item) => item.classId === classId)
if (type === '0') { if (type === '0') {
// //
if (findClassId) {
uni.$u.route({ uni.$u.route({
url: '/pages/train_management/realname_info_auth', url: '/pages/train_management/realname_info_auth',
params: { params: {
@ -111,8 +120,12 @@ export default {
classId classId
} }
}) })
} else {
uni.$u.toast('您未在培训计划内,无法入班签到,请联系教师')
}
} else if (type === '1') { } else if (type === '1') {
// //
if (findClassId) {
uni.$u.route({ uni.$u.route({
url: '/pages/train_management/face_authentication', url: '/pages/train_management/face_authentication',
params: { params: {
@ -124,6 +137,9 @@ export default {
numberofexams numberofexams
} }
}) })
} else {
uni.$u.toast('您未在培训计划内,无法进行考试,请联系教师')
}
} }
}, },
fail: function (error) { fail: function (error) {
@ -138,9 +154,10 @@ export default {
* 获取是否已经完成上传人脸信息 * 获取是否已经完成上传人脸信息
*/ */
async getUserFaceCompleted() { async getUserFaceCompleted() {
const userFaceData = await getIsUploadFace() // const userFaceData = await getIsUploadFace()
console.log('userFaceData :>> ', userFaceData) // verification --> 0:
if (!userFaceData?.data) { // verification --> 1:
if (this.verification === '0') {
uni.showModal({ uni.showModal({
title: '温馨提示', title: '温馨提示',
content: '检测到您还未完成人脸信息读取,请先完成人脸信息认证!', content: '检测到您还未完成人脸信息读取,请先完成人脸信息认证!',

View File

@ -68,7 +68,7 @@
</template> </template>
<script> <script>
import { getDataDictionary, joinClass } from '../../api' import { getDataDictionary, joinClass } from '@/api';
import Sign from '@/components/sign/sign.vue' import Sign from '@/components/sign/sign.vue'
import { validateFieldPhone, validateFieldIdCard } from '@/utils/formValidateField.js' import { validateFieldPhone, validateFieldIdCard } from '@/utils/formValidateField.js'

View File

@ -5,12 +5,7 @@
<view class="sign_item"> <view class="sign_item">
<view class="sign_item_avatar"> <view class="sign_item_avatar">
<!-- 用来给图片资源添加前置的统一的访问路径头部: $filePath, 这个将会用在下面的 u-image 组件中的 src 属性中, 示例为: src="$filePath + item.FILEPATH" --> <!-- 用来给图片资源添加前置的统一的访问路径头部: $filePath, 这个将会用在下面的 u-image 组件中的 src 属性中, 示例为: src="$filePath + item.FILEPATH" -->
<u-image <u-image width="200rpx" height="200rpx" model="widthFix" :src="item.useravatarurl" />
width="200rpx"
height="200rpx"
model="widthFix"
:src="item.FILEPATH"
/>
</view> </view>
<view class="info_body"> <view class="info_body">
<view class="info_name"> <view class="info_name">
@ -18,19 +13,23 @@
</view> </view>
<view class="info_raw"> <view class="info_raw">
<text class="content_label">班级名称: </text> <text class="content_label">班级名称: </text>
<text class="content_value">{{ item.className }}</text> <text class="content_value">{{ item.name }}</text>
</view> </view>
<view class="info_raw"> <view class="info_raw">
<text class="content_label">签到时间: </text> <text class="content_label">签到时间: </text>
<text class="content_value">{{ item.signTime }}</text> <text class="content_value">{{ item.studyStartTime }}</text>
</view> </view>
<view class="info_raw"> <view class="info_raw">
<text class="content_label">培训地点: </text> <text class="content_label">培训地点: </text>
<text class="content_value">{{ item.train }}</text> <text class="content_value">{{ item.trainingLocation }}</text>
</view> </view>
<view class="info_raw flex_layout"> <view class="info_raw flex_layout">
<text class="content_label">签到状态: </text> <text class="content_label">签到状态: </text>
<text class="tag_flag">{{ handleCalcSignStatus(item.trainStatus) }}</text> <text class="tag" :class="studyStateMap[item.studystate].color">{{ studyStateMap[item.studystate].value }}</text>
</view>
<view class="info_raw flex_layout">
<text class="content_label">考试状态: </text>
<text class="tag" :class="stageexamStateMap[item.stageexamstate].color">{{ stageexamStateMap[item.stageexamstate].value }}</text>
</view> </view>
</view> </view>
</view> </view>
@ -40,17 +39,42 @@
</template> </template>
<script> <script>
import { getSignInfo } from '@/api'
export default { export default {
data() { data() {
return { return {
routeQuery: {},
pageSize: 10, pageSize: 10,
currentPage: 1, currentPage: 1,
totalPage: 0, totalPage: 0,
signList: [], signList: [],
signStatusMap: { //
0: '认证签到', studyStateMap: {
1: '考试签到' '0': {
value: '未签到',
color: 'tag__red'
},
'1': {
value: '已签到',
color: 'tag__green'
} }
},
//
stageexamStateMap: {
'0': {
value: '无需考试',
color: 'tag__orange'
},
'1': {
value: '未签到',
color: 'tag__red'
},
'5': {
value: '已签到',
color: 'tag__green'
},
},
} }
}, },
@ -58,31 +82,30 @@ export default {
this.resetList() this.resetList()
}, },
onLoad(query) {
this.routeQuery = query
},
methods: { methods: {
async getData() { async getData() {
// let resData = await getCertificateInformationList({ const { classId } = this.routeQuery
// let resData = await getSignInfo({
// showCount: this.pageSize, // showCount: this.pageSize,
// currentPage: this.currentPage, // currentPage: this.currentPage,
// classId
// }); // });
// this.signList = [...this.signList, ...resData.page.list]
// this.totalPage = resData.page.totalPage
this.signList = [ this.signList = [
{ {
userName: '齐天大圣1', userName: '齐天大圣1',
FILEPATH: useravatarurl: 'https://img.alicdn.com/img/i1/131787161/O1CN01z67Qvv22lnCzgPob4_!!0-saturn_solar.jpg_.webp',
'https://img.alicdn.com/img/i1/131787161/O1CN01z67Qvv22lnCzgPob4_!!0-saturn_solar.jpg_.webp', name: '班级名称1班级名称1班级名称1班级名称1',
className: '班级名称1班级名称1班级名称1班级名称1', studyStartTime: '2025-02-11 09:40',
signTime: '2025-02-11 09:40', trainingLocation: '教三大教室',
train: '教三大教室', studystate: '0',
trainStatus: 0 // stageexamstate: '0'
}, },
{
userName: '齐天大圣2',
FILEPATH:
'https://img.alicdn.com/img/i1/131787161/O1CN01z67Qvv22lnCzgPob4_!!0-saturn_solar.jpg_.webp',
className: '班级名称2',
signTime: '2025-02-14 18:00',
train: '教一大教室',
trainStatus: 1 //
}
] ]
this.totalPage = 2 this.totalPage = 2
}, },
@ -95,9 +118,6 @@ export default {
scrolltolower() { scrolltolower() {
this.currentPage++ this.currentPage++
if (this.totalPage >= this.currentPage) this.getData() if (this.totalPage >= this.currentPage) this.getData()
},
handleCalcSignStatus(type) {
return this.signStatusMap[type]
} }
} }
} }
@ -137,8 +157,6 @@ export default {
.content_value { .content_value {
display: inline-block; display: inline-block;
vertical-align: bottom; vertical-align: bottom;
line-height: 1.2;
transform: translateY(8rpx);
padding: 0; padding: 0;
width: 300rpx; width: 300rpx;
overflow: hidden; overflow: hidden;
@ -147,16 +165,26 @@ export default {
} }
} }
.tag_flag { .tag {
background: #5ac725;
color: #fff;
padding: 2rpx 6rpx; padding: 2rpx 6rpx;
border-radius: 8rpx; border-radius: 8rpx;
color: #fff;
}
.tag__orange {
background: #ff9e43;
}
.tag__green {
background: #5ac725;
}
.tag__red {
background: red;
} }
.flex_layout { .flex_layout {
display: flex; display: flex;
margin-top: 8rpx;
} }
} }
} }

BIN
static/images/my_ico2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -5,6 +5,8 @@ import createPersistedState from 'vuex-persistedstate'
Vue.use(Vuex) Vue.use(Vuex)
const store = new Vuex.Store({ const store = new Vuex.Store({
state: { state: {
/** 人脸检测验证状态 ["0": 未完成人脸认证; "1": 已完成人脸认证] */
verification: "0",
userInfo: { userInfo: {
CORPINFO_ID: '', CORPINFO_ID: '',
DEPARTMENT_ID: '', DEPARTMENT_ID: '',
@ -19,16 +21,23 @@ const store = new Vuex.Store({
}, },
getters: { getters: {
getUserInfo: state => state.userInfo, getUserInfo: state => state.userInfo,
getVerification: state => state.verification,
}, },
mutations: { mutations: {
setUserInfo(state, userInfo) { setUserInfo(state, userInfo) {
state.userInfo = userInfo state.userInfo = userInfo
} },
setVerification(state, verification) {
state.verification = verification
},
}, },
actions: { actions: {
setUserInfo({commit}, userInfo) { setUserInfo({commit}, userInfo) {
commit('setUserInfo', userInfo) commit('setUserInfo', userInfo)
} },
setVerification({commit}, verification) {
commit('setVerification', verification)
},
}, },
plugins: [ plugins: [
createPersistedState({ createPersistedState({

View File

@ -1,5 +1,5 @@
// let requestPath = 'https://qggf.qhdsafety.com/xgfApi/'; // 后台请求地址 // let requestPath = 'https://qggf.qhdsafety.com/xgfApi/'; // 后台请求地址
let requestPath = 'http://192.168.0.37:8058//xgf_gwj/'; // 后台请求地址 let requestPath = 'http://192.168.0.37:8058/xgf_gwj_2.0'; // 后台请求地址
// let requestPath = 'https://skqhdg.porthebei.com:9006/qa-prevention-xgf/'; // 后台请求地址 // let requestPath = 'https://skqhdg.porthebei.com:9006/qa-prevention-xgf/'; // 后台请求地址
// let requestPath = 'https://qgxgf.qhdsafety.com/qa-prevention-xgf/'; // 外网地址 // let requestPath = 'https://qgxgf.qhdsafety.com/qa-prevention-xgf/'; // 外网地址
import store from '../store/index' import store from '../store/index'