|
@@ -125,6 +125,9 @@ import wxJs from "jweixin-module"
|
|
|
},
|
|
},
|
|
|
isAJAX:false,
|
|
isAJAX:false,
|
|
|
index:0,
|
|
index:0,
|
|
|
|
|
+ audioServe:undefined,
|
|
|
|
|
+ isPlay:false,
|
|
|
|
|
+ isAutoPlay:false,
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
onshow() {
|
|
onshow() {
|
|
@@ -136,8 +139,33 @@ import wxJs from "jweixin-module"
|
|
|
if(isWeiXin){
|
|
if(isWeiXin){
|
|
|
this.getJsConfig()
|
|
this.getJsConfig()
|
|
|
}
|
|
}
|
|
|
|
|
+ this.musicPlay()
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ musicPlay() {
|
|
|
|
|
+ if (!this.audioServe) {
|
|
|
|
|
+ this.audioServe = uni.createInnerAudioContext();
|
|
|
|
|
+ this.audioServe.autoplay = true;
|
|
|
|
|
+ this.audioServe.loop = true;
|
|
|
|
|
+ this.audioServe.obeyMuteSwitch = true;
|
|
|
|
|
+ this.audioServe.src = 'https://jhnewshop.oss-cn-chengdu.aliyuncs.com/RockHouseJail.mp3';
|
|
|
|
|
+ }
|
|
|
|
|
+ this.audioServe.play();
|
|
|
|
|
+ this.audioServe.onPlay(() => {
|
|
|
|
|
+ this.isPlay = true;
|
|
|
|
|
+ this.isAutoPlay = true
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
|
|
+ musicPause() {
|
|
|
|
|
+ if (this.audioServe) {
|
|
|
|
|
+ this.audioServe.pause();
|
|
|
|
|
+ this.audioServe.onPause(() => {
|
|
|
|
|
+ this.isPlay = false;
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
getJsConfig(){
|
|
getJsConfig(){
|
|
|
console.log(window.location)
|
|
console.log(window.location)
|
|
|
let url = window.location.href.split('#')[0];
|
|
let url = window.location.href.split('#')[0];
|