Browse Source

修改bug

cr 4 years ago
parent
commit
fb6d030c11
1 changed files with 31 additions and 27 deletions
  1. 31 27
      src/pages/manage/index.vue

+ 31 - 27
src/pages/manage/index.vue

@@ -4,7 +4,7 @@
4 4
             当前店铺没有门店,请后台添加门店后重试
5 5
         </div>
6 6
         <div v-if="!shopErr">
7
-            <block v-if="showShop">
7
+            <block v-if="showShop && showMenu">
8 8
                 <div class="page__top" v-if="isAdmin">
9 9
                     <div class="name">当前门店:</div>
10 10
                     <div class="shop" v-if="!hideShop" @click="goShopSelect">
@@ -27,16 +27,27 @@
27 27
                     </div>
28 28
                 </div>
29 29
             </block>
30
-            <ul class="menu" v-if="!menuLoading">
31
-                <li
32
-                    class="item"
33
-                    v-for="item of menuList"
34
-                    :key="item.id"
35
-                    @click="jump(item.url)"
36
-                >
37
-                    <my-image class="img" :src="item.icon"></my-image>
38
-                    <span class="text">{{ item.name }}</span>
39
-                </li>
30
+            <block v-if="showMenu">
31
+                <ul class="menu" v-if="!menuLoading">
32
+                    <li
33
+                        class="item"
34
+                        v-for="item of menuList"
35
+                        :key="item.id"
36
+                        @click="jump(item.url)"
37
+                    >
38
+                        <my-image class="img" :src="item.icon"></my-image>
39
+                        <span class="text">{{ item.name }}</span>
40
+                    </li>
41
+                    <li class="item" @click="jump('/pages/manage/user/index')">
42
+                        <my-image
43
+                            class="img"
44
+                            src="/static/icon/user.png"
45
+                        ></my-image>
46
+                        <span class="text">账号设置</span>
47
+                    </li>
48
+                </ul>
49
+            </block>
50
+            <ul class="menu" v-if="!showMenu">
40 51
                 <li class="item" @click="jump('/pages/manage/user/index')">
41 52
                     <my-image
42 53
                         class="img"
@@ -44,20 +55,6 @@
44 55
                     ></my-image>
45 56
                     <span class="text">账号设置</span>
46 57
                 </li>
47
-                <!-- <li class="item" @click="jump('/pages/manage/cashier/index')">
48
-                    <my-image
49
-                        class="img"
50
-                        src="/static/icon/cashier.png"
51
-                    ></my-image>
52
-                    <span class="text">收银</span>
53
-                </li>
54
-                <li class="item" @click="jump('/pages/manage/cashier/list')">
55
-                    <my-image
56
-                        class="img"
57
-                        src="/static/icon/cashier-list.png"
58
-                    ></my-image>
59
-                    <span class="text">历史单据</span>
60
-                </li> -->
61 58
             </ul>
62 59
         </div>
63 60
 
@@ -89,6 +86,7 @@ export default {
89 86
             menuLoading: true,
90 87
             loading: false,
91 88
             showShop: true,
89
+            showMenu: true,
92 90
         };
93 91
     },
94 92
 
@@ -117,6 +115,12 @@ export default {
117 115
                 this.showShop = false;
118 116
             }
119 117
         }
118
+        // 判断页面显示
119
+        if (this.user.roleId && this.user.bundleId !== 0) {
120
+            this.showMenu = true;
121
+        } else {
122
+            this.showMenu = false;
123
+        }
120 124
         this.getUserMenu();
121 125
         this.$refs.tabbar.setIndex(2);
122 126
     },
@@ -170,8 +174,8 @@ export default {
170 174
                 menuList: arr,
171 175
             });
172 176
             let arr2 = [];
173
-            for(let item of arr){
174
-                if(item.id !=='mobile_setting'){
177
+            for (let item of arr) {
178
+                if (item.id !== "mobile_setting") {
175 179
                     arr2.push(item);
176 180
                 }
177 181
             }