@pisell/private-materials 3.3.87 → 3.3.88

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 (253) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +1 -1
  6. package/build/lowcode/preview.js +8 -8
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +11 -11
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +11 -11
  11. package/es/businessModel/SalesModel/Sales/index.js +4 -37
  12. package/es/components/Sales/Cart/index.js +1 -5
  13. package/es/components/Sales/Cart/utils.d.ts +0 -40
  14. package/es/components/Sales/Cart/utils.js +0 -167
  15. package/es/components/Sales/Checkout/index.d.ts +0 -4
  16. package/es/components/Sales/Checkout/index.js +8 -52
  17. package/es/components/Sales/Checkout/serve.d.ts +0 -13
  18. package/es/components/Sales/Checkout/serve.js +2 -16
  19. package/es/components/Sales/Checkout/utils.js +1 -7
  20. package/es/components/Sales/Resource/index.js +2 -2
  21. package/es/components/Sales/Resource/serve.d.ts +0 -7
  22. package/es/components/Sales/Resource/serve.js +0 -10
  23. package/es/components/Sales/Summary/index.d.ts +0 -10
  24. package/es/components/Sales/Summary/index.js +2 -17
  25. package/es/components/Sales/Summary/serve.d.ts +0 -1
  26. package/es/components/Sales/Summary/serve.js +0 -6
  27. package/es/components/Sales/Summary/utils.d.ts +0 -15
  28. package/es/components/Sales/Summary/utils.js +1 -43
  29. package/es/components/appointmentBooking/components/Cart/Item/index.less +3 -3
  30. package/es/components/appointmentBooking/components/Content/index.less +1 -1
  31. package/es/components/appointmentBooking/components/Deposit/index.d.ts +0 -6
  32. package/es/components/appointmentBooking/components/Deposit/index.js +7 -27
  33. package/es/components/appointmentBooking/components/Services/index.js +27 -23
  34. package/es/components/appointmentBooking/deposit/components/PolicyModal/index.js +20 -25
  35. package/es/components/appointmentBooking/deposit/index.js +2 -4
  36. package/es/components/appointmentBooking/index.js +0 -14
  37. package/es/components/appointmentBooking/index.less +1 -1
  38. package/es/components/booking/components/footer/utils.d.ts +0 -1
  39. package/es/components/booking/components/footer/utils.js +1 -1
  40. package/es/components/booking/components/voucher/index.js +2 -2
  41. package/es/components/booking/info/service2/utils.js +2 -3
  42. package/es/components/booking/info2/service/addService/utils.d.ts +0 -10
  43. package/es/components/booking/info2/service/addService/utils.js +13 -44
  44. package/es/components/booking/info2/service/editService/Resources/index.js +8 -22
  45. package/es/components/booking/info2/service/editService/Resources/index.less +0 -6
  46. package/es/components/booking/info2/utilsByBooking.js +0 -9
  47. package/es/components/booking/locales.d.ts +0 -3
  48. package/es/components/booking/locales.js +0 -3
  49. package/es/components/eftposPay/const.d.ts +1 -4
  50. package/es/components/eftposPay/const.js +1 -3
  51. package/es/components/eftposPay/hooks.d.ts +1 -1
  52. package/es/components/eftposPay/hooks.js +1 -3
  53. package/es/components/eftposPay/index.js +1 -1
  54. package/es/components/eftposPay/manufacturer.d.ts +0 -1
  55. package/es/components/eftposPay/manufacturer.js +0 -4
  56. package/es/components/eftposPay/pay.d.ts +1 -1
  57. package/es/components/eftposPay/pay.js +2 -6
  58. package/es/components/eftposPay/store/index.d.ts +1 -1
  59. package/es/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +17 -29
  60. package/es/components/eventBooking/components/Provider/Cart/Item/Total.js +6 -10
  61. package/es/components/eventBooking/components/Provider/Cart/Item/index.js +2 -4
  62. package/es/components/eventBooking/components/Provider/Event/index.js +4 -13
  63. package/es/components/eventBooking/components/bookingDetailModal/index.js +4 -22
  64. package/es/components/eventBooking/index.js +7 -21
  65. package/es/components/eventBooking/locales.d.ts +0 -24
  66. package/es/components/eventBooking/locales.js +6 -30
  67. package/es/components/index.d.ts +1 -3
  68. package/es/components/index.js +1 -3
  69. package/es/components/pay/toC/PaymentMethods/index.js +4 -5
  70. package/es/components/ticketBooking/components/addServiceVariant/addService.js +1 -1
  71. package/es/components/ticketBooking/components/ticketBooking/index.d.ts +0 -1
  72. package/es/components/ticketBooking/components/ticketBooking/index.js +138 -257
  73. package/es/components/ticketBooking/locales.d.ts +146 -164
  74. package/es/components/ticketBooking/locales.js +147 -195
  75. package/es/index.d.ts +0 -2
  76. package/es/index.js +1 -3
  77. package/lib/businessModel/SalesModel/Sales/index.js +8 -22
  78. package/lib/components/Sales/Cart/index.js +0 -1
  79. package/lib/components/Sales/Cart/utils.d.ts +0 -40
  80. package/lib/components/Sales/Cart/utils.js +0 -117
  81. package/lib/components/Sales/Checkout/index.d.ts +0 -4
  82. package/lib/components/Sales/Checkout/index.js +7 -39
  83. package/lib/components/Sales/Checkout/serve.d.ts +0 -13
  84. package/lib/components/Sales/Checkout/serve.js +2 -7
  85. package/lib/components/Sales/Checkout/utils.js +0 -2
  86. package/lib/components/Sales/Resource/index.js +1 -1
  87. package/lib/components/Sales/Resource/serve.d.ts +0 -7
  88. package/lib/components/Sales/Resource/serve.js +2 -9
  89. package/lib/components/Sales/Summary/index.d.ts +0 -10
  90. package/lib/components/Sales/Summary/index.js +1 -7
  91. package/lib/components/Sales/Summary/serve.d.ts +0 -1
  92. package/lib/components/Sales/Summary/serve.js +0 -32
  93. package/lib/components/Sales/Summary/utils.d.ts +0 -15
  94. package/lib/components/Sales/Summary/utils.js +1 -30
  95. package/lib/components/appointmentBooking/components/Cart/Item/index.less +3 -3
  96. package/lib/components/appointmentBooking/components/Content/index.less +1 -1
  97. package/lib/components/appointmentBooking/components/Deposit/index.d.ts +0 -6
  98. package/lib/components/appointmentBooking/components/Deposit/index.js +4 -36
  99. package/lib/components/appointmentBooking/components/Services/index.js +11 -6
  100. package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.js +4 -8
  101. package/lib/components/appointmentBooking/deposit/index.js +2 -4
  102. package/lib/components/appointmentBooking/index.js +0 -11
  103. package/lib/components/appointmentBooking/index.less +1 -1
  104. package/lib/components/booking/components/footer/utils.d.ts +0 -1
  105. package/lib/components/booking/components/footer/utils.js +0 -2
  106. package/lib/components/booking/components/voucher/index.js +2 -2
  107. package/lib/components/booking/info/service2/utils.js +2 -2
  108. package/lib/components/booking/info2/service/addService/utils.d.ts +0 -10
  109. package/lib/components/booking/info2/service/addService/utils.js +4 -27
  110. package/lib/components/booking/info2/service/editService/Resources/index.js +10 -54
  111. package/lib/components/booking/info2/service/editService/Resources/index.less +0 -6
  112. package/lib/components/booking/info2/utilsByBooking.js +0 -6
  113. package/lib/components/booking/locales.d.ts +0 -3
  114. package/lib/components/booking/locales.js +0 -3
  115. package/lib/components/eftposPay/const.d.ts +1 -4
  116. package/lib/components/eftposPay/const.js +0 -2
  117. package/lib/components/eftposPay/hooks.d.ts +1 -1
  118. package/lib/components/eftposPay/hooks.js +4 -11
  119. package/lib/components/eftposPay/index.js +1 -1
  120. package/lib/components/eftposPay/manufacturer.d.ts +0 -1
  121. package/lib/components/eftposPay/manufacturer.js +0 -6
  122. package/lib/components/eftposPay/pay.d.ts +1 -1
  123. package/lib/components/eftposPay/pay.js +2 -13
  124. package/lib/components/eftposPay/store/index.d.ts +1 -1
  125. package/lib/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +3 -16
  126. package/lib/components/eventBooking/components/Provider/Cart/Item/Total.js +5 -8
  127. package/lib/components/eventBooking/components/Provider/Cart/Item/index.js +2 -4
  128. package/lib/components/eventBooking/components/Provider/Event/index.js +3 -10
  129. package/lib/components/eventBooking/components/bookingDetailModal/index.js +4 -10
  130. package/lib/components/eventBooking/index.js +7 -11
  131. package/lib/components/eventBooking/locales.d.ts +0 -24
  132. package/lib/components/eventBooking/locales.js +6 -30
  133. package/lib/components/index.d.ts +1 -3
  134. package/lib/components/index.js +0 -6
  135. package/lib/components/pay/toC/PaymentMethods/index.js +9 -10
  136. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +1 -1
  137. package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +0 -1
  138. package/lib/components/ticketBooking/components/ticketBooking/index.js +139 -263
  139. package/lib/components/ticketBooking/locales.d.ts +146 -164
  140. package/lib/components/ticketBooking/locales.js +4 -22
  141. package/lib/index.d.ts +0 -2
  142. package/lib/index.js +0 -6
  143. package/package.json +3 -3
  144. package/es/components/booking/editBookingModal/index.d.ts +0 -5
  145. package/es/components/booking/editBookingModal/index.js +0 -386
  146. package/es/components/booking/editBookingModal/index.less +0 -8
  147. package/es/components/booking/editBookingModal/locales.d.ts +0 -21
  148. package/es/components/booking/editBookingModal/locales.js +0 -20
  149. package/es/components/booking/editBookingModal/mock.d.ts +0 -807
  150. package/es/components/booking/editBookingModal/mock.js +0 -2993
  151. package/es/components/booking/editBookingModal/serve.d.ts +0 -51
  152. package/es/components/booking/editBookingModal/serve.js +0 -288
  153. package/es/components/booking/editBookingModal/type.d.ts +0 -12
  154. package/es/components/booking/editBookingModal/type.js +0 -1
  155. package/es/components/booking/editBookingModal/utils.d.ts +0 -12
  156. package/es/components/booking/editBookingModal/utils.js +0 -157
  157. package/es/components/booking/info2/service/editService/ResourcesV2/MaxLengthSelect/index.d.ts +0 -7
  158. package/es/components/booking/info2/service/editService/ResourcesV2/MaxLengthSelect/index.js +0 -26
  159. package/es/components/booking/info2/service/editService/ResourcesV2/index.d.ts +0 -10
  160. package/es/components/booking/info2/service/editService/ResourcesV2/index.js +0 -308
  161. package/es/components/booking/info2/service/editService/ResourcesV2/index.less +0 -44
  162. package/es/components/eftposPay/linkly/const.d.ts +0 -23
  163. package/es/components/eftposPay/linkly/const.js +0 -82
  164. package/es/components/eftposPay/linkly/hooks/index.d.ts +0 -2
  165. package/es/components/eftposPay/linkly/hooks/index.js +0 -2
  166. package/es/components/eftposPay/linkly/hooks/normal.d.ts +0 -30
  167. package/es/components/eftposPay/linkly/hooks/normal.js +0 -318
  168. package/es/components/eftposPay/linkly/hooks/useTimeQuery.d.ts +0 -4
  169. package/es/components/eftposPay/linkly/hooks/useTimeQuery.js +0 -273
  170. package/es/components/eftposPay/linkly/index.d.ts +0 -2
  171. package/es/components/eftposPay/linkly/index.js +0 -197
  172. package/es/components/eftposPay/linkly/service.d.ts +0 -32
  173. package/es/components/eftposPay/linkly/service.js +0 -73
  174. package/es/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +0 -2
  175. package/es/components/eventBooking/components/Provider/Cart/Deposit/index.js +0 -17
  176. package/es/components/stepController/components/Content/index.d.ts +0 -7
  177. package/es/components/stepController/components/Content/index.js +0 -9
  178. package/es/components/stepController/components/Content/index.less +0 -8
  179. package/es/components/stepController/components/Footer/index.d.ts +0 -8
  180. package/es/components/stepController/components/Footer/index.js +0 -15
  181. package/es/components/stepController/components/Footer/index.less +0 -39
  182. package/es/components/stepController/components/Header/index.d.ts +0 -20
  183. package/es/components/stepController/components/Header/index.js +0 -97
  184. package/es/components/stepController/components/Header/index.less +0 -21
  185. package/es/components/stepController/index.d.ts +0 -5
  186. package/es/components/stepController/index.js +0 -64
  187. package/es/components/stepController/index.less +0 -11
  188. package/es/components/stepController/locales.d.ts +0 -27
  189. package/es/components/stepController/locales.js +0 -32
  190. package/es/components/stepController/types.d.ts +0 -23
  191. package/es/components/stepController/types.js +0 -1
  192. package/es/components/ticketBooking/utils/formatProductMessage.d.ts +0 -2
  193. package/es/components/ticketBooking/utils/formatProductMessage.js +0 -62
  194. package/es/components/ticketBooking/utils/formatTime.d.ts +0 -31
  195. package/es/components/ticketBooking/utils/formatTime.js +0 -144
  196. package/es/hooks/useWindowSize.d.ts +0 -5
  197. package/es/hooks/useWindowSize.js +0 -26
  198. package/lib/components/booking/editBookingModal/index.d.ts +0 -5
  199. package/lib/components/booking/editBookingModal/index.js +0 -363
  200. package/lib/components/booking/editBookingModal/index.less +0 -8
  201. package/lib/components/booking/editBookingModal/locales.d.ts +0 -21
  202. package/lib/components/booking/editBookingModal/locales.js +0 -44
  203. package/lib/components/booking/editBookingModal/mock.d.ts +0 -807
  204. package/lib/components/booking/editBookingModal/mock.js +0 -3314
  205. package/lib/components/booking/editBookingModal/serve.d.ts +0 -51
  206. package/lib/components/booking/editBookingModal/serve.js +0 -178
  207. package/lib/components/booking/editBookingModal/type.d.ts +0 -12
  208. package/lib/components/booking/editBookingModal/type.js +0 -17
  209. package/lib/components/booking/editBookingModal/utils.d.ts +0 -12
  210. package/lib/components/booking/editBookingModal/utils.js +0 -158
  211. package/lib/components/booking/info2/service/editService/ResourcesV2/MaxLengthSelect/index.d.ts +0 -7
  212. package/lib/components/booking/info2/service/editService/ResourcesV2/MaxLengthSelect/index.js +0 -53
  213. package/lib/components/booking/info2/service/editService/ResourcesV2/index.d.ts +0 -10
  214. package/lib/components/booking/info2/service/editService/ResourcesV2/index.js +0 -311
  215. package/lib/components/booking/info2/service/editService/ResourcesV2/index.less +0 -44
  216. package/lib/components/eftposPay/linkly/const.d.ts +0 -23
  217. package/lib/components/eftposPay/linkly/const.js +0 -102
  218. package/lib/components/eftposPay/linkly/hooks/index.d.ts +0 -2
  219. package/lib/components/eftposPay/linkly/hooks/index.js +0 -25
  220. package/lib/components/eftposPay/linkly/hooks/normal.d.ts +0 -30
  221. package/lib/components/eftposPay/linkly/hooks/normal.js +0 -239
  222. package/lib/components/eftposPay/linkly/hooks/useTimeQuery.d.ts +0 -4
  223. package/lib/components/eftposPay/linkly/hooks/useTimeQuery.js +0 -222
  224. package/lib/components/eftposPay/linkly/index.d.ts +0 -2
  225. package/lib/components/eftposPay/linkly/index.js +0 -208
  226. package/lib/components/eftposPay/linkly/service.d.ts +0 -32
  227. package/lib/components/eftposPay/linkly/service.js +0 -55
  228. package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +0 -2
  229. package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.js +0 -55
  230. package/lib/components/stepController/components/Content/index.d.ts +0 -7
  231. package/lib/components/stepController/components/Content/index.js +0 -40
  232. package/lib/components/stepController/components/Content/index.less +0 -8
  233. package/lib/components/stepController/components/Footer/index.d.ts +0 -8
  234. package/lib/components/stepController/components/Footer/index.js +0 -49
  235. package/lib/components/stepController/components/Footer/index.less +0 -39
  236. package/lib/components/stepController/components/Header/index.d.ts +0 -20
  237. package/lib/components/stepController/components/Header/index.js +0 -104
  238. package/lib/components/stepController/components/Header/index.less +0 -21
  239. package/lib/components/stepController/index.d.ts +0 -5
  240. package/lib/components/stepController/index.js +0 -89
  241. package/lib/components/stepController/index.less +0 -11
  242. package/lib/components/stepController/locales.d.ts +0 -27
  243. package/lib/components/stepController/locales.js +0 -50
  244. package/lib/components/stepController/types.d.ts +0 -23
  245. package/lib/components/stepController/types.js +0 -17
  246. package/lib/components/ticketBooking/utils/formatProductMessage.d.ts +0 -2
  247. package/lib/components/ticketBooking/utils/formatProductMessage.js +0 -84
  248. package/lib/components/ticketBooking/utils/formatTime.d.ts +0 -31
  249. package/lib/components/ticketBooking/utils/formatTime.js +0 -139
  250. package/lib/hooks/useWindowSize.d.ts +0 -5
  251. package/lib/hooks/useWindowSize.js +0 -51
  252. package/lowcode/edit-booking-modal/meta.ts +0 -53
  253. package/lowcode/step-controller/meta.ts +0 -88
