| | |
| | | </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; |
| | |
| | | } |
| | | }; |
| | | const audioChangeWord = () => { |
| | | navigator.getUserMedia( |
| | | { audio: true }, |
| | | function onSuccess(stream) { |
| | | voicePageIsShow.value = true; |
| | | }, |
| | | function onError(error) { |
| | | ElMessage.warning('请打开麦克风权限'); |
| | | } |
| | | ); |
| | | }; |
| | | </script> |
| | | <style scoped lang="scss"> |