@pisell/pisellos 3.0.76 → 3.0.78

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 (314) 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/Date/types.d.ts +3 -1
  14. package/dist/modules/Discount/index.d.ts +0 -1
  15. package/dist/modules/Discount/index.js +1 -1
  16. package/dist/modules/Guests/index.js +9 -9
  17. package/dist/modules/Order/index.d.ts +1 -25
  18. package/dist/modules/Order/index.js +3 -224
  19. package/dist/modules/Order/types.d.ts +0 -45
  20. package/dist/modules/Order/types.js +0 -8
  21. package/dist/modules/Order/utils.js +1 -1
  22. package/dist/modules/Payment/index.d.ts +9 -184
  23. package/dist/modules/Payment/index.js +109 -2084
  24. package/dist/modules/Payment/types.d.ts +30 -772
  25. package/dist/modules/Payment/types.js +12 -236
  26. package/dist/modules/ProductList/index.d.ts +1 -12
  27. package/dist/modules/ProductList/index.js +6 -29
  28. package/dist/modules/Resource/index.js +1 -1
  29. package/dist/modules/Rules/index.d.ts +4 -3
  30. package/dist/modules/Rules/index.js +121 -78
  31. package/dist/modules/Rules/types.d.ts +6 -1
  32. package/dist/modules/Rules/types.js +8 -0
  33. package/dist/modules/Schedule/index.d.ts +0 -9
  34. package/dist/modules/Schedule/index.js +0 -77
  35. package/dist/modules/index.d.ts +0 -1
  36. package/dist/modules/index.js +0 -1
  37. package/dist/plugins/window.d.ts +0 -1
  38. package/dist/solution/BookingByStep/index.d.ts +17 -0
  39. package/dist/solution/BookingByStep/index.js +525 -190
  40. package/dist/solution/BookingByStep/utils/products.d.ts +0 -6
  41. package/dist/solution/BookingByStep/utils/products.js +0 -10
  42. package/dist/solution/BookingByStep/utils/resources.js +4 -0
  43. package/dist/solution/BuyTickets/index.js +8 -7
  44. package/dist/solution/ShopDiscount/index.d.ts +12 -10
  45. package/dist/solution/ShopDiscount/index.js +64 -110
  46. package/dist/solution/ShopDiscount/types.d.ts +0 -8
  47. package/dist/solution/ShopDiscount/utils.js +1 -0
  48. package/dist/solution/index.d.ts +0 -2
  49. package/dist/solution/index.js +1 -3
  50. package/dist/types/index.d.ts +1 -4
  51. package/lib/core/index.js +1 -1
  52. package/lib/effects/index.d.ts +3 -5
  53. package/lib/effects/index.js +1 -17
  54. package/lib/modules/Account/index.js +3 -2
  55. package/lib/modules/AccountList/index.d.ts +1 -7
  56. package/lib/modules/AccountList/index.js +0 -27
  57. package/lib/modules/AccountList/types.d.ts +0 -28
  58. package/lib/modules/BaseModule.d.ts +0 -3
  59. package/lib/modules/BaseModule.js +0 -9
  60. package/lib/modules/Cart/index.d.ts +0 -1
  61. package/lib/modules/Cart/index.js +2 -5
  62. package/lib/modules/Date/types.d.ts +3 -1
  63. package/lib/modules/Discount/index.d.ts +0 -1
  64. package/lib/modules/Discount/index.js +1 -1
  65. package/lib/modules/Guests/index.js +9 -9
  66. package/lib/modules/Order/index.d.ts +1 -25
  67. package/lib/modules/Order/index.js +1 -186
  68. package/lib/modules/Order/types.d.ts +0 -45
  69. package/lib/modules/Order/utils.js +1 -1
  70. package/lib/modules/Payment/index.d.ts +9 -184
  71. package/lib/modules/Payment/index.js +51 -1084
  72. package/lib/modules/Payment/types.d.ts +30 -772
  73. package/lib/modules/Payment/types.js +6 -79
  74. package/lib/modules/ProductList/index.d.ts +1 -12
  75. package/lib/modules/ProductList/index.js +5 -31
  76. package/lib/modules/Resource/index.js +1 -1
  77. package/lib/modules/Rules/index.d.ts +4 -3
  78. package/lib/modules/Rules/index.js +64 -43
  79. package/lib/modules/Rules/types.d.ts +6 -1
  80. package/lib/modules/Rules/types.js +11 -2
  81. package/lib/modules/Schedule/index.d.ts +0 -9
  82. package/lib/modules/Schedule/index.js +0 -60
  83. package/lib/modules/index.d.ts +0 -1
  84. package/lib/modules/index.js +0 -2
  85. package/lib/plugins/window.d.ts +0 -1
  86. package/lib/solution/BookingByStep/index.d.ts +17 -0
  87. package/lib/solution/BookingByStep/index.js +325 -60
  88. package/lib/solution/BookingByStep/utils/products.d.ts +0 -6
  89. package/lib/solution/BookingByStep/utils/products.js +2 -8
  90. package/lib/solution/BookingByStep/utils/resources.js +4 -1
  91. package/lib/solution/BuyTickets/index.js +8 -7
  92. package/lib/solution/ShopDiscount/index.d.ts +12 -10
  93. package/lib/solution/ShopDiscount/index.js +30 -51
  94. package/lib/solution/ShopDiscount/types.d.ts +0 -8
  95. package/lib/solution/index.d.ts +0 -2
  96. package/lib/solution/index.js +1 -5
  97. package/lib/types/index.d.ts +1 -4
  98. package/package.json +1 -3
  99. package/dist/modules/Customer/constants.d.ts +0 -7
  100. package/dist/modules/Customer/constants.js +0 -12
  101. package/dist/modules/Customer/index.d.ts +0 -122
  102. package/dist/modules/Customer/index.js +0 -696
  103. package/dist/modules/Customer/types.d.ts +0 -146
  104. package/dist/modules/Customer/types.js +0 -41
  105. package/dist/modules/Payment/cash.d.ts +0 -19
  106. package/dist/modules/Payment/cash.js +0 -97
  107. package/dist/modules/Payment/cashRecommendationAlgorithm.d.ts +0 -22
  108. package/dist/modules/Payment/cashRecommendationAlgorithm.js +0 -423
  109. package/dist/modules/Payment/eftpos.d.ts +0 -11
  110. package/dist/modules/Payment/eftpos.js +0 -80
  111. package/dist/modules/Payment/mx51.d.ts +0 -0
  112. package/dist/modules/Payment/mx51.js +0 -0
  113. package/dist/modules/Payment/utils.d.ts +0 -17
  114. package/dist/modules/Payment/utils.js +0 -62
  115. package/dist/modules/Payment/walletpass.d.ts +0 -99
  116. package/dist/modules/Payment/walletpass.js +0 -711
  117. package/dist/plugins/app-types/app/app.d.ts +0 -83
  118. package/dist/plugins/app-types/app/const.d.ts +0 -4
  119. package/dist/plugins/app-types/app/index.d.ts +0 -14
  120. package/dist/plugins/app-types/applicationManager/application.d.ts +0 -50
  121. package/dist/plugins/app-types/applicationManager/index.d.ts +0 -13
  122. package/dist/plugins/app-types/config.d.ts +0 -3
  123. package/dist/plugins/app-types/cookie/index.d.ts +0 -13
  124. package/dist/plugins/app-types/data/index.d.ts +0 -8
  125. package/dist/plugins/app-types/history/config.d.ts +0 -24
  126. package/dist/plugins/app-types/history/index.d.ts +0 -20
  127. package/dist/plugins/app-types/history/type.d.ts +0 -2
  128. package/dist/plugins/app-types/hooks/index.d.ts +0 -12
  129. package/dist/plugins/app-types/hooks/useDelayedValue/index.d.ts +0 -2
  130. package/dist/plugins/app-types/hooks/useDispatch/index.d.ts +0 -2
  131. package/dist/plugins/app-types/hooks/useLowCode/index.d.ts +0 -13
  132. package/dist/plugins/app-types/hooks/useStore/index.d.ts +0 -6
  133. package/dist/plugins/app-types/index.d.ts +0 -6
  134. package/dist/plugins/app-types/indexDB/index.d.ts +0 -178
  135. package/dist/plugins/app-types/locales/en.d.ts +0 -3
  136. package/dist/plugins/app-types/locales/index.d.ts +0 -37
  137. package/dist/plugins/app-types/locales/original.d.ts +0 -3
  138. package/dist/plugins/app-types/locales/type.d.ts +0 -19
  139. package/dist/plugins/app-types/locales/zh-CN.d.ts +0 -3
  140. package/dist/plugins/app-types/locales/zh-HK.d.ts +0 -3
  141. package/dist/plugins/app-types/logger/feishu.d.ts +0 -11
  142. package/dist/plugins/app-types/logger/index.d.ts +0 -122
  143. package/dist/plugins/app-types/menuManager/hooks.d.ts +0 -17
  144. package/dist/plugins/app-types/menuManager/index.d.ts +0 -28
  145. package/dist/plugins/app-types/models/global.d.ts +0 -32
  146. package/dist/plugins/app-types/models/index.d.ts +0 -45
  147. package/dist/plugins/app-types/models/type.d.ts +0 -2
  148. package/dist/plugins/app-types/package.json +0 -15
  149. package/dist/plugins/app-types/plugin/index.d.ts +0 -0
  150. package/dist/plugins/app-types/pubsub/example.d.ts +0 -5
  151. package/dist/plugins/app-types/pubsub/index.d.ts +0 -63
  152. package/dist/plugins/app-types/request/cache.d.ts +0 -46
  153. package/dist/plugins/app-types/request/cancelToken.d.ts +0 -38
  154. package/dist/plugins/app-types/request/config.d.ts +0 -3
  155. package/dist/plugins/app-types/request/constants.d.ts +0 -2
  156. package/dist/plugins/app-types/request/index.d.ts +0 -24
  157. package/dist/plugins/app-types/request/pisell2Request.d.ts +0 -6
  158. package/dist/plugins/app-types/request/type.d.ts +0 -41
  159. package/dist/plugins/app-types/request/utils.d.ts +0 -46
  160. package/dist/plugins/app-types/routes/config.d.ts +0 -7
  161. package/dist/plugins/app-types/routes/index.d.ts +0 -28
  162. package/dist/plugins/app-types/socket/components/SocketMonitorPage.d.ts +0 -6
  163. package/dist/plugins/app-types/socket/components/index.d.ts +0 -2
  164. package/dist/plugins/app-types/socket/constants.d.ts +0 -33
  165. package/dist/plugins/app-types/socket/events.d.ts +0 -31
  166. package/dist/plugins/app-types/socket/heartbeat.d.ts +0 -66
  167. package/dist/plugins/app-types/socket/index.d.ts +0 -61
  168. package/dist/plugins/app-types/socket/monitor.d.ts +0 -169
  169. package/dist/plugins/app-types/socket/reconnect.d.ts +0 -61
  170. package/dist/plugins/app-types/socket/socket.d.ts +0 -129
  171. package/dist/plugins/app-types/socket/types.d.ts +0 -85
  172. package/dist/plugins/app-types/storage/index.d.ts +0 -17
  173. package/dist/plugins/app-types/tasks/index.d.ts +0 -77
  174. package/dist/plugins/app-types/tasks/type.d.ts +0 -62
  175. package/dist/plugins/app-types/tasks/useTasks.d.ts +0 -5
  176. package/dist/plugins/app-types/type.d.ts +0 -2
  177. package/dist/plugins/app-types/variables/VariablesProvider.d.ts +0 -7
  178. package/dist/plugins/app-types/variables/config.d.ts +0 -3
  179. package/dist/plugins/app-types/variables/index.d.ts +0 -6
  180. package/dist/plugins/app-types/variables/type.d.ts +0 -2
  181. package/dist/plugins/app-types/website/index.d.ts +0 -6
  182. package/dist/plugins/app.d.ts +0 -8
  183. package/dist/plugins/app.js +0 -1
  184. package/dist/solution/BookingTicket/index.d.ts +0 -184
  185. package/dist/solution/BookingTicket/index.js +0 -698
  186. package/dist/solution/BookingTicket/types.d.ts +0 -68
  187. package/dist/solution/BookingTicket/types.js +0 -43
  188. package/dist/solution/BookingTicket/utils/scan/cloudSearch.d.ts +0 -22
  189. package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +0 -159
  190. package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +0 -22
  191. package/dist/solution/BookingTicket/utils/scan/handleScan.js +0 -189
  192. package/dist/solution/BookingTicket/utils/scan/index.d.ts +0 -85
  193. package/dist/solution/BookingTicket/utils/scan/index.js +0 -294
  194. package/dist/solution/BookingTicket/utils/scan/scanCache.d.ts +0 -78
  195. package/dist/solution/BookingTicket/utils/scan/scanCache.js +0 -305
  196. package/dist/solution/Checkout/appointmentDemo.json +0 -1
  197. package/dist/solution/Checkout/index.d.ts +0 -432
  198. package/dist/solution/Checkout/index.js +0 -4452
  199. package/dist/solution/Checkout/types.d.ts +0 -727
  200. package/dist/solution/Checkout/types.js +0 -104
  201. package/dist/solution/Checkout/utils/index.d.ts +0 -121
  202. package/dist/solution/Checkout/utils/index.js +0 -511
  203. package/dist/utils/task.d.ts +0 -40
  204. package/dist/utils/task.js +0 -171
  205. package/dist/utils/watch.d.ts +0 -102
  206. package/dist/utils/watch.js +0 -294
  207. package/lib/modules/Customer/constants.d.ts +0 -7
  208. package/lib/modules/Customer/constants.js +0 -39
  209. package/lib/modules/Customer/index.d.ts +0 -122
  210. package/lib/modules/Customer/index.js +0 -439
  211. package/lib/modules/Customer/types.d.ts +0 -146
  212. package/lib/modules/Customer/types.js +0 -37
  213. package/lib/modules/Payment/cash.d.ts +0 -19
  214. package/lib/modules/Payment/cash.js +0 -64
  215. package/lib/modules/Payment/cashRecommendationAlgorithm.d.ts +0 -22
  216. package/lib/modules/Payment/cashRecommendationAlgorithm.js +0 -342
  217. package/lib/modules/Payment/eftpos.d.ts +0 -11
  218. package/lib/modules/Payment/eftpos.js +0 -51
  219. package/lib/modules/Payment/mx51.d.ts +0 -0
  220. package/lib/modules/Payment/mx51.js +0 -0
  221. package/lib/modules/Payment/utils.d.ts +0 -17
  222. package/lib/modules/Payment/utils.js +0 -67
  223. package/lib/modules/Payment/walletpass.d.ts +0 -99
  224. package/lib/modules/Payment/walletpass.js +0 -484
  225. package/lib/plugins/app-types/app/app.d.ts +0 -83
  226. package/lib/plugins/app-types/app/const.d.ts +0 -4
  227. package/lib/plugins/app-types/app/index.d.ts +0 -14
  228. package/lib/plugins/app-types/applicationManager/application.d.ts +0 -50
  229. package/lib/plugins/app-types/applicationManager/index.d.ts +0 -13
  230. package/lib/plugins/app-types/config.d.ts +0 -3
  231. package/lib/plugins/app-types/cookie/index.d.ts +0 -13
  232. package/lib/plugins/app-types/data/index.d.ts +0 -8
  233. package/lib/plugins/app-types/history/config.d.ts +0 -24
  234. package/lib/plugins/app-types/history/index.d.ts +0 -20
  235. package/lib/plugins/app-types/history/type.d.ts +0 -2
  236. package/lib/plugins/app-types/hooks/index.d.ts +0 -12
  237. package/lib/plugins/app-types/hooks/useDelayedValue/index.d.ts +0 -2
  238. package/lib/plugins/app-types/hooks/useDispatch/index.d.ts +0 -2
  239. package/lib/plugins/app-types/hooks/useLowCode/index.d.ts +0 -13
  240. package/lib/plugins/app-types/hooks/useStore/index.d.ts +0 -6
  241. package/lib/plugins/app-types/index.d.ts +0 -6
  242. package/lib/plugins/app-types/indexDB/index.d.ts +0 -178
  243. package/lib/plugins/app-types/locales/en.d.ts +0 -3
  244. package/lib/plugins/app-types/locales/index.d.ts +0 -37
  245. package/lib/plugins/app-types/locales/original.d.ts +0 -3
  246. package/lib/plugins/app-types/locales/type.d.ts +0 -19
  247. package/lib/plugins/app-types/locales/zh-CN.d.ts +0 -3
  248. package/lib/plugins/app-types/locales/zh-HK.d.ts +0 -3
  249. package/lib/plugins/app-types/logger/feishu.d.ts +0 -11
  250. package/lib/plugins/app-types/logger/index.d.ts +0 -122
  251. package/lib/plugins/app-types/menuManager/hooks.d.ts +0 -17
  252. package/lib/plugins/app-types/menuManager/index.d.ts +0 -28
  253. package/lib/plugins/app-types/models/global.d.ts +0 -32
  254. package/lib/plugins/app-types/models/index.d.ts +0 -45
  255. package/lib/plugins/app-types/models/type.d.ts +0 -2
  256. package/lib/plugins/app-types/package.json +0 -15
  257. package/lib/plugins/app-types/plugin/index.d.ts +0 -0
  258. package/lib/plugins/app-types/pubsub/example.d.ts +0 -5
  259. package/lib/plugins/app-types/pubsub/index.d.ts +0 -63
  260. package/lib/plugins/app-types/request/cache.d.ts +0 -46
  261. package/lib/plugins/app-types/request/cancelToken.d.ts +0 -38
  262. package/lib/plugins/app-types/request/config.d.ts +0 -3
  263. package/lib/plugins/app-types/request/constants.d.ts +0 -2
  264. package/lib/plugins/app-types/request/index.d.ts +0 -24
  265. package/lib/plugins/app-types/request/pisell2Request.d.ts +0 -6
  266. package/lib/plugins/app-types/request/type.d.ts +0 -41
  267. package/lib/plugins/app-types/request/utils.d.ts +0 -46
  268. package/lib/plugins/app-types/routes/config.d.ts +0 -7
  269. package/lib/plugins/app-types/routes/index.d.ts +0 -28
  270. package/lib/plugins/app-types/socket/components/SocketMonitorPage.d.ts +0 -6
  271. package/lib/plugins/app-types/socket/components/index.d.ts +0 -2
  272. package/lib/plugins/app-types/socket/constants.d.ts +0 -33
  273. package/lib/plugins/app-types/socket/events.d.ts +0 -31
  274. package/lib/plugins/app-types/socket/heartbeat.d.ts +0 -66
  275. package/lib/plugins/app-types/socket/index.d.ts +0 -61
  276. package/lib/plugins/app-types/socket/monitor.d.ts +0 -169
  277. package/lib/plugins/app-types/socket/reconnect.d.ts +0 -61
  278. package/lib/plugins/app-types/socket/socket.d.ts +0 -129
  279. package/lib/plugins/app-types/socket/types.d.ts +0 -85
  280. package/lib/plugins/app-types/storage/index.d.ts +0 -17
  281. package/lib/plugins/app-types/tasks/index.d.ts +0 -77
  282. package/lib/plugins/app-types/tasks/type.d.ts +0 -62
  283. package/lib/plugins/app-types/tasks/useTasks.d.ts +0 -5
  284. package/lib/plugins/app-types/type.d.ts +0 -2
  285. package/lib/plugins/app-types/variables/VariablesProvider.d.ts +0 -7
  286. package/lib/plugins/app-types/variables/config.d.ts +0 -3
  287. package/lib/plugins/app-types/variables/index.d.ts +0 -6
  288. package/lib/plugins/app-types/variables/type.d.ts +0 -2
  289. package/lib/plugins/app-types/website/index.d.ts +0 -6
  290. package/lib/plugins/app.d.ts +0 -8
  291. package/lib/plugins/app.js +0 -17
  292. package/lib/solution/BookingTicket/index.d.ts +0 -184
  293. package/lib/solution/BookingTicket/index.js +0 -426
  294. package/lib/solution/BookingTicket/types.d.ts +0 -68
  295. package/lib/solution/BookingTicket/types.js +0 -72
  296. package/lib/solution/BookingTicket/utils/scan/cloudSearch.d.ts +0 -22
  297. package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +0 -117
  298. package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +0 -22
  299. package/lib/solution/BookingTicket/utils/scan/handleScan.js +0 -132
  300. package/lib/solution/BookingTicket/utils/scan/index.d.ts +0 -85
  301. package/lib/solution/BookingTicket/utils/scan/index.js +0 -216
  302. package/lib/solution/BookingTicket/utils/scan/scanCache.d.ts +0 -78
  303. package/lib/solution/BookingTicket/utils/scan/scanCache.js +0 -231
  304. package/lib/solution/Checkout/appointmentDemo.json +0 -1
  305. package/lib/solution/Checkout/index.d.ts +0 -432
  306. package/lib/solution/Checkout/index.js +0 -2776
  307. package/lib/solution/Checkout/types.d.ts +0 -727
  308. package/lib/solution/Checkout/types.js +0 -63
  309. package/lib/solution/Checkout/utils/index.d.ts +0 -121
  310. package/lib/solution/Checkout/utils/index.js +0 -362
  311. package/lib/utils/task.d.ts +0 -40
  312. package/lib/utils/task.js +0 -109
  313. package/lib/utils/watch.d.ts +0 -102
  314. package/lib/utils/watch.js +0 -217
