@pisell/private-materials 3.2.33 → 3.2.35

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 (191) 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 +13 -13
  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 +8 -8
  11. package/es/components/Sales/Event/index.js +7 -7
  12. package/es/components/Sales/Summary/utils.d.ts +1 -1
  13. package/es/components/appointmentBooking/components/Cart/ContinueButton/index.js +86 -41
  14. package/es/components/appointmentBooking/components/Cart/Item/Total.js +3 -2
  15. package/es/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -1
  16. package/es/components/appointmentBooking/components/Cart/Item/index.js +34 -16
  17. package/es/components/appointmentBooking/components/Cart/Item/index.less +15 -9
  18. package/es/components/appointmentBooking/components/Cart/index.js +2 -7
  19. package/es/components/appointmentBooking/components/ConfirmInformation/index.d.ts +3 -0
  20. package/es/components/appointmentBooking/components/ConfirmInformation/index.js +16 -0
  21. package/es/components/appointmentBooking/components/ConfirmInformation/index.less +24 -0
  22. package/es/components/appointmentBooking/components/Content/index.js +42 -6
  23. package/es/components/appointmentBooking/components/Date/index.js +86 -24
  24. package/es/components/appointmentBooking/components/Deposit/index.d.ts +3 -0
  25. package/es/components/appointmentBooking/components/Deposit/index.js +30 -0
  26. package/es/components/appointmentBooking/components/Deposit/index.less +16 -0
  27. package/es/components/appointmentBooking/components/Form/index.d.ts +3 -0
  28. package/es/components/appointmentBooking/components/Form/index.js +110 -0
  29. package/es/components/appointmentBooking/components/Form/index.less +3 -0
  30. package/es/components/appointmentBooking/components/Header/index.js +3 -2
  31. package/es/components/appointmentBooking/components/Resource/index.js +4 -1
  32. package/es/components/appointmentBooking/components/Services/index.js +103 -9
  33. package/es/components/appointmentBooking/context.d.ts +3 -0
  34. package/es/components/appointmentBooking/context.js +19 -3
  35. package/es/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +3 -0
  36. package/es/components/appointmentBooking/deposit/components/PolicyModal/index.js +108 -0
  37. package/es/components/appointmentBooking/deposit/components/PolicyModal/index.less +9 -0
  38. package/es/components/appointmentBooking/deposit/index.d.ts +3 -0
  39. package/es/components/appointmentBooking/deposit/index.js +101 -0
  40. package/es/components/appointmentBooking/deposit/index.less +53 -0
  41. package/es/components/appointmentBooking/hooks.d.ts +16 -0
  42. package/es/components/appointmentBooking/hooks.js +138 -53
  43. package/es/components/appointmentBooking/index.js +8 -0
  44. package/es/components/appointmentBooking/locales.d.ts +36 -3
  45. package/es/components/appointmentBooking/locales.js +42 -3
  46. package/es/components/appointmentBooking/utils.d.ts +23 -1
  47. package/es/components/appointmentBooking/utils.js +112 -27
  48. package/es/components/booking/addons/model.js +5 -5
  49. package/es/components/booking/components/TabProduct/selectProductItem/index.js +4 -4
  50. package/es/components/booking/components/TabProduct/tabs/index.js +5 -1
  51. package/es/components/booking/components/browserSelect/index.js +1 -1
  52. package/es/components/booking/components/footer/index.js +6 -4
  53. package/es/components/booking/components/voucher/index.js +13 -15
  54. package/es/components/booking/forms/model.js +5 -5
  55. package/es/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
  56. package/es/components/booking/info/index.js +2 -8
  57. package/es/components/booking/info/service/like/index.js +1 -1
  58. package/es/components/booking/info/service2/utils.d.ts +1 -1
  59. package/es/components/booking/info2/service/addTimeModal/index.js +3 -2
  60. package/es/components/booking/info2/service/editService/Resources/MaxLengthSelect/index.js +4 -2
  61. package/es/components/booking/info2/service/editService/index.js +4 -11
  62. package/es/components/booking/materiels/startTime/index.js +1 -1
  63. package/es/components/booking/notes/NoteBlock/NoteItem/index.js +1 -1
  64. package/es/components/booking/notes/NoteBlock/index.js +11 -11
  65. package/es/components/booking/notes/addNote/index.js +1 -1
  66. package/es/components/booking/notes/model.js +5 -5
  67. package/es/components/booking/payments/model.js +5 -5
  68. package/es/components/booking/utils.d.ts +2 -2
  69. package/es/components/eftposPay/amount.d.ts +1 -1
  70. package/es/components/eftposPay/device.d.ts +1 -1
  71. package/es/components/eftposPay/hooks.d.ts +2 -2
  72. package/es/components/eftposPay/store/index.d.ts +4 -4
  73. package/es/components/eventBooking/components/Provider/SelectProduct/index.d.ts +4 -0
  74. package/es/components/eventBooking/components/Provider/SelectProduct/index.js +77 -0
  75. package/es/components/eventBooking/components/Provider/SelectProduct/index.less +131 -0
  76. package/es/components/listComponent/index.js +5 -5
  77. package/es/components/productExtension/card/index.js +3 -3
  78. package/es/components/productExtension/fields/Actor/CutOffTime/index.js +1 -1
  79. package/es/components/productExtension/fields/Forms/index.js +12 -12
  80. package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.js +1 -1
  81. package/es/components/productExtension/fields/SelectProducts/server.js +2 -2
  82. package/es/components/productExtension/fields/SelectResourcesTable/server.js +2 -2
  83. package/es/components/productExtension/server.js +2 -2
  84. package/es/components/ruleSetting/ruleBorder/index.js +1 -1
  85. package/es/components/schedules/calendar/index.js +4 -4
  86. package/es/components/schedules/calendar/serve.js +2 -2
  87. package/es/components/schedules/components/CurrentDay/index.js +5 -5
  88. package/es/components/schedules/components/CurrentDay/serve.js +2 -2
  89. package/es/components/schedules/components/DropdownSort/index.js +1 -1
  90. package/es/components/schedules/components/ResourceList/index.js +1 -1
  91. package/es/components/schedules/components/Search/index.js +5 -5
  92. package/es/components/schedules/model.js +5 -5
  93. package/es/components/schedules/openHours/index.js +1 -1
  94. package/es/components/schedules/openHours/serve.js +2 -2
  95. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.js +1 -1
  96. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.js +5 -5
  97. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.js +4 -4
  98. package/es/components/schedules/products/ProductDetailDrawer/index.js +3 -3
  99. package/es/components/schedules/products/serve.js +2 -2
  100. package/es/components/schedules/products/utils.js +5 -5
  101. package/es/components/schedules/resources/detail/detailContent.js +2 -2
  102. package/es/components/schedules/resources/detail/index.js +10 -10
  103. package/es/components/schedules/resources/list/index.js +2 -2
  104. package/es/components/schedules/resources/relationProduct/index.js +1 -1
  105. package/es/components/schedules/resources/serve.js +2 -2
  106. package/es/components/schedules/schedules/ScheduleDetailDrawer/index.js +9 -9
  107. package/es/components/schedules/utils.d.ts +1 -1
  108. package/es/components/schedules/utils.js +4 -4
  109. package/es/components/selectModal/index.js +2 -2
  110. package/es/components/shoppingCart/components/Cart/Product.js +16 -3
  111. package/es/components/shoppingCart/status.js +4 -1
  112. package/es/components/shoppingCart/type.d.ts +3 -0
  113. package/es/components/wallet/Detail/index.js +1 -1
  114. package/es/components/wallet/components/WalletCard.js +1 -1
  115. package/es/hooks/useComponents.js +1 -1
  116. package/es/index.d.ts +1 -0
  117. package/es/index.js +2 -1
  118. package/es/utils/index.d.ts +1 -1
  119. package/lib/components/Sales/Event/index.js +5 -1
  120. package/lib/components/Sales/Summary/utils.d.ts +1 -1
  121. package/lib/components/appointmentBooking/components/Cart/ContinueButton/index.js +56 -20
  122. package/lib/components/appointmentBooking/components/Cart/Item/Total.js +31 -24
  123. package/lib/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -1
  124. package/lib/components/appointmentBooking/components/Cart/Item/index.js +31 -11
  125. package/lib/components/appointmentBooking/components/Cart/Item/index.less +15 -9
  126. package/lib/components/appointmentBooking/components/Cart/index.js +2 -2
  127. package/lib/components/appointmentBooking/components/ConfirmInformation/index.d.ts +3 -0
  128. package/lib/components/appointmentBooking/components/ConfirmInformation/index.js +42 -0
  129. package/lib/components/appointmentBooking/components/ConfirmInformation/index.less +24 -0
  130. package/lib/components/appointmentBooking/components/Content/index.js +31 -3
  131. package/lib/components/appointmentBooking/components/Date/index.js +27 -8
  132. package/lib/components/appointmentBooking/components/Deposit/index.d.ts +3 -0
  133. package/lib/components/appointmentBooking/components/Deposit/index.js +61 -0
  134. package/lib/components/appointmentBooking/components/Deposit/index.less +16 -0
  135. package/lib/components/appointmentBooking/components/Form/index.d.ts +3 -0
  136. package/lib/components/appointmentBooking/components/Form/index.js +108 -0
  137. package/lib/components/appointmentBooking/components/Form/index.less +3 -0
  138. package/lib/components/appointmentBooking/components/Header/index.js +9 -6
  139. package/lib/components/appointmentBooking/components/Resource/index.js +2 -0
  140. package/lib/components/appointmentBooking/components/Services/index.js +48 -7
  141. package/lib/components/appointmentBooking/context.d.ts +3 -0
  142. package/lib/components/appointmentBooking/context.js +12 -4
  143. package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +3 -0
  144. package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.js +95 -0
  145. package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.less +9 -0
  146. package/lib/components/appointmentBooking/deposit/index.d.ts +3 -0
  147. package/lib/components/appointmentBooking/deposit/index.js +109 -0
  148. package/lib/components/appointmentBooking/deposit/index.less +53 -0
  149. package/lib/components/appointmentBooking/hooks.d.ts +16 -0
  150. package/lib/components/appointmentBooking/hooks.js +49 -6
  151. package/lib/components/appointmentBooking/index.js +5 -0
  152. package/lib/components/appointmentBooking/locales.d.ts +36 -3
  153. package/lib/components/appointmentBooking/locales.js +36 -3
  154. package/lib/components/appointmentBooking/utils.d.ts +23 -1
  155. package/lib/components/appointmentBooking/utils.js +84 -26
  156. package/lib/components/booking/components/footer/index.js +8 -6
  157. package/lib/components/booking/components/voucher/index.js +11 -15
  158. package/lib/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
  159. package/lib/components/booking/info/index.js +4 -6
  160. package/lib/components/booking/info/service2/utils.d.ts +1 -1
  161. package/lib/components/booking/info2/service/addTimeModal/index.js +4 -3
  162. package/lib/components/booking/info2/service/editService/Resources/MaxLengthSelect/index.js +2 -1
  163. package/lib/components/booking/info2/service/editService/index.js +4 -11
  164. package/lib/components/booking/utils.d.ts +2 -2
  165. package/lib/components/eftposPay/amount.d.ts +1 -1
  166. package/lib/components/eftposPay/device.d.ts +1 -1
  167. package/lib/components/eftposPay/hooks.d.ts +2 -2
  168. package/lib/components/eftposPay/store/index.d.ts +4 -4
  169. package/lib/components/eventBooking/components/Provider/SelectProduct/index.d.ts +4 -0
  170. package/lib/components/eventBooking/components/Provider/SelectProduct/index.js +69 -0
  171. package/lib/components/eventBooking/components/Provider/SelectProduct/index.less +131 -0
  172. package/lib/components/schedules/utils.d.ts +1 -1
  173. package/lib/components/schedules/utils.js +1 -1
  174. package/lib/components/shoppingCart/components/Cart/Product.js +14 -3
  175. package/lib/components/shoppingCart/status.js +4 -1
  176. package/lib/components/shoppingCart/type.d.ts +3 -0
  177. package/lib/components/wallet/Detail/index.js +1 -1
  178. package/lib/components/wallet/components/WalletCard.js +1 -1
  179. package/lib/index.d.ts +1 -0
  180. package/lib/index.js +3 -0
  181. package/lib/utils/index.d.ts +1 -1
  182. package/lowcode/appointment-deposit/meta.ts +58 -0
  183. package/package.json +4 -4
  184. package/es/components/ticketBooking/data.d.ts +0 -0
  185. package/es/components/ticketBooking/data.js +0 -82
  186. package/es/components/ticketBooking/index.d.ts +0 -2
  187. package/es/components/ticketBooking/index.js +0 -6
  188. package/lib/components/ticketBooking/data.d.ts +0 -0
  189. package/lib/components/ticketBooking/data.js +0 -0
  190. package/lib/components/ticketBooking/index.d.ts +0 -2
  191. package/lib/components/ticketBooking/index.js +0 -28
