|
@@ -1,6 +1,6 @@
|
|
<template>
|
|
<template>
|
|
- <section class="auditory-word-img-matching-container flex-center flex-col wh-full relative">
|
|
|
|
- <water-title title="词图匹配" />
|
|
|
|
|
|
+ <section class="auditory-sentence-img-matching-container flex-center flex-col wh-full relative">
|
|
|
|
+ <water-title title="句图匹配" />
|
|
<div v-if="isMainWin" class="text-[42px] text-[#0F308C]">
|
|
<div v-if="isMainWin" class="text-[42px] text-[#0F308C]">
|
|
{{ Topics.question }}
|
|
{{ Topics.question }}
|
|
</div>
|
|
</div>
|
|
@@ -29,7 +29,7 @@
|
|
<el-image
|
|
<el-image
|
|
:src="`/static/image/cognitiveAbility/SpeechTraining/${useClickIndex === index || item === TopicsVal[currentIndex].userAnswer ? 'Options-right' : 'Options-Blank'}.png`"
|
|
:src="`/static/image/cognitiveAbility/SpeechTraining/${useClickIndex === index || item === TopicsVal[currentIndex].userAnswer ? 'Options-right' : 'Options-Blank'}.png`"
|
|
fit="contain"
|
|
fit="contain"
|
|
- class="w-[100px] h-[100px] mt-30px"
|
|
|
|
|
|
+ class="w-[60px] h-[60px] mt-30px"
|
|
/>
|
|
/>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -60,8 +60,8 @@
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
/*
|
|
/*
|
|
- * 组件名: CATAuditoryTrainingWordImgMatching
|
|
|
|
- * 组件用途: 常规听康复训练 - 词图匹配
|
|
|
|
|
|
+ * 组件名: CATAuditoryTrainingRecognition
|
|
|
|
+ * 组件用途: 常规听康复训练 - 语音辨识
|
|
* 创建日期: 2024/11/12
|
|
* 创建日期: 2024/11/12
|
|
* 编写者: JutarryWu
|
|
* 编写者: JutarryWu
|
|
*/
|
|
*/
|
|
@@ -69,7 +69,7 @@
|
|
import { formatSeconds, isJSON } from '@/utils'
|
|
import { formatSeconds, isJSON } from '@/utils'
|
|
|
|
|
|
defineOptions({
|
|
defineOptions({
|
|
- name: 'CATAuditoryTrainingWordImgMatching',
|
|
|
|
|
|
+ name: 'CATAuditoryTrainingRecognition',
|
|
inheritAttrs: false
|
|
inheritAttrs: false
|
|
})
|
|
})
|
|
|
|
|
|
@@ -99,12 +99,12 @@ const handleNext = () => {
|
|
if (TopicsVal.value[currentIndex.value].userAnswer === '') {
|
|
if (TopicsVal.value[currentIndex.value].userAnswer === '') {
|
|
showTopics.value = true
|
|
showTopics.value = true
|
|
showNextBtn.value = false
|
|
showNextBtn.value = false
|
|
- localStorage.setItem('tow-win-auditory-word-img-matching-show-topics', currentIndex.value + '')
|
|
|
|
|
|
+ localStorage.setItem('tow-win-auditory-sentence-img-matching-show-topics', currentIndex.value + '')
|
|
} else {
|
|
} else {
|
|
let tempCount = TopicsVal.value.filter((item) => item.userAnswer !== '').length
|
|
let tempCount = TopicsVal.value.filter((item) => item.userAnswer !== '').length
|
|
if (tempCount === TopicsVal.value.length) {
|
|
if (tempCount === TopicsVal.value.length) {
|
|
isSubmitting = true
|
|
isSubmitting = true
|
|
- localStorage.setItem('tow-win-auditory-word-img-matching-isSubmitting', 'YES')
|
|
|
|
|
|
+ localStorage.setItem('tow-win-auditory-sentence-img-matching-isSubmitting', 'YES')
|
|
} else {
|
|
} else {
|
|
currentIndex.value++
|
|
currentIndex.value++
|
|
handleNext()
|
|
handleNext()
|
|
@@ -113,7 +113,7 @@ const handleNext = () => {
|
|
}
|
|
}
|
|
|
|
|
|
const handlePlay = () => {
|
|
const handlePlay = () => {
|
|
- localStorage.setItem('two-win-auditory-word-img-matching-item-check', TopicsVal.value[currentIndex.value].correct)
|
|
|
|
|
|
+ localStorage.setItem('two-win-auditory-sentence-img-matching-item-check', TopicsVal.value[currentIndex.value].correct)
|
|
}
|
|
}
|
|
|
|
|
|
const handleItemClick = (item: string, index: number) => {
|
|
const handleItemClick = (item: string, index: number) => {
|
|
@@ -124,7 +124,7 @@ const handleItemClick = (item: string, index: number) => {
|
|
useClickIndex.value = index
|
|
useClickIndex.value = index
|
|
showSubmitBtn.value = true
|
|
showSubmitBtn.value = true
|
|
localStorage.setItem(
|
|
localStorage.setItem(
|
|
- 'two-win-auditory-word-img-matching-submit-answer',
|
|
|
|
|
|
+ 'two-win-auditory-sentence-img-matching-submit-answer',
|
|
TopicsVal.value[currentIndex.value].userAnswer
|
|
TopicsVal.value[currentIndex.value].userAnswer
|
|
)
|
|
)
|
|
}
|
|
}
|
|
@@ -139,7 +139,7 @@ const handleSubmit = () => {
|
|
TopicsVal.value[currentIndex.value].userAnswer === TopicsVal.value[currentIndex.value].correct ? 'right' : 'error'
|
|
TopicsVal.value[currentIndex.value].userAnswer === TopicsVal.value[currentIndex.value].correct ? 'right' : 'error'
|
|
)
|
|
)
|
|
showSubmitBtn.value = false
|
|
showSubmitBtn.value = false
|
|
- localStorage.setItem('two-win-auditory-word-img-matching-try-over', 'YES')
|
|
|
|
|
|
+ localStorage.setItem('two-win-auditory-sentence-img-matching-try-over', 'YES')
|
|
}
|
|
}
|
|
|
|
|
|
async function exec() {
|
|
async function exec() {
|
|
@@ -151,15 +151,15 @@ async function exec() {
|
|
return item
|
|
return item
|
|
})
|
|
})
|
|
.sort(() => Math.random() - 0.5)
|
|
.sort(() => Math.random() - 0.5)
|
|
- localStorage.setItem('two-win-auditory-word-img-matching-init-data', JSON.stringify(TopicsVal.value))
|
|
|
|
|
|
+ localStorage.setItem('two-win-auditory-sentence-img-matching-init-data', JSON.stringify(TopicsVal.value))
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
showNextBtn.value = true
|
|
showNextBtn.value = true
|
|
- }, 6600)
|
|
|
|
|
|
+ }, 5200)
|
|
} else {
|
|
} else {
|
|
taskBeginTime = Date.now()
|
|
taskBeginTime = Date.now()
|
|
VoiceImpRef.value.videoPlay(
|
|
VoiceImpRef.value.videoPlay(
|
|
'Speech-Auditory',
|
|
'Speech-Auditory',
|
|
- 'static/voice/cognitiveAbility/SpeechTraining/Auditory/WordImgMatching/1.mp3'
|
|
|
|
|
|
+ 'static/voice/cognitiveAbility/SpeechTraining/Auditory/SentenceImgMatching/1.mp3'
|
|
)
|
|
)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -169,37 +169,41 @@ onMounted(() => {
|
|
|
|
|
|
window.addEventListener('storage', (val) => {
|
|
window.addEventListener('storage', (val) => {
|
|
if (isMainWin.value) {
|
|
if (isMainWin.value) {
|
|
- if (val.key === 'two-win-auditory-word-img-matching-submit-answer') {
|
|
|
|
|
|
+ if (val.key === 'two-win-auditory-sentence-img-matching-submit-answer') {
|
|
TopicsVal.value[currentIndex.value].userAnswer = val.newValue!
|
|
TopicsVal.value[currentIndex.value].userAnswer = val.newValue!
|
|
- localStorage.removeItem('two-win-auditory-word-img-matching-submit-answer')
|
|
|
|
|
|
+ localStorage.removeItem('two-win-auditory-sentence-img-matching-submit-answer')
|
|
}
|
|
}
|
|
|
|
|
|
- if (val.key === 'two-win-auditory-word-img-matching-try-over') {
|
|
|
|
|
|
+ if (val.key === 'two-win-auditory-sentence-img-matching-try-over') {
|
|
showNextBtn.value = true
|
|
showNextBtn.value = true
|
|
- localStorage.removeItem('two-win-auditory-word-img-matching-try-over')
|
|
|
|
|
|
+ localStorage.removeItem('two-win-auditory-sentence-img-matching-try-over')
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
- if (val.key === 'two-win-auditory-word-img-matching-init-data' && isJSON(val.newValue!)) {
|
|
|
|
|
|
+ if (val.key === 'two-win-auditory-sentence-img-matching-init-data' && isJSON(val.newValue!)) {
|
|
TopicsVal.value = JSON.parse(val.newValue!) as TopicsType[]
|
|
TopicsVal.value = JSON.parse(val.newValue!) as TopicsType[]
|
|
- localStorage.removeItem('two-win-auditory-word-img-matching-init-data')
|
|
|
|
|
|
+ localStorage.removeItem('two-win-auditory-sentence-img-matching-init-data')
|
|
}
|
|
}
|
|
|
|
|
|
- if (val.key === 'tow-win-auditory-word-img-matching-show-topics') {
|
|
|
|
|
|
+ if (val.key === 'tow-win-auditory-sentence-img-matching-show-topics') {
|
|
showTopics.value = true
|
|
showTopics.value = true
|
|
currentIndex.value = Number(val.newValue!)
|
|
currentIndex.value = Number(val.newValue!)
|
|
useClickIndex.value = -1
|
|
useClickIndex.value = -1
|
|
- localStorage.removeItem('tow-win-auditory-word-img-matching-show-topics')
|
|
|
|
|
|
+ VoiceImpRef.value.videoPlay(
|
|
|
|
+ 'Speech-Auditory',
|
|
|
|
+ `static/voice/cognitiveAbility/SpeechTraining/Auditory/SentenceImgMatching/${TopicsVal.value[currentIndex.value].correct}.mp3`
|
|
|
|
+ )
|
|
|
|
+ localStorage.removeItem('tow-win-auditory-sentence-img-matching-show-topics')
|
|
}
|
|
}
|
|
|
|
|
|
- if (val.key === 'two-win-auditory-word-img-matching-item-check') {
|
|
|
|
|
|
+ if (val.key === 'two-win-auditory-sentence-img-matching-item-check') {
|
|
VoiceImpRef.value.videoPlay(
|
|
VoiceImpRef.value.videoPlay(
|
|
'Speech-Auditory',
|
|
'Speech-Auditory',
|
|
- `static/voice/cognitiveAbility/SpeechTraining/Auditory/WordImgMatching/${val.newValue}.mp3`
|
|
|
|
|
|
+ `static/voice/cognitiveAbility/SpeechTraining/Auditory/SentenceImgMatching/${val.newValue}.mp3`
|
|
)
|
|
)
|
|
- localStorage.removeItem('two-win-auditory-word-img-matching-item-check')
|
|
|
|
|
|
+ localStorage.removeItem('two-win-auditory-sentence-img-matching-item-check')
|
|
}
|
|
}
|
|
|
|
|
|
- if (val.key === 'tow-win-auditory-word-img-matching-isSubmitting' && val.newValue === 'YES') {
|
|
|
|
|
|
+ if (val.key === 'tow-win-auditory-sentence-img-matching-isSubmitting' && val.newValue === 'YES') {
|
|
isSubmitting = true
|
|
isSubmitting = true
|
|
emits('gameOver', {
|
|
emits('gameOver', {
|
|
min: formatSeconds(Date.now() - taskBeginTime),
|
|
min: formatSeconds(Date.now() - taskBeginTime),
|
|
@@ -209,7 +213,7 @@ onMounted(() => {
|
|
}),
|
|
}),
|
|
score: TopicsVal.value.filter((item) => item.userAnswer === item.correct).length + ''
|
|
score: TopicsVal.value.filter((item) => item.userAnswer === item.correct).length + ''
|
|
})
|
|
})
|
|
- localStorage.removeItem('tow-win-auditory-word-img-matching-isSubmitting')
|
|
|
|
|
|
+ localStorage.removeItem('tow-win-auditory-sentence-img-matching-isSubmitting')
|
|
}
|
|
}
|
|
}
|
|
}
|
|
})
|
|
})
|