新消息提示
							parent
							
								
									93049cf453
								
							
						
					
					
						commit
						45eefe8d73
					
				|  | @ -417,23 +417,25 @@ | ||||||
| 					console.log("会员上线",msg); | 					console.log("会员上线",msg); | ||||||
| 				}); | 				}); | ||||||
| 				// 接收消息 | 				// 接收消息 | ||||||
| 				socket.on('new_msg',  (msg)=> { | 				if(uni.getStorageSync('ifMessage')){ | ||||||
| 					console.log(msg); | 					socket.on('new_msg',  (msg)=> { | ||||||
| 					console.log(uni.getStorageSync('ifVoice'),uni.getStorageSync('ifMessage'),55555); | 						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('背景音乐播放中'); | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue