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
6bc275e815
commit
47d93bb036
@ -38,7 +38,7 @@ Page({
|
||||
getAllRoomInfoRq().then(res => {
|
||||
console.log('getAllRoomInfoRq', res);
|
||||
_this.setData({
|
||||
roomList : res.rows
|
||||
roomList : res.data
|
||||
})
|
||||
})
|
||||
},
|
||||
|
@ -295,6 +295,20 @@ 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('链接已经关闭')
|
||||
};
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
@ -306,7 +320,9 @@ Page({
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
let _this = this
|
||||
// 初始化socket
|
||||
_this.initSocket()
|
||||
},
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user