|
|
|
|
|
|
|
|
// websocket初始化 |
|
|
// websocket初始化 |
|
|
initWebSocket: function () { |
|
|
initWebSocket: function () { |
|
|
var _this = this; |
|
|
var _this = this; |
|
|
let { customerId, sendMemberId } = this.data; |
|
|
|
|
|
|
|
|
let { receiveMemberId, sendMemberId } = this.data; |
|
|
// console.log() |
|
|
// console.log() |
|
|
//建立连接 |
|
|
//建立连接 |
|
|
wx.connectSocket({ |
|
|
wx.connectSocket({ |
|
|
url: `ws://192.168.18.138/webSocket/{"userno":${customerId},"messageModule":"008"}`,//本地 |
|
|
|
|
|
|
|
|
url: `ws://192.168.18.138/webSocket/{"userno":${receiveMemberId},"messageModule":"008"}`,//本地 |
|
|
success: function () { |
|
|
success: function () { |
|
|
console.log('websocket连接成功~') |
|
|
console.log('websocket连接成功~') |
|
|
}, |
|
|
}, |