嘉兴绿城濮院
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

26 lines
916 B

import { useStore } from '@/store/root'
import { getConfig, getFacilitiesList } from '@/http/api/base'
import { getShopAndBuildingList } from '@/http/api/shop'
import { getCurrentFloor } from '@/http/api/building'
import Message from '@/base/Message/Message'
export const useInitConfigAndMallInfo = async () => {
try {
const _config = await getConfig()
const store = useStore()
store.SET_CONFIG(_config.data)
const [_currentFloor, _shopAndBuilding, _facilityList] = await Promise.all([
getCurrentFloor(),
getShopAndBuildingList(),
getFacilitiesList()
])
const { shopList, buildingList } = _shopAndBuilding.data
store.SET_CURRENT_FLOOR(_currentFloor.data)
store.SET_SHOP_LIST(shopList)
store.SET_BUILDING_LIST(buildingList)
store.SET_FACILITY_LIST(_facilityList.data)
} catch (error) {
Message({ text: '获取数据失败', type: 'success' })
}
}