@pisell/pisellos 3.0.57 → 3.0.58

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 (256) hide show
  1. package/dist/core/index.js +1 -2
  2. package/dist/effects/index.d.ts +3 -4
  3. package/dist/effects/index.js +6 -15
  4. package/dist/modules/AccountList/index.d.ts +1 -7
  5. package/dist/modules/AccountList/index.js +14 -81
  6. package/dist/modules/AccountList/types.d.ts +0 -28
  7. package/dist/modules/AccountList/types.js +0 -8
  8. package/dist/modules/Cart/index.js +1 -1
  9. package/dist/modules/Payment/index.d.ts +9 -273
  10. package/dist/modules/Payment/index.js +109 -2525
  11. package/dist/modules/Payment/types.d.ts +30 -382
  12. package/dist/modules/Payment/types.js +14 -116
  13. package/dist/modules/ProductList/index.d.ts +1 -12
  14. package/dist/modules/ProductList/index.js +3 -27
  15. package/dist/modules/Rules/index.js +14 -27
  16. package/dist/modules/Rules/types.d.ts +0 -1
  17. package/dist/modules/index.d.ts +0 -1
  18. package/dist/modules/index.js +0 -1
  19. package/dist/plugins/window.d.ts +0 -1
  20. package/dist/solution/BookingByStep/index.js +1 -9
  21. package/dist/solution/ShopDiscount/index.js +2 -4
  22. package/dist/solution/index.d.ts +0 -2
  23. package/dist/solution/index.js +1 -3
  24. package/dist/types/index.d.ts +1 -3
  25. package/lib/core/index.js +1 -1
  26. package/lib/effects/index.d.ts +3 -4
  27. package/lib/effects/index.js +1 -4
  28. package/lib/modules/AccountList/index.d.ts +1 -7
  29. package/lib/modules/AccountList/index.js +0 -27
  30. package/lib/modules/AccountList/types.d.ts +0 -28
  31. package/lib/modules/Cart/index.js +1 -1
  32. package/lib/modules/Payment/index.d.ts +9 -273
  33. package/lib/modules/Payment/index.js +50 -1285
  34. package/lib/modules/Payment/types.d.ts +30 -382
  35. package/lib/modules/Payment/types.js +6 -41
  36. package/lib/modules/ProductList/index.d.ts +1 -12
  37. package/lib/modules/ProductList/index.js +2 -29
  38. package/lib/modules/Rules/index.js +12 -20
  39. package/lib/modules/Rules/types.d.ts +0 -1
  40. package/lib/modules/index.d.ts +0 -1
  41. package/lib/modules/index.js +0 -2
  42. package/lib/plugins/window.d.ts +0 -1
  43. package/lib/solution/BookingByStep/index.js +2 -1
  44. package/lib/solution/ShopDiscount/index.js +1 -2
  45. package/lib/solution/index.d.ts +0 -2
  46. package/lib/solution/index.js +1 -5
  47. package/lib/types/index.d.ts +1 -3
  48. package/package.json +2 -4
  49. package/dist/modules/Customer/constants.d.ts +0 -7
  50. package/dist/modules/Customer/constants.js +0 -12
  51. package/dist/modules/Customer/index.d.ts +0 -122
  52. package/dist/modules/Customer/index.js +0 -697
  53. package/dist/modules/Customer/types.d.ts +0 -146
  54. package/dist/modules/Customer/types.js +0 -41
  55. package/dist/modules/Payment/cash.d.ts +0 -11
  56. package/dist/modules/Payment/cash.js +0 -78
  57. package/dist/modules/Payment/eftpos.d.ts +0 -11
  58. package/dist/modules/Payment/eftpos.js +0 -80
  59. package/dist/modules/Payment/wallet.d.ts +0 -11
  60. package/dist/modules/Payment/wallet.js +0 -78
  61. package/dist/modules/Payment/walletpass.d.ts +0 -0
  62. package/dist/modules/Payment/walletpass.js +0 -0
  63. package/dist/plugins/app-types/app/app.d.ts +0 -83
  64. package/dist/plugins/app-types/app/const.d.ts +0 -4
  65. package/dist/plugins/app-types/app/index.d.ts +0 -14
  66. package/dist/plugins/app-types/applicationManager/application.d.ts +0 -50
  67. package/dist/plugins/app-types/applicationManager/index.d.ts +0 -13
  68. package/dist/plugins/app-types/config.d.ts +0 -3
  69. package/dist/plugins/app-types/cookie/index.d.ts +0 -13
  70. package/dist/plugins/app-types/data/index.d.ts +0 -8
  71. package/dist/plugins/app-types/history/config.d.ts +0 -24
  72. package/dist/plugins/app-types/history/index.d.ts +0 -20
  73. package/dist/plugins/app-types/history/type.d.ts +0 -2
  74. package/dist/plugins/app-types/hooks/index.d.ts +0 -12
  75. package/dist/plugins/app-types/hooks/useDelayedValue/index.d.ts +0 -2
  76. package/dist/plugins/app-types/hooks/useDispatch/index.d.ts +0 -2
  77. package/dist/plugins/app-types/hooks/useLowCode/index.d.ts +0 -13
  78. package/dist/plugins/app-types/hooks/useStore/index.d.ts +0 -6
  79. package/dist/plugins/app-types/index.d.ts +0 -6
  80. package/dist/plugins/app-types/indexDB/index.d.ts +0 -178
  81. package/dist/plugins/app-types/locales/en.d.ts +0 -3
  82. package/dist/plugins/app-types/locales/index.d.ts +0 -37
  83. package/dist/plugins/app-types/locales/original.d.ts +0 -3
  84. package/dist/plugins/app-types/locales/type.d.ts +0 -19
  85. package/dist/plugins/app-types/locales/zh-CN.d.ts +0 -3
  86. package/dist/plugins/app-types/locales/zh-HK.d.ts +0 -3
  87. package/dist/plugins/app-types/logger/feishu.d.ts +0 -11
  88. package/dist/plugins/app-types/logger/index.d.ts +0 -122
  89. package/dist/plugins/app-types/menuManager/hooks.d.ts +0 -17
  90. package/dist/plugins/app-types/menuManager/index.d.ts +0 -28
  91. package/dist/plugins/app-types/models/global.d.ts +0 -32
  92. package/dist/plugins/app-types/models/index.d.ts +0 -45
  93. package/dist/plugins/app-types/models/type.d.ts +0 -2
  94. package/dist/plugins/app-types/package.json +0 -15
  95. package/dist/plugins/app-types/plugin/index.d.ts +0 -0
  96. package/dist/plugins/app-types/pubsub/example.d.ts +0 -5
  97. package/dist/plugins/app-types/pubsub/index.d.ts +0 -63
  98. package/dist/plugins/app-types/request/cache.d.ts +0 -46
  99. package/dist/plugins/app-types/request/cancelToken.d.ts +0 -38
  100. package/dist/plugins/app-types/request/config.d.ts +0 -3
  101. package/dist/plugins/app-types/request/constants.d.ts +0 -2
  102. package/dist/plugins/app-types/request/index.d.ts +0 -24
  103. package/dist/plugins/app-types/request/pisell2Request.d.ts +0 -6
  104. package/dist/plugins/app-types/request/type.d.ts +0 -41
  105. package/dist/plugins/app-types/request/utils.d.ts +0 -46
  106. package/dist/plugins/app-types/routes/config.d.ts +0 -7
  107. package/dist/plugins/app-types/routes/index.d.ts +0 -28
  108. package/dist/plugins/app-types/socket/components/SocketMonitorPage.d.ts +0 -6
  109. package/dist/plugins/app-types/socket/components/index.d.ts +0 -2
  110. package/dist/plugins/app-types/socket/constants.d.ts +0 -33
  111. package/dist/plugins/app-types/socket/events.d.ts +0 -31
  112. package/dist/plugins/app-types/socket/heartbeat.d.ts +0 -66
  113. package/dist/plugins/app-types/socket/index.d.ts +0 -61
  114. package/dist/plugins/app-types/socket/monitor.d.ts +0 -169
  115. package/dist/plugins/app-types/socket/reconnect.d.ts +0 -61
  116. package/dist/plugins/app-types/socket/socket.d.ts +0 -129
  117. package/dist/plugins/app-types/socket/types.d.ts +0 -85
  118. package/dist/plugins/app-types/storage/index.d.ts +0 -17
  119. package/dist/plugins/app-types/tasks/index.d.ts +0 -77
  120. package/dist/plugins/app-types/tasks/type.d.ts +0 -62
  121. package/dist/plugins/app-types/tasks/useTasks.d.ts +0 -5
  122. package/dist/plugins/app-types/type.d.ts +0 -2
  123. package/dist/plugins/app-types/variables/VariablesProvider.d.ts +0 -7
  124. package/dist/plugins/app-types/variables/config.d.ts +0 -3
  125. package/dist/plugins/app-types/variables/index.d.ts +0 -6
  126. package/dist/plugins/app-types/variables/type.d.ts +0 -2
  127. package/dist/plugins/app-types/website/index.d.ts +0 -6
  128. package/dist/plugins/app.d.ts +0 -8
  129. package/dist/plugins/app.js +0 -1
  130. package/dist/solution/BookingTicket/index.d.ts +0 -172
  131. package/dist/solution/BookingTicket/index.js +0 -665
  132. package/dist/solution/BookingTicket/types.d.ts +0 -68
  133. package/dist/solution/BookingTicket/types.js +0 -43
  134. package/dist/solution/BookingTicket/utils/scan/cloudSearch.d.ts +0 -22
  135. package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +0 -159
  136. package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +0 -16
  137. package/dist/solution/BookingTicket/utils/scan/handleScan.js +0 -174
  138. package/dist/solution/BookingTicket/utils/scan/index.d.ts +0 -81
  139. package/dist/solution/BookingTicket/utils/scan/index.js +0 -285
  140. package/dist/solution/BookingTicket/utils/scan/scanCache.d.ts +0 -78
  141. package/dist/solution/BookingTicket/utils/scan/scanCache.js +0 -305
  142. package/dist/solution/Checkout/appointmentDemo.json +0 -1
  143. package/dist/solution/Checkout/index.d.ts +0 -181
  144. package/dist/solution/Checkout/index.js +0 -1596
  145. package/dist/solution/Checkout/types.d.ts +0 -550
  146. package/dist/solution/Checkout/types.js +0 -132
  147. package/dist/solution/Checkout/utils/index.d.ts +0 -73
  148. package/dist/solution/Checkout/utils/index.js +0 -371
  149. package/dist/utils/task.d.ts +0 -40
  150. package/dist/utils/task.js +0 -171
  151. package/dist/utils/watch.d.ts +0 -102
  152. package/dist/utils/watch.js +0 -294
  153. package/lib/modules/Customer/constants.d.ts +0 -7
  154. package/lib/modules/Customer/constants.js +0 -39
  155. package/lib/modules/Customer/index.d.ts +0 -122
  156. package/lib/modules/Customer/index.js +0 -440
  157. package/lib/modules/Customer/types.d.ts +0 -146
  158. package/lib/modules/Customer/types.js +0 -37
  159. package/lib/modules/Payment/cash.d.ts +0 -11
  160. package/lib/modules/Payment/cash.js +0 -51
  161. package/lib/modules/Payment/eftpos.d.ts +0 -11
  162. package/lib/modules/Payment/eftpos.js +0 -51
  163. package/lib/modules/Payment/wallet.d.ts +0 -11
  164. package/lib/modules/Payment/wallet.js +0 -51
  165. package/lib/modules/Payment/walletpass.d.ts +0 -0
  166. package/lib/modules/Payment/walletpass.js +0 -0
  167. package/lib/plugins/app-types/app/app.d.ts +0 -83
  168. package/lib/plugins/app-types/app/const.d.ts +0 -4
  169. package/lib/plugins/app-types/app/index.d.ts +0 -14
  170. package/lib/plugins/app-types/applicationManager/application.d.ts +0 -50
  171. package/lib/plugins/app-types/applicationManager/index.d.ts +0 -13
  172. package/lib/plugins/app-types/config.d.ts +0 -3
  173. package/lib/plugins/app-types/cookie/index.d.ts +0 -13
  174. package/lib/plugins/app-types/data/index.d.ts +0 -8
  175. package/lib/plugins/app-types/history/config.d.ts +0 -24
  176. package/lib/plugins/app-types/history/index.d.ts +0 -20
  177. package/lib/plugins/app-types/history/type.d.ts +0 -2
  178. package/lib/plugins/app-types/hooks/index.d.ts +0 -12
  179. package/lib/plugins/app-types/hooks/useDelayedValue/index.d.ts +0 -2
  180. package/lib/plugins/app-types/hooks/useDispatch/index.d.ts +0 -2
  181. package/lib/plugins/app-types/hooks/useLowCode/index.d.ts +0 -13
  182. package/lib/plugins/app-types/hooks/useStore/index.d.ts +0 -6
  183. package/lib/plugins/app-types/index.d.ts +0 -6
  184. package/lib/plugins/app-types/indexDB/index.d.ts +0 -178
  185. package/lib/plugins/app-types/locales/en.d.ts +0 -3
  186. package/lib/plugins/app-types/locales/index.d.ts +0 -37
  187. package/lib/plugins/app-types/locales/original.d.ts +0 -3
  188. package/lib/plugins/app-types/locales/type.d.ts +0 -19
  189. package/lib/plugins/app-types/locales/zh-CN.d.ts +0 -3
  190. package/lib/plugins/app-types/locales/zh-HK.d.ts +0 -3
  191. package/lib/plugins/app-types/logger/feishu.d.ts +0 -11
  192. package/lib/plugins/app-types/logger/index.d.ts +0 -122
  193. package/lib/plugins/app-types/menuManager/hooks.d.ts +0 -17
  194. package/lib/plugins/app-types/menuManager/index.d.ts +0 -28
  195. package/lib/plugins/app-types/models/global.d.ts +0 -32
  196. package/lib/plugins/app-types/models/index.d.ts +0 -45
  197. package/lib/plugins/app-types/models/type.d.ts +0 -2
  198. package/lib/plugins/app-types/package.json +0 -15
  199. package/lib/plugins/app-types/plugin/index.d.ts +0 -0
  200. package/lib/plugins/app-types/pubsub/example.d.ts +0 -5
  201. package/lib/plugins/app-types/pubsub/index.d.ts +0 -63
  202. package/lib/plugins/app-types/request/cache.d.ts +0 -46
  203. package/lib/plugins/app-types/request/cancelToken.d.ts +0 -38
  204. package/lib/plugins/app-types/request/config.d.ts +0 -3
  205. package/lib/plugins/app-types/request/constants.d.ts +0 -2
  206. package/lib/plugins/app-types/request/index.d.ts +0 -24
  207. package/lib/plugins/app-types/request/pisell2Request.d.ts +0 -6
  208. package/lib/plugins/app-types/request/type.d.ts +0 -41
  209. package/lib/plugins/app-types/request/utils.d.ts +0 -46
  210. package/lib/plugins/app-types/routes/config.d.ts +0 -7
  211. package/lib/plugins/app-types/routes/index.d.ts +0 -28
  212. package/lib/plugins/app-types/socket/components/SocketMonitorPage.d.ts +0 -6
  213. package/lib/plugins/app-types/socket/components/index.d.ts +0 -2
  214. package/lib/plugins/app-types/socket/constants.d.ts +0 -33
  215. package/lib/plugins/app-types/socket/events.d.ts +0 -31
  216. package/lib/plugins/app-types/socket/heartbeat.d.ts +0 -66
  217. package/lib/plugins/app-types/socket/index.d.ts +0 -61
  218. package/lib/plugins/app-types/socket/monitor.d.ts +0 -169
  219. package/lib/plugins/app-types/socket/reconnect.d.ts +0 -61
  220. package/lib/plugins/app-types/socket/socket.d.ts +0 -129
  221. package/lib/plugins/app-types/socket/types.d.ts +0 -85
  222. package/lib/plugins/app-types/storage/index.d.ts +0 -17
  223. package/lib/plugins/app-types/tasks/index.d.ts +0 -77
  224. package/lib/plugins/app-types/tasks/type.d.ts +0 -62
  225. package/lib/plugins/app-types/tasks/useTasks.d.ts +0 -5
  226. package/lib/plugins/app-types/type.d.ts +0 -2
  227. package/lib/plugins/app-types/variables/VariablesProvider.d.ts +0 -7
  228. package/lib/plugins/app-types/variables/config.d.ts +0 -3
  229. package/lib/plugins/app-types/variables/index.d.ts +0 -6
  230. package/lib/plugins/app-types/variables/type.d.ts +0 -2
  231. package/lib/plugins/app-types/website/index.d.ts +0 -6
  232. package/lib/plugins/app.d.ts +0 -8
  233. package/lib/plugins/app.js +0 -17
  234. package/lib/solution/BookingTicket/index.d.ts +0 -172
  235. package/lib/solution/BookingTicket/index.js +0 -399
  236. package/lib/solution/BookingTicket/types.d.ts +0 -68
  237. package/lib/solution/BookingTicket/types.js +0 -72
  238. package/lib/solution/BookingTicket/utils/scan/cloudSearch.d.ts +0 -22
  239. package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +0 -117
  240. package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +0 -16
  241. package/lib/solution/BookingTicket/utils/scan/handleScan.js +0 -125
  242. package/lib/solution/BookingTicket/utils/scan/index.d.ts +0 -81
  243. package/lib/solution/BookingTicket/utils/scan/index.js +0 -210
  244. package/lib/solution/BookingTicket/utils/scan/scanCache.d.ts +0 -78
  245. package/lib/solution/BookingTicket/utils/scan/scanCache.js +0 -231
  246. package/lib/solution/Checkout/appointmentDemo.json +0 -1
  247. package/lib/solution/Checkout/index.d.ts +0 -181
  248. package/lib/solution/Checkout/index.js +0 -864
  249. package/lib/solution/Checkout/types.d.ts +0 -550
  250. package/lib/solution/Checkout/types.js +0 -75
  251. package/lib/solution/Checkout/utils/index.d.ts +0 -73
  252. package/lib/solution/Checkout/utils/index.js +0 -266
  253. package/lib/utils/task.d.ts +0 -40
  254. package/lib/utils/task.js +0 -109
  255. package/lib/utils/watch.d.ts +0 -102
  256. package/lib/utils/watch.js +0 -217
