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