@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/v2/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,6 @@
|
|
|
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("vue3").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, AuxiliaryPassangerProps>;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { h } 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 h("div", [!!passengerPosition && h(AuxiliaryCircle, {
|
|
32
|
+
"attrs": {
|
|
33
|
+
"center": passengerPosition,
|
|
34
|
+
"radius": MAX_DEVIATION_DISTANCE_WALKING,
|
|
35
|
+
"opacity": 0.2
|
|
36
|
+
}
|
|
37
|
+
}), prevPositions.length > 0 && h(AuxiliaryLine, {
|
|
38
|
+
"attrs": {
|
|
39
|
+
"path": prevPositions,
|
|
40
|
+
"type": "circle",
|
|
41
|
+
"color": "purple",
|
|
42
|
+
"scale": MAX_DEVIATION_DISTANCE_WALKING,
|
|
43
|
+
"opacity": 0.2
|
|
44
|
+
}
|
|
45
|
+
})]);
|
|
46
|
+
};
|
|
47
|
+
});
|
|
48
|
+
export {
|
|
49
|
+
AuxiliaryPassanger
|
|
50
|
+
};
|
|
@@ -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.eebd0822.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.eebd0822.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.eebd0822.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/types/v3-define-component").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, BusinessTaxiEndMapProps>;
|
|
7
8
|
export declare const BusinessTaxiEndMap: import("vue/types/v3-define-component").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, BusinessTaxiEndMapProps>;
|
|
@@ -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 h(HeycarMap, {
|
|
41
44
|
"class": attrs.class,
|
|
@@ -53,6 +56,7 @@ const BusinessTaxiEndMapInner = defineSetup("BusinessTaxiEndMapInner", function(
|
|
|
53
56
|
"attrs": {
|
|
54
57
|
"from": from,
|
|
55
58
|
"to": to,
|
|
59
|
+
"routePath": path,
|
|
56
60
|
"registerOverlay": registerFitVeiw
|
|
57
61
|
}
|
|
58
62
|
})]);
|
|
@@ -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/runtime-core").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", BusinessTaxiServiceMapProps>;
|
|
30
33
|
export declare const BusinessTaxiServiceMap: import("vue-demi").DefineComponent<import("@vue/runtime-core").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", BusinessTaxiServiceMapProps>;
|
|
@@ -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 h(HeycarMap, {
|
|
108
140
|
"class": attrs.class,
|
|
109
141
|
"style": attrs.style,
|
|
@@ -136,6 +168,7 @@ const BusinessTaxiServiceMapInner = defineSetup("BusinessTaxiServiceMapInner", f
|
|
|
136
168
|
"attrs": {
|
|
137
169
|
"from": from,
|
|
138
170
|
"to": to,
|
|
171
|
+
"routePath": confirmedPath,
|
|
139
172
|
"passengerPosition": passengerPosition,
|
|
140
173
|
"passengerAngle": orientation == null ? void 0 : orientation.cssRotationVariableName,
|
|
141
174
|
"registerOverlay": registerOverlay
|
|
@@ -153,6 +186,7 @@ const BusinessTaxiServiceMapInner = defineSetup("BusinessTaxiServiceMapInner", f
|
|
|
153
186
|
"carPosition": carPosition,
|
|
154
187
|
"carAngle": carAngle,
|
|
155
188
|
"carTrackPositions": carTrackPositions,
|
|
189
|
+
"carRoute": carRoute,
|
|
156
190
|
"passengerPosition": passengerPosition,
|
|
157
191
|
"passengerAngle": orientation == null ? void 0 : orientation.cssRotationVariableName,
|
|
158
192
|
"relayToTitle": relayToTitle,
|
|
@@ -171,6 +205,7 @@ const BusinessTaxiServiceMapInner = defineSetup("BusinessTaxiServiceMapInner", f
|
|
|
171
205
|
"carPosition": carPosition,
|
|
172
206
|
"carAngle": carAngle,
|
|
173
207
|
"carTrackPositions": carTrackPositions,
|
|
208
|
+
"carRoute": carRoute,
|
|
174
209
|
"passengerPosition": passengerPosition,
|
|
175
210
|
"passengerAngle": orientation == null ? void 0 : orientation.cssRotationVariableName,
|
|
176
211
|
"renderTitle": renderStartSerivceTitle,
|
|
@@ -187,6 +222,7 @@ const BusinessTaxiServiceMapInner = defineSetup("BusinessTaxiServiceMapInner", f
|
|
|
187
222
|
"from": from,
|
|
188
223
|
"to": to,
|
|
189
224
|
"title": bookDispatchedTitle,
|
|
225
|
+
"routePath": confirmedPath,
|
|
190
226
|
"passengerPosition": passengerPosition,
|
|
191
227
|
"passengerAngle": orientation == null ? void 0 : orientation.cssRotationVariableName,
|
|
192
228
|
"registerOverlay": registerOverlay
|
|
@@ -199,6 +235,7 @@ const BusinessTaxiServiceMapInner = defineSetup("BusinessTaxiServiceMapInner", f
|
|
|
199
235
|
"carPosition": carPosition,
|
|
200
236
|
"carAngle": carAngle,
|
|
201
237
|
"carTrackPositions": carTrackPositions,
|
|
238
|
+
"carRoute": carRoute,
|
|
202
239
|
"renderTitle": renderInServiceTitle,
|
|
203
240
|
"registerOverlay": registerOverlay
|
|
204
241
|
},
|
|
@@ -229,6 +266,7 @@ const BusinessTaxiServiceMapInner = defineSetup("BusinessTaxiServiceMapInner", f
|
|
|
229
266
|
"attrs": {
|
|
230
267
|
"from": from,
|
|
231
268
|
"to": to,
|
|
269
|
+
"routePath": endServicePath,
|
|
232
270
|
"registerOverlay": registerOverlay
|
|
233
271
|
}
|
|
234
272
|
}) : (
|
|
@@ -237,16 +275,22 @@ const BusinessTaxiServiceMapInner = defineSetup("BusinessTaxiServiceMapInner", f
|
|
|
237
275
|
"attrs": {
|
|
238
276
|
"from": from,
|
|
239
277
|
"to": to,
|
|
278
|
+
"routePath": endServicePath,
|
|
240
279
|
"registerOverlay": registerOverlay
|
|
241
280
|
}
|
|
242
281
|
})
|
|
243
|
-
), IS_ENABLE_AUXILIARY_GRASP_ROAD && h(AuxiliaryGraspRoad, {
|
|
282
|
+
), IS_ENABLE_AUXILIARY_GRASP_ROAD && !carRoute && h(AuxiliaryGraspRoad, {
|
|
244
283
|
"attrs": {
|
|
245
284
|
"status": driverStatus,
|
|
246
285
|
"trackPoints": carTrackPositions,
|
|
247
286
|
"from": from,
|
|
248
287
|
"to": to
|
|
249
288
|
}
|
|
289
|
+
}), IS_ENABLE_AUXILIARY_GRASP_ROAD && h(AuxiliaryPassanger, {
|
|
290
|
+
"attrs": {
|
|
291
|
+
"status": driverStatus,
|
|
292
|
+
"passengerPosition": passengerPosition
|
|
293
|
+
}
|
|
250
294
|
})]);
|
|
251
295
|
};
|
|
252
296
|
});
|
|
@@ -265,7 +309,7 @@ const BusinessTaxiServiceMap = defineLagecySetup("BusinessTaxiServiceMap", funct
|
|
|
265
309
|
attrs: props,
|
|
266
310
|
key: `${payload.supplier}${instanceNo}`
|
|
267
311
|
});
|
|
268
|
-
}).props(["bookDispatchingTitle", "bookDispatchedTitle", "dispatchingTitle", "driverArrivedTitle", "driverStatus", "fallback", "from", "getDriverPositionTrack", "interval", "disablePassenger", "loading", "mapContext", "relayTo", "relayToTitle", "renderInServiceTitle", "renderStartSerivceTitle", "to"]);
|
|
312
|
+
}).props(["bookDispatchingTitle", "bookDispatchedTitle", "dispatchingTitle", "driverArrivedTitle", "driverStatus", "fallback", "from", "getDriverPositionTrack", "getDriverRouteOrTrack", "interval", "disablePassenger", "loading", "mapContext", "relayTo", "relayToTitle", "renderInServiceTitle", "renderStartSerivceTitle", "confirmedPath", "endServicePath", "to"]);
|
|
269
313
|
export {
|
|
270
314
|
BusinessTaxiServiceMap,
|
|
271
315
|
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;
|
|
@@ -11,6 +11,7 @@ type SectionConfirmedProps = Required<MROP> & {
|
|
|
11
11
|
passengerAngle?: string;
|
|
12
12
|
from: Place;
|
|
13
13
|
to: Place;
|
|
14
|
+
routePath?: Point[];
|
|
14
15
|
};
|
|
15
16
|
export declare const SectionConfirmed: import("vue").DefineComponent<import("vue3").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, SectionConfirmedProps>;
|
|
16
17
|
interface SectionDriverStartRelayServiceProps extends SectionDriverStartServiceProps {
|
|
@@ -24,6 +25,7 @@ type SectionDriverStartServiceProps = Required<MROP> & {
|
|
|
24
25
|
carPosition?: Point;
|
|
25
26
|
carAngle?: number;
|
|
26
27
|
carTrackPositions?: TrackPoint[];
|
|
28
|
+
carRoute?: ExternalRoute;
|
|
27
29
|
from: Place;
|
|
28
30
|
renderTitle: (props: Pick<DrivingRouteRenderProps, "duration" | "distance">) => string;
|
|
29
31
|
};
|
|
@@ -33,6 +35,7 @@ type SectionBookDispatchedProps = Required<MROP> & {
|
|
|
33
35
|
passengerAngle?: string;
|
|
34
36
|
from: Place;
|
|
35
37
|
to: Place;
|
|
38
|
+
routePath?: Point[];
|
|
36
39
|
title?: string;
|
|
37
40
|
};
|
|
38
41
|
export declare const SectionBookDispatched: import("vue").DefineComponent<import("vue3").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, SectionBookDispatchedProps>;
|
|
@@ -50,6 +53,7 @@ type SectionInServiceProps = Required<MROP> & {
|
|
|
50
53
|
carPosition?: Point;
|
|
51
54
|
carAngle?: number;
|
|
52
55
|
carTrackPositions?: TrackPoint[];
|
|
56
|
+
carRoute?: ExternalRoute;
|
|
53
57
|
renderTitle: (props: Pick<DrivingRouteRenderProps, "duration" | "distance">) => string;
|
|
54
58
|
};
|
|
55
59
|
export declare const SectionInService: import("vue").DefineComponent<import("vue3").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, SectionInServiceProps>;
|
|
@@ -61,6 +65,7 @@ export declare const SectionCanceled: import("vue").DefineComponent<import("vue3
|
|
|
61
65
|
export type SectionEndServiceProps = Required<MROP> & {
|
|
62
66
|
from: Place;
|
|
63
67
|
to: Place;
|
|
68
|
+
routePath?: Point[];
|
|
64
69
|
};
|
|
65
70
|
export declare const SectionEndService: import("vue").DefineComponent<import("vue3").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, SectionEndServiceProps>;
|
|
66
71
|
export {};
|