@pisell/pisellos 3.0.56 → 3.0.57

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 (268) hide show
  1. package/dist/core/index.js +2 -1
  2. package/dist/effects/index.d.ts +4 -3
  3. package/dist/effects/index.js +15 -6
  4. package/dist/modules/AccountList/index.d.ts +7 -1
  5. package/dist/modules/AccountList/index.js +81 -14
  6. package/dist/modules/AccountList/types.d.ts +28 -0
  7. package/dist/modules/AccountList/types.js +8 -0
  8. package/dist/modules/Cart/index.js +1 -1
  9. package/dist/modules/Cart/utils/changePrice.d.ts +2 -2
  10. package/dist/modules/Cart/utils/changePrice.js +1 -1
  11. package/dist/modules/Customer/constants.d.ts +7 -0
  12. package/dist/modules/Customer/constants.js +12 -0
  13. package/dist/modules/Customer/index.d.ts +122 -0
  14. package/dist/modules/Customer/index.js +697 -0
  15. package/dist/modules/Customer/types.d.ts +146 -0
  16. package/dist/modules/Customer/types.js +41 -0
  17. package/dist/modules/Payment/cash.d.ts +11 -0
  18. package/dist/modules/Payment/cash.js +78 -0
  19. package/dist/modules/Payment/eftpos.d.ts +11 -0
  20. package/dist/modules/Payment/eftpos.js +80 -0
  21. package/dist/modules/Payment/index.d.ts +273 -9
  22. package/dist/modules/Payment/index.js +2525 -109
  23. package/dist/modules/Payment/types.d.ts +382 -30
  24. package/dist/modules/Payment/types.js +116 -14
  25. package/dist/modules/Payment/wallet.d.ts +11 -0
  26. package/dist/modules/Payment/wallet.js +78 -0
  27. package/dist/modules/Payment/walletpass.d.ts +0 -0
  28. package/dist/modules/Payment/walletpass.js +0 -0
  29. package/dist/modules/ProductList/index.d.ts +13 -3
  30. package/dist/modules/ProductList/index.js +52 -42
  31. package/dist/modules/ProductList/types.d.ts +0 -1
  32. package/dist/modules/Rules/index.js +27 -14
  33. package/dist/modules/Rules/types.d.ts +1 -0
  34. package/dist/modules/index.d.ts +1 -0
  35. package/dist/modules/index.js +1 -0
  36. package/dist/plugins/app-types/app/app.d.ts +83 -0
  37. package/dist/plugins/app-types/app/const.d.ts +4 -0
  38. package/dist/plugins/app-types/app/index.d.ts +14 -0
  39. package/dist/plugins/app-types/applicationManager/application.d.ts +50 -0
  40. package/dist/plugins/app-types/applicationManager/index.d.ts +13 -0
  41. package/dist/plugins/app-types/config.d.ts +3 -0
  42. package/dist/plugins/app-types/cookie/index.d.ts +13 -0
  43. package/dist/plugins/app-types/data/index.d.ts +8 -0
  44. package/dist/plugins/app-types/history/config.d.ts +24 -0
  45. package/dist/plugins/app-types/history/index.d.ts +20 -0
  46. package/dist/plugins/app-types/history/type.d.ts +2 -0
  47. package/dist/plugins/app-types/hooks/index.d.ts +12 -0
  48. package/dist/plugins/app-types/hooks/useDelayedValue/index.d.ts +2 -0
  49. package/dist/plugins/app-types/hooks/useDispatch/index.d.ts +2 -0
  50. package/dist/plugins/app-types/hooks/useLowCode/index.d.ts +13 -0
  51. package/dist/plugins/app-types/hooks/useStore/index.d.ts +6 -0
  52. package/dist/plugins/app-types/index.d.ts +6 -0
  53. package/dist/plugins/app-types/indexDB/index.d.ts +178 -0
  54. package/dist/plugins/app-types/locales/en.d.ts +3 -0
  55. package/dist/plugins/app-types/locales/index.d.ts +37 -0
  56. package/dist/plugins/app-types/locales/original.d.ts +3 -0
  57. package/dist/plugins/app-types/locales/type.d.ts +19 -0
  58. package/dist/plugins/app-types/locales/zh-CN.d.ts +3 -0
  59. package/dist/plugins/app-types/locales/zh-HK.d.ts +3 -0
  60. package/dist/plugins/app-types/logger/feishu.d.ts +11 -0
  61. package/dist/plugins/app-types/logger/index.d.ts +122 -0
  62. package/dist/plugins/app-types/menuManager/hooks.d.ts +17 -0
  63. package/dist/plugins/app-types/menuManager/index.d.ts +28 -0
  64. package/dist/plugins/app-types/models/global.d.ts +32 -0
  65. package/dist/plugins/app-types/models/index.d.ts +45 -0
  66. package/dist/plugins/app-types/models/type.d.ts +2 -0
  67. package/dist/plugins/app-types/package.json +15 -0
  68. package/dist/plugins/app-types/plugin/index.d.ts +0 -0
  69. package/dist/plugins/app-types/pubsub/example.d.ts +5 -0
  70. package/dist/plugins/app-types/pubsub/index.d.ts +63 -0
  71. package/dist/plugins/app-types/request/cache.d.ts +46 -0
  72. package/dist/plugins/app-types/request/cancelToken.d.ts +38 -0
  73. package/dist/plugins/app-types/request/config.d.ts +3 -0
  74. package/dist/plugins/app-types/request/constants.d.ts +2 -0
  75. package/dist/plugins/app-types/request/index.d.ts +24 -0
  76. package/dist/plugins/app-types/request/pisell2Request.d.ts +6 -0
  77. package/dist/plugins/app-types/request/type.d.ts +41 -0
  78. package/dist/plugins/app-types/request/utils.d.ts +46 -0
  79. package/dist/plugins/app-types/routes/config.d.ts +7 -0
  80. package/dist/plugins/app-types/routes/index.d.ts +28 -0
  81. package/dist/plugins/app-types/socket/components/SocketMonitorPage.d.ts +6 -0
  82. package/dist/plugins/app-types/socket/components/index.d.ts +2 -0
  83. package/dist/plugins/app-types/socket/constants.d.ts +33 -0
  84. package/dist/plugins/app-types/socket/events.d.ts +31 -0
  85. package/dist/plugins/app-types/socket/heartbeat.d.ts +66 -0
  86. package/dist/plugins/app-types/socket/index.d.ts +61 -0
  87. package/dist/plugins/app-types/socket/monitor.d.ts +169 -0
  88. package/dist/plugins/app-types/socket/reconnect.d.ts +61 -0
  89. package/dist/plugins/app-types/socket/socket.d.ts +129 -0
  90. package/dist/plugins/app-types/socket/types.d.ts +85 -0
  91. package/dist/plugins/app-types/storage/index.d.ts +17 -0
  92. package/dist/plugins/app-types/tasks/index.d.ts +77 -0
  93. package/dist/plugins/app-types/tasks/type.d.ts +62 -0
  94. package/dist/plugins/app-types/tasks/useTasks.d.ts +5 -0
  95. package/dist/plugins/app-types/type.d.ts +2 -0
  96. package/dist/plugins/app-types/variables/VariablesProvider.d.ts +7 -0
  97. package/dist/plugins/app-types/variables/config.d.ts +3 -0
  98. package/dist/plugins/app-types/variables/index.d.ts +6 -0
  99. package/dist/plugins/app-types/variables/type.d.ts +2 -0
  100. package/dist/plugins/app-types/website/index.d.ts +6 -0
  101. package/dist/plugins/app.d.ts +8 -0
  102. package/dist/plugins/app.js +1 -0
  103. package/dist/plugins/window.d.ts +1 -0
  104. package/dist/solution/BookingByStep/index.js +59 -35
  105. package/dist/solution/BookingByStep/types.d.ts +3 -2
  106. package/dist/solution/BookingTicket/index.d.ts +172 -0
  107. package/dist/solution/BookingTicket/index.js +665 -0
  108. package/dist/solution/BookingTicket/types.d.ts +68 -0
  109. package/dist/solution/BookingTicket/types.js +43 -0
  110. package/dist/solution/BookingTicket/utils/scan/cloudSearch.d.ts +22 -0
  111. package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +159 -0
  112. package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +16 -0
  113. package/dist/solution/BookingTicket/utils/scan/handleScan.js +174 -0
  114. package/dist/solution/BookingTicket/utils/scan/index.d.ts +81 -0
  115. package/dist/solution/BookingTicket/utils/scan/index.js +285 -0
  116. package/dist/solution/BookingTicket/utils/scan/scanCache.d.ts +78 -0
  117. package/dist/solution/BookingTicket/utils/scan/scanCache.js +305 -0
  118. package/dist/solution/BuyTickets/index.d.ts +2 -2
  119. package/dist/solution/BuyTickets/index.js +1 -1
  120. package/dist/solution/Checkout/appointmentDemo.json +1 -0
  121. package/dist/solution/Checkout/index.d.ts +181 -0
  122. package/dist/solution/Checkout/index.js +1596 -0
  123. package/dist/solution/Checkout/types.d.ts +550 -0
  124. package/dist/solution/Checkout/types.js +132 -0
  125. package/dist/solution/Checkout/utils/index.d.ts +73 -0
  126. package/dist/solution/Checkout/utils/index.js +371 -0
  127. package/dist/solution/ShopDiscount/index.js +4 -2
  128. package/dist/solution/index.d.ts +2 -0
  129. package/dist/solution/index.js +3 -1
  130. package/dist/types/index.d.ts +3 -1
  131. package/dist/utils/task.d.ts +40 -0
  132. package/dist/utils/task.js +171 -0
  133. package/dist/utils/watch.d.ts +102 -0
  134. package/dist/utils/watch.js +294 -0
  135. package/lib/core/index.js +1 -1
  136. package/lib/effects/index.d.ts +4 -3
  137. package/lib/effects/index.js +4 -1
  138. package/lib/modules/AccountList/index.d.ts +7 -1
  139. package/lib/modules/AccountList/index.js +27 -0
  140. package/lib/modules/AccountList/types.d.ts +28 -0
  141. package/lib/modules/Cart/index.js +1 -1
  142. package/lib/modules/Cart/utils/changePrice.d.ts +2 -2
  143. package/lib/modules/Cart/utils/changePrice.js +1 -1
  144. package/lib/modules/Customer/constants.d.ts +7 -0
  145. package/lib/modules/Customer/constants.js +39 -0
  146. package/lib/modules/Customer/index.d.ts +122 -0
  147. package/lib/modules/Customer/index.js +440 -0
  148. package/lib/modules/Customer/types.d.ts +146 -0
  149. package/lib/modules/Customer/types.js +37 -0
  150. package/lib/modules/Payment/cash.d.ts +11 -0
  151. package/lib/modules/Payment/cash.js +51 -0
  152. package/lib/modules/Payment/eftpos.d.ts +11 -0
  153. package/lib/modules/Payment/eftpos.js +51 -0
  154. package/lib/modules/Payment/index.d.ts +273 -9
  155. package/lib/modules/Payment/index.js +1285 -50
  156. package/lib/modules/Payment/types.d.ts +382 -30
  157. package/lib/modules/Payment/types.js +41 -6
  158. package/lib/modules/Payment/wallet.d.ts +11 -0
  159. package/lib/modules/Payment/wallet.js +51 -0
  160. package/lib/modules/Payment/walletpass.d.ts +0 -0
  161. package/lib/modules/Payment/walletpass.js +0 -0
  162. package/lib/modules/ProductList/index.d.ts +13 -3
  163. package/lib/modules/ProductList/index.js +37 -26
  164. package/lib/modules/ProductList/types.d.ts +0 -1
  165. package/lib/modules/Rules/index.js +20 -12
  166. package/lib/modules/Rules/types.d.ts +1 -0
  167. package/lib/modules/index.d.ts +1 -0
  168. package/lib/modules/index.js +2 -0
  169. package/lib/plugins/app-types/app/app.d.ts +83 -0
  170. package/lib/plugins/app-types/app/const.d.ts +4 -0
  171. package/lib/plugins/app-types/app/index.d.ts +14 -0
  172. package/lib/plugins/app-types/applicationManager/application.d.ts +50 -0
  173. package/lib/plugins/app-types/applicationManager/index.d.ts +13 -0
  174. package/lib/plugins/app-types/config.d.ts +3 -0
  175. package/lib/plugins/app-types/cookie/index.d.ts +13 -0
  176. package/lib/plugins/app-types/data/index.d.ts +8 -0
  177. package/lib/plugins/app-types/history/config.d.ts +24 -0
  178. package/lib/plugins/app-types/history/index.d.ts +20 -0
  179. package/lib/plugins/app-types/history/type.d.ts +2 -0
  180. package/lib/plugins/app-types/hooks/index.d.ts +12 -0
  181. package/lib/plugins/app-types/hooks/useDelayedValue/index.d.ts +2 -0
  182. package/lib/plugins/app-types/hooks/useDispatch/index.d.ts +2 -0
  183. package/lib/plugins/app-types/hooks/useLowCode/index.d.ts +13 -0
  184. package/lib/plugins/app-types/hooks/useStore/index.d.ts +6 -0
  185. package/lib/plugins/app-types/index.d.ts +6 -0
  186. package/lib/plugins/app-types/indexDB/index.d.ts +178 -0
  187. package/lib/plugins/app-types/locales/en.d.ts +3 -0
  188. package/lib/plugins/app-types/locales/index.d.ts +37 -0
  189. package/lib/plugins/app-types/locales/original.d.ts +3 -0
  190. package/lib/plugins/app-types/locales/type.d.ts +19 -0
  191. package/lib/plugins/app-types/locales/zh-CN.d.ts +3 -0
  192. package/lib/plugins/app-types/locales/zh-HK.d.ts +3 -0
  193. package/lib/plugins/app-types/logger/feishu.d.ts +11 -0
  194. package/lib/plugins/app-types/logger/index.d.ts +122 -0
  195. package/lib/plugins/app-types/menuManager/hooks.d.ts +17 -0
  196. package/lib/plugins/app-types/menuManager/index.d.ts +28 -0
  197. package/lib/plugins/app-types/models/global.d.ts +32 -0
  198. package/lib/plugins/app-types/models/index.d.ts +45 -0
  199. package/lib/plugins/app-types/models/type.d.ts +2 -0
  200. package/lib/plugins/app-types/package.json +15 -0
  201. package/lib/plugins/app-types/plugin/index.d.ts +0 -0
  202. package/lib/plugins/app-types/pubsub/example.d.ts +5 -0
  203. package/lib/plugins/app-types/pubsub/index.d.ts +63 -0
  204. package/lib/plugins/app-types/request/cache.d.ts +46 -0
  205. package/lib/plugins/app-types/request/cancelToken.d.ts +38 -0
  206. package/lib/plugins/app-types/request/config.d.ts +3 -0
  207. package/lib/plugins/app-types/request/constants.d.ts +2 -0
  208. package/lib/plugins/app-types/request/index.d.ts +24 -0
  209. package/lib/plugins/app-types/request/pisell2Request.d.ts +6 -0
  210. package/lib/plugins/app-types/request/type.d.ts +41 -0
  211. package/lib/plugins/app-types/request/utils.d.ts +46 -0
  212. package/lib/plugins/app-types/routes/config.d.ts +7 -0
  213. package/lib/plugins/app-types/routes/index.d.ts +28 -0
  214. package/lib/plugins/app-types/socket/components/SocketMonitorPage.d.ts +6 -0
  215. package/lib/plugins/app-types/socket/components/index.d.ts +2 -0
  216. package/lib/plugins/app-types/socket/constants.d.ts +33 -0
  217. package/lib/plugins/app-types/socket/events.d.ts +31 -0
  218. package/lib/plugins/app-types/socket/heartbeat.d.ts +66 -0
  219. package/lib/plugins/app-types/socket/index.d.ts +61 -0
  220. package/lib/plugins/app-types/socket/monitor.d.ts +169 -0
  221. package/lib/plugins/app-types/socket/reconnect.d.ts +61 -0
  222. package/lib/plugins/app-types/socket/socket.d.ts +129 -0
  223. package/lib/plugins/app-types/socket/types.d.ts +85 -0
  224. package/lib/plugins/app-types/storage/index.d.ts +17 -0
  225. package/lib/plugins/app-types/tasks/index.d.ts +77 -0
  226. package/lib/plugins/app-types/tasks/type.d.ts +62 -0
  227. package/lib/plugins/app-types/tasks/useTasks.d.ts +5 -0
  228. package/lib/plugins/app-types/type.d.ts +2 -0
  229. package/lib/plugins/app-types/variables/VariablesProvider.d.ts +7 -0
  230. package/lib/plugins/app-types/variables/config.d.ts +3 -0
  231. package/lib/plugins/app-types/variables/index.d.ts +6 -0
  232. package/lib/plugins/app-types/variables/type.d.ts +2 -0
  233. package/lib/plugins/app-types/website/index.d.ts +6 -0
  234. package/lib/plugins/app.d.ts +8 -0
  235. package/lib/plugins/app.js +17 -0
  236. package/lib/plugins/window.d.ts +1 -0
  237. package/lib/solution/BookingByStep/index.js +40 -29
  238. package/lib/solution/BookingByStep/types.d.ts +3 -2
  239. package/lib/solution/BookingTicket/index.d.ts +172 -0
  240. package/lib/solution/BookingTicket/index.js +399 -0
  241. package/lib/solution/BookingTicket/types.d.ts +68 -0
  242. package/lib/solution/BookingTicket/types.js +72 -0
  243. package/lib/solution/BookingTicket/utils/scan/cloudSearch.d.ts +22 -0
  244. package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +117 -0
  245. package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +16 -0
  246. package/lib/solution/BookingTicket/utils/scan/handleScan.js +125 -0
  247. package/lib/solution/BookingTicket/utils/scan/index.d.ts +81 -0
  248. package/lib/solution/BookingTicket/utils/scan/index.js +210 -0
  249. package/lib/solution/BookingTicket/utils/scan/scanCache.d.ts +78 -0
  250. package/lib/solution/BookingTicket/utils/scan/scanCache.js +231 -0
  251. package/lib/solution/BuyTickets/index.d.ts +2 -2
  252. package/lib/solution/BuyTickets/index.js +1 -1
  253. package/lib/solution/Checkout/appointmentDemo.json +1 -0
  254. package/lib/solution/Checkout/index.d.ts +181 -0
  255. package/lib/solution/Checkout/index.js +864 -0
  256. package/lib/solution/Checkout/types.d.ts +550 -0
  257. package/lib/solution/Checkout/types.js +75 -0
  258. package/lib/solution/Checkout/utils/index.d.ts +73 -0
  259. package/lib/solution/Checkout/utils/index.js +266 -0
  260. package/lib/solution/ShopDiscount/index.js +2 -1
  261. package/lib/solution/index.d.ts +2 -0
  262. package/lib/solution/index.js +5 -1
  263. package/lib/types/index.d.ts +3 -1
  264. package/lib/utils/task.d.ts +40 -0
  265. package/lib/utils/task.js +109 -0
  266. package/lib/utils/watch.d.ts +102 -0
  267. package/lib/utils/watch.js +217 -0
  268. package/package.json +4 -2