@@ -26,45 +26,30 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
26
26
  import { BaseModule } from "../BaseModule";
27
27
  import { generateDuration, getAllDiscountList, mergeRelationForms } from "./utils";
28
28
  import { isNormalProduct } from "../Product/utils";
29
- import dayjs from 'dayjs';
30
29
  export var OrderModule = /*#__PURE__*/function (_BaseModule) {
31
30
  _inherits(OrderModule, _BaseModule);
32
31
  var _super = _createSuper(OrderModule);
33
- // LoggerManager 实例
34
-
35
32
  function OrderModule(name, version) {
36
33
  var _this;
37
34
  _classCallCheck(this, OrderModule);
38
- _this = _super.call(this, name || "order", version);
35
+ _this = _super.call(this, name, version);
39
36
  _defineProperty(_assertThisInitialized(_this), "defaultName", 'order');
40
37
  _defineProperty(_assertThisInitialized(_this), "defaultVersion", '1.0.0');
41
38
  _defineProperty(_assertThisInitialized(_this), "store", void 0);
42
39
  _defineProperty(_assertThisInitialized(_this), "request", void 0);
43
- _defineProperty(_assertThisInitialized(_this), "logger", void 0);
44
40
  return _this;
45
41
  }
46
42
  _createClass(OrderModule, [{
47
43
  key: "initialize",
48
44
  value: function () {
49
45
  var _initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(core, options) {
50
- var appPlugin, app;
51
46
  return _regeneratorRuntime().wrap(function _callee$(_context) {
52
47
  while (1) switch (_context.prev = _context.next) {
53
48
  case 0:
54
49
  this.core = core;
55
50
  this.store = options.store;
56
51
  this.request = this.core.getPlugin('request');
57
- appPlugin = this.core.getPlugin('app');
58
- if (appPlugin) {
59
- _context.next = 6;
60
- break;
61
- }
62
- throw new Error('Order 模块需要 app 插件支持');
63
- case 6:
64
- app = appPlugin.getApp();
65
- this.logger = app.logger;
66
- this.logInfo('OrderModule initialized successfully');
67
- case 9:
52
+ case 3:
68
53
  case "end":
69
54
  return _context.stop();
70
55
  }
@@ -75,50 +60,6 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
75
60
  }
76
61
  return initialize;
77
62
  }()
78
- /**
79
- * 记录信息日志
80
- */
81
- }, {
82
- key: "logInfo",
83
- value: function logInfo(title, metadata) {
84
- if (this.logger) {
85
- this.logger.addLog({
86
- type: 'info',
87
- title: "[OrderModule] ".concat(title),
88
- metadata: metadata || {}
89
- });
90
- }
91
- }
92
-
93
- /**
94
- * 记录警告日志
95
- */
96
- }, {
97
- key: "logWarning",
98
- value: function logWarning(title, metadata) {
99
- if (this.logger) {
100
- this.logger.addLog({
101
- type: 'warning',
102
- title: "[OrderModule] ".concat(title),
103
- metadata: metadata || {}
104
- });
105
- }
106
- }
107
-
108
- /**
109
- * 记录错误日志
110
- */
111
- }, {
112
- key: "logError",
113
- value: function logError(title, metadata) {
114
- if (this.logger) {
115
- this.logger.addLog({
116
- type: 'error',
117
- title: "[OrderModule] ".concat(title),
118
- metadata: metadata || {}
119
- });
120
- }
121
- }
122
63
  }, {
123
64
  key: "createOrder",
124
65
  value: function createOrder(params) {
@@ -181,11 +122,6 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
181
122
  }, {
182
123
  key: "checkBeforeSubmitOrder",
183
124
  value: function checkBeforeSubmitOrder(params) {
184
- var _params$cartItems;
185
- this.logInfo('checkBeforeSubmitOrder called', {
186
- cartItemsCount: ((_params$cartItems = params.cartItems) === null || _params$cartItems === void 0 ? void 0 : _params$cartItems.length) || 0,
187
- type: params.type
188
- });
189
125
  var cartItems = params.cartItems,
190
126
  type = params.type;
191
127
  if (type === 'holder') {
@@ -203,31 +139,15 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
203
139
  key: "submitOrder",
204
140
  value: function () {
205
141
  var _submitOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(order) {
206
- var _order$query$cartItem, _params$bookings, _params$relation_prod;
207
142
  var url, query, fetchUrl, params;
208
143
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
209
144
  while (1) switch (_context2.prev = _context2.next) {
210
145
  case 0:
211
- this.logInfo('submitOrder called', {
212
- url: order.url,
213
- orderType: order.query.type,
214
- platform: order.query.platform,
215
- cartItemsCount: ((_order$query$cartItem = order.query.cartItems) === null || _order$query$cartItem === void 0 ? void 0 : _order$query$cartItem.length) || 0
216
- });
217
146
  url = order.url, query = order.query;
218
147
  fetchUrl = url || '/order/appointment';
219
148
  params = this.createOrder(query);
220
- this.logInfo('Calling backend order API', {
221
- url: fetchUrl,
222
- orderType: params.type,
223
- platform: params.platform,
224
- isDeposit: params.is_deposit,
225
- bookingsCount: ((_params$bookings = params.bookings) === null || _params$bookings === void 0 ? void 0 : _params$bookings.length) || 0,
226
- relationProductsCount: ((_params$relation_prod = params.relation_products) === null || _params$relation_prod === void 0 ? void 0 : _params$relation_prod.length) || 0,
227
- scheduleDate: params.schedule_date
228
- });
229
149
  return _context2.abrupt("return", this.request.post(fetchUrl, params));
230
- case 6:
150
+ case 4:
231
151
  case "end":
232
152
  return _context2.stop();
233
153
  }
@@ -238,147 +158,6 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
238
158
  }
239
159
  return submitOrder;
240
160
  }()
241
- /**
242
- * Checkout 专用:创建订单到后端
243
- *
244
- * 专门为 Checkout 模块设计的订单创建方法,
245
- * 直接调用 /order/checkout 接口创建订单
246
- * 接收已经处理好的订单数据,无需再处理购物车
247
- *
248
- * @param params Checkout 订单参数(已处理的订单数据)
249
- * @returns 后端返回的订单数据(包含订单ID等)
250
- */
251
- }, {
252
- key: "createOrderByCheckout",
253
- value: (function () {
254
- var _createOrderByCheckout = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(params) {
255
- var _params$bookings2, _params$relation_prod2, _params$payments, _params$payments2, _params$bookings3, _params$relation_prod3, _params$payments3;
256
- var _orderData$payments, _orderData$bookings, _orderData$relation_p, _orderData$payments2, _orderData$payments3, _orderData$bookings2, _orderData$relation_p2, _orderData$payments4, _orderData$payments5, _response$data, orderData, response;
257
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
258
- while (1) switch (_context3.prev = _context3.next) {
259
- case 0:
260
- this.logInfo('createOrderByCheckout called', {
261
- type: params.type,
262
- platform: params.platform,
263
- is_deposit: params.is_deposit,
264
- customer_id: params.customer_id,
265
- bookingsCount: ((_params$bookings2 = params.bookings) === null || _params$bookings2 === void 0 ? void 0 : _params$bookings2.length) || 0,
266
- relationProductsCount: ((_params$relation_prod2 = params.relation_products) === null || _params$relation_prod2 === void 0 ? void 0 : _params$relation_prod2.length) || 0,
267
- paymentsCount: ((_params$payments = params.payments) === null || _params$payments === void 0 ? void 0 : _params$payments.length) || 0,
268
- depositAmount: params.deposit_amount,
269
- productTaxFee: params.product_tax_fee,
270
- note: params.note,
271
- scheduleDate: params.schedule_date,
272
- hasOrderId: !!params.order_id,
273
- orderIdIncluded: params.order_id,
274
- paymentMethods: ((_params$payments2 = params.payments) === null || _params$payments2 === void 0 ? void 0 : _params$payments2.map(function (p) {
275
- return p.code;
276
- })) || []
277
- });
278
- console.log('[Order] createOrderByCheckout 开始创建订单:', {
279
- type: params.type,
280
- platform: params.platform,
281
- is_deposit: params.is_deposit,
282
- customer_id: params.customer_id,
283
- bookingsCount: ((_params$bookings3 = params.bookings) === null || _params$bookings3 === void 0 ? void 0 : _params$bookings3.length) || 0,
284
- relationProductsCount: ((_params$relation_prod3 = params.relation_products) === null || _params$relation_prod3 === void 0 ? void 0 : _params$relation_prod3.length) || 0,
285
- paymentsCount: ((_params$payments3 = params.payments) === null || _params$payments3 === void 0 ? void 0 : _params$payments3.length) || 0
286
- });
287
- _context3.prev = 2;
288
- // 构建订单数据,设置默认值并允许 params 覆盖
289
- orderData = _objectSpread({
290
- sales_channel: 'my_pisel',
291
- order_sales_channel: 'online_store',
292
- shop_note: '',
293
- schedule_date: '',
294
- is_deposit: 0,
295
- bookings: [],
296
- relation_products: [],
297
- relation_forms: [],
298
- payments: [],
299
- is_full_overwrite_flag: 1
300
- }, params);
301
- if ((_orderData$payments = orderData.payments) !== null && _orderData$payments !== void 0 && _orderData$payments.length) {
302
- orderData.small_ticket_data_flag = 1;
303
- }
304
-
305
- // 兜底策略,如果是第一次下单,没有 order_id,且没有 schedule_date,则设置为当前时间
306
- if (!params.order_id && !orderData.schedule_date) {
307
- orderData.schedule_date = dayjs().format('YYYY-MM-DD HH:mm:ss');
308
- }
309
- console.log('[Order] 调用后端接口创建订单:', {
310
- url: '/order/checkout',
311
- orderType: orderData.type,
312
- platform: orderData.platform,
313
- isDeposit: orderData.is_deposit,
314
- customerId: orderData.customer_id,
315
- bookingsCount: ((_orderData$bookings = orderData.bookings) === null || _orderData$bookings === void 0 ? void 0 : _orderData$bookings.length) || 0,
316
- relationProductsCount: ((_orderData$relation_p = orderData.relation_products) === null || _orderData$relation_p === void 0 ? void 0 : _orderData$relation_p.length) || 0,
317
- paymentsCount: ((_orderData$payments2 = orderData.payments) === null || _orderData$payments2 === void 0 ? void 0 : _orderData$payments2.length) || 0,
318
- paymentsMethods: ((_orderData$payments3 = orderData.payments) === null || _orderData$payments3 === void 0 ? void 0 : _orderData$payments3.map(function (p) {
319
- return p.code;
320
- })) || []
321
- });
322
-
323
- // 记录接口调用详情
324
- this.logInfo('Calling backend checkout API', {
325
- url: '/order/checkout',
326
- orderType: orderData.type,
327
- platform: orderData.platform,
328
- isDeposit: orderData.is_deposit,
329
- customerId: orderData.customer_id,
330
- depositAmount: orderData.deposit_amount,
331
- bookingsCount: ((_orderData$bookings2 = orderData.bookings) === null || _orderData$bookings2 === void 0 ? void 0 : _orderData$bookings2.length) || 0,
332
- relationProductsCount: ((_orderData$relation_p2 = orderData.relation_products) === null || _orderData$relation_p2 === void 0 ? void 0 : _orderData$relation_p2.length) || 0,
333
- paymentsCount: ((_orderData$payments4 = orderData.payments) === null || _orderData$payments4 === void 0 ? void 0 : _orderData$payments4.length) || 0,
334
- paymentMethods: ((_orderData$payments5 = orderData.payments) === null || _orderData$payments5 === void 0 ? void 0 : _orderData$payments5.map(function (p) {
335
- return {
336
- code: p.code,
337
- amount: p.amount,
338
- type: p.type,
339
- hasVoucherId: !!p.voucher_id,
340
- orderPaymentType: p.order_payment_type
341
- };
342
- })) || [],
343
- productTaxFee: orderData.product_tax_fee,
344
- note: orderData.note,
345
- scheduleDate: orderData.schedule_date,
346
- hasOrderId: !!orderData.order_id,
347
- smallTicketDataFlag: orderData.small_ticket_data_flag
348
- });
349
-
350
- // 调用后端接口
351
- _context3.next = 10;
352
- return this.request.post('/order/checkout', orderData);
353
- case 10:
354
- response = _context3.sent;
355
- this.logInfo('Order API called successfully', {
356
- response: response
357
- });
358
- console.log('[Order] 订单创建成功,后端响应:', {
359
- success: !!response,
360
- hasOrderId: !!(response !== null && response !== void 0 && (_response$data = response.data) !== null && _response$data !== void 0 && _response$data.order_id || response !== null && response !== void 0 && response.order_id)
361
- });
362
- return _context3.abrupt("return", response);
363
- case 16:
364
- _context3.prev = 16;
365
- _context3.t0 = _context3["catch"](2);
366
- console.error('[Order] createOrderByCheckout 创建订单失败:', _context3.t0);
367
- this.logInfo('Order API called failed', {
368
- error: _context3.t0 instanceof Error ? _context3.t0.message : String(_context3.t0)
369
- });
370
- throw _context3.t0;
371
- case 21:
372
- case "end":
373
- return _context3.stop();
374
- }
375
- }, _callee3, this, [[2, 16]]);
376
- }));
377
- function createOrderByCheckout(_x4) {
378
- return _createOrderByCheckout.apply(this, arguments);
379
- }
380
- return createOrderByCheckout;
381
- }())
382
161
  }]);
383
162
  return OrderModule;
384
163
  }(BaseModule);
@@ -19,45 +19,6 @@ export interface CommitOrderParams {
19
19
  extraData?: Record<string, any>;
20
20
  };
21
21
  }
