|
@@ -5,16 +5,11 @@
|
|
|
{{ Topics.question }}
|
|
|
</div>
|
|
|
|
|
|
- <div v-if="!isMainWin && showTopics" class="flex-center flex-col text-100px text-[#0F308C]">
|
|
|
+ <div v-if="showTopics" class="flex-center flex-col text-100px text-[#0F308C]">
|
|
|
{{ TopicsVal[currentIndex].correct }}
|
|
|
- <div v-if="tipsFlag" class="text-50px w-[80%]">{{ TopicsVal[currentIndex].Tips }}</div>
|
|
|
</div>
|
|
|
<div class="w-80% h-60% my-30px flex-center flex-col">
|
|
|
<template v-if="showTopics">
|
|
|
- <div v-if="isMainWin" class="flex-center flex-col text-100px text-[#0F308C]" @click="handlePlay">
|
|
|
- {{ TopicsVal[currentIndex].correct }}
|
|
|
- <div class="text-50px">提示</div>
|
|
|
- </div>
|
|
|
<!-- <el-image-->
|
|
|
<!-- v-if="isMainWin"-->
|
|
|
<!-- src="/static/image/cognitiveAbility/SpeechTraining/Auditory/play.png"-->
|
|
@@ -28,13 +23,12 @@
|
|
|
<el-image
|
|
|
:src="`/static/image/cognitiveAbility/SpeechTraining/Visual/${item}.png`"
|
|
|
fit="contain"
|
|
|
- class="w-[120px] h-[120px] cursor-pointer mt-30px"
|
|
|
+ class="w-[180px] h-[180px] cursor-pointer mt-30px rounded-8px"
|
|
|
/>
|
|
|
</div>
|
|
|
<el-image
|
|
|
:src="`/static/image/cognitiveAbility/SpeechTraining/${useClickIndex === index || item === TopicsVal[currentIndex].userAnswer ? 'Options-right' : 'Options-Blank'}.png`"
|
|
|
fit="contain"
|
|
|
- @click="handleItemClick(item, index)"
|
|
|
class="w-[60px] h-[60px] mt-30px"
|
|
|
/>
|
|
|
</div>
|
|
@@ -84,30 +78,22 @@
|
|
|
@click="handleNext()"
|
|
|
/>
|
|
|
</div>
|
|
|
- <!-- <div-->
|
|
|
- <!-- v-if="!isMainWin && showScoreArea"-->
|
|
|
- <!-- class="absolute bottom-[44px] left-10% w-240px h-140px flex flex-row items-end justify-between"-->
|
|
|
- <!-- >-->
|
|
|
- <!-- <span class="text-[#0F308C] text-[42px] mb-12px">得分:</span>-->
|
|
|
- <!-- <span class="text-[#b1b1b1] text-[72px] score-text">{{ TopicsVal[currentIndex].score }}</span>-->
|
|
|
- <!-- <span class="text-[#0F308C] text-[42px] mb-12px">分</span>-->
|
|
|
- <!-- </div>-->
|
|
|
<div
|
|
|
v-if="!isMainWin && showScoreArea"
|
|
|
class="df-bg absolute bottom-[44px] left-10% w-280px h-120px flex flex-row items-end justify-between"
|
|
|
>
|
|
|
<div class="text-[#2569CA] text-[58px] ml-[158px] pb-[10px] score-text">
|
|
|
- {{ TopicsVal[currentIndex].score }} <span>分</span>
|
|
|
- <!-- <span class="text-[#0F308C] text-[42px] mb-12px">分</span>-->
|
|
|
+ {{ TopicsVal[currentIndex].score }}<span>分</span>
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
<VoiceImp ref="VoiceImpRef" />
|
|
|
</section>
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
/*
|
|
|
- * 组件名: wordMap
|
|
|
+ * 组件名:wordWord
|
|
|
* 组件用途: 常规视康复训练 - 词图匹配
|
|
|
* 创建日期: 2024/11/12
|
|
|
* 编写者: JutarryWu
|
|
@@ -116,7 +102,7 @@
|
|
|
import { formatSeconds, isJSON } from '@/utils'
|
|
|
|
|
|
defineOptions({
|
|
|
- name: 'wordMap',
|
|
|
+ name: 'wordWord',
|
|
|
inheritAttrs: false
|
|
|
})
|
|
|
|
|
@@ -125,7 +111,6 @@ import Topics from './topics.json'
|
|
|
interface TopicsType {
|
|
|
choices: string[]
|
|
|
correct: string
|
|
|
- Tips: string
|
|
|
userAnswer: string
|
|
|
score: string
|
|
|
}
|
|
@@ -139,8 +124,6 @@ const showScoreArea = ref(false) // 主屏 - 显示评分标识
|
|
|
const showSubmitBtn = ref(false) // 副屏 - 显示确定按钮标识
|
|
|
let isSubmitting = false // 是否正在提交标识
|
|
|
const showTopics = ref(false) // 显示题目选项标识
|
|
|
-const tipsFlag = ref(false) // 显示副屏提示
|
|
|
-
|
|
|
const VoiceImpRef = ref()
|
|
|
const currentIndex = ref(0) // 当前题目索引
|
|
|
const TopicsVal = ref<TopicsType[]>([])
|
|
@@ -164,16 +147,13 @@ const handleNext = () => {
|
|
|
localStorage.setItem('tow-win-auditory-word-img-matching-show-topics', currentIndex.value + '')
|
|
|
} else {
|
|
|
let tempCount = TopicsVal.value.filter((item) => item.userAnswer !== '').length
|
|
|
- console.log('最后一题', TopicsVal.value.length, tempCount)
|
|
|
if (tempCount === TopicsVal.value.length) {
|
|
|
isSubmitting = true
|
|
|
- console.log('最后一题,结束')
|
|
|
localStorage.setItem('tow-win-auditory-word-img-matching-isSubmitting', 'YES')
|
|
|
} else {
|
|
|
currentIndex.value++
|
|
|
showScoreArea.value = false
|
|
|
scoreIndex.value = -1
|
|
|
- tipsFlag.value = false
|
|
|
handleNext()
|
|
|
}
|
|
|
}
|
|
@@ -221,7 +201,7 @@ async function exec() {
|
|
|
localStorage.setItem('two-win-auditory-word-img-matching-init-data', JSON.stringify(TopicsVal.value))
|
|
|
setTimeout(() => {
|
|
|
showNextBtn.value = true
|
|
|
- }, 1600)
|
|
|
+ }, 600)
|
|
|
} else {
|
|
|
taskBeginTime = Date.now()
|
|
|
// VoiceImpRef.value.videoPlay(
|
|
@@ -258,7 +238,6 @@ onMounted(() => {
|
|
|
useClickIndex.value = -1
|
|
|
showScoreArea.value = false
|
|
|
scoreIndex.value = -1
|
|
|
- tipsFlag.value = false
|
|
|
// VoiceImpRef.value.videoPlay(
|
|
|
// 'Speech-Auditory',
|
|
|
// `static/voice/cognitiveAbility/SpeechTraining/Auditory/WordImgMatching/${TopicsVal.value[currentIndex.value].correct}.mp3`
|
|
@@ -271,7 +250,6 @@ onMounted(() => {
|
|
|
// 'Speech-Auditory',
|
|
|
// `static/voice/cognitiveAbility/SpeechTraining/Auditory/WordImgMatching/${val.newValue}-tips.mp3`
|
|
|
// )
|
|
|
- tipsFlag.value = true
|
|
|
localStorage.removeItem('two-win-auditory-word-img-matching-item-check')
|
|
|
}
|
|
|
|
|
@@ -283,7 +261,6 @@ onMounted(() => {
|
|
|
|
|
|
if (val.key === 'tow-win-auditory-word-img-matching-isSubmitting' && val.newValue === 'YES') {
|
|
|
isSubmitting = true
|
|
|
- console.log('游戏结束')
|
|
|
emits('gameOver', {
|
|
|
min: formatSeconds(Date.now() - taskBeginTime),
|
|
|
content: JSON.stringify({
|