|
@@ -59,8 +59,17 @@ const turnsNumber = ref<number>(0)
|
|
|
|
|
|
//引入静态资源的方法
|
|
|
// vue3+vite 实现动态加载图片
|
|
|
-const requireImg = (path: string) => {
|
|
|
- return new URL(`${path}`, import.meta.url).href
|
|
|
+const requireImg = (name: string) => {
|
|
|
+ return new URL(`../assets/cognize/ETBnew/${name}.jpg`, import.meta.url).href
|
|
|
+}
|
|
|
+
|
|
|
+//加载Mp3
|
|
|
+const requireMp3 = (name: string) => {
|
|
|
+ return new URL(`../assets/cognize/${name}.mp3`, import.meta.url).href
|
|
|
+}
|
|
|
+//加载Wav
|
|
|
+const requireWav = (name: string) => {
|
|
|
+ return new URL(`../assets/cognize/${name}.wav`, import.meta.url).href
|
|
|
}
|
|
|
|
|
|
onMounted(() => {
|
|
@@ -101,8 +110,8 @@ onMounted(() => {
|
|
|
//判断是否是练习测试
|
|
|
//判断是否是正式测试
|
|
|
|
|
|
- clickVoice.value = new Audio(requireImg("../assets/cognize/notify.wav"));
|
|
|
- banClickVoice.value = new Audio(requireImg("../assets/cognize/ban.mp3"));
|
|
|
+ clickVoice.value = new Audio(requireWav("notify"));
|
|
|
+ banClickVoice.value = new Audio(requireMp3("ban"));
|
|
|
|
|
|
|
|
|
})
|
|
@@ -724,16 +733,16 @@ const initImgList = async (rank: any) => {
|
|
|
dotPos: index >= 6 ? "0" : "1", //0-上,1-下
|
|
|
topImg:
|
|
|
index % 2 == 0
|
|
|
- ? requireImg(`../assets/cognize/ETBnew/${item >= "06" ? "m" + item : "f" + item
|
|
|
- }-happy-0${rank + 1}.jpg`)
|
|
|
- : requireImg(`../assets/cognize/ETBnew/${item >= "06" ? "m" + item : "f" + item
|
|
|
- }-neutral.jpg`), //图片地址
|
|
|
+ ? requireImg(`${item >= "06" ? "m" + item : "f" + item
|
|
|
+ }-happy-0${rank + 1}`)
|
|
|
+ : requireImg(`${item >= "06" ? "m" + item : "f" + item
|
|
|
+ }-neutral`), //图片地址
|
|
|
bottomImg:
|
|
|
index % 2 == 0
|
|
|
- ? requireImg(`../assets/cognize/ETBnew/${item >= "06" ? "m" + item : "f" + item
|
|
|
- }-neutral.jpg`)
|
|
|
- : requireImg(`../assets/cognize/ETBnew/${item >= "06" ? "m" + item : "f" + item
|
|
|
- }-happy-0${rank + 1}.jpg`), //图片地址
|
|
|
+ ? requireImg(`${item >= "06" ? "m" + item : "f" + item
|
|
|
+ }-neutral`)
|
|
|
+ : requireImg(`${item >= "06" ? "m" + item : "f" + item
|
|
|
+ }-happy-0${rank + 1}`), //图片地址
|
|
|
});
|
|
|
//害怕-1
|
|
|
blockList1.value.push({
|
|
@@ -747,16 +756,16 @@ const initImgList = async (rank: any) => {
|
|
|
dotPos: index >= 6 ? "0" : "1", //0-上,1-下
|
|
|
topImg:
|
|
|
index % 2 == 0
|
|
|
- ? requireImg(`../assets/cognize/ETBnew/${item >= "06" ? "m" + item : "f" + item
|
|
|
- }-fear-0${rank + 1}.jpg`)
|
|
|
- : requireImg(`../assets/cognize/ETBnew/${item >= "06" ? "m" + item : "f" + item
|
|
|
- }-neutral.jpg`), //图片地址
|
|
|
+ ? requireImg(`${item >= "06" ? "m" + item : "f" + item
|
|
|
+ }-fear-0${rank + 1}`)
|
|
|
+ : requireImg(`${item >= "06" ? "m" + item : "f" + item
|
|
|
+ }-neutral`), //图片地址
|
|
|
bottomImg:
|
|
|
index % 2 == 0
|
|
|
- ? requireImg(`../assets/cognize/ETBnew/${item >= "06" ? "m" + item : "f" + item
|
|
|
- }-neutral.jpg`)
|
|
|
- : requireImg(`../assets/cognize/ETBnew/${item >= "06" ? "m" + item : "f" + item
|
|
|
- }-fear-0${rank + 1}.jpg`), //图片地址
|
|
|
+ ? requireImg(`${item >= "06" ? "m" + item : "f" + item
|
|
|
+ }-neutral`)
|
|
|
+ : requireImg(`${item >= "06" ? "m" + item : "f" + item
|
|
|
+ }-fear-0${rank + 1}`), //图片地址
|
|
|
});
|
|
|
//开心-2
|
|
|
blockList2.value.push({
|
|
@@ -770,16 +779,16 @@ const initImgList = async (rank: any) => {
|
|
|
dotPos: index >= 6 ? "0" : "1", //0-上,1-下
|
|
|
topImg:
|
|
|
index % 2 == 0
|
|
|
- ? requireImg(`../assets/cognize/ETBnew/${item >= "06" ? "m" + item : "f" + item
|
|
|
- }-happy-0${rank + 1}-jumble.jpg`)
|
|
|
- : requireImg(`../assets/cognize/ETBnew/${item >= "06" ? "m" + item : "f" + item
|
|
|
- }-neutral.jpg`), //图片地址
|
|
|
+ ? requireImg(`${item >= "06" ? "m" + item : "f" + item
|
|
|
+ }-happy-0${rank + 1}-jumble`)
|
|
|
+ : requireImg(`${item >= "06" ? "m" + item : "f" + item
|
|
|
+ }-neutral`), //图片地址
|
|
|
bottomImg:
|
|
|
index % 2 == 0
|
|
|
- ? requireImg(`../assets/cognize/ETBnew/${item >= "06" ? "m" + item : "f" + item
|
|
|
- }-neutral.jpg`)
|
|
|
- : requireImg(`../assets/cognize/ETBnew/${item >= "06" ? "m" + item : "f" + item
|
|
|
- }-happy-0${rank + 1}-jumble.jpg`), //图片地址
|
|
|
+ ? requireImg(`${item >= "06" ? "m" + item : "f" + item
|
|
|
+ }-neutral`)
|
|
|
+ : requireImg(`${item >= "06" ? "m" + item : "f" + item
|
|
|
+ }-happy-0${rank + 1}-jumble`), //图片地址
|
|
|
});
|
|
|
//害怕-2
|
|
|
blockList2.value.push({
|
|
@@ -793,16 +802,16 @@ const initImgList = async (rank: any) => {
|
|
|
dotPos: index >= 6 ? "0" : "1", //点位置0-上,1-下
|
|
|
topImg:
|
|
|
index % 2 == 0
|
|
|
- ? requireImg(`../assets/cognize/ETBnew/${item >= "06" ? "m" + item : "f" + item
|
|
|
- }-fear-0${rank + 1}-jumble.jpg`)
|
|
|
- : requireImg(`../assets/cognize/ETBnew/${item >= "06" ? "m" + item : "f" + item
|
|
|
- }-neutral.jpg`), //图片地址
|
|
|
+ ? requireImg(`${item >= "06" ? "m" + item : "f" + item
|
|
|
+ }-fear-0${rank + 1}-jumble`)
|
|
|
+ : requireImg(`${item >= "06" ? "m" + item : "f" + item
|
|
|
+ }-neutral`), //图片地址
|
|
|
bottomImg:
|
|
|
index % 2 == 0
|
|
|
- ? requireImg(`../assets/cognize/ETBnew/${item >= "06" ? "m" + item : "f" + item
|
|
|
- }-neutral.jpg`)
|
|
|
- : requireImg(`../assets/cognize/ETBnew/${item >= "06" ? "m" + item : "f" + item
|
|
|
- }-fear-0${rank + 1}-jumble.jpg`), //图片地址
|
|
|
+ ? requireImg(`${item >= "06" ? "m" + item : "f" + item
|
|
|
+ }-neutral`)
|
|
|
+ : requireImg(`${item >= "06" ? "m" + item : "f" + item
|
|
|
+ }-fear-0${rank + 1}-jumble`), //图片地址
|
|
|
});
|
|
|
});
|
|
|
}
|
|
@@ -897,9 +906,9 @@ 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>
|
|
|
- <Transition name="fade">
|
|
|
- <p :key="countDownStr" v-show="countDownShow" class="imgBox1">{{ countDownStr }}</p>
|
|
|
- </Transition>
|
|
|
+ <!-- <Transition name="fade"> -->
|
|
|
+ <p :key="countDownStr" v-if="countDownShow" class="countdownStr">{{ countDownStr }}</p>
|
|
|
+ <!-- </Transition> -->
|
|
|
|
|
|
<div style="text-align: center">
|
|
|
<img v-show="crossShow" src="../assets/cognize/whiteFlag-new.png" alt=""
|
|
@@ -1010,4 +1019,21 @@ const userClick = (param: any) => {
|
|
|
transform: scale(0.2);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+.countdownStr {
|
|
|
+ font-size: 50px;
|
|
|
+ font-weight: 700;
|
|
|
+ position: absolute;
|
|
|
+ // background-color: antiquewhite;
|
|
|
+ ;
|
|
|
+ width: 500px;
|
|
|
+ height: 40px;
|
|
|
+ // background-color: aliceblue;
|
|
|
+ text-align: center;
|
|
|
+ left: 0;
|
|
|
+ right: 0;
|
|
|
+ top: 0;
|
|
|
+ bottom: 0;
|
|
|
+ margin: auto;
|
|
|
+}
|
|
|
</style>
|