lmc 1 рік тому
батько
коміт
3e20845003
1 змінених файлів з 39 додано та 41 видалено
  1. 39 41
      src/views/home.vue

+ 39 - 41
src/views/home.vue

@@ -61,12 +61,7 @@
           v-for="(item, index) in functionList"
           :key="index"
           :style="{ display: !item.role.includes(role) ? 'none' : '' }"
-          @click="
-            toPath(
-              role == 'Tenant' ? item.path : '/bill/detail',
-              item.activeTab
-            )
-          "
+          @click="toPath(item.path, item.activeTab)"
         >
           <template v-if="item.role.includes(role)">
             <van-image :src="item.src" width="36" height="36" fit="contain" />
@@ -310,42 +305,44 @@
     </div>
   </div>
   <!-- 底部tabbar -->
-  <van-tabbar
-    v-model="activeTabBar"
-    active-color="#2E69EB"
-    inactive-color="#0c1935"
-  >
-    <van-tabbar-item
-      name="home"
-      :icon="
-        activeTabBar == 'home'
-          ? require('@/assets/home-active.svg')
-          : require('@/assets/home.svg')
-      "
-      to="/home"
-      >首页</van-tabbar-item
-    >
-    <van-tabbar-item
-      name="rentBill"
-      :icon="
-        activeTabBar == 'bill'
-          ? require('@/assets/rent-bill-active.svg')
-          : require('@/assets/rent-bill.svg')
-      "
-      to="/bill/list"
-      >租户账单</van-tabbar-item
-    >
-    <van-tabbar-item
-      name="remoteControl"
-      :icon="
-        activeTabBar == 'remoteControl'
-          ? require('@/assets/remote-control-active.svg')
-          : require('@/assets/remote-control.svg')
-      "
-      to="/remoteControl"
-      >远程管控</van-tabbar-item
+  <template v-if="role == 'admin'">
+    <van-tabbar
+      v-model="activeTabBar"
+      active-color="#2E69EB"
+      inactive-color="#0c1935"
     >
-  </van-tabbar>
+      <van-tabbar-item
+        name="home"
+        :icon="
+          activeTabBar == 'home'
+            ? require('@/assets/home-active.svg')
+            : require('@/assets/home.svg')
+        "
+        to="/home"
+        >首页</van-tabbar-item
+      >
+      <van-tabbar-item
+        name="rentBill"
+        :icon="
+          activeTabBar == 'bill'
+            ? require('@/assets/rent-bill-active.svg')
+            : require('@/assets/rent-bill.svg')
+        "
+        to="/bill/list"
+        >租户账单</van-tabbar-item
+      >
+      <van-tabbar-item
+        name="remoteControl"
+        :icon="
+          activeTabBar == 'remoteControl'
+            ? require('@/assets/remote-control-active.svg')
+            : require('@/assets/remote-control.svg')
+        "
+        to="/remoteControl"
+        >远程管控</van-tabbar-item
+      >
+    </van-tabbar>
+  </template>
 </template>
 <script>
 import { isEmpty, getDictDataList } from "@/utils/index.js";
@@ -490,6 +487,7 @@ export default {
           tenantName: this.tenantInfo.tenantName,
           activeTab: val,
         };
+        path = "/bill/detail";
       }
       this.$router.push({
         path: path,