@@ -112,7 +112,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
112
112
  this.otherData = ((_data$this$otherParam = data[this.otherParams.cacheId]) === null || _data$this$otherParam === void 0 || (_data$this$otherParam = _data$this$otherParam[this.name]) === null || _data$this$otherParam === void 0 ? void 0 : _data$this$otherParam['otherData']) || {};
113
113
  }
114
114
  }
115
- moduleArr = ['accountList', 'cart', 'schedule', 'summary', 'step', 'products', 'date', 'order', 'payment'];
115
+ moduleArr = ['accountList', 'cart', 'schedule', 'summary', 'step', 'products', 'date', 'order'];
116
116
  moduleArr.forEach(function (step) {
117
117
  var targetModule = createModule(step, _this2.name);
118
118
  if (targetModule) {
@@ -701,6 +701,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
701
701
  _params$useCache,
702
702
  useCache,
703
703
  tempProducts,
704
+ _this$store$currentPr,
704
705
  dateRange,
705
706
  tempStartDate,
706
707
  tempEndDate,
@@ -732,8 +733,8 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
732
733
  }
733
734
  // 如果当前打开了某个的商品详情弹窗,则应该默认用这个商品
734
735
  if (this.store.currentProduct) {
735
- tempProducts = [_objectSpread(_objectSpread({}, this.store.currentProduct.getData()), {}, {
736
- _schedule: this.store.currentProduct.getOtherParams()['schedule']
736
+ tempProducts = [_objectSpread(_objectSpread({}, this.store.currentProduct), {}, {
737
+ _schedule: (_this$store$currentPr = this.store.currentProductMeta) === null || _this$store$currentPr === void 0 ? void 0 : _this$store$currentPr['schedule']
737
738
  })];
738
739
  }
739
740
  dateRange = this.store.date.getDateRange();
@@ -1212,6 +1213,14 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
1212
1213
  _this6.store.cart.removeItem(n._id);
1213
1214
  });
1214
1215
  }
1216
+ // // 如果 date.startTime 和 dateRange 里的 startTime 不一样,需要修正 dateRange
1217
+ // const dateRange = this.store.date.getDateRange()
1218
+ // if (dateRange?.[0] && !dayjs(dateRange[0].date).isSame(dayjs(date.startTime), 'day')) {
1219
+ // this.setDateRange([
1220
+ // { date: dayjs(date.startTime).format('YYYY-MM-DD'), status: 'available', week: '', weekNum: 0 },
1221
+ // { date: dayjs(date.endTime).format('YYYY-MM-DD'), status: 'available', week: '', weekNum: 0 },
1222
+ // ]);
1223
+ // }
1215
1224
  }
1216
1225
  }
