|
|
@ -1,4 +1,4 @@ |
|
|
import { getConfig, getCurrentFloor, getGuideList, getTheme, getQMGoShopData, getMenuList } from '@/http/api' |
|
|
|
|
|
|
|
|
import { getConfig, getCurrentFloor, getGuideList, getTheme, getQMGoShopData, getMenuList, getFoodIIndustryList } from '@/http/api' |
|
|
import { useStore } from '@/store/root' |
|
|
import { useStore } from '@/store/root' |
|
|
import VConsole from 'vconsole' |
|
|
import VConsole from 'vconsole' |
|
|
|
|
|
|
|
|
@ -22,6 +22,14 @@ export const useInitConfigAndMallInfo = async () => { |
|
|
const { data: menuList } = await getMenuList() |
|
|
const { data: menuList } = await getMenuList() |
|
|
store.SET_MENU_LIST(menuList) |
|
|
store.SET_MENU_LIST(menuList) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
const { data: foodIndustryList } = await getFoodIIndustryList() |
|
|
|
|
|
store.SET_FOOD_INDUSTRY_MAP(foodIndustryList.reduce((acc, nxt) => ({ ...acc, [nxt.content.industryCode]: true }), {})) |
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
console.log(error) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
store.SET_CONFIG(_config.data) |
|
|
store.SET_CONFIG(_config.data) |
|
|
|
|
|
|
|
|
const _currentFloor = await getCurrentFloor() |
|
|
const _currentFloor = await getCurrentFloor() |
|
|
@ -34,5 +42,6 @@ export const useInitConfigAndMallInfo = async () => { |
|
|
const { |
|
|
const { |
|
|
data: { searchList, recommendList } |
|
|
data: { searchList, recommendList } |
|
|
} = await getQMGoShopData() |
|
|
} = await getQMGoShopData() |
|
|
store.SET_INDEX_LIST({ recommendList, hotSearch: searchList }) |
|
|
|
|
|
|
|
|
const shopMap = shopList.reduce((acc, nxt) => ({ ...acc, [nxt.shopCode]: nxt }), {}) |
|
|
|
|
|
store.SET_INDEX_LIST({ recommendList, hotSearch: searchList.map(item => ({ ...item, ...shopMap[item.shopCode] })) }) |
|
|
} |
|
|
} |
|
|
|