@heycar/heycars-map 2.14.0-walkOptimize2 → 2.15.0-domestic2

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.
Files changed (80) hide show
  1. package/README.md +47 -15
  2. package/dist/v2/Demo/DemoBusinessRecomendPlace.js +2 -1
  3. package/dist/v2/Demo/DemoBusinessTaxiEnd.d.ts +2 -1
  4. package/dist/v2/Demo/DemoBusinessTaxiEnd.js +9 -2
  5. package/dist/v2/Demo/DemoBusinessTaxiService.d.ts +4 -1
  6. package/dist/v2/Demo/DemoBusinessTaxiService.js +19 -1
  7. package/dist/v2/Demo/demo.data.mock.d.ts +4 -0
  8. package/dist/v2/Demo/demo.data.mock.js +1194 -0
  9. package/dist/v2/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.d.ts +2 -2
  10. package/dist/v2/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.js +2 -1
  11. package/dist/v2/business-components/BusinessRecomendPlaceMap/index.js +1 -1
  12. package/dist/v2/business-components/BusinessRecomendPlaceMap/useCacheCenterPlace.d.ts +1 -2
  13. package/dist/v2/business-components/BusinessRecomendPlaceMap/useCacheCenterPlace.js +6 -14
  14. package/dist/v2/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.js +1 -1
  15. package/dist/v2/business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.d.ts +4 -3
  16. package/dist/v2/business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.js +6 -2
  17. package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.d.ts +4 -1
  18. package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.js +45 -7
  19. package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceSection.d.ts +6 -1
  20. package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceSection.js +80 -16
  21. package/dist/v2/business-components/TaxiCar/RandomCars.d.ts +6 -0
  22. package/dist/v2/business-components/TaxiCar/RandomCars.js +47 -0
  23. package/dist/v2/chunks/{BusinessRecomendPlaceMap.8a4a1015.js → BusinessRecomendPlaceMap.eebd0822.js} +9 -5
  24. package/dist/{v3/chunks/Loading.4c949ec9.js → v2/chunks/Loading.8aa3aad3.js} +47 -27
  25. package/dist/v2/components/Loading/Loading.js +1 -1
  26. package/dist/v2/components/Loading/index.js +1 -1
  27. package/dist/v2/components/MapProvider/MapProvider.js +21 -10
  28. package/dist/v2/hooks/useMapCoordinatify.d.ts +2 -1
  29. package/dist/v2/hooks/useMapCoordinatify.js +6 -1
  30. package/dist/v2/hooks/useMapLoader.js +3 -3
  31. package/dist/v2/hooks-business/useBusinessRecomendPlaceMap.js +1 -1
  32. package/dist/v2/index.js +1 -1
  33. package/dist/v2/types/interface.d.ts +12 -0
  34. package/dist/v2/utils/geometryPolygon.d.ts +9 -0
  35. package/dist/v2/utils/geometryPolygon.js +19 -0
  36. package/dist/v2/utils/log.js +1 -1
  37. package/dist/v2/utils/platform.d.ts +2 -1
  38. package/dist/v2/utils/platform.js +2 -1
  39. package/dist/v2/utils/typeChecking.d.ts +7 -1
  40. package/dist/v2/utils/typeChecking.js +18 -0
  41. package/dist/v3/Demo/DemoBusinessRecomendPlace.js +2 -1
  42. package/dist/v3/Demo/DemoBusinessTaxiEnd.d.ts +2 -1
  43. package/dist/v3/Demo/DemoBusinessTaxiEnd.js +9 -2
  44. package/dist/v3/Demo/DemoBusinessTaxiService.d.ts +4 -1
  45. package/dist/v3/Demo/DemoBusinessTaxiService.js +19 -1
  46. package/dist/v3/Demo/demo.data.mock.d.ts +4 -0
  47. package/dist/v3/Demo/demo.data.mock.js +1194 -0
  48. package/dist/v3/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.d.ts +2 -2
  49. package/dist/v3/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.js +2 -1
  50. package/dist/v3/business-components/BusinessRecomendPlaceMap/index.js +1 -1
  51. package/dist/v3/business-components/BusinessRecomendPlaceMap/useCacheCenterPlace.d.ts +1 -2
  52. package/dist/v3/business-components/BusinessRecomendPlaceMap/useCacheCenterPlace.js +6 -14
  53. package/dist/v3/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.js +1 -1
  54. package/dist/v3/business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.d.ts +4 -3
  55. package/dist/v3/business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.js +6 -2
  56. package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.d.ts +4 -1
  57. package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.js +45 -7
  58. package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceSection.d.ts +6 -1
  59. package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceSection.js +62 -16
  60. package/dist/v3/business-components/TaxiCar/RandomCars.d.ts +8 -0
  61. package/dist/v3/business-components/TaxiCar/RandomCars.js +45 -0
  62. package/dist/v3/chunks/{BusinessRecomendPlaceMap.b30ca4e4.js → BusinessRecomendPlaceMap.71c439c6.js} +7 -5
  63. package/dist/{v2/chunks/Loading.70dfc720.js → v3/chunks/Loading.4b53c31f.js} +34 -30
  64. package/dist/v3/components/Loading/Loading.js +1 -1
  65. package/dist/v3/components/Loading/index.js +1 -1
  66. package/dist/v3/components/MapProvider/MapProvider.js +21 -10
  67. package/dist/v3/hooks/useMapCoordinatify.d.ts +2 -1
  68. package/dist/v3/hooks/useMapCoordinatify.js +6 -1
  69. package/dist/v3/hooks/useMapLoader.js +3 -3
  70. package/dist/v3/hooks-business/useBusinessRecomendPlaceMap.js +1 -1
  71. package/dist/v3/index.js +1 -1
  72. package/dist/v3/types/interface.d.ts +12 -0
  73. package/dist/v3/utils/geometryPolygon.d.ts +9 -0
  74. package/dist/v3/utils/geometryPolygon.js +19 -0
  75. package/dist/v3/utils/log.js +1 -1
  76. package/dist/v3/utils/platform.d.ts +2 -1
  77. package/dist/v3/utils/platform.js +2 -1
  78. package/dist/v3/utils/typeChecking.d.ts +7 -1
  79. package/dist/v3/utils/typeChecking.js +18 -0
  80. package/package.json +1 -1
