Commit 61183b60 authored by 任国军's avatar 任国军

fix distance bug

parent 4e8b6f51
Pipeline #17066 passed with stage
in 7 seconds
......@@ -173,7 +173,7 @@ class InstitutionSubService extends Service {
if (lbsResult.results.length > 0) {
area.distance = (lbsResult.results[0].distance / 1000).toFixed(1);
area.duration = lbsResult.results[0].duration;
const minute = area.travel_method === 'walking' ? Math.ceil(area.distance / 80) : Math.ceil(area.duration / 60);
const minute = area.travel_method === 'walking' ? Math.ceil(area.distance / 0.08) : Math.ceil(area.duration / 60);
area.travel_tips = area.travel_method === 'walking' ? `距我${area.distance}km,步行${minute}分钟` : `距我${area.distance}km,开车${minute}分钟`;
} else {
area.distance = 999999;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment