Ver código fonte

数字人的朝向

liyanbo 2 meses atrás
pai
commit
33348e0d9a
1 arquivos alterados com 4 adições e 13 exclusões
  1. 4 13
      src/views/AIPage/aiGenerate/DialogContent.vue

+ 4 - 13
src/views/AIPage/aiGenerate/DialogContent.vue

@@ -59,7 +59,7 @@
 
       <!-- 用户输入卡片 -->
       <div
-        v-if="currentDialogue.type == 'user'"
+        v-if="currentDialogue.type === 'user'"
         class="dialogue-card user-input-card"
       >
         <div class="dialogue-header">
@@ -81,7 +81,7 @@
       </div>
 
       <!-- 输入按钮区域 -->
-      <div class="input-buttons-container" v-if="currentDialogue.type == 'user'">
+      <div class="input-buttons-container" v-if="currentDialogue.type === 'user'">
         <!-- 语音输入按钮 -->
         <div class="voice-input-outer" :class="{ 'recording': isVoiceRecording }">
           <VoiceInput 
@@ -131,8 +131,6 @@ const currentSectionIndex = ref(0)
 const currentDialogueIndex = ref(0)
 // 是否正在播放
 const isPlaying = ref(false)
-// 输入卡片是否可见
-const isInputCardVisible = ref(false)
 // 用户输入内容
 const userInput = ref('')
 // 语音录音状态
@@ -244,7 +242,6 @@ const submitUserInput = async () => {
 
 // 取消用户输入
 const cancelUserInput = () => {
-  isInputCardVisible.value = false
   userInput.value = ''
 }
 
@@ -254,13 +251,8 @@ const parseMarkdown = (content) => {
   return marked(content)
 }
 
-const getCharacterSide = (roleName) => {
-  const sideMap = {
-    '牛顿': 'left',
-    '小智': 'right',
-    '园子': 'right'
-  }
-  return sideMap[roleName] || 'left'
+const getCharacterSide = () => {
+  return currentDialogueIndex.value % 2 === 0 ? 'left' : 'right'
   
 }
 
@@ -506,7 +498,6 @@ const doSendMessage = async () => {
   })
   // 清空输入框
   userInput.value = ''
-  isInputCardVisible.value = false
   recoverQuestDialogue()
 }