@@ -29,7 +29,6 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
29
29
  // src/components/ticketBooking/components/ticketBooking/index.tsx
30
30
  var ticketBooking_exports = {};
31
31
  __export(ticketBooking_exports, {
32
- _formatBookingDetail: () => _formatBookingDetail,
33
32
  default: () => ticketBooking_default
34
33
  });
35
34
  module.exports = __toCommonJS(ticketBooking_exports);
@@ -46,163 +45,12 @@ var import_utils2 = require("../../utils");
46
45
  var import_addServiceVariant = __toESM(require("../addServiceVariant"));
47
46
  var import_timeBar = __toESM(require("../timeBar"));
48
47
  var import_index = require("./index.less");
49
- var import_utils3 = require("../../../booking/info/service2/utils");
50
- var import_amount = require("../../../booking/components/footer/amount");
51
- var import_formatProductMessage = __toESM(require("../../utils/formatProductMessage"));
52
- var _formatBookingDetail = (data, modalState) => {
53
- var _a, _b, _c, _d;
54
- let {
55
- customer_id,
56
- holder,
57
- customer_name,
58
- email,
59
- phone,
60
- country_calling_code,
61
- bookings,
62
- customer,
63
- note,
64
- payment_status,
65
- is_other_entrance_edited,
66
- shop_discount
67
- } = data;
68
- const clientValue = {
69
- name: ((customer == null ? void 0 : customer.display_name) || "").trim() || ((customer == null ? void 0 : customer.nickname) || "").trim() || "",
70
- id: customer_id || (customer == null ? void 0 : customer.id) || (customer == null ? void 0 : customer.customer_id) || 1,
71
- email: customer == null ? void 0 : customer.email,
72
- phone: (customer == null ? void 0 : customer.phone) || "",
73
- country_calling_code: (customer == null ? void 0 : customer.country_calling_code) || "",
74
- cover: (customer == null ? void 0 : customer.cover) || ""
75
- };
76
- const start_date = (_b = (_a = bookings == null ? void 0 : bookings.list) == null ? void 0 : _a[0]) == null ? void 0 : _b.start_date;
77
- const dateValue = (0, import_dayjs.default)(
78
- start_date ? start_date + " " + ((_d = (_c = bookings == null ? void 0 : bookings.list) == null ? void 0 : _c[0]) == null ? void 0 : _d.start_time) : /* @__PURE__ */ new Date()
79
- );
80
- const petsValue = holder;
81
- const getCapacity = (resetD) => {
82
- var _a2;
83
- return (_a2 = resetD.metadata) == null ? void 0 : _a2.capacity;
84
- };
85
- const getResource = (resetD) => {
86
- var _a2;
87
- if (!bookings.relation_type) {
88
- try {
89
- if ((resetD == null ? void 0 : resetD.event_resources) && ((_a2 = resetD == null ? void 0 : resetD.event_resources) == null ? void 0 : _a2.length)) {
90
- return resetD.event_resources.reduce((pre, cur) => {
91
- if (pre[cur.form_id]) {
92
- pre[cur.form_id].push(cur);
93
- } else {
94
- pre[cur.form_id] = [cur];
95
- }
96
- return pre;
97
- }, {});
98
- }
99
- } catch (err) {
100
- console.error(err);
101
- }
102
- }
103
- return resetD.relation_id;
104
- };
105
- const serviceValue = bookings.list.map((d) => {
106
- let { detail, product, ...resetD } = d;
107
- let _detail = detail || mockProduct;
108
- let start_date2 = (0, import_dayjs.default)(resetD.start_date + " " + resetD.start_time);
109
- let end_date = (0, import_dayjs.default)(resetD.end_date + " " + resetD.end_time);
110
- return {
111
- _id: (Math.random() + "").replace(/\D/g, "").substring(0, 11),
112
- ..._detail,
113
- booking_id: resetD.id,
114
- id: _detail.product_id,
115
- title: _detail.product_title,
116
- quantity: Number(_detail.product_quantity),
117
- cover: _detail.product_cover,
118
- // 商品本身的价格
119
- price: Number(_detail.source_product_price),
120
- relation_form_name: resetD.relation_form_name,
121
- product_resource: product == null ? void 0 : product.product_resource,
122
- capacity: product == null ? void 0 : product.capacity,
123
- _extend: {
124
- ...resetD,
125
- quantity: Number(_detail.product_quantity),
126
- startDate: start_date2,
127
- start_date: start_date2,
128
- endDate: end_date,
129
- end_date,
130
- // 商品本身的价格
131
- price: Number(_detail.source_product_price),
132
- product_name: _detail.product_title,
133
- discount_reason: _detail.product_discount_reason,
134
- // resource: resetD.relation_id,
135
- order_detail_id: _detail.order_detail_id,
136
- // 总价: 商品本身价格 + 套餐价格 + 单规格价格 包含折扣
137
- total: Number(_detail.selling_price),
138
- // 原总价: 商品本身价格 + 套餐价格 + 单规格价格 不包含折扣
139
- origin_total: Number(_detail.original_price),
140
- payment_price: Number(_detail.payment_price),
141
- other: (0, import_utils2.restoreProductOtherData)(d),
142
- // 是否编辑了套餐 默认为0 如果编辑之后为1
143
- bundle_edit: 0,
144
- discount_per: _detail.discount_per,
145
- discount_type: _detail.discount_type,
146
- discountway: _detail.discountway,
147
- capacity: getCapacity(resetD),
148
- resource: getResource(resetD)
149
- }
150
- };
151
- });
152
- let disabledEdit = (0, import_utils2.getDisabledEdit)(data);
153
- let channelDisabledEdit = !!is_other_entrance_edited;
154
- return {
155
- ...modalState,
156
- client: {
157
- ...modalState.client,
158
- value: clientValue,
159
- edit: false,
160
- showModal: false
161
- },
162
- date: {
163
- ...modalState.date,
164
- value: dateValue,
165
- edit: false,
166
- showModal: false
167
- },
168
- pet: {
169
- ...modalState.pet,
170
- showModal: false,
171
- edit: false
172
- },
173
- service: {
174
- ...modalState.service,
175
- value: serviceValue,
176
- addModal: false,
177
- editModal: false,
178
- edit: false
179
- },
180
- notes: {
181
- ...modalState.notes,
182
- orderNote: note,
183
- edit: false
184
- },
185
- disabledEdit,
186
- channelDisabledEdit,
187
- appointment_status: bookings == null ? void 0 : bookings.appointment_status
188
- };
189
- };
190
48
  var TicketBooking = () => {
191
49
  var _a;
192
50
  const [state, setState] = (0, import_miniRedux.useStore)();
193
51
  const engineContext = (0, import_useEngineContext.default)();
194
52
  const { props: engineProps } = engineContext.engine;
195
- const {
196
- action,
197
- isTerminal,
198
- lowcodeRef,
199
- interaction,
200
- store,
201
- storage,
202
- Toast,
203
- getSymbolic,
204
- translation
205
- } = (_a = engineContext.appHelper) == null ? void 0 : _a.utils;
53
+ const { action, isTerminal, lowcodeRef, interaction, store, storage, Toast } = (_a = engineContext.appHelper) == null ? void 0 : _a.utils;
206
54
  const _persistentRef = (0, import_react.useRef)(false);
207
55
  const _initStateRef = (0, import_react.useRef)({});
208
56
  const _listTimerRef = (0, import_react.useRef)();
@@ -289,112 +137,6 @@ var TicketBooking = () => {
289
137
  intervalSetTime: isInterval
290
138
  });
