@pisell/private-materials 3.3.81 → 3.3.83

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 (169) 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 +5 -5
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +5 -5
  11. package/es/businessModel/SalesModel/Sales/index.js +4 -37
  12. package/es/components/Sales/Resource/index.js +2 -2
  13. package/es/components/Sales/Resource/serve.d.ts +0 -7
  14. package/es/components/Sales/Resource/serve.js +0 -10
  15. package/es/components/appointmentBooking/components/Cart/Item/index.less +3 -3
  16. package/es/components/appointmentBooking/components/Content/index.less +1 -1
  17. package/es/components/appointmentBooking/components/Header/index.js +14 -8
  18. package/es/components/appointmentBooking/components/Services/index.js +36 -38
  19. package/es/components/appointmentBooking/components/Voucher/index.js +1 -1
  20. package/es/components/appointmentBooking/index.js +0 -14
  21. package/es/components/appointmentBooking/index.less +1 -1
  22. package/es/components/appointmentBooking/locales.d.ts +3 -0
  23. package/es/components/appointmentBooking/locales.js +3 -0
  24. package/es/components/booking/components/footer/utils.d.ts +0 -1
  25. package/es/components/booking/components/footer/utils.js +1 -1
  26. package/es/components/booking/components/voucher/index.js +2 -2
  27. package/es/components/booking/info/service2/utils.js +2 -3
  28. package/es/components/booking/info2/service/addService/utils.d.ts +0 -10
  29. package/es/components/booking/info2/service/addService/utils.js +13 -43
  30. package/es/components/booking/info2/service/editService/Resources/index.js +8 -22
  31. package/es/components/booking/info2/service/editService/Resources/index.less +0 -6
  32. package/es/components/booking/info2/utilsByBooking.js +0 -9
  33. package/es/components/booking/locales.d.ts +0 -3
  34. package/es/components/booking/locales.js +0 -3
  35. package/es/components/eventBooking/components/Provider/Event/index.js +4 -13
  36. package/es/components/eventBooking/components/bookingDetailModal/index.js +3 -19
  37. package/es/components/eventBooking/index.js +7 -21
  38. package/es/components/eventBooking/locales.js +3 -3
  39. package/es/components/index.d.ts +1 -3
  40. package/es/components/index.js +1 -3
  41. package/es/components/pay/toC/PaymentMethods/index.js +4 -5
  42. package/es/components/ticketBooking/components/addServiceVariant/addService.js +1 -1
  43. package/es/components/ticketBooking/components/ticketBooking/index.d.ts +0 -1
  44. package/es/components/ticketBooking/components/ticketBooking/index.js +138 -257
  45. package/es/components/ticketBooking/locales.d.ts +146 -164
  46. package/es/components/ticketBooking/locales.js +147 -195
  47. package/es/index.d.ts +0 -2
  48. package/es/index.js +1 -3
  49. package/lib/businessModel/SalesModel/Sales/index.js +8 -22
  50. package/lib/components/Sales/Resource/index.js +1 -1
  51. package/lib/components/Sales/Resource/serve.d.ts +0 -7
  52. package/lib/components/Sales/Resource/serve.js +2 -9
  53. package/lib/components/appointmentBooking/components/Cart/Item/index.less +3 -3
  54. package/lib/components/appointmentBooking/components/Content/index.less +1 -1
  55. package/lib/components/appointmentBooking/components/Header/index.js +3 -2
  56. package/lib/components/appointmentBooking/components/Services/index.js +18 -19
  57. package/lib/components/appointmentBooking/components/Voucher/index.js +1 -1
  58. package/lib/components/appointmentBooking/index.js +0 -11
  59. package/lib/components/appointmentBooking/index.less +1 -1
  60. package/lib/components/appointmentBooking/locales.d.ts +3 -0
  61. package/lib/components/appointmentBooking/locales.js +3 -0
  62. package/lib/components/booking/components/footer/utils.d.ts +0 -1
  63. package/lib/components/booking/components/footer/utils.js +0 -2
  64. package/lib/components/booking/components/voucher/index.js +23 -11
  65. package/lib/components/booking/info/service2/utils.js +2 -2
  66. package/lib/components/booking/info2/service/addService/utils.d.ts +0 -10
  67. package/lib/components/booking/info2/service/addService/utils.js +4 -26
  68. package/lib/components/booking/info2/service/editService/Resources/index.js +10 -54
  69. package/lib/components/booking/info2/service/editService/Resources/index.less +0 -6
  70. package/lib/components/booking/info2/utilsByBooking.js +0 -6
  71. package/lib/components/booking/locales.d.ts +0 -3
  72. package/lib/components/booking/locales.js +0 -3
  73. package/lib/components/eventBooking/components/Provider/Event/index.js +3 -10
  74. package/lib/components/eventBooking/components/bookingDetailModal/index.js +3 -9
  75. package/lib/components/eventBooking/index.js +7 -11
  76. package/lib/components/eventBooking/locales.js +3 -3
  77. package/lib/components/index.d.ts +1 -3
  78. package/lib/components/index.js +0 -6
  79. package/lib/components/pay/toC/PaymentMethods/index.js +9 -10
  80. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +1 -1
  81. package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +0 -1
  82. package/lib/components/ticketBooking/components/ticketBooking/index.js +139 -263
  83. package/lib/components/ticketBooking/locales.d.ts +146 -164
  84. package/lib/components/ticketBooking/locales.js +4 -22
  85. package/lib/index.d.ts +0 -2
  86. package/lib/index.js +0 -6
  87. package/package.json +4 -4
  88. package/es/components/booking/editBookingModal/index.d.ts +0 -5
  89. package/es/components/booking/editBookingModal/index.js +0 -386
  90. package/es/components/booking/editBookingModal/index.less +0 -8
  91. package/es/components/booking/editBookingModal/locales.d.ts +0 -21
  92. package/es/components/booking/editBookingModal/locales.js +0 -20
  93. package/es/components/booking/editBookingModal/mock.d.ts +0 -807
  94. package/es/components/booking/editBookingModal/mock.js +0 -2993
  95. package/es/components/booking/editBookingModal/serve.d.ts +0 -51
  96. package/es/components/booking/editBookingModal/serve.js +0 -288
  97. package/es/components/booking/editBookingModal/type.d.ts +0 -12
  98. package/es/components/booking/editBookingModal/type.js +0 -1
  99. package/es/components/booking/editBookingModal/utils.d.ts +0 -12
  100. package/es/components/booking/editBookingModal/utils.js +0 -157
  101. package/es/components/booking/info2/service/editService/ResourcesV2/MaxLengthSelect/index.d.ts +0 -7
  102. package/es/components/booking/info2/service/editService/ResourcesV2/MaxLengthSelect/index.js +0 -26
  103. package/es/components/booking/info2/service/editService/ResourcesV2/index.d.ts +0 -10
  104. package/es/components/booking/info2/service/editService/ResourcesV2/index.js +0 -308
  105. package/es/components/booking/info2/service/editService/ResourcesV2/index.less +0 -44
  106. package/es/components/stepController/components/Content/index.d.ts +0 -7
  107. package/es/components/stepController/components/Content/index.js +0 -9
  108. package/es/components/stepController/components/Content/index.less +0 -8
  109. package/es/components/stepController/components/Footer/index.d.ts +0 -8
  110. package/es/components/stepController/components/Footer/index.js +0 -15
  111. package/es/components/stepController/components/Footer/index.less +0 -39
  112. package/es/components/stepController/components/Header/index.d.ts +0 -20
  113. package/es/components/stepController/components/Header/index.js +0 -97
  114. package/es/components/stepController/components/Header/index.less +0 -21
  115. package/es/components/stepController/index.d.ts +0 -5
  116. package/es/components/stepController/index.js +0 -64
  117. package/es/components/stepController/index.less +0 -11
  118. package/es/components/stepController/locales.d.ts +0 -27
  119. package/es/components/stepController/locales.js +0 -32
  120. package/es/components/stepController/types.d.ts +0 -23
  121. package/es/components/stepController/types.js +0 -1
  122. package/es/components/ticketBooking/utils/formatProductMessage.d.ts +0 -2
  123. package/es/components/ticketBooking/utils/formatProductMessage.js +0 -62
  124. package/es/components/ticketBooking/utils/formatTime.d.ts +0 -31
  125. package/es/components/ticketBooking/utils/formatTime.js +0 -144
  126. package/es/hooks/useWindowSize.d.ts +0 -5
  127. package/es/hooks/useWindowSize.js +0 -26
  128. package/lib/components/booking/editBookingModal/index.d.ts +0 -5
  129. package/lib/components/booking/editBookingModal/index.js +0 -363
  130. package/lib/components/booking/editBookingModal/index.less +0 -8
  131. package/lib/components/booking/editBookingModal/locales.d.ts +0 -21
  132. package/lib/components/booking/editBookingModal/locales.js +0 -44
  133. package/lib/components/booking/editBookingModal/mock.d.ts +0 -807
  134. package/lib/components/booking/editBookingModal/mock.js +0 -3314
  135. package/lib/components/booking/editBookingModal/serve.d.ts +0 -51
  136. package/lib/components/booking/editBookingModal/serve.js +0 -178
  137. package/lib/components/booking/editBookingModal/type.d.ts +0 -12
  138. package/lib/components/booking/editBookingModal/type.js +0 -17
  139. package/lib/components/booking/editBookingModal/utils.d.ts +0 -12
  140. package/lib/components/booking/editBookingModal/utils.js +0 -158
  141. package/lib/components/booking/info2/service/editService/ResourcesV2/MaxLengthSelect/index.d.ts +0 -7
  142. package/lib/components/booking/info2/service/editService/ResourcesV2/MaxLengthSelect/index.js +0 -53
  143. package/lib/components/booking/info2/service/editService/ResourcesV2/index.d.ts +0 -10
  144. package/lib/components/booking/info2/service/editService/ResourcesV2/index.js +0 -311
  145. package/lib/components/booking/info2/service/editService/ResourcesV2/index.less +0 -44
  146. package/lib/components/stepController/components/Content/index.d.ts +0 -7
  147. package/lib/components/stepController/components/Content/index.js +0 -40
  148. package/lib/components/stepController/components/Content/index.less +0 -8
  149. package/lib/components/stepController/components/Footer/index.d.ts +0 -8
  150. package/lib/components/stepController/components/Footer/index.js +0 -49
  151. package/lib/components/stepController/components/Footer/index.less +0 -39
  152. package/lib/components/stepController/components/Header/index.d.ts +0 -20
  153. package/lib/components/stepController/components/Header/index.js +0 -104
  154. package/lib/components/stepController/components/Header/index.less +0 -21
  155. package/lib/components/stepController/index.d.ts +0 -5
  156. package/lib/components/stepController/index.js +0 -89
  157. package/lib/components/stepController/index.less +0 -11
  158. package/lib/components/stepController/locales.d.ts +0 -27
  159. package/lib/components/stepController/locales.js +0 -50
  160. package/lib/components/stepController/types.d.ts +0 -23
  161. package/lib/components/stepController/types.js +0 -17
  162. package/lib/components/ticketBooking/utils/formatProductMessage.d.ts +0 -2
  163. package/lib/components/ticketBooking/utils/formatProductMessage.js +0 -84
  164. package/lib/components/ticketBooking/utils/formatTime.d.ts +0 -31
  165. package/lib/components/ticketBooking/utils/formatTime.js +0 -139
  166. package/lib/hooks/useWindowSize.d.ts +0 -5
  167. package/lib/hooks/useWindowSize.js +0 -51
  168. package/lowcode/edit-booking-modal/meta.ts +0 -53
  169. package/lowcode/step-controller/meta.ts +0 -88
