|
@@ -49,11 +49,19 @@ function doConnect() {
|
|
|
}
|
|
|
wsss.send(ExexuteMove(JSON.stringify(bitRate), form.sn))
|
|
|
};
|
|
|
- wsss.onclose = function (event) {
|
|
|
- alert("websocket连接断开");
|
|
|
- wx.miniProgram.switchTab({
|
|
|
- url: '/pages/home/home'
|
|
|
- })
|
|
|
+ wsss.onclose = function () {
|
|
|
+ $.confirm({
|
|
|
+ title: '提示',
|
|
|
+ text: '连接断开,是否准备重连?',
|
|
|
+ onOK: function () {
|
|
|
+ doConnect();
|
|
|
+ },
|
|
|
+ onCancel: function () {
|
|
|
+ wx.miniProgram.switchTab({
|
|
|
+ url: '/pages/home/home'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ });
|
|
|
};
|
|
|
}
|
|
|
$('#box').on("click", function () {
|