@pisell/pisellos 3.0.76 → 3.0.77

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 (308) hide show
  1. package/dist/core/index.js +1 -2
  2. package/dist/effects/index.d.ts +3 -5
  3. package/dist/effects/index.js +8 -40
  4. package/dist/modules/Account/index.js +3 -2
  5. package/dist/modules/AccountList/index.d.ts +1 -7
  6. package/dist/modules/AccountList/index.js +14 -81
  7. package/dist/modules/AccountList/types.d.ts +0 -28
  8. package/dist/modules/AccountList/types.js +0 -8
  9. package/dist/modules/BaseModule.d.ts +0 -3
  10. package/dist/modules/BaseModule.js +0 -15
  11. package/dist/modules/Cart/index.d.ts +0 -1
  12. package/dist/modules/Cart/index.js +1 -2
  13. package/dist/modules/Discount/index.d.ts +0 -1
  14. package/dist/modules/Discount/index.js +1 -1
  15. package/dist/modules/Guests/index.js +9 -9
  16. package/dist/modules/Order/index.d.ts +1 -25
  17. package/dist/modules/Order/index.js +3 -224
  18. package/dist/modules/Order/types.d.ts +0 -45
  19. package/dist/modules/Order/types.js +0 -8
  20. package/dist/modules/Order/utils.js +1 -1
  21. package/dist/modules/Payment/index.d.ts +9 -184
  22. package/dist/modules/Payment/index.js +109 -2084
  23. package/dist/modules/Payment/types.d.ts +30 -772
  24. package/dist/modules/Payment/types.js +12 -236
  25. package/dist/modules/ProductList/index.d.ts +1 -12
  26. package/dist/modules/ProductList/index.js +15 -37
  27. package/dist/modules/Resource/index.js +1 -1
  28. package/dist/modules/Rules/index.d.ts +1 -2
  29. package/dist/modules/Rules/index.js +26 -66
  30. package/dist/modules/Rules/types.d.ts +0 -1
  31. package/dist/modules/Schedule/index.d.ts +0 -9
  32. package/dist/modules/Schedule/index.js +0 -77
  33. package/dist/modules/index.d.ts +0 -1
  34. package/dist/modules/index.js +0 -1
  35. package/dist/plugins/window.d.ts +0 -1
  36. package/dist/solution/BookingByStep/index.js +13 -43
  37. package/dist/solution/BookingByStep/utils/capacity.js +1 -1
  38. package/dist/solution/BookingByStep/utils/products.d.ts +0 -6
  39. package/dist/solution/BookingByStep/utils/products.js +0 -10
  40. package/dist/solution/BuyTickets/index.js +8 -7
  41. package/dist/solution/ShopDiscount/index.d.ts +10 -10
  42. package/dist/solution/ShopDiscount/index.js +57 -107
  43. package/dist/solution/ShopDiscount/types.d.ts +0 -8
  44. package/dist/solution/ShopDiscount/utils.js +1 -0
  45. package/dist/solution/index.d.ts +0 -2
  46. package/dist/solution/index.js +1 -3
  47. package/dist/types/index.d.ts +1 -4
  48. package/lib/core/index.js +1 -1
  49. package/lib/effects/index.d.ts +3 -5
  50. package/lib/effects/index.js +1 -17
  51. package/lib/modules/Account/index.js +3 -2
  52. package/lib/modules/AccountList/index.d.ts +1 -7
  53. package/lib/modules/AccountList/index.js +0 -27
  54. package/lib/modules/AccountList/types.d.ts +0 -28
  55. package/lib/modules/BaseModule.d.ts +0 -3
  56. package/lib/modules/BaseModule.js +0 -9
  57. package/lib/modules/Cart/index.d.ts +0 -1
  58. package/lib/modules/Cart/index.js +2 -5
  59. package/lib/modules/Discount/index.d.ts +0 -1
  60. package/lib/modules/Discount/index.js +1 -1
  61. package/lib/modules/Guests/index.js +9 -9
  62. package/lib/modules/Order/index.d.ts +1 -25
  63. package/lib/modules/Order/index.js +1 -186
  64. package/lib/modules/Order/types.d.ts +0 -45
  65. package/lib/modules/Order/utils.js +1 -1
  66. package/lib/modules/Payment/index.d.ts +9 -184
  67. package/lib/modules/Payment/index.js +51 -1084
  68. package/lib/modules/Payment/types.d.ts +30 -772
  69. package/lib/modules/Payment/types.js +6 -79
  70. package/lib/modules/ProductList/index.d.ts +1 -12
  71. package/lib/modules/ProductList/index.js +12 -31
  72. package/lib/modules/Resource/index.js +1 -1
  73. package/lib/modules/Rules/index.d.ts +1 -2
  74. package/lib/modules/Rules/index.js +24 -41
  75. package/lib/modules/Rules/types.d.ts +0 -1
  76. package/lib/modules/Schedule/index.d.ts +0 -9
  77. package/lib/modules/Schedule/index.js +0 -60
  78. package/lib/modules/index.d.ts +0 -1
  79. package/lib/modules/index.js +0 -2
  80. package/lib/plugins/window.d.ts +0 -1
  81. package/lib/solution/BookingByStep/index.js +6 -18
  82. package/lib/solution/BookingByStep/utils/capacity.js +1 -1
  83. package/lib/solution/BookingByStep/utils/products.d.ts +0 -6
  84. package/lib/solution/BookingByStep/utils/products.js +2 -8
  85. package/lib/solution/BuyTickets/index.js +8 -7
  86. package/lib/solution/ShopDiscount/index.d.ts +10 -10
  87. package/lib/solution/ShopDiscount/index.js +21 -47
  88. package/lib/solution/ShopDiscount/types.d.ts +0 -8
  89. package/lib/solution/index.d.ts +0 -2
  90. package/lib/solution/index.js +1 -5
  91. package/lib/types/index.d.ts +1 -4
  92. package/package.json +1 -3
  93. package/dist/modules/Customer/constants.d.ts +0 -7
  94. package/dist/modules/Customer/constants.js +0 -12
  95. package/dist/modules/Customer/index.d.ts +0 -122
  96. package/dist/modules/Customer/index.js +0 -696
  97. package/dist/modules/Customer/types.d.ts +0 -146
  98. package/dist/modules/Customer/types.js +0 -41
  99. package/dist/modules/Payment/cash.d.ts +0 -19
  100. package/dist/modules/Payment/cash.js +0 -97
  101. package/dist/modules/Payment/cashRecommendationAlgorithm.d.ts +0 -22
  102. package/dist/modules/Payment/cashRecommendationAlgorithm.js +0 -423
  103. package/dist/modules/Payment/eftpos.d.ts +0 -11
  104. package/dist/modules/Payment/eftpos.js +0 -80
  105. package/dist/modules/Payment/mx51.d.ts +0 -0
  106. package/dist/modules/Payment/mx51.js +0 -0
  107. package/dist/modules/Payment/utils.d.ts +0 -17
  108. package/dist/modules/Payment/utils.js +0 -62
  109. package/dist/modules/Payment/walletpass.d.ts +0 -99
  110. package/dist/modules/Payment/walletpass.js +0 -711
  111. package/dist/plugins/app-types/app/app.d.ts +0 -83
  112. package/dist/plugins/app-types/app/const.d.ts +0 -4
  113. package/dist/plugins/app-types/app/index.d.ts +0 -14
  114. package/dist/plugins/app-types/applicationManager/application.d.ts +0 -50
  115. package/dist/plugins/app-types/applicationManager/index.d.ts +0 -13
  116. package/dist/plugins/app-types/config.d.ts +0 -3
  117. package/dist/plugins/app-types/cookie/index.d.ts +0 -13
  118. package/dist/plugins/app-types/data/index.d.ts +0 -8
  119. package/dist/plugins/app-types/history/config.d.ts +0 -24
  120. package/dist/plugins/app-types/history/index.d.ts +0 -20
  121. package/dist/plugins/app-types/history/type.d.ts +0 -2
  122. package/dist/plugins/app-types/hooks/index.d.ts +0 -12
  123. package/dist/plugins/app-types/hooks/useDelayedValue/index.d.ts +0 -2
  124. package/dist/plugins/app-types/hooks/useDispatch/index.d.ts +0 -2
  125. package/dist/plugins/app-types/hooks/useLowCode/index.d.ts +0 -13
  126. package/dist/plugins/app-types/hooks/useStore/index.d.ts +0 -6
  127. package/dist/plugins/app-types/index.d.ts +0 -6
  128. package/dist/plugins/app-types/indexDB/index.d.ts +0 -178
  129. package/dist/plugins/app-types/locales/en.d.ts +0 -3
  130. package/dist/plugins/app-types/locales/index.d.ts +0 -37
  131. package/dist/plugins/app-types/locales/original.d.ts +0 -3
  132. package/dist/plugins/app-types/locales/type.d.ts +0 -19
  133. package/dist/plugins/app-types/locales/zh-CN.d.ts +0 -3
  134. package/dist/plugins/app-types/locales/zh-HK.d.ts +0 -3
  135. package/dist/plugins/app-types/logger/feishu.d.ts +0 -11
  136. package/dist/plugins/app-types/logger/index.d.ts +0 -122
  137. package/dist/plugins/app-types/menuManager/hooks.d.ts +0 -17
  138. package/dist/plugins/app-types/menuManager/index.d.ts +0 -28
  139. package/dist/plugins/app-types/models/global.d.ts +0 -32
  140. package/dist/plugins/app-types/models/index.d.ts +0 -45
  141. package/dist/plugins/app-types/models/type.d.ts +0 -2
  142. package/dist/plugins/app-types/package.json +0 -15
  143. package/dist/plugins/app-types/plugin/index.d.ts +0 -0
  144. package/dist/plugins/app-types/pubsub/example.d.ts +0 -5
  145. package/dist/plugins/app-types/pubsub/index.d.ts +0 -63
  146. package/dist/plugins/app-types/request/cache.d.ts +0 -46
  147. package/dist/plugins/app-types/request/cancelToken.d.ts +0 -38
  148. package/dist/plugins/app-types/request/config.d.ts +0 -3
  149. package/dist/plugins/app-types/request/constants.d.ts +0 -2
  150. package/dist/plugins/app-types/request/index.d.ts +0 -24
  151. package/dist/plugins/app-types/request/pisell2Request.d.ts +0 -6
  152. package/dist/plugins/app-types/request/type.d.ts +0 -41
  153. package/dist/plugins/app-types/request/utils.d.ts +0 -46
  154. package/dist/plugins/app-types/routes/config.d.ts +0 -7
  155. package/dist/plugins/app-types/routes/index.d.ts +0 -28
  156. package/dist/plugins/app-types/socket/components/SocketMonitorPage.d.ts +0 -6
  157. package/dist/plugins/app-types/socket/components/index.d.ts +0 -2
  158. package/dist/plugins/app-types/socket/constants.d.ts +0 -33
  159. package/dist/plugins/app-types/socket/events.d.ts +0 -31
  160. package/dist/plugins/app-types/socket/heartbeat.d.ts +0 -66
  161. package/dist/plugins/app-types/socket/index.d.ts +0 -61
  162. package/dist/plugins/app-types/socket/monitor.d.ts +0 -169
  163. package/dist/plugins/app-types/socket/reconnect.d.ts +0 -61
  164. package/dist/plugins/app-types/socket/socket.d.ts +0 -129
  165. package/dist/plugins/app-types/socket/types.d.ts +0 -85
  166. package/dist/plugins/app-types/storage/index.d.ts +0 -17
  167. package/dist/plugins/app-types/tasks/index.d.ts +0 -77
  168. package/dist/plugins/app-types/tasks/type.d.ts +0 -62
  169. package/dist/plugins/app-types/tasks/useTasks.d.ts +0 -5
  170. package/dist/plugins/app-types/type.d.ts +0 -2
  171. package/dist/plugins/app-types/variables/VariablesProvider.d.ts +0 -7
  172. package/dist/plugins/app-types/variables/config.d.ts +0 -3
  173. package/dist/plugins/app-types/variables/index.d.ts +0 -6
  174. package/dist/plugins/app-types/variables/type.d.ts +0 -2
  175. package/dist/plugins/app-types/website/index.d.ts +0 -6
  176. package/dist/plugins/app.d.ts +0 -8
  177. package/dist/plugins/app.js +0 -1
  178. package/dist/solution/BookingTicket/index.d.ts +0 -184
  179. package/dist/solution/BookingTicket/index.js +0 -698
  180. package/dist/solution/BookingTicket/types.d.ts +0 -68
  181. package/dist/solution/BookingTicket/types.js +0 -43
  182. package/dist/solution/BookingTicket/utils/scan/cloudSearch.d.ts +0 -22
  183. package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +0 -159
  184. package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +0 -22
  185. package/dist/solution/BookingTicket/utils/scan/handleScan.js +0 -189
  186. package/dist/solution/BookingTicket/utils/scan/index.d.ts +0 -85
  187. package/dist/solution/BookingTicket/utils/scan/index.js +0 -294
  188. package/dist/solution/BookingTicket/utils/scan/scanCache.d.ts +0 -78
  189. package/dist/solution/BookingTicket/utils/scan/scanCache.js +0 -305
  190. package/dist/solution/Checkout/appointmentDemo.json +0 -1
  191. package/dist/solution/Checkout/index.d.ts +0 -432
  192. package/dist/solution/Checkout/index.js +0 -4452
  193. package/dist/solution/Checkout/types.d.ts +0 -727
  194. package/dist/solution/Checkout/types.js +0 -104
  195. package/dist/solution/Checkout/utils/index.d.ts +0 -121
  196. package/dist/solution/Checkout/utils/index.js +0 -511
  197. package/dist/utils/task.d.ts +0 -40
  198. package/dist/utils/task.js +0 -171
  199. package/dist/utils/watch.d.ts +0 -102
  200. package/dist/utils/watch.js +0 -294
  201. package/lib/modules/Customer/constants.d.ts +0 -7
  202. package/lib/modules/Customer/constants.js +0 -39
  203. package/lib/modules/Customer/index.d.ts +0 -122
  204. package/lib/modules/Customer/index.js +0 -439
  205. package/lib/modules/Customer/types.d.ts +0 -146
  206. package/lib/modules/Customer/types.js +0 -37
  207. package/lib/modules/Payment/cash.d.ts +0 -19
  208. package/lib/modules/Payment/cash.js +0 -64
  209. package/lib/modules/Payment/cashRecommendationAlgorithm.d.ts +0 -22
  210. package/lib/modules/Payment/cashRecommendationAlgorithm.js +0 -342
  211. package/lib/modules/Payment/eftpos.d.ts +0 -11
  212. package/lib/modules/Payment/eftpos.js +0 -51
  213. package/lib/modules/Payment/mx51.d.ts +0 -0
  214. package/lib/modules/Payment/mx51.js +0 -0
  215. package/lib/modules/Payment/utils.d.ts +0 -17
  216. package/lib/modules/Payment/utils.js +0 -67
  217. package/lib/modules/Payment/walletpass.d.ts +0 -99
  218. package/lib/modules/Payment/walletpass.js +0 -484
  219. package/lib/plugins/app-types/app/app.d.ts +0 -83
  220. package/lib/plugins/app-types/app/const.d.ts +0 -4
  221. package/lib/plugins/app-types/app/index.d.ts +0 -14
  222. package/lib/plugins/app-types/applicationManager/application.d.ts +0 -50
  223. package/lib/plugins/app-types/applicationManager/index.d.ts +0 -13
  224. package/lib/plugins/app-types/config.d.ts +0 -3
  225. package/lib/plugins/app-types/cookie/index.d.ts +0 -13
  226. package/lib/plugins/app-types/data/index.d.ts +0 -8
  227. package/lib/plugins/app-types/history/config.d.ts +0 -24
  228. package/lib/plugins/app-types/history/index.d.ts +0 -20
  229. package/lib/plugins/app-types/history/type.d.ts +0 -2
  230. package/lib/plugins/app-types/hooks/index.d.ts +0 -12
  231. package/lib/plugins/app-types/hooks/useDelayedValue/index.d.ts +0 -2
  232. package/lib/plugins/app-types/hooks/useDispatch/index.d.ts +0 -2
  233. package/lib/plugins/app-types/hooks/useLowCode/index.d.ts +0 -13
  234. package/lib/plugins/app-types/hooks/useStore/index.d.ts +0 -6
  235. package/lib/plugins/app-types/index.d.ts +0 -6
  236. package/lib/plugins/app-types/indexDB/index.d.ts +0 -178
  237. package/lib/plugins/app-types/locales/en.d.ts +0 -3
  238. package/lib/plugins/app-types/locales/index.d.ts +0 -37
  239. package/lib/plugins/app-types/locales/original.d.ts +0 -3
  240. package/lib/plugins/app-types/locales/type.d.ts +0 -19
  241. package/lib/plugins/app-types/locales/zh-CN.d.ts +0 -3
  242. package/lib/plugins/app-types/locales/zh-HK.d.ts +0 -3
  243. package/lib/plugins/app-types/logger/feishu.d.ts +0 -11
  244. package/lib/plugins/app-types/logger/index.d.ts +0 -122
  245. package/lib/plugins/app-types/menuManager/hooks.d.ts +0 -17
  246. package/lib/plugins/app-types/menuManager/index.d.ts +0 -28
  247. package/lib/plugins/app-types/models/global.d.ts +0 -32
  248. package/lib/plugins/app-types/models/index.d.ts +0 -45
  249. package/lib/plugins/app-types/models/type.d.ts +0 -2
  250. package/lib/plugins/app-types/package.json +0 -15
  251. package/lib/plugins/app-types/plugin/index.d.ts +0 -0
  252. package/lib/plugins/app-types/pubsub/example.d.ts +0 -5
  253. package/lib/plugins/app-types/pubsub/index.d.ts +0 -63
  254. package/lib/plugins/app-types/request/cache.d.ts +0 -46
  255. package/lib/plugins/app-types/request/cancelToken.d.ts +0 -38
  256. package/lib/plugins/app-types/request/config.d.ts +0 -3
  257. package/lib/plugins/app-types/request/constants.d.ts +0 -2
  258. package/lib/plugins/app-types/request/index.d.ts +0 -24
  259. package/lib/plugins/app-types/request/pisell2Request.d.ts +0 -6
  260. package/lib/plugins/app-types/request/type.d.ts +0 -41
  261. package/lib/plugins/app-types/request/utils.d.ts +0 -46
  262. package/lib/plugins/app-types/routes/config.d.ts +0 -7
  263. package/lib/plugins/app-types/routes/index.d.ts +0 -28
  264. package/lib/plugins/app-types/socket/components/SocketMonitorPage.d.ts +0 -6
  265. package/lib/plugins/app-types/socket/components/index.d.ts +0 -2
  266. package/lib/plugins/app-types/socket/constants.d.ts +0 -33
  267. package/lib/plugins/app-types/socket/events.d.ts +0 -31
  268. package/lib/plugins/app-types/socket/heartbeat.d.ts +0 -66
  269. package/lib/plugins/app-types/socket/index.d.ts +0 -61
  270. package/lib/plugins/app-types/socket/monitor.d.ts +0 -169
  271. package/lib/plugins/app-types/socket/reconnect.d.ts +0 -61
  272. package/lib/plugins/app-types/socket/socket.d.ts +0 -129
  273. package/lib/plugins/app-types/socket/types.d.ts +0 -85
  274. package/lib/plugins/app-types/storage/index.d.ts +0 -17
  275. package/lib/plugins/app-types/tasks/index.d.ts +0 -77
  276. package/lib/plugins/app-types/tasks/type.d.ts +0 -62
  277. package/lib/plugins/app-types/tasks/useTasks.d.ts +0 -5
  278. package/lib/plugins/app-types/type.d.ts +0 -2
  279. package/lib/plugins/app-types/variables/VariablesProvider.d.ts +0 -7
  280. package/lib/plugins/app-types/variables/config.d.ts +0 -3
  281. package/lib/plugins/app-types/variables/index.d.ts +0 -6
  282. package/lib/plugins/app-types/variables/type.d.ts +0 -2
  283. package/lib/plugins/app-types/website/index.d.ts +0 -6
  284. package/lib/plugins/app.d.ts +0 -8
  285. package/lib/plugins/app.js +0 -17
  286. package/lib/solution/BookingTicket/index.d.ts +0 -184
  287. package/lib/solution/BookingTicket/index.js +0 -426
  288. package/lib/solution/BookingTicket/types.d.ts +0 -68
  289. package/lib/solution/BookingTicket/types.js +0 -72
  290. package/lib/solution/BookingTicket/utils/scan/cloudSearch.d.ts +0 -22
  291. package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +0 -117
  292. package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +0 -22
  293. package/lib/solution/BookingTicket/utils/scan/handleScan.js +0 -132
  294. package/lib/solution/BookingTicket/utils/scan/index.d.ts +0 -85
  295. package/lib/solution/BookingTicket/utils/scan/index.js +0 -216
  296. package/lib/solution/BookingTicket/utils/scan/scanCache.d.ts +0 -78
  297. package/lib/solution/BookingTicket/utils/scan/scanCache.js +0 -231
  298. package/lib/solution/Checkout/appointmentDemo.json +0 -1
  299. package/lib/solution/Checkout/index.d.ts +0 -432
  300. package/lib/solution/Checkout/index.js +0 -2776
  301. package/lib/solution/Checkout/types.d.ts +0 -727
  302. package/lib/solution/Checkout/types.js +0 -63
  303. package/lib/solution/Checkout/utils/index.d.ts +0 -121
  304. package/lib/solution/Checkout/utils/index.js +0 -362
  305. package/lib/utils/task.d.ts +0 -40
  306. package/lib/utils/task.js +0 -109
  307. package/lib/utils/watch.d.ts +0 -102
  308. package/lib/utils/watch.js +0 -217
