-
当前 Bug 的表现(可附上截图) showLoading会在连接websocket时自动关闭。loading代码在前或在后结果都一样,自动关闭
-
预期表现
- 复现路径
- 提供一个最简复现 Demo
wx.showLoading({
title: ‘loading’,
mask: true
})
var socketTask = wx.connectSocket({
url: ‘ws://’
})
socketTask.onMessage(this.onSocketMessage);
socketTask.onClose(this.onSocketClose);
socketTask.onError(this.onSocketError);
wx.showLoading({
title: ‘loading’,
mask: true
})
wx.showLoading({
title: ‘loading’,
mask: true
})
let url = ‘ws://121.40.165.18:8800’
wx.connectSocket({
url: url,
success: function(res) {
console.log(‘连接成功’)
console.log(res)
},
fail: function(res) {
console.log(‘连接失败’)
console.log(res)
}
})
wx.onSocketOpen(function(res) {
console.log(‘WebSocket连接已打开!’)
wx.hideLoading()
console.log(‘关闭loading’)
})