heyang 3 年之前
父節點
當前提交
c23e72c958
共有 2 個文件被更改,包括 47 次插入15 次删除
  1. 19 6
      screenAndroid/WXdraw.js
  2. 28 9
      screenAndroid/WXtrialInterface.html

+ 19 - 6
screenAndroid/WXdraw.js

@@ -72,9 +72,15 @@ function doConnect() {
 		wsss.close();
 		throttle(doConnect,100);
 		if(errorTime > 1000){
-			wx.miniProgram.switchTab({
-				url: '/pages/home/home'
-			})
+			if(navigator.userAgent.toLowerCase().includes('toutiaomicroapp')){
+				tt.miniProgram.switchTab({
+					url: '/pages/home/home'
+				})
+			}else{
+				wx.miniProgram.switchTab({
+					url: '/pages/home/home'
+				})
+			}
 		}
 	};
 	wsss.onerror = function (evt) {
@@ -82,9 +88,16 @@ function doConnect() {
 		wsss.close();
 		throttle(doConnect,100);
 		if(errorTime > 1000){
-			wx.miniProgram.switchTab({
-				url: '/pages/home/home'
-			})
+			if(navigator.userAgent.toLowerCase().includes('toutiaomicroapp')){
+				tt.miniProgram.switchTab({
+					url: '/pages/home/home'
+				})
+			}else{
+				wx.miniProgram.switchTab({
+					url: '/pages/home/home'
+				})
+			}
+			
 		}
 	};
 }

+ 28 - 9
screenAndroid/WXtrialInterface.html

@@ -105,6 +105,7 @@
 	<body oncontextmenu="Back()">
 	</body>
 	<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.3.2.js"></script>
+	<script src="https://lf1-cdn-tos.bytegoofy.com/goofy/developer/jssdk/jssdk-1.0.3.js"></script>
 	<script type="text/javascript" src="../static/js/jquery-1.11.0.min.js"></script>
 	<script type="text/javascript" src="helper.js"></script>
 	<script type="text/javascript" src="pcm-player.js"></script>
@@ -199,9 +200,15 @@
 				ws.close();
 				throttle(doConnect, 100);
 				if (errorTime > 1000) {
-					wx.miniProgram.switchTab({
-						url: '/pages/home/home'
-					})
+					if(navigator.userAgent.toLowerCase().includes('toutiaomicroapp')){
+						tt.miniProgram.switchTab({
+							url: '/pages/home/home'
+						})
+					}else{
+						wx.miniProgram.switchTab({
+							url: '/pages/home/home'
+						})
+					}
 				}
 			}
 
@@ -215,9 +222,15 @@
 				ws.close();
 				throttle(doConnect, 100);
 				if (errorTime > 1000) {
-					wx.miniProgram.switchTab({
-						url: '/pages/home/home'
-					})
+					if(navigator.userAgent.toLowerCase().includes('toutiaomicroapp')){
+						tt.miniProgram.switchTab({
+							url: '/pages/home/home'
+						})
+					}else{
+						wx.miniProgram.switchTab({
+							url: '/pages/home/home'
+						})
+					}
 				}
 			});
 			ws.addEventListener('message', function (event) {
@@ -761,9 +774,15 @@
 		})
 
 		$("#upload").on("click", function () {
-			wx.miniProgram.switchTab({
-				url: '/pages/home/home'
-			})
+			if(navigator.userAgent.toLowerCase().includes('toutiaomicroapp')){
+				tt.miniProgram.switchTab({
+					url: '/pages/home/home'
+				})
+			}else{
+				wx.miniProgram.switchTab({
+					url: '/pages/home/home'
+				})
+			}
 		})
 
 		function selectText(x) {