@@ -1,184 +0,0 @@
1
- import { Module, PisellCore } from '../../types';
2
- import { BaseModule } from '../../modules/BaseModule';
3
- import { RequestPlugin, WindowPlugin } from '../../plugins';
4
- import { IGetCustomerListParams, ICustomer, ILoadProductsParams, IScanResult } from './types';
5
- import { ProductData } from '../../modules';
6
- export declare class BookingTicketImpl extends BaseModule implements Module {
7
- protected defaultName: string;
8
- protected defaultVersion: string;
9
- isSolution: boolean;
10
- request: RequestPlugin;
11
- window: WindowPlugin;
12
- private shopStore;
13
- private store;
14
- private otherParams;
15
- private cacheId;
16
- private platform;
17
- private scan;
18
- initialize(core: PisellCore, options: any): Promise<void>;
19
- /**
20
- * 获取商品列表
21
- * @param params 包含 schedule_date 的参数
22
- * @returns 商品列表
23
- */
24
- loadProducts(params?: ILoadProductsParams): Promise<any>;
25
- /**
26
- * 初始化外设扫码结果监听
27
- */
28
- initPeripheralsListener(): void;
29
- /**
30
- * 获取商品列表(不加载到模块中)
31
- * @returns 商品列表
32
- */
33
- getProducts(): Promise<ProductData[]>;
34
- /**
35
- * 获取客户列表
36
- * @param params 查询参数
37
- * @returns 客户列表响应
38
- */
39
- getCustomerList(params?: IGetCustomerListParams): Promise<import("../../modules").ICustomerListResponse>;
40
- /**
41
- * 设置活跃客户
42
- * @param customer 客户信息
43
- */
44
- setActiveCustomer(customer: ICustomer): void;
45
- /**
46
- * 获取当前活跃客户
47
- * @returns 当前活跃客户
48
- */
49
- getActiveCustomer(): ICustomer | null;
50
- /**
51
- * 根据ID设置选中的客户
52
- * @param customerId 客户ID
53
- */
54
- setSelectedCustomerById(customerId: string | number): void;
55
- /**
56
- * 获取所有客户
57
- * @returns 客户列表
58
- */
59
- getCustomers(): ICustomer[];
60
- /**
61
- * 根据ID获取客户
62
- * @param customerId 客户ID
63
- * @returns 客户信息
64
- */
65
- getCustomerById(customerId: string | number): ICustomer | null;
66
- /**
67
- * 清空客户列表
68
- */
69
- clearCustomers(): void;
70
- /**
71
- * 添加客户到列表第一位
72
- * @param customer 要添加的客户信息
73
- */
74
- addCustomerToFirst(customer: ICustomer): void;
75
- /**
76
- * 获取客户分页信息
77
- * @returns 分页信息
78
- */
79
- getCustomerPaginationInfo(): import("../../modules").IPaginationInfo;
80
- /**
81
- * 获取客户列表总数
82
- * @returns 总数
83
- */
84
- getCustomerTotal(): number;
85
- /**
86
- * 设置客户分页信息
87
- * @param page 页码
88
- * @param pageSize 每页数量
89
- */
90
- setCustomerPaginationInfo(page: number, pageSize: number): void;
91
- /**
92
- * 便捷方法:切换客户分页并自动获取数据
93
- * @param page 页码
94
- * @param pageSize 每页数量(可选)
95
- * @returns 客户列表响应
96
- */
97
- changeCustomerPage(page: number, pageSize?: number): Promise<import("../../modules").ICustomerListResponse>;
98
- /**
99
- * 滚动加载更多客户数据 - 数据会追加到现有列表中
100
- * @returns 客户列表响应
101
- */
102
- loadMoreCustomers(): Promise<import("../../modules").ICustomerListResponse>;
103
- /**
104
- * 重置并重新开始滚动加载客户数据
105
- * @param params 查询参数
106
- * @returns 客户列表响应
107
- */
108
- resetAndLoadCustomers(params?: IGetCustomerListParams): Promise<import("../../modules").ICustomerListResponse>;
109
- /**
110
- * 检查是否还有更多客户数据可以加载
111
- * @returns 是否还有更多数据
112
- */
113
- hasMoreCustomers(): boolean;
114
- /**
115
- * 获取当前的客户搜索条件
116
- * @returns 当前搜索条件
117
- */
118
- getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
119
- /**
120
- * 获取客户列表状态(包含滚动加载相关状态)
121
- * @returns 客户状态
122
- */
123
- getCustomerState(): import("../../modules").CustomerState;
124
- /**
125
- * 全局扫描监听
126
- * @param callback 回调
127
- */
128
- scanGlobalListener(callback: (data: IScanResult) => void): {
129
- remove: () => void;
130
- };
131
- /**
132
- * 客户扫描监听
133
- * @param callback 回调
134
- */
135
- scanCustomerListener(callback: (data: IScanResult) => void): {
136
- remove: () => void;
137
- };
138
- /**
139
- * @title 通用扫描监听
140
- * @description 直接将扫描结果返回给调用方
141
- * @param callback 回调
142
- */
143
- scanUniversalListener(callback: (data: IScanResult) => void, key: string): {
144
- remove: () => void;
145
- };
146
- /**
147
- * 调用摄像头
148
- * @param data 用户自定义数据
149
- */
150
- activateCamera(data?: {
151
- [key: string]: any;
152
- }): void;
153
- /**
154
- * 禁用所有扫描监听
155
- */
156
- disableAllScanListeners(): void;
157
- /**
158
- * 启用所有扫描监听
159
- */
160
- enableAllScanListeners(): void;
161
- /**
162
- * 清空所有扫描监听对应的任务执行队列
163
- */
164
- clearAllScanListenersTaskQueue(): void;
165
- /**
166
- * 设置其他参数
167
- * @param params 参数
168
- * @param options 选项
169
- */
170
- setOtherParams(params: Record<string, any>, { cover }?: {
171
- cover?: boolean;
172
- }): Promise<void>;
173
- /**
174
- * 获取其他参数
175
- * @returns 其他参数
176
- */
177
- getOtherParams(): Promise<Record<string, any>>;
178
- /**
179
- * 销毁模块
180
- */
181
- destroy(): void;
182
- }
183
- export * from './types';
184
- export { BookingTicketImpl as BookingTicket };
@@ -1,426 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
-
30
- // src/solution/BookingTicket/index.ts
31
- var BookingTicket_exports = {};
32
- __export(BookingTicket_exports, {
33
- BookingTicket: () => BookingTicketImpl,
34
- BookingTicketImpl: () => BookingTicketImpl
35
- });
36
- module.exports = __toCommonJS(BookingTicket_exports);
37
- var import_BaseModule = require("../../modules/BaseModule");
38
- var import_types = require("./types");
39
- var import_scan = __toESM(require("./utils/scan"));
40
- var import_handleScan = require("./utils/scan/handleScan");
41
- var import_scanCache = __toESM(require("./utils/scan/scanCache"));
42
- __reExport(BookingTicket_exports, require("./types"), module.exports);
43
- var BookingTicketImpl = class extends import_BaseModule.BaseModule {
44
- constructor() {
45
- super(...arguments);
46
- this.defaultName = "bookingTicket";
47
- this.defaultVersion = "1.0.0";
48
- this.isSolution = true;
49
- this.otherParams = {};
50
- }
51
- async initialize(core, options) {
52
- var _a, _b, _c;
53
- this.core = core;
54
- this.store = options.store || {};
55
- this.otherParams = options.otherParams || {};
56
- console.log("[BookingTicket] 初始化完成");
57
- this.request = core.getPlugin("request");
58
- this.window = core.getPlugin("window");
59
- this.shopStore = core.getPlugin("shopStore");
60
- if (!this.request) {
61
- throw new Error("bookingTicket解决方案需要 request 插件支持");
62
- }
63
- if (!this.shopStore) {
64
- throw new Error("bookingTicket解决方案需要 shopStore 插件支持");
65
- }
66
- let targetCacheData = {};
67
- this.cacheId = (_a = this.otherParams) == null ? void 0 : _a.cacheId;
68
- this.platform = (_b = this.otherParams) == null ? void 0 : _b.platform;
69
- this.scan = new import_scan.default(this, "BOOKING_TICKET_SCAN");
70
- if ((_c = this.otherParams) == null ? void 0 : _c.cacheId) {
71
- const sessionData = this.window.sessionStorage.getItem(this.name);
72
- if (sessionData) {
73
- const data = JSON.parse(sessionData);
74
- targetCacheData = data[this.otherParams.cacheId];
75
- }
76
- }
77
- const moduleArr = [
78
- "cart",
79
- "products",
80
- "accountList",
81
- "customer",
82
- "order"
83
- ];
84
- moduleArr.forEach((step) => {
85
- var _a2, _b2;
86
- const targetModule = (0, import_types.createModule)(step, this.name);
87
- if (targetModule) {
88
- this.store[step] = targetModule;
89
- this.core.registerModule(targetModule, {
90
- initialState: targetCacheData == null ? void 0 : targetCacheData[targetModule.name],
91
- otherParams: {
92
- ...this.otherParams,
93
- fatherModule: this.name,
94
- openCache: ((_a2 = this.otherParams) == null ? void 0 : _a2.cacheId) ? true : false,
95
- cacheId: (_b2 = this.otherParams) == null ? void 0 : _b2.cacheId
96
- }
97
- });
98
- } else {
99
- throw new Error(`模块 ${step} 不存在`);
100
- }
101
- });
102
- this.core.effects.emit(`${this.name}:onInited`, {});
103
- }
104
- /**
105
- * 获取商品列表
106
- * @param params 包含 schedule_date 的参数
107
- * @returns 商品列表
108
- */
109
- async loadProducts(params = {}) {
110
- const { schedule_date, customer_id, menu_list_ids, schedule_datetime } = params;
111
- try {
112
- const result = await this.store.products.loadProducts({
113
- with_count: ["bundleGroup", "optionGroup"],
114
- with_schedule: 1,
115
- ...params,
116
- cacheId: this.cacheId
117
- });
118
- this.core.effects.emit(`${this.name}:onProductsLoaded`, result);
119
- return result;
120
- } catch (error) {
121
- console.error("Failed to load products:", error);
122
- throw error;
123
- }
124
- }
125
- /**
126
- * 初始化外设扫码结果监听
127
- */
128
- initPeripheralsListener() {
129
- this.scan.initPeripheralsListener();
130
- }
131
- /**
132
- * 获取商品列表(不加载到模块中)
133
- * @returns 商品列表
134
- */
135
- async getProducts() {
136
- return this.store.products.getProducts();
137
- }
138
- /**
139
- * 获取客户列表
140
- * @param params 查询参数
141
- * @returns 客户列表响应
142
- */
143
- async getCustomerList(params = {}) {
144
- try {
145
- const result = await this.store.customer.getCustomerList(params);
146
- return result;
147
- } catch (error) {
148
- console.error("Failed to get customer list:", error);
149
- throw error;
150
- }
151
- }
152
- /**
153
- * 设置活跃客户
154
- * @param customer 客户信息
155
- */
156
- setActiveCustomer(customer) {
157
- this.store.customer.setSelectedCustomer(customer);
158
- this.core.effects.emit(`${this.name}:onCustomerSelected`, {
159
- customer
160
- });
161
- }
162
- /**
163
- * 获取当前活跃客户
164
- * @returns 当前活跃客户
165
- */
166
- getActiveCustomer() {
167
- return this.store.customer.getSelectedCustomer();
168
- }
169
- /**
170
- * 根据ID设置选中的客户
171
- * @param customerId 客户ID
172
- */
173
- setSelectedCustomerById(customerId) {
174
- const customer = this.store.customer.getCustomerById(customerId);
175
- if (customer) {
176
- this.store.customer.setSelectedCustomer(customer);
177
- this.core.effects.emit(`${this.name}:onCustomerSelected`, {
178
- customer
179
- });
180
- }
181
- }
182
- /**
183
- * 获取所有客户
184
- * @returns 客户列表
185
- */
186
- getCustomers() {
187
- return this.store.customer.getCustomers();
188
- }
189
- /**
190
- * 根据ID获取客户
191
- * @param customerId 客户ID
192
- * @returns 客户信息
193
- */
194
- getCustomerById(customerId) {
195
- return this.store.customer.getCustomerById(customerId);
196
- }
197
- /**
198
- * 清空客户列表
199
- */
200
- clearCustomers() {
201
- this.store.customer.clearCustomers();
202
- }
203
- /**
204
- * 添加客户到列表第一位
205
- * @param customer 要添加的客户信息
206
- */
207
- addCustomerToFirst(customer) {
208
- this.store.customer.addCustomerToFirst(customer);
209
- }
210
- /**
211
- * 获取客户分页信息
212
- * @returns 分页信息
213
- */
214
- getCustomerPaginationInfo() {
215
- return this.store.customer.getPaginationInfo();
216
- }
217
- /**
218
- * 获取客户列表总数
219
- * @returns 总数
220
- */
221
- getCustomerTotal() {
222
- return this.store.customer.getState().total;
223
- }
224
- /**
225
- * 设置客户分页信息
226
- * @param page 页码
227
- * @param pageSize 每页数量
228
- */
229
- setCustomerPaginationInfo(page, pageSize) {
230
- this.store.customer.setPaginationInfo(page, pageSize);
231
- }
232
- /**
233
- * 便捷方法:切换客户分页并自动获取数据
234
- * @param page 页码
235
- * @param pageSize 每页数量(可选)
236
- * @returns 客户列表响应
237
- */
238
- async changeCustomerPage(page, pageSize) {
239
- try {
240
- const result = await this.store.customer.changeCustomerPage(
241
- page,
242
- pageSize
243
- );
244
- return result;
245
- } catch (error) {
246
- console.error("Failed to change customer page:", error);
247
- throw error;
248
- }
249
- }
250
- /**
251
- * 滚动加载更多客户数据 - 数据会追加到现有列表中
252
- * @returns 客户列表响应
253
- */
254
- async loadMoreCustomers() {
255
- try {
256
- const result = await this.store.customer.loadMoreCustomers();
257
- this.core.effects.emit(`${this.name}:onCustomerListUpdate`, result);
258
- return result;
259
- } catch (error) {
260
- console.error("Failed to load more customers:", error);
261
- throw error;
262
- }
263
- }
264
- /**
265
- * 重置并重新开始滚动加载客户数据
266
- * @param params 查询参数
267
- * @returns 客户列表响应
268
- */
269
- async resetAndLoadCustomers(params = {}) {
270
- try {
271
- const result = await this.store.customer.resetAndLoadCustomers(params);
272
- this.core.effects.emit(`${this.name}:onCustomerListReset`, result);
273
- return result;
274
- } catch (error) {
275
- console.error("Failed to reset and load customers:", error);
276
- throw error;
277
- }
278
- }
279
- /**
280
- * 检查是否还有更多客户数据可以加载
281
- * @returns 是否还有更多数据
282
- */
283
- hasMoreCustomers() {
284
- return this.store.customer.hasMoreCustomers();
285
- }
286
- /**
287
- * 获取当前的客户搜索条件
288
- * @returns 当前搜索条件
289
- */
290
- getCurrentCustomerSearchParams() {
291
- return this.store.customer.getCurrentSearchParams();
292
- }
293
- /**
294
- * 获取客户列表状态(包含滚动加载相关状态)
295
- * @returns 客户状态
296
- */
297
- getCustomerState() {
298
- return this.store.customer.getState();
299
- }
300
- /**
301
- * 全局扫描监听
302
- * @param callback 回调
303
- */
304
- scanGlobalListener(callback) {
305
- const localSearch = (v) => this.store.products.findProductsByCodeOrBarcode(v);
306
- const scanCallback = (0, import_handleScan.handleGlobalScan)(this.request, localSearch);
307
- const safeCallback = (d) => {
308
- try {
309
- callback(d);
310
- } catch (error) {
311
- console.error("scanGlobalListener传入的回调函数异常", error);
312
- }
313
- };
314
- const listener = { key: "global", callback: safeCallback };
315
- const removeListener = this.scan.addListener(listener, scanCallback);
316
- return removeListener;
317
- }
318
- /**
319
- * 客户扫描监听
320
- * @param callback 回调
321
- */
322
- scanCustomerListener(callback) {
323
- const scanCallback = (0, import_handleScan.handleCustomerScan)();
324
- const safeCallback = (d) => {
325
- try {
326
- callback(d);
327
- } catch (error) {
328
- console.error("scanCustomerListener传入的回调函数异常", error);
329
- }
330
- };
331
- const listener = { key: "customer", callback: safeCallback };
332
- const removeListener = this.scan.addListener(listener, scanCallback);
333
- return removeListener;
334
- }
335
- /**
336
- * @title 通用扫描监听
337
- * @description 直接将扫描结果返回给调用方
338
- * @param callback 回调
339
- */
340
- scanUniversalListener(callback, key) {
341
- const scanCallback = (0, import_handleScan.handleUniversalScan)();
342
- const safeCallback = (d) => {
343
- try {
344
- callback(d);
345
- } catch (error) {
346
- console.error(
347
- `scanUniversalListener传入的回调函数异常, key: ${key}`,
348
- error
349
- );
350
- }
351
- };
352
- const listener = { key, callback: safeCallback };
353
- const removeListener = this.scan.addListener(listener, scanCallback);
354
- return removeListener;
355
- }
356
- /**
357
- * 调用摄像头
358
- * @param data 用户自定义数据
359
- */
360
- activateCamera(data) {
361
- var _a, _b, _c, _d;
362
- (_d = (_c = (_b = (_a = this.window) == null ? void 0 : _a.interaction) == null ? void 0 : _b.utils) == null ? void 0 : _c.postMessageToApp) == null ? void 0 : _d.call(_c, {
363
- module: "global",
364
- key: "active_native_scanner",
365
- data
366
- });
367
- }
368
- /**
369
- * 禁用所有扫描监听
370
- */
371
- disableAllScanListeners() {
372
- this.scan.disableAllListeners();
373
- }
374
- /**
375
- * 启用所有扫描监听
376
- */
377
- enableAllScanListeners() {
378
- this.scan.enableAllListeners();
379
- }
380
- /**
381
- * 清空所有扫描监听对应的任务执行队列
382
- */
383
- clearAllScanListenersTaskQueue() {
384
- this.scan.clearTaskQueue();
385
- }
386
- /**
387
- * 设置其他参数
388
- * @param params 参数
389
- * @param options 选项
390
- */
391
- async setOtherParams(params, { cover = false } = {}) {
392
- if (cover) {
393
- this.otherParams = params;
394
- } else {
395
- this.otherParams = { ...this.otherParams, ...params };
396
- }
397
- }
398
- /**
399
- * 获取其他参数
400
- * @returns 其他参数
401
- */
402
- async getOtherParams() {
403
- return this.otherParams;
404
- }
405
- /**
406
- * 销毁模块
407
- */
408
- destroy() {
409
- var _a, _b, _c, _d, _e;
410
- (_a = this.store.cart) == null ? void 0 : _a.destroy();
411
- (_b = this.store.products) == null ? void 0 : _b.destroy();
412
- (_c = this.store.accountList) == null ? void 0 : _c.destroy();
413
- (_d = this.store.customer) == null ? void 0 : _d.destroy();
414
- (_e = this.store.order) == null ? void 0 : _e.destroy();
415
- this.core.effects.offByModuleDestroy(this.name);
416
- this.core.unregisterModule(this);
417
- this.scan.removeAllListeners();
418
- import_scanCache.default.clear();
419
- }
420
- };
421
- // Annotate the CommonJS export names for ESM import in node:
422
- 0 && (module.exports = {
423
- BookingTicket,
424
- BookingTicketImpl,
425
- ...require("./types")
426
- });
@@ -1,68 +0,0 @@
1
- import { ProductList, CartModule, AccountListModule, OrderModule } from '../../modules';
2
- import { CustomerModule } from '../../modules/Customer';
3
- export interface BookingTicketState {
4
- cart: CartModule;
5
- products: ProductList;
6
- accountList: AccountListModule;
7
- customer: CustomerModule;
8
- order: OrderModule;
9
- }
10
- export declare function createModule<T extends keyof BookingTicketState>(moduleName: T, solutionName: string, name?: string, version?: string): BookingTicketState[T];
11
- export declare enum BookingTicketHooks {
12
- onInited = "bookingTicket:onInited",
13
- onDestroy = "bookingTicket:onDestroy",
14
- onProductsLoaded = "bookingTicket:onProductsLoaded",
15
- onCustomerSelected = "bookingTicket:onCustomerSelected",
16
- onCustomerListUpdate = "bookingTicket:onCustomerListUpdate",
17
- onCustomerListReset = "bookingTicket:onCustomerListReset"
18
- }
19
- /**
20
- * 获取客户列表的参数
21
- */
22
- export interface IGetCustomerListParams {
23
- /** 页码 */
24
- skip?: number;
25
- /** 每页数量 */
26
- num?: number;
27
- /** 搜索关键词 */
28
- search?: string;
29
- /** 其他筛选参数 */
30
- [key: string]: any;
31
- }
32
- /**
33
- * 客户信息
34
- */
35
- export interface ICustomer {
36
- /** 客户ID */
37
- id: string | number;
38
- /** 客户姓名 */
39
- name: string;
40
- /** 客户电话 */
41
- phone?: string;
42
- /** 客户邮箱 */
43
- email?: string;
44
- /** 其他客户信息 */
45
- [key: string]: any;
46
- }
47
- /**
48
- * 加载商品列表的参数
49
- */
50
- export interface ILoadProductsParams {
51
- /** 日期 格式:YYYY-MM-DD */
52
- schedule_date?: string;
53
- /** 客户ID */
54
- customer_id?: number;
55
- /** 餐牌列表ID */
56
- menu_list_ids?: number[];
57
- /** 时间 格式:YYYY-MM-DD HH:mm:ss*/
58
- schedule_datetime?: string;
59
- }
60
- /**
61
- * 扫描结果
62
- */
63
- export interface IScanResult {
64
- status: 'success' | 'fail';
65
- scanType: string;
66
- scanCode: string;
67
- result: any;
68
- }