vue-tianditu2
Version:
73 lines (72 loc) • 2.1 kB
JavaScript
import { defineComponent as o, h as t } from "vue";
import { useState as u } from "../use/state.mjs";
/* empty css */
const c = o({
setup() {
const n = u();
return () => t(
"div",
{
class: "route-plans"
},
[
// 驾车方案
n.drivingPlans.length ? t(
"div",
null,
n.drivingPlans.map(
(e, a) => t(
"details",
{
onClick: () => {
n.drivingPlanIndex = a;
}
},
[
t("summary", null, `方案${a + 1}: ${e.duration} 秒 | ${e.distance} 公里`),
...e.routes.item.map((s, i) => t("div", null, `${i + 1}.${s.strguide}`))
]
)
)
) : "",
// 公交方案
n.transitPlans.length ? t(
"div",
null,
n.transitPlans.map(
(e, a) => t(
"details",
{
onClick: () => {
n.transitPlanIndex = a;
},
style: { backgroundColor: "#fff" }
},
[
t("summary", null, `方案${a + 1}: ${e.lineName}`),
e.segments.map((s) => {
const i = s.segmentLine[0], r = i.segmentStationCount ? ",经过" + i.segmentStationCount + "站" : "";
switch (s.segmentType) {
case 1:
return "步行约" + i.segmentDistance + "米,到达" + s.stationEnd.name;
case 2:
case 3:
return "乘坐" + i.direction + r + ",到达" + s.stationEnd.name;
case 4:
return "站内换乘";
default:
return "";
}
}).join(",") + "终点"
]
)
)
) : ""
]
);
}
});
export {
c as RoutePlans
};
//# sourceMappingURL=RoutePlans.mjs.map