package/README.md CHANGED
@@ -133,6 +133,17 @@ export interface CoordinateTrackPoint {
133
133
  timestamp: number;
134
134
  }
135
135
 
136
+ export interface CoordinateExternalRoute {
137
+ path: CoordinatePoint[];
138
+ duration: number;
139
+ distance: number;
140
+ }
141
+
142
+ export type GetDriverRouteOrTrackOutput = {
143
+ routes?: CoordinateExternalRoute;
144
+ tracks?: CoordinateTrackPoint[];
145
+ };
146
+
136
147
  export enum CenterPlaceStatus {
137
148
  GEO_LOADING = "GEO_LOADING",
138
149
  QUERYING_INFO = "QUERYING_INFO",
@@ -195,6 +206,7 @@ export type DriverStatus =
195
206
  gmapKey={gmapApiKey}
196
207
  // 使用哪个地图供应商,目前两个供应商: amap 高德 / gmap 谷歌
197
208
  supplier={"amap"}
209
+ // 对于国内聚合,路径将 "/overseas/.*" 改为 "/now/.*"
198
210
  // 可选,高德驾车路线规划代理地址
199
211
  gaodeDirectionDrivingProxyUrl="/overseas/amap/driveGuide"
200
212
  // 可选,高德步行路线规划代理地址
@@ -349,6 +361,8 @@ export default defineComponent({
349
361
  queryingTitle={"正在获取地址信息"}
350
362
  recomendDescription={"您将在此处上车"}
351
363
  geoErrorOnceNotificationKey="BusinessReselectPlaceMap_GeoErrorOnceKey"
364
+ // 是否显示附近车辆
365
+ enableNearbyCars={true}
352
366
  defaultCenterPlace={(place) =>
353
367
  place ?? {
354
368
  lng: 139.777777,
@@ -358,17 +372,6 @@ export default defineComponent({
358
372
  displayName: "default place displayName",
359
373
  }
360
374
  }
361
- // 可选,应用启动时是否跳过等待 GPS,默认 false
362
- skipWaitGeo={
363
- false ||
364
- true || {
365
- lng: 139.55555,
366
- lat: 35.5555,
367
- type: "wgs84",
368
- name: "skip geo place name",
369
- displayName: "skip geo place displayName",
370
- }
371
- }
372
375
  getAvailable={() => Promise.resolve(true)}
373
376
  getRecomendPlace={getRecomendPlace}
374
377
  getDefaultCenterPlace={getDefaultCenterPlace}
@@ -607,10 +610,6 @@ export default defineComponent({
607
610
  mapContext={mapContext}
608
611
  onClickStartPoint={(place) => console.log("点击起点时触发 palce = ", place)}
609
612
  onClickEndPoint={(place) => console.log("点击终点时触发 palce = ", place)}
610
- onChangeGoogleConnection={(status) =>
611
- // 根据目前的产品需求,连通性检测只会被检测一次。
612
- console.log("谷歌连通性发生变化时触发,连通性状态是:", status)
613
- }
614
613
  />
615
614
  <div>
616
615
  经度 103.841974, 纬度 1.311295 在高德地图上的坐标类型是:
@@ -669,6 +668,18 @@ export default defineComponent({
669
668
  renderInServiceTitle={({ distance, duration }) =>
670
669
  `距离终点*${distance}*公里, 预计*${duration}*分钟`
671
670
  }
671
+ // 选填。 司机接单时,第三方指定的起点到终点的路径
672
+ confirmedPath={[
673
+ {lng: 121.401554, lat: 31.21653, type: "gcj02"},
674
+ {lng: 121.401554, lat: 31.21653, type: "gcj02"},
675
+ {lng: 121.401795, lat: 31.21654, type: "gcj02"},
676
+ ]}
677
+ // 选填。 订单结束时,实际行驶路径
678
+ endServicePath={[
679
+ {lng: 121.401554, lat: 31.21653, type: "gcj02"},
680
+ {lng: 121.401554, lat: 31.21653, type: "gcj02"},
681
+ {lng: 121.401795, lat: 31.21654, type: "gcj02"},
682
+ ]}
672
683
  getDriverPositionTrack={async () => {
673
684
  // 向后端请求司机的历史轨迹
674
685
  return Promise.resolve<TrackPoint[]>([
@@ -677,6 +688,21 @@ export default defineComponent({
677
688
  { lng: 121.403581, lat: 31.216415, type: "gcj02", angle: 30, timestamp: 1698058442000 },
678
689
  ]);
679
690
  }}
691
+ // getDriverRouteOrTrack 与 getDriverPositionTrack 二选一
692
+ getDriverRouteOrTrack={async () => {
693
+ // 后端返回司机的真实导航路径或者历史轨迹
694
+ return Promise.resolve<GetDriverRouteOrTrackOutput>({
695
+ routes: {
696
+ distance: 4270,
697
+ duration: 1310,
698
+ path: [
699
+ {lng: 121.401554, lat: 31.21653, type: "gcj02"},
700
+ {lng: 121.401554, lat: 31.21653, type: "gcj02"},
701
+ {lng: 121.401795, lat: 31.21654, type: "gcj02"},
702
+ ],
703
+ },
704
+ });
705
+ }}
680
706
  interval={5000}
681
707
  mapContext={mapContext}
682
708
  />
@@ -712,6 +738,12 @@ export default defineComponent({
712
738
  displayName: "长城美华 Coffee Shop (CCMW)",
713
739
  type: "wgs84",
714
740
  }}
741
+ // 选填。实际行驶路径
742
+ path={[
743
+ { lng: 103.996211, lat: 1.35202, type: "wgs84" },
744
+ { lng: 103.996469, lat: 1.352348, type: "wgs84" },
745
+ { lng: 103.996581, lat: 1.3526, type: "wgs84" },
746
+ ]}
715
747
  />
716
748
  );
717
749
  },
@@ -1,5 +1,5 @@
1
1
  import { h } from "vue";
2
- import { B as BusinessRecomendPlaceMap } from "../chunks/BusinessRecomendPlaceMap.8a4a1015.js";
2
+ import { B as BusinessRecomendPlaceMap } from "../chunks/BusinessRecomendPlaceMap.eebd0822.js";
3
3
  import { useBusinessRecomendPlaceMap } from "../hooks-business/useBusinessRecomendPlaceMap.js";
4
4
  import { defineSetup } from "../types/helper.js";
5
5
  import { d as demo } from "../chunks/Demo.css.e921a2f6.js";
@@ -124,6 +124,7 @@ const DemoBusinessRecomendPlace = defineSetup("DemoBusinessRecomendPlace", funct
124
124
  name: "default place name",
125
125
  displayName: "default place displayName"
126
126
  },
127
+ "enableNearbyCars": true,
127
128
  "getAvailable": () => Promise.resolve(true),
128
129
  "getRecomendPlace": getRecomendPlace,
129
130
  "renderPlacePhoto": (place) => {
@@ -1,6 +1,7 @@
1
- import { type CoordinatePlace } from "../types/interface";
1
+ import { type CoordinatePlace, type CoordinatePoint } from "../types/interface";
2
2
  export declare const DemoBusinessTaxiEnd: import("vue-demi").DefineComponent<{}, unknown, {
3
3
  from: CoordinatePlace;
4
4
  to: CoordinatePlace;
5
+ path: CoordinatePoint[];
5
6
  contentHeight: number;
6
7
  }, {}, {}, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue-demi").ExtractPropTypes<{}>>, {}>;
@@ -2,6 +2,7 @@ import { h } from "vue";
2
2
  import { defineComponent } from "vue-demi";
3
3
  import { BusinessTaxiEndMap } from "../business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.js";
4
4
  import { l as layout, a as adjustedDemo } from "../chunks/Demo.css.e921a2f6.js";
5
+ import { mockPath } from "./demo.data.mock.js";
5
6
  const DemoBusinessTaxiEnd = defineComponent({
6
7
  name: "DemoBusinessTaxiEnd",
7
8
  data() {
@@ -20,6 +21,7 @@ const DemoBusinessTaxiEnd = defineComponent({
20
21
  displayName: "",
21
22
  type: "wgs84"
22
23
  },
24
+ path: [],
23
25
  contentHeight: 200
24
26
  };
25
27
  },
@@ -43,12 +45,16 @@ const DemoBusinessTaxiEnd = defineComponent({
43
45
  setTimeout(() => {
44
46
  this.contentHeight = 600;
45
47
  }, 2500);
48
+ setTimeout(() => {
49
+ this.path = [...mockPath];
50
+ }, 3500);
46
51
  },
47
52
  render() {
48
53
  const {
49
54
  from,
50
55
  to,
51
- contentHeight
56
+ contentHeight,
57
+ path
52
58
  } = this;
53
59
  return h("div", {
54
60
  "class": layout
@@ -56,7 +62,8 @@ const DemoBusinessTaxiEnd = defineComponent({
56
62
  "class": adjustedDemo,
57
63
  "attrs": {
58
64
  "from": from,
59
- "to": to
65
+ "to": to,
66
+ "path": path
60
67
  }
61
68
  }), h("div", {
62
69
  "style": {
@@ -1,4 +1,4 @@
1
- import { type CoordinatePlace, type CoordinateTrackPoint, type DriverStatus } from "../types/interface";
1
+ import { type CoordinatePlace, type CoordinatePoint, type CoordinateTrackPoint, type DriverStatus, type GetDriverRouteOrTrackOutput } from "../types/interface";
2
2
  export declare const DemoBusinessTaxiService: import("vue-demi").DefineComponent<Readonly<{}>, {
3
3
  mapContext: import("../hooks-business/useBusinessTaxiServiceMap").BusinessTaxiServiceContext;
4
4
  }, {
@@ -7,6 +7,9 @@ export declare const DemoBusinessTaxiService: import("vue-demi").DefineComponent
7
7
  relayTo: Partial<CoordinatePlace>;
8
8
  status: DriverStatus;
9
9
  contentHeight: number;
10
+ confirmedPath: CoordinatePoint[];
11
+ endServicePath: CoordinatePoint[];
10
12
  }, {}, {
11
13
  getDriverPositionTrack(): Promise<CoordinateTrackPoint[]>;
14
+ getDriverRouteOrTrack(): Promise<GetDriverRouteOrTrackOutput>;
12
15
  }, import("vue/types/v3-component-options").ComponentOptionsMixin, import("vue/types/v3-component-options").ComponentOptionsMixin, {}, string, Readonly<import("vue-demi").ExtractPropTypes<Readonly<{}>>>, {}>;
@@ -4,7 +4,9 @@ import { BusinessTaxiServiceMap } from "../business-components/BusinessTaxiServi
4
4
  import { useBusinessTaxiServiceMap } from "../hooks-business/useBusinessTaxiServiceMap.js";
5
5
  import { isCoordinatePoint } from "../utils/typeChecking.js";
6
6
  import { l as layout, a as adjustedDemo } from "../chunks/Demo.css.e921a2f6.js";
7
+ import { mockConfirmedPath, mockExternalRoute } from "./demo.data.mock.js";
7
8
  const allDriverStatus = ["dispatching", "book-dispatching", "dispatched", "driverStartRelayService", "driverStartService", "book-driverStartService", "book-dispatched", "driverArrived", "inService", "canceled", "endService", "completed", "canceling", "banlanceRefund", "waitBanlanceRefund", "rechargePayed", "waitRechargePay", "payed", "waitpay", "refund", "confirmed", "assign"];
9
+ const mockDriverRoute = mockExternalRoute;
8
10
  const mockDriverTrackPoints = [{
9
11
  lng: 121.4036983,
10
12
  lat: 31.216324,
@@ -40,7 +42,9 @@ const DemoBusinessTaxiService = defineComponent({
40
42
  to: {},
41
43
  relayTo: {},
42
44
  status: "driverStartRelayService",
43
- contentHeight: 200
45
+ contentHeight: 200,
46
+ confirmedPath: [],
47
+ endServicePath: []
44
48
  };
45
49
  },
46
50
  created() {
@@ -85,10 +89,24 @@ const DemoBusinessTaxiService = defineComponent({
85
89
  type
86
90
  });
87
91
  };
92
+ window.updateDriverRoute = () => {
93
+ mockDriverRoute.path = mockDriverRoute.path.slice(5);
94
+ };
95
+ window.updateConfirmedPath = () => {
96
+ this.confirmedPath = [...mockConfirmedPath];
97
+ };
98
+ window.updateEndServicePath = () => {
99
+ this.endServicePath = [...mockConfirmedPath];
100
+ };
88
101
  },
89
102
  methods: {
90
103
  getDriverPositionTrack() {
91
104
  return Promise.resolve(mockDriverTrackPoints);
105
+ },
106
+ getDriverRouteOrTrack() {
107
+ return Promise.resolve({
108
+ routes: mockDriverRoute
109
+ });
92
110
  }
93
111
  },
94
112
  render() {
@@ -0,0 +1,4 @@
1
+ import type { CoordinateExternalRoute, CoordinatePoint } from "../types/interface";
2
+ export declare const mockPath: CoordinatePoint[];
3
+ export declare const mockExternalRoute: CoordinateExternalRoute;
4
+ export declare const mockConfirmedPath: CoordinatePoint[];