|
|
|
@ -13,11 +13,13 @@ import View from '@/layouts/View.vue' |
|
|
|
import BrandScroll from '@/components/BrandScroll/BrandScroll.vue' |
|
|
|
|
|
|
|
const store = useStore() |
|
|
|
const { config, shopList, indexList } = storeToRefs(store) |
|
|
|
const storeRefs = storeToRefs(store) |
|
|
|
const { config, shopList, indexList } = storeRefs |
|
|
|
const shop = ref(null) |
|
|
|
const selectedList = ref([]) |
|
|
|
|
|
|
|
Promise.all([getBrandListByFloor()]).then(([_brandList]) => { |
|
|
|
if (storeRefs.shop.value) shop.value = storeRefs.shop.value |
|
|
|
const recMap = indexList.value.recommendList.reduce((acc, { shopId }) => ({ ...acc, [shopId]: true }), {}) |
|
|
|
const list = _brandList.data.list |
|
|
|
selectedList.value = list.map(({ name, shopList: _shopList }) => ({ name, shopList: _shopList.filter(({ shopId }) => recMap[shopId]) })) |
|
|
|
|