@pisell/private-materials 3.0.28 → 3.0.30

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 (62) 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 +7 -7
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +9 -9
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +8 -8
  11. package/es/components/booking/components/collapsibleList/index.js +1 -1
  12. package/es/components/booking/components/footer/utils.js +5 -1
  13. package/es/components/booking/deposit/ClientItem/index.d.ts +18 -0
  14. package/es/components/booking/deposit/ClientItem/index.js +43 -0
  15. package/es/components/booking/deposit/ClientItem/index.less +37 -0
  16. package/es/components/booking/deposit/DepositItem/index.d.ts +20 -0
  17. package/es/components/booking/deposit/DepositItem/index.js +105 -0
  18. package/es/components/booking/deposit/DepositItem/index.less +88 -0
  19. package/es/components/booking/deposit/EditDepositModal/index.d.ts +9 -0
  20. package/es/components/booking/deposit/EditDepositModal/index.js +126 -0
  21. package/es/components/booking/deposit/EditDepositModal/index.less +24 -0
  22. package/es/components/booking/deposit/index.d.ts +3 -0
  23. package/es/components/booking/deposit/index.js +164 -0
  24. package/es/components/booking/deposit/index.less +3 -0
  25. package/es/components/booking/deposit/serve.d.ts +8 -0
  26. package/es/components/booking/deposit/serve.js +27 -0
  27. package/es/components/booking/forms/index.js +2 -1
  28. package/es/components/booking/info/service/addService/index.js +2 -2
  29. package/es/components/booking/info/service/editService/index.js +50 -21
  30. package/es/components/booking/locales.d.ts +54 -0
  31. package/es/components/booking/locales.js +57 -3
  32. package/es/components/booking/utils.d.ts +37 -0
  33. package/es/components/booking/utils.js +71 -8
  34. package/es/index.d.ts +1 -0
  35. package/es/index.js +2 -1
  36. package/lib/components/booking/components/collapsibleList/index.js +1 -1
  37. package/lib/components/booking/components/footer/utils.js +4 -1
  38. package/lib/components/booking/deposit/ClientItem/index.d.ts +18 -0
  39. package/lib/components/booking/deposit/ClientItem/index.js +71 -0
  40. package/lib/components/booking/deposit/ClientItem/index.less +37 -0
  41. package/lib/components/booking/deposit/DepositItem/index.d.ts +20 -0
  42. package/lib/components/booking/deposit/DepositItem/index.js +112 -0
  43. package/lib/components/booking/deposit/DepositItem/index.less +88 -0
  44. package/lib/components/booking/deposit/EditDepositModal/index.d.ts +9 -0
  45. package/lib/components/booking/deposit/EditDepositModal/index.js +131 -0
  46. package/lib/components/booking/deposit/EditDepositModal/index.less +24 -0
  47. package/lib/components/booking/deposit/index.d.ts +3 -0
  48. package/lib/components/booking/deposit/index.js +186 -0
  49. package/lib/components/booking/deposit/index.less +3 -0
  50. package/lib/components/booking/deposit/serve.d.ts +8 -0
  51. package/lib/components/booking/deposit/serve.js +30 -0
  52. package/lib/components/booking/forms/index.js +1 -1
  53. package/lib/components/booking/info/service/addService/index.js +2 -2
  54. package/lib/components/booking/info/service/editService/index.js +33 -11
  55. package/lib/components/booking/locales.d.ts +54 -0
  56. package/lib/components/booking/locales.js +57 -3
  57. package/lib/components/booking/utils.d.ts +37 -0
  58. package/lib/components/booking/utils.js +33 -10
  59. package/lib/index.d.ts +1 -0
  60. package/lib/index.js +3 -0
  61. package/lowcode/booking-deposit/meta.ts +93 -0
  62. package/package.json +3 -3
