Browse Source

feat: 首页品牌美食过滤未落位店铺

v1.0.1
jiannibang 3 years ago
parent
commit
f2e26a2ed5
  1. 2
      src/views/Guide/Guide.vue
  2. 4
      src/views/Index/Index.vue

2
src/views/Guide/Guide.vue

@ -191,7 +191,7 @@ function changeFloor(index) {
selectedShopList.value = shopList.value.map(brand => ({ selectedShopList.value = shopList.value.map(brand => ({
...brand, ...brand,
shopList: brand.shopList shopList: brand.shopList
.filter(item => item.floor === floor.floor)
.filter(item => item.floor === floor.floor && item.yaxis)
.map(item => { .map(item => {
const meta = currentFloorShopMap.value[item.shopCode] const meta = currentFloorShopMap.value[item.shopCode]
return { ...item, ...(meta ? meta : {}) } return { ...item, ...(meta ? meta : {}) }

4
src/views/Index/Index.vue

@ -159,7 +159,7 @@ const store = useStore()
const { indexList, currentFloor, buildingList, shopList, sidebarList, config, theme } = storeToRefs(store) const { indexList, currentFloor, buildingList, shopList, sidebarList, config, theme } = storeToRefs(store)
const guideDesc = ref('') const guideDesc = ref('')
const foodList = computed(() => { const foodList = computed(() => {
const arr = shopList.value.filter(({ isSpecial }) => isSpecial)
const arr = shopList.value.filter(({ isSpecial, yaxis }) => isSpecial && yaxis)
if (arr.length > 12) { if (arr.length > 12) {
while (arr.length % 4 !== 0) { while (arr.length % 4 !== 0) {
arr.push(arr[Math.floor(Math.random() * arr.length)]) arr.push(arr[Math.floor(Math.random() * arr.length)])
@ -169,7 +169,7 @@ const foodList = computed(() => {
}) })
const hotRecommend = computed(() => indexList?.value?.hotSearch?.slice(0, 5) ?? []) const hotRecommend = computed(() => indexList?.value?.hotSearch?.slice(0, 5) ?? [])
const recommendShops = computed(() => { const recommendShops = computed(() => {
const arr = indexList?.value?.recommendList
const arr = indexList?.value?.recommendList.filter(({ yaxis }) => !!yaxis)
if (arr.length > 12) { if (arr.length > 12) {
while (arr.length % 4 !== 0) { while (arr.length % 4 !== 0) {
arr.push(arr[Math.floor(Math.random() * arr.length)]) arr.push(arr[Math.floor(Math.random() * arr.length)])

Loading…
Cancel
Save