diff --git a/data-helper.js b/data-helper.js index c7aeee0..36224fc 100644 --- a/data-helper.js +++ b/data-helper.js @@ -25,7 +25,10 @@ const FacilityCodeMap = { bc: 26, etxsj: 69, }; - +const floorDiffMap = { + "3_5": 1, + "5_3": 1, +}; export const attachGraphSingle = ({ graph, key, value }) => { graph[key] = { ...graph[key], @@ -256,8 +259,14 @@ export const handleData = ( const { floorOrder: floorOrderJ, NavPoint: des } = list[j]; const leftKey = floorOrderI + "_" + src; const rightKey = floorOrderJ + "_" + des; - const floorDiff = Math.abs(floorOrderI - floorOrderJ); const isUp = Number(floorOrderJ) > Number(floorOrderI); + const floorDiffKey = isUp + ? `${floorOrderI}_${floorOrderJ}` + : `${floorOrderJ}_${floorOrderI}`; + const floorDiff = + floorDiffKey in floorDiffMap && floorDiffMap + ? floorDiffMap[floorDiffKey] + : Math.abs(floorOrderI - floorOrderJ); if (ftData[leftKey]) return; if (ftData[rightKey]) return; const leftValue = { @@ -266,7 +275,7 @@ export const handleData = ( ? Infinity : list.isEscalator ? 7000 * floorDiff - : 10000 + floorDiff * 1000, + : 7000 + floorDiff * 1000, }; const rightValue = { [leftKey]: @@ -274,7 +283,7 @@ export const handleData = ( ? Infinity : list.isEscalator ? 7000 * floorDiff - : 10000 + floorDiff * 1000, + : 7000 + floorDiff * 1000, }; attachGraph({ graph, diff --git a/project.config.json b/project.config.json index 8c80c18..658e90a 100644 --- a/project.config.json +++ b/project.config.json @@ -2,7 +2,7 @@ "description": "项目配置文件,详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html", "cloudfunctionRoot": "cloudfunctions/", "setting": { - "urlCheck": false, + "urlCheck": true, "es6": false, "enhance": true, "postcss": true,