解决冲突

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);
}); });
// //
if(uni.getStorageSync('ifMessage')){
socket.on('new_msg', (msg)=> { socket.on('new_msg', (msg)=> {
console.log(msg); console.log(msg,121212)
// this.offMusic(); // this.offMusic();
if(uni.getStorageSync('ifVoice') || uni.getStorageSync('ifMessage')){ if(uni.getStorageSync('ifVoice')){
console.log('进入接收消息'); console.log('进入接收消息');
uni.showToast({ // uni.showToast({
title:msg // 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('背景音乐播放中');