|
@@ -16,14 +16,10 @@
|
|
|
<span>{{ item.name }}</span>
|
|
<span>{{ item.name }}</span>
|
|
|
</el-menu-item>
|
|
</el-menu-item>
|
|
|
</el-menu> -->
|
|
</el-menu> -->
|
|
|
- <el-dropdown class="user_top" trigger="click">
|
|
|
|
|
- <div @click="chanceUser">23333 <i class="el-icon-caret-bottom"></i></div>
|
|
|
|
|
|
|
+ <el-dropdown class="user_top" trigger="click" @command="shopCommand">
|
|
|
|
|
+ <div>{{currentShop}} <i class="el-icon-caret-bottom"></i></div>
|
|
|
<el-dropdown-menu slot="dropdown" class="popper-dropdown-menu-user">
|
|
<el-dropdown-menu slot="dropdown" class="popper-dropdown-menu-user">
|
|
|
- <el-dropdown-item>黄金糕</el-dropdown-item>
|
|
|
|
|
- <el-dropdown-item>狮子头</el-dropdown-item>
|
|
|
|
|
- <el-dropdown-item>螺蛳粉</el-dropdown-item>
|
|
|
|
|
- <el-dropdown-item>双皮奶</el-dropdown-item>
|
|
|
|
|
- <el-dropdown-item>蚵仔煎</el-dropdown-item>
|
|
|
|
|
|
|
+ <el-dropdown-item v-for="(item, index) in shopList" :key="index" :class="{'shopActive': item.id == userInfo.currentShopId}" :command="item">{{item.shopName}}</el-dropdown-item>
|
|
|
</el-dropdown-menu>
|
|
</el-dropdown-menu>
|
|
|
</el-dropdown>
|
|
</el-dropdown>
|
|
|
<div class="flex1"></div>
|
|
<div class="flex1"></div>
|
|
@@ -61,7 +57,8 @@ export default {
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
$projectName: this.$projectName,
|
|
$projectName: this.$projectName,
|
|
|
- index: '0'
|
|
|
|
|
|
|
+ index: '0',
|
|
|
|
|
+ shopList: []
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
|
|
|
|
@@ -72,6 +69,7 @@ export default {
|
|
|
// this.SET_MENU_LIST(i);
|
|
// this.SET_MENU_LIST(i);
|
|
|
// }
|
|
// }
|
|
|
// });
|
|
// });
|
|
|
|
|
+ this.getAllShop()
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
computed: {
|
|
computed: {
|
|
@@ -81,7 +79,17 @@ export default {
|
|
|
return this.shopInfo.smallLogoUrl;
|
|
return this.shopInfo.smallLogoUrl;
|
|
|
}
|
|
}
|
|
|
return '';
|
|
return '';
|
|
|
- }
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ currentShop() {
|
|
|
|
|
+ let str
|
|
|
|
|
+ this.shopList.map(ele => {
|
|
|
|
|
+ console.log(ele.id, this.userInfo.currentShopId)
|
|
|
|
|
+ if(ele.id == this.userInfo.currentShopId) {
|
|
|
|
|
+ str = ele.shopName
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ return str
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
methods: {
|
|
@@ -109,7 +117,20 @@ export default {
|
|
|
});
|
|
});
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
|
|
+ },
|
|
|
|
|
+ shopCommand(item) {
|
|
|
|
|
+ console.log(item)
|
|
|
|
|
+ this.$service.common.toggleShop({shopId: item.id}).then(res => {
|
|
|
|
|
+ console.log('res', res)
|
|
|
|
|
+ }).catch(err => {})
|
|
|
|
|
+ },
|
|
|
|
|
+ // 获取门店
|
|
|
|
|
+ getAllShop() {
|
|
|
|
|
+ this.$service.common.shopAll().then(res => {
|
|
|
|
|
+ console.log(res)
|
|
|
|
|
+ this.shopList = res
|
|
|
|
|
+ }).catch(err => {})
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
// collapse() {
|
|
// collapse() {
|
|
|
// this.COLLAPSE_MENU(!this.menuCollapse);
|
|
// this.COLLAPSE_MENU(!this.menuCollapse);
|
|
@@ -267,5 +288,9 @@ export default {
|
|
|
margin-left: 10px;
|
|
margin-left: 10px;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ .shopActive{
|
|
|
|
|
+ background-color: #ecf5ff!importnat;
|
|
|
|
|
+ color: #66b1ff!importnat;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|