gerson
2024-07-19 c6e3c33979ab6ed1aa6a834f39c85356320c0f93
src/components/chat/components/playBar/PlayBar.vue
@@ -35,20 +35,35 @@
            </div>
         </div>
      </div>
      <VoicePage v-model:isShow="voicePageIsShow" v-show="voicePageIsShow" />
      <VoicePage
         v-model:isShow="voicePageIsShow"
         v-show="voicePageIsShow"
         @submit="(cb) => emits('sendClick', cb)"
         @updateInputValue="updateInputValue"
         :isHome = "isHome"
      />
   </div>
</template>
<script setup lang="ts">
import { ElMessage } from 'element-plus';
import { ref } from 'vue';
import VoicePage from './voicePage/VoicePage.vue';
const emits = defineEmits(['sendClick']);
const props = defineProps(['isTalking']);
const voicePageIsShow = ref(false);
const props = defineProps(['isTalking','isHome']);
const voicePageIsShow = defineModel('voicePageIsShow', {
   type: Boolean,
   default: false,
});
const inputValue = defineModel({
   type: String,
});
const updateInputValue = (val) => {
   inputValue.value = val;
};
const enterInput = (e) => {
   if (props.isTalking) return;
@@ -61,7 +76,15 @@
   }
};
const audioChangeWord = () => {
   navigator.getUserMedia(
      { audio: true },
      function onSuccess(stream) {
   voicePageIsShow.value = true;
      },
      function onError(error) {
         ElMessage.warning('请打开麦克风权限');
      }
   );
};
</script>
<style scoped lang="scss">