Browse Source

Merge branch 'feature_20241231_计划外列表页面刷新优化' into uat(dev)

# Conflicts:
#	src/store/getters.js
#	src/views/deviceOutside/index.vue
zhujindu 11 months ago
parent
commit
3a08d1c10f

+ 1 - 0
src/store/getters.js

@@ -3,5 +3,6 @@ const getters = {
   refreshClewPage: (state) => state.isRefreshPage.refreshClewPage,
   storeType: (state) => state.user.storeType,
   shotsNum: (state) => state.otheStore.shotsNum,
+  deviceOutsidePage: (state) => state.isRefreshPage.deviceOutsidePage,
 };
 export default getters;

+ 8 - 1
src/store/modules/isRefreshPage.js

@@ -1,18 +1,25 @@
 const isRefreshPage = {
   state: {
-    refreshClewPage: false,
+    refreshClewPage: false, //刷新客资页面
+    deviceOutsidePage: false, //刷新计划外页面
   },
 
   mutations: {
     SET_REFRESH_CLEW_PAGE: (state, value) => {
       state.refreshClewPage = value;
     },
+    SET_DEVICE_OUTSIDE_PAGE: (state, value) => {
+      state.deviceOutsidePage = value;
+    },
   },
 
   actions: {
     setRefreshClewPage({ commit }, value) {
       commit('SET_REFRESH_CLEW_PAGE', value);
     },
+    setDeviceOutsidePage({ commit }, value) {
+      commit('SET_DEVICE_OUTSIDE_PAGE', value);
+    },
   },
 };
 

+ 239 - 287
src/views/deviceOutside/index.vue

@@ -534,9 +534,16 @@ import xmgj from '@/assets/xmgj.png';
 import { getOrderUrlByStoreId } from '@/api/inventory';
 import { checkStoreAddressByStoreCode } from '@/api/visitstore';
 import { getPosition, getMapPoi, getkeywordPoi, getTicketFun } from '@/utils/TXApiFun';
