|
|
@ -53,13 +53,14 @@ const getMallInfo = async ({ memberID }) => { |
|
|
} = await axios.get( |
|
|
} = await axios.get( |
|
|
`${cdnUrl}/ar/${code}/config.json?t=${new Date().getTime()}` |
|
|
`${cdnUrl}/ar/${code}/config.json?t=${new Date().getTime()}` |
|
|
); |
|
|
); |
|
|
// if (mapUrl) config.mapDataUrl = mapUrl;
|
|
|
|
|
|
// if (shopUrl) config.shopInfoUrl = shopUrl;
|
|
|
|
|
|
|
|
|
if (mapUrl) config.mapDataUrl = mapUrl; |
|
|
|
|
|
if (shopUrl) config.shopInfoUrl = shopUrl; |
|
|
} catch (error) { |
|
|
} catch (error) { |
|
|
console.log("获取config失败"); |
|
|
console.log("获取config失败"); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
const [ |
|
|
const [ |
|
|
|
|
|
recIndexMap, |
|
|
mapDataJSON, |
|
|
mapDataJSON, |
|
|
serverShopInfo, |
|
|
serverShopInfo, |
|
|
facs, |
|
|
facs, |
|
|
@ -68,6 +69,24 @@ const getMallInfo = async ({ memberID }) => { |
|
|
menu, |
|
|
menu, |
|
|
{ shopCouponMap, userLevel }, |
|
|
{ shopCouponMap, userLevel }, |
|
|
] = await Promise.all([ |
|
|
] = await Promise.all([ |
|
|
|
|
|
(async () => { |
|
|
|
|
|
try { |
|
|
|
|
|
const { |
|
|
|
|
|
data: { |
|
|
|
|
|
data: { recommendList }, |
|
|
|
|
|
}, |
|
|
|
|
|
} = await axios.get( |
|
|
|
|
|
`${baseUrl}/api/guidance/v1/web/getBrandShopList?projectCode=${code}` |
|
|
|
|
|
); |
|
|
|
|
|
return recommendList.reduce( |
|
|
|
|
|
(acc, nxt, i) => ({ ...acc, [nxt.shopCode]: i }), |
|
|
|
|
|
{} |
|
|
|
|
|
); |
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
console.error(error); |
|
|
|
|
|
return {}; |
|
|
|
|
|
} |
|
|
|
|
|
})(), |
|
|
(async () => { |
|
|
(async () => { |
|
|
try { |
|
|
try { |
|
|
const { |
|
|
const { |
|
|
@ -126,6 +145,7 @@ const getMallInfo = async ({ memberID }) => { |
|
|
return { shopCouponMap: {} }; |
|
|
return { shopCouponMap: {} }; |
|
|
})(), |
|
|
})(), |
|
|
]); |
|
|
]); |
|
|
|
|
|
|
|
|
mall.name = "SKP"; |
|
|
mall.name = "SKP"; |
|
|
document.title = "成都SKP"; |
|
|
document.title = "成都SKP"; |
|
|
mall.city = "成都"; |
|
|
mall.city = "成都"; |
|
|
@ -189,6 +209,13 @@ const getMallInfo = async ({ memberID }) => { |
|
|
mapData.buildArr.forEach(({ mapData: { parkArea } }) => { |
|
|
mapData.buildArr.forEach(({ mapData: { parkArea } }) => { |
|
|
parkArea.forEach(({ parkNum }) => mall.lots.push(parkNum)); |
|
|
parkArea.forEach(({ parkNum }) => mall.lots.push(parkNum)); |
|
|
}); |
|
|
}); |
|
|
|
|
|
mall.shops = shopInfo.reduce((acc, { shopList }) => acc.concat(shopList), []); |
|
|
|
|
|
mall.sortedShops = [...mall.shops]; |
|
|
|
|
|
mall.sortedShops.sort( |
|
|
|
|
|
(a, b) => |
|
|
|
|
|
(a.shopCode in recIndexMap ? recIndexMap[a.shopCode] : Infinity) - |
|
|
|
|
|
(b.shopCode in recIndexMap ? recIndexMap[b.shopCode] : Infinity) |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
Object.assign(mall, { |
|
|
Object.assign(mall, { |
|
|
floorData: mall.floors, |
|
|
floorData: mall.floors, |
|
|
|