1217
1226
  }, {
@@ -2278,41 +2287,42 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
2278
2287
  key: "openProductDetail",
2279
2288
  value: function () {
2280
2289
  var _openProductDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25(productId) {
2281
- var targetProduct, targetProductData, newScheduleArr, dateRange;
2290
+ var targetProductData, newScheduleArr, dateRange;
2282
2291
  return _regeneratorRuntime().wrap(function _callee25$(_context25) {
2283
2292
  while (1) switch (_context25.prev = _context25.next) {
2284
2293
  case 0:
2285
2294
  _context25.next = 2;
2286
2295
  return this.store.products.getProduct(productId);
2287
2296
  case 2:
2288
- targetProduct = _context25.sent;
2289
- if (!targetProduct) {
2290
- _context25.next = 16;
2297
+ targetProductData = _context25.sent;
2298
+ if (!targetProductData) {
2299
+ _context25.next = 17;
2291
2300
  break;
2292
2301
  }
2293
- targetProductData = targetProduct.getData();
2294
- this.store.currentProduct = targetProduct;
2302
+ this.store.currentProduct = targetProductData;
2303
+ this.store.currentProductMeta = {};
2295
2304
  // 资源预加载,如果是 duration 类型的商品,且是先选日期的流程,在这里预拉取资源数据
2296
2305
  if (!targetProductData['schedule.ids']) {
2297
- _context25.next = 11;
2306
+ _context25.next = 12;
2298
2307
  break;
2299
2308
  }
2300
2309
  newScheduleArr = this.getScheduleDataByIds(targetProductData['schedule.ids']);
2301
- targetProduct.setOtherParams('schedule', newScheduleArr);
2302
- _context25.next = 16;
2310
+ if (!this.store.currentProductMeta) this.store.currentProductMeta = {};
2311
+ this.store.currentProductMeta.schedule = newScheduleArr;
2312
+ _context25.next = 17;
2303
2313
  break;
2304
- case 11:
2314
+ case 12:
2305
2315
  if (!targetProductData.duration) {
2306
- _context25.next = 16;
2316
+ _context25.next = 17;
2307
2317
  break;
2308
2318
  }
2309
2319
  dateRange = this.store.date.getDateRange(); // 如果不是先选日期的流程 duration 商品就啥也不做
2310
2320
  if (dateRange !== null && dateRange !== void 0 && dateRange.length) {
2311
- _context25.next = 15;
2321
+ _context25.next = 16;
2312
2322
  break;
2313
2323
  }
2314
2324
  return _context25.abrupt("return");
2315
- case 15:
2325
+ case 16:
2316
2326
  // this.store.date.getResourceDates({
2317
2327
  // query: {
2318
2328
  // start_date: dateRange[0].date,
@@ -2325,7 +2335,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
2325
2335
  endDate: dateRange[dateRange.length - 1].date,
2326
2336
  products: [targetProductData]
2327
2337
  });
2328
- case 16:
2338
+ case 17:
2329
2339
  case "end":
2330
2340
  return _context25.stop();
2331
2341
  }
@@ -2339,8 +2349,9 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
2339
2349
  }, {
2340
2350
  key: "closeProductDetail",
2341
2351
  value: function closeProductDetail() {
2342
- var _this$store$currentPr;
2343
- (_this$store$currentPr = this.store.currentProduct) === null || _this$store$currentPr === void 0 || _this$store$currentPr.setOtherParams('schedule', []);
2352
+ if (this.store.currentProductMeta) {
2353
+ this.store.currentProductMeta.schedule = [];
2354
+ }
2344
2355
  this.store.currentProduct = undefined;
2345
2356
  }
2346
2357
  }, {
@@ -2353,7 +2364,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
2353
2364
  product = _ref10.product;
2354
2365
  var targetProduct = this.store.currentProduct;
2355
2366
  // 如果外面传递了product 优先用外面的
2356
- var targetProductData = product || (targetProduct === null || targetProduct === void 0 ? void 0 : targetProduct.getData());
2367
+ var targetProductData = product || targetProduct;
2357
2368
  var targetSchedules = [];
2358
2369
  // 如果外面传递了 scheduleIds,优先取入参
2359
2370
  if (scheduleIds !== null && scheduleIds !== void 0 && scheduleIds.length) {
@@ -2368,7 +2379,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
2368
2379
  var cartItems = cloneDeep(this.store.cart.getItems());
2369
2380
  var resourcesMap = getResourcesMap((targetResourceDate === null || targetResourceDate === void 0 ? void 0 : targetResourceDate.resource) || []);
2370
2381
  var selectedResources = getOthersSelectedResources(cartItems, '', resourcesMap);
2371
- var productResources = getResourcesByProduct(resourcesMap, resources || ((_this$store$currentPr2 = this.store.currentProduct) === null || _this$store$currentPr2 === void 0 || (_this$store$currentPr2 = _this$store$currentPr2.getData()) === null || _this$store$currentPr2 === void 0 || (_this$store$currentPr2 = _this$store$currentPr2.product_resource) === null || _this$store$currentPr2 === void 0 ? void 0 : _this$store$currentPr2.resources) || [], selectedResources, 1);
2382
+ var productResources = getResourcesByProduct(resourcesMap, resources || ((_this$store$currentPr2 = this.store.currentProduct) === null || _this$store$currentPr2 === void 0 || (_this$store$currentPr2 = _this$store$currentPr2.product_resource) === null || _this$store$currentPr2 === void 0 ? void 0 : _this$store$currentPr2.resources) || [], selectedResources, 1);
2372
2383
  var minTimeMaxTime = calcMinTimeMaxTimeBySchedules(targetSchedules, {}, date);
2373
2384
  var scheduleTimeSlots = getAllSortedDateRanges(minTimeMaxTime);
2374
2385
  // 当前所有待选择资源的集合,先提出来,提升性能
@@ -2488,22 +2499,34 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
2488
2499
  key: "getProductTypeById",
2489
2500
  value: function () {
2490
2501
  var _getProductTypeById = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee26(id) {
2491
- var product;
2502
+ var productData, _productData$schedule;
2492
2503
  return _regeneratorRuntime().wrap(function _callee26$(_context26) {
2493
2504
  while (1) switch (_context26.prev = _context26.next) {
2494
2505
  case 0:
2495
2506
  _context26.next = 2;
2496
2507
  return this.store.products.getProduct(id);
2497
2508
  case 2:
2498
- product = _context26.sent;
2499
- if (!product) {
2500
- _context26.next = 5;
2509
+ productData = _context26.sent;
2510
+ if (!productData) {
2511
+ _context26.next = 9;
2501
2512
  break;
2502
2513
  }
2503
- return _context26.abrupt("return", product.getProductType());
2504
- case 5:
2505
- return _context26.abrupt("return", 'normal');
2514
+ if (!productData.duration) {
2515
+ _context26.next = 6;
2516
+ break;
2517
+ }
2518
+ return _context26.abrupt("return", 'duration');
2506
2519
  case 6:
2520
+ if (!((_productData$schedule = productData['schedule.ids']) !== null && _productData$schedule !== void 0 && _productData$schedule.length)) {
2521
+ _context26.next = 8;
2522
+ break;
2523
+ }
2524
+ return _context26.abrupt("return", 'session');
2525
+ case 8:
2526
+ return _context26.abrupt("return", 'normal');
2527
+ case 9:
2528
+ return _context26.abrupt("return", 'normal');
2529
+ case 10:
2507
2530
  case "end":
2508
2531
  return _context26.stop();
2509
2532
  }
@@ -2675,7 +2698,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
2675
2698
  key: "getAvailableDateForSessionOptimize",
2676
2699
  value: function () {
2677
2700
  var _getAvailableDateForSessionOptimize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28() {
2678
- var _this$store$currentPr3, _this$store$currentPr4, _this$store$currentPr5, _tempProducts, _this$store$currentPr6;
2701
+ var _this$store$currentPr3, _this$store$currentPr4, _tempProducts;
2679
2702
  var params,
2680
2703
  startDate,
2681
2704
  endDate,
@@ -2721,7 +2744,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
2721
2744
  endDate = tempEndDate;
2722
2745
 
2723
2746
  // 先去读缓存结果,因为正常 UI 调用的是 7 天,而下面我会直接计算 30 天(最少也是 14 天),所以先去读缓存结果,如果缓存结果存在,则直接返回
2724
- cache = (_this$store$currentPr3 = this.store.currentProduct) === null || _this$store$currentPr3 === void 0 ? void 0 : _this$store$currentPr3.getOtherParams()['timeSlotBySchedule'];
2747
+ cache = (_this$store$currentPr3 = this.store.currentProductMeta) === null || _this$store$currentPr3 === void 0 ? void 0 : _this$store$currentPr3['timeSlotBySchedule'];
2725
2748
  if (!cache) {
2726
2749
  _context29.next = 13;
2727
2750
  break;
@@ -2737,8 +2760,8 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
2737
2760
  });
2738
2761
  case 13:
2739
2762
  // 如果当前打开了某个的商品详情弹窗,则应该默认用这个商品
2740
- tempProducts = (_this$store$currentPr4 = this.store.currentProduct) === null || _this$store$currentPr4 === void 0 ? void 0 : _this$store$currentPr4.getData();
2741
- schedule = (_this$store$currentPr5 = this.store.currentProduct) === null || _this$store$currentPr5 === void 0 ? void 0 : _this$store$currentPr5.getOtherParams()['schedule'];
2763
+ tempProducts = this.store.currentProduct;
2764
+ schedule = (_this$store$currentPr4 = this.store.currentProductMeta) === null || _this$store$currentPr4 === void 0 ? void 0 : _this$store$currentPr4['schedule'];
2742
2765
  filteredSchedule = filterScheduleByDateRange(schedule, startDate || '', endDate || ''); // 1.后端返回的数据,确定资源在每一天的可用和使用情况
2743
2766
  tempResourceIds = getResourcesIdsByProduct(tempProducts);
2744
2767
  _context29.next = 19;
@@ -2898,17 +2921,18 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
2898
2921
  this.store.date.setDateList(dates);
2899
2922
 
2900
2923
  // 缓存这次结果,以防后面他小幅度范围内去修改天数
2901
- (_this$store$currentPr6 = this.store.currentProduct) === null || _this$store$currentPr6 === void 0 || _this$store$currentPr6.setOtherParams('timeSlotBySchedule', {
2924
+ if (!this.store.currentProductMeta) this.store.currentProductMeta = {};
2925
+ this.store.currentProductMeta.timeSlotBySchedule = {
2902
2926
  dateList: dates,
2903
2927
  firstAvailableDate: firstAvailableDate,
2904
2928
  startDate: startDate,
2905
2929
  endDate: dayjs(currentDate).format('YYYY-MM-DD')
2906
- });
2930
+ };
2907
2931
  return _context29.abrupt("return", {
2908
2932
  dateList: dates,
2909
2933
  firstAvailableDate: firstAvailableDate
2910
2934
  });
2911
- case 38:
2935
+ case 39:
2912
2936
  case "end":
2913
2937
  return _context29.stop();
2914
2938
  }
@@ -1,4 +1,4 @@
1
- import { ProductList, CartModule, Product, AccountModule, AccountListModule, DateModule, GuestListModule, OrderModule, PaymentModule, ResourceListModule, StepModule, SummaryModule, ScheduleModule } from '../../modules';
1
+ import { ProductList, CartModule, ProductData, AccountModule, AccountListModule, DateModule, GuestListModule, OrderModule, PaymentModule, ResourceListModule, StepModule, SummaryModule, ScheduleModule } from '../../modules';
2
2
  export interface BookingByStepState {
3
3
  cart: CartModule;
4
4
  summary: SummaryModule;
@@ -11,7 +11,8 @@ export interface BookingByStepState {
11
11
  accountList: AccountListModule;
12
12
  order: OrderModule;
13
13
  payment: PaymentModule;
14
- currentProduct?: Product;
14
+ currentProduct?: ProductData;
15
+ currentProductMeta?: Record<string, any>;
15
16
  schedule: ScheduleModule;
16
17
  }
17
18
  export declare function createModule<T extends keyof BookingByStepState>(moduleName: T, solutionName: string, name?: string, version?: string): BookingByStepState[T];
@@ -0,0 +1,172 @@
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
+ * @returns 商品列表
28
+ */
29
+ getProducts(): Promise<ProductData[]>;
30
+ /**
31
+ * 获取客户列表
32
+ * @param params 查询参数
33
+ * @returns 客户列表响应
34
+ */
35
+ getCustomerList(params?: IGetCustomerListParams): Promise<import("../../modules").ICustomerListResponse>;
36
+ /**
37
+ * 设置活跃客户
38
+ * @param customer 客户信息
39
+ */
40
+ setActiveCustomer(customer: ICustomer): void;
41
+ /**
42
+ * 获取当前活跃客户
43
+ * @returns 当前活跃客户
44
+ */
45
+ getActiveCustomer(): ICustomer | null;
46
+ /**
47
+ * 根据ID设置选中的客户
48
+ * @param customerId 客户ID
49
+ */
50
+ setSelectedCustomerById(customerId: string | number): void;
51
+ /**
52
+ * 获取所有客户
53
+ * @returns 客户列表
54
+ */
55
+ getCustomers(): ICustomer[];
56
+ /**
57
+ * 根据ID获取客户
58
+ * @param customerId 客户ID
59
+ * @returns 客户信息
60
+ */
61
+ getCustomerById(customerId: string | number): ICustomer | null;
62
+ /**
63
+ * 清空客户列表
64
+ */
65
+ clearCustomers(): void;
66
+ /**
67
+ * 添加客户到列表第一位
68
+ * @param customer 要添加的客户信息
69
+ */
70
+ addCustomerToFirst(customer: ICustomer): void;
71
+ /**
72
+ * 获取客户分页信息
73
+ * @returns 分页信息
74
+ */
75
+ getCustomerPaginationInfo(): import("../../modules").IPaginationInfo;
76
+ /**
77
+ * 获取客户列表总数
78
+ * @returns 总数
79
+ */
80
+ getCustomerTotal(): number;
81
+ /**
82
+ * 设置客户分页信息
83
+ * @param page 页码
84
+ * @param pageSize 每页数量
85
+ */
86
+ setCustomerPaginationInfo(page: number, pageSize: number): void;
87
+ /**
88
+ * 便捷方法:切换客户分页并自动获取数据
89
+ * @param page 页码
90
+ * @param pageSize 每页数量(可选)
91
+ * @returns 客户列表响应
92
+ */
93
+ changeCustomerPage(page: number, pageSize?: number): Promise<import("../../modules").ICustomerListResponse>;
94
+ /**
95
+ * 滚动加载更多客户数据 - 数据会追加到现有列表中
96
+ * @returns 客户列表响应
97
+ */
98
+ loadMoreCustomers(): Promise<import("../../modules").ICustomerListResponse>;
99
+ /**
100
+ * 重置并重新开始滚动加载客户数据
101
+ * @param params 查询参数
102
+ * @returns 客户列表响应
103
+ */
104
+ resetAndLoadCustomers(params?: IGetCustomerListParams): Promise<import("../../modules").ICustomerListResponse>;
105
+ /**
106
+ * 检查是否还有更多客户数据可以加载
107
+ * @returns 是否还有更多数据
108
+ */
109
+ hasMoreCustomers(): boolean;
110
+ /**
111
+ * 获取当前的客户搜索条件
112
+ * @returns 当前搜索条件
113
+ */
114
+ getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
115
+ /**
116
+ * 获取客户列表状态(包含滚动加载相关状态)
117
+ * @returns 客户状态
118
+ */
119
+ getCustomerState(): import("../../modules").CustomerState;
120
+ /**
121
+ * 全局扫描监听
122
+ * @param callback 回调
123
+ */
124
+ scanGlobalListener(callback: (data: IScanResult) => void): {
125
+ remove: () => void;
126
+ };
127
+ /**
128
+ * 客户扫描监听
129
+ * @param callback 回调
130
+ */
131
+ scanCustomerListener(callback: (data: IScanResult) => void): {
132
+ remove: () => void;
133
+ };
134
+ /**
135
+ * 调用摄像头
136
+ * @param data 用户自定义数据
137
+ */
138
+ activateCamera(data?: {
139
+ [key: string]: any;
140
+ }): void;
141
+ /**
142
+ * 禁用所有扫描监听
143
+ */
144
+ disableAllScanListeners(): void;
145
+ /**
146
+ * 启用所有扫描监听
147
+ */
148
+ enableAllScanListeners(): void;
149
+ /**
150
+ * 清空所有扫描监听对应的任务执行队列
151
+ */
152
+ clearAllScanListenersTaskQueue(): void;
153
+ /**
154
+ * 设置其他参数
155
+ * @param params 参数
156
+ * @param options 选项
157
+ */
158
+ setOtherParams(params: Record<string, any>, { cover }?: {
159
+ cover?: boolean;
160
+ }): Promise<void>;
161
+ /**
162
+ * 获取其他参数
163
+ * @returns 其他参数
164
+ */
165
+ getOtherParams(): Promise<Record<string, any>>;
166
+ /**
167
+ * 销毁模块
168
+ */
169
+ destroy(): void;
170
+ }
171
+ export * from './types';
172
+ export { BookingTicketImpl as BookingTicket };