@pisell/private-materials 3.3.85 → 3.3.87
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 +8 -8
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +11 -11
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +11 -11
- package/es/businessModel/SalesModel/Sales/index.js +37 -4
- package/es/components/Sales/Cart/index.js +5 -1
- package/es/components/Sales/Cart/utils.d.ts +40 -0
- package/es/components/Sales/Cart/utils.js +167 -0
- package/es/components/Sales/Checkout/index.d.ts +4 -0
- package/es/components/Sales/Checkout/index.js +52 -8
- package/es/components/Sales/Checkout/serve.d.ts +13 -0
- package/es/components/Sales/Checkout/serve.js +16 -2
- package/es/components/Sales/Checkout/utils.js +7 -1
- package/es/components/Sales/Resource/index.js +2 -2
- package/es/components/Sales/Resource/serve.d.ts +7 -0
- package/es/components/Sales/Resource/serve.js +10 -0
- package/es/components/Sales/Summary/index.d.ts +10 -0
- package/es/components/Sales/Summary/index.js +17 -2
- package/es/components/Sales/Summary/serve.d.ts +1 -0
- package/es/components/Sales/Summary/serve.js +6 -0
- package/es/components/Sales/Summary/utils.d.ts +15 -0
- package/es/components/Sales/Summary/utils.js +43 -1
- package/es/components/appointmentBooking/components/Cart/Item/index.less +3 -3
- package/es/components/appointmentBooking/components/Content/index.less +1 -1
- package/es/components/appointmentBooking/components/Deposit/index.d.ts +6 -0
- package/es/components/appointmentBooking/components/Deposit/index.js +27 -7
- package/es/components/appointmentBooking/components/Header/index.d.ts +3 -0
- package/es/components/appointmentBooking/components/Services/index.js +23 -27
- package/es/components/appointmentBooking/deposit/components/PolicyModal/index.js +25 -20
- package/es/components/appointmentBooking/deposit/index.js +4 -2
- package/es/components/appointmentBooking/index.js +14 -0
- package/es/components/appointmentBooking/index.less +1 -1
- package/es/components/booking/components/footer/utils.d.ts +1 -0
- package/es/components/booking/components/footer/utils.js +5 -6
- package/es/components/booking/components/voucher/index.js +2 -2
- package/es/components/booking/editBookingModal/index.d.ts +5 -0
- package/es/components/booking/editBookingModal/index.js +386 -0
- package/es/components/booking/editBookingModal/index.less +8 -0
- package/es/components/booking/editBookingModal/locales.d.ts +21 -0
- package/es/components/booking/editBookingModal/locales.js +20 -0
- package/es/components/booking/editBookingModal/mock.d.ts +807 -0
- package/es/components/booking/editBookingModal/mock.js +2993 -0
- package/es/components/booking/editBookingModal/serve.d.ts +51 -0
- package/es/components/booking/editBookingModal/serve.js +288 -0
- package/es/components/booking/editBookingModal/type.d.ts +12 -0
- package/es/components/booking/editBookingModal/type.js +1 -0
- package/es/components/booking/editBookingModal/utils.d.ts +12 -0
- package/es/components/booking/editBookingModal/utils.js +157 -0
- package/es/components/booking/info/service/addService/index.js +3 -3
- package/es/components/booking/info/service2/utils.d.ts +1 -1
- package/es/components/booking/info/service2/utils.js +3 -2
- package/es/components/booking/info2/service/addService/utils.d.ts +10 -0
- package/es/components/booking/info2/service/addService/utils.js +44 -13
- package/es/components/booking/info2/service/editService/Resources/index.js +22 -8
- package/es/components/booking/info2/service/editService/Resources/index.less +6 -0
- package/es/components/booking/info2/service/editService/ResourcesV2/MaxLengthSelect/index.d.ts +7 -0
- package/es/components/booking/info2/service/editService/ResourcesV2/MaxLengthSelect/index.js +26 -0
- package/es/components/booking/info2/service/editService/ResourcesV2/index.d.ts +10 -0
- package/es/components/booking/info2/service/editService/ResourcesV2/index.js +308 -0
- package/es/components/booking/info2/service/editService/ResourcesV2/index.less +44 -0
- package/es/components/booking/info2/utilsByBooking.js +9 -0
- package/es/components/booking/locales.d.ts +3 -0
- package/es/components/booking/locales.js +3 -0
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/eftposPay/const.d.ts +4 -1
- package/es/components/eftposPay/const.js +3 -1
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/hooks.js +3 -1
- package/es/components/eftposPay/index.js +1 -1
- package/es/components/eftposPay/linkly/const.d.ts +23 -0
- package/es/components/eftposPay/linkly/const.js +82 -0
- package/es/components/eftposPay/linkly/hooks/index.d.ts +2 -0
- package/es/components/eftposPay/linkly/hooks/index.js +2 -0
- package/es/components/eftposPay/linkly/hooks/normal.d.ts +30 -0
- package/es/components/eftposPay/linkly/hooks/normal.js +318 -0
- package/es/components/eftposPay/linkly/hooks/useTimeQuery.d.ts +4 -0
- package/es/components/eftposPay/linkly/hooks/useTimeQuery.js +273 -0
- package/es/components/eftposPay/linkly/index.d.ts +2 -0
- package/es/components/eftposPay/linkly/index.js +197 -0
- package/es/components/eftposPay/linkly/service.d.ts +32 -0
- package/es/components/eftposPay/linkly/service.js +73 -0
- package/es/components/eftposPay/manufacturer.d.ts +1 -0
- package/es/components/eftposPay/manufacturer.js +4 -0
- package/es/components/eftposPay/pay.d.ts +1 -1
- package/es/components/eftposPay/pay.js +6 -2
- package/es/components/eftposPay/store/index.d.ts +1 -1
- package/es/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +29 -17
- package/es/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +2 -0
- package/es/components/eventBooking/components/Provider/Cart/Deposit/index.js +17 -0
- package/es/components/eventBooking/components/Provider/Cart/Item/Total.js +10 -6
- package/es/components/eventBooking/components/Provider/Cart/Item/index.js +4 -2
- package/es/components/eventBooking/components/Provider/Event/index.js +13 -4
- package/es/components/eventBooking/components/bookingDetailModal/index.js +22 -4
- package/es/components/eventBooking/index.js +21 -7
- package/es/components/eventBooking/locales.d.ts +24 -0
- package/es/components/eventBooking/locales.js +30 -6
- package/es/components/index.d.ts +3 -1
- package/es/components/index.js +3 -1
- package/es/components/pay/toC/PaymentMethods/index.js +5 -4
- package/es/components/stepController/components/Content/index.d.ts +7 -0
- package/es/components/stepController/components/Content/index.js +9 -0
- package/es/components/stepController/components/Content/index.less +8 -0
- package/es/components/stepController/components/Footer/index.d.ts +8 -0
- package/es/components/stepController/components/Footer/index.js +15 -0
- package/es/components/stepController/components/Footer/index.less +39 -0
- package/es/components/stepController/components/Header/index.d.ts +20 -0
- package/es/components/stepController/components/Header/index.js +97 -0
- package/es/components/stepController/components/Header/index.less +21 -0
- package/es/components/stepController/index.d.ts +5 -0
- package/es/components/stepController/index.js +64 -0
- package/es/components/stepController/index.less +11 -0
- package/es/components/stepController/locales.d.ts +27 -0
- package/es/components/stepController/locales.js +32 -0
- package/es/components/stepController/types.d.ts +23 -0
- package/es/components/stepController/types.js +1 -0
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +4 -5
- package/es/components/ticketBooking/components/ticketBooking/index.d.ts +1 -0
- package/es/components/ticketBooking/components/ticketBooking/index.js +257 -138
- package/es/components/ticketBooking/locales.d.ts +164 -146
- package/es/components/ticketBooking/locales.js +195 -147
- package/es/components/ticketBooking/utils/formatProductMessage.d.ts +2 -0
- package/es/components/ticketBooking/utils/formatProductMessage.js +62 -0
- package/es/components/ticketBooking/utils/formatTime.d.ts +31 -0
- package/es/components/ticketBooking/utils/formatTime.js +144 -0
- package/es/hooks/useWindowSize.d.ts +5 -0
- package/es/hooks/useWindowSize.js +26 -0
- package/es/index.d.ts +2 -0
- package/es/index.js +3 -1
- package/lib/businessModel/SalesModel/Sales/index.js +22 -8
- package/lib/components/Sales/Cart/index.js +1 -0
- package/lib/components/Sales/Cart/utils.d.ts +40 -0
- package/lib/components/Sales/Cart/utils.js +117 -0
- package/lib/components/Sales/Checkout/index.d.ts +4 -0
- package/lib/components/Sales/Checkout/index.js +39 -7
- package/lib/components/Sales/Checkout/serve.d.ts +13 -0
- package/lib/components/Sales/Checkout/serve.js +7 -2
- package/lib/components/Sales/Checkout/utils.js +2 -0
- package/lib/components/Sales/Resource/index.js +1 -1
- package/lib/components/Sales/Resource/serve.d.ts +7 -0
- package/lib/components/Sales/Resource/serve.js +9 -2
- package/lib/components/Sales/Summary/index.d.ts +10 -0
- package/lib/components/Sales/Summary/index.js +7 -1
- package/lib/components/Sales/Summary/serve.d.ts +1 -0
- package/lib/components/Sales/Summary/serve.js +32 -0
- package/lib/components/Sales/Summary/utils.d.ts +15 -0
- package/lib/components/Sales/Summary/utils.js +30 -1
- package/lib/components/appointmentBooking/components/Cart/Item/index.less +3 -3
- package/lib/components/appointmentBooking/components/Content/index.less +1 -1
- package/lib/components/appointmentBooking/components/Deposit/index.d.ts +6 -0
- package/lib/components/appointmentBooking/components/Deposit/index.js +36 -4
- package/lib/components/appointmentBooking/components/Header/index.d.ts +3 -0
- package/lib/components/appointmentBooking/components/Services/index.js +6 -11
- package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.js +8 -4
- package/lib/components/appointmentBooking/deposit/index.js +4 -2
- package/lib/components/appointmentBooking/index.js +11 -0
- package/lib/components/appointmentBooking/index.less +1 -1
- package/lib/components/booking/components/footer/utils.d.ts +1 -0
- package/lib/components/booking/components/footer/utils.js +4 -5
- package/lib/components/booking/components/voucher/index.js +2 -2
- package/lib/components/booking/editBookingModal/index.d.ts +5 -0
- package/lib/components/booking/editBookingModal/index.js +363 -0
- package/lib/components/booking/editBookingModal/index.less +8 -0
- package/lib/components/booking/editBookingModal/locales.d.ts +21 -0
- package/lib/components/booking/editBookingModal/locales.js +44 -0
- package/lib/components/booking/editBookingModal/mock.d.ts +807 -0
- package/lib/components/booking/editBookingModal/mock.js +3314 -0
- package/lib/components/booking/editBookingModal/serve.d.ts +51 -0
- package/lib/components/booking/editBookingModal/serve.js +178 -0
- package/lib/components/booking/editBookingModal/type.d.ts +12 -0
- package/lib/components/booking/editBookingModal/type.js +17 -0
- package/lib/components/booking/editBookingModal/utils.d.ts +12 -0
- package/lib/components/booking/editBookingModal/utils.js +158 -0
- package/lib/components/booking/info/service/addService/index.js +1 -1
- package/lib/components/booking/info/service2/utils.d.ts +1 -1
- package/lib/components/booking/info/service2/utils.js +2 -2
- package/lib/components/booking/info2/service/addService/utils.d.ts +10 -0
- package/lib/components/booking/info2/service/addService/utils.js +27 -4
- package/lib/components/booking/info2/service/editService/Resources/index.js +54 -10
- package/lib/components/booking/info2/service/editService/Resources/index.less +6 -0
- package/lib/components/booking/info2/service/editService/ResourcesV2/MaxLengthSelect/index.d.ts +7 -0
- package/lib/components/booking/info2/service/editService/ResourcesV2/MaxLengthSelect/index.js +53 -0
- package/lib/components/booking/info2/service/editService/ResourcesV2/index.d.ts +10 -0
- package/lib/components/booking/info2/service/editService/ResourcesV2/index.js +311 -0
- package/lib/components/booking/info2/service/editService/ResourcesV2/index.less +44 -0
- package/lib/components/booking/info2/utilsByBooking.js +6 -0
- package/lib/components/booking/locales.d.ts +3 -0
- package/lib/components/booking/locales.js +3 -0
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/eftposPay/const.d.ts +4 -1
- package/lib/components/eftposPay/const.js +2 -0
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/hooks.js +11 -4
- package/lib/components/eftposPay/index.js +1 -1
- package/lib/components/eftposPay/linkly/const.d.ts +23 -0
- package/lib/components/eftposPay/linkly/const.js +102 -0
- package/lib/components/eftposPay/linkly/hooks/index.d.ts +2 -0
- package/lib/components/eftposPay/linkly/hooks/index.js +25 -0
- package/lib/components/eftposPay/linkly/hooks/normal.d.ts +30 -0
- package/lib/components/eftposPay/linkly/hooks/normal.js +239 -0
- package/lib/components/eftposPay/linkly/hooks/useTimeQuery.d.ts +4 -0
- package/lib/components/eftposPay/linkly/hooks/useTimeQuery.js +222 -0
- package/lib/components/eftposPay/linkly/index.d.ts +2 -0
- package/lib/components/eftposPay/linkly/index.js +208 -0
- package/lib/components/eftposPay/linkly/service.d.ts +32 -0
- package/lib/components/eftposPay/linkly/service.js +55 -0
- package/lib/components/eftposPay/manufacturer.d.ts +1 -0
- package/lib/components/eftposPay/manufacturer.js +6 -0
- package/lib/components/eftposPay/pay.d.ts +1 -1
- package/lib/components/eftposPay/pay.js +13 -2
- package/lib/components/eftposPay/store/index.d.ts +1 -1
- package/lib/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +16 -3
- package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +2 -0
- package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.js +55 -0
- package/lib/components/eventBooking/components/Provider/Cart/Item/Total.js +8 -5
- package/lib/components/eventBooking/components/Provider/Cart/Item/index.js +4 -2
- package/lib/components/eventBooking/components/Provider/Event/index.js +10 -3
- package/lib/components/eventBooking/components/bookingDetailModal/index.js +10 -4
- package/lib/components/eventBooking/index.js +11 -7
- package/lib/components/eventBooking/locales.d.ts +24 -0
- package/lib/components/eventBooking/locales.js +30 -6
- package/lib/components/index.d.ts +3 -1
- package/lib/components/index.js +6 -0
- package/lib/components/pay/toC/PaymentMethods/index.js +10 -9
- package/lib/components/stepController/components/Content/index.d.ts +7 -0
- package/lib/components/stepController/components/Content/index.js +40 -0
- package/lib/components/stepController/components/Content/index.less +8 -0
- package/lib/components/stepController/components/Footer/index.d.ts +8 -0
- package/lib/components/stepController/components/Footer/index.js +49 -0
- package/lib/components/stepController/components/Footer/index.less +39 -0
- package/lib/components/stepController/components/Header/index.d.ts +20 -0
- package/lib/components/stepController/components/Header/index.js +104 -0
- package/lib/components/stepController/components/Header/index.less +21 -0
- package/lib/components/stepController/index.d.ts +5 -0
- package/lib/components/stepController/index.js +89 -0
- package/lib/components/stepController/index.less +11 -0
- package/lib/components/stepController/locales.d.ts +27 -0
- package/lib/components/stepController/locales.js +50 -0
- package/lib/components/stepController/types.d.ts +23 -0
- package/lib/components/stepController/types.js +17 -0
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +6 -4
- package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +1 -0
- package/lib/components/ticketBooking/components/ticketBooking/index.js +263 -139
- package/lib/components/ticketBooking/locales.d.ts +164 -146
- package/lib/components/ticketBooking/locales.js +22 -4
- package/lib/components/ticketBooking/utils/formatProductMessage.d.ts +2 -0
- package/lib/components/ticketBooking/utils/formatProductMessage.js +84 -0
- package/lib/components/ticketBooking/utils/formatTime.d.ts +31 -0
- package/lib/components/ticketBooking/utils/formatTime.js +139 -0
- package/lib/hooks/useWindowSize.d.ts +5 -0
- package/lib/hooks/useWindowSize.js +51 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +6 -0
- package/lowcode/edit-booking-modal/meta.ts +53 -0
- package/lowcode/step-controller/meta.ts +88 -0
- package/package.json +4 -4
|
@@ -29,6 +29,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
29
29
|
// src/components/ticketBooking/components/ticketBooking/index.tsx
|
|
30
30
|
var ticketBooking_exports = {};
|
|
31
31
|
__export(ticketBooking_exports, {
|
|
32
|
+
_formatBookingDetail: () => _formatBookingDetail,
|
|
32
33
|
default: () => ticketBooking_default
|
|
33
34
|
});
|
|
34
35
|
module.exports = __toCommonJS(ticketBooking_exports);
|
|
@@ -45,12 +46,163 @@ var import_utils2 = require("../../utils");
|
|
|
45
46
|
var import_addServiceVariant = __toESM(require("../addServiceVariant"));
|
|
46
47
|
var import_timeBar = __toESM(require("../timeBar"));
|
|
47
48
|
var import_index = require("./index.less");
|
|
49
|
+
var import_utils3 = require("../../../booking/info/service2/utils");
|
|
50
|
+
var import_amount = require("../../../booking/components/footer/amount");
|
|
51
|
+
var import_formatProductMessage = __toESM(require("../../utils/formatProductMessage"));
|
|
52
|
+
var _formatBookingDetail = (data, modalState) => {
|
|
53
|
+
var _a, _b, _c, _d;
|
|
54
|
+
let {
|
|
55
|
+
customer_id,
|
|
56
|
+
holder,
|
|
57
|
+
customer_name,
|
|
58
|
+
email,
|
|
59
|
+
phone,
|
|
60
|
+
country_calling_code,
|
|
61
|
+
bookings,
|
|
62
|
+
customer,
|
|
63
|
+
note,
|
|
64
|
+
payment_status,
|
|
65
|
+
is_other_entrance_edited,
|
|
66
|
+
shop_discount
|
|
67
|
+
} = data;
|
|
68
|
+
const clientValue = {
|
|
69
|
+
name: ((customer == null ? void 0 : customer.display_name) || "").trim() || ((customer == null ? void 0 : customer.nickname) || "").trim() || "",
|
|
70
|
+
id: customer_id || (customer == null ? void 0 : customer.id) || (customer == null ? void 0 : customer.customer_id) || 1,
|
|
71
|
+
email: customer == null ? void 0 : customer.email,
|
|
72
|
+
phone: (customer == null ? void 0 : customer.phone) || "",
|
|
73
|
+
country_calling_code: (customer == null ? void 0 : customer.country_calling_code) || "",
|
|
74
|
+
cover: (customer == null ? void 0 : customer.cover) || ""
|
|
75
|
+
};
|
|
76
|
+
const start_date = (_b = (_a = bookings == null ? void 0 : bookings.list) == null ? void 0 : _a[0]) == null ? void 0 : _b.start_date;
|
|
77
|
+
const dateValue = (0, import_dayjs.default)(
|
|
78
|
+
start_date ? start_date + " " + ((_d = (_c = bookings == null ? void 0 : bookings.list) == null ? void 0 : _c[0]) == null ? void 0 : _d.start_time) : /* @__PURE__ */ new Date()
|
|
79
|
+
);
|
|
80
|
+
const petsValue = holder;
|
|
81
|
+
const getCapacity = (resetD) => {
|
|
82
|
+
var _a2;
|
|
83
|
+
return (_a2 = resetD.metadata) == null ? void 0 : _a2.capacity;
|
|
84
|
+
};
|
|
85
|
+
const getResource = (resetD) => {
|
|
86
|
+
var _a2;
|
|
87
|
+
if (!bookings.relation_type) {
|
|
88
|
+
try {
|
|
89
|
+
if ((resetD == null ? void 0 : resetD.event_resources) && ((_a2 = resetD == null ? void 0 : resetD.event_resources) == null ? void 0 : _a2.length)) {
|
|
90
|
+
return resetD.event_resources.reduce((pre, cur) => {
|
|
91
|
+
if (pre[cur.form_id]) {
|
|
92
|
+
pre[cur.form_id].push(cur);
|
|
93
|
+
} else {
|
|
94
|
+
pre[cur.form_id] = [cur];
|
|
95
|
+
}
|
|
96
|
+
return pre;
|
|
97
|
+
}, {});
|
|
98
|
+
}
|
|
99
|
+
} catch (err) {
|
|
100
|
+
console.error(err);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return resetD.relation_id;
|
|
104
|
+
};
|
|
105
|
+
const serviceValue = bookings.list.map((d) => {
|
|
106
|
+
let { detail, product, ...resetD } = d;
|
|
107
|
+
let _detail = detail || mockProduct;
|
|
108
|
+
let start_date2 = (0, import_dayjs.default)(resetD.start_date + " " + resetD.start_time);
|
|
109
|
+
let end_date = (0, import_dayjs.default)(resetD.end_date + " " + resetD.end_time);
|
|
110
|
+
return {
|
|
111
|
+
_id: (Math.random() + "").replace(/\D/g, "").substring(0, 11),
|
|
112
|
+
..._detail,
|
|
113
|
+
booking_id: resetD.id,
|
|
114
|
+
id: _detail.product_id,
|
|
115
|
+
title: _detail.product_title,
|
|
116
|
+
quantity: Number(_detail.product_quantity),
|
|
117
|
+
cover: _detail.product_cover,
|
|
118
|
+
// 商品本身的价格
|
|
119
|
+
price: Number(_detail.source_product_price),
|
|
120
|
+
relation_form_name: resetD.relation_form_name,
|
|
121
|
+
product_resource: product == null ? void 0 : product.product_resource,
|
|
122
|
+
capacity: product == null ? void 0 : product.capacity,
|
|
123
|
+
_extend: {
|
|
124
|
+
...resetD,
|
|
125
|
+
quantity: Number(_detail.product_quantity),
|
|
126
|
+
startDate: start_date2,
|
|
127
|
+
start_date: start_date2,
|
|
128
|
+
endDate: end_date,
|
|
129
|
+
end_date,
|
|
130
|
+
// 商品本身的价格
|
|
131
|
+
price: Number(_detail.source_product_price),
|
|
132
|
+
product_name: _detail.product_title,
|
|
133
|
+
discount_reason: _detail.product_discount_reason,
|
|
134
|
+
// resource: resetD.relation_id,
|
|
135
|
+
order_detail_id: _detail.order_detail_id,
|
|
136
|
+
// 总价: 商品本身价格 + 套餐价格 + 单规格价格 包含折扣
|
|
137
|
+
total: Number(_detail.selling_price),
|
|
138
|
+
// 原总价: 商品本身价格 + 套餐价格 + 单规格价格 不包含折扣
|
|
139
|
+
origin_total: Number(_detail.original_price),
|
|
140
|
+
payment_price: Number(_detail.payment_price),
|
|
141
|
+
other: (0, import_utils2.restoreProductOtherData)(d),
|
|
142
|
+
// 是否编辑了套餐 默认为0 如果编辑之后为1
|
|
143
|
+
bundle_edit: 0,
|
|
144
|
+
discount_per: _detail.discount_per,
|
|
145
|
+
discount_type: _detail.discount_type,
|
|
146
|
+
discountway: _detail.discountway,
|
|
147
|
+
capacity: getCapacity(resetD),
|
|
148
|
+
resource: getResource(resetD)
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
});
|
|
152
|
+
let disabledEdit = (0, import_utils2.getDisabledEdit)(data);
|
|
153
|
+
let channelDisabledEdit = !!is_other_entrance_edited;
|
|
154
|
+
return {
|
|
155
|
+
...modalState,
|
|
156
|
+
client: {
|
|
157
|
+
...modalState.client,
|
|
158
|
+
value: clientValue,
|
|
159
|
+
edit: false,
|
|
160
|
+
showModal: false
|
|
161
|
+
},
|
|
162
|
+
date: {
|
|
163
|
+
...modalState.date,
|
|
164
|
+
value: dateValue,
|
|
165
|
+
edit: false,
|
|
166
|
+
showModal: false
|
|
167
|
+
},
|
|
168
|
+
pet: {
|
|
169
|
+
...modalState.pet,
|
|
170
|
+
showModal: false,
|
|
171
|
+
edit: false
|
|
172
|
+
},
|
|
173
|
+
service: {
|
|
174
|
+
...modalState.service,
|
|
175
|
+
value: serviceValue,
|
|
176
|
+
addModal: false,
|
|
177
|
+
editModal: false,
|
|
178
|
+
edit: false
|
|
179
|
+
},
|
|
180
|
+
notes: {
|
|
181
|
+
...modalState.notes,
|
|
182
|
+
orderNote: note,
|
|
183
|
+
edit: false
|
|
184
|
+
},
|
|
185
|
+
disabledEdit,
|
|
186
|
+
channelDisabledEdit,
|
|
187
|
+
appointment_status: bookings == null ? void 0 : bookings.appointment_status
|
|
188
|
+
};
|
|
189
|
+
};
|
|
48
190
|
var TicketBooking = () => {
|
|
49
191
|
var _a;
|
|
50
192
|
const [state, setState] = (0, import_miniRedux.useStore)();
|
|
51
193
|
const engineContext = (0, import_useEngineContext.default)();
|
|
52
194
|
const { props: engineProps } = engineContext.engine;
|
|
53
|
-
const {
|
|
195
|
+
const {
|
|
196
|
+
action,
|
|
197
|
+
isTerminal,
|
|
198
|
+
lowcodeRef,
|
|
199
|
+
interaction,
|
|
200
|
+
store,
|
|
201
|
+
storage,
|
|
202
|
+
Toast,
|
|
203
|
+
getSymbolic,
|
|
204
|
+
translation
|
|
205
|
+
} = (_a = engineContext.appHelper) == null ? void 0 : _a.utils;
|
|
54
206
|
const _persistentRef = (0, import_react.useRef)(false);
|
|
55
207
|
const _initStateRef = (0, import_react.useRef)({});
|
|
56
208
|
const _listTimerRef = (0, import_react.useRef)();
|
|
@@ -137,6 +289,112 @@ var TicketBooking = () => {
|
|
|
137
289
|
intervalSetTime: isInterval
|
|
138
290
|
});
|
|
139
291
|
};
|
|
292
|
+
(0, import_react.useEffect)(() => {
|
|
293
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
294
|
+
const cartItems = (_b = (_a2 = state == null ? void 0 : state.modalState) == null ? void 0 : _a2.service) == null ? void 0 : _b.value;
|
|
295
|
+
if (!Array.isArray(cartItems) || cartItems.length === 0) {
|
|
296
|
+
(_d = (_c = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _c.postMessageToApp) == null ? void 0 : _d.call(_c, {
|
|
297
|
+
module: "cds",
|
|
298
|
+
key: "cartUpdate",
|
|
299
|
+
data: {
|
|
300
|
+
currency_symbol: getSymbolic(),
|
|
301
|
+
total: "0",
|
|
302
|
+
// 小计
|
|
303
|
+
products: [],
|
|
304
|
+
fees: []
|
|
305
|
+
}
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
const total = (0, import_amount.getSumTotal)(state.modalState, true);
|
|
309
|
+
let formatedProducts = [];
|
|
310
|
+
try {
|
|
311
|
+
formatedProducts = (0, import_utils3.formatProducts)(
|
|
312
|
+
cartItems,
|
|
313
|
+
state.modalState,
|
|
314
|
+
false,
|
|
315
|
+
true,
|
|
316
|
+
true
|
|
317
|
+
);
|
|
318
|
+
} catch (error) {
|
|
319
|
+
console.error(error);
|
|
320
|
+
}
|
|
321
|
+
console.log("formatedProducts", total, formatedProducts);
|
|
322
|
+
let fees = [];
|
|
323
|
+
let products = [];
|
|
324
|
+
for (const item of formatedProducts) {
|
|
325
|
+
const { id, name, image, origin_total, total: total2, num, note, _origin } = item;
|
|
326
|
+
(_e = _origin == null ? void 0 : _origin.discount_list) == null ? void 0 : _e.forEach((dl) => {
|
|
327
|
+
fees.push({
|
|
328
|
+
isReduce: dl.type === "good_pass",
|
|
329
|
+
title: translation(dl == null ? void 0 : dl.discount.title),
|
|
330
|
+
price: dl.amount,
|
|
331
|
+
type: dl.type
|
|
332
|
+
});
|
|
333
|
+
});
|
|
334
|
+
let msg = "";
|
|
335
|
+
try {
|
|
336
|
+
msg = (0, import_formatProductMessage.default)(
|
|
337
|
+
{
|
|
338
|
+
...item,
|
|
339
|
+
currency_symbol: getSymbolic()
|
|
340
|
+
},
|
|
341
|
+
(_f = engineContext.appHelper) == null ? void 0 : _f.utils
|
|
342
|
+
);
|
|
343
|
+
} catch (error) {
|
|
344
|
+
console.error(error);
|
|
345
|
+
}
|
|
346
|
+
let _item = {
|
|
347
|
+
productID: id,
|
|
348
|
+
title: name,
|
|
349
|
+
cover: image,
|
|
350
|
+
// 封面图
|
|
351
|
+
price: total2,
|
|
352
|
+
// 售价
|
|
353
|
+
buyCount: num,
|
|
354
|
+
// 购买数量
|
|
355
|
+
productFormatMessage: msg,
|
|
356
|
+
note
|
|
357
|
+
};
|
|
358
|
+
if (origin_total !== total2) _item.modifyPrice = origin_total;
|
|
359
|
+
products.push(_item);
|
|
360
|
+
}
|
|
361
|
+
console.log(
|
|
362
|
+
"formatedProducts",
|
|
363
|
+
(_g = import_utils.locales.getText("pisell2.product.card.cart-items")) == null ? void 0 : _g(products.length)
|
|
364
|
+
);
|
|
365
|
+
if (products.length > 0) {
|
|
366
|
+
fees.unshift({
|
|
367
|
+
title: import_utils.locales.getText("pisell2.product.card.subtotal"),
|
|
368
|
+
price: total.productAmount,
|
|
369
|
+
type: "subtotal",
|
|
370
|
+
message: (_h = import_utils.locales.getText("pisell2.product.card.cart-items")) == null ? void 0 : _h(
|
|
371
|
+
products.length
|
|
372
|
+
)
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
console.log("start post message, config:", {
|
|
376
|
+
module: "cds",
|
|
377
|
+
key: "cartUpdate",
|
|
378
|
+
data: {
|
|
379
|
+
currency_symbol: getSymbolic(),
|
|
380
|
+
total: total.productAmount,
|
|
381
|
+
// 小计
|
|
382
|
+
products,
|
|
383
|
+
fees
|
|
384
|
+
}
|
|
385
|
+
});
|
|
386
|
+
(_j = (_i = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _i.postMessageToApp) == null ? void 0 : _j.call(_i, {
|
|
387
|
+
module: "cds",
|
|
388
|
+
key: "cartUpdate",
|
|
389
|
+
data: {
|
|
390
|
+
currency_symbol: getSymbolic(),
|
|
391
|
+
total: total.expectAmount,
|
|
392
|
+
// 小计
|
|
393
|
+
products,
|
|
394
|
+
fees
|
|
395
|
+
}
|
|
396
|
+
});
|
|
397
|
+
}, [state.modalState]);
|
|
140
398
|
const _setModalState = (props) => {
|
|
141
399
|
var _a2, _b;
|
|
142
400
|
console.log("同步state到外层", props);
|
|
@@ -306,144 +564,6 @@ var TicketBooking = () => {
|
|
|
306
564
|
(_a2 = dom == null ? void 0 : dom.scrollIntoView) == null ? void 0 : _a2.call(dom, { block: "center", behavior: "smooth" });
|
|
307
565
|
}
|
|
308
566
|
};
|
|
309
|
-
const _formatBookingDetail = (data, modalState) => {
|
|
310
|
-
var _a2, _b, _c, _d;
|
|
311
|
-
let {
|
|
312
|
-
customer_id,
|
|
313
|
-
holder,
|
|
314
|
-
customer_name,
|
|
315
|
-
email,
|
|
316
|
-
phone,
|
|
317
|
-
country_calling_code,
|
|
318
|
-
bookings,
|
|
319
|
-
customer,
|
|
320
|
-
note,
|
|
321
|
-
payment_status,
|
|
322
|
-
is_other_entrance_edited,
|
|
323
|
-
shop_discount
|
|
324
|
-
} = data;
|
|
325
|
-
const clientValue = {
|
|
326
|
-
name: ((customer == null ? void 0 : customer.display_name) || "").trim() || ((customer == null ? void 0 : customer.nickname) || "").trim() || "",
|
|
327
|
-
id: customer_id || (customer == null ? void 0 : customer.id) || (customer == null ? void 0 : customer.customer_id) || 1,
|
|
328
|
-
email: customer == null ? void 0 : customer.email,
|
|
329
|
-
phone: (customer == null ? void 0 : customer.phone) || "",
|
|
330
|
-
country_calling_code: (customer == null ? void 0 : customer.country_calling_code) || "",
|
|
331
|
-
cover: (customer == null ? void 0 : customer.cover) || ""
|
|
332
|
-
};
|
|
333
|
-
const start_date = (_b = (_a2 = bookings == null ? void 0 : bookings.list) == null ? void 0 : _a2[0]) == null ? void 0 : _b.start_date;
|
|
334
|
-
const dateValue = (0, import_dayjs.default)(
|
|
335
|
-
start_date ? start_date + " " + ((_d = (_c = bookings == null ? void 0 : bookings.list) == null ? void 0 : _c[0]) == null ? void 0 : _d.start_time) : /* @__PURE__ */ new Date()
|
|
336
|
-
);
|
|
337
|
-
const petsValue = holder;
|
|
338
|
-
const getCapacity = (resetD) => {
|
|
339
|
-
var _a3;
|
|
340
|
-
return (_a3 = resetD.metadata) == null ? void 0 : _a3.capacity;
|
|
341
|
-
};
|
|
342
|
-
const getResource = (resetD) => {
|
|
343
|
-
var _a3;
|
|
344
|
-
if (!bookings.relation_type) {
|
|
345
|
-
try {
|
|
346
|
-
if ((resetD == null ? void 0 : resetD.event_resources) && ((_a3 = resetD == null ? void 0 : resetD.event_resources) == null ? void 0 : _a3.length)) {
|
|
347
|
-
return resetD.event_resources.reduce((pre, cur) => {
|
|
348
|
-
if (pre[cur.form_id]) {
|
|
349
|
-
pre[cur.form_id].push(cur);
|
|
350
|
-
} else {
|
|
351
|
-
pre[cur.form_id] = [cur];
|
|
352
|
-
}
|
|
353
|
-
return pre;
|
|
354
|
-
}, {});
|
|
355
|
-
}
|
|
356
|
-
} catch (err) {
|
|
357
|
-
console.error(err);
|
|
358
|
-
}
|
|
359
|
-
}
|
|
360
|
-
return resetD.relation_id;
|
|
361
|
-
};
|
|
362
|
-
const serviceValue = bookings.list.map((d) => {
|
|
363
|
-
let { detail, product, ...resetD } = d;
|
|
364
|
-
let _detail = detail || mockProduct;
|
|
365
|
-
let start_date2 = (0, import_dayjs.default)(resetD.start_date + " " + resetD.start_time);
|
|
366
|
-
let end_date = (0, import_dayjs.default)(resetD.end_date + " " + resetD.end_time);
|
|
367
|
-
return {
|
|
368
|
-
_id: (Math.random() + "").replace(/\D/g, "").substring(0, 11),
|
|
369
|
-
..._detail,
|
|
370
|
-
booking_id: resetD.id,
|
|
371
|
-
id: _detail.product_id,
|
|
372
|
-
title: _detail.product_title,
|
|
373
|
-
quantity: Number(_detail.product_quantity),
|
|
374
|
-
cover: _detail.product_cover,
|
|
375
|
-
// 商品本身的价格
|
|
376
|
-
price: Number(_detail.source_product_price),
|
|
377
|
-
relation_form_name: resetD.relation_form_name,
|
|
378
|
-
product_resource: product == null ? void 0 : product.product_resource,
|
|
379
|
-
capacity: product == null ? void 0 : product.capacity,
|
|
380
|
-
_extend: {
|
|
381
|
-
...resetD,
|
|
382
|
-
quantity: Number(_detail.product_quantity),
|
|
383
|
-
startDate: start_date2,
|
|
384
|
-
start_date: start_date2,
|
|
385
|
-
endDate: end_date,
|
|
386
|
-
end_date,
|
|
387
|
-
// 商品本身的价格
|
|
388
|
-
price: Number(_detail.source_product_price),
|
|
389
|
-
product_name: _detail.product_title,
|
|
390
|
-
discount_reason: _detail.product_discount_reason,
|
|
391
|
-
// resource: resetD.relation_id,
|
|
392
|
-
order_detail_id: _detail.order_detail_id,
|
|
393
|
-
// 总价: 商品本身价格 + 套餐价格 + 单规格价格 包含折扣
|
|
394
|
-
total: Number(_detail.selling_price),
|
|
395
|
-
// 原总价: 商品本身价格 + 套餐价格 + 单规格价格 不包含折扣
|
|
396
|
-
origin_total: Number(_detail.original_price),
|
|
397
|
-
payment_price: Number(_detail.payment_price),
|
|
398
|
-
other: (0, import_utils2.restoreProductOtherData)(d),
|
|
399
|
-
// 是否编辑了套餐 默认为0 如果编辑之后为1
|
|
400
|
-
bundle_edit: 0,
|
|
401
|
-
discount_per: _detail.discount_per,
|
|
402
|
-
discount_type: _detail.discount_type,
|
|
403
|
-
discountway: _detail.discountway,
|
|
404
|
-
capacity: getCapacity(resetD),
|
|
405
|
-
resource: getResource(resetD)
|
|
406
|
-
}
|
|
407
|
-
};
|
|
408
|
-
});
|
|
409
|
-
let disabledEdit = (0, import_utils2.getDisabledEdit)(data);
|
|
410
|
-
let channelDisabledEdit = !!is_other_entrance_edited;
|
|
411
|
-
return {
|
|
412
|
-
...modalState,
|
|
413
|
-
client: {
|
|
414
|
-
...modalState.client,
|
|
415
|
-
value: clientValue,
|
|
416
|
-
edit: false,
|
|
417
|
-
showModal: false
|
|
418
|
-
},
|
|
419
|
-
date: {
|
|
420
|
-
...modalState.date,
|
|
421
|
-
value: dateValue,
|
|
422
|
-
edit: false,
|
|
423
|
-
showModal: false
|
|
424
|
-
},
|
|
425
|
-
pet: {
|
|
426
|
-
...modalState.pet,
|
|
427
|
-
showModal: false,
|
|
428
|
-
edit: false
|
|
429
|
-
},
|
|
430
|
-
service: {
|
|
431
|
-
...modalState.service,
|
|
432
|
-
value: serviceValue,
|
|
433
|
-
addModal: false,
|
|
434
|
-
editModal: false,
|
|
435
|
-
edit: false
|
|
436
|
-
},
|
|
437
|
-
notes: {
|
|
438
|
-
...modalState.notes,
|
|
439
|
-
orderNote: note,
|
|
440
|
-
edit: false
|
|
441
|
-
},
|
|
442
|
-
disabledEdit,
|
|
443
|
-
channelDisabledEdit,
|
|
444
|
-
appointment_status: bookings == null ? void 0 : bookings.appointment_status
|
|
445
|
-
};
|
|
446
|
-
};
|
|
447
567
|
const _initBookingData = (type, data) => {
|
|
448
568
|
var _a2, _b, _c, _d, _e, _f, _g;
|
|
449
569
|
let initState = _getInitState({
|
|
@@ -788,3 +908,7 @@ var TicketBooking = () => {
|
|
|
788
908
|
));
|
|
789
909
|
};
|
|
790
910
|
var ticketBooking_default = TicketBooking;
|
|
911
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
912
|
+
0 && (module.exports = {
|
|
913
|
+
_formatBookingDetail
|
|
914
|
+
});
|