qingyiay
2023-05-16 72935b2a35765bcc3622561bb06f2eccd64caf83
pages/tabbar-page/index-tabbar/index-tabbar.vue
@@ -40,7 +40,10 @@
      freightForwarderIndex
   },
   computed: {
      ...mapState(['globalweighHouseCode', 'globalweigh'])
      ...mapState(['globalweighHouseCode', 'globalweigh', 'globalisconnect'])
   },
   watch: {
      globalisconnect(v, oldv) {}
   },
   //首页下拉刷新
   onPullDownRefresh() {
@@ -111,18 +114,6 @@
            console.log('开启双人通话成功Complete');
         }
      });
      let amap = require('../../../utils/amap-wx.130.js');
      let amapPlugin = new amap.AMapWX({
         key: 'e3106700a6225e6a25727d3a41fa54c5'
      });
      amapPlugin.getRegeo({
         success: data => {
            console.log(data, '获取位置');
         },
         fail: info => {
            console.log(info, '错误信息');
         }
      });
   },
   data() {
      return {
@@ -134,15 +125,12 @@
         messagePushShow: false,
         messageList: {},
         isconnect: false,
         dotShow: false,
         amapPlugin: null,
         key: 'e3106700a6225e6a25727d3a41fa54c5',
         addressName: ''
         dotShow: false
      };
   },
   onShow() {
      this.init();
      if (!this.isconnect) {
      if (!this.globalisconnect || !this.isconnect) {
         this.initWebsocket();
      }
      this.userAuthorization();
@@ -150,7 +138,10 @@
   },
   onHide() {
      console.log('页面隐藏');
      if (!this.isconnect) {
      // this.isconnect = false;
      // this.changeisconnect(false);
      // socket.close();
      if (!this.globalisconnect || !this.isconnect) {
         this.initWebsocket();
      }
   },
@@ -160,7 +151,7 @@
      clearInterval(this.intervalId);
   },
   methods: {
      ...mapMutations(['pushMessage', 'changeWeigh', 'changeinfraredStatus']),
      ...mapMutations(['pushMessage', 'changeWeigh', 'changeinfraredStatus', 'changeisconnect']),
      messagePage() {
         uni.navigateTo({
            url: '/pages/public-page/message/message'
@@ -239,6 +230,7 @@
            complete: res => {
               console.log(res, 'socket结果');
               if (res.errMsg == 'connectSocket:ok') {
                  this.changeisconnect(true);
                  this.isconnect = true;
               }
            }
@@ -294,7 +286,7 @@
         this.$reqGet('getMessageByUser', { current: 1, size: 10 }).then(res => {
            if (res.code == 0) {
               this.messageList = res.data.records;
               this.messageList.map(v => {
               this.messageList.forEach(v => {
                  if (v.status !== 1) {
                     this.dotShow = true;
                  } else {