Browse Source

fix: 🧩 store action类型错误

pull/1/head
jiangx 3 years ago
parent
commit
6b1966c2fd
  1. 2
      public/static/offline/JSON/getBackTime.json
  2. 2
      src/composables/useInitConfigAndMallInfo.ts
  3. 32
      src/composables/useInitMap.ts
  4. 2
      src/http/api/base/index.ts

2
public/static/offline/JSON/getBackTime.json

@ -1 +1 @@
{"code":200,"msg":"操作成功","data":[60,5]}
{"code":200,"msg":"操作成功","data":[60,15]}

2
src/composables/useInitConfigAndMallInfo.ts

@ -22,7 +22,7 @@ export const useInitConfigAndMallInfo = async () => {
]) ])
const { shopList, buildingList } = _shopAndBuilding.data const { shopList, buildingList } = _shopAndBuilding.data
store.SET_CURRENT_FLOOR(_DeviceInfo.data)
store.SET_DEVICE(_DeviceInfo.data)
store.SET_SHOP_LIST(shopList) store.SET_SHOP_LIST(shopList)
store.SET_BUILDING_LIST(buildingList) store.SET_BUILDING_LIST(buildingList)
store.SET_BRAND_INFO(_brandInfo.data) store.SET_BRAND_INFO(_brandInfo.data)

32
src/composables/useInitMap.ts

@ -14,22 +14,22 @@ export const useInitMap = async function () {
})) }))
//初始化地图 //初始化地图
window.MainMap_QM.init(
() => {
store.SET_MAP_STATUS(true)
window.Map_QM.addEventListener('shop', onClickShop, false)
window.Map_QM.renderer.domElement.addEventListener('webglcontextlost', onContextLost)
},
{
build: device.value?.buildingOrder ?? 0,
floor: device.value.floorOrder,
navPoint: device.value.location,
angle: device.value.angle,
iconUrl: delPrefixOfFacilityList,
mapData: data,
shopData: shopList.value.slice()
}
)
// window.MainMap_QM.init(
// () => {
// store.SET_MAP_STATUS(true)
// window.Map_QM.addEventListener('shop', onClickShop, false)
// window.Map_QM.renderer.domElement.addEventListener('webglcontextlost', onContextLost)
// },
// {
// build: device.value?.buildingOrder ?? 0,
// floor: device.value.floorOrder,
// navPoint: device.value.location,
// angle: device.value.angle,
// iconUrl: delPrefixOfFacilityList,
// mapData: data,
// shopData: shopList.value.slice()
// }
// )
} catch (error) { } catch (error) {
Message({ text: '获取地图数据失败', type: 'success' }) Message({ text: '获取地图数据失败', type: 'success' })
} }

2
src/http/api/base/index.ts

@ -8,7 +8,7 @@ export const getConfig = () => request<Config>({ url: '/static/offline/JSON/conf
export const getWeather = () => request<Weather>({ url: `/JSON/GetWeather.json` }) export const getWeather = () => request<Weather>({ url: `/JSON/GetWeather.json` })
//获取设施列表 //获取设施列表
export const getFacilitiesList = () => request<Facility[]>({ url: `/JSON/GetFacilitiesList.json` })
export const getFacilitiesList = () => request<Facility[]>({ url: `/JSON/getFacilityList.json` })
//地图模型数据 //地图模型数据
export const getMapData = () => request({ url: `/JSON/getMap.json` }) export const getMapData = () => request({ url: `/JSON/getMap.json` })

Loading…
Cancel
Save