Browse Source

[feat][ai聊天][语音合成]

hizhangling 1 week atrás
parent
commit
d6ffb922d0
1 changed files with 2 additions and 1 deletions
  1. 2 1
      src/views/xjc-integratedmachine/common/ai/chat.vue

+ 2 - 1
src/views/xjc-integratedmachine/common/ai/chat.vue

@@ -51,7 +51,7 @@
                                     {{expandIndexList.includes(index)?'折叠':'展开'}}
                                 </el-button>
                             </div>
-                            <el-button @click="ttsStartPlay(item.content, index)">{{playActiveIndex === index ?'停止':'播放'}}</el-button>
+                            <el-button @click="ttsStartPlay(item.content, index)">{{playActiveIndex === index && playButtonFlag ?'停止':'播放'}}</el-button>
                         </div>
                     </div>
                 </div>
@@ -598,6 +598,7 @@
 
     function ttsStartPlay(text, index) {
         playActiveIndex.value = index
+        playButtonFlag.value = !playButtonFlag.value;
         if (btnStatus === "UNDEFINED") {
             // 开始合成
             connectWebSocket(text.replace(/<\/?.+?\/?>/g,''));