@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.
Files changed (92) hide show
  1. package/README.md +47 -4
  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/api/contants.d.ts +3 -0
  10. package/dist/v2/api/contants.js +6 -0
  11. package/dist/v2/business-components/AuxiliaryPassanger/AuxiliaryPassanger.d.ts +6 -0
  12. package/dist/v2/business-components/AuxiliaryPassanger/AuxiliaryPassanger.js +50 -0
  13. package/dist/v2/business-components/AuxiliaryPassanger/index.d.ts +1 -0
  14. package/dist/v2/business-components/AuxiliaryPassanger/index.js +4 -0
  15. package/dist/v2/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.d.ts +1 -0
  16. package/dist/v2/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.js +2 -1
  17. package/dist/v2/business-components/BusinessRecomendPlaceMap/index.js +1 -1
  18. package/dist/v2/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.js +1 -1
  19. package/dist/v2/business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.d.ts +4 -3
  20. package/dist/v2/business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.js +6 -2
  21. package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.d.ts +4 -1
  22. package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.js +51 -7
  23. package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceSection.d.ts +6 -1
  24. package/dist/v2/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceSection.js +81 -19
  25. package/dist/v2/business-components/TaxiCar/RandomCars.d.ts +6 -0
  26. package/dist/v2/business-components/TaxiCar/RandomCars.js +47 -0
  27. package/dist/v2/chunks/{BusinessRecomendPlaceMap.e9166e7d.js → BusinessRecomendPlaceMap.eebd0822.js} +7 -1
  28. package/dist/v2/hooks/useMapCoordinatify.d.ts +2 -1
  29. package/dist/v2/hooks/useMapCoordinatify.js +6 -1
  30. package/dist/v2/hooks/useMapGeometry.d.ts +3 -3
  31. package/dist/v2/hooks/useMapGeometry.js +3 -3
  32. package/dist/v2/hooks/useWalkingRoute.js +46 -4
  33. package/dist/v2/hooks-business/useBusinessRecomendPlaceMap.js +1 -1
  34. package/dist/v2/index.js +1 -1
  35. package/dist/v2/types/interface.d.ts +12 -0
  36. package/dist/v2/utils/geometry.d.ts +1 -0
  37. package/dist/v2/utils/geometry.js +4 -2
  38. package/dist/v2/utils/geometryPolygon.d.ts +14 -0
  39. package/dist/v2/utils/geometryPolygon.js +46 -0
  40. package/dist/v2/utils/log.js +11 -3
  41. package/dist/v2/utils/platform.d.ts +2 -1
  42. package/dist/v2/utils/platform.js +2 -1
  43. package/dist/v2/utils/ttlCache.d.ts +34 -0
  44. package/dist/v2/utils/ttlCache.js +64 -0
  45. package/dist/v2/utils/typeChecking.d.ts +7 -1
  46. package/dist/v2/utils/typeChecking.js +18 -0
  47. package/dist/v3/Demo/DemoBusinessRecomendPlace.js +2 -1
  48. package/dist/v3/Demo/DemoBusinessTaxiEnd.d.ts +2 -1
  49. package/dist/v3/Demo/DemoBusinessTaxiEnd.js +9 -2
  50. package/dist/v3/Demo/DemoBusinessTaxiService.d.ts +4 -1
  51. package/dist/v3/Demo/DemoBusinessTaxiService.js +19 -1
  52. package/dist/v3/Demo/demo.data.mock.d.ts +4 -0
  53. package/dist/v3/Demo/demo.data.mock.js +1194 -0
  54. package/dist/v3/api/contants.d.ts +3 -0
  55. package/dist/v3/api/contants.js +6 -0
  56. package/dist/v3/business-components/AuxiliaryPassanger/AuxiliaryPassanger.d.ts +8 -0
  57. package/dist/v3/business-components/AuxiliaryPassanger/AuxiliaryPassanger.js +46 -0
  58. package/dist/v3/business-components/AuxiliaryPassanger/index.d.ts +1 -0
  59. package/dist/v3/business-components/AuxiliaryPassanger/index.js +4 -0
  60. package/dist/v3/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.d.ts +1 -0
  61. package/dist/v3/business-components/BusinessRecomendPlaceMap/BusinessRecomendPlaceMap.js +2 -1
  62. package/dist/v3/business-components/BusinessRecomendPlaceMap/index.js +1 -1
  63. package/dist/v3/business-components/BusinessReselectPlaceMap/BusinessReselectPlaceMap.js +1 -1
  64. package/dist/v3/business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.d.ts +4 -3
  65. package/dist/v3/business-components/BusinessTaxiEndMap/BusinessTaxiEndMap.js +6 -2
  66. package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.d.ts +4 -1
  67. package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceMap.js +49 -7
  68. package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceSection.d.ts +6 -1
  69. package/dist/v3/business-components/BusinessTaxiServiceMap/BusinessTaxiServiceSection.js +63 -19
  70. package/dist/v3/business-components/TaxiCar/RandomCars.d.ts +8 -0
  71. package/dist/v3/business-components/TaxiCar/RandomCars.js +45 -0
  72. package/dist/v3/chunks/{BusinessRecomendPlaceMap.c71d0b97.js → BusinessRecomendPlaceMap.71c439c6.js} +5 -1
  73. package/dist/v3/hooks/useMapCoordinatify.d.ts +2 -1
  74. package/dist/v3/hooks/useMapCoordinatify.js +6 -1
  75. package/dist/v3/hooks/useMapGeometry.d.ts +3 -3
  76. package/dist/v3/hooks/useMapGeometry.js +3 -3
  77. package/dist/v3/hooks/useWalkingRoute.js +46 -4
  78. package/dist/v3/hooks-business/useBusinessRecomendPlaceMap.js +1 -1
  79. package/dist/v3/index.js +1 -1
  80. package/dist/v3/types/interface.d.ts +12 -0
  81. package/dist/v3/utils/geometry.d.ts +1 -0
  82. package/dist/v3/utils/geometry.js +4 -2
  83. package/dist/v3/utils/geometryPolygon.d.ts +14 -0
  84. package/dist/v3/utils/geometryPolygon.js +46 -0
  85. package/dist/v3/utils/log.js +11 -3
  86. package/dist/v3/utils/platform.d.ts +2 -1
  87. package/dist/v3/utils/platform.js +2 -1
  88. package/dist/v3/utils/ttlCache.d.ts +34 -0
  89. package/dist/v3/utils/ttlCache.js +64 -0
  90. package/dist/v3/utils/typeChecking.d.ts +7 -1
  91. package/dist/v3/utils/typeChecking.js +18 -0
  92. 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,
