From 81d7140c3590a24a140eb42f1a4f06750e9284fe Mon Sep 17 00:00:00 2001 From: "@0Melon0" <576788380@qq.com> Date: Thu, 11 Jul 2024 16:21:05 +0800 Subject: [PATCH] =?UTF-8?q?feat:=E5=AE=8C=E6=88=90=E5=A4=A7=E5=B1=8F?= =?UTF-8?q?=E6=92=AD=E6=8A=A5=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 1.html | 99 +++++++++++++++--------- src/views/scheduleList/index.vue | 2 +- src/views/waitList/index.vue | 129 ++++++++++++++++++++----------- 3 files changed, 145 insertions(+), 85 deletions(-) diff --git a/1.html b/1.html index 8708f7c..521fb16 100644 --- a/1.html +++ b/1.html @@ -1,46 +1,69 @@ - - Speech Synthesis Example - - -

Speech Synthesis Example

- -
- - - - + function speakText() { + window.speechSynthesis.cancel(); // 清除之前的语音合成 + + setTimeout(() => { + const textInput = document.getElementById('text').value; + const rate = parseFloat(document.getElementById('rate').value); + + + const utterance = new SpeechSynthesisUtterance([textInput, textInput, textInput].join('')); + + const selectedVoiceIndex = voiceSelect.selectedOptions[0].value; + const voices = synth.getVoices(); + utterance.voice = voices[selectedVoiceIndex]; + utterance.rate = rate; + + utterance.onend = function (event) { + console.log('Speech has finished.'); + alert('Speech has finished.'); + }; + + window.speechSynthesis.speak(utterance); + }, 100); // 延迟 100 毫秒 + } + + diff --git a/src/views/scheduleList/index.vue b/src/views/scheduleList/index.vue index 802f94c..ab06ddb 100644 --- a/src/views/scheduleList/index.vue +++ b/src/views/scheduleList/index.vue @@ -116,7 +116,7 @@ export default { this.patientList[groupIndex] = [element]; } } - if (!this.carouselTimer) { + if (!this.carouselTimer && res['Data']['length'] > this.showItemNum) { this.onCarouselTimer(); } } else { diff --git a/src/views/waitList/index.vue b/src/views/waitList/index.vue index 3b213c7..c516ca3 100644 --- a/src/views/waitList/index.vue +++ b/src/views/waitList/index.vue @@ -47,6 +47,13 @@ +
@@ -68,7 +75,7 @@