|
@@ -59,6 +59,8 @@ const currentType = ref(0)
|
|
|
//当前测试的轮数
|
|
|
const turnsNumber = ref<number>(0)
|
|
|
|
|
|
+const responseFlag = ref<boolean>(false)
|
|
|
+
|
|
|
//引入静态资源的方法
|
|
|
// vue3+vite 实现动态加载图片
|
|
|
const requireImg = (name: string) => {
|
|
@@ -327,7 +329,7 @@ const recordUserResponse = () => {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }, 2000);
|
|
|
+ }, formalTest.value == '0' ? 2000000 : 2000);
|
|
|
}
|
|
|
const endTime = () => {
|
|
|
flag.value = clearInterval(flag.value);
|
|
@@ -505,11 +507,15 @@ const submitData = async () => {
|
|
|
neutralResponse2.map((item) => {
|
|
|
neutralAllTime2 += item.responseTime;
|
|
|
});
|
|
|
+ let scoreFin = blockRight1.length / turnsNumber.value * 100
|
|
|
+ if (scoreFin > 60) {
|
|
|
+ userInfo.saveIspass('FDOT')
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
- userInfo.saveIspass('FDOT')
|
|
|
if (!currentType.value) {
|
|
|
ElMessage({
|
|
|
- message: `正确率为${((blockRight1.length / turnsNumber.value) * 100).toFixed(2)}%`,
|
|
|
+ message: `正确率为${(scoreFin).toFixed(2)}%`,
|
|
|
type: "info"
|
|
|
})
|
|
|
setTimeout(() => {
|
|
@@ -868,26 +874,39 @@ const randomList = () => {
|
|
|
//获取12个人,随机重复两个人
|
|
|
randomArr.value = randomArr.value.concat(arrList.value);
|
|
|
}
|
|
|
+const responseF = ref<boolean>(false)
|
|
|
+const responseFTime = ref<any>()
|
|
|
+const errorFlagFun = () => {
|
|
|
+ responseF.value = true
|
|
|
+ responseFTime.value = setTimeout(() => {
|
|
|
+ responseF.value = false
|
|
|
+ }, 500)
|
|
|
+}
|
|
|
const userClick = (param: any) => {
|
|
|
if (disableClick.value) {
|
|
|
// 播放错误点击声音并阻止此次点击事件
|
|
|
- banClickVoice.value.play();
|
|
|
+ // banClickVoice.value.play();
|
|
|
return;
|
|
|
}
|
|
|
//如果两秒内用户点击了选项按钮
|
|
|
timingThree.value = clearTimeout(timingThree.value);
|
|
|
// 播放正确点击声音
|
|
|
- clickVoice.value.play();
|
|
|
+ // clickVoice.value.play();
|
|
|
//关闭提示点显示
|
|
|
dotShow.value = false;
|
|
|
//关闭计时器
|
|
|
endTime();
|
|
|
+ errorFlagFun
|
|
|
+ responseFlag.value = (param == activeBlock.value.dotType) ? true : false;
|
|
|
+ errorFlagFun()
|
|
|
|
|
|
if (activeBlock.value.type == 0) {
|
|
|
blockList1.value[cumulation.value].responseTime = commonTime.value * 10; //反应时(ms)
|
|
|
blockList1.value[cumulation.value].correct =
|
|
|
param == activeBlock.value.dotType ? 1 : 0; //反应是否正确
|
|
|
|
|
|
+
|
|
|
+
|
|
|
//切换数组二
|
|
|
activeBlock.value = blockList2.value[cumulation.value];
|
|
|
changeImg("2", cumulation.value);
|
|
@@ -898,6 +917,7 @@ const userClick = (param: any) => {
|
|
|
blockList2.value[cumulation.value].correct =
|
|
|
param == activeBlock.value.dotType ? 1 : 0; //反应是否正确
|
|
|
|
|
|
+
|
|
|
if (cumulation.value >= turnsNumber.value) {
|
|
|
//调用接口,跳转页面
|
|
|
submitData();
|
|
@@ -938,6 +958,10 @@ const userClick = (param: any) => {
|
|
|
:stroke-width="48" :percentage="(cumulation / turnsNumber) * 100" style="width: 50%">
|
|
|
<span style="color: #000;font-size: 20px;"> {{ cumulation }}/{{ turnsNumber }}</span>
|
|
|
</el-progress>
|
|
|
+ <p class="correct_txt" v-show="responseF && formalTest == '0'">
|
|
|
+ <img src="../assets/cognize/correct.png" alt="" v-show="responseFlag">
|
|
|
+ <img src="../assets/cognize/wrong.png" v-show="!responseFlag" alt=""><span></span>
|
|
|
+ </p>
|
|
|
<!-- <Transition name="fade"> -->
|
|
|
<p :key="countDownStr" v-if="countDownShow" class="countdownStr">{{ countDownStr }}</p>
|
|
|
<!-- </Transition> -->
|
|
@@ -951,6 +975,7 @@ const userClick = (param: any) => {
|
|
|
<img class="faceImg mt100" :src="bottomImg" alt="" />
|
|
|
</div>
|
|
|
<div class="imgBox" v-show="dotShow">
|
|
|
+ <!-- {{ activeBlock }} -->
|
|
|
<div class="target">
|
|
|
{{ activeBlock?.dotPos == "0" ? activeBlock?.dot : "" }}
|
|
|
</div>
|
|
@@ -958,10 +983,55 @@ const userClick = (param: any) => {
|
|
|
{{ activeBlock?.dotPos == "1" ? activeBlock?.dot : "" }}
|
|
|
</div>
|
|
|
</div>
|
|
|
+ <div class="tip_cla" v-show="dotShow && formalTest == '0'">
|
|
|
+ <span class="font_one" v-show="activeBlock?.dotType == '0'">当前显示为 <span class="font_one_sub sbclass">
|
|
|
+ :</span>
|
|
|
+ ,请点击<span class="font_two_sub sbclass">左键</span></span>
|
|
|
+ <span class='font_one' v-show="activeBlock?.dotType == '1'">当前显示为 <span class="font_one_sub sbclass">
|
|
|
+ ..</span>,请点击鼠标<span class="font_two_sub sbclass">右键</span></span>
|
|
|
+ </div>
|
|
|
<CpdmMessage ref="cpdmMe" />
|
|
|
</div>
|
|
|
</template>
|
|
|
-<style lang="scss">
|
|
|
+<style scoped>
|
|
|
+.sbclass {
|
|
|
+
|
|
|
+ animation-duration: 1s;
|
|
|
+ animation-name: slidein;
|
|
|
+ animation-iteration-count: infinite;
|
|
|
+ animation-direction: alternate;
|
|
|
+}
|
|
|
+
|
|
|
+@keyframes slidein {
|
|
|
+ from {
|
|
|
+ /* margin-left: 100%; */
|
|
|
+ /* width: 300%; */
|
|
|
+ font-size: 20px;
|
|
|
+ }
|
|
|
+
|
|
|
+ to {
|
|
|
+ /* margin-left: 0%;
|
|
|
+ width: 100%; */
|
|
|
+ font-size: 30px;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|
|
|
+<style lang="scss" scoped>
|
|
|
+.font_one {
|
|
|
+ letter-spacing: 3px;
|
|
|
+}
|
|
|
+
|
|
|
+.font_one_sub {
|
|
|
+ font-size: 50px;
|
|
|
+ font-weight: 700;
|
|
|
+}
|
|
|
+
|
|
|
+.font_two_sub {
|
|
|
+ color: red;
|
|
|
+ font-size: 35px;
|
|
|
+ font-weight: 700;
|
|
|
+}
|
|
|
+
|
|
|
.cognize_plu {
|
|
|
width: 100%;
|
|
|
height: 100vh;
|
|
@@ -1069,4 +1139,20 @@ const userClick = (param: any) => {
|
|
|
bottom: 0;
|
|
|
margin: auto;
|
|
|
}
|
|
|
+
|
|
|
+.correct_txt {
|
|
|
+ position: absolute;
|
|
|
+ left: 50%;
|
|
|
+ transform: translateX(-50%);
|
|
|
+ top: 100px;
|
|
|
+ text-align: center;
|
|
|
+}
|
|
|
+
|
|
|
+.tip_cla {
|
|
|
+ position: absolute;
|
|
|
+ left: 50%;
|
|
|
+ transform: translateX(-50%);
|
|
|
+ bottom: 200px;
|
|
|
+ text-align: center;
|
|
|
+}
|
|
|
</style>
|