|
|
|
@ -2,11 +2,11 @@ import axios from "axios"; |
|
|
|
import icons from "./image-helper"; |
|
|
|
let mallInfos = new Map(); |
|
|
|
// dev
|
|
|
|
export const code = "project-k5chc3vt0vkodjbmhl8rua"; |
|
|
|
export const baseUrl = "https://iot-dev.123.1000my.com"; |
|
|
|
// export const code = "project-k5chc3vt0vkodjbmhl8rua";
|
|
|
|
// export const baseUrl = "https://iot-dev.123.1000my.com";
|
|
|
|
// test
|
|
|
|
// export const code = "project-skcn0gk6yb2xutkcsmjtra";
|
|
|
|
// export const baseUrl = "https://project-iot.test.1000my.com";
|
|
|
|
export const code = "project-skcn0gk6yb2xutkcsmjtra"; |
|
|
|
export const baseUrl = "https://project-iot.test.1000my.com"; |
|
|
|
export const post = async (url = "", data = {}) => { |
|
|
|
const response = await fetch(baseUrl + url, { |
|
|
|
method: "POST", |
|
|
|
@ -72,7 +72,7 @@ const getMallInfo = async ({ memberID }) => { |
|
|
|
activities, |
|
|
|
pois, |
|
|
|
menu, |
|
|
|
shopCouponMap, |
|
|
|
{ shopCouponMap, userLevel }, |
|
|
|
] = await Promise.all([ |
|
|
|
(async () => { |
|
|
|
try { |
|
|
|
@ -161,7 +161,7 @@ const getMallInfo = async ({ memberID }) => { |
|
|
|
(async () => { |
|
|
|
try { |
|
|
|
const { |
|
|
|
data: { shopDetailShowCoupon }, |
|
|
|
data: { shopDetailShowCoupon, level: userLevel }, |
|
|
|
} = await post(`/api/ar/v1/applet/MiniproBasicData`, { |
|
|
|
memberID, |
|
|
|
}); |
|
|
|
@ -169,7 +169,7 @@ const getMallInfo = async ({ memberID }) => { |
|
|
|
(acc, nxt) => ({ ...acc, [nxt]: true }), |
|
|
|
{} |
|
|
|
); |
|
|
|
return shopCouponMap; |
|
|
|
return { shopCouponMap, userLevel }; |
|
|
|
} catch (error) { |
|
|
|
console.error(error); |
|
|
|
return {}; |
|
|
|
@ -250,6 +250,7 @@ const getMallInfo = async ({ memberID }) => { |
|
|
|
}, []), |
|
|
|
poiMap, |
|
|
|
menu, |
|
|
|
userLevel, |
|
|
|
}); |
|
|
|
const mallInfo = { mall, shopInfo, images }; |
|
|
|
mallInfos.set(mall.code, mallInfo); |
|
|
|
|