|
|
@ -1,4 +1,4 @@ |
|
|
import { getConfig, getCurrentFloor, getGuideList, getTheme, getQMGoShopData, getMenuList, getFoodIIndustryList } from '@/http/api' |
|
|
|
|
|
|
|
|
import { getConfig, getCurrentFloor, getGuideList, getTheme, getQMGoShopData, getMenuList, getFoodIIndustryList, getWeather } from '@/http/api' |
|
|
import { useStore } from '@/store/root' |
|
|
import { useStore } from '@/store/root' |
|
|
import VConsole from 'vconsole' |
|
|
import VConsole from 'vconsole' |
|
|
|
|
|
|
|
|
@ -41,9 +41,18 @@ export const useInitConfigAndMallInfo = async () => { |
|
|
const { buildingList, shopList } = _guideList.data |
|
|
const { buildingList, shopList } = _guideList.data |
|
|
store.SET_SHOP_LIST(shopList.filter(({ yaxis }) => !!yaxis)) |
|
|
store.SET_SHOP_LIST(shopList.filter(({ yaxis }) => !!yaxis)) |
|
|
store.SET_BUILDING_LIST(buildingList) |
|
|
store.SET_BUILDING_LIST(buildingList) |
|
|
|
|
|
let weather = {} |
|
|
|
|
|
try { |
|
|
|
|
|
const { data } = await getWeather() |
|
|
|
|
|
console.log(data) |
|
|
|
|
|
weather = data |
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
console.log(error) |
|
|
|
|
|
} |
|
|
const { |
|
|
const { |
|
|
data: { searchList, recommendList } |
|
|
data: { searchList, recommendList } |
|
|
} = await getQMGoShopData() |
|
|
} = await getQMGoShopData() |
|
|
const shopMap = shopList.reduce((acc, nxt) => ({ ...acc, [nxt.shopCode]: nxt }), {}) |
|
|
const shopMap = shopList.reduce((acc, nxt) => ({ ...acc, [nxt.shopCode]: nxt }), {}) |
|
|
store.SET_INDEX_LIST({ recommendList, hotSearch: searchList.filter(({ shopName }) => shopName).map(item => ({ ...item, ...shopMap[item.shopCode] })) }) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
store.SET_INDEX_LIST({ ...weather, recommendList, hotSearch: searchList.filter(({ shopName }) => shopName).map(item => ({ ...item, ...shopMap[item.shopCode] })) }) |
|
|
} |
|
|
} |
|
|
|