+
liuyg
2022-01-07 8bc1e13641e9f172e7bdc12abc054c82b565324e
src/store/modules/mobile.js
@@ -45,6 +45,8 @@
    tilesetLayer: null, //2.5d模型
    usetowpointfive: null,
    tilesetLayer: null, //瀑布流
    audioData: null, //语音
  },
  mutations: {
    MSET_VIEWER(state, viewer) {
@@ -300,7 +302,11 @@
      if (!state.MobileWindowsHide && state.popupsDom) {
        state.popupsDom.closeOur();
        commit("MSET_MOBILEWINDOWSHIDE", true);
      }
        if (state.audioData) {
          state.audioData = null;
          window.speechSynthesis.cancel();
        }
      } //cancel
    },
    CHANGETOC3({ state, commit }, data) {
      // //转换经纬度坐标 成世界坐标cartesian3
@@ -483,6 +489,16 @@
        },
      });
    },
    MSET_GETAUDIO({ state, commit, dispatch }, val) {
      if (state.audioData) {
        state.audioData = null;
        window.speechSynthesis.cancel();
      } else {
        state.audioData = new window.SpeechSynthesisUtterance();
        state.audioData.text = val;
        window.speechSynthesis.speak(state.audioData);
      }
    },
  },
};