diff --git a/pages.json b/pages.json index a3ed179..9971d16 100644 --- a/pages.json +++ b/pages.json @@ -191,6 +191,13 @@ { "navigationStyle" : "custom" } + }, + { + "path" : "pages/YNEduApp/user/faceScan", + "style" : + { + "navigationBarTitleText" : "人脸识别" + } } ], "globalStyle": { diff --git a/pages/YNEduApp/exam/examination.vue b/pages/YNEduApp/exam/examination.vue index c788901..f2342b1 100644 --- a/pages/YNEduApp/exam/examination.vue +++ b/pages/YNEduApp/exam/examination.vue @@ -117,6 +117,7 @@ export default { time: 30 * 60 * 1000, random1: 0, random2: 0, + hasScanned: false, // 答题时间 answerTime: 0, currentIndex: 0, @@ -264,14 +265,6 @@ export default { this.random1 = Math.floor(Math.random() * 100000) + 420000 // random1 在 7-13分钟之间 this.random2 = Math.floor(Math.random() * 100000) + 900000 // random2 在 15-19分钟之间 console.log('🚀 ~ mounted ~ this.random1:', this.random1, this.random2) - - setTimeout(() => { - this.openFaceScan() - }, this.random1) - - setTimeout(() => { - this.openFaceScan() - }, this.random2) }, methods: { // 获取列表 @@ -294,6 +287,14 @@ export default { // console.log('🚀 ~ changeCountDown ~ time:', time) this.answerTime = this.time - (time.days * 24 * 60 * 60 + time.hours * 60 * 60 + time.minutes * 60 + time.seconds) * 1000 + // console.log('🚀 ~ changeCountDown ~ this.answerTime:', this.answerTime) + if (this.answerTime > this.random1 && this.answerTime < this.random2 && !this.hasScanned) { + this.openFaceScan() + this.hasScanned = true + } else if (this.answerTime > this.random2 && this.hasScanned) { + this.openFaceScan() + this.hasScanned = false + } if (this.answerTime == this.time) { // 提示: 时间结束, 自动提交 this.$refs.uToast.show({ diff --git a/pages/YNEduApp/user/faceScan.vue b/pages/YNEduApp/user/faceScan.vue new file mode 100644 index 0000000..0c21bb0 --- /dev/null +++ b/pages/YNEduApp/user/faceScan.vue @@ -0,0 +1,142 @@ + + + + + diff --git a/static/images/人脸识别.png b/static/images/人脸识别.png new file mode 100644 index 0000000..96e8e71 Binary files /dev/null and b/static/images/人脸识别.png differ diff --git a/static/images/光线充足.png b/static/images/光线充足.png new file mode 100644 index 0000000..6a491e3 Binary files /dev/null and b/static/images/光线充足.png differ diff --git a/static/images/正对手机.png b/static/images/正对手机.png new file mode 100644 index 0000000..7512637 Binary files /dev/null and b/static/images/正对手机.png differ diff --git a/static/images/避免遮挡.png b/static/images/避免遮挡.png new file mode 100644 index 0000000..025983b Binary files /dev/null and b/static/images/避免遮挡.png differ