@pisell/private-materials 3.2.25 → 3.2.26
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.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +6 -6
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +8 -8
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +8 -8
- package/es/components/appointmentBooking/components/Cart/ContinueButton/index.js +5 -5
- package/es/components/appointmentBooking/components/Cart/Item/index.js +1 -5
- package/es/components/appointmentBooking/components/Cart/Item/index.less +8 -1
- package/es/components/appointmentBooking/components/Header/index.js +4 -1
- package/es/components/booking/addons/index.js +7 -5
- package/es/components/booking/addons/model.d.ts +1 -10
- package/es/components/booking/components/footer/utils.js +8 -5
- package/es/components/booking/forms/footer.d.ts +6 -0
- package/es/components/booking/forms/footer.js +88 -0
- package/es/components/booking/forms/index.d.ts +1 -1
- package/es/components/booking/forms/index.js +25 -20
- package/es/components/booking/forms/index.less +7 -0
- package/es/components/booking/forms/model.d.ts +1 -10
- package/es/components/booking/forms/sendModal/index.d.ts +27 -0
- package/es/components/booking/forms/sendModal/index.js +82 -0
- package/es/components/booking/forms/sendModal/index.less +9 -0
- package/es/components/booking/forms/sendModal/useSendModal.d.ts +9 -0
- package/es/components/booking/forms/sendModal/useSendModal.js +79 -0
- package/es/components/booking/forms/serve.d.ts +9 -0
- package/es/components/booking/forms/serve.js +20 -0
- package/es/components/booking/info/model.d.ts +1 -10
- package/es/components/booking/info/service/addService/index.js +3 -3
- package/es/components/booking/info/service/editService/index.js +71 -51
- package/es/components/booking/info2/service/addService/index.js +3 -2
- package/es/components/booking/info2/service/addService/utils.js +57 -5
- package/es/components/booking/info2/service/editService/Resources/index.js +20 -2
- package/es/components/booking/info2/service/editService/index.js +5 -3
- package/es/components/booking/info2/service/editService/utils.d.ts +4 -2
- package/es/components/booking/info2/service/editService/utils.js +18 -0
- package/es/components/booking/locales.d.ts +39 -0
- package/es/components/booking/locales.js +39 -0
- package/es/components/booking/model.d.ts +1 -9
- package/es/components/booking/notes/model.d.ts +1 -10
- package/es/components/booking/payments/model.d.ts +1 -10
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/store/index.d.ts +1 -1
- package/es/components/pay/toC/PaymentList/serve.js +2 -2
- package/es/components/pay/toC/model.d.ts +1 -9
- package/es/components/pay/toC/serve.js +2 -2
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.js +4 -1
- package/es/components/schedules/model.d.ts +1 -9
- package/es/components/wallet/Detail/model.d.ts +1 -13
- package/es/components/wallet/DiscountCard/model.d.ts +1 -14
- package/es/components/wallet/PointCard/model.d.ts +1 -13
- package/es/components/wallet/RechargeableCard/model.d.ts +1 -29
- package/es/components/wallet/Voucher/model.d.ts +1 -13
- package/es/components/wallet/model.d.ts +1 -9
- package/lib/components/appointmentBooking/components/Cart/ContinueButton/index.js +8 -8
- package/lib/components/appointmentBooking/components/Cart/Item/index.js +1 -2
- package/lib/components/appointmentBooking/components/Cart/Item/index.less +8 -1
- package/lib/components/appointmentBooking/components/Header/index.js +4 -1
- package/lib/components/booking/addons/index.js +7 -5
- package/lib/components/booking/addons/model.d.ts +1 -10
- package/lib/components/booking/components/footer/utils.js +4 -5
- package/lib/components/booking/forms/footer.d.ts +6 -0
- package/lib/components/booking/forms/footer.js +81 -0
- package/lib/components/booking/forms/index.d.ts +1 -1
- package/lib/components/booking/forms/index.js +4 -2
- package/lib/components/booking/forms/index.less +7 -0
- package/lib/components/booking/forms/model.d.ts +1 -10
- package/lib/components/booking/forms/sendModal/index.d.ts +27 -0
- package/lib/components/booking/forms/sendModal/index.js +128 -0
- package/lib/components/booking/forms/sendModal/index.less +9 -0
- package/lib/components/booking/forms/sendModal/useSendModal.d.ts +9 -0
- package/lib/components/booking/forms/sendModal/useSendModal.js +70 -0
- package/lib/components/booking/forms/serve.d.ts +9 -0
- package/lib/components/booking/forms/serve.js +5 -2
- package/lib/components/booking/info/model.d.ts +1 -10
- package/lib/components/booking/info/service/addService/index.js +2 -2
- package/lib/components/booking/info/service/editService/index.js +12 -2
- package/lib/components/booking/info2/service/addService/index.js +3 -2
- package/lib/components/booking/info2/service/addService/utils.js +36 -1
- package/lib/components/booking/info2/service/editService/Resources/index.js +16 -1
- package/lib/components/booking/info2/service/editService/index.js +4 -2
- package/lib/components/booking/info2/service/editService/utils.d.ts +4 -2
- package/lib/components/booking/info2/service/editService/utils.js +48 -0
- package/lib/components/booking/locales.d.ts +39 -0
- package/lib/components/booking/locales.js +39 -0
- package/lib/components/booking/model.d.ts +1 -9
- package/lib/components/booking/notes/model.d.ts +1 -10
- package/lib/components/booking/payments/model.d.ts +1 -10
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/store/index.d.ts +1 -1
- package/lib/components/pay/toC/PaymentList/serve.js +1 -1
- package/lib/components/pay/toC/model.d.ts +1 -9
- package/lib/components/pay/toC/serve.js +1 -1
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.js +4 -1
- package/lib/components/schedules/model.d.ts +1 -9
- package/lib/components/wallet/Detail/model.d.ts +1 -13
- package/lib/components/wallet/DiscountCard/model.d.ts +1 -14
- package/lib/components/wallet/PointCard/model.d.ts +1 -13
- package/lib/components/wallet/RechargeableCard/model.d.ts +1 -29
- package/lib/components/wallet/Voucher/model.d.ts +1 -13
- package/lib/components/wallet/model.d.ts +1 -9
- package/package.json +4 -4
- package/es/components/eventBooking/components/Provider/SelectProduct/index.d.ts +0 -4
- package/es/components/eventBooking/components/Provider/SelectProduct/index.js +0 -77
- package/es/components/eventBooking/components/Provider/SelectProduct/index.less +0 -131
- package/lib/components/eventBooking/components/Provider/SelectProduct/index.d.ts +0 -4
- package/lib/components/eventBooking/components/Provider/SelectProduct/index.js +0 -69
- package/lib/components/eventBooking/components/Provider/SelectProduct/index.less +0 -131
|
@@ -0,0 +1,81 @@
|
|
|
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/forms/footer.tsx
|
|
30
|
+
var footer_exports = {};
|
|
31
|
+
__export(footer_exports, {
|
|
32
|
+
default: () => footer_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(footer_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_materials = require("@pisell/materials");
|
|
37
|
+
var import_icons = require("@ant-design/icons");
|
|
38
|
+
var import_useSendModal = __toESM(require("./sendModal/useSendModal"));
|
|
39
|
+
var import_sendModal = __toESM(require("./sendModal"));
|
|
40
|
+
var import_utils = require("@pisell/utils");
|
|
41
|
+
var Footer = ({ state, reload }) => {
|
|
42
|
+
var _a, _b, _c, _d, _e;
|
|
43
|
+
const { open, setOpen, handleOpen, handleValuesChange, handleOk } = (0, import_useSendModal.default)(state == null ? void 0 : state.bookingId);
|
|
44
|
+
const handleReload = async () => {
|
|
45
|
+
await reload();
|
|
46
|
+
import_materials.message.success(import_utils.locales.getText("pisell2.text.send-form-reminder-refresh"));
|
|
47
|
+
};
|
|
48
|
+
const isAllCompleted = (0, import_react.useMemo)(() => {
|
|
49
|
+
var _a2;
|
|
50
|
+
return Object.values(((_a2 = state == null ? void 0 : state.form) == null ? void 0 : _a2.value) || {}).every(
|
|
51
|
+
(item) => item.length > 0
|
|
52
|
+
);
|
|
53
|
+
}, [(_a = state == null ? void 0 : state.form) == null ? void 0 : _a.value]);
|
|
54
|
+
const defaultValues = (0, import_react.useMemo)(() => {
|
|
55
|
+
var _a2, _b2, _c2, _d2, _e2, _f, _g, _h, _i, _j;
|
|
56
|
+
return {
|
|
57
|
+
sendSms: !!((_b2 = (_a2 = state.client) == null ? void 0 : _a2.value) == null ? void 0 : _b2.phone),
|
|
58
|
+
sendEmail: !!((_d2 = (_c2 = state.client) == null ? void 0 : _c2.value) == null ? void 0 : _d2.email),
|
|
59
|
+
email: (_f = (_e2 = state.client) == null ? void 0 : _e2.value) == null ? void 0 : _f.email,
|
|
60
|
+
phone: {
|
|
61
|
+
code: (_h = (_g = state.client) == null ? void 0 : _g.value) == null ? void 0 : _h.country_calling_code,
|
|
62
|
+
phone: (_j = (_i = state.client) == null ? void 0 : _i.value) == null ? void 0 : _j.phone
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
}, [(_b = state.client) == null ? void 0 : _b.value]);
|
|
66
|
+
if (!state.bookingId || !((_c = state == null ? void 0 : state.form) == null ? void 0 : _c.forms.length)) {
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-form-footer" }, /* @__PURE__ */ import_react.default.createElement(import_materials.Tooltip, { title: import_utils.locales.getText("pisell2.text.send-form-reminder-tooltip") }, /* @__PURE__ */ import_react.default.createElement(import_materials.Button, { size: "large", icon: /* @__PURE__ */ import_react.default.createElement(import_icons.ReloadOutlined, null), onClick: handleReload })), /* @__PURE__ */ import_react.default.createElement(import_materials.Button, { size: "large", block: true, type: "primary", onClick: handleOpen, disabled: isAllCompleted }, !isAllCompleted ? import_utils.locales.getText("pisell2.text.send-form-reminder") : import_utils.locales.getText("pisell2.text.send-form-reminder-completed")), /* @__PURE__ */ import_react.default.createElement(
|
|
70
|
+
import_sendModal.default,
|
|
71
|
+
{
|
|
72
|
+
refreshKey: (_e = (_d = state.client) == null ? void 0 : _d.value) == null ? void 0 : _e.id,
|
|
73
|
+
open,
|
|
74
|
+
onCancel: () => setOpen(false),
|
|
75
|
+
onOk: handleOk,
|
|
76
|
+
onValuesChange: handleValuesChange,
|
|
77
|
+
defaultValues
|
|
78
|
+
}
|
|
79
|
+
));
|
|
80
|
+
};
|
|
81
|
+
var footer_default = Footer;
|
|
@@ -42,9 +42,10 @@ var import_utils = require("@pisell/utils");
|
|
|
42
42
|
var import_forms = __toESM(require("./forms"));
|
|
43
43
|
var import_utils2 = require("../utils");
|
|
44
44
|
var import_useEngineContext = __toESM(require("../../../hooks/useEngineContext"));
|
|
45
|
+
var import_footer = __toESM(require("./footer"));
|
|
45
46
|
var relation_type = "appointment_booking";
|
|
46
47
|
var Forms = (0, import_model.Provider)((props) => {
|
|
47
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
48
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
48
49
|
const { globalState } = props;
|
|
49
50
|
const [loading, setLoading] = (0, import_react.useState)(true);
|
|
50
51
|
const { state, dispatch } = (0, import_react.useContext)(import_model.Context);
|
|
@@ -215,7 +216,8 @@ var Forms = (0, import_model.Provider)((props) => {
|
|
|
215
216
|
{
|
|
216
217
|
header: import_utils.locales.getText("pisell2.text.forms"),
|
|
217
218
|
loading: loading && globalState.bookingId,
|
|
218
|
-
bodyClassName: "booking-forms-body"
|
|
219
|
+
bodyClassName: "booking-forms-body",
|
|
220
|
+
footer: state.bookingId && ((_i = state == null ? void 0 : state.form) == null ? void 0 : _i.forms.length) && /* @__PURE__ */ import_react.default.createElement(import_footer.default, { state: globalState, reload: geForms })
|
|
219
221
|
},
|
|
220
222
|
!globalState.bookingId ? /* @__PURE__ */ import_react.default.createElement(import_emptyBooking.default, null) : /* @__PURE__ */ import_react.default.createElement(
|
|
221
223
|
import_forms.default,
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { FormState } from "../model";
|
|
3
|
-
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
4
|
-
state: FormState;
|
|
5
|
-
} & {
|
|
6
|
-
dispatch: (params: {
|
|
7
|
-
type: string;
|
|
8
|
-
payload: any;
|
|
9
|
-
}) => void;
|
|
10
|
-
}>;
|
|
1
|
+
export declare const Provider: any, Context: any;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
export declare type SendModalValues = {
|
|
4
|
+
sendSms: boolean;
|
|
5
|
+
sendEmail: boolean;
|
|
6
|
+
phone: {
|
|
7
|
+
code: string;
|
|
8
|
+
phone: string;
|
|
9
|
+
};
|
|
10
|
+
email: string;
|
|
11
|
+
};
|
|
12
|
+
interface SendModalProps {
|
|
13
|
+
open: boolean;
|
|
14
|
+
refreshKey: string;
|
|
15
|
+
onCancel: () => void;
|
|
16
|
+
onOk: (values: SendModalValues) => void;
|
|
17
|
+
defaultValues?: {
|
|
18
|
+
email?: string;
|
|
19
|
+
phone?: {
|
|
20
|
+
code?: string;
|
|
21
|
+
phone?: string;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
onValuesChange?: (values: any) => void;
|
|
25
|
+
}
|
|
26
|
+
declare const SendModal: React.FC<SendModalProps>;
|
|
27
|
+
export default SendModal;
|
|
@@ -0,0 +1,128 @@
|
|
|
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/forms/sendModal/index.tsx
|
|
30
|
+
var sendModal_exports = {};
|
|
31
|
+
__export(sendModal_exports, {
|
|
32
|
+
default: () => sendModal_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(sendModal_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_antd = require("antd");
|
|
37
|
+
var import_materials = require("@pisell/materials");
|
|
38
|
+
var import_PhoneField = __toESM(require("../../../pisellSelectCustomerModal/RightPanel/Add/PhoneField"));
|
|
39
|
+
var import_utils = require("@pisell/utils");
|
|
40
|
+
var import_index = require("./index.less");
|
|
41
|
+
var SendModal = ({
|
|
42
|
+
open,
|
|
43
|
+
refreshKey,
|
|
44
|
+
onCancel,
|
|
45
|
+
onOk,
|
|
46
|
+
defaultValues = {},
|
|
47
|
+
onValuesChange
|
|
48
|
+
}) => {
|
|
49
|
+
const [form] = import_antd.Form.useForm();
|
|
50
|
+
const sendSms = import_antd.Form.useWatch("sendSms", form);
|
|
51
|
+
const sendEmail = import_antd.Form.useWatch("sendEmail", form);
|
|
52
|
+
const handleOk = () => {
|
|
53
|
+
form.validateFields().then((values) => {
|
|
54
|
+
onOk(values);
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
58
|
+
import_materials.PisellModal,
|
|
59
|
+
{
|
|
60
|
+
open,
|
|
61
|
+
title: import_utils.locales.getText("pisell2.text.send-form-reminder"),
|
|
62
|
+
onCancel,
|
|
63
|
+
onOk: handleOk,
|
|
64
|
+
okText: import_utils.locales.getText("pisell2.text.send-form-ok")
|
|
65
|
+
},
|
|
66
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode-send-form-wrap" }, /* @__PURE__ */ import_react.default.createElement(
|
|
67
|
+
import_antd.Form,
|
|
68
|
+
{
|
|
69
|
+
form,
|
|
70
|
+
key: refreshKey,
|
|
71
|
+
onValuesChange,
|
|
72
|
+
layout: "vertical",
|
|
73
|
+
initialValues: defaultValues
|
|
74
|
+
},
|
|
75
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
76
|
+
import_antd.Form.Item,
|
|
77
|
+
{
|
|
78
|
+
name: "sendSms",
|
|
79
|
+
valuePropName: "checked",
|
|
80
|
+
style: { marginBottom: 12 }
|
|
81
|
+
},
|
|
82
|
+
/* @__PURE__ */ import_react.default.createElement(import_antd.Checkbox, null, import_utils.locales.getText("pisell2.text.send-sms-reminder"))
|
|
83
|
+
),
|
|
84
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
85
|
+
import_antd.Form.Item,
|
|
86
|
+
{
|
|
87
|
+
name: "phone",
|
|
88
|
+
style: { marginLeft: 16 },
|
|
89
|
+
rules: [
|
|
90
|
+
{
|
|
91
|
+
required: sendSms,
|
|
92
|
+
message: import_utils.locales.getText("pisell2.text.phone-required-error-message")
|
|
93
|
+
}
|
|
94
|
+
]
|
|
95
|
+
},
|
|
96
|
+
/* @__PURE__ */ import_react.default.createElement(import_PhoneField.default, null)
|
|
97
|
+
),
|
|
98
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
99
|
+
import_antd.Form.Item,
|
|
100
|
+
{
|
|
101
|
+
name: "sendEmail",
|
|
102
|
+
valuePropName: "checked",
|
|
103
|
+
style: { marginBottom: 12 }
|
|
104
|
+
},
|
|
105
|
+
/* @__PURE__ */ import_react.default.createElement(import_antd.Checkbox, null, import_utils.locales.getText("pisell2.text.send-email-reminder"))
|
|
106
|
+
),
|
|
107
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
108
|
+
import_antd.Form.Item,
|
|
109
|
+
{
|
|
110
|
+
name: "email",
|
|
111
|
+
style: { marginLeft: 16 },
|
|
112
|
+
rules: [
|
|
113
|
+
{
|
|
114
|
+
required: sendEmail,
|
|
115
|
+
message: import_utils.locales.getText("pisell2.text.email-required-error-message")
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
pattern: /^([a-zA-Z0-9_\-\.+])+@([a-zA-Z0-9-]+\.)+([a-zA-Z]{2,63})+$/,
|
|
119
|
+
message: import_utils.locales.getText("pisell2.text.email-error-message")
|
|
120
|
+
}
|
|
121
|
+
]
|
|
122
|
+
},
|
|
123
|
+
/* @__PURE__ */ import_react.default.createElement(import_antd.Input, { size: "large" })
|
|
124
|
+
)
|
|
125
|
+
))
|
|
126
|
+
);
|
|
127
|
+
};
|
|
128
|
+
var sendModal_default = SendModal;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SendModalValues } from './index';
|
|
2
|
+
declare const useSendModal: (bookingId?: number) => {
|
|
3
|
+
open: boolean;
|
|
4
|
+
setOpen: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
|
5
|
+
handleOpen: () => void;
|
|
6
|
+
handleValuesChange: (val: any) => void;
|
|
7
|
+
handleOk: (values: SendModalValues) => Promise<boolean | undefined>;
|
|
8
|
+
};
|
|
9
|
+
export default useSendModal;
|
|
@@ -0,0 +1,70 @@
|
|
|
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/forms/sendModal/useSendModal.ts
|
|
20
|
+
var useSendModal_exports = {};
|
|
21
|
+
__export(useSendModal_exports, {
|
|
22
|
+
default: () => useSendModal_default
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(useSendModal_exports);
|
|
25
|
+
var import_react = require("react");
|
|
26
|
+
var import_materials = require("@pisell/materials");
|
|
27
|
+
var import_utils = require("@pisell/utils");
|
|
28
|
+
var import_serve = require("../serve");
|
|
29
|
+
var useSendModal = (bookingId) => {
|
|
30
|
+
const [open, setOpen] = (0, import_react.useState)(false);
|
|
31
|
+
const handleOpen = () => {
|
|
32
|
+
setOpen(true);
|
|
33
|
+
};
|
|
34
|
+
const handleValuesChange = (val) => {
|
|
35
|
+
console.log(val, "val");
|
|
36
|
+
};
|
|
37
|
+
const handleOk = async (values) => {
|
|
38
|
+
if (!values.sendSms && !values.sendEmail) {
|
|
39
|
+
return import_materials.message.error(
|
|
40
|
+
import_utils.locales.getText("pisell2.text.send-form-reminder-error-message")
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
if (values.sendSms && !values.phone.phone) {
|
|
44
|
+
return import_materials.message.error(
|
|
45
|
+
import_utils.locales.getText("pisell2.text.phone-required-error-message")
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
if (values.sendEmail && !values.email) {
|
|
49
|
+
return import_materials.message.error(
|
|
50
|
+
import_utils.locales.getText("pisell2.text.email-required-error-message")
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
const value = await (0, import_serve.sendFormReminder)({
|
|
54
|
+
phone: values.sendSms ? values.phone.phone : void 0,
|
|
55
|
+
email: values.sendEmail ? values.email : void 0,
|
|
56
|
+
order_id: bookingId,
|
|
57
|
+
country_calling_code: values.sendSms ? values.phone.code.replace("+", "") : void 0
|
|
58
|
+
});
|
|
59
|
+
import_materials.message.success(import_utils.locales.getText("pisell2.text.send-form-toast"));
|
|
60
|
+
setOpen(false);
|
|
61
|
+
};
|
|
62
|
+
return {
|
|
63
|
+
open,
|
|
64
|
+
setOpen,
|
|
65
|
+
handleOpen,
|
|
66
|
+
handleValuesChange,
|
|
67
|
+
handleOk
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
var useSendModal_default = useSendModal;
|
|
@@ -7,3 +7,12 @@ export declare const getFormData: (params: {
|
|
|
7
7
|
num: number;
|
|
8
8
|
skip: number;
|
|
9
9
|
}) => Promise<any>;
|
|
10
|
+
/**
|
|
11
|
+
* 发送表单填写提醒
|
|
12
|
+
*/
|
|
13
|
+
export declare const sendFormReminder: (params: {
|
|
14
|
+
email?: string;
|
|
15
|
+
phone?: string;
|
|
16
|
+
order_id: number;
|
|
17
|
+
country_calling_code?: string;
|
|
18
|
+
}) => Promise<any>;
|
|
@@ -19,12 +19,15 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
19
19
|
// src/components/booking/forms/serve.ts
|
|
20
20
|
var serve_exports = {};
|
|
21
21
|
__export(serve_exports, {
|
|
22
|
-
getFormData: () => getFormData
|
|
22
|
+
getFormData: () => getFormData,
|
|
23
|
+
sendFormReminder: () => sendFormReminder
|
|
23
24
|
});
|
|
24
25
|
module.exports = __toCommonJS(serve_exports);
|
|
25
26
|
var import_utils = require("../utils");
|
|
26
27
|
var getFormData = async (params) => import_utils.request.getRequest().get(`/shop/form/data/v1`, params);
|
|
28
|
+
var sendFormReminder = async (params) => import_utils.request.getRequest().post(`/shop/form/form-reminder`, params);
|
|
27
29
|
// Annotate the CommonJS export names for ESM import in node:
|
|
28
30
|
0 && (module.exports = {
|
|
29
|
-
getFormData
|
|
31
|
+
getFormData,
|
|
32
|
+
sendFormReminder
|
|
30
33
|
});
|
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { FormState } from '../model';
|
|
3
1
|
export declare const walkInData: {
|
|
4
2
|
id: number;
|
|
5
3
|
nickname: string;
|
|
6
4
|
};
|
|
7
|
-
export declare const Provider:
|
|
8
|
-
state: FormState;
|
|
9
|
-
} & {
|
|
10
|
-
dispatch: (params: {
|
|
11
|
-
type: string;
|
|
12
|
-
payload: any;
|
|
13
|
-
}) => void;
|
|
14
|
-
}>;
|
|
5
|
+
export declare const Provider: any, Context: any;
|
|
@@ -245,9 +245,9 @@ var Info = (props) => {
|
|
|
245
245
|
is_eject: isEject ? 1 : 0,
|
|
246
246
|
customer_id: customerId
|
|
247
247
|
},
|
|
248
|
-
callback: async (e) => {
|
|
248
|
+
callback: async (e, extension_type, detail) => {
|
|
249
249
|
const data = await createBookingData({
|
|
250
|
-
product: { ...item, _params: e }
|
|
250
|
+
product: { ...detail || item, _params: e }
|
|
251
251
|
});
|
|
252
252
|
createBooking({ booking: data });
|
|
253
253
|
}
|
|
@@ -72,6 +72,7 @@ var Info = (_, ref) => {
|
|
|
72
72
|
const { state, dispatch } = (0, import_react.useContext)(import_model.Context);
|
|
73
73
|
const [selectOpen, setSelectOpen] = (0, import_react.useState)();
|
|
74
74
|
const { holderLists } = (0, import_useSelectPet.default)(state);
|
|
75
|
+
const isChangeTotal = (0, import_react.useRef)(false);
|
|
75
76
|
const { editBookingData, editBooking } = (0, import_serviceManager.useService)({ state, dispatch });
|
|
76
77
|
const [currentTab, setCurrentTab] = (0, import_react.useState)("batch_edit");
|
|
77
78
|
const isDayBookingMode = (0, import_react.useMemo)(() => {
|
|
@@ -255,10 +256,14 @@ var Info = (_, ref) => {
|
|
|
255
256
|
errorList
|
|
256
257
|
}
|
|
257
258
|
});
|
|
259
|
+
if (isChangeTotal.current) {
|
|
260
|
+
delete data.discount_list;
|
|
261
|
+
}
|
|
258
262
|
await editBooking({ booking: data });
|
|
259
263
|
});
|
|
260
264
|
const setEditData = (0, import_ahooks.useMemoizedFn)((_cacheItem, open) => {
|
|
261
265
|
setCurrentTab("batch_edit");
|
|
266
|
+
isChangeTotal.current = false;
|
|
262
267
|
let cacheItem = _cacheItem || state.service.cacheItem;
|
|
263
268
|
let values = cacheItem._extend;
|
|
264
269
|
values = {
|
|
@@ -423,10 +428,11 @@ var Info = (_, ref) => {
|
|
|
423
428
|
},
|
|
424
429
|
customer_id: isDayBookingMode ? ((_h2 = (_g2 = state.client) == null ? void 0 : _g2.value) == null ? void 0 : _h2.id) || 1 : void 0
|
|
425
430
|
},
|
|
426
|
-
callback: (e2) => {
|
|
431
|
+
callback: async (e2, extension_type, detail) => {
|
|
427
432
|
var _a3, _b3, _c3, _d3;
|
|
433
|
+
const _detail = detail || item;
|
|
428
434
|
let cacheItem = {
|
|
429
|
-
...
|
|
435
|
+
..._detail,
|
|
430
436
|
product_id: item.id,
|
|
431
437
|
_id: item == null ? void 0 : item._id,
|
|
432
438
|
_key: e2.key,
|
|
@@ -578,6 +584,9 @@ var Info = (_, ref) => {
|
|
|
578
584
|
const isEditGroup = (0, import_react.useMemo)(() => {
|
|
579
585
|
return items.length;
|
|
580
586
|
}, [items]);
|
|
587
|
+
const handleTotalChange = (number) => {
|
|
588
|
+
isChangeTotal.current = true;
|
|
589
|
+
};
|
|
581
590
|
return (0, import_react.useMemo)(() => {
|
|
582
591
|
var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m2, _n2, _o2, _p2;
|
|
583
592
|
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
@@ -661,6 +670,7 @@ var Info = (_, ref) => {
|
|
|
661
670
|
style: { width: "100%" },
|
|
662
671
|
min: 0,
|
|
663
672
|
precision: 2,
|
|
673
|
+
onChange: handleTotalChange,
|
|
664
674
|
prefix: state.amountSymbol,
|
|
665
675
|
disabled: state.channelDisabledEdit,
|
|
666
676
|
originValue: ((_j2 = (_i2 = state.service.cacheItem) == null ? void 0 : _i2._extend) == null ? void 0 : _j2.origin_total) || 0,
|
|
@@ -202,15 +202,16 @@ var Info = (props) => {
|
|
|
202
202
|
setTimeout(() => {
|
|
203
203
|
lock = false;
|
|
204
204
|
}, 2e3);
|
|
205
|
+
const _detail = detail || item;
|
|
205
206
|
let cacheItem = {
|
|
206
|
-
...
|
|
207
|
+
..._detail,
|
|
207
208
|
product_id: item.id,
|
|
208
209
|
_id: (0, import_utils4.getUniqueId)(),
|
|
209
210
|
_key: e.key,
|
|
210
211
|
_extend: {
|
|
211
212
|
start_date: state.date.value,
|
|
212
213
|
quantity: 1,
|
|
213
|
-
price:
|
|
214
|
+
price: _detail.price,
|
|
214
215
|
product_name: item.title,
|
|
215
216
|
other: JSON.parse(JSON.stringify(e))
|
|
216
217
|
},
|
|
@@ -45,6 +45,7 @@ var import_utilsByBooking = require("../../utilsByBooking");
|
|
|
45
45
|
var import_dayjs = __toESM(require("dayjs"));
|
|
46
46
|
var import_utils2 = require("@pisell/utils");
|
|
47
47
|
var import_AlertTriangle = __toESM(require("@pisell/icon/es/AlertTriangle"));
|
|
48
|
+
var import_utils3 = require("../editService/utils");
|
|
48
49
|
var import_mock = require("../../../mock");
|
|
49
50
|
var getUsableTime = (cacheItem) => {
|
|
50
51
|
try {
|
|
@@ -191,12 +192,43 @@ var formatResources = ({ cacheItem, resourcesOrigin }) => {
|
|
|
191
192
|
maps: []
|
|
192
193
|
};
|
|
193
194
|
};
|
|
195
|
+
var getResourceMaxFreeTime = (resource) => {
|
|
196
|
+
const { renderList, form_id } = resource;
|
|
197
|
+
if (!(0, import_utils3.getAutoAllocationStorage)(form_id)) {
|
|
198
|
+
return [];
|
|
199
|
+
}
|
|
200
|
+
const usableList = renderList.filter((d) => d.usable && d.id !== 0);
|
|
201
|
+
let defaultResource = [];
|
|
202
|
+
let maxFreeTime = 0;
|
|
203
|
+
usableList.forEach((d) => {
|
|
204
|
+
const { times } = d;
|
|
205
|
+
const currentMaxFreeTime = times.reduce((pre, cur) => {
|
|
206
|
+
var _a, _b, _c;
|
|
207
|
+
const start = ((_c = (_b = cur.event_list) == null ? void 0 : _b[((_a = cur.event_list) == null ? void 0 : _a.length) - 1]) == null ? void 0 : _c.end_at) || cur.start_at;
|
|
208
|
+
const end = cur.end_at;
|
|
209
|
+
const diff = (0, import_dayjs.default)(end).diff((0, import_dayjs.default)(start), "minute");
|
|
210
|
+
return diff > pre ? diff : pre;
|
|
211
|
+
}, 0);
|
|
212
|
+
if (currentMaxFreeTime > maxFreeTime) {
|
|
213
|
+
maxFreeTime = currentMaxFreeTime;
|
|
214
|
+
defaultResource = [d];
|
|
215
|
+
}
|
|
216
|
+
});
|
|
217
|
+
return defaultResource;
|
|
218
|
+
};
|
|
194
219
|
var setDefaultResource = ({ cacheItem, resources }) => {
|
|
195
220
|
let obj = {};
|
|
196
221
|
const serviceParams = (0, import_utils.getCacheParams)();
|
|
197
222
|
let resourceId = Number(serviceParams == null ? void 0 : serviceParams.resource_id);
|
|
198
223
|
for (let item of resources) {
|
|
199
|
-
|
|
224
|
+
const renderList = item.renderList.filter((d) => d.is_default == 1 || d.id === resourceId);
|
|
225
|
+
let defaultOriginalResource = [];
|
|
226
|
+
if (renderList.length === 0) {
|
|
227
|
+
defaultOriginalResource = getResourceMaxFreeTime(item);
|
|
228
|
+
} else {
|
|
229
|
+
defaultOriginalResource = renderList;
|
|
230
|
+
}
|
|
231
|
+
const defaultResource = defaultOriginalResource.map((d) => {
|
|
200
232
|
return {
|
|
201
233
|
...d,
|
|
202
234
|
relation_type: d.relation_type,
|
|
@@ -289,6 +321,9 @@ var getIsAutoClose = (cacheItem) => {
|
|
|
289
321
|
}
|
|
290
322
|
}
|
|
291
323
|
}
|
|
324
|
+
return Object.entries(cacheItem._extend.resource).every(([key, value]) => {
|
|
325
|
+
return (0, import_utils3.getAutoAllocationStorage)(key) && (value == null ? void 0 : value.length);
|
|
326
|
+
});
|
|
292
327
|
};
|
|
293
328
|
var getProductExtend = ({ cacheItem, state }) => {
|
|
294
329
|
const isNew = cacheItem.new || !cacheItem._extend.endDate;
|
|
@@ -40,9 +40,13 @@ var import_index = require("./index.less");
|
|
|
40
40
|
var import_utils = require("@pisell/utils");
|
|
41
41
|
var import_utilsByBooking = require("../../../utilsByBooking");
|
|
42
42
|
var import_lodash = require("lodash");
|
|
43
|
+
var import_utils2 = require("../utils");
|
|
44
|
+
var import_ahooks = require("ahooks");
|
|
45
|
+
var import_icons = require("@ant-design/icons");
|
|
43
46
|
var Resources = ({ state, cacheItem, getCurrentCacheItem, onChange, value }, ref) => {
|
|
44
47
|
var _a, _b;
|
|
45
48
|
const [showError, setShowError] = (0, import_react.useState)(false);
|
|
49
|
+
const update = (0, import_ahooks.useUpdate)();
|
|
46
50
|
const data = (0, import_react.useMemo)(() => {
|
|
47
51
|
var _a2;
|
|
48
52
|
return ((_a2 = cacheItem == null ? void 0 : cacheItem._data) == null ? void 0 : _a2.resources) || [];
|
|
@@ -60,6 +64,10 @@ var Resources = ({ state, cacheItem, getCurrentCacheItem, onChange, value }, ref
|
|
|
60
64
|
const _value = (0, import_react.useMemo)(() => {
|
|
61
65
|
return value || defaultValue;
|
|
62
66
|
}, [value, defaultValue]);
|
|
67
|
+
const handleCheckAutoAllocation = (id, checked) => {
|
|
68
|
+
(0, import_utils2.setAutoAllocationStorage)({ [id]: checked });
|
|
69
|
+
update();
|
|
70
|
+
};
|
|
63
71
|
const _onChange = (val, form_id, key) => {
|
|
64
72
|
let _val = { ..._value };
|
|
65
73
|
let maps = _val[form_id] ? _val[form_id].reduce((pre, cur) => {
|
|
@@ -142,6 +150,9 @@ var Resources = ({ state, cacheItem, getCurrentCacheItem, onChange, value }, ref
|
|
|
142
150
|
check
|
|
143
151
|
};
|
|
144
152
|
});
|
|
153
|
+
const getIsAutoAllocation = (id) => {
|
|
154
|
+
return (0, import_utils2.getAutoAllocationStorage)(id);
|
|
155
|
+
};
|
|
145
156
|
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, data.map((item) => {
|
|
146
157
|
var _a2;
|
|
147
158
|
const cur = _value[item.form_id];
|
|
@@ -194,7 +205,11 @@ var Resources = ({ state, cacheItem, getCurrentCacheItem, onChange, value }, ref
|
|
|
194
205
|
}
|
|
195
206
|
},
|
|
196
207
|
renderOptions(item.renderList, "id", "label", "resource")
|
|
197
|
-
))
|
|
208
|
+
), /* @__PURE__ */ import_react.default.createElement(import_antd.Checkbox, { checked: getIsAutoAllocation(item.form_id), onChange: (e) => {
|
|
209
|
+
handleCheckAutoAllocation(item.form_id, e.target.checked);
|
|
210
|
+
} }), /* @__PURE__ */ import_react.default.createElement(import_antd.Tooltip, { title: import_utils.locales.getText(
|
|
211
|
+
"page.booking.text.resource.check-auto-allocation-tip"
|
|
212
|
+
) }, /* @__PURE__ */ import_react.default.createElement(import_icons.QuestionCircleOutlined, null)))
|
|
198
213
|
), state.renderType !== "eventBooking" && (errors || []).map((d) => {
|
|
199
214
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
200
215
|
import_antd.Alert,
|
|
@@ -207,6 +207,7 @@ var Info = (_, ref) => {
|
|
|
207
207
|
};
|
|
208
208
|
const setEditData = (0, import_ahooks.useMemoizedFn)((_cacheItem) => {
|
|
209
209
|
form.resetFields();
|
|
210
|
+
isChangeTotal.current = false;
|
|
210
211
|
let cacheItem = _cacheItem || state.service.cacheItem;
|
|
211
212
|
let values = cacheItem._extend;
|
|
212
213
|
form.setFieldsValue(values);
|
|
@@ -307,9 +308,10 @@ var Info = (_, ref) => {
|
|
|
307
308
|
},
|
|
308
309
|
value: item._extend.other
|
|
309
310
|
},
|
|
310
|
-
callback: (e2) => {
|
|
311
|
+
callback: (e2, extension_type, detail) => {
|
|
312
|
+
const _detail = detail || item;
|
|
311
313
|
let cacheItem = {
|
|
312
|
-
...
|
|
314
|
+
..._detail,
|
|
313
315
|
product_id: item.id,
|
|
314
316
|
_id: item == null ? void 0 : item._id,
|
|
315
317
|
_key: e2.key,
|
|
@@ -7,5 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
判断是否需要进入编辑服务页
|
|
9
9
|
*/
|
|
10
|
-
declare const
|
|
11
|
-
declare const
|
|
10
|
+
export declare const getAutoAllocationStorage: (id: string | number) => any;
|
|
11
|
+
export declare const setAutoAllocationStorage: (data: {
|
|
12
|
+
[key: string]: boolean;
|
|
13
|
+
}) => void;
|