22
- /**
23
- * 支付项数据
24
- */
25
- export interface PaymentItemData {
26
- /** 当前支付项的唯一 ID */
27
- uuid: string;
28
- /** 当前支付方式付出去多少钱 */
29
- amount: string;
30
- /** 支付类型代码 */
31
- code: string;
32
- /** 支付类型id */
33
- id: number;
34
- /** 支付类型名称 */
35
- name: string;
36
- /** 支付类型 */
37
- type: string;
38
- /** 是否已同步到后端 */
39
- isSynced?: boolean;
40
- }
41
- /**
42
- * Checkout 专用订单创建参数
43
- */
44
- export interface CheckoutOrderParams {
45
- type: 'virtual' | 'appointment_booking';
46
- platform: 'PC' | 'H5';
47
- sales_channel?: string;
48
- order_sales_channel?: string;
49
- bookings?: any[];
50
- shop_note?: string;
51
- schedule_date?: string;
52
- is_deposit?: number;
53
- relation_products?: any[];
54
- relation_forms?: any[];
55
- payments?: PaymentItemData[];
56
- customer_id?: string;
57
- /** 小票数据标记,当有支付项时设置为1 */
58
- small_ticket_data_flag?: number;
59
- [key: string]: any;
60
- }
61
22
  /**
62
23
  * 订单模块 API
63
24
  */