@@ -34,13 +34,11 @@ __export(components_exports, {
34
34
  BookingForms: () => import_forms.default,
35
35
  BookingInfo: () => import_info.default,
36
36
  BookingNotes: () => import_notes.default,
37
- EditBookingModal: () => import_editBookingModal.default,
38
37
  Login: () => import_login.default,
39
38
  PisellSelectCustomerModal: () => import_pisellSelectCustomerModal.default,
40
39
  ProductExtension: () => import_productExtension.default,
41
40
  RuleSetting: () => import_ruleSetting.default,
42
41
  Schedules: () => import_schedules.default,
43
- StepController: () => import_stepController.default,
44
42
  SubTotal: () => import_subTotal.default,
45
43
  TaxSelect: () => import_taxSelect.default,
46
44
  ToCPay: () => import_toC.default,
@@ -67,8 +65,6 @@ var import_workSpaceListDetail = __toESM(require("./workSpaceListDetail/"));
67
65
  var import_workSpaceList = __toESM(require("./workSpaceList"));
68
66
  var import_pisellSelectCustomerModal = __toESM(require("./pisellSelectCustomerModal"));
69
67
  var import_subTotal = __toESM(require("./subTotal"));
70
- var import_stepController = __toESM(require("./stepController"));
71
- var import_editBookingModal = __toESM(require("./booking/editBookingModal"));
72
68
  // Annotate the CommonJS export names for ESM import in node:
73
69
  0 && (module.exports = {
74
70
  Booking,
@@ -76,13 +72,11 @@ var import_editBookingModal = __toESM(require("./booking/editBookingModal"));
76
72
  BookingForms,
77
73
  BookingInfo,
78
74
  BookingNotes,
79
- EditBookingModal,
80
75
  Login,
81
76
  PisellSelectCustomerModal,
82
77
  ProductExtension,
83
78
  RuleSetting,
84
79
  Schedules,
85
- StepController,
86
80
  SubTotal,
87
81
  TaxSelect,
88
82
  ToCPay,
@@ -65,7 +65,7 @@ var isOfflinePayment = (type) => {
65
65
  ].includes(type);
66
66
  };
67
67
  var PaymentMethods = (props, ref) => {
68
- var _a, _b, _c;
68
+ var _a;
69
69
  const MWCreditCardRef2 = (0, import_react.useRef)(null);
70
70
  const SuperPayAliPayH5Ref2 = (0, import_react.useRef)(null);
71
71
  const StripePayRef2 = (0, import_react.useRef)(null);
@@ -83,9 +83,9 @@ var PaymentMethods = (props, ref) => {
83
83
  const context = (0, import_useEngineContext.default)();
84
84
  const { interaction } = (_a = context.appHelper) == null ? void 0 : _a.utils;
85
85
  const init = async ({ type, payGroup }) => {
86
- var _a2, _b2;
86
+ var _a2, _b;
87
87
  const waitAmount = (payGroup == null ? void 0 : payGroup.wait_amount) || 0;
88
- const cards = (_b2 = (_a2 = payGroup == null ? void 0 : payGroup.walletPass) == null ? void 0 : _a2.cards) == null ? void 0 : _b2.length;
88
+ const cards = (_b = (_a2 = payGroup == null ? void 0 : payGroup.walletPass) == null ? void 0 : _a2.cards) == null ? void 0 : _b.length;
89
89
  if (cards && (waitAmount <= 0 || isOfflinePayment(type))) {
90
90
  try {
91
91
  await (0, import_serve.walletPassPay)((0, import_utils.formatWalletPassParams)(payGroup));
@@ -115,11 +115,10 @@ var PaymentMethods = (props, ref) => {
115
115
  }
116
116
  await onPayByType({ type, payGroup });
117
117
  };
118
- console.log("paymentResult isAppEnv", (_c = (_b = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _b.isAppEnv) == null ? void 0 : _c.call(_b), interaction, context);
119
118
  (0, import_react.useEffect)(() => {
120
- var _a2, _b2, _c2, _d;
121
- console.log("paymentResult isAppEnv", (_b2 = (_a2 = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _a2.isAppEnv) == null ? void 0 : _b2.call(_a2));
122
- if ((_d = (_c2 = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _c2.isAppEnv) == null ? void 0 : _d.call(_c2)) {
119
+ var _a2, _b, _c, _d;
120
+ console.log("paymentResult isAppEnv", (_b = (_a2 = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _a2.isAppEnv) == null ? void 0 : _b.call(_a2));
121
+ if ((_d = (_c = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _c.isAppEnv) == null ? void 0 : _d.call(_c)) {
123
122
  interaction.utils.mountFunction("global", "paymentResult", (strResult) => {
124
123
  console.log("paymentResult", strResult);
125
124
  if (!(0, import_utils2.isJson)(strResult)) return;
@@ -135,18 +134,18 @@ var PaymentMethods = (props, ref) => {
135
134
  }
136
135
  }, []);
137
136
  const onPayByType = async ({ type, payGroup }) => {
138
- var _a2, _b2, _c2, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
137
+ var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
139
138
  console.log(type, payGroup);
140
139
  if (type === "mw.apple") {
141
140
  await ((_a2 = ApplePayRef2.current) == null ? void 0 : _a2.init({ payGroup }));
142
141
  return;
143
142
  }
144
143
  if (type === "mw.google") {
145
- await ((_b2 = GooglePayRef2.current) == null ? void 0 : _b2.init({ payGroup }));
144
+ await ((_b = GooglePayRef2.current) == null ? void 0 : _b.init({ payGroup }));
146
145
  return;
147
146
  }
148
147
  if (type === "mw.credit_card") {
149
- (_c2 = MWCreditCardRef2.current) == null ? void 0 : _c2.init({ payGroup });
148
+ (_c = MWCreditCardRef2.current) == null ? void 0 : _c.init({ payGroup });
150
149
  return;
151
150
  }
152
151
  if (type === "superpay.alipay.h5") {
@@ -404,7 +404,7 @@ var AddSerivce = (props) => {
404
404
  isTitle: 1,
405
405
  isSubtitle: 1,
406
406
  isPrice: 1,
407
- isOriginPrice: 0,
407
+ isOriginPrice: 1,
408
408
  isStock: 1
409
409
  }
410
410
  }
@@ -1,4 +1,3 @@
1
1
  import './index.less';
2
- export declare const _formatBookingDetail: (data: any, modalState: any) => any;
3
2
  declare const TicketBooking: () => JSX.Element;
4
3
  export default TicketBooking;
@@ -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
- });