فهرست منبع

Merge branch 'refs/heads/20240604-dev' into 20240904-zyy

周玉佂 1 هفته پیش
والد
کامیت
a726b506da

BIN
public/static/voice/game/introduce/31.mp3


BIN
public/static/voice/game/introduce/32.mp3


+ 25 - 13
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>
@@ -102,6 +102,7 @@
 import { useUserStore } from '@/store'
 import { GameManageVO } from '@/api/gameCenter/manage'
 import iconArrowRight from '@/assets/images/icon-arrow-right.png'
+import { getCurrentInstance } from 'vue'
 
 const props = defineProps({
   gameInfo: {
@@ -109,6 +110,8 @@ const props = defineProps({
     default: () => ({})
   }
 })
+
+const instance = getCurrentInstance()
 const userStore = useUserStore()
 const emits = defineEmits(['close'])
 const gameFlag = ref<StrKeyObj>({
@@ -141,20 +144,19 @@ const cocosType = ref('')
 const cocosUrl = ref('')
 const VoiceImpRef = ref()
 
+let tempPlanId = ''
+
 const beginGame = () => {
   for (const item in gameFlag.value) {
     gameFlag.value[item] = false
   }
-  if (props.gameInfo.code?.indexOf('Cocos-') !== -1) {
-    cocosType.value = <string>props.gameInfo.code?.split('-')[1]
-    let tempPlanId = ''
-    if (userStore.user.roles?.includes('Patient')) {
-      let currentPlanInfo = sessionStorage.getItem('currentPlanInfo')
-      if (currentPlanInfo) {
-        tempPlanId = JSON.parse(currentPlanInfo).id
-      }
-    }
-    cocosUrl.value = `${window.location.origin}/cocos/${cocosType.value}/?userID=${userStore.user.id}&planID=${tempPlanId}`
+  // 如果是cocos游戏 或者是 眼动训练的游戏
+  if (props.gameInfo.code?.indexOf('Cocos-') !== -1 || props.gameInfo.typeId === '7') {
+    cocosType.value =
+      props.gameInfo.code?.indexOf('Cocos-') !== -1 ? <string>props.gameInfo.code?.split('-')[1] : props.gameInfo.code
+    cocosUrl.value = `${window.location.origin}/${props.gameInfo.code?.indexOf('Cocos-') !== -1 ? 'cocos' : 'jquery'}/${cocosType.value}/?userID=${userStore.user.id}&planID=${tempPlanId}`
+    console.log(cocosUrl.value)
+    debugger
     VoiceImpRef.value.pauseIntro()
     gameFlag.value.CocosDialog = true
   } else {
@@ -165,10 +167,20 @@ const beginGame = () => {
 
 const gameOver = (key: string) => {
   gameFlag.value[key] = false
+  if (tempPlanId !== '') {
+    instance?.proxy?.$Bus.emit('trainList-refresh')
+  }
 }
 
 async function exec() {
   VoiceImpRef.value.videoPlay(props.gameInfo.id)
+
+  if (userStore.user.roles?.includes('Patient')) {
+    let currentPlanInfo = sessionStorage.getItem('currentPlanInfo')
+    if (currentPlanInfo) {
+      tempPlanId = JSON.parse(currentPlanInfo).id
+    }
+  }
 }
 
 onMounted(() => {

+ 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])]

+ 0 - 1
src/views/tester/components/RehabilitationEvaluation/CognitiveAbilityTask/CognitiveAbilityTaskAuditoryTraining/index.vue

@@ -337,7 +337,6 @@ onMounted(() => {
 
       if (val.key === 'tow-win-auditory-change-status') {
         checkItems.value[modeCurrentIndex].isFinish = true
-        childTaskOver(JSON.parse(val.newValue!))
         localStorage.removeItem('tow-win-auditory-change-status')
       }
     } else {