解决冲突

master
chen 2022-08-16 16:57:33 +08:00
commit 2e8aaea60f
1 changed files with 15 additions and 13 deletions

View File

@ -417,22 +417,24 @@
console.log("会员上线",msg); console.log("会员上线",msg);
}); });
// //
socket.on('new_msg', (msg)=> { if(uni.getStorageSync('ifMessage')){
console.log(msg); socket.on('new_msg', (msg)=> {
// this.offMusic(); console.log(msg,121212)
if(uni.getStorageSync('ifVoice') || uni.getStorageSync('ifMessage')){ // this.offMusic();
console.log('进入接收消息'); if(uni.getStorageSync('ifVoice')){
uni.showToast({ console.log('进入接收消息');
title:msg // uni.showToast({
}) // title:''
this.bofang(); // })
} this.bofang(msg);
}); }
});
}
}, },
bofang(){ bofang(msg){
this.bgmMusic.autoplay = true;// this.bgmMusic.autoplay = true;//
// this.bgmMusic.loop = true;// // this.bgmMusic.loop = true;//
this.bgmMusic.src = 'https://img-cdn2.yespik.com/sound/00/29/33/70/293370_548da270e343f070330174bd880d2e83.mp3';// this.bgmMusic.src = msg;//
this.bgmMusic.volume = 1;// this.bgmMusic.volume = 1;//
this.bgmMusic.play(()=>{ this.bgmMusic.play(()=>{
console.log('背景音乐播放中'); console.log('背景音乐播放中');