新消息提示

master
Lee1203 2022-08-16 16:56:04 +08:00
parent 93049cf453
commit 45eefe8d73
1 changed files with 16 additions and 14 deletions

View File

@ -417,23 +417,25 @@
console.log("会员上线",msg);
});
//
socket.on('new_msg', (msg)=> {
console.log(msg);
console.log(uni.getStorageSync('ifVoice'),uni.getStorageSync('ifMessage'),55555);
// this.offMusic();
if(uni.getStorageSync('ifVoice') || uni.getStorageSync('ifMessage')){
console.log('进入接收消息');
uni.showToast({
title:msg
})
this.bofang();
}
});
if(uni.getStorageSync('ifMessage')){
socket.on('new_msg', (msg)=> {
console.log(msg,121212)
// this.offMusic();
if(uni.getStorageSync('ifVoice')){
console.log('进入接收消息');
// uni.showToast({
// title:''
// })
this.bofang(msg);
}
});
}
},
bofang(){
bofang(msg){
this.bgmMusic.autoplay = 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.play(()=>{
console.log('背景音乐播放中');