Browse Source

fix: 店铺券无法展示

master
jiannibang 3 years ago
parent
commit
851597ed80
  1. 2
      package.json
  2. 16
      src/js/helpers/data-helper.js

2
package.json

@ -29,7 +29,7 @@
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build && coscmd config -a AKIDjS6at7fjTAVgggDNCrogRiZTSL304DPR -s FPPGCXr4xgZRLKDC8tZGp7HTZXlqx0gU -b lg-cjdqwkbo-1256266248 -r ap-shanghai && coscmd delete iot-qmplaza -f && coscmd upload -r build iot-qmplaza",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},

16
src/js/helpers/data-helper.js

@ -1,8 +1,12 @@
import axios from "axios";
import icons from "./image-helper";
let mallInfos = new Map();
export const code = "project-k5chc3vt0vkodjbmhl8rua";
export const baseUrl = "https://iot-dev.123.1000my.com";
// dev
// 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 post = async (url = "", data = {}) => {
const response = await fetch(baseUrl + url, {
method: "POST",
@ -47,11 +51,16 @@ const getMallInfo = async ({ memberID }) => {
console.error(error);
}
// const config = {
// mapDataUrl: `${cdnUrl}/ar/${code}/Aeditor/Aeditor.json?t=${new Date().getTime()}`,
// shopInfoUrl: `${cdnUrl}/ar/${code}/QueryShopListForMap/QueryShopListForMap.json?t=${new Date().getTime()}`,
// };
// try {
// const {
// data: { mapUrl, shopUrl },
// } = await axios.get(
// `${cdnUrl}/test-projects/${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;
@ -194,6 +203,7 @@ const getMallInfo = async ({ memberID }) => {
.filter(({ buildingOrder }) => buildingOrder === 0)
.map((iot) => ({
...iot,
code: iot.shopCode,
name: iot.shopName,
houseNum: iot.houseNumber,
nameEn: iot.shopNameEn,

Loading…
Cancel
Save