liyongli 2 years ago
parent
commit
55632525cd
5 changed files with 13 additions and 34 deletions
  1. 5 6
      src/App.vue
  2. 1 0
      src/main.js
  3. 6 3
      src/router/index.js
  4. 1 1
      src/views/coffee/index.vue
  5. 0 24
      src/views/report/index.vue

+ 5 - 6
src/App.vue

@@ -1,19 +1,18 @@
 <template>
   <div id="app">
-    <router-view />
+    <router-view :key="$route.fullPath" />
   </div>
 </template>
 
 <script>
-import '@vant/touch-emulator';
+import "@vant/touch-emulator";
 export default {
   name: "App",
-  data(){
-    return {}
+  data() {
+    return {};
   },
   methods: {},
-  mounted() {
-  },
+  mounted() {},
   components: {},
 };
 </script>

+ 1 - 0
src/main.js

@@ -9,6 +9,7 @@ Vue.use(ElementUI);
 
 router.beforeEach((to, from, next) => {
   if (to.meta.title) document.title = to.meta.title;
+  if (to.path === '/traditional' || to.path === '/advertisement') return next();
   if (!localStorage.user) {
     // apply 必须拿到oa用户数据
     getUser(() => next())

+ 6 - 3
src/router/index.js

@@ -8,6 +8,7 @@ import coffee from "./coffee";
 import report from "./report";
 // http://djweb.smcic.net/hair/index.html#/appointment
 const router = new VueRouter({
+  mode: "hash",
   routes: [
     {
       path: "/",
@@ -48,7 +49,9 @@ const router = new VueRouter({
       path: "/actionSheet",
       name: "ActionSheet",
       component: () =>
-        import(/* webpackChunkName: "actionSheet" */ "../views/ActionSheet.vue"),
+        import(
+          /* webpackChunkName: "actionSheet" */ "../views/ActionSheet.vue"
+        ),
       meta: {
         title: "汽车保险",
       },
@@ -84,8 +87,8 @@ const router = new VueRouter({
     //    咖啡
     ...coffee,
     //   周报
-    ...report
-  ]
+    ...report,
+  ],
 });
 
 export default router;

+ 1 - 1
src/views/coffee/index.vue

@@ -1,6 +1,6 @@
 <template>
   <div class="skeleton_coffee">
-    <router-view class="main_coffee" />
+    <router-view class="main_coffee" :key="$route.fullPath" />
     <van-tabbar active-color="#ee0a24" v-model="active">
       <van-tabbar-item name="Drinks" icon="home-o" url="#/coffee">点餐</van-tabbar-item>
       <van-tabbar-item name="Orders" icon="orders-o" url="#/coffee/orders">

+ 0 - 24
src/views/report/index.vue

@@ -1,24 +0,0 @@
-<template>
-  <router-view class="main_coffee" />
-</template>
-
-<script>
-export default {
-  name: "Report",
-  data() {
-    return {};
-  },
-  mounted() {},
-  computed: {},
-  methods: {},
-  beforeUnmount: function () {},
-  components: {},
-};
-</script>
-
-<style>
-.main_coffee {
-  width: 100vw;
-  height: calc(100% - 50px);
-}
-</style>