Browse Source

取消ios重连提示

heyang 4 years ago
parent
commit
df7db414ce
2 changed files with 41 additions and 36 deletions
  1. 28 24
      screenIos/WXdraw.js
  2. 13 12
      screenIos/WXtrialInterface.html

+ 28 - 24
screenIos/WXdraw.js

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

+ 13 - 12
screenIos/WXtrialInterface.html

@@ -462,18 +462,19 @@
 				decodeWoker.postMessage(event.data);
 			}
 			if (event.data === 'close') {
-				$.confirm({
-					title: '提示',
-					text: '连接断开,是否准备重连?',
-					onOK: function () {
-						webSocketWorker.postMessage('restart');
-					},
-					onCancel: function () {
-						wx.miniProgram.switchTab({
-							url: '/pages/home/home'
-						})
-					}
-				});
+				webSocketWorker.postMessage('restart');
+				// $.confirm({
+				// 	title: '提示',
+				// 	text: '连接断开,是否准备重连?',
+				// 	onOK: function () {
+				// 		webSocketWorker.postMessage('restart');
+				// 	},
+				// 	onCancel: function () {
+				// 		wx.miniProgram.switchTab({
+				// 			url: '/pages/home/home'
+				// 		})
+				// 	}
+				// });
 			}
 		}