@pisell/private-materials 3.0.209 → 3.0.211
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 -14
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +4 -4
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +7 -7
- package/es/components/Sales/Cart/index.d.ts +8 -5
- package/es/components/Sales/Cart/index.js +158 -37
- package/es/components/Sales/Cart/serve.d.ts +1 -0
- package/es/components/Sales/Cart/serve.js +5 -0
- package/es/components/Sales/Cart/types.d.ts +19 -0
- package/es/components/Sales/Cart/types.js +1 -0
- package/es/components/Sales/Checkout/index.js +3 -0
- package/es/components/booking/info/pet/index.js +3 -3
- package/es/components/booking/info/service2/utils.d.ts +1 -1
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/app.d.ts +1 -1
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/store/index.d.ts +2 -2
- package/es/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +153 -37
- package/es/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +4 -0
- package/es/components/eventBooking/components/Provider/EmptyHolderModal/index.js +35 -0
- package/es/components/eventBooking/components/Provider/EmptyHolderModal/index.less +17 -0
- package/es/components/eventBooking/components/Provider/Event/index.js +8 -1
- package/es/components/eventBooking/components/Provider/OrderProductModal/index.js +12 -35
- package/es/components/eventBooking/components/Provider/Resource/index.js +22 -11
- package/es/components/eventBooking/components/Provider/SelectHolderModal.js +4 -1
- package/es/components/eventBooking/components/bookingDetailModal/index.js +55 -9
- package/es/components/eventBooking/components/progressBar/index.js +18 -2
- package/es/components/eventBooking/components/scheduleCalendar/calendarItem.js +8 -0
- package/es/components/eventBooking/components/scheduleCalendar/index.less +12 -0
- package/es/components/eventBooking/index.js +1 -15
- package/es/components/eventBooking/locales.d.ts +33 -3
- package/es/components/eventBooking/locales.js +42 -6
- package/es/components/shoppingCart/components/Cart/Product.js +2 -2
- package/lib/components/Sales/Cart/index.d.ts +8 -5
- package/lib/components/Sales/Cart/index.js +97 -13
- package/lib/components/Sales/Cart/serve.d.ts +1 -0
- package/lib/components/Sales/Cart/serve.js +5 -0
- package/lib/components/Sales/Cart/types.d.ts +19 -0
- package/lib/components/Sales/Cart/types.js +17 -0
- package/lib/components/Sales/Checkout/index.js +1 -0
- package/lib/components/booking/info/pet/index.js +3 -3
- package/lib/components/booking/info/service2/utils.d.ts +1 -1
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/app.d.ts +1 -1
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/store/index.d.ts +2 -2
- package/lib/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +62 -14
- package/lib/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +4 -0
- package/lib/components/eventBooking/components/Provider/EmptyHolderModal/index.js +61 -0
- package/lib/components/eventBooking/components/Provider/EmptyHolderModal/index.less +17 -0
- package/lib/components/eventBooking/components/Provider/Event/index.js +20 -11
- package/lib/components/eventBooking/components/Provider/OrderProductModal/index.js +11 -26
- package/lib/components/eventBooking/components/Provider/Resource/index.js +12 -7
- package/lib/components/eventBooking/components/Provider/SelectHolderModal.js +2 -0
- package/lib/components/eventBooking/components/bookingDetailModal/index.js +21 -5
- package/lib/components/eventBooking/components/progressBar/index.js +8 -4
- package/lib/components/eventBooking/components/scheduleCalendar/calendarItem.js +8 -0
- package/lib/components/eventBooking/components/scheduleCalendar/index.less +12 -0
- package/lib/components/eventBooking/index.js +0 -8
- package/lib/components/eventBooking/locales.d.ts +33 -3
- package/lib/components/eventBooking/locales.js +36 -6
- package/lib/components/shoppingCart/components/Cart/Product.js +2 -2
- package/package.json +2 -2
|
@@ -11,7 +11,7 @@ import './device.less';
|
|
|
11
11
|
declare const _default: ({ api, onChange, onClose, className, device_number, isMobile, net, client, formatAmount, }: {
|
|
12
12
|
api: PayProps['api'];
|
|
13
13
|
className?: string | undefined;
|
|
14
|
-
onChange?: ((status: "
|
|
14
|
+
onChange?: ((status: "success" | "page" | "print" | "fail" | "mark_tx_processed", params?: string | {
|
|
15
15
|
[keys: string]: unknown;
|
|
16
16
|
} | undefined, other?: any) => void) | undefined;
|
|
17
17
|
onClose: () => void;
|
|
@@ -174,7 +174,7 @@ export declare const updateCustom: (payload: {
|
|
|
174
174
|
export declare const updateStatus: (status: 'loading' | 'warn' | 'fail' | 'success' | 'question') => {
|
|
175
175
|
type: EActionTypes;
|
|
176
176
|
payload: {
|
|
177
|
-
status: "
|
|
177
|
+
status: "loading" | "success" | "warn" | "fail" | "question";
|
|
178
178
|
};
|
|
179
179
|
};
|
|
180
180
|
/**
|
|
@@ -308,7 +308,7 @@ export declare const backUpFree: (payload: Partial<State>) => {
|
|
|
308
308
|
net?: boolean | undefined;
|
|
309
309
|
component?: string | undefined;
|
|
310
310
|
form?: string | undefined;
|
|
311
|
-
status?: "
|
|
311
|
+
status?: "loading" | "success" | "warn" | "fail" | "pedding" | "resove" | "reject" | "question" | undefined;
|
|
312
312
|
warn?: string | undefined;
|
|
313
313
|
steps?: {
|
|
314
314
|
/** 用于重置当前步骤 */
|
|
@@ -38,12 +38,13 @@ var import_materials = require("@pisell/materials");
|
|
|
38
38
|
var import_Sales = require("../../../../../Sales");
|
|
39
39
|
var import_utils2 = require("../../../../../Sales/Checkout/utils");
|
|
40
40
|
var import_OrderProductModal = __toESM(require("../../OrderProductModal/index"));
|
|
41
|
+
var import_EmptyHolderModal = __toESM(require("../../EmptyHolderModal"));
|
|
41
42
|
var import_index = require("./index.less");
|
|
42
43
|
var ContinueButton = () => {
|
|
43
|
-
var _a
|
|
44
|
+
var _a;
|
|
44
45
|
const { data } = (0, import_Sales.useSales)();
|
|
45
46
|
const { onHolderOpen } = (0, import_Sales.useHolder)();
|
|
46
|
-
const { checkHolder, onCloseCart, cartData } = (0, import_Sales.useCart)();
|
|
47
|
+
const { checkHolder, onCloseCart, cartData, getWithoutCartItemsHolderNames } = (0, import_Sales.useCart)();
|
|
47
48
|
const { currentStepData, nextStep, isLastStep } = (0, import_Sales.useStep)();
|
|
48
49
|
const {
|
|
49
50
|
onCheckout,
|
|
@@ -51,21 +52,65 @@ var ContinueButton = () => {
|
|
|
51
52
|
onCheckBeforeBooking,
|
|
52
53
|
checkBeforeBooking
|
|
53
54
|
} = (0, import_Sales.useCheckout)();
|
|
55
|
+
const { openLoginModal, isLogin } = (0, import_Sales.useCustomer)();
|
|
54
56
|
const [openCheckout, setOpenCheckout] = (0, import_react.useState)(false);
|
|
55
57
|
const [checkedNumber, setCheckedNumber] = (0, import_react.useState)(0);
|
|
56
|
-
const
|
|
58
|
+
const [openEmptyHolder, setOpenEmptyHolder] = (0, import_react.useState)(false);
|
|
59
|
+
const { removeSessionStorage } = (0, import_Sales.useSales)();
|
|
60
|
+
const handleCheckout = async () => {
|
|
61
|
+
const value = (0, import_utils2.formatValues)(data);
|
|
62
|
+
const result = await onCheckout(value);
|
|
63
|
+
if (result == null ? void 0 : result.success) {
|
|
64
|
+
removeSessionStorage();
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
const handleNextStep = async () => {
|
|
57
68
|
onCloseCart();
|
|
69
|
+
setOpenEmptyHolder(false);
|
|
58
70
|
if (isLastStep) {
|
|
59
|
-
|
|
60
|
-
const _data = await onCheckout(value);
|
|
61
|
-
return;
|
|
71
|
+
return handleCheckout();
|
|
62
72
|
}
|
|
73
|
+
nextStep();
|
|
74
|
+
};
|
|
75
|
+
const handleHolder = () => {
|
|
63
76
|
const isHolder = checkHolder();
|
|
64
77
|
if (!isHolder) {
|
|
65
78
|
onHolderOpen();
|
|
66
79
|
return;
|
|
67
80
|
}
|
|
68
|
-
|
|
81
|
+
const emptyHolders = getWithoutCartItemsHolderNames();
|
|
82
|
+
if ((emptyHolders == null ? void 0 : emptyHolders.length) > 0) {
|
|
83
|
+
return setOpenEmptyHolder(true);
|
|
84
|
+
}
|
|
85
|
+
handleNextStep();
|
|
86
|
+
};
|
|
87
|
+
const handleContinue = async () => {
|
|
88
|
+
if (isLastStep) {
|
|
89
|
+
const value = (0, import_utils2.formatValues)(data);
|
|
90
|
+
const checkRes = await onCheckBeforeBooking(value);
|
|
91
|
+
if ((checkRes == null ? void 0 : checkRes.result) === false) {
|
|
92
|
+
setCheckedNumber(checkRes == null ? void 0 : checkRes.num);
|
|
93
|
+
setOpenCheckout(true);
|
|
94
|
+
return;
|
|
95
|
+
}
|
|
96
|
+
const emptyHolders = getWithoutCartItemsHolderNames();
|
|
97
|
+
if ((emptyHolders == null ? void 0 : emptyHolders.length) > 0) {
|
|
98
|
+
return setOpenEmptyHolder(true);
|
|
99
|
+
}
|
|
100
|
+
onCloseCart();
|
|
101
|
+
return handleCheckout();
|
|
102
|
+
}
|
|
103
|
+
if (!isLogin()) {
|
|
104
|
+
onCloseCart();
|
|
105
|
+
return openLoginModal({
|
|
106
|
+
callback: (status) => {
|
|
107
|
+
if (status === "success") {
|
|
108
|
+
handleHolder();
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
handleHolder();
|
|
69
114
|
};
|
|
70
115
|
const continueText = (0, import_react.useMemo)(() => {
|
|
71
116
|
if (isLastStep) {
|
|
@@ -93,13 +138,16 @@ var ContinueButton = () => {
|
|
|
93
138
|
import_OrderProductModal.default,
|
|
94
139
|
{
|
|
95
140
|
open: openCheckout,
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
141
|
+
type: "checkout",
|
|
142
|
+
onCancel: () => setOpenCheckout(false)
|
|
143
|
+
}
|
|
144
|
+
), /* @__PURE__ */ import_react.default.createElement(
|
|
145
|
+
import_EmptyHolderModal.default,
|
|
146
|
+
{
|
|
147
|
+
open: openEmptyHolder,
|
|
148
|
+
lists: getWithoutCartItemsHolderNames(),
|
|
149
|
+
onCancel: () => setOpenEmptyHolder(false),
|
|
150
|
+
onOk: () => handleNextStep()
|
|
103
151
|
}
|
|
104
152
|
));
|
|
105
153
|
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/eventBooking/components/Provider/EmptyHolderModal/index.tsx
|
|
30
|
+
var EmptyHolderModal_exports = {};
|
|
31
|
+
__export(EmptyHolderModal_exports, {
|
|
32
|
+
default: () => EmptyHolderModal_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(EmptyHolderModal_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_materials = require("@pisell/materials");
|
|
37
|
+
var import_utils = require("@pisell/utils");
|
|
38
|
+
var import_index = require("./index.less");
|
|
39
|
+
var EmptyHolderModal = (props) => {
|
|
40
|
+
const { open, onCancel, onOk, lists } = props;
|
|
41
|
+
const content = (0, import_react.useMemo)(() => {
|
|
42
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "event-booking-empty-holder-describe" }, /* @__PURE__ */ import_react.default.createElement("span", null, import_utils.locales.getText("pisell2.event.empty.holder.tip")), /* @__PURE__ */ import_react.default.createElement("ul", null, lists.map((item, index) => {
|
|
43
|
+
return /* @__PURE__ */ import_react.default.createElement("li", { key: index }, item);
|
|
44
|
+
})), /* @__PURE__ */ import_react.default.createElement("span", null, import_utils.locales.getText("pisell2.event.empty.holder.continue.tip")));
|
|
45
|
+
}, [lists]);
|
|
46
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
47
|
+
import_materials.PisellModal.Information,
|
|
48
|
+
{
|
|
49
|
+
open,
|
|
50
|
+
title: import_utils.locales.getText("pisell2.event.empty.holder.title"),
|
|
51
|
+
describe: content,
|
|
52
|
+
okText: import_utils.locales.getText("pisell2.event.empty.holder.continue.anyway"),
|
|
53
|
+
cancelText: import_utils.locales.getText("pisell2.event.empty.holder.go.back"),
|
|
54
|
+
closable: true,
|
|
55
|
+
onCancel: () => onCancel(),
|
|
56
|
+
onOk: () => onOk(),
|
|
57
|
+
mobileModalHeight: "80vh"
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
};
|
|
61
|
+
var EmptyHolderModal_default = EmptyHolderModal;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
.event-booking-empty-holder-describe {
|
|
2
|
+
color: var(--Gray-900, #101828);
|
|
3
|
+
font-size: 16px;
|
|
4
|
+
font-weight: 400;
|
|
5
|
+
line-height: 24px;
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
gap: 4px;
|
|
9
|
+
|
|
10
|
+
ul {
|
|
11
|
+
list-style-type: disc !important;
|
|
12
|
+
padding-left: 20px;
|
|
13
|
+
li {
|
|
14
|
+
list-style-type: disc !important;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -34,6 +34,7 @@ __export(Event_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(Event_exports);
|
|
35
35
|
var import_react = __toESM(require("react"));
|
|
36
36
|
var import_utils = require("@pisell/utils");
|
|
37
|
+
var import_antd = require("antd");
|
|
37
38
|
var import_Sales = require("../../../../Sales");
|
|
38
39
|
var import_bookingServiceList = __toESM(require("../../bookingServiceList"));
|
|
39
40
|
var import_bookingDetailModal = __toESM(require("../../bookingDetailModal"));
|
|
@@ -74,18 +75,26 @@ var Event = () => {
|
|
|
74
75
|
className: `event-interface-service-wrap ${(0, import_utils.isMobile)() ? "event-interface-service-mobile-wrap" : ""}`
|
|
75
76
|
},
|
|
76
77
|
/* @__PURE__ */ import_react.default.createElement(
|
|
77
|
-
|
|
78
|
+
import_antd.Skeleton,
|
|
78
79
|
{
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
80
|
+
active: true,
|
|
81
|
+
loading: getEventList.loading,
|
|
82
|
+
style: { padding: "16px" }
|
|
83
|
+
},
|
|
84
|
+
/* @__PURE__ */ import_react.default.createElement(
|
|
85
|
+
import_bookingServiceList.default,
|
|
86
|
+
{
|
|
87
|
+
dataSource: lists,
|
|
88
|
+
showSearch: true,
|
|
89
|
+
showCategory: false,
|
|
90
|
+
showImage: true,
|
|
91
|
+
onClick: handleClick,
|
|
92
|
+
onSearch: handleSearch,
|
|
93
|
+
placeholder: import_utils.locales.getText("pisell2.event.search"),
|
|
94
|
+
isShowEmpty: !getEventList.loading,
|
|
95
|
+
description: import_utils.locales.getText("pisell2.event.empty.event")
|
|
96
|
+
}
|
|
97
|
+
)
|
|
89
98
|
)
|
|
90
99
|
), /* @__PURE__ */ import_react.default.createElement(import_bookingDetailModal.default, { open }));
|
|
91
100
|
};
|
|
@@ -37,37 +37,22 @@ var import_materials = require("@pisell/materials");
|
|
|
37
37
|
var import_utils = require("@pisell/utils");
|
|
38
38
|
var import_index = require("./index.less");
|
|
39
39
|
var OrderProductModal = (props) => {
|
|
40
|
-
const { open, onCancel,
|
|
41
|
-
const renderStyle = () => {
|
|
42
|
-
return {
|
|
43
|
-
border: "1px solid var(--Error-600, #D92D20)",
|
|
44
|
-
background: "var(--Error-600, #D92D20)",
|
|
45
|
-
boxShadow: "0px 1px 2px 0px rgba(16, 24, 40, 0.05)",
|
|
46
|
-
color: "#fff"
|
|
47
|
-
};
|
|
48
|
-
};
|
|
40
|
+
const { open, onCancel, type = "cart" } = props;
|
|
49
41
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
50
|
-
import_materials.PisellModal,
|
|
42
|
+
import_materials.PisellModal.Information,
|
|
51
43
|
{
|
|
52
44
|
open,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
cancelText: import_utils.locales.getText("pisell2.event.order.items.error.back"),
|
|
45
|
+
title: type === "cart" ? import_utils.locales.getText("pisell2.event.event.full.title") : import_utils.locales.getText("pisell2.event.capacity.limit.reached.title"),
|
|
46
|
+
describe: type === "cart" ? import_utils.locales.getText("pisell2.event.event.full.tip") : import_utils.locales.getText("pisell2.event.capacity.limit.reached.tip"),
|
|
47
|
+
okText: import_utils.locales.getText("pisell2.event.event.full.ok"),
|
|
48
|
+
cancelText: "",
|
|
49
|
+
cancelVisible: false,
|
|
59
50
|
closable: true,
|
|
60
51
|
onCancel: () => onCancel(),
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
style: !okVisible ? renderStyle() : {}
|
|
66
|
-
},
|
|
67
|
-
onOk: () => onOk(),
|
|
68
|
-
className: "event-booking-order-product-modal"
|
|
69
|
-
},
|
|
70
|
-
/* @__PURE__ */ import_react.default.createElement("div", { className: "event-booking-order-product-modal-content" }, /* @__PURE__ */ import_react.default.createElement("span", { className: "event-booking-order-product-modal-content-title" }, import_utils.locales.getText("pisell2.event.order.items.error.title")), /* @__PURE__ */ import_react.default.createElement("div", { className: "event-booking-order-product-modal-content-describe" }, /* @__PURE__ */ import_react.default.createElement("span", null, !okVisible ? import_utils.locales.getText("pisell2.event.order.items.error.all.tip") : import_utils.locales.getText("pisell2.event.order.items.error.tip")(number)), okVisible ? /* @__PURE__ */ import_react.default.createElement("ul", null, /* @__PURE__ */ import_react.default.createElement("li", null, import_utils.locales.getText("pisell2.event.order.items.error.proceed")), /* @__PURE__ */ import_react.default.createElement("li", null, import_utils.locales.getText("pisell2.event.order.items.error.return"))) : null))
|
|
52
|
+
onOk: () => onCancel(),
|
|
53
|
+
mobileModalHeight: "80vh",
|
|
54
|
+
zIndex: 1001
|
|
55
|
+
}
|
|
71
56
|
);
|
|
72
57
|
};
|
|
73
58
|
var OrderProductModal_default = OrderProductModal;
|
|
@@ -36,19 +36,17 @@ var import_react = __toESM(require("react"));
|
|
|
36
36
|
var import_materials = require("@pisell/materials");
|
|
37
37
|
var import_utils = require("@pisell/utils");
|
|
38
38
|
var import_Sales = require("../../../../Sales");
|
|
39
|
+
var import_useEngineContext = __toESM(require("../../../../../hooks/useEngineContext"));
|
|
39
40
|
var import_resourceDisplay = __toESM(require("../../resourceDisplay"));
|
|
40
41
|
var import_index = require("./index.less");
|
|
41
42
|
var Resource = () => {
|
|
42
|
-
var _a, _b;
|
|
43
|
+
var _a, _b, _c;
|
|
43
44
|
const { data } = (0, import_Sales.useSales)();
|
|
44
45
|
const { getResourceList, selectResource } = (0, import_Sales.useResource)();
|
|
45
46
|
const { createCartItem } = (0, import_Sales.useCart)();
|
|
46
47
|
const { nextStep } = (0, import_Sales.useStep)();
|
|
47
|
-
const
|
|
48
|
+
const context = (0, import_useEngineContext.default)();
|
|
48
49
|
const handleClick = (item) => {
|
|
49
|
-
if (!isLogin()) {
|
|
50
|
-
return openLoginModal({});
|
|
51
|
-
}
|
|
52
50
|
createCartItem();
|
|
53
51
|
selectResource(item);
|
|
54
52
|
nextStep();
|
|
@@ -68,13 +66,20 @@ var Resource = () => {
|
|
|
68
66
|
}
|
|
69
67
|
);
|
|
70
68
|
};
|
|
69
|
+
const resourceTitle = (0, import_react.useMemo)(() => {
|
|
70
|
+
var _a2, _b2, _c2, _d, _e, _f, _g;
|
|
71
|
+
const form = (_c2 = (_b2 = (_a2 = data == null ? void 0 : data.initData) == null ? void 0 : _a2.boardSetting) == null ? void 0 : _b2.event_v2_form) == null ? void 0 : _c2.form;
|
|
72
|
+
const title = ((_d = form == null ? void 0 : form.setting) == null ? void 0 : _d.title) || (form == null ? void 0 : form.title);
|
|
73
|
+
const translation = (_f = (_e = context == null ? void 0 : context.appHelper) == null ? void 0 : _e.utils) == null ? void 0 : _f.translation;
|
|
74
|
+
return (_g = translation(title)) == null ? void 0 : _g.toLowerCase();
|
|
75
|
+
}, [(_a = data == null ? void 0 : data.initData) == null ? void 0 : _a.boardSetting]);
|
|
71
76
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
72
77
|
"div",
|
|
73
78
|
{
|
|
74
79
|
className: `event-interface-resource-wrap ${(0, import_utils.isMobile)() ? "event-interface-resource-mobile-wrap" : ""}`
|
|
75
80
|
},
|
|
76
|
-
/* @__PURE__ */ import_react.default.createElement("span", { className: "title" }, import_utils.locales.getText("pisell2.event.select.campus")),
|
|
77
|
-
/* @__PURE__ */ import_react.default.createElement("div", { className: "content" }, (
|
|
81
|
+
/* @__PURE__ */ import_react.default.createElement("span", { className: "title" }, import_utils.locales.getText("pisell2.event.select.campus")(resourceTitle)),
|
|
82
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "content" }, (_c = (_b = data == null ? void 0 : data.resourceData) == null ? void 0 : _b.resourceList) == null ? void 0 : _c.map((item, index) => {
|
|
78
83
|
return /* @__PURE__ */ import_react.default.createElement("div", { key: index, className: "content-item" }, /* @__PURE__ */ import_react.default.createElement("span", { className: "content-title" }, item == null ? void 0 : item.title), /* @__PURE__ */ import_react.default.createElement(
|
|
79
84
|
import_materials.PisellViewGrid,
|
|
80
85
|
{
|
|
@@ -50,6 +50,7 @@ var SelectHolderModal = (props) => {
|
|
|
50
50
|
} = (0, import_Sales.useHolder)();
|
|
51
51
|
const { nextStep, prevStep, currentStepData } = (0, import_Sales.useStep)();
|
|
52
52
|
const [selectedHolder, setSelectedHolder] = (0, import_react.useState)(defaultSelectedHolder);
|
|
53
|
+
const { onCloseCart } = (0, import_Sales.useCart)();
|
|
53
54
|
(0, import_react.useEffect)(() => {
|
|
54
55
|
setSelectedHolder(defaultSelectedHolder);
|
|
55
56
|
}, [defaultSelectedHolder]);
|
|
@@ -80,6 +81,7 @@ var SelectHolderModal = (props) => {
|
|
|
80
81
|
disabled: !((_a = holderData == null ? void 0 : holderData.holderList) == null ? void 0 : _a.length) || !(selectedHolder == null ? void 0 : selectedHolder.id),
|
|
81
82
|
errorTipText: import_utils.locales.getText("pisell2.event.error.holder"),
|
|
82
83
|
onOk: () => {
|
|
84
|
+
onCloseCart();
|
|
83
85
|
const isEvent = (currentStepData == null ? void 0 : currentStepData.key) === "select-event";
|
|
84
86
|
selectHolder(selectedHolder, isEvent ? "addToCart" : "createCartItem");
|
|
85
87
|
if (isEvent) {
|
|
@@ -40,6 +40,7 @@ var import_utils = require("@pisell/utils");
|
|
|
40
40
|
var import_Schedule = __toESM(require("./components/Schedule"));
|
|
41
41
|
var import_Resource = __toESM(require("./components/Resource"));
|
|
42
42
|
var import_BookingOptions = __toESM(require("./components/BookingOptions"));
|
|
43
|
+
var import_OrderProductModal = __toESM(require("../Provider/OrderProductModal/index"));
|
|
43
44
|
var import_index = require("./index.less");
|
|
44
45
|
var BookingDetailModal = (props) => {
|
|
45
46
|
var _a;
|
|
@@ -47,9 +48,10 @@ var BookingDetailModal = (props) => {
|
|
|
47
48
|
const tabsRef = (0, import_react.useRef)();
|
|
48
49
|
const { open = false } = props;
|
|
49
50
|
const { detail, onCloseEventDetail, onSelectEventDetail } = (0, import_Sales.useEventDetail)();
|
|
50
|
-
const { addToCart } = (0, import_Sales.useCart)();
|
|
51
|
+
const { addToCart, checkBeforeAddToCart, checkBeforeAddToCartResquest } = (0, import_Sales.useCart)();
|
|
51
52
|
const [activeTab, setActiveTab] = (0, import_react.useState)("introduction");
|
|
52
53
|
const [isScrolling, setIsScrolling] = (0, import_react.useState)(false);
|
|
54
|
+
const [openCheckout, setOpenCheckout] = (0, import_react.useState)(false);
|
|
53
55
|
const anchorOptions = (0, import_react.useMemo)(
|
|
54
56
|
() => [
|
|
55
57
|
{
|
|
@@ -151,11 +153,16 @@ var BookingDetailModal = (props) => {
|
|
|
151
153
|
}
|
|
152
154
|
) : null, /* @__PURE__ */ import_react.default.createElement(import_eventCard.default, { data: detail == null ? void 0 : detail.introduction })), /* @__PURE__ */ import_react.default.createElement("div", { id: "schedule", className: "content-section" }, /* @__PURE__ */ import_react.default.createElement(import_Schedule.default, null)), /* @__PURE__ */ import_react.default.createElement("div", { id: "resource", className: "content-section" }, /* @__PURE__ */ import_react.default.createElement(import_Resource.default, null)), /* @__PURE__ */ import_react.default.createElement("div", { id: "booking_options", className: "content-section" }, /* @__PURE__ */ import_react.default.createElement(import_BookingOptions.default, null))));
|
|
153
155
|
};
|
|
154
|
-
const handleOk = () => {
|
|
156
|
+
const handleOk = async () => {
|
|
155
157
|
onSelectEventDetail();
|
|
158
|
+
const checkRes = await checkBeforeAddToCart();
|
|
159
|
+
if ((checkRes == null ? void 0 : checkRes.result) === false) {
|
|
160
|
+
setOpenCheckout(true);
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
156
163
|
addToCart();
|
|
157
164
|
};
|
|
158
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
165
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
159
166
|
import_materials.PisellModal,
|
|
160
167
|
{
|
|
161
168
|
open,
|
|
@@ -169,9 +176,18 @@ var BookingDetailModal = (props) => {
|
|
|
169
176
|
okText: import_utils.locales.getText("pisell2.event.add.to.cart"),
|
|
170
177
|
cancelVisible: false,
|
|
171
178
|
onOk: handleOk,
|
|
172
|
-
width: (0, import_utils.isMobile)() ? "100%" : 600
|
|
179
|
+
width: (0, import_utils.isMobile)() ? "100%" : 600,
|
|
180
|
+
okButtonProps: {
|
|
181
|
+
loading: checkBeforeAddToCartResquest == null ? void 0 : checkBeforeAddToCartResquest.loading
|
|
182
|
+
}
|
|
173
183
|
},
|
|
174
184
|
content()
|
|
175
|
-
)
|
|
185
|
+
), /* @__PURE__ */ import_react.default.createElement(
|
|
186
|
+
import_OrderProductModal.default,
|
|
187
|
+
{
|
|
188
|
+
open: openCheckout,
|
|
189
|
+
onCancel: () => setOpenCheckout(false)
|
|
190
|
+
}
|
|
191
|
+
));
|
|
176
192
|
};
|
|
177
193
|
var bookingDetailModal_default = BookingDetailModal;
|
|
@@ -34,6 +34,7 @@ __export(progressBar_exports, {
|
|
|
34
34
|
module.exports = __toCommonJS(progressBar_exports);
|
|
35
35
|
var import_react = __toESM(require("react"));
|
|
36
36
|
var import_materials = require("@pisell/materials");
|
|
37
|
+
var import_Sales = require("../../../Sales");
|
|
37
38
|
var import_utils = require("@pisell/utils");
|
|
38
39
|
var import_index = require("./index.less");
|
|
39
40
|
var ProgressBar = ({
|
|
@@ -48,6 +49,7 @@ var ProgressBar = ({
|
|
|
48
49
|
onClose
|
|
49
50
|
}) => {
|
|
50
51
|
const [open, setOpen] = (0, import_react.useState)(false);
|
|
52
|
+
const { removeSessionStorage } = (0, import_Sales.useSales)();
|
|
51
53
|
const handleClose = () => {
|
|
52
54
|
if (isConfirmClose) {
|
|
53
55
|
setOpen(true);
|
|
@@ -55,6 +57,11 @@ var ProgressBar = ({
|
|
|
55
57
|
onClose == null ? void 0 : onClose();
|
|
56
58
|
}
|
|
57
59
|
};
|
|
60
|
+
const handleOk = () => {
|
|
61
|
+
onClose == null ? void 0 : onClose();
|
|
62
|
+
setOpen(false);
|
|
63
|
+
removeSessionStorage();
|
|
64
|
+
};
|
|
58
65
|
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
59
66
|
import_materials.PisellHeaderProgressBar,
|
|
60
67
|
{
|
|
@@ -86,10 +93,7 @@ var ProgressBar = ({
|
|
|
86
93
|
onCancel: () => {
|
|
87
94
|
setOpen(false);
|
|
88
95
|
},
|
|
89
|
-
onOk: () =>
|
|
90
|
-
onClose == null ? void 0 : onClose();
|
|
91
|
-
setOpen(false);
|
|
92
|
-
}
|
|
96
|
+
onOk: () => handleOk()
|
|
93
97
|
}
|
|
94
98
|
));
|
|
95
99
|
};
|
|
@@ -37,8 +37,15 @@ var import_dayjs = __toESM(require("dayjs"));
|
|
|
37
37
|
var import_react = __toESM(require("react"));
|
|
38
38
|
var import_materials = require("@pisell/materials");
|
|
39
39
|
var import_utils = require("../../utils");
|
|
40
|
+
var import_useEngineContext = __toESM(require("../../../../hooks/useEngineContext"));
|
|
41
|
+
var import_zh_CN = __toESM(require("antd/es/date-picker/locale/zh_CN"));
|
|
42
|
+
var import_en_US = __toESM(require("antd/es/date-picker/locale/en_US"));
|
|
40
43
|
var CalendarItem = (props) => {
|
|
44
|
+
var _a, _b;
|
|
41
45
|
const { month, schedulesData, selectDate, onSelect, isEdit, onChange } = props;
|
|
46
|
+
const context = (0, import_useEngineContext.default)();
|
|
47
|
+
const utils = context.appHelper.utils || {};
|
|
48
|
+
const locale = ((_b = (_a = utils == null ? void 0 : utils.storage) == null ? void 0 : _a.get("umi_locale")) == null ? void 0 : _b.includes("zh")) ? import_zh_CN.default : import_en_US.default;
|
|
42
49
|
const scheduleMap = (0, import_react.useMemo)(
|
|
43
50
|
() => new Map(
|
|
44
51
|
schedulesData.map((schedule) => [schedule.date, schedule])
|
|
@@ -71,6 +78,7 @@ var CalendarItem = (props) => {
|
|
|
71
78
|
)), /* @__PURE__ */ import_react.default.createElement(
|
|
72
79
|
import_antd.Calendar,
|
|
73
80
|
{
|
|
81
|
+
locale,
|
|
74
82
|
headerRender: () => null,
|
|
75
83
|
fullscreen: false,
|
|
76
84
|
value: (0, import_dayjs.default)(month),
|
|
@@ -41,6 +41,10 @@
|
|
|
41
41
|
padding: 0;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
+
.pisell-lowcode-picker-calendar {
|
|
45
|
+
user-select: none;
|
|
46
|
+
}
|
|
47
|
+
|
|
44
48
|
// .pisell-lowcode-picker-calendar .pisell-lowcode-picker-cell {
|
|
45
49
|
// // margin-top: 16px;
|
|
46
50
|
// margin-top: 0;
|
|
@@ -62,6 +66,10 @@
|
|
|
62
66
|
align-items: center;
|
|
63
67
|
align-self: stretch;
|
|
64
68
|
margin-bottom: 10px;
|
|
69
|
+
user-select: none; // 防止文本被选中
|
|
70
|
+
-webkit-user-select: none;
|
|
71
|
+
-moz-user-select: none;
|
|
72
|
+
-ms-user-select: none;
|
|
65
73
|
|
|
66
74
|
.calendar-month-icon {
|
|
67
75
|
font-size: 20px;
|
|
@@ -71,6 +79,10 @@
|
|
|
71
79
|
align-items: center;
|
|
72
80
|
gap: 8px;
|
|
73
81
|
cursor: pointer;
|
|
82
|
+
user-select: none;
|
|
83
|
+
&:active {
|
|
84
|
+
cursor: pointer !important;
|
|
85
|
+
}
|
|
74
86
|
}
|
|
75
87
|
|
|
76
88
|
.calendar-month-title {
|
|
@@ -50,17 +50,9 @@ var Content = () => {
|
|
|
50
50
|
const { getBoardSetting } = (0, import_Sales.useInit)();
|
|
51
51
|
const { currentStepData } = (0, import_Sales.useStep)();
|
|
52
52
|
const { getResourceList } = (0, import_Sales.useResource)();
|
|
53
|
-
const { openLoginModal, isLogin } = (0, import_Sales.useCustomer)();
|
|
54
|
-
const { removeSessionStorage } = (0, import_Sales.useSales)();
|
|
55
53
|
const { form_id, shop_id } = data.initData || {};
|
|
56
54
|
(0, import_react.useEffect)(() => {
|
|
57
|
-
if (!isLogin()) {
|
|
58
|
-
openLoginModal({});
|
|
59
|
-
}
|
|
60
55
|
getBoardSetting.run({ item_type: "event_booking_v2" });
|
|
61
|
-
return () => {
|
|
62
|
-
removeSessionStorage();
|
|
63
|
-
};
|
|
64
56
|
}, []);
|
|
65
57
|
(0, import_react.useEffect)(() => {
|
|
66
58
|
if (!form_id)
|
|
@@ -14,7 +14,7 @@ declare const _default: {
|
|
|
14
14
|
'pisell2.event.close.exit': string;
|
|
15
15
|
'pisell2.event.step': (step: number) => string;
|
|
16
16
|
'pisell2.event.select.category': string;
|
|
17
|
-
'pisell2.event.select.campus': string;
|
|
17
|
+
'pisell2.event.select.campus': (val: string) => string;
|
|
18
18
|
'pisell2.event.select.event': string;
|
|
19
19
|
'pisell2.event.cart': string;
|
|
20
20
|
'pisell2.event.total': string;
|
|
@@ -58,6 +58,16 @@ declare const _default: {
|
|
|
58
58
|
'pisell2.event.empty.event': string;
|
|
59
59
|
'pisell2.event.error.holder': string;
|
|
60
60
|
'pisell2.event.price.from': string;
|
|
61
|
+
'pisell2.event.empty.holder.title': string;
|
|
62
|
+
'pisell2.event.empty.holder.tip': string;
|
|
63
|
+
'pisell2.event.empty.holder.continue.tip': string;
|
|
64
|
+
'pisell2.event.empty.holder.go.back': string;
|
|
65
|
+
'pisell2.event.empty.holder.continue.anyway': string;
|
|
66
|
+
'pisell2.event.event.full.title': string;
|
|
67
|
+
'pisell2.event.event.full.tip': string;
|
|
68
|
+
'pisell2.event.event.full.ok': string;
|
|
69
|
+
'pisell2.event.capacity.limit.reached.title': string;
|
|
70
|
+
'pisell2.event.capacity.limit.reached.tip': string;
|
|
61
71
|
};
|
|
62
72
|
'zh-CN': {
|
|
63
73
|
'pisell2.event.calendar.limit.unavailable': string;
|
|
@@ -75,7 +85,7 @@ declare const _default: {
|
|
|
75
85
|
'pisell2.event.step': (step: number) => string;
|
|
76
86
|
'pisell2.event.select.category': string;
|
|
77
87
|
'pisell2.event.select.event': string;
|
|
78
|
-
'pisell2.event.select.campus': string;
|
|
88
|
+
'pisell2.event.select.campus': (val: string) => string;
|
|
79
89
|
'pisell2.event.cart': string;
|
|
80
90
|
'pisell2.event.total': string;
|
|
81
91
|
'pisell2.event.continue': string;
|
|
@@ -118,6 +128,16 @@ declare const _default: {
|
|
|
118
128
|
'pisell2.event.empty.event': string;
|
|
119
129
|
'pisell2.event.error.holder': string;
|
|
120
130
|
'pisell2.event.price.from': string;
|
|
131
|
+
'pisell2.event.empty.holder.title': string;
|
|
132
|
+
'pisell2.event.empty.holder.tip': string;
|
|
133
|
+
'pisell2.event.empty.holder.continue.tip': string;
|
|
134
|
+
'pisell2.event.empty.holder.go.back': string;
|
|
135
|
+
'pisell2.event.empty.holder.continue.anyway': string;
|
|
136
|
+
'pisell2.event.event.full.title': string;
|
|
137
|
+
'pisell2.event.event.full.tip': string;
|
|
138
|
+
'pisell2.event.event.full.ok': string;
|
|
139
|
+
'pisell2.event.capacity.limit.reached.title': string;
|
|
140
|
+
'pisell2.event.capacity.limit.reached.tip': string;
|
|
121
141
|
};
|
|
122
142
|
'zh-HK': {
|
|
123
143
|
'pisell2.event.calendar.limit.unavailable': string;
|
|
@@ -135,7 +155,7 @@ declare const _default: {
|
|
|
135
155
|
'pisell2.event.step': (step: number) => string;
|
|
136
156
|
'pisell2.event.select.category': string;
|
|
137
157
|
'pisell2.event.select.event': string;
|
|
138
|
-
'pisell2.event.select.campus': string;
|
|
158
|
+
'pisell2.event.select.campus': (val: string) => string;
|
|
139
159
|
'pisell2.event.cart': string;
|
|
140
160
|
'pisell2.event.total': string;
|
|
141
161
|
'pisell2.event.continue': string;
|
|
@@ -178,6 +198,16 @@ declare const _default: {
|
|
|
178
198
|
'pisell2.event.empty.event': string;
|
|
179
199
|
'pisell2.event.error.holder': string;
|
|
180
200
|
'pisell2.event.price.from': string;
|
|
201
|
+
'pisell2.event.empty.holder.title': string;
|
|
202
|
+
'pisell2.event.empty.holder.tip': string;
|
|
203
|
+
'pisell2.event.empty.holder.continue.tip': string;
|
|
204
|
+
'pisell2.event.empty.holder.go.back': string;
|
|
205
|
+
'pisell2.event.empty.holder.continue.anyway': string;
|
|
206
|
+
'pisell2.event.event.full.title': string;
|
|
207
|
+
'pisell2.event.event.full.tip': string;
|
|
208
|
+
'pisell2.event.event.full.ok': string;
|
|
209
|
+
'pisell2.event.capacity.limit.reached.title': string;
|
|
210
|
+
'pisell2.event.capacity.limit.reached.tip': string;
|
|
181
211
|
};
|
|
182
212
|
};
|
|
183
213
|
export default _default;
|