| | |
| | | :preview-src-list="popupImgAtlas" |
| | | ref="popupImgs"> |
| | | </el-image> |
| | | |
| | | <audio ref="audioControlPlay" |
| | | style="position: fixed; left: 111111111px;" |
| | | v-html="audioSource" |
| | | @ended="overAudio"> |
| | | </audio> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | tabBtnFlag: '教学科研行政', |
| | | QRCodeFlag: false, |
| | | audioSource: '', |
| | | audioFlag: false |
| | | audioFlag: false, |
| | | audioCourse: false, |
| | | audioSynth: null, |
| | | audioMsg: null |
| | | } |
| | | }, |
| | | computed: { |
| | |
| | | }, |
| | | created () { |
| | | this.DC = global.DC |
| | | |
| | | this.audioSynth = window.speechSynthesis |
| | | this.audioMsg = new window.SpeechSynthesisUtterance() |
| | | |
| | | this.audioMsg.onend = function () { |
| | | this.audioSynth.cancel() |
| | | this.audioFlag = false |
| | | this.audioCourse = false |
| | | } |
| | | }, |
| | | watch: { |
| | | introduceText: { |
| | | immediate: true, |
| | | handler (newQuestion, oldQuestion) { |
| | | var zhText = encodeURI(newQuestion) |
| | | this.audioSource = `<source src="http://tts.baidu.com/text2audio?lan=zh&ie=UTF-8&spd=4&text=${zhText}" type="audio/mpeg"><embed height="0" width="0" src="http://tts.baidu.com/text2audio?text=${zhText}">` |
| | | this.audioSource = newQuestion |
| | | if (this.audioFlag == true) { |
| | | this.audioSynth.cancel() |
| | | this.audioFlag = false |
| | | this.audioCourse = false |
| | | } |
| | | } |
| | | }, |
| | | teachList: { |
| | |
| | | handler (newCode, oldCode) { |
| | | if (newCode.length > 0 && this.teachList.length == 0) { |
| | | this.tabBtnFlag = '生活服务' |
| | | } |
| | | } |
| | | }, |
| | | detailsPopup: { |
| | | immediate: true, |
| | | handler (newCode, oldCode) { |
| | | if (newCode == false) { |
| | | this.audioSynth.cancel() |
| | | this.audioFlag = false |
| | | this.audioCourse = false |
| | | } else { |
| | | if (this.audioFlag == true) { |
| | | this.audioSynth.cancel() |
| | | this.audioFlag = false |
| | | this.audioCourse = false |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | panoramaClick () { |
| | | if (this.audioFlag == true) { |
| | | this.$refs.audioControlPlay.pause() |
| | | this.audioSynth.cancel() |
| | | this.audioFlag = false |
| | | this.audioCourse = false |
| | | } |
| | | |
| | | // eslint-disable-next-line new-cap |
| | | var positions = this.DC.Transform.transformWGS84ToCartesian(new this.DC.Position.fromArray(this.pointPosition)) |
| | | this.viewer.scene.globe.depthTestAgainstTerrain = false |
| | |
| | | |
| | | monitorClick () { |
| | | if (this.audioFlag == true) { |
| | | this.$refs.audioControlPlay.pause() |
| | | this.audioSynth.cancel() |
| | | this.audioFlag = false |
| | | this.audioCourse = false |
| | | } |
| | | // eslint-disable-next-line new-cap |
| | | var positions = this.DC.Transform.transformWGS84ToCartesian(new this.DC.Position.fromArray(this.pointPosition)) |
| | |
| | | |
| | | closeMapPopupBox () { |
| | | if (this.audioFlag == true) { |
| | | this.$refs.audioControlPlay.pause() |
| | | this.audioSynth.cancel() |
| | | this.audioFlag = false |
| | | this.audioCourse = false |
| | | } |
| | | this.audioSource = '' |
| | | this.$store.commit('SET_DETAILSPOPUP', false) |
| | | }, |
| | | |
| | |
| | | }, |
| | | |
| | | audioPlay () { |
| | | if (this.audioSource == '') { |
| | | var zhText = encodeURI(this.$refs.DomIntroduceText.innerText) |
| | | this.audioSource = `<source src="http://tts.baidu.com/text2audio?lan=zh&ie=UTF-8&spd=4&text=${zhText}" type="audio/mpeg"><embed height="0" width="0" src="http://tts.baidu.com/text2audio?text=${zhText}">` |
| | | this.$refs.audioControlPlay.play() |
| | | if (this.audioFlag == false) { |
| | | this.audioMsg.text = this.audioSource |
| | | this.audioSynth.speak(this.audioMsg) |
| | | this.audioFlag = true |
| | | this.audioCourse = true |
| | | } else { |
| | | if (this.audioFlag == true) { |
| | | this.$refs.audioControlPlay.pause() |
| | | this.audioFlag = false |
| | | if (this.audioCourse == true) { |
| | | this.audioSynth.pause() |
| | | this.audioCourse = false |
| | | } else { |
| | | this.$refs.audioControlPlay.play() |
| | | this.audioFlag = true |
| | | this.audioSynth.resume() |
| | | this.audioCourse = true |
| | | } |
| | | } |
| | | }, |
| | | |
| | | overAudio () { |
| | | this.audioFlag = false |
| | | }, |
| | | |
| | | mechanismDetailPopup (num, param) { |
| | |
| | | |
| | | this.newPopup(result) |
| | | this.viewer.flyToPosition( |
| | | new this.DC.Position(Number(result.jd), Number(result.wd), 3000, Number(result.heading), Number(result.pitch), Number(result.roll)), |
| | | new this.DC.Position(Number(result.jd), Number(result.wd), 300, Number(result.heading), Number(result.pitch), Number(result.roll)), |
| | | function () { |
| | | }, |
| | | 3 |