mirror of
https://gitee.com/elegant_wings/dbd-meeting-wx-small.git
synced 2025-06-21 18:59:36 +08:00
1
This commit is contained in:
parent
47d93bb036
commit
abc07be3aa
@ -5,8 +5,9 @@
|
||||
.roomContainer {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-evenly;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 0 30rpx;
|
||||
}
|
||||
|
||||
.roomContainer .roomItem {
|
||||
|
@ -297,16 +297,15 @@ Page({
|
||||
|
||||
// 初始化socket
|
||||
initSocket() {
|
||||
const ws = new WebSocket("ws:///222.184.49.22:8081/websocket-server");
|
||||
ws.onopen = function () {
|
||||
console.log('链接建立成功')
|
||||
};
|
||||
ws.onmessage = function (evt) {
|
||||
console.log(evt.data)
|
||||
};
|
||||
ws.onclose = function () {
|
||||
console.log('链接已经关闭')
|
||||
};
|
||||
let socketTask = wx.connectSocket({
|
||||
url: 'ws:///222.184.49.22:8081/websocket-server',
|
||||
header: {
|
||||
'content-type': 'application/json'
|
||||
}
|
||||
})
|
||||
socketTask.onMessage(res=>{
|
||||
console.log('onMessage' , res);
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user