Browse Source

修复提问类型语音校验和播放

liyanbo 2 tháng trước cách đây
mục cha
commit
f9f100811e
1 tập tin đã thay đổi với 7 bổ sung5 xóa
  1. 7 5
      src/views/bjdx/course/aiGenerate/aiGengrate.vue

+ 7 - 5
src/views/bjdx/course/aiGenerate/aiGengrate.vue

@@ -263,7 +263,7 @@
                         </div>
                       </div>
                     </template>
-                    
+
                     <!-- 提问 -->
                     <template v-else-if="dialogue.type === 'quest'">
                       <div class="dialogue-role-select">
@@ -404,7 +404,7 @@
                         </div>
                       </div>
                       <button
-                        v-if="dialogue.voiceoverUrl && dialogue.type === 'digital'"
+                        v-if="dialogue.voiceoverUrl"
                         class="play-btn small"
                         @click="playVoiceover(dialogue.voiceoverUrl)"
                       >
@@ -631,7 +631,9 @@ const canProceed = computed(() => {
     case 2:
     case 3:
       return scriptData.sections.every(section =>
-        section.backgroundImage.url && section.dialogues.every(dialogue => dialogue.type !== "digital" || dialogue.voiceoverUrl)
+        section.backgroundImage.url && section.dialogues.every(dialogue =>
+          ((dialogue.type === 'digital' || dialogue.type === 'quest') && dialogue.roleName && dialogue.content.trim() && dialogue.voiceoverUrl) ||
+          (dialogue.type === 'user' && dialogue.roleName && dialogue.content.trim()))
       )
     default:
       return false
@@ -1123,10 +1125,10 @@ onMounted(async () => {
       Object.assign(scriptData, cachedData)
     }
   }
-  
+
   // 设置初始步骤
   currentStep.value = props.initialStep
-  
+
   try {
     const params = {
       pageOn: 1,