From 9c2ce903b2ecfcc76e6291f1bd34b1b62a6c4ae4 Mon Sep 17 00:00:00 2001 From: duan <1004387497@qq.com> Date: Tue, 22 Oct 2024 14:27:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=AB=E5=8F=B7=E8=AF=AD=E9=9F=B3=E6=92=AD?= =?UTF-8?q?=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/lineUp/index.vue | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/views/lineUp/index.vue b/src/views/lineUp/index.vue index 65a2c5e..3a4275c 100644 --- a/src/views/lineUp/index.vue +++ b/src/views/lineUp/index.vue @@ -103,6 +103,8 @@ border: 1px solid rgba(255,255,255,0.28);" @click="dialogConfirm(3)">过号 import { callTable, callTablequeue, callTableput, callTabletakeNumber, callTablecall } from '@/api/shop' +const synth = window.speechSynthesis; +const msg = new SpeechSynthesisUtterance() export default { data() { return { @@ -151,7 +153,27 @@ export default { } }, + + + + handleSpeak(text) { + msg.text = text; // 文字内容: 小朋友,你是否有很多问号 + msg.lang = "zh-CN"; // 使用的语言:中文 + msg.volume = 3; // 声音音量:1 + msg.rate = 1; // 语速:1 + msg.pitch = 1; // 音高:1 + synth.speak(msg); // 播放 + }, + // // 语音停止 + // handleStop(e) { + // msg.text = e; + // msg.lang = "zh-CN"; + // synth.cancel(msg); + // }, + + async profilepicture(d) { + this.handleSpeak(d.callNum) let res = await callTablecall({ shopId: localStorage.getItem('shopId'), callQueueId: d.id