| | |
| | | tilesetLayer: null, //瀑布流 |
| | | |
| | | audioData: null, //语音 |
| | | audioState: false, //语音状态 |
| | | }, |
| | | mutations: { |
| | | MSET_VIEWER(state, viewer) { |
| | |
| | | // }) |
| | | commit("MSET_POPUPDOM", popupsDom); |
| | | }, |
| | | closeMobileWindowsDom({ state, commit }) { |
| | | closeMobileWindowsDom({ state, commit, dispatch }) { |
| | | if (!state.MobileWindowsHide && state.popupsDom) { |
| | | state.popupsDom.closeOur(); |
| | | commit("MSET_MOBILEWINDOWSHIDE", true); |
| | | if (state.audioData) { |
| | | state.audioData = null; |
| | | window.speechSynthesis.cancel(); |
| | | dispatch("MSET_GETAUDIOBEGIN", "notOpen"); |
| | | } |
| | | } //cancel |
| | | }, |
| | |
| | | }); |
| | | }, |
| | | MSET_GETAUDIO({ state, commit, dispatch }, val) { |
| | | if (state.audioData) { |
| | | state.audioData = null; |
| | | state.audioData = new window.SpeechSynthesisUtterance(); |
| | | state.audioData.text = val; |
| | | state.audioData.onstart = function (e) { |
| | | state.audioState = true; |
| | | }; |
| | | state.audioData.onend = function (event) { |
| | | state.audioState = false; |
| | | }; |
| | | }, |
| | | MSET_GETAUDIOBEGIN({ state, commit, dispatch }, val) { |
| | | if (state.audioState) { |
| | | window.speechSynthesis.cancel(); |
| | | state.audioState = false; |
| | | } else { |
| | | state.audioData = new window.SpeechSynthesisUtterance(); |
| | | state.audioData.text = val; |
| | | window.speechSynthesis.speak(state.audioData); |
| | | if (val != "notOpen") { |
| | | window.speechSynthesis.speak(state.audioData); |
| | | } |
| | | } |
| | | }, |
| | | }, |