ZaiZai 2 år sedan
förälder
incheckning
38b0b60264
2 ändrade filer med 5 tillägg och 5 borttagningar
  1. 4 4
      httpApi/request/socket.js
  2. 1 1
      pages/index/index.vue

+ 4 - 4
httpApi/request/socket.js

@@ -43,14 +43,14 @@ export default class HcSocket {
         //连接失败
         this.socketTask.onError(function(res) {
             console.log('socket 连接打开失败,请检查!');
-            //进入重新连接
-            setTimeout(() => {
-                _this.connectSocket();
-            }, 3000)
         })
         //监听连接关闭
         this.socketTask.onClose((e) => {
             console.log('socket 连接关闭!');
+            //进入重新连接
+            setTimeout(() => {
+                _this.connectSocket();
+            }, 3000)
         })
         //收到的消息
         this.socketTask.onMessage(function({data}) {

+ 1 - 1
pages/index/index.vue

@@ -10,7 +10,7 @@
             </view>
         </template>
         <view class="relative px-5" v-if="msgCountData.taskCount > 0">
-            <uni-notice-bar show-icon :text="`您有${msgCountData.taskCount}条待办任务,请注意及时处理`" @click="toTaskPage"/>
+            <uni-notice-bar class="radius" show-icon :text="`您有${msgCountData.taskCount}条待办任务,请注意及时处理`" @click="toTaskPage"/>
         </view>
         <template v-if="!isListType">
             <view class="hc-flex-conten mt-4">