|
@@ -28,6 +28,7 @@ const showCountDown = ref(true) // 显示倒计时
|
|
const showImg = ref(true) // 显示图片
|
|
const showImg = ref(true) // 显示图片
|
|
const showText = ref(false) // 显示文字
|
|
const showText = ref(false) // 显示文字
|
|
const musicFlag = ref(true) // 页面音乐开关
|
|
const musicFlag = ref(true) // 页面音乐开关
|
|
|
|
+const userCanClickFlag = ref(false) // 用户是否可以点击开关
|
|
const showDataArr = ref<IData[]>([])
|
|
const showDataArr = ref<IData[]>([])
|
|
const seconds = [3000, 2000, 1500]
|
|
const seconds = [3000, 2000, 1500]
|
|
const currentIndex = ref(0) // 当前索引
|
|
const currentIndex = ref(0) // 当前索引
|
|
@@ -68,6 +69,9 @@ function musicClick(flag: number) {
|
|
}
|
|
}
|
|
|
|
|
|
function choiceClick(item: string, index: number) {
|
|
function choiceClick(item: string, index: number) {
|
|
|
|
+ if (!userCanClickFlag.value) {
|
|
|
|
+ return
|
|
|
|
+ }
|
|
if (!showDataArr.value[currentIndex.value].checked) {
|
|
if (!showDataArr.value[currentIndex.value].checked) {
|
|
showDataArr.value[currentIndex.value].checked = true
|
|
showDataArr.value[currentIndex.value].checked = true
|
|
selectiveIndex.value = index
|
|
selectiveIndex.value = index
|
|
@@ -84,11 +88,13 @@ function choiceClick(item: string, index: number) {
|
|
VoiceImpRef.value.videoPlay('error')
|
|
VoiceImpRef.value.videoPlay('error')
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
clearTimeout(textTimeout.value)
|
|
clearTimeout(textTimeout.value)
|
|
clearTimeout(imgTimeout.value)
|
|
clearTimeout(imgTimeout.value)
|
|
clearTimeout(onceTimer.value)
|
|
clearTimeout(onceTimer.value)
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
|
+ userCanClickFlag.value = false
|
|
|
|
+ showText.value = false
|
|
|
|
+ showImg.value = false
|
|
currentIndex.value++
|
|
currentIndex.value++
|
|
nextOnce()
|
|
nextOnce()
|
|
}, 900)
|
|
}, 900)
|
|
@@ -100,19 +106,23 @@ function nextOnce() {
|
|
onceStart = performance.now()
|
|
onceStart = performance.now()
|
|
selectiveIndex.value = -1
|
|
selectiveIndex.value = -1
|
|
showImg.value = true
|
|
showImg.value = true
|
|
- showText.value = true
|
|
|
|
- // 隐藏文字
|
|
|
|
- textTimeout.value = setTimeout(() => {
|
|
|
|
- showText.value = false
|
|
|
|
- }, 3000)
|
|
|
|
|
|
|
|
// 隐藏图片
|
|
// 隐藏图片
|
|
imgTimeout.value = setTimeout(() => {
|
|
imgTimeout.value = setTimeout(() => {
|
|
showImg.value = false
|
|
showImg.value = false
|
|
|
|
+ showText.value = true
|
|
|
|
+ userCanClickFlag.value = true
|
|
|
|
+ // 隐藏文字
|
|
|
|
+ textTimeout.value = setTimeout(() => {
|
|
|
|
+ showText.value = false
|
|
|
|
+ }, 3000)
|
|
}, showDataArr.value[currentIndex.value].seconds)
|
|
}, showDataArr.value[currentIndex.value].seconds)
|
|
|
|
|
|
// 如果用户未点击,自动清除定时器,进入下一个试次
|
|
// 如果用户未点击,自动清除定时器,进入下一个试次
|
|
onceTimer.value = setTimeout(() => {
|
|
onceTimer.value = setTimeout(() => {
|
|
|
|
+ userCanClickFlag.value = false
|
|
|
|
+ showText.value = false
|
|
|
|
+ showImg.value = false
|
|
clearTimeout(textTimeout.value)
|
|
clearTimeout(textTimeout.value)
|
|
clearTimeout(imgTimeout.value)
|
|
clearTimeout(imgTimeout.value)
|
|
clearTimeout(onceTimer.value)
|
|
clearTimeout(onceTimer.value)
|