Bläddra i källkod

增加眼动训练两个游戏的支持

JutarryWu 5 dagar sedan
förälder
incheckning
572b6c8637

+ 3 - 3
src/views/gameCenter/components/Introduction/index.vue

@@ -13,8 +13,8 @@
           />
         </div>
         <div class="flex-1">
-          <div class="flex flex-row items-center gap-x-[16px] mt-[6px]">
-            <el-image :src="iconArrowRight" fit="cover" class="w-[24px] h-[36px]" />
+          <div class="flex flex-row items-center mt-[6px]">
+            <el-image :src="iconArrowRight" fit="cover" class="w-[24px] h-[36px] mr-16px" />
             <span class="color-[#222222] font-bold text-[36px]">{{ props.gameInfo.name }}</span>
           </div>
           <div class="color-[#FEB401] text-[24px] mt-[19px] pl-[40px]">测试人数:100+</div>
@@ -30,7 +30,7 @@
           type="primary"
           @click="beginGame()"
           size="large"
-          class="text-[24px] p-x-[48px] p-y-[2px] flex-center"
+          class="h-60px text-[24px] p-x-[56px] p-y-[12px] flex-center"
         >
           开始游戏
         </el-button>

+ 5 - 1
src/views/gameCenter/components/games/CocosDialog/index.vue

@@ -1,7 +1,7 @@
 <template>
   <my-full-screen-dialog ref="openDialogRef" close-color="#134FA4" :show-close="false" @close-dialog="handleClose">
     <div class="cocos-container w-full h-full flex flex-col items-center text-[#134FA4]">
-      <iframe :src="props.url" frameborder="0"></iframe>
+      <iframe id="cocosDialog" :src="props.url" frameborder="0" allow="microphone *;camera *"></iframe>
       <!--<iframe src="http://192.168.1.10:7456/web-mobile/ADL/index.html" frameborder="0"></iframe>-->
     </div>
   </my-full-screen-dialog>
@@ -35,6 +35,10 @@ const handleClose = (done: () => void) => {
 }
 
 async function exec() {
+  let area = document.querySelector('#cocosDialog') as HTMLElement
+  if (area) {
+    area.allow = 'microphone *;camera *'
+  }
   openDialogRef.value.openDialog()
   window.addEventListener('message', (e: MessageEvent) => {
     if (e.data === 'close') {

+ 24 - 13
src/views/gameCenter/components/games/DigitalUnderstanding/components/DUMainShow/index.vue

@@ -12,38 +12,50 @@
       >
         <div v-if="false" class="text-[24px] ml-[20px] w-[110px]">第 {{ index + 1 }} 题:</div>
         <template v-if="[0, 1, 2, 3].includes(showData.tempLevel)">
-          <div class="ml-[20px] title-right">
-            <div class="flex flex-row flex-wrap gap-[32px]">
-              <div
-                v-for="(img, imageIndex) in item.titleImages"
-                :key="imageIndex"
-                class="height-[125px] flex flex-row items-center"
-              >
+          <div class="w-full">
+            <div class="flex-center flex-row flex-wrap gap-[32px]">
+              <div v-for="(img, imageIndex) in item.titleImages" :key="imageIndex" class="flex flex-row items-center">
                 <div
-                  class="w-[200px] h-[200px] flex-center cursor-pointer pos-relative"
+                  class="flex-center cursor-pointer pos-relative"
                   :class="{
+                    'w-[600px] h-[600px]': item.titleImages!.length <= 2,
+                    'w-[520px] h-[520px]': item.titleImages!.length === 3,
+                    'w-[400px] h-[400px]': item.titleImages!.length === 4,
+                    'w-[320px] h-[320px]': item.titleImages!.length === 5,
+                    'w-[260px] h-[260px]': item.titleImages!.length === 6,
+                    'w-[270px] h-[270px]': [7, 8, 9].includes(item.titleImages!.length),
                     select: parseInt(<string>showData.list[index].answer) === imageIndex,
                     'icon-outline': showData.tempLevel === 0
                   }"
                   @click="choiceClick0(index, imageIndex)"
                 >
-                  <svg-icon :icon-class="img" class="text-[200px]" />
+                  <svg-icon
+                    :icon-class="img"
+                    :class="{
+                      'text-[600px]': item.titleImages!.length <= 2,
+                      'text-[520px]': item.titleImages!.length === 3,
+                      'text-[400px]': item.titleImages!.length === 4,
+                      'text-[320px]': item.titleImages!.length === 5,
+                      'text-[260px]': item.titleImages!.length === 6,
+                      'text-[280px]': [7, 8, 9].includes(item.titleImages!.length)
+                    }"
+                  />
                 </div>
 
                 <!-- 中间的占位圆圈, 用来表示填写对比符号 -->
                 <div
                   v-if="showData.tempLevel === 1 && item.titleImages && imageIndex < item.titleImages.length - 1"
-                  class="b-[#D96E7E] b-[6px] w-[60px] h-[60px] border-rd-[50%] ml-[32px]"
+                  class="b-[#D96E7E] b-[6px] w-[180px] h-[180px] border-rd-[50%] ml-[32px]"
                 ></div>
               </div>
             </div>
 
             <!-- 图片下方的数字按钮 -->
-            <div v-if="item.choices" class="w-[400px] h-[60px] flex-center flex-row text-[32px] mt-[16px]">
+            <div v-if="item.choices" class="w-full h-[110px] flex-center flex-row justify-around text-[32px] mt-[40px]">
               <div
                 v-for="(choice, choiceIndex) in item.choices"
                 :key="choiceIndex"
-                class="choice-div m-x-[12px] w-[120px] h-[44px] p-x-[16px] p-y-[6px] line-height-[32px] text-center bor-radius-8 b-[#D96E7E59] b-[1px]"
+                class="choice-div m-x-[12px] w-[240px] h-[110px] p-x-[16px] p-y-[6px] line-height-[98px] text-center text-[90px] font-600 bor-radius-8 b-[#D96E7E59] b-[1px]"
                 :class="{ select: showData.list[index].answer === choice + '' }"
                 @click="choiceClick1(index, choice + '')"
               >
@@ -185,7 +197,6 @@ const setData = (data: any) => {
 const endChildLoop = () => {
   setTimeout(() => {
     let answeredCount = showData.list.filter((item) => item.choiceClickFlag).length
-    console.log('answeredCount === showData.list.length: ', answeredCount === showData.list.length)
     if (answeredCount === showData.list.length) {
       $emits('endLoop', toRaw(showData.list))
     }

+ 0 - 1
src/views/gameCenter/components/games/DigitalUnderstanding/index.vue

@@ -62,7 +62,6 @@ const userStore = useUserStore()
 const setChildData = () => {
   nextLevelFlag.value = false
   // DUMainShowRef.value.setData(baseData.dataList[currentLevel.value])
-  console.log(baseData.dataList[currentLevel.value].list[onceIndex.value])
   DUMainShowRef.value.setData({
     tempLevel: baseData.dataList[currentLevel.value].tempLevel,
     list: [toRaw(baseData.dataList[currentLevel.value].list[onceIndex.value])]