Browse Source

feat: 响应新导视4.1菜单方面的变动

ShangHai_LongXiang
jiannibang 3 years ago
parent
commit
226efd70e8
  1. 10
      src/components/PublicComponent/Tabs.vue
  2. 5
      src/store/root/getters.js
  3. 6
      src/views/Index/Index.vue

10
src/components/PublicComponent/Tabs.vue

@ -1,8 +1,8 @@
<template> <template>
<div class="tabs" v-if="menuList.find(({ content: { path } }) => path === $route.path)">
<div :class="['item', tab.content.path === $route.path ? 'active' : '']" v-for="(tab, i) of menuList" :key="tab.id" @click="goPage(tab)">
<div class="icon"><img :src="theme.images[tab.content.moduleName]" /></div>
<div class="title">{{ tab.content.name }}</div>
<div class="tabs" v-if="menuList.find(({ routePath }) => routePath === $route.path)">
<div :class="['item', tab.routePath === $route.path ? 'active' : '']" v-for="(tab, i) of menuList" :key="tab.id" @click="goPage(tab)">
<div class="icon"><img :src="theme.images[tab.routePath.slice(1)]" /></div>
<div class="title">{{ tab.moduleName }}</div>
<div class="count" v-if="i === 0 && activityCount">{{ activityCount }}</div> <div class="count" v-if="i === 0 && activityCount">{{ activityCount }}</div>
</div> </div>
</div> </div>
@ -19,7 +19,7 @@ const router = useRouter()
const store = useStore() const store = useStore()
const { menuList, theme } = storeToRefs(store) const { menuList, theme } = storeToRefs(store)
const goPage = item => { const goPage = item => {
router.push(item.content.path)
router.push(item.routePath)
} }
getActivityList().then(({ data }) => { getActivityList().then(({ data }) => {

5
src/store/root/getters.js

@ -1,8 +1,5 @@
import arrows from '../arrows/arrows' import arrows from '../arrows/arrows'
const DEVICE = {
WINDOWS: 'windows',
ANDROID: 'android'
}
export const currentBuildingFloorsList = state => { export const currentBuildingFloorsList = state => {
const currentBuilding = state.buildingList.find(building => building.buildingCode === state.currentFloor.buildingCode) const currentBuilding = state.buildingList.find(building => building.buildingCode === state.currentFloor.buildingCode)
return currentBuilding?.floorList ?? [] return currentBuilding?.floorList ?? []

6
src/views/Index/Index.vue

@ -110,8 +110,8 @@
<div class="menu"> <div class="menu">
<div class="item" v-for="tab of menuList" :key="tab.id" @click="goMenu(tab)"> <div class="item" v-for="tab of menuList" :key="tab.id" @click="goMenu(tab)">
<div class="icon"><img :src="theme.images[tab.content.moduleName]" /></div>
<div class="title">{{ tab.content.name }}</div>
<div class="icon"><img :src="theme.images[tab.routePath.slice(1)]" /></div>
<div class="title">{{ tab.moduleName }}</div>
</div> </div>
</div> </div>
<div class="acts"> <div class="acts">
@ -190,7 +190,7 @@ getBrandList().then(({ data: { allShopNum, industryFatherList } }) => {
const goPage = item => router.push(item.path) const goPage = item => router.push(item.path)
const goMenu = item => router.push(item.content.path)
const goMenu = item => router.push(item.routePath)
const setShopById = id => { const setShopById = id => {
const shop = shopList.value.find(_shop => _shop.shopCode === id) const shop = shopList.value.find(_shop => _shop.shopCode === id)

Loading…
Cancel
Save