+import { mapState } from 'vuex';
+import store from '@/store';
 export default {
   name: 'outsidelist',
   components: { tabBar, mapmarker },
+  computed: {
+    ...mapState({
+      deviceOutsidePage: (state) => state.isRefreshPage.deviceOutsidePage,
+    }),
+  },
   data() {
     return {
       yichang: yichang,
@@ -622,121 +629,128 @@ export default {
     };
   },
   watch: {
-    $route(to, from) {
-      this.storeName = localStorage.getItem('outvstoreName');
-      this.chainName = localStorage.getItem('outvchainName');
-      if (localStorage.getItem('lat') != null) {
-        this.lat = localStorage.getItem('lat');
-        this.lon = localStorage.getItem('lon');
-      } else {
-        this.lat = '';
-        this.lon = '';
-      }
+    deviceOutsidePage: {
+      handler(val) {
+        if (val) this.initData();
+        store.dispatch('setDeviceOutsidePage', false);
+      },
+      immediate: true,
+    },
+    // $route(to, from) {
+    //   this.storeName = localStorage.getItem('outvstoreName');
+    //   this.chainName = localStorage.getItem('outvchainName');
+    //   if (localStorage.getItem('lat') != null) {
+    //     this.lat = localStorage.getItem('lat');
+    //     this.lon = localStorage.getItem('lon');
+    //   } else {
+    //     this.lat = '';
+    //     this.lon = '';
+    //   }
 
-      if (localStorage.getItem('outvstoreLabelTypes') != null) {
-        this.storeLabelTypes = localStorage.getItem('outvstoreLabelTypes').split(',');
-      } else {
-        this.storeLabelTypes = [];
-      }
+    //   if (localStorage.getItem('outvstoreLabelTypes') != null) {
+    //     this.storeLabelTypes = localStorage.getItem('outvstoreLabelTypes').split(',');
+    //   } else {
+    //     this.storeLabelTypes = [];
+    //   }
 
-      if (localStorage.getItem('outvstoreCategoryList') != null) {
-        this.result = localStorage.getItem('outvstoreCategoryList').split(',');
-        this.storeLabelTypes = [];
-        this.storeCategoryList = this.result.join(',');
-      } else {
-        this.result = [];
-        this.storeCategoryList = this.result.join(',');
-      }
-      this.chainCode = localStorage.getItem('outvchainCode');
-      this.storeName = localStorage.getItem('outvstoreName');
-      if (
-        (from.path == '/My/index' && to.path == '/outsidelist/index') ||
-        (from.path == '/home' && to.path == '/outsidelist/index') ||
-        (from.path == '/deviceWithin/index' && to.path == '/outsidelist/index') ||
-        (from.path == '/storemanagement/index' && to.path == '/outsidelist/index')
-      ) {
-        this.tabVal = '1';
-      } else {
-        if (localStorage.getItem('tabVal') != null) {
-          this.tabVal = localStorage.getItem('tabVal');
-        }
-      }
-      if (
-        (from.path == '/storeDetail' && to.path == '/outsidelist/index') ||
-        (from.path == '/storeGroup' && to.path == '/outsidelist/index') ||
-        (from.path == '/suishenbangOutstoreVisit' && to.path == '/outsidelist/index') ||
-        (from.path == '/outabnormalVisit' && to.path == '/outsidelist/index') ||
-        (from.path == '/home' && to.path == '/outsidelist/index') ||
-        (from.path == '/deviceWithin/index' && to.path == '/outsidelist/index') ||
-        (from.path == '/storemanagement/index' && to.path == '/outsidelist/index') ||
-        (from.path == '/My/index' && to.path == '/outsidelist/index')
-      ) {
-        this.onSearch();
-      }
-      var postType = localStorage.getItem('postType');
-      if (postType == 'GZ') {
-        this.addShow1 = false;
-        this.otherShow = true;
-      } else {
-        this.addShow1 = true;
-        this.otherShow = false;
-      }
-      if (localStorage.getItem('postType') == 'JZ' || localStorage.getItem('postType') == 'GZ') {
-        this.mapShows = false;
-      } else {
-        this.mapShows = true;
-      }
-      this.getMonth();
-    },
+    //   if (localStorage.getItem('outvstoreCategoryList') != null) {
+    //     this.result = localStorage.getItem('outvstoreCategoryList').split(',');
+    //     this.storeLabelTypes = [];
+    //     this.storeCategoryList = this.result.join(',');
+    //   } else {
+    //     this.result = [];
+    //     this.storeCategoryList = this.result.join(',');
+    //   }
+    //   this.chainCode = localStorage.getItem('outvchainCode');
+    //   this.storeName = localStorage.getItem('outvstoreName');
+    //   if (
+    //     (from.path == '/My/index' && to.path == '/outsidelist/index') ||
+    //     (from.path == '/home' && to.path == '/outsidelist/index') ||
+    //     (from.path == '/deviceWithin/index' && to.path == '/outsidelist/index') ||
+    //     (from.path == '/storemanagement/index' && to.path == '/outsidelist/index')
+    //   ) {
+    //     this.tabVal = '1';
+    //   } else {
+    //     if (localStorage.getItem('tabVal') != null) {
+    //       this.tabVal = localStorage.getItem('tabVal');
+    //     }
+    //   }
+    //   if (
+    //     (from.path == '/storeDetail' && to.path == '/outsidelist/index') ||
+    //     (from.path == '/storeGroup' && to.path == '/outsidelist/index') ||
+    //     (from.path == '/suishenbangOutstoreVisit' && to.path == '/outsidelist/index') ||
+    //     (from.path == '/outabnormalVisit' && to.path == '/outsidelist/index') ||
+    //     (from.path == '/home' && to.path == '/outsidelist/index') ||
+    //     (from.path == '/deviceWithin/index' && to.path == '/outsidelist/index') ||
+    //     (from.path == '/storemanagement/index' && to.path == '/outsidelist/index') ||
+    //     (from.path == '/My/index' && to.path == '/outsidelist/index')
+    //   ) {
+    //     this.onSearch();
+    //   }
+    //   var postType = localStorage.getItem('postType');
+    //   if (postType == 'GZ') {
+    //     this.addShow1 = false;
+    //     this.otherShow = true;
+    //   } else {
+    //     this.addShow1 = true;
+    //     this.otherShow = false;
+    //   }
+    //   if (localStorage.getItem('postType') == 'JZ' || localStorage.getItem('postType') == 'GZ') {
+    //     this.mapShows = false;
+    //   } else {
+    //     this.mapShows = true;
+    //   }
+    //   this.getMonth();
+    // },
   },
   created() {
-    this.storeName = localStorage.getItem('outvstoreName');
-    this.chainName = localStorage.getItem('outvchainName');
-    if (localStorage.getItem('outvstoreLabelTypes') != null) {
-      this.storeLabelTypes = localStorage.getItem('outvstoreLabelTypes').split(',');
-    } else {
-      this.storeLabelTypes = [];
-    }
-    if (localStorage.getItem('outvstoreCategoryList') != null) {
-      this.result = localStorage.getItem('outvstoreCategoryList').split(',');
-      this.storeCategoryList = this.result.join(',');
-    } else {
-      this.result = [];
-      this.storeCategoryList = this.result.join(',');
-    }
-    this.chainCode = localStorage.getItem('outvchainCode');
-    this.storeName = localStorage.getItem('outvstoreName');
-    if (localStorage.getItem('tabVal') == null || this.$route.query.info != 'y') {
-      if (this.$route.query.info != undefined) {
-        if (this.$route.query.info.indexOf('y') != -1) {
-          this.tabVal = localStorage.getItem('tabVal');
-        } else {
-          this.tabVal = '1';
-        }
-      } else {
-        this.tabVal = localStorage.getItem('tabVal');
-      }
-    } else {
-      this.tabVal = localStorage.getItem('tabVal');
-    }
-    if (localStorage.getItem('postType') == 'JZ' || localStorage.getItem('postType') == 'GZ') {
-      this.mapShows = false;
-    } else {
-      this.mapShows = true;
-    }
-    this.query = this.$route.query;
-    localStorage.removeItem('visitId');
-    this.getStoreTypeList();
-    this.getStoreLabels();
-    var postType = localStorage.getItem('postType');
-    if (postType == 'GZ') {
-      this.addShow1 = false;
-      this.otherShow = true;
-    } else {
-      this.addShow1 = true;
-      this.otherShow = false;
-    }
-    this.getMonth();
+    // this.storeName = localStorage.getItem('outvstoreName');
+    // this.chainName = localStorage.getItem('outvchainName');
+    // if (localStorage.getItem('outvstoreLabelTypes') != null) {
+    //   this.storeLabelTypes = localStorage.getItem('outvstoreLabelTypes').split(',');
+    // } else {
+    //   this.storeLabelTypes = [];
+    // }
+    // if (localStorage.getItem('outvstoreCategoryList') != null) {
+    //   this.result = localStorage.getItem('outvstoreCategoryList').split(',');
+    //   this.storeCategoryList = this.result.join(',');
+    // } else {
+    //   this.result = [];
+    //   this.storeCategoryList = this.result.join(',');
+    // }
+    // this.chainCode = localStorage.getItem('outvchainCode');
+    // this.storeName = localStorage.getItem('outvstoreName');
+    // if (localStorage.getItem('tabVal') == null || this.$route.query.info != 'y') {
+    //   if (this.$route.query.info != undefined) {
+    //     if (this.$route.query.info.indexOf('y') != -1) {
+    //       this.tabVal = localStorage.getItem('tabVal');
+    //     } else {
+    //       this.tabVal = '1';
+    //     }
+    //   } else {
+    //     this.tabVal = localStorage.getItem('tabVal');
+    //   }
+    // } else {
+    //   this.tabVal = localStorage.getItem('tabVal');
+    // }
+    // if (localStorage.getItem('postType') == 'JZ' || localStorage.getItem('postType') == 'GZ') {
+    //   this.mapShows = false;
+    // } else {
+    //   this.mapShows = true;
+    // }
+    // this.query = this.$route.query;
+    // localStorage.removeItem('visitId');
+    // this.getStoreTypeList();
+    // this.getStoreLabels();
+    // var postType = localStorage.getItem('postType');
+    // if (postType == 'GZ') {
+    //   this.addShow1 = false;
+    //   this.otherShow = true;
+    // } else {
+    //   this.addShow1 = true;
+    //   this.otherShow = false;
+    // }
+    // this.getMonth();
   },
   mounted() {
     // 上拉边界下拉出现白色空白
@@ -756,6 +770,48 @@ export default {
     handleTouch(e) {
       e._isScroller = true;
     },
+    initData() {
+      // 筛选-门店标签
+      if (localStorage.getItem('outvstoreLabelTypes') != null) {
+        this.storeLabelTypes = localStorage.getItem('outvstoreLabelTypes').split(',');
+      } else {
+        this.storeLabelTypes = [];
+      }
+      this.storeName = localStorage.getItem('outvstoreName'); //搜索框内容
+      this.chainName = localStorage.getItem('outvchainName'); //筛选-经销商名称搜索
+      this.chainCode = localStorage.getItem('outvchainCode'); //筛选-经销商Code
+      // 地图是否显示 家装和工装不显示
+      if (localStorage.getItem('postType') == 'JZ' || localStorage.getItem('postType') == 'GZ') {
+        this.mapShows = false;
+      } else {
+        this.mapShows = true;
+      }
+      // 筛选-店型选择
+      if (localStorage.getItem('outvstoreCategoryList') != null) {
+        this.result = localStorage.getItem('outvstoreCategoryList').split(',');
+        this.storeCategoryList = this.result.join(',');
+      } else {
+        this.result = [];
+        this.storeCategoryList = this.result.join(',');
+      }
+      // 当前tabs,0:销售部;1:我的
+      if (localStorage.getItem('tabVal')) {
+        this.tabVal = localStorage.getItem('tabVal');
+      } else {
+        this.tabVal = '1';
+      }
+      this.query = this.$route.query; // 路由参数
+      localStorage.removeItem('visitId');
+      if (localStorage.getItem('postType') == 'GZ') {
+        this.addShow1 = false;
+        this.otherShow = true; //筛选-其他
+      } else {
+        this.addShow1 = true;
+        this.otherShow = false; //筛选-其他
+      }
+      this.onSearch();
+      this.getMonth();
+    },
     setStroeNameStyle(item) {
       // 家装或工装 approvalStatus:是否结案 0:未结案,1:已结案
       if (
@@ -942,9 +998,11 @@ export default {
       this.moreTypeShow = false;
     },
     getStoreLabels() {
-      getStoreLabels().then((res) => {
-        this.StoreLabels = res.data;
-      });
+      if (this.StoreLabels.length == 0) {
+        getStoreLabels().then((res) => {
+          this.StoreLabels = res.data;
+        });
+      }
     },
     searchType(val) {
       this.storeTypeLists = [];
@@ -983,10 +1041,12 @@ export default {
       this.onSearch();
     },
     getStoreTypeList() {
-      getStoreTypeListlp({}).then((res) => {
-        this.storeTypeLists = res.data;
-        this.storeTypeList = res.data;
-      });
+      if (this.storeTypeLists.length == 0) {
+        getStoreTypeListlp({}).then((res) => {
+          this.storeTypeLists = res.data;
+          this.storeTypeList = res.data;
+        });
+      }
     },
     buryingPointFn(val) {
       this.buryingPoint({
@@ -1045,8 +1105,11 @@ export default {
       });
     },
     searchFn() {
-      this.showPicker = true;
-      this.CustomerName = '';
+      //获取门店类型  //获取门店标签
+      Promise.all([this.getStoreTypeList(), this.getStoreLabels()]).then(() => {
+        this.showPicker = true;
+        this.CustomerName = '';
+      });
     },
     moreSearch() {
       this.onSearch();
@@ -1433,6 +1496,8 @@ export default {
         positionDesc: '',
         accuracy: res.accuracy,
       });
+      // 进入拜访之前先刷新页面
+      this.onSearch();
       this.$router.push({
         path: '/suishenbangOutstoreVisit',
         query: {
@@ -1776,175 +1841,62 @@ export default {
             localStorage.setItem('chainNameR', val.storeName);
           } else {
             if (this.flag) {
-              this.flag = false;
-              this.timer = null;
-              this.timer = setTimeout(() => {
-                this.flag = true;
-              }, 2000);
-
-              let loading1 = this.$toast.loading({
-                duration: 0,
-                message: '加载中...',
-                forbidClick: true,
-              });
-              let url = window.location.href;
-              let that = this;
-              let wx = this.wx;
-              let qiyeData;
-              const instance = axios.create();
-              instance.defaults.headers.common['userId'] = localStorage.getItem('loginName');
-              instance
-                .get(process.env.VUE_APP_BASE_API + 'mobile/wx/ticket', {
-                  params: {
-                    url: url,
-                  },
+              getPosition()
+                .then((res) => {
+                  let { TXisBD, resData } = res;
+                  this.lat = TXisBD.lat;
+                  this.lon = TXisBD.lon;
+                  localStorage.setItem('lat', this.lat);
+                  localStorage.setItem('lon', this.lon);
+                  let PointSum = this.twoPointSum(
+                    TXisBD.lat,
+                    TXisBD.lon,
+                    TXisBD.lat,
+                    TXisBD.lon
+                  ).toFixed(2);
+                  // 先刷新页面
+                  this.onSearch();
+                  this.$router.push({
+                    path: '/outabnormalVisit',
+                    query: {
+                      storeId: val.storeId,
+                      rdId: val.rdId,
+                      lat: this.lat,
+                      lon: this.lon,
+                      visitId: val.visitId,
+                      pageType: 'out',
+                      visitModel: localStorage.getItem('postType') != 'GZ' ? '5' : '3',
+                      storeCode: val.storeCode,
+                      tabVal: this.tabVal,
+                      latNew: TXisBD.lat,
+                      lonNew: TXisBD.lon,
+                      PointSum: PointSum,
+                      marklat: resData.latitude,
+                      marklon: resData.longitude,
+                    },
+                  });
+                  localStorage.setItem('startTime', new Date());
+                  localStorage.setItem('ORGName', val.deptName);
+                  localStorage.setItem('chainNameR', val.storeName);
+                  addVisitsPosition({
+                    storeId: val.storeId,
+                    visitsId: '',
+                    lon: resData.longitude,
+                    lat: resData.latitude,
+                    sourceLon: location.lon,
+                    sourceLat: location.lat,
+                    positionDesc: '',
+                    accuracy: resData.accuracy,
+                  });
+                  localStorage.setItem('startTime', new Date());
+                  localStorage.setItem('ORGName', val.deptName);
+                  localStorage.setItem('chainNameR', val.storeName);
                 })
-                .then((response) => {
-                  if (response.status == 200) {
-                    this.cont = 3;
-                    var flat = true;
-                    var times = setInterval(() => {
-                      this.cont--;
-                      if (this.cont == '0') {
-                        if (flat) {
-                          loading1.clear();
-                          clearInterval(times);
-                          that.$dialog
-                            .alert({
-                              message: '定位失败,请开启企微定位权限',
-                            })
-                            .then(() => {
-                              this.$router.go(-1);
-                            });
-                        } else {
-                          clearInterval(times);
-                        }
-                      }
-                    }, 1000);
-                    qiyeData = response.data.data;
-                    wx.config({
-                      beta: true, // 必须这么写,否则wx.invoke调用形式的jsapi会有问题
-                      debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
-                      appId: qiyeData.appId, // 必填,企业微信的corpID
-                      timestamp: qiyeData.timestamp, // 必填,生成签名的时间戳
-                      nonceStr: qiyeData.nonceStr, // 必填,生成签名的随机串
-                      signature: qiyeData.signature, // 必填,签名,见 附录-JS-SDK使用权限签名算法
-                      jsApiList: ['ready', 'getLocation'], // 必填,需要使用的JS接口列表,凡是要调用的接口都需要传进来
-                    });
-                    wx.ready(function () {
-                      wx.getLocation({
-                        type: 'gcj02',
-                        success: function (res) {
-                          flat = false;
-                          loading1.clear();
-                          var location = that.CJ02BD(res.latitude, res.longitude);
-                          if (val.lat == '' || val.lat == null) {
-                            that.lat = location.lat;
-                            that.lon = location.lon;
-                          }
-                          let PointSum = that
-                            .twoPointSum(that.lat, that.lon, location.lat, location.lon)
-                            .toFixed(2);
-
-                          if (PointSum > 500 && localStorage.getItem('postType') != 'GZ') {
-                            // that.$dialog
-                            //   .confirm({
-                            //     confirmButtonText: '确定',
-                            //     cancelButtonText: '取消',
-                            //     title: '系统提示',
-                            //     message: '定位距离偏差大',
-                            //     closeOnClickOverlay: true,
-                            //   })
-                            //   .then(() => {
-                            that.$router.push({
-                              path: '/outabnormalVisit',
-                              query: {
-                                storeId: val.storeId,
-                                rdId: val.rdId,
-                                lat: that.lat,
-                                lon: that.lon,
-                                visitId: val.visitId,
-                                pageType: 'out',
-                                visitModel: '5',
-                                storeCode: val.storeCode,
-                                tabVal: that.tabVal,
-                                latNew: location.lat,
-                                lonNew: location.lon,
-                                PointSum: PointSum,
-                                marklat: res.latitude,
-                                marklon: res.longitude,
-                              },
-                            });
-                            localStorage.setItem('startTime', new Date());
-                            localStorage.setItem('ORGName', val.deptName);
-                            localStorage.setItem('chainNameR', val.storeName);
-                            // })
-                            // .catch(() => {
-                            //   // that.abnormalVisit(val)
-                            // });
-                          } else {
-                            that.$router.push({
-                              path: '/outabnormalVisit',
-                              query: {
-                                storeId: val.storeId,
-                                rdId: val.rdId,
-                                lat: that.lat,
-                                lon: that.lon,
-                                visitId: val.visitId,
-                                pageType: 'out',
-                                visitModel: '3',
-                                storeCode: val.storeCode,
-                                tabVal: that.tabVal,
-                                latNew: location.lat,
-                                lonNew: location.lon,
-                                PointSum: PointSum,
-                                marklat: res.latitude,
-                                marklon: res.longitude,
-                              },
-                            });
-                            localStorage.setItem('startTime', new Date());
-                            localStorage.setItem('ORGName', val.deptName);
-                            localStorage.setItem('chainNameR', val.storeName);
-                          }
-                          addVisitsPosition({
-                            storeId: val.storeId,
-                            visitsId: '',
-                            lon: res.longitude,
-                            lat: res.latitude,
-                            sourceLon: location.lon,
-                            sourceLat: location.lat,
-                            positionDesc: '',
-                            accuracy: res.accuracy,
-                          });
-                        },
-                        fail: function () {
-                          loading1.clear();
-                          that.$dialog
-                            .alert({
-                              message: 'GPS未开启',
-                            })
-                            .then(() => {
-                              // that.abnormalVisit(val)
-                            });
-                        },
-                      });
-                    });
-                    wx.error(function (res) {
-                      loading1.clear();
-                      that.$dialog
-                        .alert({
-                          message: '定位失败,请开启企微定位权限',
-                        })
-                        .then(() => {});
-                    });
-                  } else {
-                    loading1.clear();
-                    this.$toast.fail(dataList.msg);
-                  }
+                .catch((error) => {
+                  this.$dialog.alert({
+                    message: error,
+                  });
                 });
-              localStorage.setItem('startTime', new Date());
-              localStorage.setItem('ORGName', val.deptName);
-              localStorage.setItem('chainNameR', val.storeName);
             }
           }
         } else {

+ 4 - 2
src/views/deviceOutside/suishenbangOutstoreVisit.vue

@@ -124,6 +124,7 @@ import {
 } from '@/api/index';
 import axios from 'axios';
 import { saveVisitsParams, getOrderUrlByStoreId } from '@/api/inventory';
+import store from '@/store';
 export default {
   name: 'suishenbangOutstoreVisit',
   data() {
@@ -262,9 +263,8 @@ export default {
                   message: '拜访中任务结束成功!',
                 })
                 .then(() => {
-                  // this.$router.replace({});
+                  store.dispatch('setDeviceOutsidePage', true);
                   this.onClickLeft();
-                  // window.location.replace(window.location.origin + '/mobile/outsidelist/index');
                 });
             } else {
               this.$dialog.alert({
@@ -565,6 +565,7 @@ export default {
       if (this.$route.query.urltype == 1) {
         window.location.replace(window.location.origin + '/mobile/home');
       } else {
+        // 返回上一页不会刷新页面
         this.$router.go(-1);
       }
     },
@@ -632,6 +633,7 @@ export default {
           loading1.clear();
           if (res.code == 200) {
             this.editDwellTimes();
+            store.dispatch('setDeviceOutsidePage', true);
             if (this.$route.query.linkType == 6) {
               window.location.replace(window.location.origin + '/mobile/topStore?info=y');
             } else {

+ 1 - 0
src/views/home/login.vue

@@ -25,6 +25,7 @@ export default {
       localStorage.clear();
       if (this.name.trim() != '') {
         store.commit('SET_USER_INFO', null);
+        store.dispatch('setDeviceOutsidePage', true);
         // 当前设备:PC/mobile
         let isDevice = window.navigator.userAgent.match(
           /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i