@@ -1,231 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
- var __getOwnPropNames = Object.getOwnPropertyNames;
4
- var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __export = (target, all) => {
6
- for (var name in all)
7
- __defProp(target, name, { get: all[name], enumerable: true });
8
- };
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") {
11
- for (let key of __getOwnPropNames(from))
12
- if (!__hasOwnProp.call(to, key) && key !== except)
13
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
- }
15
- return to;
16
- };
17
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
-
19
- // src/solution/BookingTicket/utils/scan/scanCache.ts
20
- var scanCache_exports = {};
21
- __export(scanCache_exports, {
22
- default: () => scanCache_default
23
- });
24
- module.exports = __toCommonJS(scanCache_exports);
25
- var compressData = (data) => {
26
- try {
27
- if (data === void 0) {
28
- return "undefined";
29
- }
30
- return JSON.stringify(data);
31
- } catch (error) {
32
- console.warn("数据压缩失败:", error);
33
- return JSON.stringify(data);
34
- }
35
- };
36
- var decompressData = (compressedData) => {
37
- try {
38
- if (compressedData === "undefined") {
39
- return void 0;
40
- }
41
- return JSON.parse(compressedData);
42
- } catch (error) {
43
- console.warn("数据解压缩失败:", error);
44
- return null;
45
- }
46
- };
47
- var LRUCache = class {
48
- constructor(maxSize = 100) {
49
- this.head = null;
50
- // 最久未使用的节点
51
- this.tail = null;
52
- // 最近使用的节点
53
- this.keyMap = /* @__PURE__ */ new Map();
54
- this.maxSize = maxSize;
55
- }
56
- /**
57
- * 将节点移动到链表尾部(最近使用)
58
- * @param node 要移动的节点
59
- */
60
- moveToTail(node) {
61
- if (this.tail === node)
62
- return;
63
- if (node.prev) {
64
- node.prev.next = node.next;
65
- }
66
- if (node.next) {
67
- node.next.prev = node.prev;
68
- }
69
- if (this.head === node) {
70
- this.head = node.next;
71
- }
72
- if (this.tail) {
73
- this.tail.next = node;
74
- }
75
- node.prev = this.tail;
76
- node.next = null;
77
- this.tail = node;
78
- if (!this.head) {
79
- this.head = node;
80
- }
81
- }
82
- /**
83
- * 添加新节点到链表尾部
84
- * @param key 缓存键
85
- * @param compressedData 压缩后的数据
86
- * @param timestamp 时间戳
87
- */
88
- addToTail(key, compressedData, timestamp) {
89
- const oldTail = this.tail;
90
- const node = {
91
- key,
92
- compressedData,
93
- timestamp,
94
- prev: oldTail,
95
- // 使用保存的引用,避免循环引用
96
- next: null
97
- };
98
- this.keyMap.set(key, node);
99
- if (oldTail) {
100
- oldTail.next = node;
101
- }
102
- this.tail = node;
103
- if (!this.head) {
104
- this.head = node;
105
- }
106
- return node;
107
- }
108
- /**
109
- * 从链表中移除节点
110
- * @param node 要移除的节点
111
- */
112
- removeNode(node) {
113
- if (node.prev) {
114
- node.prev.next = node.next;
115
- }
116
- if (node.next) {
117
- node.next.prev = node.prev;
118
- }
119
- if (this.head === node) {
120
- this.head = node.next;
121
- }
122
- if (this.tail === node) {
123
- this.tail = node.prev;
124
- }
125
- this.keyMap.delete(node.key);
126
- }
127
- /**
128
- * 移除最久未使用的节点(链表头部)
129
- */
130
- removeOldest() {
131
- if (this.head) {
132
- this.removeNode(this.head);
133
- }
134
- }
135
- /**
136
- * 设置缓存
137
- * @param key 缓存键
138
- * @param data 缓存数据
139
- */
140
- set(key, data) {
141
- const compressedData = compressData(data);
142
- const timestamp = Date.now();
143
- const existingNode = this.keyMap.get(key);
144
- if (existingNode) {
145
- existingNode.compressedData = compressedData;
146
- existingNode.timestamp = timestamp;
147
- this.moveToTail(existingNode);
148
- } else {
149
- if (this.keyMap.size >= this.maxSize) {
150
- this.removeOldest();
151
- }
152
- this.addToTail(key, compressedData, timestamp);
153
- }
154
- }
155
- /**
156
- * 获取缓存
157
- * @param key 缓存键
158
- * @returns 缓存数据或undefined
159
- */
160
- get(key) {
161
- const node = this.keyMap.get(key);
162
- if (node) {
163
- const decompressedData = decompressData(node.compressedData);
164
- if (decompressedData !== null) {
165
- node.timestamp = Date.now();
166
- this.moveToTail(node);
167
- return decompressedData;
168
- } else {
169
- this.removeNode(node);
170
- return void 0;
171
- }
172
- }
173
- return void 0;
174
- }
175
- /**
176
- * 检查是否存在缓存
177
- * @param key 缓存键
178
- * @returns 是否存在
179
- */
180
- has(key) {
181
- return this.keyMap.has(key);
182
- }
183
- /**
184
- * 清除所有缓存
185
- */
186
- clear() {
187
- let current = this.head;
188
- while (current) {
189
- const next = current.next;
190
- current.prev = null;
191
- current.next = null;
192
- current = next;
193
- }
194
- this.keyMap.clear();
195
- this.head = null;
196
- this.tail = null;
197
- }
198
- /**
199
- * 获取缓存大小
200
- * @returns 当前缓存数量
201
- */
202
- size() {
203
- return this.keyMap.size;
204
- }
205
- /**
206
- * 获取缓存统计信息
207
- * @returns 缓存统计信息
208
- */
209
- getStats() {
210
- return {
211
- size: this.keyMap.size,
212
- maxSize: this.maxSize,
213
- usage: Math.round(this.keyMap.size / this.maxSize * 100)
214
- };
215
- }
216
- /**
217
- * 删除指定的缓存项
218
- * @param key 要删除的缓存键
219
- * @returns 是否删除成功
220
- */
221
- delete(key) {
222
- const node = this.keyMap.get(key);
223
- if (node) {
224
- this.removeNode(node);
225
- return true;
226
- }
227
- return false;
228
- }
229
- };
230
- var scanCache = new LRUCache();
231
- var scanCache_default = scanCache;
@@ -1 +0,0 @@
1
- {"type":"appointment_booking","platform":"PC","sales_channel":"my_pisel","order_sales_channel":"online_store","bookings":[{"id":0,"number":1,"registration_type":"all","relation_products":[],"is_all":false,"product":{"num":1,"product_id":61170,"product_variant_id":0,"product_bundle":[],"product_option_item":[],"discount_list":[{"amount":100,"type":"good_pass","discount":{"resource_id":64523,"title":{"auto":"玄-商品券","original":"玄-商品券","en":null,"zh-CN":null,"zh-HK":null},"original_amount":100,"product_id":61170,"percent":"1.00"}}]},"sub_type":"minutes","duration":480,"like_status":"common","resources":[{"relation_type":"form","like_status":"common","form_id":35,"relation_id":40357,"capacity":1,"metadata":{"combined_resource":{"status":1,"resource_ids":[40262,40263]},"form_name":"桌台","resource_name":"组合资源测试table-0422-01"},"children":[{"relation_type":"form","like_status":"common","id":40262,"main_field":"A01(组合资源-小桌-4 人)","resourceType":"single","form_id":35,"relation_id":40262,"capacity":1,"metadata":{"combined_resource":null,"form_name":"桌台","resource_name":"A01(组合资源-小桌-4 人)"}},{"relation_type":"form","like_status":"common","id":40263,"main_field":"A02(组合资源-小桌-4 人)","resourceType":"single","form_id":35,"relation_id":40263,"capacity":0,"metadata":{"combined_resource":null,"form_name":"桌台","resource_name":"A02(组合资源-小桌-4 人)"}}]},{"relation_type":"form","like_status":"common","form_id":214,"relation_id":38350,"capacity":1,"metadata":{"combined_resource":null,"form_name":"校区2","resource_name":"West Campus"}}],"schedule_id":0,"start_date":"2025-08-22","start_time":"09:00","select_date":"2025-08-22","end_time":"17:00","end_date":"2025-08-22","metadata":{"account":{"id":13433,"username":"a a"},"capacity":[{"id":0,"value":1,"name":""}]},"holder":null,"relation_forms":[]}],"shop_note":"","schedule_date":"2025-08-22 09:00:00","is_deposit":0,"relation_products":[],"relation_forms":[]}
@@ -1,181 +0,0 @@
1
- import { Module, PisellCore, ModuleOptions } from '../../types';
2
- import { BaseModule } from '../../modules/BaseModule';
3
- import { OrderModule } from '../../modules/Order';
4
- import { PaymentModule } from '../../modules/Payment';
5
- import { CheckoutModuleAPI, CheckoutStep, CheckoutInitParams, CreateLocalOrderParams, PlaceOrderParams, CreateOrderParams, ProcessPaymentParams, CheckoutStatusInfo, CheckoutSummary, CurrentOrderInfo } from './types';
6
- import { PaymentOrder, PaymentMethod } from '../../modules/Payment/types';
7
- export * from './types';
8
- /**
9
- * 结账解决方案实现
10
- *
11
- * 整合订单处理和支付功能,提供完整的结账流程管理。
12
- * 支持多种支付方式,提供实时状态跟踪和错误处理。
13
- */
14
- export declare class CheckoutImpl extends BaseModule implements Module, CheckoutModuleAPI {
15
- protected defaultName: string;
16
- protected defaultVersion: string;
17
- isSolution: boolean;
18
- private request;
19
- private store;
20
- private otherParams;
21
- constructor(name?: string, version?: string);
22
- initialize(core: PisellCore, options: ModuleOptions): Promise<void>;
23
- /**
24
- * 初始化子模块
25
- */
26
- private initializeSubModules;
27
- /**
28
- * 设置支付模块事件监听
29
- */
30
- private setupPaymentEventListeners;
31
- /**
32
- * 初始化结账流程
33
- */
34
- initializeCheckoutAsync(params: CheckoutInitParams): Promise<void>;
35
- /**
36
- * 创建本地订单 (前端模拟下单流程)
37
- *
38
- * 此方法用于在前端模拟整个下单流程,创建一个本地的虚拟订单。
39
- * 用户在购物车点击下单时,会把购物车参数传递给此方法,
40
- * 方法会记录参数并创建本地虚拟订单,然后用 Payment 模块管理支付流程。
41
- */
42
- createLocalOrderAsync(params: CreateLocalOrderParams): Promise<PaymentOrder>;
43
- /**
44
- * 手动下单 (根据虚拟订单生成实际订单)
45
- *
46
- * 使用当前存储的本地订单数据调用 Order 模块创建真实订单
47
- */
48
- placeOrderAsync(params?: PlaceOrderParams): Promise<{
49
- success: boolean;
50
- orderId?: string;
51
- error?: string;
52
- }>;
53
- /**
54
- * 创建订单
55
- */
56
- createOrderAsync(params: CreateOrderParams): Promise<PaymentOrder>;
57
- /**
58
- * 处理支付
59
- */
60
- processPaymentAsync(params: ProcessPaymentParams): Promise<void>;
61
- /**
62
- * 完成结账
63
- */
64
- completeCheckoutAsync(): Promise<{
65
- success: boolean;
66
- orderId?: string;
67
- }>;
68
- /**
69
- * 取消结账
70
- */
71
- cancelCheckoutAsync(): Promise<void>;
72
- /**
73
- * 获取结账状态
74
- */
75
- getCheckoutStatus(): CheckoutStatusInfo;
76
- /**
77
- * 获取结账摘要
78
- */
79
- getCheckoutSummaryAsync(): Promise<CheckoutSummary>;
80
- /**
81
- * 获取可用支付方式
82
- */
83
- getAvailablePaymentMethodsAsync(): Promise<PaymentMethod[]>;
84
- /**
85
- * 刷新支付方式缓存
86
- *
87
- * 强制重新从服务器获取支付方式列表,更新本地缓存
88
- */
89
- refreshPaymentMethodsAsync(): Promise<PaymentMethod[]>;
90
- /**
91
- * 获取当前订单基础信息
92
- *
93
- * 返回当前订单的基础信息,包括订单状态、金额、支付状态等
94
- */
95
- getCurrentOrderInfo(): CurrentOrderInfo | null;
96
- /**
97
- * 验证结账前置条件
98
- */
99
- validateCheckoutAsync(): Promise<{
100
- valid: boolean;
101
- errors: string[];
102
- }>;
103
- /**
104
- * 重试失败的操作
105
- */
106
- retryFailedOperationAsync(): Promise<void>;
107
- /**
108
- * 设置当前步骤
109
- */
110
- setCurrentStep(step: CheckoutStep): void;
111
- /**
112
- * 获取订单模块
113
- */
114
- getOrderModule(): OrderModule;
115
- /**
116
- * 获取支付模块
117
- */
118
- getPaymentModule(): PaymentModule;
119
- /**
120
- * 替换本地订单ID为真实订单ID
121
- *
122
- * 当后端订单创建完成后,调用此方法将本地虚拟订单ID替换为真实订单ID
123
- *
124
- * @param newOrderId 后端返回的真实订单ID
125
- * @returns 更新后的订单对象,如果当前没有订单则返回null
126
- */
127
- replaceLocalOrderIdAsync(newOrderId: string): Promise<PaymentOrder | null>;
128
- /**
129
- * 设置状态
130
- */
131
- private setStatus;
132
- /**
133
- * 设置步骤
134
- */
135
- private setStep;
136
- /**
137
- * 处理错误
138
- */
139
- private handleError;
140
- /**
141
- * 处理支付成功
142
- */
143
- private handlePaymentSuccess;
144
- /**
145
- * 处理支付错误
146
- */
147
- private handlePaymentError;
148
- /**
149
- * 验证结账参数
150
- */
151
- private validateCheckoutParams;
152
- /**
153
- * 验证本地订单数据
154
- */
155
- private validateLocalOrderData;
156
- /**
157
- * 生成本地订单ID
158
- */
159
- private generateLocalOrderId;
160
- /**
161
- * 从购物车小计数据中提取金额信息
162
- */
163
- private extractAmountFromCartSummary;
164
- /**
165
- * 预加载支付方式(在初始化时调用)
166
- */
167
- private preloadPaymentMethods;
168
- /**
169
- * 计算总金额
170
- */
171
- private calculateTotalAmount;
172
- /**
173
- * 计算已支付金额
174
- */
175
- private calculatePaidAmount;
176
- /**
177
- * 获取状态消息
178
- */
179
- private getStatusMessage;
180
- destroy(): Promise<void>;
181
- }