Commit 021ddb87 by 李伟康

commit

1 parent c9b92b9a
...@@ -222,6 +222,10 @@ export default { ...@@ -222,6 +222,10 @@ export default {
videoUrl: '' videoUrl: ''
} }
}, },
// activated(){
// console.log('--------------------')
// if(window.$AUDIO) window.$AUDIO.toggleBGM()
// },
mounted () { mounted () {
let _this = this let _this = this
let jsApiList = ['getLocation', 'openLocation', 'getNetworkType', 'onMenuShareAppMessage', 'launchMiniprogram', 'updateAppMessageShareData'] let jsApiList = ['getLocation', 'openLocation', 'getNetworkType', 'onMenuShareAppMessage', 'launchMiniprogram', 'updateAppMessageShareData']
...@@ -285,7 +289,7 @@ export default { ...@@ -285,7 +289,7 @@ export default {
} }
if (data.activityMusic) { if (data.activityMusic) {
this.$nextTick(() => { this.$nextTick(() => {
this.audio = new Audio(data.activityMusic, () => { window.$AUDIO = new Audio(data.activityMusic, () => {
this.musicOff = false this.musicOff = false
this.audioFlag = true this.audioFlag = true
}) })
...@@ -353,11 +357,11 @@ export default { ...@@ -353,11 +357,11 @@ export default {
audioAutoPlay (off = false) { audioAutoPlay (off = false) {
if (off === true) { if (off === true) {
this.musicOff = true this.musicOff = true
this.audio.toggleBGM(true) window.$AUDIO.toggleBGM(true)
return return
} }
this.musicOff = !this.musicOff this.musicOff = !this.musicOff
this.audio.toggleBGM() window.$AUDIO.toggleBGM()
}, },
playVideo (index) { playVideo (index) {
let _this = this, let _this = this,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!