@heycar/heycars-map 0.2.9 → 0.2.11
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/dist/Demo/DemoBusinessTaxiEnd.d.ts +4 -1
- package/dist/Demo/DemoBusinessTaxiService.d.ts +2054 -1
- package/dist/api/contants.d.ts +2 -0
- package/dist/business-components/AddressBox/AddressBox.d.ts +2 -1
- package/dist/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.d.ts +2 -1
- package/dist/business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.d.ts +4 -3
- package/dist/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.d.ts +3 -2
- package/dist/business-components/DrivingLine/DrivingLine.d.ts +2 -1
- package/dist/business-components/DrivingRoute/DrivingRoute.d.ts +2 -1
- package/dist/business-components/PassengerCircle/PassengerCircle.d.ts +2 -1
- package/dist/business-components/PickupPoints/PickupPoints.d.ts +2 -1
- package/dist/business-components/PlaceCircle/PlaceCircle.d.ts +2 -1
- package/dist/business-components/StartEndPoint/StartEndPoint.d.ts +2 -1
- package/dist/business-components/TaxiCar/TaxiCar.d.ts +2 -1
- package/dist/business-components/WalkingLine/WalkingLine.d.ts +2 -1
- package/dist/business-components/WalkingRoute/WalkingRoute.d.ts +2 -1
- package/dist/business-components/WaveCircle/WaveCircle.d.ts +2 -1
- package/dist/components/MapProvider/MapProvider.d.ts +2 -1
- package/dist/hooks/useMapAutoComplete.d.ts +3 -3
- package/dist/hooks/useMapLog.d.ts +4 -0
- package/dist/hooks/useMapPlace.d.ts +3 -3
- package/dist/hooks/useMapRecomendPlace.d.ts +6 -6
- package/dist/hooks-business/useBusinessMapAutoComplete.d.ts +1 -1
- package/dist/hooks-business/useBusinessRecomendPlaceMap.d.ts +2 -2
- package/dist/hooks-business/useLagecyMapRecomendPlace.d.ts +2 -2
- package/dist/index.cjs +56 -56
- package/dist/index.js +1431 -1356
- package/dist/types/interface.d.ts +1 -1
- package/dist/utils/helper.d.ts +2 -0
- package/package.json +2 -2
- package/src/App.tsx +3 -3
- package/src/Demo/DemoBusinessRecomendPlace.tsx +42 -12
- package/src/Demo/DemoBusinessTaxiEnd.tsx +34 -9
- package/src/Demo/DemoBusinessTaxiService.tsx +53 -27
- package/src/api/contants.ts +3 -0
- package/src/business-components/AddressBox/AddressBox.tsx +4 -1
- package/src/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.tsx +8 -3
- package/src/business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.tsx +21 -11
- package/src/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.tsx +109 -28
- package/src/business-components/DrivingLine/DrivingLine.tsx +4 -1
- package/src/business-components/DrivingRoute/DrivingRoute.tsx +4 -1
- package/src/business-components/PassengerCircle/PassengerCircle.tsx +4 -1
- package/src/business-components/PickupPoints/PickupPoints.tsx +3 -1
- package/src/business-components/PlaceCircle/PlaceCircle.tsx +4 -1
- package/src/business-components/StartEndPoint/StartEndPoint.tsx +9 -6
- package/src/business-components/TaxiCar/TaxiCar.tsx +4 -1
- package/src/business-components/WalkingLine/WalkingLine.tsx +4 -1
- package/src/business-components/WalkingRoute/WalkingRoute.tsx +4 -1
- package/src/business-components/WaveCircle/WaveCircle.tsx +4 -1
- package/src/components/MapProvider/MapProvider.tsx +4 -1
- package/src/hooks/useMapLog.ts +12 -0
- package/src/hooks/useMapPlace.ts +8 -3
- package/src/types/amap/geocoder.d.ts +2 -0
- package/src/types/interface.ts +1 -1
- package/src/utils/helper.ts +5 -0
|
@@ -2,6 +2,7 @@ import { ref, watch } from "vue-demi";
|
|
|
2
2
|
import { HeycarMap, HeycarMapProps } from "../../components/MapProvider";
|
|
3
3
|
import { useGeoLocation } from "../../hooks/useGeoLocation";
|
|
4
4
|
import { MapMountedProps, onMapMounted } from "../../hooks/useMap";
|
|
5
|
+
import { MapLogProps, useMapLog } from "../../hooks/useMapLog";
|
|
5
6
|
import type { MROP } from "../../hooks/useOverlay";
|
|
6
7
|
import { defineLagecySetup, defineSetup } from "../../types/helper";
|
|
7
8
|
import type { DriverStatus, Place, Point } from "../../types/interface";
|
|
@@ -25,11 +26,13 @@ const STATUS_NEED_CAR_POSITION: DriverStatus[] = [
|
|
|
25
26
|
];
|
|
26
27
|
|
|
27
28
|
type SectionDispatchingProps = MROP &
|
|
29
|
+
MapLogProps &
|
|
28
30
|
MapMountedProps & {
|
|
29
31
|
title: string;
|
|
30
32
|
from: Place;
|
|
31
33
|
};
|
|
32
34
|
const SectionDispatching = defineSetup((props: SectionDispatchingProps, { emit }) => {
|
|
35
|
+
useMapLog(props, "SectionDispatching");
|
|
33
36
|
onMapMounted(() => emit("mapMounted"));
|
|
34
37
|
return () => {
|
|
35
38
|
const { from: fromPlace, title, registerOverlay } = props;
|
|
@@ -41,15 +44,17 @@ const SectionDispatching = defineSetup((props: SectionDispatchingProps, { emit }
|
|
|
41
44
|
position={from}
|
|
42
45
|
title={title}
|
|
43
46
|
registerOverlay={registerOverlay}
|
|
47
|
+
log={props.log}
|
|
44
48
|
/>
|
|
45
|
-
<WaveCircle position={from} />
|
|
46
|
-
<PlaceCircle position={from} label={fromPlace.name} hideIcon />
|
|
49
|
+
<WaveCircle position={from} log={props.log} />
|
|
50
|
+
<PlaceCircle position={from} label={fromPlace.name} hideIcon log={props.log} />
|
|
47
51
|
</div>
|
|
48
52
|
);
|
|
49
53
|
};
|
|
50
54
|
});
|
|
51
55
|
|
|
52
56
|
type SectionDriverStartServiceProps = MROP &
|
|
57
|
+
MapLogProps &
|
|
53
58
|
MapMountedProps & {
|
|
54
59
|
passengerPosition: Point;
|
|
55
60
|
carPosition: Point;
|
|
@@ -57,34 +62,51 @@ type SectionDriverStartServiceProps = MROP &
|
|
|
57
62
|
renderTitle: (props: Pick<DrivingRouteRenderProps, "duration" | "distance">) => string;
|
|
58
63
|
};
|
|
59
64
|
const SectionDriverStartService = defineSetup((props: SectionDriverStartServiceProps, { emit }) => {
|
|
65
|
+
useMapLog(props, "SectionDriverStartService");
|
|
60
66
|
onMapMounted(() => emit("mapMounted"));
|
|
61
67
|
return () => {
|
|
62
68
|
const { from: fromPlace, carPosition, passengerPosition, renderTitle, registerOverlay } = props;
|
|
63
69
|
const from = place2point(fromPlace);
|
|
64
70
|
return (
|
|
65
71
|
<div>
|
|
66
|
-
<StartEndPoint
|
|
67
|
-
|
|
72
|
+
<StartEndPoint
|
|
73
|
+
type="start"
|
|
74
|
+
position={from}
|
|
75
|
+
registerOverlay={registerOverlay}
|
|
76
|
+
log={props.log}
|
|
77
|
+
/>
|
|
78
|
+
<PlaceCircle position={from} label={fromPlace.name} hideIcon log={props.log} />
|
|
68
79
|
<DrivingRoute
|
|
69
80
|
from={carPosition}
|
|
70
81
|
to={from}
|
|
82
|
+
log={props.log}
|
|
71
83
|
render={({ path, distance, duration }) => [
|
|
72
|
-
<DrivingLine path={path} />,
|
|
73
|
-
<TaxiCar
|
|
84
|
+
<DrivingLine path={path} log={props.log} />,
|
|
85
|
+
<TaxiCar
|
|
86
|
+
position={carPosition}
|
|
87
|
+
title={renderTitle({ distance, duration })}
|
|
88
|
+
log={props.log}
|
|
89
|
+
/>,
|
|
74
90
|
]}
|
|
75
91
|
/>
|
|
76
92
|
<WalkingRoute
|
|
77
93
|
from={passengerPosition}
|
|
78
94
|
to={from}
|
|
79
|
-
|
|
95
|
+
log={props.log}
|
|
96
|
+
render={({ path }) => <WalkingLine path={path} log={props.log} />}
|
|
97
|
+
/>
|
|
98
|
+
<PassengerCircle
|
|
99
|
+
position={passengerPosition}
|
|
100
|
+
registerOverlay={registerOverlay}
|
|
101
|
+
log={props.log}
|
|
80
102
|
/>
|
|
81
|
-
<PassengerCircle position={passengerPosition} registerOverlay={registerOverlay} />
|
|
82
103
|
</div>
|
|
83
104
|
);
|
|
84
105
|
};
|
|
85
106
|
});
|
|
86
107
|
|
|
87
108
|
type SectionBookDispatchedProps = MROP &
|
|
109
|
+
MapLogProps &
|
|
88
110
|
MapMountedProps & {
|
|
89
111
|
passengerPosition: Point;
|
|
90
112
|
from: Place;
|
|
@@ -92,6 +114,7 @@ type SectionBookDispatchedProps = MROP &
|
|
|
92
114
|
title: string;
|
|
93
115
|
};
|
|
94
116
|
const SectionBookDispatched = defineSetup((props: SectionBookDispatchedProps, { emit }) => {
|
|
117
|
+
useMapLog(props, "SectionBookDispatched");
|
|
95
118
|
onMapMounted(() => emit("mapMounted"));
|
|
96
119
|
return () => {
|
|
97
120
|
const { from: fromPlace, passengerPosition, title, registerOverlay } = props;
|
|
@@ -103,15 +126,21 @@ const SectionBookDispatched = defineSetup((props: SectionBookDispatchedProps, {
|
|
|
103
126
|
position={from}
|
|
104
127
|
title={title}
|
|
105
128
|
registerOverlay={registerOverlay}
|
|
129
|
+
log={props.log}
|
|
130
|
+
/>
|
|
131
|
+
<PlaceCircle position={from} label={fromPlace.name} hideIcon log={props.log} />
|
|
132
|
+
<PassengerCircle
|
|
133
|
+
position={passengerPosition}
|
|
134
|
+
registerOverlay={registerOverlay}
|
|
135
|
+
log={props.log}
|
|
106
136
|
/>
|
|
107
|
-
<PlaceCircle position={from} label={fromPlace.name} hideIcon />
|
|
108
|
-
<PassengerCircle position={passengerPosition} registerOverlay={registerOverlay} />
|
|
109
137
|
</div>
|
|
110
138
|
);
|
|
111
139
|
};
|
|
112
140
|
});
|
|
113
141
|
|
|
114
142
|
type SectionDriverArrivedProps = MROP &
|
|
143
|
+
MapLogProps &
|
|
115
144
|
MapMountedProps & {
|
|
116
145
|
from: Place;
|
|
117
146
|
carPosition: Point;
|
|
@@ -120,24 +149,37 @@ type SectionDriverArrivedProps = MROP &
|
|
|
120
149
|
title: string;
|
|
121
150
|
};
|
|
122
151
|
const SectionDriverArrived = defineSetup((props: SectionDriverArrivedProps, { emit }) => {
|
|
152
|
+
useMapLog(props, "SectionDriverArrived");
|
|
123
153
|
onMapMounted(() => emit("mapMounted"));
|
|
124
154
|
return () => {
|
|
125
155
|
const { from: fromPlace, carPosition, passengerPosition, title, registerOverlay } = props;
|
|
126
156
|
const from = place2point(fromPlace);
|
|
127
157
|
return (
|
|
128
158
|
<div>
|
|
129
|
-
<TaxiCar
|
|
130
|
-
|
|
131
|
-
|
|
159
|
+
<TaxiCar
|
|
160
|
+
position={carPosition}
|
|
161
|
+
title={title}
|
|
162
|
+
registerOverlay={registerOverlay}
|
|
163
|
+
log={props.log}
|
|
164
|
+
/>
|
|
165
|
+
<StartEndPoint
|
|
166
|
+
type="start"
|
|
167
|
+
position={from}
|
|
168
|
+
registerOverlay={registerOverlay}
|
|
169
|
+
log={props.log}
|
|
170
|
+
/>
|
|
171
|
+
<PlaceCircle position={from} label={fromPlace.name} hideIcon log={props.log} />
|
|
132
172
|
<WalkingRoute
|
|
133
173
|
from={passengerPosition}
|
|
134
174
|
to={from}
|
|
175
|
+
log={props.log}
|
|
135
176
|
render={({ path }) => <WalkingLine path={path} />}
|
|
136
177
|
/>
|
|
137
178
|
<PassengerCircle
|
|
138
179
|
position={passengerPosition}
|
|
139
180
|
size="small"
|
|
140
181
|
registerOverlay={registerOverlay}
|
|
182
|
+
log={props.log}
|
|
141
183
|
/>
|
|
142
184
|
</div>
|
|
143
185
|
);
|
|
@@ -145,29 +187,38 @@ const SectionDriverArrived = defineSetup((props: SectionDriverArrivedProps, { em
|
|
|
145
187
|
});
|
|
146
188
|
|
|
147
189
|
type SectionInServiceProps = MROP &
|
|
190
|
+
MapLogProps &
|
|
148
191
|
MapMountedProps & {
|
|
149
192
|
to: Place;
|
|
150
193
|
carPosition: Point;
|
|
151
194
|
renderTitle: (props: Pick<DrivingRouteRenderProps, "duration" | "distance">) => string;
|
|
152
195
|
};
|
|
153
196
|
const SectionInService = defineSetup((props: SectionInServiceProps, { emit }) => {
|
|
197
|
+
useMapLog(props, "SectionInService");
|
|
154
198
|
onMapMounted(() => emit("mapMounted"));
|
|
155
199
|
return () => {
|
|
156
200
|
const { to: toPlace, carPosition, renderTitle, registerOverlay } = props;
|
|
157
201
|
const to = place2point(toPlace);
|
|
158
202
|
return (
|
|
159
203
|
<div>
|
|
160
|
-
<StartEndPoint type="end" position={to} registerOverlay={registerOverlay} />
|
|
161
|
-
<PlaceCircle
|
|
204
|
+
<StartEndPoint type="end" position={to} registerOverlay={registerOverlay} log={props.log} />
|
|
205
|
+
<PlaceCircle
|
|
206
|
+
position={carPosition}
|
|
207
|
+
label="'WebSter Dental Plaza'"
|
|
208
|
+
hideIcon
|
|
209
|
+
log={props.log}
|
|
210
|
+
/>
|
|
162
211
|
<DrivingRoute
|
|
163
212
|
from={carPosition}
|
|
164
213
|
to={to}
|
|
214
|
+
log={props.log}
|
|
165
215
|
render={({ path, distance, duration }) => [
|
|
166
|
-
<DrivingLine path={path} />,
|
|
216
|
+
<DrivingLine path={path} log={props.log} />,
|
|
167
217
|
<TaxiCar
|
|
168
218
|
position={carPosition}
|
|
169
219
|
title={renderTitle({ distance, duration })}
|
|
170
220
|
registerOverlay={registerOverlay}
|
|
221
|
+
log={props.log}
|
|
171
222
|
/>,
|
|
172
223
|
]}
|
|
173
224
|
/>
|
|
@@ -177,11 +228,13 @@ const SectionInService = defineSetup((props: SectionInServiceProps, { emit }) =>
|
|
|
177
228
|
});
|
|
178
229
|
|
|
179
230
|
type SectionCanceledProps = MROP &
|
|
231
|
+
MapLogProps &
|
|
180
232
|
MapMountedProps & {
|
|
181
233
|
from: Place;
|
|
182
234
|
to: Place;
|
|
183
235
|
};
|
|
184
236
|
const SectionCanceled = defineSetup((props: SectionCanceledProps, { emit }) => {
|
|
237
|
+
useMapLog(props, "SectionCanceled");
|
|
185
238
|
onMapMounted(() => emit("mapMounted"));
|
|
186
239
|
return () => {
|
|
187
240
|
const { from: fromPlace, to: toPlace, registerOverlay } = props;
|
|
@@ -189,21 +242,28 @@ const SectionCanceled = defineSetup((props: SectionCanceledProps, { emit }) => {
|
|
|
189
242
|
const to = place2point(toPlace);
|
|
190
243
|
return (
|
|
191
244
|
<div>
|
|
192
|
-
<StartEndPoint
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
245
|
+
<StartEndPoint
|
|
246
|
+
type="start"
|
|
247
|
+
position={from}
|
|
248
|
+
registerOverlay={registerOverlay}
|
|
249
|
+
log={props.log}
|
|
250
|
+
/>
|
|
251
|
+
<StartEndPoint type="end" position={to} registerOverlay={registerOverlay} log={props.log} />
|
|
252
|
+
<PlaceCircle position={from} label={fromPlace.name} hideIcon log={props.log} />
|
|
253
|
+
<PlaceCircle position={to} label={toPlace.name} hideIcon log={props.log} />
|
|
196
254
|
</div>
|
|
197
255
|
);
|
|
198
256
|
};
|
|
199
257
|
});
|
|
200
258
|
|
|
201
259
|
export type SectionEndServiceProps = MROP &
|
|
260
|
+
MapLogProps &
|
|
202
261
|
MapMountedProps & {
|
|
203
262
|
from: Place;
|
|
204
263
|
to: Place;
|
|
205
264
|
};
|
|
206
265
|
export const SectionEndService = defineSetup((props: SectionEndServiceProps, { emit }) => {
|
|
266
|
+
useMapLog(props, "SectionEndService");
|
|
207
267
|
onMapMounted(() => emit("mapMounted"));
|
|
208
268
|
return () => {
|
|
209
269
|
const { from: fromPlace, to: toPlace, registerOverlay } = props;
|
|
@@ -211,18 +271,29 @@ export const SectionEndService = defineSetup((props: SectionEndServiceProps, { e
|
|
|
211
271
|
const to = place2point(toPlace);
|
|
212
272
|
return (
|
|
213
273
|
<div>
|
|
214
|
-
<StartEndPoint
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
274
|
+
<StartEndPoint
|
|
275
|
+
type="start"
|
|
276
|
+
position={from}
|
|
277
|
+
registerOverlay={registerOverlay}
|
|
278
|
+
log={props.log}
|
|
279
|
+
/>
|
|
280
|
+
<StartEndPoint type="end" position={to} registerOverlay={registerOverlay} log={props.log} />
|
|
281
|
+
<PlaceCircle position={from} label={fromPlace.name} hideIcon log={props.log} />
|
|
282
|
+
<PlaceCircle position={to} label={toPlace.name} hideIcon log={props.log} />
|
|
283
|
+
<DrivingRoute
|
|
284
|
+
from={from}
|
|
285
|
+
to={to}
|
|
286
|
+
render={({ path }) => <DrivingLine path={path} done log={props.log} />}
|
|
287
|
+
log={props.log}
|
|
288
|
+
/>
|
|
219
289
|
</div>
|
|
220
290
|
);
|
|
221
291
|
};
|
|
222
292
|
});
|
|
223
293
|
|
|
224
294
|
export type BusinessTaxiServiceMapProps = Omit<HeycarMapProps, "center" | "zoom"> &
|
|
225
|
-
Required<MROP> &
|
|
295
|
+
Required<MROP> &
|
|
296
|
+
MapLogProps & {
|
|
226
297
|
from: Place;
|
|
227
298
|
to: Place;
|
|
228
299
|
// @example 正在为您搜索附近司机
|
|
@@ -237,6 +308,7 @@ export type BusinessTaxiServiceMapProps = Omit<HeycarMapProps, "center" | "zoom"
|
|
|
237
308
|
getDriverPosition: () => Promise<Point>;
|
|
238
309
|
};
|
|
239
310
|
export const BusinessTaxiServiceMap = defineLagecySetup((props: BusinessTaxiServiceMapProps) => {
|
|
311
|
+
useMapLog(props, "BusinessTaxiServiceMap");
|
|
240
312
|
const {
|
|
241
313
|
from,
|
|
242
314
|
interval,
|
|
@@ -272,13 +344,14 @@ export const BusinessTaxiServiceMap = defineLagecySetup((props: BusinessTaxiServ
|
|
|
272
344
|
} = props;
|
|
273
345
|
const carPosition = carPositionRef.value;
|
|
274
346
|
return (
|
|
275
|
-
<HeycarMap center={place2point(from)} zoom={13} mapRef={mapRef}>
|
|
347
|
+
<HeycarMap center={place2point(from)} zoom={13} mapRef={mapRef} log={props.log}>
|
|
276
348
|
{driverStatus === "dispatching" ? (
|
|
277
349
|
<SectionDispatching
|
|
278
350
|
from={from}
|
|
279
351
|
title={dispatchingTitle}
|
|
280
352
|
registerOverlay={registerOverlay}
|
|
281
353
|
onMapMounted={setFitView}
|
|
354
|
+
log={props.log}
|
|
282
355
|
/>
|
|
283
356
|
) : driverStatus === "book-dispatching" ? (
|
|
284
357
|
<SectionDispatching
|
|
@@ -286,6 +359,7 @@ export const BusinessTaxiServiceMap = defineLagecySetup((props: BusinessTaxiServ
|
|
|
286
359
|
title={bookDispatchingTitle}
|
|
287
360
|
registerOverlay={registerOverlay}
|
|
288
361
|
onMapMounted={setFitView}
|
|
362
|
+
log={props.log}
|
|
289
363
|
/>
|
|
290
364
|
) : driverStatus === "dispatched" ||
|
|
291
365
|
driverStatus === "driverStartService" ||
|
|
@@ -297,6 +371,7 @@ export const BusinessTaxiServiceMap = defineLagecySetup((props: BusinessTaxiServ
|
|
|
297
371
|
renderTitle={renderStartSerivceTitle}
|
|
298
372
|
registerOverlay={registerOverlay}
|
|
299
373
|
onMapMounted={setFitView}
|
|
374
|
+
log={props.log}
|
|
300
375
|
/>
|
|
301
376
|
) : driverStatus === "book-dispatched" ? (
|
|
302
377
|
<SectionBookDispatched
|
|
@@ -305,6 +380,7 @@ export const BusinessTaxiServiceMap = defineLagecySetup((props: BusinessTaxiServ
|
|
|
305
380
|
title={bookDispatchedTitle}
|
|
306
381
|
registerOverlay={registerOverlay}
|
|
307
382
|
onMapMounted={setFitView}
|
|
383
|
+
log={props.log}
|
|
308
384
|
/>
|
|
309
385
|
) : driverStatus === "inService" ? (
|
|
310
386
|
<SectionInService
|
|
@@ -313,6 +389,7 @@ export const BusinessTaxiServiceMap = defineLagecySetup((props: BusinessTaxiServ
|
|
|
313
389
|
renderTitle={renderInServiceTitle}
|
|
314
390
|
registerOverlay={registerOverlay}
|
|
315
391
|
onMapMounted={setFitView}
|
|
392
|
+
log={props.log}
|
|
316
393
|
/>
|
|
317
394
|
) : driverStatus === "driverArrived" ? (
|
|
318
395
|
<SectionDriverArrived
|
|
@@ -322,9 +399,10 @@ export const BusinessTaxiServiceMap = defineLagecySetup((props: BusinessTaxiServ
|
|
|
322
399
|
title={driverArrivedTitle}
|
|
323
400
|
registerOverlay={registerOverlay}
|
|
324
401
|
onMapMounted={setFitView}
|
|
402
|
+
log={props.log}
|
|
325
403
|
/>
|
|
326
404
|
) : driverStatus === "canceled" || driverStatus === "canceling" ? (
|
|
327
|
-
<SectionCanceled from={from} to={to} registerOverlay={registerOverlay} />
|
|
405
|
+
<SectionCanceled from={from} to={to} registerOverlay={registerOverlay} log={props.log} />
|
|
328
406
|
) : driverStatus === "endService" ||
|
|
329
407
|
driverStatus === "completed" ||
|
|
330
408
|
driverStatus === "banlanceRefund" ||
|
|
@@ -340,6 +418,7 @@ export const BusinessTaxiServiceMap = defineLagecySetup((props: BusinessTaxiServ
|
|
|
340
418
|
to={to}
|
|
341
419
|
registerOverlay={registerOverlay}
|
|
342
420
|
onMapMounted={setFitView}
|
|
421
|
+
log={props.log}
|
|
343
422
|
/>
|
|
344
423
|
) : (
|
|
345
424
|
// 匹配不到就显示灰色路线
|
|
@@ -348,12 +427,14 @@ export const BusinessTaxiServiceMap = defineLagecySetup((props: BusinessTaxiServ
|
|
|
348
427
|
to={to}
|
|
349
428
|
registerOverlay={registerOverlay}
|
|
350
429
|
onMapMounted={setFitView}
|
|
430
|
+
log={props.log}
|
|
351
431
|
/>
|
|
352
432
|
)}
|
|
353
433
|
</HeycarMap>
|
|
354
434
|
);
|
|
355
435
|
};
|
|
356
436
|
}).props([
|
|
437
|
+
"log",
|
|
357
438
|
"bookDispatchedTitle",
|
|
358
439
|
"bookDispatchingTitle",
|
|
359
440
|
"dispatchingTitle",
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { computed } from "vue-demi";
|
|
2
2
|
import { AmapPolyline } from "../../components/AmapPolyline";
|
|
3
3
|
import { GmapPolyline } from "../../components/GmapPolyline";
|
|
4
|
+
import { MapLogProps, useMapLog } from "../../hooks/useMapLog";
|
|
4
5
|
import { useMapSupplier } from "../../hooks/useMapSupplier";
|
|
5
6
|
import { createElement, defineSetup } from "../../types/helper";
|
|
6
7
|
import { vec2lnglat } from "../../utils/transform";
|
|
7
8
|
|
|
8
|
-
export interface DrivingLineProps {
|
|
9
|
+
export interface DrivingLineProps extends MapLogProps {
|
|
9
10
|
done?: boolean;
|
|
10
11
|
path: [number, number][];
|
|
11
12
|
}
|
|
12
13
|
export const ADrivingLine = defineSetup(function ADrivingLine(props: DrivingLineProps) {
|
|
14
|
+
useMapLog(props, "ADrivingLine");
|
|
13
15
|
return () => {
|
|
14
16
|
const vw = window.innerWidth * 0.01;
|
|
15
17
|
const strokeWidth = 2.5 * vw;
|
|
@@ -63,6 +65,7 @@ export const ADrivingLine = defineSetup(function ADrivingLine(props: DrivingLine
|
|
|
63
65
|
});
|
|
64
66
|
|
|
65
67
|
export const GDrivingLine = defineSetup(function GDrivingLine(props: DrivingLineProps) {
|
|
68
|
+
useMapLog(props, "ADrivingLine");
|
|
66
69
|
const pathRef = computed(() => props.path.map(vec2lnglat));
|
|
67
70
|
return () => {
|
|
68
71
|
const vw = window.innerWidth * 0.01;
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
} from "../../hooks/useDrivingRoute";
|
|
7
7
|
import { useAmap, useGmap } from "../../hooks/useMap";
|
|
8
8
|
import { useAmapAngle, useGmapAngle } from "../../hooks/useMapAngle";
|
|
9
|
+
import { MapLogProps, useMapLog } from "../../hooks/useMapLog";
|
|
9
10
|
import { useMapSupplier } from "../../hooks/useMapSupplier";
|
|
10
11
|
import { createElement, defineSetup, VNodeChild } from "../../types/helper";
|
|
11
12
|
import type { Point } from "../../types/interface";
|
|
@@ -16,13 +17,14 @@ export type DrivingRouteRenderProps = {
|
|
|
16
17
|
distance: number;
|
|
17
18
|
duration: number;
|
|
18
19
|
};
|
|
19
|
-
export interface DrivingRouteProps extends UseDrivingRouteProps {
|
|
20
|
+
export interface DrivingRouteProps extends UseDrivingRouteProps, MapLogProps {
|
|
20
21
|
render?: (props: DrivingRouteRenderProps) => VNodeChild;
|
|
21
22
|
}
|
|
22
23
|
export const ADrivingRoute = defineSetup(function DrivingRoute(
|
|
23
24
|
props: DrivingRouteProps,
|
|
24
25
|
{ slots }
|
|
25
26
|
) {
|
|
27
|
+
useMapLog(props, "ADrivingRoute");
|
|
26
28
|
const map = useAmap();
|
|
27
29
|
const { path, distance, duration } = toRefs(useADrivingRoute(props));
|
|
28
30
|
const angle = useAmapAngle(reactive({ path, map }));
|
|
@@ -33,6 +35,7 @@ export const GDrivingRoute = defineSetup(function DrivingRoute(
|
|
|
33
35
|
props: DrivingRouteProps,
|
|
34
36
|
{ slots }
|
|
35
37
|
) {
|
|
38
|
+
useMapLog(props, "GDrivingRoute");
|
|
36
39
|
const map = useGmap();
|
|
37
40
|
const { path, distance, duration } = toRefs(useGDrivingRoute(props));
|
|
38
41
|
const angle = useGmapAngle(reactive({ path, map }));
|
|
@@ -3,6 +3,7 @@ import imgPassengerCircle from "../../assets/icons/svg/passenger-circle.svg";
|
|
|
3
3
|
import imgPlaceCircle from "../../assets/icons/svg/place-circle.svg";
|
|
4
4
|
import { AmapMarker } from "../../components/AmapMarker";
|
|
5
5
|
import { GmapAdvancedMarkerView } from "../../components/GmapAdvancedMarkerView";
|
|
6
|
+
import { MapLogProps, useMapLog } from "../../hooks/useMapLog";
|
|
6
7
|
import { useMapSupplier } from "../../hooks/useMapSupplier";
|
|
7
8
|
import type { AmapOverlay, GmapOverlay, MapRegisterOverlayProps } from "../../hooks/useOverlay";
|
|
8
9
|
import { createElement, defineSetup } from "../../types/helper";
|
|
@@ -11,13 +12,14 @@ import { vec2lnglat } from "../../utils/transform";
|
|
|
11
12
|
|
|
12
13
|
import * as css from "./PassengerCircle.css";
|
|
13
14
|
|
|
14
|
-
interface PassengerCircleProps<T> extends MapRegisterOverlayProps<T
|
|
15
|
+
interface PassengerCircleProps<T> extends MapRegisterOverlayProps<T>, MapLogProps {
|
|
15
16
|
position: [number, number];
|
|
16
17
|
size?: "small" | "large";
|
|
17
18
|
}
|
|
18
19
|
export const APassengerCircle = defineSetup(function APassengerCircle(
|
|
19
20
|
props: PassengerCircleProps<AmapOverlay>
|
|
20
21
|
) {
|
|
22
|
+
useMapLog(props, "APassengerCircle");
|
|
21
23
|
const contentRef = computed(() => {
|
|
22
24
|
const { size = "large" } = props;
|
|
23
25
|
const src = size === "large" ? imgPassengerCircle : imgPlaceCircle;
|
|
@@ -40,6 +42,7 @@ export const APassengerCircle = defineSetup(function APassengerCircle(
|
|
|
40
42
|
export const GPassengerCircle = defineSetup(function GPassengerCircle(
|
|
41
43
|
props: PassengerCircleProps<GmapOverlay>
|
|
42
44
|
) {
|
|
45
|
+
useMapLog(props, "GPassengerCircle");
|
|
43
46
|
const contentRef = computed(() => {
|
|
44
47
|
const { size = "large" } = props;
|
|
45
48
|
const src = size === "large" ? imgPassengerCircle : imgPlaceCircle;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
+
import { MapLogProps, useMapLog } from "../../hooks/useMapLog";
|
|
1
2
|
import { defineSetup } from "../../types/helper";
|
|
2
3
|
import type { Place } from "../../types/interface";
|
|
3
4
|
import { place2point } from "../../utils/transform";
|
|
4
5
|
import { PlaceCircle } from "../PlaceCircle";
|
|
5
6
|
|
|
6
|
-
export interface PickupPointsProps {
|
|
7
|
+
export interface PickupPointsProps extends MapLogProps {
|
|
7
8
|
places: Place[];
|
|
8
9
|
onClick?: (value: Place) => any;
|
|
9
10
|
}
|
|
10
11
|
export const PickupPoints = defineSetup(function PickupPoints(props: PickupPointsProps, { emit }) {
|
|
12
|
+
useMapLog(props, "PickupPoints");
|
|
11
13
|
return () => (
|
|
12
14
|
<div>
|
|
13
15
|
{props.places.map((place) => (
|
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
GmapAdvancedMarkerView,
|
|
6
6
|
GmapAdvancedMarkerViewProps,
|
|
7
7
|
} from "../../components/GmapAdvancedMarkerView";
|
|
8
|
+
import { MapLogProps, useMapLog } from "../../hooks/useMapLog";
|
|
8
9
|
import { useMapSupplier } from "../../hooks/useMapSupplier";
|
|
9
10
|
import { AnchorType } from "../../types/amap/marker";
|
|
10
11
|
import { createElement, defineSetup } from "../../types/helper";
|
|
@@ -13,7 +14,7 @@ import { createDom } from "../../utils/dom";
|
|
|
13
14
|
import { vec2lnglat } from "../../utils/transform";
|
|
14
15
|
import * as css from "./PlaceCircle.css";
|
|
15
16
|
|
|
16
|
-
export interface PlaceCircleProps {
|
|
17
|
+
export interface PlaceCircleProps extends MapLogProps {
|
|
17
18
|
position: [number, number];
|
|
18
19
|
label?: string;
|
|
19
20
|
textAlign?: "left" | "right";
|
|
@@ -21,6 +22,7 @@ export interface PlaceCircleProps {
|
|
|
21
22
|
onClick?: (value: Point) => any;
|
|
22
23
|
}
|
|
23
24
|
export const APlaceCircle = defineSetup(function APlaceCircle(props: PlaceCircleProps, { emit }) {
|
|
25
|
+
useMapLog(props, "APlaceCircle");
|
|
24
26
|
const textAlignRef = computed(() => props.textAlign ?? "right");
|
|
25
27
|
const contentRef = computed(() => {
|
|
26
28
|
const { hideIcon = false } = props;
|
|
@@ -56,6 +58,7 @@ export const APlaceCircle = defineSetup(function APlaceCircle(props: PlaceCircle
|
|
|
56
58
|
});
|
|
57
59
|
|
|
58
60
|
export const GPlaceCircle = defineSetup(function GPlaceCircle(props: PlaceCircleProps, { emit }) {
|
|
61
|
+
useMapLog(props, "GPlaceCircle");
|
|
59
62
|
const textAlignRef = computed(() => props.textAlign ?? "right");
|
|
60
63
|
const contentRef = computed(() => {
|
|
61
64
|
const { hideIcon = false } = props;
|
|
@@ -3,22 +3,24 @@ import imgEndPoint from "../../assets/icons/svg/end-point.svg";
|
|
|
3
3
|
import imgStartPoint from "../../assets/icons/svg/start-point.svg";
|
|
4
4
|
import { AmapMarker } from "../../components/AmapMarker";
|
|
5
5
|
import { GmapAdvancedMarkerView } from "../../components/GmapAdvancedMarkerView/GmapAdvancedMarkerView";
|
|
6
|
+
import { MapLogProps, useMapLog } from "../../hooks/useMapLog";
|
|
6
7
|
import { useMapSupplier } from "../../hooks/useMapSupplier";
|
|
7
8
|
import type { AmapOverlay, GmapOverlay, MapRegisterOverlayProps } from "../../hooks/useOverlay";
|
|
8
|
-
import { createElement,
|
|
9
|
+
import { createElement, defineSetup } from "../../types/helper";
|
|
9
10
|
import { createDom } from "../../utils/dom";
|
|
10
11
|
import { decodeAsterisk, vec2lnglat } from "../../utils/transform";
|
|
11
12
|
import * as css from "./StartEndPoint.css";
|
|
12
13
|
|
|
13
|
-
export interface StartEndPointProps<T> extends MapRegisterOverlayProps<T
|
|
14
|
+
export interface StartEndPointProps<T> extends MapRegisterOverlayProps<T>, MapLogProps {
|
|
14
15
|
type: "start" | "end";
|
|
15
16
|
position: [number, number];
|
|
16
17
|
title?: string;
|
|
17
18
|
description?: string;
|
|
18
19
|
}
|
|
19
|
-
export const AStartEndPoint =
|
|
20
|
+
export const AStartEndPoint = defineSetup(function AStartEndPoint(
|
|
20
21
|
props: StartEndPointProps<AmapOverlay>
|
|
21
22
|
) {
|
|
23
|
+
useMapLog(props, "AStartEndPoint");
|
|
22
24
|
const contentRef = computed(() => {
|
|
23
25
|
const icon = props.type === "start" ? imgStartPoint : imgEndPoint;
|
|
24
26
|
const descriptionRow = !props.description
|
|
@@ -57,11 +59,12 @@ export const AStartEndPoint = defineLagecySetup(function AStartEndPoint(
|
|
|
57
59
|
anchor={"bottom-center"}
|
|
58
60
|
/>
|
|
59
61
|
);
|
|
60
|
-
})
|
|
62
|
+
});
|
|
61
63
|
|
|
62
|
-
export const GStartEndPoint =
|
|
64
|
+
export const GStartEndPoint = defineSetup(function GStartEndPoint(
|
|
63
65
|
props: StartEndPointProps<GmapOverlay>
|
|
64
66
|
) {
|
|
67
|
+
useMapLog(props, "GStartEndPoint");
|
|
65
68
|
const contentRef = computed(() => {
|
|
66
69
|
const icon = props.type === "start" ? imgStartPoint : imgEndPoint;
|
|
67
70
|
const descriptionRow = !props.description
|
|
@@ -105,7 +108,7 @@ export const GStartEndPoint = defineLagecySetup(function GStartEndPoint(
|
|
|
105
108
|
/>
|
|
106
109
|
);
|
|
107
110
|
};
|
|
108
|
-
})
|
|
111
|
+
});
|
|
109
112
|
|
|
110
113
|
export const StartEndPoint = defineSetup(function StartEndPoint(
|
|
111
114
|
props: StartEndPointProps<AmapOverlay> | StartEndPointProps<GmapOverlay>
|
|
@@ -2,6 +2,7 @@ import { computed } from "vue-demi";
|
|
|
2
2
|
import imgTaxicar from "../../assets/icons/svg/taxi-car.svg";
|
|
3
3
|
import { AmapMarker } from "../../components/AmapMarker";
|
|
4
4
|
import { GmapAdvancedMarkerView } from "../../components/GmapAdvancedMarkerView/GmapAdvancedMarkerView";
|
|
5
|
+
import { MapLogProps, useMapLog } from "../../hooks/useMapLog";
|
|
5
6
|
import { useMapSupplier } from "../../hooks/useMapSupplier";
|
|
6
7
|
import type { AmapOverlay, GmapOverlay, MapRegisterOverlayProps } from "../../hooks/useOverlay";
|
|
7
8
|
import { createElement, defineSetup } from "../../types/helper";
|
|
@@ -9,12 +10,13 @@ import { createDom } from "../../utils/dom";
|
|
|
9
10
|
import { decodeAsterisk, vec2lnglat } from "../../utils/transform";
|
|
10
11
|
import * as css from "./TaxiCar.css";
|
|
11
12
|
|
|
12
|
-
export interface TaxiCarProps<T> extends MapRegisterOverlayProps<T
|
|
13
|
+
export interface TaxiCarProps<T> extends MapRegisterOverlayProps<T>, MapLogProps {
|
|
13
14
|
position: [number, number];
|
|
14
15
|
angle?: number;
|
|
15
16
|
title?: string;
|
|
16
17
|
}
|
|
17
18
|
export const ATaxiCar = defineSetup(function ATaxiCar(props: TaxiCarProps<AmapOverlay>) {
|
|
19
|
+
useMapLog(props, "ATaxiCar");
|
|
18
20
|
const contentRef = computed(() => {
|
|
19
21
|
const titleRow = !props.title
|
|
20
22
|
? ""
|
|
@@ -45,6 +47,7 @@ export const ATaxiCar = defineSetup(function ATaxiCar(props: TaxiCarProps<AmapOv
|
|
|
45
47
|
});
|
|
46
48
|
|
|
47
49
|
export const GTaxiCar = defineSetup(function GTaxiCar(props: TaxiCarProps<GmapOverlay>) {
|
|
50
|
+
useMapLog(props, "GTaxiCar");
|
|
48
51
|
const contentRef = computed(() => {
|
|
49
52
|
const titleRow = !props.title
|
|
50
53
|
? ""
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { computed } from "vue-demi";
|
|
2
2
|
import { AmapPolyline } from "../../components/AmapPolyline";
|
|
3
3
|
import { GmapPolyline } from "../../components/GmapPolyline";
|
|
4
|
+
import { MapLogProps, useMapLog } from "../../hooks/useMapLog";
|
|
4
5
|
import { useMapSupplier } from "../../hooks/useMapSupplier";
|
|
5
6
|
import { createElement, defineSetup } from "../../types/helper";
|
|
6
7
|
import { vec2lnglat } from "../../utils/transform";
|
|
7
8
|
|
|
8
|
-
export interface WalkingLineProps {
|
|
9
|
+
export interface WalkingLineProps extends MapLogProps {
|
|
9
10
|
path: [number, number][];
|
|
10
11
|
}
|
|
11
12
|
export const AWalkingLine = defineSetup(function AWalkingLine(props: WalkingLineProps) {
|
|
13
|
+
useMapLog(props, "AWalkingLine");
|
|
12
14
|
return () => {
|
|
13
15
|
const { path } = props;
|
|
14
16
|
if (path.length === 0) return null;
|
|
@@ -30,6 +32,7 @@ export const AWalkingLine = defineSetup(function AWalkingLine(props: WalkingLine
|
|
|
30
32
|
});
|
|
31
33
|
|
|
32
34
|
export const GWalkingLine = defineSetup(function GWalkingLine(props: WalkingLineProps) {
|
|
35
|
+
useMapLog(props, "GWalkingLine");
|
|
33
36
|
const pathRef = computed(() => props.path.map(vec2lnglat));
|
|
34
37
|
return () => {
|
|
35
38
|
const path = pathRef.value;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { reactive, VNodeData } from "vue-demi";
|
|
2
|
+
import { MapLogProps, useMapLog } from "../../hooks/useMapLog";
|
|
2
3
|
import { useMapSupplier } from "../../hooks/useMapSupplier";
|
|
3
4
|
import {
|
|
4
5
|
useAWalkingRoute,
|
|
@@ -11,13 +12,14 @@ import type { Point } from "../../types/interface";
|
|
|
11
12
|
export type WalkingRouteRenderProps = {
|
|
12
13
|
path: Point[];
|
|
13
14
|
};
|
|
14
|
-
export interface WalkingRouteProps extends UseWalkingRouteProps {
|
|
15
|
+
export interface WalkingRouteProps extends UseWalkingRouteProps, MapLogProps {
|
|
15
16
|
render?: (props: WalkingRouteRenderProps) => VNodeChild;
|
|
16
17
|
}
|
|
17
18
|
export const AWalkingRoute = defineSetup(function WalkingRoute(
|
|
18
19
|
props: WalkingRouteProps,
|
|
19
20
|
{ slots }
|
|
20
21
|
) {
|
|
22
|
+
useMapLog(props, "AWalkingRoute");
|
|
21
23
|
const path = useAWalkingRoute(props);
|
|
22
24
|
return () => <div>{slots.render?.(reactive({ path }))}</div>;
|
|
23
25
|
});
|
|
@@ -26,6 +28,7 @@ export const GWalkingRoute = defineSetup(function WalkingRoute(
|
|
|
26
28
|
props: WalkingRouteProps,
|
|
27
29
|
{ slots }
|
|
28
30
|
) {
|
|
31
|
+
useMapLog(props, "GWalkingRoute");
|
|
29
32
|
const path = useGWalkingRoute(props);
|
|
30
33
|
return () => <div>{slots.render?.(reactive({ path }))}</div>;
|
|
31
34
|
});
|