291
139
  };
292
- (0, import_react.useEffect)(() => {
293
- var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j;
294
- const cartItems = (_b = (_a2 = state == null ? void 0 : state.modalState) == null ? void 0 : _a2.service) == null ? void 0 : _b.value;
295
- if (!Array.isArray(cartItems) || cartItems.length === 0) {
296
- (_d = (_c = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _c.postMessageToApp) == null ? void 0 : _d.call(_c, {
297
- module: "cds",
298
- key: "cartUpdate",
299
- data: {
300
- currency_symbol: getSymbolic(),
301
- total: "0",
302
- // 小计
303
- products: [],
304
- fees: []
305
- }
306
- });
307
- }
308
- const total = (0, import_amount.getSumTotal)(state.modalState, true);
309
- let formatedProducts = [];
310
- try {
311
- formatedProducts = (0, import_utils3.formatProducts)(
312
- cartItems,
313
- state.modalState,
314
- false,
315
- true,
316
- true
317
- );
318
- } catch (error) {
319
- console.error(error);
320
- }
321
- console.log("formatedProducts", total, formatedProducts);
322
- let fees = [];
323
- let products = [];
324
- for (const item of formatedProducts) {
325
- const { id, name, image, origin_total, total: total2, num, note, _origin } = item;
326
- (_e = _origin == null ? void 0 : _origin.discount_list) == null ? void 0 : _e.forEach((dl) => {
327
- fees.push({
328
- isReduce: dl.type === "good_pass",
329
- title: translation(dl == null ? void 0 : dl.discount.title),
330
- price: dl.amount,
331
- type: dl.type
332
- });
333
- });
334
- let msg = "";
335
- try {
336
- msg = (0, import_formatProductMessage.default)(
337
- {
338
- ...item,
339
- currency_symbol: getSymbolic()
340
- },
341
- (_f = engineContext.appHelper) == null ? void 0 : _f.utils
342
- );
343
- } catch (error) {
344
- console.error(error);
345
- }
346
- let _item = {
347
- productID: id,
348
- title: name,
349
- cover: image,
350
- // 封面图
351
- price: total2,
352
- // 售价
353
- buyCount: num,
354
- // 购买数量
355
- productFormatMessage: msg,
356
- note
357
- };
358
- if (origin_total !== total2) _item.modifyPrice = origin_total;
359
- products.push(_item);
360
- }
361
- console.log(
362
- "formatedProducts",
363
- (_g = import_utils.locales.getText("pisell2.product.card.cart-items")) == null ? void 0 : _g(products.length)
364
- );
365
- if (products.length > 0) {
366
- fees.unshift({
367
- title: import_utils.locales.getText("pisell2.product.card.subtotal"),
368
- price: total.productAmount,
369
- type: "subtotal",
370
- message: (_h = import_utils.locales.getText("pisell2.product.card.cart-items")) == null ? void 0 : _h(
371
- products.length
372
- )
373
- });
374
- }
375
- console.log("start post message, config:", {
376
- module: "cds",
377
- key: "cartUpdate",
378
- data: {
379
- currency_symbol: getSymbolic(),
380
- total: total.productAmount,
381
- // 小计
382
- products,
383
- fees
384
- }
385
- });
386
- (_j = (_i = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _i.postMessageToApp) == null ? void 0 : _j.call(_i, {
387
- module: "cds",
388
- key: "cartUpdate",
389
- data: {
390
- currency_symbol: getSymbolic(),
391
- total: total.expectAmount,
392
- // 小计
393
- products,
394
- fees
395
- }
396
- });
397
- }, [state.modalState]);
398
140
  const _setModalState = (props) => {
399
141
  var _a2, _b;
400
142
  console.log("同步state到外层", props);
@@ -564,6 +306,144 @@ var TicketBooking = () => {
564
306
  (_a2 = dom == null ? void 0 : dom.scrollIntoView) == null ? void 0 : _a2.call(dom, { block: "center", behavior: "smooth" });
565
307
  }
566
308
  };
309
+ const _formatBookingDetail = (data, modalState) => {
310
+ var _a2, _b, _c, _d;
311
+ let {
312
+ customer_id,
313
+ holder,
314
+ customer_name,
315
+ email,
316
+ phone,
317
+ country_calling_code,
318
+ bookings,
319
+ customer,
320
+ note,
321
+ payment_status,
322
+ is_other_entrance_edited,
323
+ shop_discount
324
+ } = data;
325
+ const clientValue = {
326
+ name: ((customer == null ? void 0 : customer.display_name) || "").trim() || ((customer == null ? void 0 : customer.nickname) || "").trim() || "",
327
+ id: customer_id || (customer == null ? void 0 : customer.id) || (customer == null ? void 0 : customer.customer_id) || 1,
328
+ email: customer == null ? void 0 : customer.email,
329
+ phone: (customer == null ? void 0 : customer.phone) || "",
330
+ country_calling_code: (customer == null ? void 0 : customer.country_calling_code) || "",
331
+ cover: (customer == null ? void 0 : customer.cover) || ""
332
+ };
333
+ const start_date = (_b = (_a2 = bookings == null ? void 0 : bookings.list) == null ? void 0 : _a2[0]) == null ? void 0 : _b.start_date;
334
+ const dateValue = (0, import_dayjs.default)(
335
+ start_date ? start_date + " " + ((_d = (_c = bookings == null ? void 0 : bookings.list) == null ? void 0 : _c[0]) == null ? void 0 : _d.start_time) : /* @__PURE__ */ new Date()
336
+ );
337
+ const petsValue = holder;
338
+ const getCapacity = (resetD) => {
339
+ var _a3;
340
+ return (_a3 = resetD.metadata) == null ? void 0 : _a3.capacity;
341
+ };
342
+ const getResource = (resetD) => {
343
+ var _a3;
344
+ if (!bookings.relation_type) {
345
+ try {
346
+ if ((resetD == null ? void 0 : resetD.event_resources) && ((_a3 = resetD == null ? void 0 : resetD.event_resources) == null ? void 0 : _a3.length)) {
347
+ return resetD.event_resources.reduce((pre, cur) => {
348
+ if (pre[cur.form_id]) {
349
+ pre[cur.form_id].push(cur);
350
+ } else {
351
+ pre[cur.form_id] = [cur];
352
+ }
353
+ return pre;
354
+ }, {});
355
+ }
356
+ } catch (err) {
357
+ console.error(err);
358
+ }
359
+ }
360
+ return resetD.relation_id;
361
+ };
362
+ const serviceValue = bookings.list.map((d) => {
363
+ let { detail, product, ...resetD } = d;
364
+ let _detail = detail || mockProduct;
365
+ let start_date2 = (0, import_dayjs.default)(resetD.start_date + " " + resetD.start_time);
366
+ let end_date = (0, import_dayjs.default)(resetD.end_date + " " + resetD.end_time);
367
+ return {
368
+ _id: (Math.random() + "").replace(/\D/g, "").substring(0, 11),
369
+ ..._detail,
370
+ booking_id: resetD.id,
371
+ id: _detail.product_id,
372
+ title: _detail.product_title,
373
+ quantity: Number(_detail.product_quantity),
374
+ cover: _detail.product_cover,
375
+ // 商品本身的价格
376
+ price: Number(_detail.source_product_price),
377
+ relation_form_name: resetD.relation_form_name,
378
+ product_resource: product == null ? void 0 : product.product_resource,
379
+ capacity: product == null ? void 0 : product.capacity,
380
+ _extend: {
381
+ ...resetD,
382
+ quantity: Number(_detail.product_quantity),
383
+ startDate: start_date2,
384
+ start_date: start_date2,
385
+ endDate: end_date,
386
+ end_date,
387
+ // 商品本身的价格
388
+ price: Number(_detail.source_product_price),
389
+ product_name: _detail.product_title,
390
+ discount_reason: _detail.product_discount_reason,
391
+ // resource: resetD.relation_id,
392
+ order_detail_id: _detail.order_detail_id,
393
+ // 总价: 商品本身价格 + 套餐价格 + 单规格价格 包含折扣
394
+ total: Number(_detail.selling_price),
395
+ // 原总价: 商品本身价格 + 套餐价格 + 单规格价格 不包含折扣
396
+ origin_total: Number(_detail.original_price),
397
+ payment_price: Number(_detail.payment_price),
398
+ other: (0, import_utils2.restoreProductOtherData)(d),
399
+ // 是否编辑了套餐 默认为0 如果编辑之后为1
400
+ bundle_edit: 0,
401
+ discount_per: _detail.discount_per,
402
+ discount_type: _detail.discount_type,
403
+ discountway: _detail.discountway,
404
+ capacity: getCapacity(resetD),
405
+ resource: getResource(resetD)
406
+ }
407
+ };
408
+ });
409
+ let disabledEdit = (0, import_utils2.getDisabledEdit)(data);
410
+ let channelDisabledEdit = !!is_other_entrance_edited;
411
+ return {
412
+ ...modalState,
413
+ client: {
414
+ ...modalState.client,
415
+ value: clientValue,
416
+ edit: false,
417
+ showModal: false
418
+ },
419
+ date: {
420
+ ...modalState.date,
421
+ value: dateValue,
422
+ edit: false,
423
+ showModal: false
424
+ },
425
+ pet: {
426
+ ...modalState.pet,
427
+ showModal: false,
428
+ edit: false
429
+ },
430
+ service: {
431
+ ...modalState.service,
432
+ value: serviceValue,
433
+ addModal: false,
434
+ editModal: false,
435
+ edit: false
436
+ },
437
+ notes: {
438
+ ...modalState.notes,
439
+ orderNote: note,
440
+ edit: false
441
+ },
442
+ disabledEdit,
443
+ channelDisabledEdit,
444
+ appointment_status: bookings == null ? void 0 : bookings.appointment_status
445
+ };
446
+ };
567
447
  const _initBookingData = (type, data) => {
568
448
  var _a2, _b, _c, _d, _e, _f, _g;
569
449
  let initState = _getInitState({
@@ -908,7 +788,3 @@ var TicketBooking = () => {
908
788
  ));
909
789
  };
910
790
  var ticketBooking_default = TicketBooking;
911
- // Annotate the CommonJS export names for ESM import in node:
912
- 0 && (module.exports = {
913
- _formatBookingDetail
914
- });