@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
@@ -1,11 +1,19 @@
1
1
  const availableLogKeys = /* @__PURE__ */ new Set();
2
2
  const pkgName = "@heycar/heycars-map";
3
- const pkgVersion = "2.13.0-relay2";
3
+ const pkgVersion = "2.15.0-domestic1";
4
+ const spaceLogSessionKey = "wiajlf;jwiatitruiq3jrlw";
5
+ const enableSessionLogKey = (key) => {
6
+ const sessionParam = new URLSearchParams(sessionStorage.getItem(spaceLogSessionKey) || void 0);
7
+ sessionParam.set(`log-${key}`, "true");
8
+ sessionStorage.setItem(spaceLogSessionKey, sessionParam.toString());
9
+ };
4
10
  const isEnableLog = (name) => {
5
11
  const searchParam = new URLSearchParams(location.search);
6
- return searchParam.has(`log-${name}`);
12
+ const sessionParam = new URLSearchParams(sessionStorage.getItem(spaceLogSessionKey) || void 0);
13
+ return searchParam.has(`log-${name}`) || sessionParam.has(`log-${name}`);
7
14
  };
8
- window.availableLogKeys = availableLogKeys;
15
+ window.heycarMapAvailableLogKeys = availableLogKeys;
16
+ window.heycarMapEnableSessionLogKey = enableSessionLogKey;
9
17
  const spaceLog = (logKey, ...args) => {
10
18
  availableLogKeys.add(logKey);
11
19
  if (!isEnableLog(logKey))
@@ -4,7 +4,8 @@ export declare enum BRWOSER_PLATFORM {
4
4
  ALIPAY = "ALIPAY",
5
5
  ALIPAY_MINIPROGRAM = "ALIPAY_MINIPROGRAM",
6
6
  H5 = "H5",
7
- NODE_JS = "NODE_JS"
7
+ NODE_JS = "NODE_JS",
8
+ ENTERPRISE_WECHAT = "ENTERPRISE_WECHAT"
8
9
  }
9
10
  export declare enum OS_PLATFORM {
10
11
  IOS = "IOS",
@@ -5,6 +5,7 @@ var BRWOSER_PLATFORM = /* @__PURE__ */ ((BRWOSER_PLATFORM2) => {
5
5
  BRWOSER_PLATFORM2["ALIPAY_MINIPROGRAM"] = "ALIPAY_MINIPROGRAM";
6
6
  BRWOSER_PLATFORM2["H5"] = "H5";
7
7
  BRWOSER_PLATFORM2["NODE_JS"] = "NODE_JS";
8
+ BRWOSER_PLATFORM2["ENTERPRISE_WECHAT"] = "ENTERPRISE_WECHAT";
8
9
  return BRWOSER_PLATFORM2;
9
10
  })(BRWOSER_PLATFORM || {});
10
11
  var OS_PLATFORM = /* @__PURE__ */ ((OS_PLATFORM2) => {
@@ -39,7 +40,7 @@ const detectBrowserPlatform = () => {
39
40
  return "NODE_JS";
40
41
  const useragent = navigator.userAgent.toLowerCase();
41
42
  if (useragent.includes("micromessenger")) {
42
- return useragent.includes("miniprogram") ? "WECHAT_MINIPROGRAM" : "WECHAT";
43
+ return useragent.includes("miniprogram") ? "WECHAT_MINIPROGRAM" : useragent.includes("wxwork") ? "ENTERPRISE_WECHAT" : "WECHAT";
43
44
  }
44
45
  if (useragent.includes("alipay") || detectAlipayWallet()) {
45
46
  return useragent.includes("miniprogram") ? "ALIPAY_MINIPROGRAM" : "ALIPAY";
@@ -0,0 +1,34 @@
1
+ export type Milliseconds = number;
2
+ export interface TTLCache<K, V> {
3
+ get(key: K): V | undefined;
4
+ set(key: K, value: V): void;
5
+ delete(key: K): boolean;
6
+ clear(): void;
7
+ entries(): IterableIterator<[K, V]>;
8
+ }
9
+ /**
10
+ * 高性能 TTL Cache(固定 TTL,不支持动态变更)。
11
+ * - 仅提供最小接口:get/set/delete/clear/entries
12
+ * - 惰性过期:在访问时清理过期项,无额外定时器
13
+ */
14
+ export declare function createTTLCache<K, V>(ttlMs: Milliseconds): TTLCache<K, V>;
15
+ /**
16
+ * 异步函数的 TTL 记忆化工厂
17
+ *
18
+ * 命中策略(按顺序):
19
+ * 1. 精确命中:用 `computeKey(args)` 查缓存。
20
+ * 2. 近似命中:用 `selectFromCache(args, entries)` 在当前有效条目中挑选。
21
+ * 3. 未命中:执行原函数,结果写入缓存。
22
+ *
23
+ * 过期策略:惰性按 `ttlMs` 过期;`ttlMs <= 0` 表示不缓存;传 `Infinity` 视为永不过期。
24
+ *
25
+ * 参数:
26
+ * - `ttlMs`:缓存有效期(毫秒)。
27
+ * - `selectFromCache`:近似命中选择器,入参为本次 `args` 与有效缓存条目的迭代器,返回命中值或 `undefined`。
28
+ * - `computeKey`:精确命中的 key 生成函数,默认 `JSON.stringify`。
29
+ *
30
+ * 返回:`memoize(fn)`,将异步函数包装为带缓存的版本。
31
+ *
32
+ * 说明:不做并发合并;仅实现 TTL 驱逐(无容量上限);近似匹配会遍历有效条目。
33
+ */
34
+ export declare function createMemoizeWithTTL<A extends any[], R>(ttlMs: Milliseconds, selectFromCache: (args: A, cacheEntries: IterableIterator<[A, R]>) => R | undefined, computeKey?: (args: A) => string): (fn: (...args: A) => Promise<R>) => (...args: A) => Promise<R>;
@@ -0,0 +1,64 @@
1
+ function createTTLCache(ttlMs) {
2
+ const store = /* @__PURE__ */ new Map();
3
+ const get = (key) => {
4
+ const record = store.get(key);
5
+ if (!record)
6
+ return void 0;
7
+ const now = Date.now();
8
+ if (record.expireAt !== Infinity && record.expireAt <= now) {
9
+ store.delete(key);
10
+ return void 0;
11
+ }
12
+ return record.value;
13
+ };
14
+ const set = (key, value) => {
15
+ const now = Date.now();
16
+ const expireAt = Number.isFinite(ttlMs) ? now + ttlMs : Infinity;
17
+ if (Number.isFinite(ttlMs) && ttlMs <= 0) {
18
+ store.delete(key);
19
+ return;
20
+ }
21
+ store.set(key, { value, expireAt });
22
+ };
23
+ const del = (key) => store.delete(key);
24
+ const clear = () => {
25
+ store.clear();
26
+ };
27
+ function* entries() {
28
+ const now = Date.now();
29
+ for (const [key, record] of store) {
30
+ if (record.expireAt !== Infinity && record.expireAt <= now) {
31
+ store.delete(key);
32
+ continue;
33
+ }
34
+ yield [key, record.value];
35
+ }
36
+ }
37
+ return { get, set, delete: del, clear, entries };
38
+ }
39
+ function createMemoizeWithTTL(ttlMs, selectFromCache, computeKey = JSON.stringify) {
40
+ const cache = createTTLCache(ttlMs);
41
+ function* cacheEntries() {
42
+ for (const [, record] of cache.entries()) {
43
+ yield [record.args, record.value];
44
+ }
45
+ }
46
+ return function memoize(fn) {
47
+ return async function memoizedTTLFn(...args) {
48
+ const key = computeKey(args);
49
+ const direct = cache.get(key);
50
+ if (direct !== void 0)
51
+ return direct.value;
52
+ const hit = selectFromCache(args, cacheEntries());
53
+ if (hit !== void 0)
54
+ return hit;
55
+ const result = await fn(...args);
56
+ cache.set(key, { args, value: result });
57
+ return result;
58
+ };
59
+ };
60
+ }
61
+ export {
62
+ createMemoizeWithTTL,
63
+ createTTLCache
64
+ };
@@ -1,4 +1,4 @@
1
- import type { CoordinatePlace, CoordinatePoint, CoordinateRecommendZonePlaces, CoordinateTrackPoint, CoordinateType, CoordinateZone, ProxyServiceError, RecommendType } from "../types/interface";
1
+ import type { CoordinateExternalRoute, CoordinatePlace, CoordinatePoint, CoordinateRecommendZonePlaces, CoordinateTrackPoint, CoordinateType, CoordinateZone, ProxyServiceError, RecommendType } from "../types/interface";
2
2
  export declare const createTypeError: (typeName: string, value: unknown, detail?: string) => Error;
3
3
  export declare function isCoordinateType(type: unknown): type is CoordinateType;
4
4
  export declare function isRecommendType(type: unknown): type is RecommendType;
@@ -41,6 +41,12 @@ interface MaybeCoordinateTrackPoint {
41
41
  timestamp?: number | string;
42
42
  }
43
43
  export declare const toCoordinateTrackPoint: (value?: MaybeCoordinateTrackPoint) => CoordinateTrackPoint;
44
+ interface MaybeCoordinateExternalRoute {
45
+ path?: MaybeCoordinatePoint[];
46
+ duration?: number | string | null;
47
+ distance?: number | string | null;
48
+ }
49
+ export declare const toCoordinateExternalRoute: (maybeCoordinateExternalRoute?: MaybeCoordinateExternalRoute) => CoordinateExternalRoute;
44
50
  export declare function isProxyServiceError(error: unknown): error is ProxyServiceError;
45
51
  export declare function toGeolocationPositionError(error: unknown, prefix?: string): GeolocationPositionError;
46
52
  /**
@@ -107,6 +107,23 @@ const toCoordinateTrackPoint = (value) => {
107
107
  }
108
108
  return { lng, lat, type, angle, speed, timestamp };
109
109
  };
110
+ const toCoordinateExternalRoute = (maybeCoordinateExternalRoute) => {
111
+ var _a;
112
+ try {
113
+ if (!maybeCoordinateExternalRoute)
114
+ throw Error();
115
+ const duration = Number(maybeCoordinateExternalRoute.duration);
116
+ const distance = Number(maybeCoordinateExternalRoute.distance);
117
+ if (isNaN(duration) || isNaN(distance))
118
+ throw Error();
119
+ if (!Array.isArray(maybeCoordinateExternalRoute.path))
120
+ throw Error();
121
+ const path = (_a = maybeCoordinateExternalRoute.path) == null ? void 0 : _a.map(toCoordinatePointType);
122
+ return { path, duration, distance };
123
+ } catch (err) {
124
+ throw createTypeError("CoordinateExternalRoute", maybeCoordinateExternalRoute, err == null ? void 0 : err.message);
125
+ }
126
+ };
110
127
  function isProxyServiceError(error) {
111
128
  return !!error && typeof error === "object" && "msg" in error && "code" in error;
112
129
  }
@@ -172,6 +189,7 @@ export {
172
189
  isCoordinateType,
173
190
  isProxyServiceError,
174
191
  isRecommendType,
192
+ toCoordinateExternalRoute,
175
193
  toCoordinatePlaceType,
176
194
  toCoordinatePointType,
177
195
  toCoordinateRecommendZonePlacesType,
@@ -1,5 +1,5 @@
1
1
  import { createVNode } from "vue";
2
- import { B as BusinessRecomendPlaceMap } from "../chunks/BusinessRecomendPlaceMap.c71d0b97.js";
2
+ import { B as BusinessRecomendPlaceMap } from "../chunks/BusinessRecomendPlaceMap.71c439c6.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";
@@ -123,6 +123,7 @@ const DemoBusinessRecomendPlace = defineSetup("DemoBusinessRecomendPlace", funct
123
123
  name: "default place name",
124
124
  displayName: "default place displayName"
125
125
  },
126
+ "enableNearbyCars": true,
126
127
  "getAvailable": () => Promise.resolve(true),
127
128
  "getRecomendPlace": getRecomendPlace,
128
129
  "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<{}, {}, {
3
3
  from: CoordinatePlace;
4
4
  to: CoordinatePlace;
5
+ path: CoordinatePoint[];
5
6
  contentHeight: number;
6
7
  }, {}, {}, import("vue-demi").ComponentOptionsMixin, import("vue-demi").ComponentOptionsMixin, {}, string, import("vue-demi").PublicProps, Readonly<import("vue-demi").ExtractPropTypes<{}>>, {}, {}>;
@@ -2,6 +2,7 @@ import { createVNode, createTextVNode } 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 = /* @__PURE__ */ defineComponent({
6
7
  name: "DemoBusinessTaxiEnd",
7
8
  data() {
@@ -20,6 +21,7 @@ const DemoBusinessTaxiEnd = /* @__PURE__ */ defineComponent({
20
21
  displayName: "",
21
22
  type: "wgs84"
22
23
  },
24
+ path: [],
23
25
  contentHeight: 200
24
26
  };
25
27
  },
@@ -43,19 +45,24 @@ const DemoBusinessTaxiEnd = /* @__PURE__ */ 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 createVNode("div", {
54
60
  "class": layout
55
61
  }, [createVNode("div", null, [JSON.stringify(from), createTextVNode(" | "), JSON.stringify(to)]), createVNode(BusinessTaxiEndMap, {
56
62
  "class": adjustedDemo,
57
63
  "from": from,
58
- "to": to
64
+ "to": to,
65
+ "path": path
59
66
  }, null), createVNode("div", {
60
67
  "style": {
61
68
  height: `${contentHeight}px`
@@ -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<{}, {
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-demi").ComponentOptionsMixin, import("vue-demi").ComponentOptionsMixin, {}, string, import("vue-demi").PublicProps, Readonly<import("vue-demi").ExtractPropTypes<{}>>, {}, {}>;
@@ -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 = /* @__PURE__ */ 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 = /* @__PURE__ */ 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[];