Sfoglia il codice sorgente

判断是否是最后一句代码逻辑整理

liyanbo 1 settimana fa
parent
commit
4cb8c308a3
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 2 2
      src/views/AIPage/aiGenerate/DialogContent.vue

+ 2 - 2
src/views/AIPage/aiGenerate/DialogContent.vue

@@ -128,7 +128,7 @@
         <!-- 语音输入按钮占位符 -->
         <div class="voice-input-outer placeholder" v-else></div>
         <!-- 下一个对话按钮 -->
-        <div class="arrow-icon-circle" @click="playNext" :class="{ 'disabled': currentSectionIndex === scriptData.sections.length - 1 && currentDialogueIndex === currentSection.dialogues.length - 1 }">
+        <div class="arrow-icon-circle" @click="playNext" :class="{ 'disabled': isAtLastDialogue() }">
           <el-icon class="arrow-icon"><CaretRight /></el-icon>
         </div>
       </div>
@@ -620,7 +620,7 @@ const playPrevious = () => {
 
 const playNext = (isAutoPlay = false) => {
   // 如果已经到达最后一句,直接返回,不执行任何操作
-  if (currentSection.value && currentDialogueIndex.value === currentSection.value.dialogues.length - 1 && currentSectionIndex.value === props.scriptData.sections.length - 1) {
+  if (isAtLastDialogue()) {
     return false
   }