@heycar/heycars-map 2.13.0-relay2 → 2.15.0-domestic1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -4
- package/dist/v2/Demo/DemoBusinessRecomendPlace.js +2 -1
- package/dist/v2/Demo/DemoBusinessTaxiEnd.d.ts +2 -1
- package/dist/v2/Demo/DemoBusinessTaxiEnd.js +9 -2
- package/dist/v2/Demo/DemoBusinessTaxiService.d.ts +4 -1
- package/dist/v2/Demo/DemoBusinessTaxiService.js +19 -1
- package/dist/v2/Demo/demo.data.mock.d.ts +4 -0
- package/dist/v2/Demo/demo.data.mock.js +1194 -0
- package/dist/v2/api/contants.d.ts +3 -0
- package/dist/v2/api/contants.js +6 -0
- package/dist/v2/business-components/AuxiliaryPassanger/AuxiliaryPassanger.d.ts +6 -0
- package/dist/v2/business-components/AuxiliaryPassanger/AuxiliaryPassanger.js +50 -0
- package/dist/v2/business-components/AuxiliaryPassanger/index.d.ts +1 -0
- package/dist/v2/business-components/AuxiliaryPassanger/index.js +4 -0
- package/dist/v2/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.d.ts +1 -0
- package/dist/v2/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.js +2 -1
- package/dist/v2/business-components/BusinessRecomendPlaceMap/index.js +1 -1
- package/dist/v2/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.js +1 -1
- package/dist/v2/business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.d.ts +4 -3
- package/dist/v2/business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.js +6 -2
- package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.d.ts +4 -1
- package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.js +51 -7
- package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceSection.d.ts +6 -1
- package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceSection.js +81 -19
- package/dist/v2/business-components/TaxiCar/RandomCars.d.ts +6 -0
- package/dist/v2/business-components/TaxiCar/RandomCars.js +47 -0
- package/dist/v2/chunks/{BusinessRecomendPlaceMap.e9166e7d.js → BusinessRecomendPlaceMap.eebd0822.js} +7 -1
- package/dist/v2/hooks/useMapCoordinatify.d.ts +2 -1
- package/dist/v2/hooks/useMapCoordinatify.js +6 -1
- package/dist/v2/hooks/useMapGeometry.d.ts +3 -3
- package/dist/v2/hooks/useMapGeometry.js +3 -3
- package/dist/v2/hooks/useWalkingRoute.js +46 -4
- package/dist/v2/hooks-business/useBusinessRecomendPlaceMap.js +1 -1
- package/dist/v2/index.js +1 -1
- package/dist/v2/types/interface.d.ts +12 -0
- package/dist/v2/utils/geometry.d.ts +1 -0
- package/dist/v2/utils/geometry.js +4 -2
- package/dist/v2/utils/geometryPolygon.d.ts +14 -0
- package/dist/v2/utils/geometryPolygon.js +46 -0
- package/dist/v2/utils/log.js +11 -3
- package/dist/v2/utils/platform.d.ts +2 -1
- package/dist/v2/utils/platform.js +2 -1
- package/dist/v2/utils/ttlCache.d.ts +34 -0
- package/dist/v2/utils/ttlCache.js +64 -0
- package/dist/v2/utils/typeChecking.d.ts +7 -1
- package/dist/v2/utils/typeChecking.js +18 -0
- package/dist/v3/Demo/DemoBusinessRecomendPlace.js +2 -1
- package/dist/v3/Demo/DemoBusinessTaxiEnd.d.ts +2 -1
- package/dist/v3/Demo/DemoBusinessTaxiEnd.js +9 -2
- package/dist/v3/Demo/DemoBusinessTaxiService.d.ts +4 -1
- package/dist/v3/Demo/DemoBusinessTaxiService.js +19 -1
- package/dist/v3/Demo/demo.data.mock.d.ts +4 -0
- package/dist/v3/Demo/demo.data.mock.js +1194 -0
- package/dist/v3/api/contants.d.ts +3 -0
- package/dist/v3/api/contants.js +6 -0
- package/dist/v3/business-components/AuxiliaryPassanger/AuxiliaryPassanger.d.ts +8 -0
- package/dist/v3/business-components/AuxiliaryPassanger/AuxiliaryPassanger.js +46 -0
- package/dist/v3/business-components/AuxiliaryPassanger/index.d.ts +1 -0
- package/dist/v3/business-components/AuxiliaryPassanger/index.js +4 -0
- package/dist/v3/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.d.ts +1 -0
- package/dist/v3/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.js +2 -1
- package/dist/v3/business-components/BusinessRecomendPlaceMap/index.js +1 -1
- package/dist/v3/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.js +1 -1
- package/dist/v3/business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.d.ts +4 -3
- package/dist/v3/business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.js +6 -2
- package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.d.ts +4 -1
- package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.js +49 -7
- package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceSection.d.ts +6 -1
- package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceSection.js +63 -19
- package/dist/v3/business-components/TaxiCar/RandomCars.d.ts +8 -0
- package/dist/v3/business-components/TaxiCar/RandomCars.js +45 -0
- package/dist/v3/chunks/{BusinessRecomendPlaceMap.c71d0b97.js → BusinessRecomendPlaceMap.71c439c6.js} +5 -1
- package/dist/v3/hooks/useMapCoordinatify.d.ts +2 -1
- package/dist/v3/hooks/useMapCoordinatify.js +6 -1
- package/dist/v3/hooks/useMapGeometry.d.ts +3 -3
- package/dist/v3/hooks/useMapGeometry.js +3 -3
- package/dist/v3/hooks/useWalkingRoute.js +46 -4
- package/dist/v3/hooks-business/useBusinessRecomendPlaceMap.js +1 -1
- package/dist/v3/index.js +1 -1
- package/dist/v3/types/interface.d.ts +12 -0
- package/dist/v3/utils/geometry.d.ts +1 -0
- package/dist/v3/utils/geometry.js +4 -2
- package/dist/v3/utils/geometryPolygon.d.ts +14 -0
- package/dist/v3/utils/geometryPolygon.js +46 -0
- package/dist/v3/utils/log.js +11 -3
- package/dist/v3/utils/platform.d.ts +2 -1
- package/dist/v3/utils/platform.js +2 -1
- package/dist/v3/utils/ttlCache.d.ts +34 -0
- package/dist/v3/utils/ttlCache.js +64 -0
- package/dist/v3/utils/typeChecking.d.ts +7 -1
- package/dist/v3/utils/typeChecking.js +18 -0
- package/package.json +1 -1
|
@@ -5,7 +5,10 @@ export declare const ANIMATION_DURATION_FOR_100VW = 100;
|
|
|
5
5
|
export declare const ANIMATION_DURATION_PER_ZOOM = 200;
|
|
6
6
|
export declare const BEIJIN_POINT: Point;
|
|
7
7
|
export declare const MAX_DEVIATION_DISTANCE = 30;
|
|
8
|
+
export declare const MAX_DEVIATION_DISTANCE_WALKING = 5;
|
|
8
9
|
export declare const CAR_DISTANCE_MIN = 20;
|
|
10
|
+
export declare const PASSENGER_DISTANCE_MAX = 2000;
|
|
11
|
+
export declare const PASSENGER_DISTANCE_MIN = 20;
|
|
9
12
|
export declare const ZINDEX_BUBBLE_LAYER = 50;
|
|
10
13
|
export declare const ZINDEX_START_END_LOGO_LAYER = 40;
|
|
11
14
|
export declare const ZINDEX_PLACE_LAYER = 30;
|
package/dist/v3/api/contants.js
CHANGED
|
@@ -4,7 +4,10 @@ const ANIMATION_DURATION_FOR_100VW = 100;
|
|
|
4
4
|
const ANIMATION_DURATION_PER_ZOOM = 200;
|
|
5
5
|
const BEIJIN_POINT = [116.2317, 39.5427];
|
|
6
6
|
const MAX_DEVIATION_DISTANCE = 30;
|
|
7
|
+
const MAX_DEVIATION_DISTANCE_WALKING = 5;
|
|
7
8
|
const CAR_DISTANCE_MIN = 20;
|
|
9
|
+
const PASSENGER_DISTANCE_MAX = 2e3;
|
|
10
|
+
const PASSENGER_DISTANCE_MIN = 20;
|
|
8
11
|
const ZINDEX_BUBBLE_LAYER = 50;
|
|
9
12
|
const ZINDEX_START_END_LOGO_LAYER = 40;
|
|
10
13
|
const ZINDEX_PLACE_LAYER = 30;
|
|
@@ -30,7 +33,10 @@ export {
|
|
|
30
33
|
GET_RECOMMEND_PLACE_TIMEOUT,
|
|
31
34
|
MAX_ANIMATION_DISTANCE_VW,
|
|
32
35
|
MAX_DEVIATION_DISTANCE,
|
|
36
|
+
MAX_DEVIATION_DISTANCE_WALKING,
|
|
33
37
|
MIN_ANIMATION_DURATION,
|
|
38
|
+
PASSENGER_DISTANCE_MAX,
|
|
39
|
+
PASSENGER_DISTANCE_MIN,
|
|
34
40
|
REGEO_TIMEOUT,
|
|
35
41
|
TRACKS_MATCH_MAX_LENGTH,
|
|
36
42
|
ZINDEX_AUXILIARY_GRASP,
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { DriverStatus, Point } from "../../types/interface";
|
|
2
|
+
export interface AuxiliaryPassangerProps {
|
|
3
|
+
status: DriverStatus;
|
|
4
|
+
passengerPosition?: Point;
|
|
5
|
+
}
|
|
6
|
+
export declare const AuxiliaryPassanger: import("vue-demi").DefineComponent<import("vue-demi").ComponentObjectPropsOptions<AuxiliaryPassangerProps>, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").EmitByProps<AuxiliaryPassangerProps, Required<AuxiliaryPassangerProps>>, never, import("vue-demi").PublicProps, AuxiliaryPassangerProps, AuxiliaryPassangerProps, import("vue-demi").SlotsType<{} & {
|
|
7
|
+
default?: import("../../demi-polyfill").Slot | undefined;
|
|
8
|
+
}>>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { createVNode } from "vue";
|
|
2
|
+
import { ref } from "vue-demi";
|
|
3
|
+
import { MAX_DEVIATION_DISTANCE_WALKING } from "../../api/contants.js";
|
|
4
|
+
import { defineSetup } from "../../types/helper.js";
|
|
5
|
+
import { watchEffectForDeepOption } from "../../utils/compare.js";
|
|
6
|
+
import { AuxiliaryCircle } from "../AuxiliaryCircle/AuxiliaryCircle.js";
|
|
7
|
+
import { AuxiliaryLine } from "../AuxiliaryLine/AuxiliaryLine.js";
|
|
8
|
+
const usePositionHistory = (source, capacity) => {
|
|
9
|
+
const history = ref([]);
|
|
10
|
+
watchEffectForDeepOption(source, (point) => {
|
|
11
|
+
if (!point)
|
|
12
|
+
return;
|
|
13
|
+
history.value.push([...point]);
|
|
14
|
+
if (history.value.length > capacity) {
|
|
15
|
+
history.value.shift();
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
return history;
|
|
19
|
+
};
|
|
20
|
+
const AuxiliaryPassanger = defineSetup("AuxiliaryPassanger", function(props) {
|
|
21
|
+
const passengerPositionHistory = usePositionHistory(() => props.passengerPosition, 20);
|
|
22
|
+
return () => {
|
|
23
|
+
const {
|
|
24
|
+
status,
|
|
25
|
+
passengerPosition
|
|
26
|
+
} = props;
|
|
27
|
+
console.log("passengerPositionHistory = ", passengerPositionHistory.value);
|
|
28
|
+
const prevPositions = passengerPositionHistory.value.slice(0, -1);
|
|
29
|
+
if (status !== "assign" && status !== "confirmed" && status !== "driverStartRelayService" && status !== "dispatched" && status !== "driverStartService" && status !== "book-driverStartService" && status !== "book-dispatched" && status !== "driverArrived")
|
|
30
|
+
return;
|
|
31
|
+
return createVNode("div", null, [!!passengerPosition && createVNode(AuxiliaryCircle, {
|
|
32
|
+
"center": passengerPosition,
|
|
33
|
+
"radius": MAX_DEVIATION_DISTANCE_WALKING,
|
|
34
|
+
"opacity": 0.2
|
|
35
|
+
}, null), prevPositions.length > 0 && createVNode(AuxiliaryLine, {
|
|
36
|
+
"path": prevPositions,
|
|
37
|
+
"type": "circle",
|
|
38
|
+
"color": "purple",
|
|
39
|
+
"scale": MAX_DEVIATION_DISTANCE_WALKING,
|
|
40
|
+
"opacity": 0.2
|
|
41
|
+
}, null)]);
|
|
42
|
+
};
|
|
43
|
+
});
|
|
44
|
+
export {
|
|
45
|
+
AuxiliaryPassanger
|
|
46
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./AuxiliaryPassanger";
|
|
@@ -28,6 +28,7 @@ export interface BusinessRecomendPlaceMapProps extends CoordinatifyProps<Omit<He
|
|
|
28
28
|
emptyTitle: string;
|
|
29
29
|
queryingTitle: string;
|
|
30
30
|
recomendDescription: string;
|
|
31
|
+
enableNearbyCars?: boolean;
|
|
31
32
|
disableLocator?: boolean;
|
|
32
33
|
disableLocatorPhoto?: boolean;
|
|
33
34
|
geoErrorOnceNotificationKey?: string;
|
|
@@ -26,8 +26,9 @@ import "../DeviceOrientation/DeviceOrientation.js";
|
|
|
26
26
|
import "../GreenZone/GreenZone.js";
|
|
27
27
|
import "../PassengerCircle/PassengerCircle.js";
|
|
28
28
|
import "../PickupPoints/PickupPoints.js";
|
|
29
|
+
import "../TaxiCar/RandomCars.js";
|
|
29
30
|
import "./useCacheCenterPlace.js";
|
|
30
|
-
import { B, f, D, E, R, c, a, e, b, d, Z } from "../../chunks/BusinessRecomendPlaceMap.
|
|
31
|
+
import { B, f, D, E, R, c, a, e, b, d, Z } from "../../chunks/BusinessRecomendPlaceMap.71c439c6.js";
|
|
31
32
|
export {
|
|
32
33
|
B as BusinessRecomendPlaceMap,
|
|
33
34
|
f as BusinessRecomendPlaceMapInner,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { B, f, D, E, R, c, a, e, b, d, Z } from "../../chunks/BusinessRecomendPlaceMap.
|
|
1
|
+
import { B, f, D, E, R, c, a, e, b, d, Z } from "../../chunks/BusinessRecomendPlaceMap.71c439c6.js";
|
|
2
2
|
export {
|
|
3
3
|
B as BusinessRecomendPlaceMap,
|
|
4
4
|
f as BusinessRecomendPlaceMapInner,
|
|
@@ -21,7 +21,7 @@ import { detectBrowserPlatform } from "../../utils/platform.js";
|
|
|
21
21
|
import { place2point, isPlaceEqual, isZoneEqual, geoPositionError2businessTimeout, pipeDefer } from "../../utils/transform.js";
|
|
22
22
|
import { toCoordinatePlaceType, toCoordinatePointType, toCoordinateRecommendZonePlacesType } from "../../utils/typeChecking.js";
|
|
23
23
|
import { AbsoluteAddressBox } from "../AbsoluteAddressBox/AbsoluteAddressBox.js";
|
|
24
|
-
import { E as EMPTY_PLACE, m as memoize, R as RECOMMEND_PLACE_DRAG_LIMIT, a as RECOMMEND_PLACE_LARGE_LIMIT, b as RECOMMEND_PLACE_ZONE_ICON_MIN, c as RECOMMEND_PLACE_ICON_ZOOM_MIN, d as RECOMMEND_PLACE_ZONE_TEXT_MIN, e as RECOMMEND_PLACE_TEXT_ZOOM_MIN, D as DEFAULT_ZOOM, Z as ZONE_FITVIEW_PANDING } from "../../chunks/BusinessRecomendPlaceMap.
|
|
24
|
+
import { E as EMPTY_PLACE, m as memoize, R as RECOMMEND_PLACE_DRAG_LIMIT, a as RECOMMEND_PLACE_LARGE_LIMIT, b as RECOMMEND_PLACE_ZONE_ICON_MIN, c as RECOMMEND_PLACE_ICON_ZOOM_MIN, d as RECOMMEND_PLACE_ZONE_TEXT_MIN, e as RECOMMEND_PLACE_TEXT_ZOOM_MIN, D as DEFAULT_ZOOM, Z as ZONE_FITVIEW_PANDING } from "../../chunks/BusinessRecomendPlaceMap.71c439c6.js";
|
|
25
25
|
import { DeviceOrientation } from "../DeviceOrientation/DeviceOrientation.js";
|
|
26
26
|
import { GreenZone } from "../GreenZone/GreenZone.js";
|
|
27
27
|
import { PassengerCircle } from "../PassengerCircle/PassengerCircle.js";
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { CoordinatePlace, CoordinatePoint } from "../../types/interface";
|
|
2
2
|
export interface BusinessTaxiEndMapProps {
|
|
3
|
-
from: Partial<
|
|
4
|
-
to: Partial<
|
|
3
|
+
from: Partial<CoordinatePlace>;
|
|
4
|
+
to: Partial<CoordinatePlace>;
|
|
5
|
+
path?: CoordinatePoint[];
|
|
5
6
|
}
|
|
6
7
|
export declare const BusinessTaxiEndMapInner: import("@vue/runtime-core").DefineComponent<import("@vue/runtime-core").ComponentObjectPropsOptions<BusinessTaxiEndMapProps>, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").EmitByProps<BusinessTaxiEndMapProps, Required<BusinessTaxiEndMapProps>>, never, import("@vue/runtime-core").PublicProps, BusinessTaxiEndMapProps, BusinessTaxiEndMapProps, import("@vue/runtime-core").SlotsType<{} & {
|
|
7
8
|
default?: import("../../demi-polyfill").Slot | undefined;
|
|
@@ -8,7 +8,7 @@ import { useMapFitView } from "../../hooks/useMapFitView.js";
|
|
|
8
8
|
import { useMapSupplier } from "../../hooks/useMapSupplier.js";
|
|
9
9
|
import { defineSetup } from "../../types/helper.js";
|
|
10
10
|
import { place2point, pipeDefer } from "../../utils/transform.js";
|
|
11
|
-
import { isCoordinatePoint, toCoordinatePlaceType } from "../../utils/typeChecking.js";
|
|
11
|
+
import { isCoordinatePoint, toCoordinatePlaceType, toCoordinatePointType } from "../../utils/typeChecking.js";
|
|
12
12
|
import { SectionEndService } from "../BusinessTaxiServiceMap/BusinessTaxiServiceSection.js";
|
|
13
13
|
const BusinessTaxiEndMapInner = defineSetup("BusinessTaxiEndMapInner", function(props, {
|
|
14
14
|
attrs
|
|
@@ -18,6 +18,7 @@ const BusinessTaxiEndMapInner = defineSetup("BusinessTaxiEndMapInner", function(
|
|
|
18
18
|
setMap
|
|
19
19
|
} = useHeycarMap();
|
|
20
20
|
const {
|
|
21
|
+
unCoordinatifyPoint,
|
|
21
22
|
unCoordinatifyPlace
|
|
22
23
|
} = useMapCoordinatify();
|
|
23
24
|
const {
|
|
@@ -31,11 +32,13 @@ const BusinessTaxiEndMapInner = defineSetup("BusinessTaxiEndMapInner", function(
|
|
|
31
32
|
return () => {
|
|
32
33
|
const {
|
|
33
34
|
from: inputFrom,
|
|
34
|
-
to: inputTo
|
|
35
|
+
to: inputTo,
|
|
36
|
+
path: inputPath
|
|
35
37
|
} = props;
|
|
36
38
|
const isReady = isCoordinatePoint(inputFrom) && isCoordinatePoint(inputTo);
|
|
37
39
|
const from = unCoordinatifyPlace(toCoordinatePlaceType(inputFrom));
|
|
38
40
|
const to = unCoordinatifyPlace(toCoordinatePlaceType(inputTo));
|
|
41
|
+
const path = inputPath == null ? void 0 : inputPath.map((p) => unCoordinatifyPoint(toCoordinatePointType(p)));
|
|
39
42
|
const center = isReady ? place2point(from) : [...BEIJIN_POINT];
|
|
40
43
|
return createVNode(HeycarMap, {
|
|
41
44
|
"class": attrs.class,
|
|
@@ -49,6 +52,7 @@ const BusinessTaxiEndMapInner = defineSetup("BusinessTaxiEndMapInner", function(
|
|
|
49
52
|
default: () => [isReady && createVNode(SectionEndService, {
|
|
50
53
|
"from": from,
|
|
51
54
|
"to": to,
|
|
55
|
+
"routePath": path,
|
|
52
56
|
"registerOverlay": registerFitVeiw
|
|
53
57
|
}, null)]
|
|
54
58
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type HeycarMapProps } from "../../components/MapProvider";
|
|
2
2
|
import type { BusinessTaxiServiceContext } from "../../hooks-business/useBusinessTaxiServiceMap";
|
|
3
3
|
import type { CoordinatifyProps } from "../../types/coordinatify";
|
|
4
|
-
import type { CoordinatePlace, CoordinateTrackPoint, DriverStatus } from "../../types/interface";
|
|
4
|
+
import type { CoordinatePlace, CoordinatePoint, CoordinateTrackPoint, DriverStatus, GetDriverRouteOrTrackOutput } from "../../types/interface";
|
|
5
5
|
export type BusinessTaxiServiceMapProps = CoordinatifyProps<Omit<HeycarMapProps, "center" | "zoom" | "mapRef">> & {
|
|
6
6
|
from: CoordinatePlace;
|
|
7
7
|
to: CoordinatePlace;
|
|
@@ -15,6 +15,8 @@ export type BusinessTaxiServiceMapProps = CoordinatifyProps<Omit<HeycarMapProps,
|
|
|
15
15
|
driverStatus: DriverStatus;
|
|
16
16
|
interval: number;
|
|
17
17
|
disablePassenger?: boolean;
|
|
18
|
+
confirmedPath?: CoordinatePoint[];
|
|
19
|
+
endServicePath?: CoordinatePoint[];
|
|
18
20
|
mapContext: CoordinatifyProps<BusinessTaxiServiceContext>;
|
|
19
21
|
renderStartSerivceTitle: (titleProps: {
|
|
20
22
|
distance: number;
|
|
@@ -25,6 +27,7 @@ export type BusinessTaxiServiceMapProps = CoordinatifyProps<Omit<HeycarMapProps,
|
|
|
25
27
|
duration: number;
|
|
26
28
|
}) => string;
|
|
27
29
|
getDriverPositionTrack?: () => Promise<CoordinateTrackPoint[]>;
|
|
30
|
+
getDriverRouteOrTrack?: () => Promise<GetDriverRouteOrTrackOutput>;
|
|
28
31
|
};
|
|
29
32
|
export declare const BusinessTaxiServiceMapInner: import("vue-demi").DefineComponent<import("vue-demi").ComponentObjectPropsOptions<BusinessTaxiServiceMapProps>, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").EmitByProps<BusinessTaxiServiceMapProps, Required<BusinessTaxiServiceMapProps>>, "resize" | "dragEnd" | "zoomEnd", import("vue-demi").PublicProps, BusinessTaxiServiceMapProps, BusinessTaxiServiceMapProps, import("vue-demi").SlotsType<{
|
|
30
33
|
fallback?: (() => import("vue-demi").VNodeChild) | undefined;
|
|
@@ -10,10 +10,12 @@ import { useMapFitView } from "../../hooks/useMapFitView.js";
|
|
|
10
10
|
import { useMapAssertSupplier, useMapSupplier } from "../../hooks/useMapSupplier.js";
|
|
11
11
|
import { defineSetup, defineLagecySetup } from "../../types/helper.js";
|
|
12
12
|
import { MANUAL_ABORT_MESSAGE } from "../../utils/ManualAbortError.js";
|
|
13
|
+
import { computeLineAngle } from "../../utils/geometryPolygon.js";
|
|
13
14
|
import { createAbortable, assertNotEmptyArray } from "../../utils/helper.js";
|
|
14
15
|
import { place2point, pipeDefer, lnglat2point } from "../../utils/transform.js";
|
|
15
|
-
import { toCoordinatePlaceType, toCoordinateTrackPoint } from "../../utils/typeChecking.js";
|
|
16
|
+
import { toCoordinatePlaceType, toCoordinatePointType, createTypeError, toCoordinateExternalRoute, toCoordinateTrackPoint } from "../../utils/typeChecking.js";
|
|
16
17
|
import { AuxiliaryGraspRoad } from "../AuxiliaryGraspRoad/AuxiliaryGraspRoad.js";
|
|
18
|
+
import { AuxiliaryPassanger } from "../AuxiliaryPassanger/AuxiliaryPassanger.js";
|
|
17
19
|
import { DeviceOrientation } from "../DeviceOrientation/DeviceOrientation.js";
|
|
18
20
|
import { SectionDispatching, SectionConfirmed, SectionDriverStartRelayService, SectionDriverStartService, SectionBookDispatched, SectionInService, SectionDriverArrived, SectionCanceled, SectionEndService } from "./BusinessTaxiServiceSection.js";
|
|
19
21
|
const STATUS_NEED_CAR_POSITION = ["book-driverStartService", "dispatched", "driverStartService", "driverStartRelayService", "inService", "driverArrived"];
|
|
@@ -22,6 +24,7 @@ const IS_ENABLE_AUXILIARY_GRASP_ROAD = apiGetAuxiliaryGrapStatus();
|
|
|
22
24
|
const BusinessTaxiServiceMapInner = defineSetup("BusinessTaxiServiceMapInner", function(props, {
|
|
23
25
|
attrs
|
|
24
26
|
}) {
|
|
27
|
+
var _a;
|
|
25
28
|
const {
|
|
26
29
|
interval,
|
|
27
30
|
disablePassenger,
|
|
@@ -39,10 +42,17 @@ const BusinessTaxiServiceMapInner = defineSetup("BusinessTaxiServiceMapInner", f
|
|
|
39
42
|
} = useMapAssertSupplier();
|
|
40
43
|
const abortController = new AbortController();
|
|
41
44
|
const abortable = createAbortable(abortController.signal);
|
|
42
|
-
const
|
|
45
|
+
const getDriverRouteOrTrack = abortable((_a = props.getDriverRouteOrTrack) != null ? _a : async () => {
|
|
46
|
+
var _a2;
|
|
47
|
+
return {
|
|
48
|
+
tracks: await ((_a2 = props.getDriverPositionTrack) == null ? void 0 : _a2.call(props))
|
|
49
|
+
};
|
|
50
|
+
});
|
|
43
51
|
const {
|
|
52
|
+
unCoordinatifyPoint,
|
|
44
53
|
unCoordinatifyPlace,
|
|
45
|
-
unCoordinatifyTrackPoint
|
|
54
|
+
unCoordinatifyTrackPoint,
|
|
55
|
+
unCoordinatifyExternalRoute
|
|
46
56
|
} = useMapCoordinatify();
|
|
47
57
|
const {
|
|
48
58
|
registerFitVeiw: registerOverlay,
|
|
@@ -63,11 +73,27 @@ const BusinessTaxiServiceMapInner = defineSetup("BusinessTaxiServiceMapInner", f
|
|
|
63
73
|
const carPositionRef = ref();
|
|
64
74
|
const carAngleRef = ref();
|
|
65
75
|
const carTrackPositionsRef = ref([]);
|
|
76
|
+
const carRouteRef = ref();
|
|
66
77
|
watch(() => props.driverStatus, (status, _, onCleanup) => {
|
|
67
78
|
if (!STATUS_NEED_CAR_POSITION.includes(status))
|
|
68
79
|
return;
|
|
69
80
|
const update = async () => {
|
|
70
|
-
const
|
|
81
|
+
const output = await (getDriverRouteOrTrack == null ? void 0 : getDriverRouteOrTrack());
|
|
82
|
+
if (!("tracks" in output) && !("routes" in output)) {
|
|
83
|
+
throw createTypeError("GetDriverRouteOrTrackOutput", output);
|
|
84
|
+
}
|
|
85
|
+
if ("routes" in output) {
|
|
86
|
+
const routes = unCoordinatifyExternalRoute(toCoordinateExternalRoute(output.routes));
|
|
87
|
+
assertNotEmptyArray(routes.path, "routes.path");
|
|
88
|
+
carPositionRef.value = routes.path[0];
|
|
89
|
+
carAngleRef.value = computeLineAngle(routes.path[0], routes.path[1]);
|
|
90
|
+
carTrackPositionsRef.value = [];
|
|
91
|
+
carRouteRef.value = routes;
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
const {
|
|
95
|
+
tracks
|
|
96
|
+
} = output;
|
|
71
97
|
assertNotEmptyArray(tracks, "tracks");
|
|
72
98
|
const trackPositions = tracks.map((p) => unCoordinatifyTrackPoint(toCoordinateTrackPoint(p)));
|
|
73
99
|
const [{
|
|
@@ -76,6 +102,7 @@ const BusinessTaxiServiceMapInner = defineSetup("BusinessTaxiServiceMapInner", f
|
|
|
76
102
|
carPositionRef.value = lnglat2point(trackPositions[trackPositions.length - 1]);
|
|
77
103
|
carAngleRef.value = angle;
|
|
78
104
|
carTrackPositionsRef.value = trackPositions;
|
|
105
|
+
carRouteRef.value = void 0;
|
|
79
106
|
};
|
|
80
107
|
const timer = setInterval(update, interval);
|
|
81
108
|
update();
|
|
@@ -94,16 +121,21 @@ const BusinessTaxiServiceMapInner = defineSetup("BusinessTaxiServiceMapInner", f
|
|
|
94
121
|
dispatchingTitle,
|
|
95
122
|
bookDispatchingTitle,
|
|
96
123
|
bookDispatchedTitle,
|
|
97
|
-
driverArrivedTitle
|
|
124
|
+
driverArrivedTitle,
|
|
125
|
+
confirmedPath: inputConfirmedPath,
|
|
126
|
+
endServicePath: inputEndServicePath
|
|
98
127
|
} = props;
|
|
99
128
|
const from = unCoordinatifyPlace(toCoordinatePlaceType(inputFrom));
|
|
100
129
|
const to = unCoordinatifyPlace(toCoordinatePlaceType(inputTo));
|
|
101
130
|
const relayTo = inputRelayTo ? unCoordinatifyPlace(toCoordinatePlaceType(inputRelayTo)) : void 0;
|
|
131
|
+
const confirmedPath = inputConfirmedPath == null ? void 0 : inputConfirmedPath.map((p) => unCoordinatifyPoint(toCoordinatePointType(p)));
|
|
132
|
+
const endServicePath = inputEndServicePath == null ? void 0 : inputEndServicePath.map((p) => unCoordinatifyPoint(toCoordinatePointType(p)));
|
|
102
133
|
const carPosition = carPositionRef.value;
|
|
103
134
|
const carAngle = carAngleRef.value;
|
|
104
135
|
const carTrackPositions = carTrackPositionsRef.value;
|
|
105
136
|
const touchEnable = !["canceled", "canceling", "completed", "endService", "waitpay", "waitRechargePay", "refund", "rechargePayed", "payed"].includes(driverStatus);
|
|
106
137
|
const passengerPosition = disablePassenger || geoLoading.value || geoError.value ? void 0 : geoPosition.value;
|
|
138
|
+
const carRoute = carRouteRef.value;
|
|
107
139
|
return createVNode(HeycarMap, {
|
|
108
140
|
"class": attrs.class,
|
|
109
141
|
"style": attrs.style,
|
|
@@ -127,6 +159,7 @@ const BusinessTaxiServiceMapInner = defineSetup("BusinessTaxiServiceMapInner", f
|
|
|
127
159
|
"render": (orientation) => createVNode(SectionConfirmed, {
|
|
128
160
|
"from": from,
|
|
129
161
|
"to": to,
|
|
162
|
+
"routePath": confirmedPath,
|
|
130
163
|
"passengerPosition": passengerPosition,
|
|
131
164
|
"passengerAngle": orientation == null ? void 0 : orientation.cssRotationVariableName,
|
|
132
165
|
"registerOverlay": registerOverlay
|
|
@@ -140,6 +173,7 @@ const BusinessTaxiServiceMapInner = defineSetup("BusinessTaxiServiceMapInner", f
|
|
|
140
173
|
"carPosition": carPosition,
|
|
141
174
|
"carAngle": carAngle,
|
|
142
175
|
"carTrackPositions": carTrackPositions,
|
|
176
|
+
"carRoute": carRoute,
|
|
143
177
|
"passengerPosition": passengerPosition,
|
|
144
178
|
"passengerAngle": orientation == null ? void 0 : orientation.cssRotationVariableName,
|
|
145
179
|
"relayToTitle": relayToTitle,
|
|
@@ -154,6 +188,7 @@ const BusinessTaxiServiceMapInner = defineSetup("BusinessTaxiServiceMapInner", f
|
|
|
154
188
|
"carPosition": carPosition,
|
|
155
189
|
"carAngle": carAngle,
|
|
156
190
|
"carTrackPositions": carTrackPositions,
|
|
191
|
+
"carRoute": carRoute,
|
|
157
192
|
"passengerPosition": passengerPosition,
|
|
158
193
|
"passengerAngle": orientation == null ? void 0 : orientation.cssRotationVariableName,
|
|
159
194
|
"renderTitle": renderStartSerivceTitle,
|
|
@@ -166,6 +201,7 @@ const BusinessTaxiServiceMapInner = defineSetup("BusinessTaxiServiceMapInner", f
|
|
|
166
201
|
"from": from,
|
|
167
202
|
"to": to,
|
|
168
203
|
"title": bookDispatchedTitle,
|
|
204
|
+
"routePath": confirmedPath,
|
|
169
205
|
"passengerPosition": passengerPosition,
|
|
170
206
|
"passengerAngle": orientation == null ? void 0 : orientation.cssRotationVariableName,
|
|
171
207
|
"registerOverlay": registerOverlay
|
|
@@ -175,6 +211,7 @@ const BusinessTaxiServiceMapInner = defineSetup("BusinessTaxiServiceMapInner", f
|
|
|
175
211
|
"carPosition": carPosition,
|
|
176
212
|
"carAngle": carAngle,
|
|
177
213
|
"carTrackPositions": carTrackPositions,
|
|
214
|
+
"carRoute": carRoute,
|
|
178
215
|
"renderTitle": renderInServiceTitle,
|
|
179
216
|
"registerOverlay": registerOverlay,
|
|
180
217
|
"key": `${to.lng},${to.lat}`
|
|
@@ -197,19 +234,24 @@ const BusinessTaxiServiceMapInner = defineSetup("BusinessTaxiServiceMapInner", f
|
|
|
197
234
|
}, null) : driverStatus === "endService" || driverStatus === "completed" || driverStatus === "banlanceRefund" || driverStatus === "waitBanlanceRefund" || driverStatus === "rechargePayed" || driverStatus === "waitRechargePay" || driverStatus === "payed" || driverStatus === "waitpay" || driverStatus === "refund" ? createVNode(SectionEndService, {
|
|
198
235
|
"from": from,
|
|
199
236
|
"to": to,
|
|
237
|
+
"routePath": endServicePath,
|
|
200
238
|
"registerOverlay": registerOverlay
|
|
201
239
|
}, null) : (
|
|
202
240
|
// 匹配不到就显示灰色路线
|
|
203
241
|
createVNode(SectionEndService, {
|
|
204
242
|
"from": from,
|
|
205
243
|
"to": to,
|
|
244
|
+
"routePath": endServicePath,
|
|
206
245
|
"registerOverlay": registerOverlay
|
|
207
246
|
}, null)
|
|
208
|
-
), IS_ENABLE_AUXILIARY_GRASP_ROAD && createVNode(AuxiliaryGraspRoad, {
|
|
247
|
+
), IS_ENABLE_AUXILIARY_GRASP_ROAD && !carRoute && createVNode(AuxiliaryGraspRoad, {
|
|
209
248
|
"status": driverStatus,
|
|
210
249
|
"trackPoints": carTrackPositions,
|
|
211
250
|
"from": from,
|
|
212
251
|
"to": to
|
|
252
|
+
}, null), IS_ENABLE_AUXILIARY_GRASP_ROAD && createVNode(AuxiliaryPassanger, {
|
|
253
|
+
"status": driverStatus,
|
|
254
|
+
"passengerPosition": passengerPosition
|
|
213
255
|
}, null)]
|
|
214
256
|
});
|
|
215
257
|
};
|
|
@@ -229,7 +271,7 @@ const BusinessTaxiServiceMap = defineLagecySetup("BusinessTaxiServiceMap", funct
|
|
|
229
271
|
attrs: props,
|
|
230
272
|
key: `${payload.supplier}${instanceNo}`
|
|
231
273
|
});
|
|
232
|
-
}).props(["bookDispatchingTitle", "bookDispatchedTitle", "dispatchingTitle", "driverArrivedTitle", "driverStatus", "fallback", "from", "getDriverPositionTrack", "interval", "disablePassenger", "loading", "mapContext", "relayTo", "relayToTitle", "renderInServiceTitle", "renderStartSerivceTitle", "to"]);
|
|
274
|
+
}).props(["bookDispatchingTitle", "bookDispatchedTitle", "dispatchingTitle", "driverArrivedTitle", "driverStatus", "fallback", "from", "getDriverPositionTrack", "getDriverRouteOrTrack", "interval", "disablePassenger", "loading", "mapContext", "relayTo", "relayToTitle", "renderInServiceTitle", "renderStartSerivceTitle", "confirmedPath", "endServicePath", "to"]);
|
|
233
275
|
export {
|
|
234
276
|
BusinessTaxiServiceMap,
|
|
235
277
|
BusinessTaxiServiceMapInner
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { MROP } from "../../hooks/useOverlay";
|
|
2
|
-
import type { Place, Point, TrackPoint } from "../../types/interface";
|
|
2
|
+
import type { ExternalRoute, Place, Point, TrackPoint } from "../../types/interface";
|
|
3
3
|
import { type DrivingRouteRenderProps } from "../DrivingRoute";
|
|
4
4
|
type SectionDispatchingProps = Required<MROP> & {
|
|
5
5
|
title: string;
|
|
@@ -13,6 +13,7 @@ type SectionConfirmedProps = Required<MROP> & {
|
|
|
13
13
|
passengerAngle?: string;
|
|
14
14
|
from: Place;
|
|
15
15
|
to: Place;
|
|
16
|
+
routePath?: Point[];
|
|
16
17
|
};
|
|
17
18
|
export declare const SectionConfirmed: import("vue").DefineComponent<import("vue").ComponentObjectPropsOptions<SectionConfirmedProps>, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").EmitByProps<SectionConfirmedProps, Required<SectionConfirmedProps>>, never, import("vue").PublicProps, SectionConfirmedProps, SectionConfirmedProps, import("vue").SlotsType<{} & {
|
|
18
19
|
default?: import("../../demi-polyfill").Slot | undefined;
|
|
@@ -32,6 +33,7 @@ type SectionDriverStartServiceProps = Required<MROP> & {
|
|
|
32
33
|
carPosition?: Point;
|
|
33
34
|
carAngle?: number;
|
|
34
35
|
carTrackPositions?: TrackPoint[];
|
|
36
|
+
carRoute?: ExternalRoute;
|
|
35
37
|
from: Place;
|
|
36
38
|
renderTitle: (props: Pick<DrivingRouteRenderProps, "duration" | "distance">) => string;
|
|
37
39
|
};
|
|
@@ -45,6 +47,7 @@ type SectionBookDispatchedProps = Required<MROP> & {
|
|
|
45
47
|
passengerAngle?: string;
|
|
46
48
|
from: Place;
|
|
47
49
|
to: Place;
|
|
50
|
+
routePath?: Point[];
|
|
48
51
|
title?: string;
|
|
49
52
|
};
|
|
50
53
|
export declare const SectionBookDispatched: import("vue").DefineComponent<import("vue").ComponentObjectPropsOptions<SectionBookDispatchedProps>, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").EmitByProps<SectionBookDispatchedProps, Required<SectionBookDispatchedProps>>, never, import("vue").PublicProps, SectionBookDispatchedProps, SectionBookDispatchedProps, import("vue").SlotsType<{} & {
|
|
@@ -66,6 +69,7 @@ type SectionInServiceProps = Required<MROP> & {
|
|
|
66
69
|
carPosition?: Point;
|
|
67
70
|
carAngle?: number;
|
|
68
71
|
carTrackPositions?: TrackPoint[];
|
|
72
|
+
carRoute?: ExternalRoute;
|
|
69
73
|
renderTitle: (props: Pick<DrivingRouteRenderProps, "duration" | "distance">) => string;
|
|
70
74
|
};
|
|
71
75
|
export declare const SectionInService: import("vue").DefineComponent<import("vue").ComponentObjectPropsOptions<SectionInServiceProps>, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").EmitByProps<SectionInServiceProps, Required<SectionInServiceProps>>, never, import("vue").PublicProps, SectionInServiceProps, SectionInServiceProps, import("vue").SlotsType<{
|
|
@@ -83,6 +87,7 @@ export declare const SectionCanceled: import("vue").DefineComponent<import("vue"
|
|
|
83
87
|
export type SectionEndServiceProps = Required<MROP> & {
|
|
84
88
|
from: Place;
|
|
85
89
|
to: Place;
|
|
90
|
+
routePath?: Point[];
|
|
86
91
|
};
|
|
87
92
|
export declare const SectionEndService: import("vue").DefineComponent<import("vue").ComponentObjectPropsOptions<SectionEndServiceProps>, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").Empty, import("../../types/helper").EmitByProps<SectionEndServiceProps, Required<SectionEndServiceProps>>, never, import("vue").PublicProps, SectionEndServiceProps, SectionEndServiceProps, import("vue").SlotsType<{} & {
|
|
88
93
|
default?: import("../../demi-polyfill").Slot | undefined;
|