@@ -0,0 +1,61 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/components/appointmentBooking/components/Deposit/index.tsx
30
+ var Deposit_exports = {};
31
+ __export(Deposit_exports, {
32
+ default: () => Deposit_default
33
+ });
34
+ module.exports = __toCommonJS(Deposit_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var import_materials = require("@pisell/materials");
37
+ var import_deposit = __toESM(require("../../deposit"));
38
+ var import_context = require("../../context");
39
+ var import_utils = require("@pisell/utils");
40
+ var import_index = require("./index.less");
41
+ var Deposit = () => {
42
+ const { setIsAgreeDepositPolicy, isAgreeDepositPolicy, summary } = (0, import_context.useAppointmentBookingContext)();
43
+ const { deposit } = summary;
44
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: "appointment-deposit-wrap" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "appointment-deposit-top" }, /* @__PURE__ */ import_react.default.createElement("span", null, import_utils.locales.getText("pisell2.appointment.deposit")), /* @__PURE__ */ import_react.default.createElement(
45
+ import_materials.PisellText.Amount,
46
+ {
47
+ value: deposit == null ? void 0 : deposit.total,
48
+ showCurrencySymbol: true,
49
+ className: "amount"
50
+ }
51
+ )), /* @__PURE__ */ import_react.default.createElement(
52
+ import_deposit.default,
53
+ {
54
+ total: deposit == null ? void 0 : deposit.total,
55
+ protocols: deposit == null ? void 0 : deposit.protocols,
56
+ isAgreePolicy: isAgreeDepositPolicy,
57
+ onChange: (value) => setIsAgreeDepositPolicy(value)
58
+ }
59
+ ));
60
+ };
61
+ var Deposit_default = Deposit;
@@ -0,0 +1,16 @@
1
+ .appointment-deposit-wrap {
2
+ .appointment-deposit-top {
3
+ color: var(--Text-Text_1, #1b1b1b);
4
+ font-size: 20px;
5
+ font-weight: 600;
6
+ line-height: 28px;
7
+ display: flex;
8
+ align-items: center;
9
+ gap: 8px;
10
+ margin-bottom: 14px;
11
+
12
+ .amount {
13
+ color: var(--Blue-600, #1570ef);
14
+ }
15
+ }
16
+ }
@@ -0,0 +1,3 @@
1
+ import './index.less';
2
+ declare const Form: () => JSX.Element;
3
+ export default Form;
@@ -0,0 +1,108 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/components/appointmentBooking/components/Form/index.tsx
30
+ var Form_exports = {};
31
+ __export(Form_exports, {
32
+ default: () => Form_default
33
+ });
34
+ module.exports = __toCommonJS(Form_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var import_useComponents = __toESM(require("../../../../hooks/useComponents"));
37
+ var import_utils = require("../../utils");
38
+ var import_context = require("../../context");
39
+ var import_PolicyModal = __toESM(require("../../deposit/components/PolicyModal"));
40
+ var import_index = require("./index.less");
41
+ var Form = () => {
42
+ const manualRef = (0, import_react.useRef)();
43
+ const [currentFormIndex, setCurrentFormIndex] = (0, import_react.useState)(0);
44
+ const [showAgreement, setShowAgreement] = (0, import_react.useState)(false);
45
+ const [agreementContent, setAgreementContent] = (0, import_react.useState)({});
46
+ const { carts, resources, appointmentBooking } = (0, import_context.useAppointmentBookingContext)();
47
+ const forms = (0, import_react.useMemo)(() => {
48
+ return (0, import_utils.formatForms)((0, import_utils.formatCarts)(carts, resources));
49
+ }, [carts, resources]);
50
+ const currentForm = (0, import_react.useMemo)(() => {
51
+ console.log(forms, "formatFormsformatForms");
52
+ return forms[currentFormIndex];
53
+ }, [forms, currentFormIndex]);
54
+ const [FormCard] = (0, import_useComponents.default)({
55
+ components: ["FormCard"]
56
+ });
57
+ const goToNextForm = () => {
58
+ var _a, _b, _c;
59
+ const nextIndex = currentFormIndex + 1;
60
+ if (nextIndex < forms.length) {
61
+ setCurrentFormIndex(nextIndex);
62
+ if (!((_a = forms == null ? void 0 : forms[nextIndex]) == null ? void 0 : _a.form_id) && ((_b = forms == null ? void 0 : forms[nextIndex]) == null ? void 0 : _b.policy_id)) {
63
+ setAgreementContent({ id: (_c = forms == null ? void 0 : forms[nextIndex]) == null ? void 0 : _c.policy_id });
64
+ setShowAgreement(true);
65
+ }
66
+ } else {
67
+ appointmentBooking.next();
68
+ }
69
+ };
70
+ const handleFormFinish = (status, values) => {
71
+ console.log(status, values, "handleFormFinish");
72
+ if (status === "success") {
73
+ if (currentForm == null ? void 0 : currentForm.policy_id) {
74
+ setAgreementContent({ id: currentForm.policy_id });
75
+ setShowAgreement(true);
76
+ } else {
77
+ goToNextForm();
78
+ }
79
+ }
80
+ };
81
+ const handleAgreementOk = () => {
82
+ setShowAgreement(false);
83
+ goToNextForm();
84
+ };
85
+ return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, (currentForm == null ? void 0 : currentForm.form_id) ? /* @__PURE__ */ import_react.default.createElement("div", { className: "appointment-form-wrap" }, /* @__PURE__ */ import_react.default.createElement(
86
+ FormCard,
87
+ {
88
+ id: currentForm == null ? void 0 : currentForm.form_id,
89
+ ref: manualRef,
90
+ isGetLastData: false,
91
+ setting: {},
92
+ formWrapStyle: { padding: "16px" },
93
+ isV2API: true,
94
+ isShowSkeleton: true,
95
+ onSubmit: (status, values) => {
96
+ handleFormFinish(status, values);
97
+ }
98
+ }
99
+ )) : null, showAgreement ? /* @__PURE__ */ import_react.default.createElement(
100
+ import_PolicyModal.default,
101
+ {
102
+ open: showAgreement,
103
+ onCancel: handleAgreementOk,
104
+ item: agreementContent
105
+ }
106
+ ) : null);
107
+ };
108
+ var Form_default = Form;
@@ -0,0 +1,3 @@
1
+ .appointment-form-wrap {
2
+ padding-bottom: 16px;
3
+ }
@@ -40,17 +40,17 @@ var import_hooks = require("../../hooks");
40
40
  var import_useEngineContext = __toESM(require("../../../../hooks/useEngineContext"));
41
41
  var import_index = require("./index.less");
42
42
  var Header = () => {
43
- var _a, _b;
43
+ var _a;
44
44
  const { currentStep, appointmentBooking, resources, setTimes } = (0, import_context.useAppointmentBookingContext)();
45
45
  const shopDiscount = (0, import_hooks.useShopDiscount)();
46
46
  const context = (0, import_useEngineContext.default)();
47
47
  const { checkSkipResourceStep } = (0, import_hooks.useIsSkipResourceStep)();
48
48
  const { getStepIndex } = (0, import_hooks.useAppointmentBookingStep)();
49
49
  const stepName = (0, import_react.useMemo)(() => {
50
- var _a2, _b2, _c, _d, _e;
50
+ var _a2, _b, _c, _d, _e;
51
51
  const key = (_a2 = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _a2.key;
52
52
  if (key === "select-resource") {
53
- const name = ((_d = (_c = (_b2 = resources == null ? void 0 : resources[0]) == null ? void 0 : _b2.resources) == null ? void 0 : _c[0]) == null ? void 0 : _d.title) || "";
53
+ const name = ((_d = (_c = (_b = resources == null ? void 0 : resources[0]) == null ? void 0 : _b.resources) == null ? void 0 : _c[0]) == null ? void 0 : _d.title) || "";
54
54
  return import_utils.locales.getText("pisell2.event.select.category")(name);
55
55
  }
56
56
  return (_e = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _e.description;
@@ -81,16 +81,19 @@ var Header = () => {
81
81
  appointmentBooking.back();
82
82
  };
83
83
  const handleClose = () => {
84
- var _a2, _b2;
84
+ var _a2, _b;
85
85
  appointmentBooking.destroy();
86
86
  (_a2 = shopDiscount == null ? void 0 : shopDiscount.destroy) == null ? void 0 : _a2.call(shopDiscount);
87
87
  const utils = context.appHelper.utils || {};
88
- (_b2 = utils == null ? void 0 : utils.history) == null ? void 0 : _b2.replace("/");
88
+ (_b = utils == null ? void 0 : utils.history) == null ? void 0 : _b.replace("/");
89
89
  };
90
+ console.log(currentStep, "wh98087");
90
91
  return /* @__PURE__ */ import_react.default.createElement(
91
92
  import_progressBar.default,
92
93
  {
93
- title: (_b = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _b.title,
94
+ title: `${import_utils.locales.getText("pisell2.appointment.step")(
95
+ (currentStep == null ? void 0 : currentStep.index) + 1
96
+ )}`,
94
97
  description: stepName,
95
98
  showBack: (currentStep == null ? void 0 : currentStep.index) > 0,
96
99
  onBack: () => handleBack(),
@@ -45,8 +45,10 @@ var Resource = () => {
45
45
  const [selectedResource, setSelectedResource] = (0, import_react.useState)(0);
46
46
  const { appointmentBooking, resources, carts, resourceOtherParams } = (0, import_context.useAppointmentBookingContext)();
47
47
  const { getResourceList, autoSelectAllProductResources } = (0, import_hooks.useAppointmentBookingResource)();
48
+ const { isDateSelectedFirst } = (0, import_hooks.useAppointmentBookingSetting)();
48
49
  (0, import_react.useEffect)(() => {
49
50
  const _resources = getResourceList();
51
+ if (isDateSelectedFirst) return;
50
52
  autoSelectAllProductResources();
51
53
  getResourceList();
52
54
  }, []);
@@ -50,19 +50,44 @@ var Services = () => {
50
50
  const { utils } = context.appHelper || {};
51
51
  const appointmentBooking = (0, import_hooks.useAppointmentBooking)();
52
52
  const { products, setProducts } = (0, import_context.useAppointmentBookingContext)();
53
- (0, import_react.useEffect)(() => {
53
+ const { isDateSelectedFirst } = (0, import_hooks.useAppointmentBookingSetting)();
54
+ const getLists = async () => {
55
+ var _a;
56
+ if (isDateSelectedFirst) {
57
+ const dates = await appointmentBooking.getDateRange();
58
+ console.log(dates, "productList11");
59
+ if (!dates || !dates.length) return;
60
+ const productList2 = await appointmentBooking.loadProductByScheduleDate(
61
+ (_a = dates[0]) == null ? void 0 : _a.date
62
+ );
63
+ console.log(productList2, "productList11");
64
+ return productList2;
65
+ }
54
66
  const { productModuleParams } = appointmentBooking.otherParams || {};
55
- appointmentBooking.loadProducts(productModuleParams).then((res) => {
56
- setProducts(res || []);
57
- }).catch(() => {
67
+ const productList = await appointmentBooking.loadProducts(
68
+ productModuleParams
69
+ );
70
+ return productList;
71
+ };
72
+ (0, import_react.useEffect)(() => {
73
+ try {
74
+ getLists().then((res) => {
75
+ console.log(res, "getLists");
76
+ setProducts(res || []);
77
+ });
78
+ } catch (error) {
58
79
  setProducts([]);
59
- });
80
+ }
60
81
  }, []);
61
82
  const handleSelectProduct = (item) => {
83
+ console.log(item, "wwwss");
84
+ if (isDateSelectedFirst && !(item == null ? void 0 : item.duration)) {
85
+ appointmentBooking.openProductDetail(item.id);
86
+ }
62
87
  utils == null ? void 0 : utils.action({
63
88
  type: "pisell1.productDetail",
64
89
  data: {
65
- detail: item
90
+ detail: { ...item, open_deposit: 1 }
66
91
  },
67
92
  callback: (data) => {
68
93
  var _a, _b;
@@ -79,8 +104,24 @@ var Services = () => {
79
104
  ...data,
80
105
  options: (data == null ? void 0 : data.option) || []
81
106
  };
107
+ console.log(data, "wh987986");
82
108
  delete product.option;
83
- appointmentBooking.storeProduct(product);
109
+ if (isDateSelectedFirst) {
110
+ appointmentBooking.addProductToCart({
111
+ product: { ...product },
112
+ date: {
113
+ startTime: "2025-04-27 09:00",
114
+ endTime: "2025-04-27 11:00"
115
+ }
116
+ });
117
+ appointmentBooking.getAvailableDate({
118
+ startDate: "2025-04-27",
119
+ endDate: "2025-04-27"
120
+ });
121
+ appointmentBooking.closeProductDetail();
122
+ } else {
123
+ appointmentBooking.storeProduct(product);
124
+ }
84
125
  }
85
126
  });
86
127
  };
@@ -21,6 +21,9 @@ interface AppointmentBookingContextType {
21
21
  setResourceOtherParams: (val: any) => void;
22
22
  selectedTime: any;
23
23
  setSelectedTime: (val: any) => void;
24
+ isAgreeDepositPolicy: boolean;
25
+ setIsAgreeDepositPolicy: (val: boolean) => void;
26
+ [key: string]: any;
24
27
  }
25
28
  export declare const AppointmentBookingProvider: ({ children, }: {
26
29
  children: ReactNode;
@@ -46,15 +46,19 @@ var AppointmentBookingProvider = ({
46
46
  const [summary, setSummary] = (0, import_react.useState)({});
47
47
  const [times, setTimes] = (0, import_react.useState)([]);
48
48
  const [resources, setResources] = (0, import_react.useState)([]);
49
- const [currentStep, setCurrentStep] = (0, import_react.useState)(
50
- appointmentBooking.getCurrentStep()
51
- );
49
+ const [currentStep, setCurrentStep] = (0, import_react.useState)();
52
50
  const [isLastStep, setIsLastStep] = (0, import_react.useState)(false);
53
51
  const [carts, setCarts] = (0, import_react.useState)([]);
54
52
  const [resourceOtherParams, setResourceOtherParams] = (0, import_react.useState)({});
55
53
  const [selectedTime, setSelectedTime] = (0, import_react.useState)(null);
54
+ const [isAgreeDepositPolicy, setIsAgreeDepositPolicy] = (0, import_react.useState)(false);
55
+ const [currentResource, setCurrentResource] = (0, import_react.useState)(null);
56
56
  const { appHelper } = (0, import_useEngineContext.default)();
57
57
  const symbolic = (_a = appHelper == null ? void 0 : appHelper.utils) == null ? void 0 : _a.getSymbolic();
58
+ (0, import_react.useEffect)(() => {
59
+ const currentStep2 = appointmentBooking.getCurrentStep();
60
+ setCurrentStep(currentStep2);
61
+ }, []);
58
62
  console.log(3234234, times, resources);
59
63
  const value = {
60
64
  appointmentBooking,
@@ -77,7 +81,11 @@ var AppointmentBookingProvider = ({
77
81
  resourceOtherParams,
78
82
  setResourceOtherParams,
79
83
  selectedTime,
80
- setSelectedTime
84
+ setSelectedTime,
85
+ isAgreeDepositPolicy,
86
+ setIsAgreeDepositPolicy,
87
+ currentResource,
88
+ setCurrentResource
81
89
  };
82
90
  return /* @__PURE__ */ import_react.default.createElement(AppointmentBookingContext.Provider, { value }, children);
83
91
  };
@@ -0,0 +1,3 @@
1
+ import './index.less';
2
+ declare const DepositModal: (props: any) => JSX.Element;
3
+ export default DepositModal;
@@ -0,0 +1,95 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/components/appointmentBooking/deposit/components/PolicyModal/index.tsx
30
+ var PolicyModal_exports = {};
31
+ __export(PolicyModal_exports, {
32
+ default: () => PolicyModal_default
33
+ });
34
+ module.exports = __toCommonJS(PolicyModal_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var import_antd = require("antd");
37
+ var import_materials = require("@pisell/materials");
38
+ var import_utils = require("@pisell/utils");
39
+ var import_context = require("../../../context");
40
+ var import_index = require("./index.less");
41
+ var DepositModal = (props) => {
42
+ const { open, onCancel, item } = props;
43
+ const { appointmentBooking } = (0, import_context.useAppointmentBookingContext)();
44
+ const [policy, setPolicy] = (0, import_react.useState)(null);
45
+ const [loading, setLoading] = (0, import_react.useState)(false);
46
+ const getPolicy = async (id) => {
47
+ setLoading(true);
48
+ try {
49
+ const { data } = await appointmentBooking.getProtocol(id);
50
+ setPolicy(data);
51
+ } catch (error) {
52
+ console.log(error);
53
+ } finally {
54
+ setLoading(false);
55
+ }
56
+ };
57
+ (0, import_react.useEffect)(() => {
58
+ if (!open || !(item == null ? void 0 : item.id)) return setPolicy(null);
59
+ getPolicy(item == null ? void 0 : item.id);
60
+ }, [open]);
61
+ return /* @__PURE__ */ import_react.default.createElement(
62
+ import_materials.PisellModal,
63
+ {
64
+ open,
65
+ platform: (0, import_utils.isMobile)() ? "h5" : "pc",
66
+ closable: true,
67
+ bodyStyle: { padding: "24px", minHeight: "250px" },
68
+ destroyOnClose: true,
69
+ title: (item == null ? void 0 : item.title) || "协议",
70
+ onCancel,
71
+ mobileModalHeight: "auto",
72
+ className: "policy-modal-wrap",
73
+ cancelVisible: false,
74
+ okText: import_utils.locales.getText("pisell2.appointment.deposit.close"),
75
+ onOk: onCancel
76
+ },
77
+ /* @__PURE__ */ import_react.default.createElement(import_antd.Spin, { style: { minHeight: "250px" }, spinning: loading }, (policy == null ? void 0 : policy.content) ? /* @__PURE__ */ import_react.default.createElement(
78
+ "div",
79
+ {
80
+ className: "policy-content",
81
+ dangerouslySetInnerHTML: {
82
+ __html: policy == null ? void 0 : policy.content
83
+ }
84
+ }
85
+ ) : /* @__PURE__ */ import_react.default.createElement(
86
+ import_materials.PisellEmpty,
87
+ {
88
+ description: import_utils.locales.getText(
89
+ "pisell2.appointment.booking.empty.data"
90
+ )
91
+ }
92
+ ))
93
+ );
94
+ };
95
+ var PolicyModal_default = DepositModal;
@@ -0,0 +1,9 @@
1
+ .policy-modal-wrap {
2
+ .pisell-lowcode-modal-header {
3
+ border: none;
4
+ }
5
+
6
+ .ant-empty-image {
7
+ height: auto !important;
8
+ }
9
+ }
@@ -0,0 +1,3 @@
1
+ import './index.less';
2
+ declare const Deposit: (props: any) => JSX.Element;
3
+ export default Deposit;
@@ -0,0 +1,109 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/components/appointmentBooking/deposit/index.tsx
30
+ var deposit_exports = {};
31
+ __export(deposit_exports, {
32
+ default: () => deposit_default
33
+ });
34
+ module.exports = __toCommonJS(deposit_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var import_antd = require("antd");
37
+ var import_materials = require("@pisell/materials");
38
+ var import_utils = require("@pisell/utils");
39
+ var import_utils2 = require("../utils");
40
+ var import_useEngineContext = __toESM(require("../../../hooks/useEngineContext"));
41
+ var import_PolicyModal = __toESM(require("./components/PolicyModal"));
42
+ var import_index = require("./index.less");
43
+ var Deposit = (props) => {
44
+ var _a;
45
+ const {
46
+ protocols,
47
+ total,
48
+ title,
49
+ isAgreePolicy = true,
50
+ isShowTitle = true,
51
+ onChange
52
+ } = props;
53
+ const context = (0, import_useEngineContext.default)();
54
+ const utils = context.appHelper.utils || {};
55
+ const locale = ((_a = utils == null ? void 0 : utils.storage) == null ? void 0 : _a.get("umi_locale")) || "en-US";
56
+ const [visible, setVisible] = (0, import_react.useState)(false);
57
+ const [policyItem, setPolicyItem] = (0, import_react.useState)();
58
+ const isEn = (0, import_react.useMemo)(() => {
59
+ return locale.includes("en");
60
+ }, [locale]);
61
+ const _policyText = (0, import_react.useCallback)(
62
+ (item, index) => {
63
+ if (!item || !(protocols == null ? void 0 : protocols.length)) return "";
64
+ return (0, import_utils2.getPunctuationMark)(index, protocols.length, isEn);
65
+ },
66
+ [protocols]
67
+ );
68
+ const handleAgreed = () => {
69
+ onChange && onChange(!isAgreePolicy);
70
+ };
71
+ return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "appointment-deposit-bottom" }, isShowTitle ? /* @__PURE__ */ import_react.default.createElement("span", { className: "title" }, title) : null, /* @__PURE__ */ import_react.default.createElement("div", { className: "tip" }, isEn ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
72
+ import_materials.PisellText.Amount,
73
+ {
74
+ value: total,
75
+ showCurrencySymbol: true,
76
+ className: "amount"
77
+ }
78
+ ), /* @__PURE__ */ import_react.default.createElement("span", null, import_utils.locales.getText("pisell2.appointment.deposit.amount.tip1"))) : /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("span", null, import_utils.locales.getText("pisell2.appointment.deposit.amount.tip1")), /* @__PURE__ */ import_react.default.createElement(
79
+ import_materials.PisellText.Amount,
80
+ {
81
+ value: total,
82
+ showCurrencySymbol: true,
83
+ className: "amount"
84
+ }
85
+ ), /* @__PURE__ */ import_react.default.createElement("span", null, import_utils.locales.getText("pisell2.appointment.deposit.amount.tip2")))), /* @__PURE__ */ import_react.default.createElement("div", { className: "checkbox-wrap", onClick: () => handleAgreed() }, /* @__PURE__ */ import_react.default.createElement(import_antd.Checkbox, { checked: isAgreePolicy }), /* @__PURE__ */ import_react.default.createElement("div", { className: "policy-box" }, /* @__PURE__ */ import_react.default.createElement("span", null, import_utils.locales.getText("pisell2.appointment.deposit.agreed")), /* @__PURE__ */ import_react.default.createElement("div", { className: "policy-wrap" }, protocols == null ? void 0 : protocols.map((item, index) => {
86
+ return /* @__PURE__ */ import_react.default.createElement(
87
+ "span",
88
+ {
89
+ key: item == null ? void 0 : item.id,
90
+ onClick: (e) => {
91
+ e.stopPropagation();
92
+ e.preventDefault();
93
+ setPolicyItem(item);
94
+ setVisible(true);
95
+ }
96
+ },
97
+ item == null ? void 0 : item.title,
98
+ /* @__PURE__ */ import_react.default.createElement("span", { className: "symbol" }, _policyText(item, index))
99
+ );
100
+ }))))), /* @__PURE__ */ import_react.default.createElement(
101
+ import_PolicyModal.default,
102
+ {
103
+ open: visible,
104
+ onCancel: () => setVisible(false),
105
+ item: policyItem
106
+ }
107
+ ));
108
+ };
109
+ var deposit_default = Deposit;
@@ -0,0 +1,53 @@
1
+ .appointment-deposit-bottom {
2
+ display: flex;
3
+ flex-direction: column;
4
+ justify-content: center;
5
+ align-items: flex-start;
6
+ gap: 8px;
7
+ align-self: stretch;
8
+
9
+ .title {
10
+ color: var(--Text-Text_1, #1b1b1b);
11
+ font-size: 16px;
12
+ font-style: normal;
13
+ font-weight: 700;
14
+ line-height: 24px;
15
+ }
16
+
17
+ .tip {
18
+ color: var(--Base-Black, #000);
19
+ font-size: 14px;
20
+ font-style: normal;
21
+ font-weight: 400;
22
+ line-height: 20px;
23
+ .amount {
24
+ font-weight: 600;
25
+ margin-right: 2px;
26
+ }
27
+ }
28
+
29
+ .checkbox-wrap {
30
+ display: flex;
31
+ cursor: pointer;
32
+ width: 100%;
33
+ .policy-box {
34
+ padding-left: 6px;
35
+ cursor: pointer;
36
+ font-size: 14px;
37
+ font-style: normal;
38
+ font-weight: 400;
39
+ line-height: 20px;
40
+ color: var(--Base-Black, #000);
41
+ flex: 1;
42
+ }
43
+
44
+ .policy-wrap {
45
+ color: var(--Blue-600, #1570ef);
46
+ display: inline;
47
+ word-break: break-word;
48
+ .symbol {
49
+ color: var(--Base-Black, #000);
50
+ }
51
+ }
52
+ }
53
+ }