gemercheung 3 năm trước cách đây
mục cha
commit
8a2f0ff90b
3 tập tin đã thay đổi với 30 bổ sung8 xóa
  1. 1 0
      pages/webview/index.js
  2. 11 0
      pages/webview/index.wxml
  3. 18 8
      socket.js

+ 1 - 0
pages/webview/index.js

@@ -26,6 +26,7 @@ Page({
     showInvitation: false,
     roomMaximum: false,
     roomDisMiss: false,
+    unKnowError: false, // 未知错误重进
     // url: 'https://www.4dkankan.com/showProPC.html?m=vroMUXdx&origin=4Dplaza&sid=1046051&room_id=1596785144930&user_id=44'
   },
 

+ 11 - 0
pages/webview/index.wxml

@@ -218,6 +218,17 @@
     <cover-view class="bgd roomMaximumBgd" wx:if="{{roomDisMiss}}"></cover-view>
 
 
+
+    <cover-view class="dialog invitation-view single-btn" wx:if="{{unKnowError}}">
+      <cover-view class="title">温馨提示</cover-view>
+      <cover-view class="content">服务器出现未知错误,重新进入或重建房间</cover-view>
+      <cover-view class="btns">
+        <button class="btn" bindtap="exitRoom">确定</button>
+      </cover-view>
+    </cover-view>
+    <cover-view class="bgd roomMaximumBgd" wx:if="{{unKnowError}}"></cover-view>
+
+
     <cover-view class="dialog invitation-view" wx:if="{{showIsEnd}}">
       <cover-view class="title">温馨提示</cover-view>
       <cover-view class="content">一起逛已结束了,是否继续逛</cover-view>

+ 18 - 8
socket.js

@@ -574,16 +574,24 @@ export default {
 
     //全员退出
     socket.on('roomDisMiss', () => {
-      wx.showToast({
-        title: '全员退出',
-      });
-    
-      wx.setData({
+      // wx.showToast({
+      //   title: '全员退出',
+      // });
+
+      this.setData({
         roomDisMiss: true
       })
-      
-      this.exitRoom();
+
+      // this.exitRoom();
     })
+
+    //服务器未知错误重进
+    socket.on('unKnowError', () => {
+      this.setData({
+        unKnowError: true
+      })
+    })
+
     //被动通知开关MIC 要3秒后
     socket.on('serverOnMic', ({
       voiceStatus
@@ -607,7 +615,9 @@ export default {
         }
 
       }, 3000)
-    })
+    });
+
+
 
     this.socketStop = () => {
       if (socket) {