@@ -596,10 +610,6 @@ export default defineComponent({
596
610
  mapContext={mapContext}
597
611
  onClickStartPoint={(place) => console.log("点击起点时触发 palce = ", place)}
598
612
  onClickEndPoint={(place) => console.log("点击终点时触发 palce = ", place)}
599
- onChangeGoogleConnection={(status) =>
600
- // 根据目前的产品需求,连通性检测只会被检测一次。
601
- console.log("谷歌连通性发生变化时触发,连通性状态是:", status)
602
- }
603
613
  />
604
614
  <div>
605
615
  经度 103.841974, 纬度 1.311295 在高德地图上的坐标类型是:
@@ -658,6 +668,18 @@ export default defineComponent({
658
668
  renderInServiceTitle={({ distance, duration }) =>
659
669
  `距离终点*${distance}*公里, 预计*${duration}*分钟`
660
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
+ ]}
661
683
  getDriverPositionTrack={async () => {
662
684
  // 向后端请求司机的历史轨迹
663
685
  return Promise.resolve<TrackPoint[]>([
@@ -666,6 +688,21 @@ export default defineComponent({
666
688
  { lng: 121.403581, lat: 31.216415, type: "gcj02", angle: 30, timestamp: 1698058442000 },
667
689
  ]);
668
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
+ }}
669
706
  interval={5000}
670
707
  mapContext={mapContext}
671
708
  />
@@ -701,6 +738,12 @@ export default defineComponent({
701
738
  displayName: "长城美华 Coffee Shop (CCMW)",
702
739
  type: "wgs84",
703
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
+ ]}
704
747
  />
705
748
  );
706
749
  },
@@ -1,5 +1,5 @@
1
1
  import { h } from "vue";
2
- import { B as BusinessRecomendPlaceMap } from "../chunks/BusinessRecomendPlaceMap.e9166e7d.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[];