Browse Source

bugfix:处理刷新后无法返回上个页面的问题

leo 1 year ago
parent
commit
fc79c8bb23
1 changed files with 7 additions and 4 deletions
  1. 7 4
      static/webRtcYJ/WXtrialInterface.html

+ 7 - 4
static/webRtcYJ/WXtrialInterface.html

@@ -453,7 +453,7 @@
       );
       );
       window.addEventListener('message', function (e) {
       window.addEventListener('message', function (e) {
         let data = e.data;
         let data = e.data;
-        if (data.bool && isVideo) {
+        if (data.bool && isVideo && !$('#playCanvas').is(':visible')) {
           document.getElementById('playVideo').play();
           document.getElementById('playVideo').play();
           debounceSwitchingScreens();
           debounceSwitchingScreens();
         }
         }
@@ -1966,9 +1966,12 @@
             url: '/pages/home/home',
             url: '/pages/home/home',
           });
           });
         } else {
         } else {
-          uni.webView.navigateBack({
-            delta: 1,
-          });
+          // uni.webView.navigateBack({
+          //   delta: 1,
+          // });
+          parent.postMessage({
+            type: 'exit'
+          }, '*')
         }
         }
       }
       }