@@ -80,10 +41,4 @@ export interface OrderModuleAPI {
80
41
  * @param params 订单信息
81
42
  */
82
43
  submitOrder: (params: CommitOrderParams) => Promise<void>;
83
- /**
84
- * Checkout 专用:创建订单到后端
85
- * @param params 订单参数
86
- * @returns 后端返回的订单数据
87
- */
88
- createOrderByCheckout: (params: CheckoutOrderParams) => Promise<any>;
89
44
  }
@@ -10,14 +10,6 @@ export var OrderHooks = /*#__PURE__*/function (OrderHooks) {
10
10
  * 订单信息
11
11
  */
12
12
 
13
- /**
14
- * 支付项数据
15
- */
16
-
17
- /**
18
- * Checkout 专用订单创建参数
19
- */
20
-
21
13
  /**
22
14
  * 订单模块 API
23
15
  */
@@ -56,7 +56,7 @@ export var getAllDiscountList = function getAllDiscountList(cartItem) {
56
56
  var _cartItem$_origin, _cartItem$_origin2;
57
57
  var discountList = (cartItem === null || cartItem === void 0 || (_cartItem$_origin = cartItem._origin) === null || _cartItem$_origin === void 0 || (_cartItem$_origin = _cartItem$_origin.product) === null || _cartItem$_origin === void 0 ? void 0 : _cartItem$_origin.discount_list) || [];
58
58
  ((cartItem === null || cartItem === void 0 || (_cartItem$_origin2 = cartItem._origin) === null || _cartItem$_origin2 === void 0 || (_cartItem$_origin2 = _cartItem$_origin2.product) === null || _cartItem$_origin2 === void 0 ? void 0 : _cartItem$_origin2.product_bundle) || []).forEach(function (item) {
59
- discountList = [].concat(_toConsumableArray(discountList), _toConsumableArray((item === null || item === void 0 ? void 0 : item.discount_list) || []));
59
+ discountList = [].concat(_toConsumableArray(discountList), _toConsumableArray(item.discount_list || []));
60
60
  item.discount_list = undefined;
61
61
  });
62
62
  return discountList;
@@ -1,191 +1,16 @@
1
1
  import { Module, PisellCore, ModuleOptions } from '../../types';
2
- import { RequestPlugin } from '../../plugins';
3
2
  import { BaseModule } from '../BaseModule';
4
- import { PaymentModuleAPI, PaymentMethod, PaymentOrder, PaymentItem, PaymentItemInput, PaymentUpdateFields, PushOrderParams, CashPayment, EftposPayment, WalletPassPayment, RoundingRule, RoundingInterval, RoundingResult } from './types';
5
- export * from './types';
6
- export { generateRequestUniqueId };
7
- /**
8
- * 生成请求唯一ID
9
- * 格式: 年月日时分秒毫秒+4位随机数
10
- * 示例: 20241201143025123456
11
- */
12
- declare function generateRequestUniqueId(): string;
13
- /**
14
- * 支付模块实现
15
- *
16
- * 负责处理支付相关的数据管理和本地存储
17
- */
3
+ import { Payment, PaymentModuleAPI, PaymentMethod, PaymentStatus } from './types';
18
4
  export declare class PaymentModule extends BaseModule implements Module, PaymentModuleAPI {
19
5
  protected defaultName: string;
20
6
  protected defaultVersion: string;
21
- request: RequestPlugin;
22
- private app;
23
- private store;
24
- private dbManager;
25
- private logger;
26
- protected otherParams: any;
27
- cash: CashPayment;
28
- eftpos: EftposPayment;
29
- wallet: WalletPassPayment;
7
+ private state;
30
8
  constructor(name?: string, version?: string);
31
- initialize(core: PisellCore, options: ModuleOptions): Promise<void>;
32
- /**
33
- * 记录信息日志
34
- */
35
- logInfo(title: string, metadata?: any): void;
36
- /**
37
- * 记录警告日志
38
- */
39
- logWarning(title: string, metadata?: any): void;
40
- /**
41
- * 记录错误日志
42
- */
43
- logError(title: string, error?: any, metadata?: any): void;
44
- /**
45
- * 记录调试日志
46
- */
47
- logDebug(title: string, metadata?: any): void;
48
- /**
49
- * 网络恢复以后,尝试执行队列
50
- *
51
- */
52
- private registerNetworkHandlers;
53
- /**
54
- * 获取支付方式列表
55
- */
56
- getPayMethodListAsync(): Promise<PaymentMethod[]>;
57
- /**
58
- * 后台刷新支付方式列表
59
- */
60
- private refreshPaymentMethodsInBackground;
61
- /**
62
- * 检查支付方式列表是否有变化
63
- */
64
- private hasPaymentMethodsChanged;
65
- /**
66
- * 获取订单列表
67
- */
68
- getOrderListAsync(): Promise<PaymentOrder[]>;
69
- /**
70
- * 根据订单UUID获取支付订单(新方法)
71
- */
72
- getPaymentOrderByUuidAsync(orderUuid: string): Promise<PaymentOrder | null>;
73
- /**
74
- * 创建支付订单(新方法,专注支付数据)
75
- */
76
- createPaymentOrderAsync(params: PushOrderParams): Promise<PaymentOrder>;
77
- /**
78
- * 删除支付订单(新方法)
79
- */
80
- deletePaymentOrderAsync(orderUuid: string): Promise<void>;
81
- /**
82
- * 更新订单
83
- */
84
- updateOrderAsync(orderUuid: string, params: Partial<PaymentOrder>): Promise<void>;
85
- /**
86
- * 基于UUID替换订单ID
87
- *
88
- * 此方法用于将本地虚拟订单ID替换为真实的订单ID。
89
- * 当前端模拟下单流程完成后,后端返回真实订单ID时调用此方法。
90
- *
91
- * @param orderUuid 订单的UUID
92
- * @param newOrderId 新的订单ID (来自后端)
93
- * @returns 更新后的订单对象,如果订单不存在则返回null
94
- */
95
- replaceOrderIdByUuidAsync(orderUuid: string, newOrderId: string): Promise<PaymentOrder | null>;
96
- /**
97
- * 获取支付项(新方法)
98
- *
99
- * @param orderUuid 订单UUID
100
- * @param includeVoided 是否包含已撤销的支付项,默认为false
101
- * @returns 支付项数组
102
- */
103
- getPaymentItemsAsync(orderUuid: string, includeVoided?: boolean): Promise<PaymentItem[]>;
104
- /**
105
- * 获取所有支付项(包括已撤销的)
106
- *
107
- * @param orderUuid 订单UUID
108
- * @returns 所有支付项数组(包括撤销的)
109
- */
110
- getAllPaymentItemsAsync(orderUuid: string): Promise<PaymentItem[]>;
111
- /**
112
- * 为某个订单添加支付项(新方法)
113
- */
114
- addPaymentItemAsync(orderUuid: string, paymentItem: PaymentItemInput): Promise<void>;
115
- /**
116
- * 删除一个支付项 - 标记删除而非物理删除
117
- */
118
- deletePaymentAsync(orderUuid: string, paymentUuid: string): Promise<void>;
119
- /**
120
- * 批量更新代金券类支付项(覆盖更新)
121
- *
122
- * 删除所有现有的带 voucher_id 的支付项,然后添加新的代金券支付项
123
- * 这是一个覆盖式更新,确保代金券支付项的一致性
124
- */
125
- updateVoucherPaymentItemsAsync(orderUuid: string, voucherPaymentItems: PaymentItemInput[]): Promise<void>;
126
- /**
127
- * 更新一个支付项
128
- */
129
- updatePaymentAsync(orderUuid: string, paymentUuid: string, params: PaymentUpdateFields): Promise<void>;
130
- /**
131
- * 提交支付
132
- */
133
- submitPayAsync(orderUuid?: string): Promise<{
134
- status: 'success' | 'failed';
135
- }>;
136
- /**
137
- * 提交单个订单的支付(推送到任务队列)
138
- */
139
- private submitSingleOrderPayment;
140
- /**
141
- * 获取订单剩余待付金额
142
- */
143
- getRemainingOrderAmountAsync(orderUuid: string): Promise<number>;
144
- /**
145
- * 在比如现金支付界面的地方,用户输入了一个金额,在下方显示剩余多少金额,通过此方法获取
146
- */
147
- getRemainingOrderAmountWithInputAsync(inputAmount: string | number, orderUuid: string): Promise<number>;
148
- /**
149
- * 重新计算订单金额
150
- */
151
- private recalculateOrderAmount;
152
- /**
153
- * 获取现金支付方式
154
- */
155
- getCashPaymentMethod(): Promise<PaymentMethod | null>;
156
- /**
157
- * 获取Eftpos支付方式
158
- */
159
- getEftposPaymentMethod(): Promise<PaymentMethod | null>;
160
- /**
161
- * 获取钱包支付方式
162
- */
163
- getWalletPaymentMethod(): Promise<PaymentMethod | null>;
164
- /**
165
- * 确保支付模块所需的数据库表已创建
166
- */
167
- private ensurePaymentTables;
168
- /**
169
- * 获取部分支付的订单
170
- */
171
- getPartiallyPaidOrdersAsync(): Promise<PaymentOrder[]>;
172
- /**
173
- * 智能金额舍入
174
- *
175
- * 根据指定的舍入间隔和规则对金额进行舍入处理
176
- *
177
- * @param originalAmount 原始金额
178
- * @param interval 舍入间隔 (0.05, 0.1, 0.5, 1)
179
- * @param rule 舍入规则 (standard, standard_down, always_up, always_down)
180
- * @returns 舍入结果详情(包含原始金额、舍入后金额和舍入差额)
181
- */
182
- roundAmountAsync(originalAmount: number | string, interval: RoundingInterval | number, rule: RoundingRule | string): Promise<RoundingResult>;
183
- /**
184
- * 标准舍入处理(处理中点情况)
185
- *
186
- * @param value 要舍入的值
187
- * @param midpointUp 中点是否向上舍入
188
- * @returns 舍入后的值
189
- */
190
- private standardRound;
9
+ initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
10
+ processPayment(paymentId: string): Promise<void>;
11
+ getPayment(paymentId: string): Promise<Payment>;
12
+ getPaymentHistory(): Promise<Payment[]>;
13
+ refund(paymentId: string): Promise<void>;
14
+ getAvailablePaymentMethods(): PaymentMethod[];
15
+ checkPaymentStatus(paymentId: string): Promise<PaymentStatus>;
191
16
  }