@pisell/private-materials 3.3.19 → 3.3.20
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/meta.js +1 -1
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +3 -3
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +3 -3
- package/es/components/appointmentBooking/components/ConfirmInformation/index.js +3 -2
- package/es/components/appointmentBooking/components/Content/index.js +19 -22
- package/es/components/appointmentBooking/components/Date/index.js +66 -42
- package/es/components/appointmentBooking/components/Date/state.d.ts +1 -0
- package/es/components/appointmentBooking/components/Date/state.js +5 -0
- package/es/components/appointmentBooking/components/Form/index.js +12 -4
- package/es/components/appointmentBooking/components/Guest/index.js +4 -2
- package/es/components/appointmentBooking/components/Resource/index.js +7 -4
- package/es/components/appointmentBooking/components/Services/index.js +3 -2
- package/es/components/appointmentBooking/components/TimeSlicing/index.js +4 -2
- package/es/components/appointmentBooking/context.d.ts +3 -1
- package/es/components/appointmentBooking/context.js +63 -6
- package/es/components/appointmentBooking/deposit/components/PolicyModal/index.js +35 -11
- package/es/components/appointmentBooking/deposit/components/PolicyModal/index.less +9 -0
- package/es/components/appointmentBooking/hooks.d.ts +1 -0
- package/es/components/appointmentBooking/hooks.js +48 -8
- package/es/components/appointmentBooking/index.d.ts +0 -1
- package/es/components/appointmentBooking/locales.d.ts +6 -0
- package/es/components/appointmentBooking/locales.js +6 -0
- package/es/components/appointmentBooking/utils.d.ts +2 -2
- package/es/components/appointmentBooking/utils.js +10 -4
- package/es/components/booking/components/footer/index.d.ts +1 -0
- package/es/components/booking/deposit/index.d.ts +0 -1
- package/es/components/booking/deposit/index.js +1 -1
- package/es/components/ticketBooking/components/ticketBooking/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/ConfirmInformation/index.js +1 -0
- package/lib/components/appointmentBooking/components/Content/index.js +11 -11
- package/lib/components/appointmentBooking/components/Date/index.js +29 -12
- package/lib/components/appointmentBooking/components/Date/state.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Date/state.js +7 -0
- package/lib/components/appointmentBooking/components/Form/index.js +6 -3
- package/lib/components/appointmentBooking/components/Guest/index.js +2 -1
- package/lib/components/appointmentBooking/components/Resource/index.js +6 -4
- package/lib/components/appointmentBooking/components/Services/index.js +2 -2
- package/lib/components/appointmentBooking/components/TimeSlicing/index.js +2 -1
- package/lib/components/appointmentBooking/context.d.ts +3 -1
- package/lib/components/appointmentBooking/context.js +28 -7
- package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.js +39 -4
- package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.less +9 -0
- package/lib/components/appointmentBooking/hooks.d.ts +1 -0
- package/lib/components/appointmentBooking/hooks.js +29 -5
- package/lib/components/appointmentBooking/index.d.ts +0 -1
- package/lib/components/appointmentBooking/locales.d.ts +6 -0
- package/lib/components/appointmentBooking/locales.js +6 -0
- package/lib/components/appointmentBooking/utils.d.ts +2 -2
- package/lib/components/appointmentBooking/utils.js +8 -4
- package/lib/components/booking/components/footer/index.d.ts +1 -0
- package/lib/components/booking/deposit/index.d.ts +0 -1
- package/lib/components/booking/deposit/index.js +1 -1
- package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +1 -0
- package/package.json +4 -4
|
@@ -53,7 +53,8 @@ var Resource = (0, import_react.forwardRef)((props, ref) => {
|
|
|
53
53
|
setCarts,
|
|
54
54
|
currentStep,
|
|
55
55
|
setResourceOtherParams,
|
|
56
|
-
setIsErrorHolder
|
|
56
|
+
setIsErrorHolder,
|
|
57
|
+
setPolicyIds
|
|
57
58
|
} = (0, import_context.useAppointmentBookingContext)();
|
|
58
59
|
const {
|
|
59
60
|
getResourceList,
|
|
@@ -61,7 +62,7 @@ var Resource = (0, import_react.forwardRef)((props, ref) => {
|
|
|
61
62
|
getResourceTimeSlot
|
|
62
63
|
} = (0, import_hooks.useAppointmentBookingResource)();
|
|
63
64
|
const { checkSkipResourceStep } = (0, import_hooks.useIsSkipResourceStep)();
|
|
64
|
-
const { updateStep } = (0, import_hooks.useAppointmentBookingStep)();
|
|
65
|
+
const { updateStep, nextStep } = (0, import_hooks.useAppointmentBookingStep)();
|
|
65
66
|
const { openLoginModal, isLogin } = (0, import_hooks.useAppointmentBookingLogin)();
|
|
66
67
|
const { getHolders, checkAccount } = (0, import_hooks.useAppointmentBookingAccount)();
|
|
67
68
|
const { isFormSubject } = (0, import_hooks.useAppointmentBookingSetting)();
|
|
@@ -78,10 +79,11 @@ var Resource = (0, import_react.forwardRef)((props, ref) => {
|
|
|
78
79
|
(0, import_utils3.scrollToFirstErrorCard)();
|
|
79
80
|
return;
|
|
80
81
|
}
|
|
81
|
-
const resultCarts = (0, import_utils.formatCartsResources)(carts, resources);
|
|
82
|
+
const resultCarts = (0, import_utils.formatCartsResources)(carts, resources, setPolicyIds);
|
|
82
83
|
const stepList = ((_c = (_b = (_a = appointmentBooking == null ? void 0 : appointmentBooking.store) == null ? void 0 : _a.step) == null ? void 0 : _b.store) == null ? void 0 : _c.stepList) || [];
|
|
83
84
|
const accountLists = await appointmentBooking.getAccounts();
|
|
84
85
|
const checkResult = (0, import_utils.checkHasFormStep)({
|
|
86
|
+
nextStep,
|
|
85
87
|
hasResourceFormId: (resultCarts == null ? void 0 : resultCarts.length) > 0,
|
|
86
88
|
currentStep,
|
|
87
89
|
stepList,
|
|
@@ -104,7 +106,7 @@ var Resource = (0, import_react.forwardRef)((props, ref) => {
|
|
|
104
106
|
errorList: null
|
|
105
107
|
});
|
|
106
108
|
getResourceTimeSlot();
|
|
107
|
-
|
|
109
|
+
nextStep();
|
|
108
110
|
}
|
|
109
111
|
}));
|
|
110
112
|
const resources = (0, import_react.useMemo)(() => {
|
|
@@ -47,13 +47,13 @@ var Services = (0, import_react.forwardRef)((props, ref) => {
|
|
|
47
47
|
const appointmentBooking = (0, import_hooks.useAppointmentBooking)();
|
|
48
48
|
const { isDateSelectedFirst } = (0, import_hooks.useAppointmentBookingSetting)();
|
|
49
49
|
const { getProducts, checkProductType } = (0, import_hooks.useAppointmentBookingProduct)();
|
|
50
|
-
const { removeStep } = (0, import_hooks.useAppointmentBookingStep)();
|
|
50
|
+
const { removeStep, nextStep } = (0, import_hooks.useAppointmentBookingStep)();
|
|
51
51
|
const { currentStep } = (0, import_context.useAppointmentBookingContext)();
|
|
52
52
|
const [products, setProducts] = (0, import_react.useState)(null);
|
|
53
53
|
const [loading, setLoading] = (0, import_react.useState)(false);
|
|
54
54
|
(0, import_react.useImperativeHandle)(ref, () => ({
|
|
55
55
|
next: () => {
|
|
56
|
-
|
|
56
|
+
nextStep();
|
|
57
57
|
}
|
|
58
58
|
}));
|
|
59
59
|
(0, import_react.useEffect)(() => {
|
|
@@ -49,6 +49,7 @@ var TimeSlicing = (0, import_react.forwardRef)((props, ref) => {
|
|
|
49
49
|
carts
|
|
50
50
|
} = (0, import_context.useAppointmentBookingContext)();
|
|
51
51
|
const { getResourceTimeSlot, getResourceList } = (0, import_hooks.useAppointmentBookingResource)();
|
|
52
|
+
const { nextStep } = (0, import_hooks.useAppointmentBookingStep)();
|
|
52
53
|
(0, import_react.useImperativeHandle)(ref, () => ({
|
|
53
54
|
next: () => {
|
|
54
55
|
const isUnSelectedTimes = appointmentBooking.checkCartItems("date");
|
|
@@ -56,7 +57,7 @@ var TimeSlicing = (0, import_react.forwardRef)((props, ref) => {
|
|
|
56
57
|
(0, import_utils2.Toast)(import_utils.locales.getText("pisell2.appointment.unselect.time"));
|
|
57
58
|
return;
|
|
58
59
|
}
|
|
59
|
-
|
|
60
|
+
nextStep();
|
|
60
61
|
}
|
|
61
62
|
}));
|
|
62
63
|
(0, import_react.useEffect)(() => {
|
|
@@ -24,10 +24,12 @@ interface AppointmentBookingContextType {
|
|
|
24
24
|
tasksManager: TasksManager;
|
|
25
25
|
policyParams: any;
|
|
26
26
|
setPolicyParams: (val: any) => void;
|
|
27
|
+
openPolicy: (content: any, callback?: any) => void;
|
|
28
|
+
closePolicy: (val?: boolean) => void;
|
|
27
29
|
[key: string]: any;
|
|
28
30
|
}
|
|
29
31
|
export declare const AppointmentBookingProvider: ({ children, }: {
|
|
30
32
|
children: ReactNode;
|
|
31
33
|
}) => JSX.Element;
|
|
32
|
-
export declare const useAppointmentBookingContext: () => AppointmentBookingContextType;
|
|
34
|
+
export declare const useAppointmentBookingContext: () => AppointmentBookingContextType | undefined;
|
|
33
35
|
export {};
|
|
@@ -42,6 +42,7 @@ var AppointmentBookingProvider = ({
|
|
|
42
42
|
children
|
|
43
43
|
}) => {
|
|
44
44
|
var _a, _b, _c, _d, _e;
|
|
45
|
+
const policyIdsRef = (0, import_react.useRef)([]);
|
|
45
46
|
const appointmentBooking = (0, import_hooks.useAppointmentBooking)();
|
|
46
47
|
const [summary, setSummary] = (0, import_react.useState)({});
|
|
47
48
|
const [times, setTimes] = (0, import_react.useState)([]);
|
|
@@ -62,6 +63,18 @@ var AppointmentBookingProvider = ({
|
|
|
62
63
|
const currentStep2 = appointmentBooking == null ? void 0 : appointmentBooking.getCurrentStep();
|
|
63
64
|
setCurrentStep(currentStep2);
|
|
64
65
|
}, []);
|
|
66
|
+
const setPolicyIds = (ids) => {
|
|
67
|
+
policyIdsRef.current = ids;
|
|
68
|
+
};
|
|
69
|
+
const openPolicy = (content, callback) => {
|
|
70
|
+
setPolicyParams({ open: true, content, callback, _ts: Date.now() });
|
|
71
|
+
};
|
|
72
|
+
const closePolicy = (isCallback) => {
|
|
73
|
+
setPolicyParams({ open: false, content: {}, callback: null });
|
|
74
|
+
if ((policyParams == null ? void 0 : policyParams.callback) && isCallback) {
|
|
75
|
+
policyParams.callback();
|
|
76
|
+
}
|
|
77
|
+
};
|
|
65
78
|
const isLastStep = (0, import_react.useMemo)(() => {
|
|
66
79
|
var _a2;
|
|
67
80
|
const key = (_a2 = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _a2.key;
|
|
@@ -99,18 +112,26 @@ var AppointmentBookingProvider = ({
|
|
|
99
112
|
isLastStep,
|
|
100
113
|
tasksManager,
|
|
101
114
|
policyParams,
|
|
102
|
-
setPolicyParams
|
|
115
|
+
setPolicyParams,
|
|
116
|
+
policyIdsRef,
|
|
117
|
+
setPolicyIds,
|
|
118
|
+
openPolicy,
|
|
119
|
+
closePolicy
|
|
103
120
|
};
|
|
104
121
|
return /* @__PURE__ */ import_react.default.createElement(AppointmentBookingContext.Provider, { value }, children);
|
|
105
122
|
};
|
|
106
123
|
var useAppointmentBookingContext = () => {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
124
|
+
try {
|
|
125
|
+
const context = (0, import_react.useContext)(AppointmentBookingContext);
|
|
126
|
+
if (context === void 0) {
|
|
127
|
+
throw new Error(
|
|
128
|
+
"useAppointmentBookingContext must be used within a AppointmentBookingProvider"
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
return context;
|
|
132
|
+
} catch (error) {
|
|
133
|
+
console.log(error, "useAppointmentBookingContext");
|
|
112
134
|
}
|
|
113
|
-
return context;
|
|
114
135
|
};
|
|
115
136
|
// Annotate the CommonJS export names for ESM import in node:
|
|
116
137
|
0 && (module.exports = {
|
|
@@ -39,19 +39,31 @@ var import_utils = require("@pisell/utils");
|
|
|
39
39
|
var import_context = require("../../../context");
|
|
40
40
|
var import_index = require("./index.less");
|
|
41
41
|
var DepositModal = (props) => {
|
|
42
|
-
const {
|
|
42
|
+
const {
|
|
43
|
+
open,
|
|
44
|
+
onCancel,
|
|
45
|
+
item,
|
|
46
|
+
onChange,
|
|
47
|
+
onConfirm,
|
|
48
|
+
isHideCheckout = true
|
|
49
|
+
} = props;
|
|
43
50
|
const { appointmentBooking } = (0, import_context.useAppointmentBookingContext)();
|
|
44
51
|
const [policy, setPolicy] = (0, import_react.useState)(null);
|
|
45
52
|
const [loading, setLoading] = (0, import_react.useState)(false);
|
|
53
|
+
const [disabled, setDisabled] = (0, import_react.useState)(false);
|
|
54
|
+
(0, import_react.useEffect)(() => {
|
|
55
|
+
setDisabled(!isHideCheckout);
|
|
56
|
+
}, [isHideCheckout]);
|
|
46
57
|
const getPolicy = async (id) => {
|
|
47
58
|
setLoading(true);
|
|
48
59
|
try {
|
|
49
60
|
const { data } = await appointmentBooking.getProtocol(id);
|
|
50
61
|
setPolicy(data);
|
|
51
|
-
onChange(data);
|
|
62
|
+
onChange && onChange(data);
|
|
52
63
|
} catch (error) {
|
|
53
64
|
console.log(error);
|
|
54
|
-
onChange(error);
|
|
65
|
+
onChange && onChange(error);
|
|
66
|
+
debugger;
|
|
55
67
|
} finally {
|
|
56
68
|
setLoading(false);
|
|
57
69
|
}
|
|
@@ -74,7 +86,30 @@ var DepositModal = (props) => {
|
|
|
74
86
|
className: "policy-modal-wrap",
|
|
75
87
|
cancelVisible: false,
|
|
76
88
|
okText: import_utils.locales.getText("pisell2.appointment.deposit.close"),
|
|
77
|
-
|
|
89
|
+
footer: [
|
|
90
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "policy-modal-footer" }, !isHideCheckout ? /* @__PURE__ */ import_react.default.createElement(
|
|
91
|
+
import_materials.Checkbox,
|
|
92
|
+
{
|
|
93
|
+
className: "policy-modal-checkbox",
|
|
94
|
+
onChange: (e) => {
|
|
95
|
+
var _a;
|
|
96
|
+
return setDisabled(!((_a = e.target) == null ? void 0 : _a.checked));
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
import_utils.locales.getText("pisell2.appointment.policy")
|
|
100
|
+
) : null, /* @__PURE__ */ import_react.default.createElement(
|
|
101
|
+
import_materials.Button,
|
|
102
|
+
{
|
|
103
|
+
type: "primary",
|
|
104
|
+
size: "large",
|
|
105
|
+
onClick: isHideCheckout ? onCancel : onConfirm,
|
|
106
|
+
disabled
|
|
107
|
+
},
|
|
108
|
+
import_utils.locales.getText(
|
|
109
|
+
isHideCheckout ? "pisell2.appointment.deposit.close" : "pisell2.appointment.policy.confirm"
|
|
110
|
+
)
|
|
111
|
+
))
|
|
112
|
+
]
|
|
78
113
|
},
|
|
79
114
|
/* @__PURE__ */ import_react.default.createElement(import_antd.Spin, { style: { minHeight: "200px" }, spinning: loading }, (policy == null ? void 0 : policy.content) ? /* @__PURE__ */ import_react.default.createElement(
|
|
80
115
|
"div",
|
|
@@ -66,7 +66,7 @@ var contextUtils = () => {
|
|
|
66
66
|
var useAppointmentBookingStep = () => {
|
|
67
67
|
var _a, _b, _c;
|
|
68
68
|
const pisellOS = (0, import_useEngineContext.usePisellOS)();
|
|
69
|
-
const { appointmentBooking, setCurrentStep } = (0, import_context.useAppointmentBookingContext)();
|
|
69
|
+
const { appointmentBooking, setCurrentStep, policyIdsRef, openPolicy } = (0, import_context.useAppointmentBookingContext)();
|
|
70
70
|
const stepList = ((_c = (_b = (_a = appointmentBooking == null ? void 0 : appointmentBooking.store) == null ? void 0 : _a.step) == null ? void 0 : _b.store) == null ? void 0 : _c.stepList) || [];
|
|
71
71
|
const getCurrentAndLastStep = () => {
|
|
72
72
|
const currentStep = appointmentBooking == null ? void 0 : appointmentBooking.getCurrentStep();
|
|
@@ -113,7 +113,30 @@ var useAppointmentBookingStep = () => {
|
|
|
113
113
|
isSkip: (step == null ? void 0 : step.isSkip) || false
|
|
114
114
|
});
|
|
115
115
|
};
|
|
116
|
-
|
|
116
|
+
const nextStep = () => {
|
|
117
|
+
var _a2, _b2, _c2, _d;
|
|
118
|
+
const currentStep = appointmentBooking == null ? void 0 : appointmentBooking.getCurrentStep();
|
|
119
|
+
const stepList2 = ((_c2 = (_b2 = (_a2 = appointmentBooking == null ? void 0 : appointmentBooking.store) == null ? void 0 : _a2.step) == null ? void 0 : _b2.store) == null ? void 0 : _c2.stepList) || [];
|
|
120
|
+
if ((currentStep == null ? void 0 : currentStep.index) + 2 === (stepList2 == null ? void 0 : stepList2.length)) {
|
|
121
|
+
if ((_d = policyIdsRef == null ? void 0 : policyIdsRef.current) == null ? void 0 : _d.length) {
|
|
122
|
+
let idx = 0;
|
|
123
|
+
const showNextPolicy = () => {
|
|
124
|
+
if (idx < policyIdsRef.current.length) {
|
|
125
|
+
openPolicy({ id: policyIdsRef.current[idx] }, () => {
|
|
126
|
+
idx++;
|
|
127
|
+
showNextPolicy();
|
|
128
|
+
});
|
|
129
|
+
} else {
|
|
130
|
+
appointmentBooking.next();
|
|
131
|
+
}
|
|
132
|
+
};
|
|
133
|
+
showNextPolicy();
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
appointmentBooking.next();
|
|
138
|
+
};
|
|
139
|
+
return { getStepIndex, stepList, removeStep, addStep, updateStep, nextStep };
|
|
117
140
|
};
|
|
118
141
|
var useAppointmentBookingProduct = () => {
|
|
119
142
|
const { appointmentBooking, carts } = (0, import_context.useAppointmentBookingContext)();
|
|
@@ -284,13 +307,14 @@ var useAppointmentBookingResource = () => {
|
|
|
284
307
|
};
|
|
285
308
|
var useIsSkipResourceStep = () => {
|
|
286
309
|
var _a, _b, _c;
|
|
287
|
-
const { currentStep, setCarts } = (0, import_context.useAppointmentBookingContext)();
|
|
310
|
+
const { currentStep, setCarts, setPolicyIds } = (0, import_context.useAppointmentBookingContext)();
|
|
288
311
|
const { getResourceList, autoSelectAllProductResources } = useAppointmentBookingResource();
|
|
289
312
|
const { isFormSubject } = useAppointmentBookingSetting();
|
|
290
313
|
const appointmentBooking = useAppointmentBooking();
|
|
291
314
|
const stepList = ((_c = (_b = (_a = appointmentBooking == null ? void 0 : appointmentBooking.store) == null ? void 0 : _a.step) == null ? void 0 : _b.store) == null ? void 0 : _c.stepList) || [];
|
|
292
315
|
const { isLogin, openLoginModal } = useAppointmentBookingLogin();
|
|
293
316
|
const { getHolders, checkAccount } = useAppointmentBookingAccount();
|
|
317
|
+
const { nextStep } = useAppointmentBookingStep();
|
|
294
318
|
const utils = contextUtils();
|
|
295
319
|
const checkSkipResourceStep = async (isSkipUpdateFormStep) => {
|
|
296
320
|
var _a2, _b2, _c2, _d, _e;
|
|
@@ -302,8 +326,8 @@ var useIsSkipResourceStep = () => {
|
|
|
302
326
|
const { resources } = getResourceList();
|
|
303
327
|
if (!((_a2 = res == null ? void 0 : res.errorList) == null ? void 0 : _a2.length) && ((_e = (_d = (_c2 = (_b2 = resources == null ? void 0 : resources[0]) == null ? void 0 : _b2.resources) == null ? void 0 : _c2[0]) == null ? void 0 : _d.renderList) == null ? void 0 : _e.length) === 1) {
|
|
304
328
|
if (!isSkipUpdateFormStep) {
|
|
305
|
-
const resultCarts = (0, import_utils2.formatCartsResources)(carts, resources);
|
|
306
|
-
(0, import_utils2.checkHasFormStep)({ isSkip: true, openLoginModal, utils, accountLists, getHolders, checkHolder: import_utils3.checkHolder, setCarts, checkAccount, carts, isFormSubject, hasResourceFormId: (resultCarts == null ? void 0 : resultCarts.length) > 0, currentStep, stepList, appointmentBooking, locales: import_utils.locales, isLogin });
|
|
329
|
+
const resultCarts = (0, import_utils2.formatCartsResources)(carts, resources, setPolicyIds);
|
|
330
|
+
(0, import_utils2.checkHasFormStep)({ nextStep, isSkip: true, openLoginModal, utils, accountLists, getHolders, checkHolder: import_utils3.checkHolder, setCarts, checkAccount, carts, isFormSubject, hasResourceFormId: (resultCarts == null ? void 0 : resultCarts.length) > 0, currentStep, stepList, appointmentBooking, locales: import_utils.locales, isLogin });
|
|
307
331
|
}
|
|
308
332
|
return true;
|
|
309
333
|
} else {
|
|
@@ -104,6 +104,8 @@ declare const _default: {
|
|
|
104
104
|
'pisell2.appointment.unselect.date': string;
|
|
105
105
|
'pisell2.appointment.unuse.date': string;
|
|
106
106
|
'pisell2.appointment.add-guests': string;
|
|
107
|
+
'pisell2.appointment.policy': string;
|
|
108
|
+
'pisell2.appointment.policy.confirm': string;
|
|
107
109
|
'pisell2.text.apply': string;
|
|
108
110
|
'pisell2.text.goodpass': string;
|
|
109
111
|
'pisell2.text.goodpass.product-vouchers': string;
|
|
@@ -219,6 +221,8 @@ declare const _default: {
|
|
|
219
221
|
'pisell2.appointment.unselect.date': string;
|
|
220
222
|
'pisell2.appointment.unuse.date': string;
|
|
221
223
|
'pisell2.appointment.add-guests': string;
|
|
224
|
+
'pisell2.appointment.policy': string;
|
|
225
|
+
'pisell2.appointment.policy.confirm': string;
|
|
222
226
|
'pisell2.text.apply': string;
|
|
223
227
|
'pisell2.text.goodpass': string;
|
|
224
228
|
'pisell2.text.goodpass.product-vouchers': string;
|
|
@@ -334,6 +338,8 @@ declare const _default: {
|
|
|
334
338
|
'pisell2.appointment.unselect.date': string;
|
|
335
339
|
'pisell2.appointment.unuse.date': string;
|
|
336
340
|
'pisell2.appointment.add-guests': string;
|
|
341
|
+
'pisell2.appointment.policy': string;
|
|
342
|
+
'pisell2.appointment.policy.confirm': string;
|
|
337
343
|
'pisell2.text.apply': string;
|
|
338
344
|
'pisell2.text.goodpass': string;
|
|
339
345
|
'pisell2.text.goodpass.product-vouchers': string;
|
|
@@ -128,6 +128,8 @@ var locales_default = {
|
|
|
128
128
|
"pisell2.appointment.unselect.date": "Please select date",
|
|
129
129
|
"pisell2.appointment.unuse.date": "This date is not available, please change the date.",
|
|
130
130
|
"pisell2.appointment.add-guests": "Add guests",
|
|
131
|
+
"pisell2.appointment.policy": "You have read and agreed to this policy",
|
|
132
|
+
"pisell2.appointment.policy.confirm": "Confirm",
|
|
131
133
|
"pisell2.text.apply": "Apply",
|
|
132
134
|
"pisell2.text.goodpass": "GoodPass",
|
|
133
135
|
"pisell2.text.goodpass.product-vouchers": "Product Vouchers",
|
|
@@ -243,6 +245,8 @@ var locales_default = {
|
|
|
243
245
|
"pisell2.appointment.unselect.date": "请选择日期",
|
|
244
246
|
"pisell2.appointment.unuse.date": "此日期不可用,请更换日期。",
|
|
245
247
|
"pisell2.appointment.add-guests": "添加预约人",
|
|
248
|
+
"pisell2.appointment.policy": "您已仔细阅读并同意此协议",
|
|
249
|
+
"pisell2.appointment.policy.confirm": "确定",
|
|
246
250
|
"pisell2.text.apply": "应用",
|
|
247
251
|
"pisell2.text.goodpass": "商品券",
|
|
248
252
|
"pisell2.text.goodpass.product-vouchers": "商品兑换券",
|
|
@@ -358,6 +362,8 @@ var locales_default = {
|
|
|
358
362
|
"pisell2.appointment.unselect.date": "請選擇日期",
|
|
359
363
|
"pisell2.appointment.unuse.date": "此日期不可用,請更換日期。",
|
|
360
364
|
"pisell2.appointment.add-guests": "添加預約人",
|
|
365
|
+
"pisell2.appointment.policy": "您已仔細閱讀並同意此協議",
|
|
366
|
+
"pisell2.appointment.policy.confirm": "確定",
|
|
361
367
|
"pisell2.text.apply": "應用",
|
|
362
368
|
"pisell2.text.goodpass": "商品券",
|
|
363
369
|
"pisell2.text.goodpass.product-vouchers": "商品兌換券",
|
|
@@ -17,7 +17,7 @@ export declare const formatGuest: (data: any[], products: any) => any[];
|
|
|
17
17
|
* @Author: WangHan
|
|
18
18
|
* @Date: 2025-05-06 22:22
|
|
19
19
|
*/
|
|
20
|
-
export declare const formatCartsResources: (carts: any[], resources: any[]) => any[];
|
|
20
|
+
export declare const formatCartsResources: (carts: any[], resources: any[], setPolicyIds: any) => any[];
|
|
21
21
|
/**
|
|
22
22
|
* @title: 格式化购物车数据
|
|
23
23
|
* @description:
|
|
@@ -111,4 +111,4 @@ export declare const Toast: (text: string) => void;
|
|
|
111
111
|
* @Author: WangHan
|
|
112
112
|
* @Date: 2025-05-06 21:51
|
|
113
113
|
*/
|
|
114
|
-
export declare const checkHasFormStep: ({ isSkip, checkHolder, checkAccount, carts, setCarts, hasResourceFormId, currentStep, stepList, appointmentBooking, locales, isLogin, openLoginModal, isFormSubject, utils, accountLists, getHolders }: any) => true | undefined;
|
|
114
|
+
export declare const checkHasFormStep: ({ nextStep, isSkip, checkHolder, checkAccount, carts, setCarts, hasResourceFormId, currentStep, stepList, appointmentBooking, locales, isLogin, openLoginModal, isFormSubject, utils, accountLists, getHolders }: any) => true | undefined;
|
|
@@ -76,8 +76,9 @@ var formatGuest = (data, products) => {
|
|
|
76
76
|
};
|
|
77
77
|
});
|
|
78
78
|
};
|
|
79
|
-
var formatCartsResources = (carts, resources) => {
|
|
79
|
+
var formatCartsResources = (carts, resources, setPolicyIds) => {
|
|
80
80
|
try {
|
|
81
|
+
let policyIds = [];
|
|
81
82
|
let newCarts = carts == null ? void 0 : carts.map((d) => {
|
|
82
83
|
var _a, _b;
|
|
83
84
|
const currentResource = resources == null ? void 0 : resources.find((r) => (d == null ? void 0 : d._id) === (r == null ? void 0 : r._id));
|
|
@@ -89,9 +90,12 @@ var formatCartsResources = (carts, resources) => {
|
|
|
89
90
|
...d,
|
|
90
91
|
resource_form_id: foundResource == null ? void 0 : foundResource.resource_form_id
|
|
91
92
|
};
|
|
93
|
+
} else if ((foundResource == null ? void 0 : foundResource.policy_id) && !policyIds.includes(foundResource == null ? void 0 : foundResource.policy_id)) {
|
|
94
|
+
policyIds.push(foundResource == null ? void 0 : foundResource.policy_id);
|
|
92
95
|
}
|
|
93
96
|
return false;
|
|
94
97
|
}).filter(Boolean);
|
|
98
|
+
setPolicyIds(policyIds);
|
|
95
99
|
return newCarts || [];
|
|
96
100
|
} catch (error) {
|
|
97
101
|
console.log(error, "formatCarts");
|
|
@@ -278,7 +282,7 @@ var Toast = (text) => {
|
|
|
278
282
|
window == null ? void 0 : window.alert(text);
|
|
279
283
|
}
|
|
280
284
|
};
|
|
281
|
-
var checkHasFormStep = ({ isSkip, checkHolder, checkAccount, carts, setCarts, hasResourceFormId: hasResourceFormId2, currentStep, stepList, appointmentBooking, locales: locales2, isLogin, openLoginModal, isFormSubject, utils, accountLists, getHolders }) => {
|
|
285
|
+
var checkHasFormStep = ({ nextStep, isSkip, checkHolder, checkAccount, carts, setCarts, hasResourceFormId: hasResourceFormId2, currentStep, stepList, appointmentBooking, locales: locales2, isLogin, openLoginModal, isFormSubject, utils, accountLists, getHolders }) => {
|
|
282
286
|
var _a, _b, _c;
|
|
283
287
|
let isNext = false;
|
|
284
288
|
if (hasResourceFormId2) {
|
|
@@ -329,13 +333,13 @@ var checkHasFormStep = ({ isSkip, checkHolder, checkAccount, carts, setCarts, ha
|
|
|
329
333
|
isNext = true;
|
|
330
334
|
}
|
|
331
335
|
if (isNext && !_checkHolder()) {
|
|
332
|
-
|
|
336
|
+
nextStep();
|
|
333
337
|
} else {
|
|
334
338
|
return true;
|
|
335
339
|
}
|
|
336
340
|
} else {
|
|
337
341
|
if (isSkip) {
|
|
338
|
-
|
|
342
|
+
nextStep();
|
|
339
343
|
}
|
|
340
344
|
}
|
|
341
345
|
};
|
|
@@ -106,7 +106,7 @@ var Deposit = (props) => {
|
|
|
106
106
|
}, [globalState]);
|
|
107
107
|
const depositList = (0, import_react.useMemo)(() => {
|
|
108
108
|
if (!bookingId) return [];
|
|
109
|
-
if (
|
|
109
|
+
if ((bookingDetail == null ? void 0 : bookingDetail.is_deposit) === 0) return [];
|
|
110
110
|
return [
|
|
111
111
|
{
|
|
112
112
|
customer: bookingDetail == null ? void 0 : bookingDetail.customer,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/private-materials",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.20",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -59,10 +59,10 @@
|
|
|
59
59
|
"react-infinite-scroll-component": "^6.1.0",
|
|
60
60
|
"rc-virtual-list": "^3.11.3",
|
|
61
61
|
"decimal.js": "^10.4.3",
|
|
62
|
-
"@pisell/
|
|
63
|
-
"@pisell/date-picker": "3.0.2",
|
|
62
|
+
"@pisell/icon": "0.0.11",
|
|
64
63
|
"@pisell/materials": "3.3.7",
|
|
65
|
-
"@pisell/
|
|
64
|
+
"@pisell/date-picker": "3.0.2",
|
|
65
|
+
"@pisell/utils": "1.0.42"
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
68
|
"react": "^18.0.0",
|