@@ -0,0 +1,131 @@
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/booking/deposit/EditDepositModal/index.tsx
30
+ var EditDepositModal_exports = {};
31
+ __export(EditDepositModal_exports, {
32
+ default: () => EditDepositModal_default
33
+ });
34
+ module.exports = __toCommonJS(EditDepositModal_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var import_antd = require("antd");
37
+ var import_index = require("./index.less");
38
+ var import_utils = require("@pisell/utils");
39
+ var EditDepositModal = (props, ref) => {
40
+ const { onChange, amountSymbol, totalAmount } = props;
41
+ const [open, setOpen] = (0, import_react.useState)(false);
42
+ const [depositMode, setDepositMode] = (0, import_react.useState)("1");
43
+ const [amount, setAmount] = (0, import_react.useState)(null);
44
+ const inputNumberRef = (0, import_react.useRef)(null);
45
+ const options = [
46
+ { label: "固定金额", value: "1" }
47
+ // { label: "订单百分比", value: "2" },
48
+ ];
49
+ const onAmountChange = (value) => {
50
+ setAmount(value);
51
+ };
52
+ const amountProps = (0, import_react.useMemo)(() => {
53
+ if (depositMode === "1") {
54
+ return {
55
+ prefix: amountSymbol
56
+ };
57
+ }
58
+ return {
59
+ min: 0,
60
+ max: 100,
61
+ addonAfter: "%"
62
+ };
63
+ }, [depositMode]);
64
+ const handleOk = () => {
65
+ if (amount === 0) {
66
+ return import_antd.message.error(import_utils.locales.getText("pisell2.text.deposit-amount-message"));
67
+ }
68
+ if (!amount) {
69
+ return import_antd.message.error(import_utils.locales.getText("pisell2.text.deposit-amount-message3"));
70
+ }
71
+ if (amount > totalAmount) {
72
+ return import_antd.message.error(import_utils.locales.getText("pisell2.text.deposit-amount-message2"));
73
+ }
74
+ onChange(amount);
75
+ setOpen(false);
76
+ };
77
+ const handleOpenChange = (val) => {
78
+ setOpen(val);
79
+ };
80
+ (0, import_react.useEffect)(() => {
81
+ if (open) {
82
+ setTimeout(() => {
83
+ var _a;
84
+ (_a = inputNumberRef.current) == null ? void 0 : _a.focus();
85
+ });
86
+ }
87
+ }, [open]);
88
+ (0, import_react.useImperativeHandle)(ref, () => {
89
+ return {
90
+ handleOpen: (amount2) => {
91
+ if (amount2) {
92
+ setAmount(amount2);
93
+ }
94
+ handleOpenChange(true);
95
+ },
96
+ handleClose: () => handleOpenChange(false)
97
+ };
98
+ });
99
+ const onCancel = () => {
100
+ handleOpenChange(false);
101
+ setAmount(null);
102
+ };
103
+ return /* @__PURE__ */ import_react.default.createElement(
104
+ import_antd.Modal,
105
+ {
106
+ open,
107
+ width: 400,
108
+ cancelButtonProps: { block: true, size: "large" },
109
+ okButtonProps: { block: true, size: "large" },
110
+ className: "pisell-lowcode__edit-deposit-modal",
111
+ title: import_utils.locales.getText("pisell2.text.deposit-deposit-amount"),
112
+ onCancel,
113
+ onOk: handleOk,
114
+ destroyOnClose: true
115
+ },
116
+ /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__edit-deposit-modal-field-list" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__edit-deposit-modal-field" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__edit-deposit-modal-field-label" }, import_utils.locales.getText("pisell2.text.deposit-amount")), /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(
117
+ import_antd.InputNumber,
118
+ {
119
+ ref: inputNumberRef,
120
+ style: { width: "100%" },
121
+ onChange: onAmountChange,
122
+ value: amount,
123
+ size: "large",
124
+ min: 0,
125
+ precision: 2,
126
+ ...amountProps
127
+ }
128
+ ))))
129
+ );
130
+ };
131
+ var EditDepositModal_default = (0, import_react.forwardRef)(EditDepositModal);
@@ -0,0 +1,24 @@
1
+ .pisell-lowcode__edit-deposit-modal {
2
+ .pisell-lowcode-modal-footer {
3
+ display: flex;
4
+ gap: 12px;
5
+ }
6
+ .pisell-lowcode__edit-deposit-modal-field-list {
7
+ display: flex;
8
+ flex-direction: column;
9
+ gap: 20px;
10
+ margin-bottom: 32px;
11
+ }
12
+ .pisell-lowcode__edit-deposit-modal-field {
13
+ display: flex;
14
+ flex-direction: column;
15
+ gap: 6px;
16
+ .pisell-lowcode__edit-deposit-modal-field-label {
17
+ color: var(--Gray-700, #344054);
18
+ font-size: 14px;
19
+ font-style: normal;
20
+ font-weight: 500;
21
+ line-height: 20px; /* 142.857% */
22
+ }
23
+ }
24
+ }
@@ -0,0 +1,3 @@
1
+ import React from "react";
2
+ declare const Deposit: (props: any) => React.JSX.Element;
3
+ export default Deposit;
@@ -0,0 +1,186 @@
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/booking/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_utils = require("@pisell/utils");
37
+ var import_emptyBooking = __toESM(require("../components/emptyBooking"));
38
+ var import_tabPane = __toESM(require("../components/tabPane"));
39
+ var import_DepositItem = __toESM(require("./DepositItem"));
40
+ var import_EditDepositModal = __toESM(require("./EditDepositModal"));
41
+ var import_antd = require("antd");
42
+ var import_amount = require("../components/footer/amount");
43
+ var import_useEngineContext = __toESM(require("../../../hooks/useEngineContext"));
44
+ var import_utils2 = require("../utils");
45
+ var import_serve = require("./serve");
46
+ var import_dayjs = __toESM(require("dayjs"));
47
+ var Deposit = (props) => {
48
+ var _a, _b;
49
+ const { globalState, setState } = props;
50
+ const [loading, setLoading] = (0, import_react.useState)(false);
51
+ const [modal, contextHolder] = import_antd.Modal.useModal();
52
+ const editDepositModalRef = (0, import_react.useRef)();
53
+ const context = (0, import_useEngineContext.default)();
54
+ const { isTerminal, interaction } = ((_a = context.appHelper) == null ? void 0 : _a.utils) || {};
55
+ import_utils2.request.setRequest(context.appHelper.utils.request);
56
+ const { bookingDetail, bookingId, amountSymbol, generatePaymentLink, locale } = globalState;
57
+ const create = () => {
58
+ var _a2, _b2;
59
+ (_b2 = (_a2 = editDepositModalRef.current) == null ? void 0 : _a2.handleOpen) == null ? void 0 : _b2.call(_a2);
60
+ };
61
+ const deleteDeposit = () => {
62
+ modal.confirm({
63
+ title: import_utils.locales.getText("pisell2.text.deposit-delete-message-title"),
64
+ content: import_utils.locales.getText("pisell2.text.deposit-delete-message"),
65
+ onOk() {
66
+ (0, import_serve.editDepositAmount)(bookingDetail.id, {
67
+ deposit_amount: 0
68
+ }).then((res) => {
69
+ setState({
70
+ bookingDetail: {
71
+ ...bookingDetail,
72
+ deposit_amount: 0
73
+ }
74
+ });
75
+ });
76
+ }
77
+ });
78
+ };
79
+ const total = (0, import_react.useMemo)(() => {
80
+ return (0, import_amount.getSumTotal)(globalState, false);
81
+ }, [globalState]);
82
+ const depositList = (0, import_react.useMemo)(() => {
83
+ if (!bookingId)
84
+ return [];
85
+ if (Number(bookingDetail == null ? void 0 : bookingDetail.deposit_amount) === 0)
86
+ return [];
87
+ return [
88
+ {
89
+ customer: bookingDetail == null ? void 0 : bookingDetail.customer,
90
+ status: (bookingDetail == null ? void 0 : bookingDetail.deposit_payment_time) ? "paid" : "unpaid",
91
+ totalAmount: total.expectAmount,
92
+ depositAmount: bookingDetail == null ? void 0 : bookingDetail.deposit_amount,
93
+ createdTime: (0, import_dayjs.default)(bookingDetail == null ? void 0 : bookingDetail.created_at).format(locale === "en" ? "dddd, D MMMM YYYY HH:mm" : "YYYY-MM-DD HH:mm"),
94
+ orderId: bookingDetail == null ? void 0 : bookingDetail.id,
95
+ orderNumber: bookingDetail == null ? void 0 : bookingDetail.shop_full_order_number,
96
+ amountSymbol: (globalState == null ? void 0 : globalState.amountSymbol) || "$",
97
+ totalAmountStr: (0, import_utils.formatAmount)(
98
+ total.expectAmount,
99
+ 2,
100
+ (globalState == null ? void 0 : globalState.amountSymbol) || "$"
101
+ )
102
+ }
103
+ ];
104
+ }, [bookingDetail, total == null ? void 0 : total.expectAmount, globalState == null ? void 0 : globalState.amountSymbol, bookingDetail == null ? void 0 : bookingDetail.deposit_amount]);
105
+ const isBookingCancelled = ((_b = bookingDetail == null ? void 0 : bookingDetail.bookings) == null ? void 0 : _b.appointment_status) === "cancelled";
106
+ const isPaid = (bookingDetail == null ? void 0 : bookingDetail.payment_time) !== null;
107
+ const footer = (0, import_react.useMemo)(() => {
108
+ if (!bookingId)
109
+ return null;
110
+ if (isBookingCancelled)
111
+ return null;
112
+ if (isPaid)
113
+ return null;
114
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-deposit-footer" }, /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { size: "large", block: true, onClick: depositList.length > 0 ? deleteDeposit : create }, depositList.length > 0 ? import_utils.locales.getText("pisell2.text.deposit-delete") : import_utils.locales.getText("pisell2.text.add")));
115
+ }, [depositList, isBookingCancelled, isPaid]);
116
+ const handleEdit = (e, item) => {
117
+ var _a2, _b2;
118
+ (_b2 = (_a2 = editDepositModalRef.current) == null ? void 0 : _a2.handleOpen) == null ? void 0 : _b2.call(_a2, item.depositAmount);
119
+ };
120
+ const handleChange = (amount) => {
121
+ (0, import_serve.editDepositAmount)(bookingDetail.id, {
122
+ deposit_amount: amount
123
+ }).then((res) => {
124
+ setState({
125
+ bookingDetail: {
126
+ ...bookingDetail,
127
+ deposit_amount: amount
128
+ }
129
+ });
130
+ });
131
+ };
132
+ const handleGoOrderDetail = () => {
133
+ var _a2, _b2;
134
+ if (isTerminal == null ? void 0 : isTerminal()) {
135
+ return (_b2 = (_a2 = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _a2.postMessageToApp) == null ? void 0 : _b2.call(_a2, {
136
+ module: "booking",
137
+ key: "edit_order",
138
+ data: {
139
+ order_id: bookingDetail.id
140
+ }
141
+ });
142
+ }
143
+ globalState.action({
144
+ type: "pisell1.goOrderDetail",
145
+ data: {
146
+ "[unique_order_id]": bookingDetail.id
147
+ }
148
+ });
149
+ };
150
+ return /* @__PURE__ */ import_react.default.createElement(
151
+ import_tabPane.default,
152
+ {
153
+ loading,
154
+ header: import_utils.locales.getText("pisell2.text.deposit-list"),
155
+ footer
156
+ },
157
+ !bookingId || !depositList.length ? /* @__PURE__ */ import_react.default.createElement(
158
+ import_emptyBooking.default,
159
+ {
160
+ description: !bookingId ? void 0 : import_utils.locales.getText("pisell2.text.deposit-list-empty")
161
+ }
162
+ ) : depositList.map((item) => /* @__PURE__ */ import_react.default.createElement(
163
+ import_DepositItem.default,
164
+ {
165
+ key: item.status,
166
+ ...item,
167
+ generatePaymentLink,
168
+ handleGoOrderDetail,
169
+ onEdit: (e) => handleEdit(e, item),
170
+ isPaid,
171
+ isBookingCancelled
172
+ }
173
+ )),
174
+ /* @__PURE__ */ import_react.default.createElement(
175
+ import_EditDepositModal.default,
176
+ {
177
+ totalAmount: total.expectAmount,
178
+ ref: editDepositModalRef,
179
+ amountSymbol,
180
+ onChange: handleChange
181
+ }
182
+ ),
183
+ contextHolder
184
+ );
185
+ };
186
+ var deposit_default = Deposit;
@@ -0,0 +1,3 @@
1
+ .pisell-lowcode__booking-deposit-footer {
2
+
3
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * 编辑订单金额
3
+ * @param orderId
4
+ * @param params
5
+ */
6
+ export declare const editDepositAmount: (orderId: number, params: {
7
+ deposit_amount: number;
8
+ }) => Promise<any>;
@@ -0,0 +1,30 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/components/booking/deposit/serve.ts
20
+ var serve_exports = {};
21
+ __export(serve_exports, {
22
+ editDepositAmount: () => editDepositAmount
23
+ });
24
+ module.exports = __toCommonJS(serve_exports);
25
+ var import_utils = require("../utils");
26
+ var editDepositAmount = async (orderId, params) => import_utils.request.getRequest().put(`/shop/order/appointment/deposit/${orderId}`, params);
27
+ // Annotate the CommonJS export names for ESM import in node:
28
+ 0 && (module.exports = {
29
+ editDepositAmount
30
+ });
@@ -139,7 +139,7 @@ var Forms = (0, import_model.Provider)((props) => {
139
139
  import_antd.message.success(
140
140
  import_utils.locales.getText("pisell2.text.forms") + import_utils.locales.getText("pisell2.text.updated")
141
141
  );
142
- state == null ? void 0 : state.callback({ order_id: state.bookingId });
142
+ state == null ? void 0 : state.callback({ order_id: state.bookingId, afterCloseUpdate: true });
143
143
  } catch (err) {
144
144
  }
145
145
  };
@@ -160,12 +160,11 @@ var Info = () => {
160
160
  quantity: 1,
161
161
  price: item.price,
162
162
  product_name: item.title,
163
- other: e
163
+ other: JSON.parse(JSON.stringify(e))
164
164
  },
165
165
  new: 1
166
166
  };
167
167
  let _total = (0, import_utils2.getProductTotalPrice)(cacheItem);
168
- console.log("_total", e);
169
168
  cacheItem._extend.total = _total;
170
169
  cacheItem._extend.origin_total = _total;
171
170
  const _isEdit = !!state.service.cacheItem;
@@ -173,6 +172,7 @@ var Info = () => {
173
172
  cacheItem._id = (_a2 = state.service.cacheItem) == null ? void 0 : _a2._id;
174
173
  cacheItem.new = 0;
175
174
  }
175
+ console.log("_total", cacheItem);
176
176
  dispatch({
177
177
  type: "setService",
178
178
  payload: {
@@ -49,7 +49,7 @@ var import_utils3 = require("../../../utils");
49
49
  var import_like = __toESM(require("../like"));
50
50
  var import_mock = require("../../../mock");
51
51
  var Info = () => {
52
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
52
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
53
53
  const [form] = import_antd.Form.useForm();
54
54
  const useTotal = import_antd.Form.useWatch("total", form);
55
55
  const useLikeStatus = import_antd.Form.useWatch("like_status", form);
@@ -117,6 +117,7 @@ var Info = () => {
117
117
  (_c2 = (_b2 = (_a2 = state.bookingConfig) == null ? void 0 : _a2.config) == null ? void 0 : _b2.basic) == null ? void 0 : _c2.service_time,
118
118
  import_utils.locales.locale
119
119
  );
120
+ let timeSlices = [...obj.timeSlices];
120
121
  let durationSlicesBasedOnTime = [...obj.durationSlicesBasedOnTime];
121
122
  if (flexibleOption) {
122
123
  durationSlicesBasedOnTime.unshift(flexibleOption);
@@ -129,11 +130,22 @@ var Info = () => {
129
130
  disabled: true
130
131
  });
131
132
  }
133
+ if (useStartTime && useStartTime !== "now" && !timeSlices.some((d) => d.value === useStartTime)) {
134
+ timeSlices.unshift({
135
+ label: (0, import_dayjs.default)(useStartTime, "HH:mm").format("hh:mm A"),
136
+ value: useStartTime
137
+ });
138
+ }
139
+ timeSlices.unshift({
140
+ label: import_utils.locales.getText("pisell2.text.now"),
141
+ value: "now"
142
+ });
132
143
  return {
133
144
  ...obj,
145
+ timeSlices,
134
146
  durationSlicesBasedOnTime
135
147
  };
136
- }, [state, import_utils.locales.locale, useDuration, flexibleOption]);
148
+ }, [state, import_utils.locales.locale, useDuration, useStartTime, flexibleOption]);
137
149
  (0, import_react.useEffect)(() => {
138
150
  try {
139
151
  if (useDuration.indexOf("flexible_") == 0) {
@@ -167,9 +179,19 @@ var Info = () => {
167
179
  })
168
180
  );
169
181
  _list = _list.sort((a, b) => b.usable ? 1 : -1);
170
- if (useResource && !_list.find((d) => d.form_record_id === useResource)) {
182
+ if (useResource) {
183
+ if (!_list.find((d) => d.form_record_id === useResource)) {
184
+ form.setFieldsValue({
185
+ resource: 0
186
+ });
187
+ }
188
+ } else {
189
+ let _useResource = 0;
190
+ if (_list.length === 2) {
191
+ _useResource = _list[1].form_record_id;
192
+ }
171
193
  form.setFieldsValue({
172
- resource: 0
194
+ resource: _useResource
173
195
  });
174
196
  }
175
197
  dispatch({
@@ -245,7 +267,7 @@ var Info = () => {
245
267
  form.setFieldsValue({ discount });
246
268
  };
247
269
  const onFinish = (values) => {
248
- var _a2, _b2;
270
+ var _a2;
249
271
  let _list = [...state.service.value];
250
272
  let _item = { ...state.service.cacheItem, errorList };
251
273
  let _extend = {
@@ -263,10 +285,10 @@ var Info = () => {
263
285
  _extend.bundle_edit = 1;
264
286
  }
265
287
  _item._extend = _extend;
266
- if ((_b2 = state.service.cacheItem) == null ? void 0 : _b2.new) {
288
+ let _id = _item == null ? void 0 : _item._id;
289
+ if (!_list.some((d) => d._id === _id)) {
267
290
  _list.push(_item);
268
291
  } else {
269
- let _id = _item == null ? void 0 : _item._id;
270
292
  _list = _list.map((d) => d._id === _id ? { ..._item, new: 0 } : d);
271
293
  }
272
294
  (0, import_utils3.deleteCacheParams)();
@@ -330,7 +352,7 @@ var Info = () => {
330
352
  const bundles = (0, import_react.useMemo)(() => {
331
353
  var _a2, _b2, _c2, _d2;
332
354
  return ((_d2 = (_c2 = (_b2 = (_a2 = state.service) == null ? void 0 : _a2.cacheItem) == null ? void 0 : _b2._extend) == null ? void 0 : _c2.other) == null ? void 0 : _d2.bundle) || [];
333
- }, [(_f = state.service) == null ? void 0 : _f.cacheItem]);
355
+ }, [(_i = (_h = (_g = (_f = state.service) == null ? void 0 : _f.cacheItem) == null ? void 0 : _g._extend) == null ? void 0 : _h.other) == null ? void 0 : _i.bundle]);
334
356
  return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
335
357
  import_drawer.default,
336
358
  {
@@ -364,7 +386,7 @@ var Info = () => {
364
386
  });
365
387
  }
366
388
  },
367
- /* @__PURE__ */ import_react.default.createElement("div", { className: "current-service-info-name" }, ((_i = (_h = (_g = state.service) == null ? void 0 : _g.cacheItem) == null ? void 0 : _h._extend) == null ? void 0 : _i.product_name) || "-"),
389
+ /* @__PURE__ */ import_react.default.createElement("div", { className: "current-service-info-name" }, ((_l = (_k = (_j = state.service) == null ? void 0 : _j.cacheItem) == null ? void 0 : _k._extend) == null ? void 0 : _l.product_name) || "-"),
368
390
  /* @__PURE__ */ import_react.default.createElement(
369
391
  import_collapsibleList.default,
370
392
  {
@@ -389,8 +411,8 @@ var Info = () => {
389
411
  precision: 2,
390
412
  style: { width: "100%" },
391
413
  min: 0,
392
- max: ((_k = (_j = state.service.cacheItem) == null ? void 0 : _j._extend) == null ? void 0 : _k.origin_total) || 0,
393
- placeholder: ((_m = (_l = state.service.cacheItem) == null ? void 0 : _l._extend) == null ? void 0 : _m.origin_total) || "0"
414
+ max: ((_n = (_m = state.service.cacheItem) == null ? void 0 : _m._extend) == null ? void 0 : _n.origin_total) || 0,
415
+ placeholder: ((_p = (_o = state.service.cacheItem) == null ? void 0 : _o._extend) == null ? void 0 : _p.origin_total) || "0"
394
416
  }
395
417
  )
396
418
  )), /* @__PURE__ */ import_react.default.createElement(import_antd.Col, { span: 12 }, /* @__PURE__ */ import_react.default.createElement(
@@ -122,6 +122,24 @@ declare const _default: {
122
122
  'pisell2.text.order.sales.channel.tableorder': string;
123
123
  'pisell2.text.order.sales.channel.reserve': string;
124
124
  'pisell2.text.rebook': string;
125
+ 'pisell2.text.now': string;
126
+ 'pisell2.text.deposit-list': string;
127
+ 'pisell2.text.deposit-item-status-paid': string;
128
+ 'pisell2.text.deposit-item-status-unpaid': string;
129
+ 'pisell2.text.deposit-order-total': string;
130
+ 'pisell2.text.deposit-order-detail': string;
131
+ 'pisell2.text.deposit-collect-deposit': string;
132
+ 'pisell2.text.deposit-order-no': string;
133
+ 'pisell2.text.deposit-amount': string;
134
+ 'pisell2.text.deposit-deposit-amount': string;
135
+ 'pisell2.text.deposit-generate-payment-link': string;
136
+ 'pisell2.text.deposit-list-empty': string;
137
+ 'pisell2.text.deposit-amount-message': string;
138
+ 'pisell2.text.deposit-amount-message2': string;
139
+ 'pisell2.text.deposit-amount-message3': string;
140
+ 'pisell2.text.deposit-delete': string;
141
+ 'pisell2.text.deposit-delete-message-title': string;
142
+ 'pisell2.text.deposit-delete-message': string;
125
143
  };
126
144
  'zh-CN': {
127
145
  'pisell2.text.refunded-amount': string;
@@ -246,6 +264,24 @@ declare const _default: {
246
264
  'pisell2.text.order.sales.channel.tableorder': string;
247
265
  'pisell2.text.order.sales.channel.reserve': string;
248
266
  'pisell2.text.rebook': string;
267
+ 'pisell2.text.now': string;
268
+ 'pisell2.text.deposit-list': string;
269
+ 'pisell2.text.deposit-item-status-paid': string;
270
+ 'pisell2.text.deposit-item-status-unpaid': string;
271
+ 'pisell2.text.deposit-order-total': string;
272
+ 'pisell2.text.deposit-order-detail': string;
273
+ 'pisell2.text.deposit-collect-deposit': string;
274
+ 'pisell2.text.deposit-order-no': string;
275
+ 'pisell2.text.deposit-amount': string;
276
+ 'pisell2.text.deposit-deposit-amount': string;
277
+ 'pisell2.text.deposit-generate-payment-link': string;
278
+ 'pisell2.text.deposit-list-empty': string;
279
+ 'pisell2.text.deposit-amount-message': string;
280
+ 'pisell2.text.deposit-amount-message2': string;
281
+ 'pisell2.text.deposit-amount-message3': string;
282
+ 'pisell2.text.deposit-delete': string;
283
+ 'pisell2.text.deposit-delete-message-title': string;
284
+ 'pisell2.text.deposit-delete-message': string;
249
285
  };
250
286
  'zh-HK': {
251
287
  'pisell2.text.refunded-amount': string;
@@ -370,6 +406,24 @@ declare const _default: {
370
406
  'pisell2.text.order.sales.channel.tableorder': string;
371
407
  'pisell2.text.order.sales.channel.reserve': string;
372
408
  'pisell2.text.rebook': string;
409
+ 'pisell2.text.now': string;
410
+ 'pisell2.text.deposit-list': string;
411
+ 'pisell2.text.deposit-item-status-paid': string;
412
+ 'pisell2.text.deposit-item-status-unpaid': string;
413
+ 'pisell2.text.deposit-order-total': string;
414
+ 'pisell2.text.deposit-order-detail': string;
415
+ 'pisell2.text.deposit-collect-deposit': string;
416
+ 'pisell2.text.deposit-order-no': string;
417
+ 'pisell2.text.deposit-amount': string;
418
+ 'pisell2.text.deposit-deposit-amount': string;
419
+ 'pisell2.text.deposit-generate-payment-link': string;
420
+ 'pisell2.text.deposit-list-empty': string;
421
+ 'pisell2.text.deposit-amount-message': string;
422
+ 'pisell2.text.deposit-amount-message2': string;
423
+ 'pisell2.text.deposit-amount-message3': string;
424
+ 'pisell2.text.deposit-delete': string;
425
+ 'pisell2.text.deposit-delete-message-title': string;
426
+ 'pisell2.text.deposit-delete-message': string;
373
427
  };
374
428
  };
375
429
  export default _default;