@pisell/private-materials 6.3.177 → 6.3.178
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 +9 -9
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +1 -1
- package/es/businessModel/SalesModel/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Cart/Item/index.js +91 -24
- package/es/components/appointmentBooking/components/ConfirmInformation/index.js +24 -20
- package/es/components/appointmentBooking/components/Header/index.js +4 -24
- package/es/components/appointmentBooking/components/Voucher/index.js +10 -0
- package/es/components/appointmentBooking/hooks.d.ts +1 -17
- package/es/components/appointmentBooking/hooks.js +54 -128
- package/es/components/appointmentBooking/utils.d.ts +1 -0
- package/es/components/appointmentBooking/utils.js +54 -33
- package/es/components/booking/addons/model.d.ts +1 -10
- package/es/components/booking/components/TabProduct/index.d.ts +1 -0
- package/es/components/booking/components/TabProduct/productItem/index.d.ts +1 -0
- package/es/components/booking/deposit/index.d.ts +1 -0
- package/es/components/booking/forms/model.d.ts +1 -10
- package/es/components/booking/forms/single/index.d.ts +1 -0
- package/es/components/booking/info/addServiceVariant/index.d.ts +1 -0
- package/es/components/booking/info/clientVariant/hooks/useClientFn.d.ts +1 -0
- package/es/components/booking/info/date/index.d.ts +1 -0
- package/es/components/booking/info/hooks/useInfoHolder.d.ts +1 -0
- package/es/components/booking/info/index.d.ts +1 -0
- package/es/components/booking/info/model.d.ts +1 -10
- package/es/components/booking/info/notes/index.d.ts +1 -0
- package/es/components/booking/info/service/Lists.d.ts +1 -0
- package/es/components/booking/info/service/actions/index.d.ts +1 -0
- package/es/components/booking/info/service/addService/index.d.ts +1 -0
- package/es/components/booking/info/service/addTimeModal/index.d.ts +1 -0
- package/es/components/booking/info/service/serviceList/index.d.ts +1 -0
- package/es/components/booking/info/service2/Lists.d.ts +1 -0
- package/es/components/booking/info2/service/actions/index.d.ts +1 -0
- package/es/components/booking/info2/service/addTimeModal/index.d.ts +1 -0
- package/es/components/booking/info2/service/contactInfoMode/index.d.ts +1 -0
- package/es/components/booking/info2/service/serviceList/index.d.ts +1 -0
- package/es/components/booking/materiels/holder/index.d.ts +1 -0
- package/es/components/booking/model.d.ts +1 -9
- package/es/components/booking/notes/model.d.ts +1 -10
- package/es/components/booking/payments/model.d.ts +1 -10
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/eftposPay/aggregatePayment/utils/payment.js +1 -2
- package/es/components/eftposPay/amount.d.ts +1 -0
- package/es/components/eftposPay/app.d.ts +1 -0
- package/es/components/eftposPay/component/fail/failCustom.d.ts +1 -0
- package/es/components/eftposPay/device.js +4 -11
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/index.d.ts +1 -0
- package/es/components/eftposPay/linkly/index.d.ts +1 -0
- package/es/components/eftposPay/pay.d.ts +1 -0
- package/es/components/eftposPay/store/index.d.ts +1 -1
- package/es/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Content/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Header/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/SelectHolderModal.d.ts +1 -0
- package/es/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +1 -0
- package/es/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +1 -0
- package/es/components/eventBooking/components/progressBar/index.d.ts +1 -8
- package/es/components/eventBooking/components/progressBar/index.js +10 -30
- package/es/components/eventBooking/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
- package/es/components/pay/toC/model.d.ts +1 -9
- package/es/components/pisellCashCounting/hooks.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/index.d.ts +1 -0
- package/es/components/productExtension/fields/Actor/index.d.ts +1 -0
- package/es/components/productExtension/fields/Forms/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
- package/es/components/productExtension/index.d.ts +1 -0
- package/es/components/ruleSetting/index.d.ts +1 -0
- package/es/components/scanOrder/components/Check/index.js +46 -187
- package/es/components/scanOrder/components/Check/index.less +0 -39
- package/es/components/scanOrder/components/Content/index.js +72 -189
- package/es/components/scanOrder/components/Menu/index.js +5 -11
- package/es/components/scanOrder/hooks.js +0 -7
- package/es/components/scanOrder/locales.d.ts +0 -75
- package/es/components/scanOrder/locales.js +0 -75
- package/es/components/schedules/model.d.ts +1 -9
- package/es/components/shoppingCart/components/Empty/index.d.ts +1 -0
- package/es/components/shoppingCart/components/Render/index.d.ts +1 -0
- package/es/components/shoppingCart/index.d.ts +1 -0
- package/es/components/ticketBooking/components/addServiceVariant/index.d.ts +1 -0
- package/es/components/venueBooking/components/Cart/index.js +159 -46
- package/es/components/venueBooking/components/Voucher/index.js +1 -6
- package/es/components/venueBooking/context.js +15 -2
- package/es/components/venueBooking/locales.d.ts +5 -0
- package/es/components/venueBooking/locales.js +10 -5
- package/es/plus/clinetSearch/Add/PhoneField/index.d.ts +1 -0
- package/es/plus/skuOptionsSelection/components/NormalCard/index.d.ts +1 -0
- package/es/pro/Login2.0/locales.js +1 -1
- package/es/utils/buildCartHolderParams.d.ts +92 -0
- package/es/utils/buildCartHolderParams.js +191 -0
- package/lib/businessModel/SalesModel/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Cart/Item/index.js +71 -9
- package/lib/components/appointmentBooking/components/ConfirmInformation/index.js +6 -2
- package/lib/components/appointmentBooking/components/Header/index.js +1 -13
- package/lib/components/appointmentBooking/components/Voucher/index.js +10 -0
- package/lib/components/appointmentBooking/hooks.d.ts +1 -17
- package/lib/components/appointmentBooking/hooks.js +16 -91
- package/lib/components/appointmentBooking/utils.d.ts +1 -0
- package/lib/components/appointmentBooking/utils.js +24 -13
- package/lib/components/booking/addons/model.d.ts +1 -10
- package/lib/components/booking/components/TabProduct/index.d.ts +1 -0
- package/lib/components/booking/components/TabProduct/productItem/index.d.ts +1 -0
- package/lib/components/booking/deposit/index.d.ts +1 -0
- package/lib/components/booking/forms/model.d.ts +1 -10
- package/lib/components/booking/forms/single/index.d.ts +1 -0
- package/lib/components/booking/info/addServiceVariant/index.d.ts +1 -0
- package/lib/components/booking/info/clientVariant/hooks/useClientFn.d.ts +1 -0
- package/lib/components/booking/info/date/index.d.ts +1 -0
- package/lib/components/booking/info/hooks/useInfoHolder.d.ts +1 -0
- package/lib/components/booking/info/index.d.ts +1 -0
- package/lib/components/booking/info/model.d.ts +1 -10
- package/lib/components/booking/info/notes/index.d.ts +1 -0
- package/lib/components/booking/info/service/Lists.d.ts +1 -0
- package/lib/components/booking/info/service/actions/index.d.ts +1 -0
- package/lib/components/booking/info/service/addService/index.d.ts +1 -0
- package/lib/components/booking/info/service/addTimeModal/index.d.ts +1 -0
- package/lib/components/booking/info/service/serviceList/index.d.ts +1 -0
- package/lib/components/booking/info/service2/Lists.d.ts +1 -0
- package/lib/components/booking/info2/service/actions/index.d.ts +1 -0
- package/lib/components/booking/info2/service/addTimeModal/index.d.ts +1 -0
- package/lib/components/booking/info2/service/contactInfoMode/index.d.ts +1 -0
- package/lib/components/booking/info2/service/serviceList/index.d.ts +1 -0
- package/lib/components/booking/materiels/holder/index.d.ts +1 -0
- package/lib/components/booking/model.d.ts +1 -9
- package/lib/components/booking/notes/model.d.ts +1 -10
- package/lib/components/booking/payments/model.d.ts +1 -10
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/eftposPay/aggregatePayment/utils/payment.js +1 -2
- package/lib/components/eftposPay/amount.d.ts +1 -0
- package/lib/components/eftposPay/app.d.ts +1 -0
- package/lib/components/eftposPay/component/fail/failCustom.d.ts +1 -0
- package/lib/components/eftposPay/device.js +4 -6
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/index.d.ts +1 -0
- package/lib/components/eftposPay/linkly/index.d.ts +1 -0
- package/lib/components/eftposPay/pay.d.ts +1 -0
- package/lib/components/eftposPay/store/index.d.ts +1 -1
- package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Content/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Header/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/SelectHolderModal.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +1 -0
- package/lib/components/eventBooking/components/progressBar/index.d.ts +1 -8
- package/lib/components/eventBooking/components/progressBar/index.js +9 -29
- package/lib/components/eventBooking/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
- package/lib/components/pay/toC/model.d.ts +1 -9
- package/lib/components/pisellCashCounting/hooks.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/index.d.ts +1 -0
- package/lib/components/productExtension/fields/Actor/index.d.ts +1 -0
- package/lib/components/productExtension/fields/Forms/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
- package/lib/components/productExtension/index.d.ts +1 -0
- package/lib/components/ruleSetting/index.d.ts +1 -0
- package/lib/components/scanOrder/components/Check/index.js +3 -116
- package/lib/components/scanOrder/components/Check/index.less +0 -39
- package/lib/components/scanOrder/components/Content/index.js +25 -106
- package/lib/components/scanOrder/components/Menu/index.js +0 -2
- package/lib/components/scanOrder/hooks.js +0 -7
- package/lib/components/scanOrder/locales.d.ts +0 -75
- package/lib/components/scanOrder/locales.js +0 -75
- package/lib/components/schedules/model.d.ts +1 -9
- package/lib/components/shoppingCart/components/Empty/index.d.ts +1 -0
- package/lib/components/shoppingCart/components/Render/index.d.ts +1 -0
- package/lib/components/shoppingCart/index.d.ts +1 -0
- package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +1 -0
- package/lib/components/venueBooking/components/Cart/index.js +92 -14
- package/lib/components/venueBooking/components/Voucher/index.js +1 -5
- package/lib/components/venueBooking/context.js +12 -2
- package/lib/components/venueBooking/locales.d.ts +5 -0
- package/lib/components/venueBooking/locales.js +10 -5
- package/lib/plus/clinetSearch/Add/PhoneField/index.d.ts +1 -0
- package/lib/plus/skuOptionsSelection/components/NormalCard/index.d.ts +1 -0
- package/lib/pro/Login2.0/locales.js +1 -1
- package/lib/utils/buildCartHolderParams.d.ts +92 -0
- package/lib/utils/buildCartHolderParams.js +167 -0
- package/package.json +1 -1
|
@@ -38,7 +38,7 @@ var import_Sales = require("../../../Sales");
|
|
|
38
38
|
var import_utils = require("@pisell/utils");
|
|
39
39
|
var import_index = require("./index.less");
|
|
40
40
|
var import_useEngineContext = __toESM(require("../../../../hooks/useEngineContext"));
|
|
41
|
-
var ProgressBar = (
|
|
41
|
+
var ProgressBar = ({
|
|
42
42
|
title,
|
|
43
43
|
description,
|
|
44
44
|
showClose = true,
|
|
@@ -47,32 +47,20 @@ var ProgressBar = (0, import_react.forwardRef)(({
|
|
|
47
47
|
showBack = true,
|
|
48
48
|
style,
|
|
49
49
|
onBack,
|
|
50
|
-
onClose
|
|
51
|
-
|
|
52
|
-
}, ref) => {
|
|
50
|
+
onClose
|
|
51
|
+
}) => {
|
|
53
52
|
var _a;
|
|
54
53
|
const [open, setOpen] = (0, import_react.useState)(false);
|
|
55
|
-
const closeFromExternalRef = (0, import_react.useRef)(false);
|
|
56
54
|
const { removeSessionStorage } = (0, import_Sales.useSales)();
|
|
57
55
|
const context = (0, import_useEngineContext.default)();
|
|
58
56
|
const { interaction } = ((_a = context.appHelper) == null ? void 0 : _a.utils) || {};
|
|
59
|
-
const handleClose = (
|
|
57
|
+
const handleClose = () => {
|
|
60
58
|
if (isConfirmClose) {
|
|
61
59
|
setOpen(true);
|
|
62
|
-
|
|
60
|
+
} else {
|
|
61
|
+
onClose == null ? void 0 : onClose();
|
|
63
62
|
}
|
|
64
|
-
|
|
65
|
-
}, [isConfirmClose, onClose]);
|
|
66
|
-
(0, import_react.useImperativeHandle)(
|
|
67
|
-
ref,
|
|
68
|
-
() => ({
|
|
69
|
-
triggerClose: () => {
|
|
70
|
-
closeFromExternalRef.current = true;
|
|
71
|
-
handleClose();
|
|
72
|
-
}
|
|
73
|
-
}),
|
|
74
|
-
[handleClose]
|
|
75
|
-
);
|
|
63
|
+
};
|
|
76
64
|
const handleOk = () => {
|
|
77
65
|
var _a2, _b;
|
|
78
66
|
if ((_b = (_a2 = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _a2.isAppEnv) == null ? void 0 : _b.call(_a2)) {
|
|
@@ -116,10 +104,7 @@ var ProgressBar = (0, import_react.forwardRef)(({
|
|
|
116
104
|
title: description,
|
|
117
105
|
showClose,
|
|
118
106
|
onBack,
|
|
119
|
-
onClose:
|
|
120
|
-
closeFromExternalRef.current = false;
|
|
121
|
-
handleClose();
|
|
122
|
-
},
|
|
107
|
+
onClose: handleClose,
|
|
123
108
|
enableBorder: true,
|
|
124
109
|
borderColor: "#EAECF0",
|
|
125
110
|
showBack
|
|
@@ -140,14 +125,9 @@ var ProgressBar = (0, import_react.forwardRef)(({
|
|
|
140
125
|
},
|
|
141
126
|
onCancel: () => {
|
|
142
127
|
setOpen(false);
|
|
143
|
-
if (closeFromExternalRef.current) {
|
|
144
|
-
onConfirmCancel == null ? void 0 : onConfirmCancel();
|
|
145
|
-
}
|
|
146
|
-
closeFromExternalRef.current = false;
|
|
147
128
|
},
|
|
148
129
|
onOk: () => handleOk()
|
|
149
130
|
}
|
|
150
131
|
));
|
|
151
|
-
}
|
|
152
|
-
ProgressBar.displayName = "ProgressBar";
|
|
132
|
+
};
|
|
153
133
|
var progressBar_default = ProgressBar;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export interface FormState {
|
|
3
2
|
platform: 'pc' | 'h5' | '' | undefined;
|
|
4
3
|
order: any;
|
|
@@ -30,11 +29,4 @@ export interface PayGroup {
|
|
|
30
29
|
_order: any;
|
|
31
30
|
front_order_uuid?: string;
|
|
32
31
|
}
|
|
33
|
-
export declare const Provider:
|
|
34
|
-
state: FormState;
|
|
35
|
-
} & {
|
|
36
|
-
dispatch: (params: {
|
|
37
|
-
type: string;
|
|
38
|
-
payload: any;
|
|
39
|
-
}) => void;
|
|
40
|
-
}>;
|
|
32
|
+
export declare const Provider: any, Context: any;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { CashCountingConfirmPayload, PisellCashCountingProps } from './types';
|
|
2
3
|
import type { PisellCashCountingModalRef } from './components/CashCountingModal/index';
|
|
3
4
|
export declare function usePisellCashCounting({ value, defaultValue, currencyCode, currencySymbol, amountPrecision, denominations, disabled, countDisabled, onChange, onCountConfirm, onCountCancel, }: PisellCashCountingProps): {
|
|
@@ -43,12 +43,11 @@ var import_context = require("../../context");
|
|
|
43
43
|
var import_hooks = require("../../hooks");
|
|
44
44
|
var import_index = require("./index.less");
|
|
45
45
|
function Check() {
|
|
46
|
-
const { viewModel, runModuleAction, refreshViewModel, tableName, entryMode, clearStepCache
|
|
46
|
+
const { viewModel, runModuleAction, refreshViewModel, tableName, entryMode, clearStepCache } = (0, import_context.useScanOrderContext)();
|
|
47
47
|
const isAdditionalOrder = entryMode === "additional_order";
|
|
48
48
|
const [submitting, setSubmitting] = (0, import_react.useState)(false);
|
|
49
49
|
const [note, setNote] = (0, import_react.useState)((viewModel == null ? void 0 : viewModel.note) || "");
|
|
50
50
|
const [pickupRefOpen, setPickupRefOpen] = (0, import_react.useState)(false);
|
|
51
|
-
const [addOnConfirmOpen, setAddOnConfirmOpen] = (0, import_react.useState)(false);
|
|
52
51
|
const utils = (0, import_hooks.contextUtils)();
|
|
53
52
|
const [dineInConfig, setDineInConfig] = (0, import_react.useState)(null);
|
|
54
53
|
const [channel, setChannel] = (0, import_react.useState)("");
|
|
@@ -85,30 +84,6 @@ function Check() {
|
|
|
85
84
|
() => String(import_utils.locales.getText("pisell2.scan.order.products.title") || "Products"),
|
|
86
85
|
[]
|
|
87
86
|
);
|
|
88
|
-
const addOnConfirmTitle = (0, import_react.useMemo)(
|
|
89
|
-
() => String(
|
|
90
|
-
import_utils.locales.getText("pisell2.scan.order.add.on.confirm.title") || "This table has already started ordering"
|
|
91
|
-
),
|
|
92
|
-
[]
|
|
93
|
-
);
|
|
94
|
-
const addOnConfirmDescription = (0, import_react.useMemo)(
|
|
95
|
-
() => String(
|
|
96
|
-
import_utils.locales.getText("pisell2.scan.order.add.on.confirm.description") || "Someone at your table has placed the order. This will be submitted as an add-on order."
|
|
97
|
-
),
|
|
98
|
-
[]
|
|
99
|
-
);
|
|
100
|
-
const addOnConfirmButtonText = (0, import_react.useMemo)(
|
|
101
|
-
() => String(
|
|
102
|
-
import_utils.locales.getText("pisell2.scan.order.add.on.confirm.button") || "Confirm Add-on Order"
|
|
103
|
-
),
|
|
104
|
-
[]
|
|
105
|
-
);
|
|
106
|
-
const addOnReturnButtonText = (0, import_react.useMemo)(
|
|
107
|
-
() => String(
|
|
108
|
-
import_utils.locales.getText("pisell2.scan.order.add.on.return.button") || "Return to Cart"
|
|
109
|
-
),
|
|
110
|
-
[]
|
|
111
|
-
);
|
|
112
87
|
const showCheckStepEmptyCartTip = () => {
|
|
113
88
|
import_antd.message.error(import_utils.locales.getText("pisell2.scan.order.check.cart.empty.tip") || "Please go back to add products");
|
|
114
89
|
};
|
|
@@ -116,28 +91,6 @@ function Check() {
|
|
|
116
91
|
const content = String(tip || import_utils.locales.getText("pisell2.scan.order.submit.failed") || "Submit order failed");
|
|
117
92
|
(0, import_materials.PisellToast)({ content });
|
|
118
93
|
}, []);
|
|
119
|
-
const showInventoryInsufficientModal = (0, import_react.useCallback)((error) => {
|
|
120
|
-
var _a;
|
|
121
|
-
setSubmitting(false);
|
|
122
|
-
const unavailableProducts = Array.isArray((_a = error == null ? void 0 : error.data) == null ? void 0 : _a.unavailable_products) ? error.data.unavailable_products : [];
|
|
123
|
-
const productNames = unavailableProducts.map((product) => String((product == null ? void 0 : product.title) || (product == null ? void 0 : product.product_id) || "").trim()).filter(Boolean);
|
|
124
|
-
const title = String(
|
|
125
|
-
import_utils.locales.getText("pisell2.scan.order.inventory.insufficient.title") || "Insufficient inventory"
|
|
126
|
-
);
|
|
127
|
-
const description = String(
|
|
128
|
-
import_utils.locales.getText("pisell2.scan.order.inventory.insufficient.description") || "The following items are out of stock or do not have enough inventory. Please adjust your cart and try again."
|
|
129
|
-
);
|
|
130
|
-
const productsLabel = String(
|
|
131
|
-
import_utils.locales.getText("pisell2.scan.order.inventory.insufficient.products.label") || "Unavailable products:"
|
|
132
|
-
);
|
|
133
|
-
const fallbackMessage = String((error == null ? void 0 : error.message) || description);
|
|
134
|
-
import_antd.Modal.info({
|
|
135
|
-
title,
|
|
136
|
-
content: /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement("div", null, description), /* @__PURE__ */ import_react.default.createElement("div", null, productsLabel), productNames.length > 0 ? /* @__PURE__ */ import_react.default.createElement("ul", null, productNames.map((name, index) => /* @__PURE__ */ import_react.default.createElement("li", { key: `${name}-${index}` }, name))) : /* @__PURE__ */ import_react.default.createElement("div", null, fallbackMessage)),
|
|
137
|
-
okText: String(import_utils.locales.getText("pisell2.event.confirm") || "OK"),
|
|
138
|
-
maskClosable: false
|
|
139
|
-
});
|
|
140
|
-
}, []);
|
|
141
94
|
const doSubmit = async () => {
|
|
142
95
|
var _a, _b, _c, _d, _e;
|
|
143
96
|
const items = (viewModel == null ? void 0 : viewModel.cartItems) || [];
|
|
@@ -152,10 +105,6 @@ function Check() {
|
|
|
152
105
|
const res = await runModuleAction("submitScanOrder");
|
|
153
106
|
console.log("submitScanOrder >>>>> ", res);
|
|
154
107
|
if ((res == null ? void 0 : res.status) === false) {
|
|
155
|
-
if ((res == null ? void 0 : res.code) === 6008) {
|
|
156
|
-
showInventoryInsufficientModal(res);
|
|
157
|
-
return;
|
|
158
|
-
}
|
|
159
108
|
setSubmitting(false);
|
|
160
109
|
showSubmitFailedTip(res == null ? void 0 : res.message);
|
|
161
110
|
return;
|
|
@@ -169,8 +118,7 @@ function Check() {
|
|
|
169
118
|
clearStepCache();
|
|
170
119
|
const channelMap = {
|
|
171
120
|
"scan_to_order": "table-order",
|
|
172
|
-
"scan_to_order_2": "mobile_order"
|
|
173
|
-
"scan_to_order_3": "scantoorder3"
|
|
121
|
+
"scan_to_order_2": "mobile_order"
|
|
174
122
|
};
|
|
175
123
|
const saleChannel = channelMap[channel] || channel;
|
|
176
124
|
if (shouldPayOnSubmit) {
|
|
@@ -213,28 +161,7 @@ function Check() {
|
|
|
213
161
|
await refreshViewModel();
|
|
214
162
|
} catch (error) {
|
|
215
163
|
console.error("[scanOrder] submitScanOrder failed", error);
|
|
216
|
-
|
|
217
|
-
setSubmitting(false);
|
|
218
|
-
showSubmitFailedTip(
|
|
219
|
-
String(import_utils.locales.getText("pisell2.scan.order.settled.cannot.add.tip") || "")
|
|
220
|
-
);
|
|
221
|
-
} else if ((error == null ? void 0 : error.code) === 670007 && (entryContext == null ? void 0 : entryContext.resource_id)) {
|
|
222
|
-
const reservationResourceSelectType = await runModuleAction("getReservationResourceSelectType");
|
|
223
|
-
const allowAddItems = await runModuleAction("checkAllowAddItems");
|
|
224
|
-
const res = await runModuleAction("syncAdditionalOrderFromResource", entryContext == null ? void 0 : entryContext.resource_id);
|
|
225
|
-
if (reservationResourceSelectType.resourceSelectType === "single" && (allowAddItems == null ? void 0 : allowAddItems.enabled) && (res == null ? void 0 : res.matched)) {
|
|
226
|
-
setSubmitting(false);
|
|
227
|
-
setAddOnConfirmOpen(true);
|
|
228
|
-
} else {
|
|
229
|
-
setSubmitting(false);
|
|
230
|
-
showSubmitFailedTip(error == null ? void 0 : error.message);
|
|
231
|
-
}
|
|
232
|
-
} else if ((error == null ? void 0 : error.code) === 6008) {
|
|
233
|
-
showInventoryInsufficientModal(error);
|
|
234
|
-
} else {
|
|
235
|
-
setSubmitting(false);
|
|
236
|
-
showSubmitFailedTip(error == null ? void 0 : error.message);
|
|
237
|
-
}
|
|
164
|
+
showSubmitFailedTip(error == null ? void 0 : error.message);
|
|
238
165
|
} finally {
|
|
239
166
|
}
|
|
240
167
|
};
|
|
@@ -282,15 +209,6 @@ function Check() {
|
|
|
282
209
|
if (submitting) return;
|
|
283
210
|
setPickupRefOpen(false);
|
|
284
211
|
};
|
|
285
|
-
const handleAddOnConfirm = async () => {
|
|
286
|
-
if (submitting) return;
|
|
287
|
-
setAddOnConfirmOpen(false);
|
|
288
|
-
await doSubmit();
|
|
289
|
-
};
|
|
290
|
-
const handleAddOnReturn = () => {
|
|
291
|
-
if (submitting) return;
|
|
292
|
-
setAddOnConfirmOpen(false);
|
|
293
|
-
};
|
|
294
212
|
const noteContent = /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-scan-order-check-note" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-scan-order-check-note-title" }, noteTitle), /* @__PURE__ */ import_react.default.createElement(
|
|
295
213
|
import_antd.Input.TextArea,
|
|
296
214
|
{
|
|
@@ -325,36 +243,5 @@ function Check() {
|
|
|
325
243
|
onCancel: handlePickupRefCancel,
|
|
326
244
|
onConfirm: handlePickupRefConfirm
|
|
327
245
|
}
|
|
328
|
-
), /* @__PURE__ */ import_react.default.createElement(
|
|
329
|
-
import_antd.Modal,
|
|
330
|
-
{
|
|
331
|
-
open: addOnConfirmOpen,
|
|
332
|
-
footer: null,
|
|
333
|
-
onCancel: handleAddOnReturn,
|
|
334
|
-
maskClosable: false,
|
|
335
|
-
destroyOnClose: true,
|
|
336
|
-
centered: true,
|
|
337
|
-
className: "pisell-scan-order-add-on-confirm-modal"
|
|
338
|
-
},
|
|
339
|
-
/* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-scan-order-add-on-confirm-body" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-scan-order-add-on-confirm-title" }, addOnConfirmTitle), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-scan-order-add-on-confirm-desc" }, addOnConfirmDescription), /* @__PURE__ */ import_react.default.createElement(
|
|
340
|
-
import_materials.Button,
|
|
341
|
-
{
|
|
342
|
-
type: "primary",
|
|
343
|
-
block: true,
|
|
344
|
-
size: "large",
|
|
345
|
-
loading: submitting,
|
|
346
|
-
onClick: handleAddOnConfirm
|
|
347
|
-
},
|
|
348
|
-
addOnConfirmButtonText
|
|
349
|
-
), /* @__PURE__ */ import_react.default.createElement(
|
|
350
|
-
import_materials.Button,
|
|
351
|
-
{
|
|
352
|
-
block: true,
|
|
353
|
-
size: "large",
|
|
354
|
-
disabled: submitting,
|
|
355
|
-
onClick: handleAddOnReturn
|
|
356
|
-
},
|
|
357
|
-
addOnReturnButtonText
|
|
358
|
-
))
|
|
359
246
|
), submitting ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-scan-order-check-loading-mask" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-scan-order-check-loading-panel" }, /* @__PURE__ */ import_react.default.createElement(import_materials.PisellLoading, { loading: true, mask: { backgroundColor: "transparent", width: 64, height: 64 } }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-scan-order-check-loading-placeholder" })))) : null);
|
|
360
247
|
}
|
|
@@ -80,42 +80,3 @@
|
|
|
80
80
|
width: 64px;
|
|
81
81
|
height: 64px;
|
|
82
82
|
}
|
|
83
|
-
|
|
84
|
-
.pisell-scan-order-add-on-confirm-modal {
|
|
85
|
-
.pisell-lowcode-modal-content {
|
|
86
|
-
border-radius: 28px;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
.pisell-lowcode-modal-body {
|
|
90
|
-
padding: 42px 32px 32px;
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
.pisell-scan-order-add-on-confirm-body {
|
|
95
|
-
display: flex;
|
|
96
|
-
flex-direction: column;
|
|
97
|
-
gap: 16px;
|
|
98
|
-
text-align: center;
|
|
99
|
-
|
|
100
|
-
.pisell-lowcode-btn {
|
|
101
|
-
height: 56px;
|
|
102
|
-
border-radius: 18px;
|
|
103
|
-
font-size: 18px;
|
|
104
|
-
font-weight: 700;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
.pisell-scan-order-add-on-confirm-title {
|
|
109
|
-
color: #1f2937;
|
|
110
|
-
font-size: 28px;
|
|
111
|
-
font-weight: 800;
|
|
112
|
-
line-height: 1.25;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
.pisell-scan-order-add-on-confirm-desc {
|
|
116
|
-
margin-bottom: 18px;
|
|
117
|
-
color: #667085;
|
|
118
|
-
font-size: 20px;
|
|
119
|
-
font-weight: 400;
|
|
120
|
-
line-height: 1.35;
|
|
121
|
-
}
|
|
@@ -95,7 +95,7 @@ function ReadyState() {
|
|
|
95
95
|
resumeStep,
|
|
96
96
|
consumeResumeStep
|
|
97
97
|
} = (0, import_context.useScanOrderContext)();
|
|
98
|
-
const { openLoginModal } = (0, import_hooks.useScanOrderLogin)();
|
|
98
|
+
const { isLogin, openLoginModal } = (0, import_hooks.useScanOrderLogin)();
|
|
99
99
|
const utils = (0, import_hooks.contextUtils)();
|
|
100
100
|
const [FormCard] = (0, import_useComponents.default)({
|
|
101
101
|
components: ["FormCard"]
|
|
@@ -154,7 +154,6 @@ function ReadyState() {
|
|
|
154
154
|
const requestPaxMinRef = (0, import_react.useRef)(1);
|
|
155
155
|
const requestPaxMaxRef = (0, import_react.useRef)(1);
|
|
156
156
|
const tableFormRecordRef = (0, import_react.useRef)(null);
|
|
157
|
-
const entryLoginPromptedRef = (0, import_react.useRef)(false);
|
|
158
157
|
const entryPaxModalWasPresentedRef = (0, import_react.useRef)(false);
|
|
159
158
|
const getLocalizedName = (nameMap) => {
|
|
160
159
|
if (!nameMap) return "";
|
|
@@ -187,10 +186,6 @@ function ReadyState() {
|
|
|
187
186
|
};
|
|
188
187
|
};
|
|
189
188
|
const app = (_a = utils == null ? void 0 : utils.getApp) == null ? void 0 : _a.call(utils);
|
|
190
|
-
const getCurrentIsLogin = () => {
|
|
191
|
-
var _a2, _b2;
|
|
192
|
-
return Boolean((_b2 = (_a2 = utils == null ? void 0 : utils.token) == null ? void 0 : _a2.get) == null ? void 0 : _b2.call(_a2));
|
|
193
|
-
};
|
|
194
189
|
const navigateToHome = () => {
|
|
195
190
|
var _a2, _b2;
|
|
196
191
|
if ((_a2 = app == null ? void 0 : app.history) == null ? void 0 : _a2.replace) {
|
|
@@ -354,7 +349,8 @@ function ReadyState() {
|
|
|
354
349
|
return (_b2 = (_a2 = utils == null ? void 0 : utils.request) == null ? void 0 : _a2.get) == null ? void 0 : _b2.call(_a2, `/h5/shop-policy/${id}`, {});
|
|
355
350
|
};
|
|
356
351
|
(0, import_react.useEffect)(() => {
|
|
357
|
-
const
|
|
352
|
+
const checkResourceAvailable = async () => {
|
|
353
|
+
var _a2;
|
|
358
354
|
const hasOrderId = !!(entryContext == null ? void 0 : entryContext.order_id);
|
|
359
355
|
const {
|
|
360
356
|
mode,
|
|
@@ -396,116 +392,39 @@ function ReadyState() {
|
|
|
396
392
|
}
|
|
397
393
|
await runEntryPaxGateThenEnterProduct();
|
|
398
394
|
} else if (isAdditionalOrder) {
|
|
399
|
-
|
|
400
|
-
if (!getCurrentIsLogin()) {
|
|
401
|
-
const openLoginForOrderDetail = () => {
|
|
402
|
-
var _a2;
|
|
403
|
-
(_a2 = scanOrderModule == null ? void 0 : scanOrderModule.setUIState) == null ? void 0 : _a2.call(scanOrderModule, "pendingStep", currentStep);
|
|
404
|
-
openLoginModal({
|
|
405
|
-
callback: async (status) => {
|
|
406
|
-
if (status === "success") {
|
|
407
|
-
if (!(entryContext == null ? void 0 : entryContext.order_id) || !allowAddItems.enabled) {
|
|
408
|
-
handleOrderDetail(order_id);
|
|
409
|
-
return;
|
|
410
|
-
}
|
|
411
|
-
await runModuleAction("restorePreviousOrderData");
|
|
412
|
-
await enterProductStep();
|
|
413
|
-
return;
|
|
414
|
-
}
|
|
415
|
-
console.log("status>>>>>>>", status);
|
|
416
|
-
const loginRequiredModal = import_antd.Modal.info({
|
|
417
|
-
title: import_utils.locales.getText(
|
|
418
|
-
"pisell2.scan.order.add.on.login.required.title"
|
|
419
|
-
),
|
|
420
|
-
content: String(
|
|
421
|
-
import_utils.locales.getText(
|
|
422
|
-
"pisell2.scan.order.add.on.login.required"
|
|
423
|
-
) || ""
|
|
424
|
-
).trim(),
|
|
425
|
-
okText: String(import_utils.locales.getText("pisell2.event.confirm") || "OK"),
|
|
426
|
-
maskClosable: false,
|
|
427
|
-
onOk: () => {
|
|
428
|
-
loginRequiredModal.destroy();
|
|
429
|
-
openLoginForOrderDetail();
|
|
430
|
-
}
|
|
431
|
-
});
|
|
432
|
-
}
|
|
433
|
-
});
|
|
434
|
-
};
|
|
435
|
-
openLoginForOrderDetail();
|
|
436
|
-
return;
|
|
437
|
-
} else {
|
|
438
|
-
if (!(entryContext == null ? void 0 : entryContext.order_id) || !allowAddItems.enabled) {
|
|
439
|
-
handleOrderDetail(order_id);
|
|
440
|
-
return;
|
|
441
|
-
}
|
|
442
|
-
await runModuleAction("restorePreviousOrderData");
|
|
443
|
-
await enterProductStep();
|
|
444
|
-
}
|
|
395
|
+
await enterProductStep();
|
|
445
396
|
} else if (mode === "submit_disabled") {
|
|
446
397
|
const tips = resolveLocalizedText(errorTips) || String(import_utils.locales.getText("pisell2.scan.order.submit.disabled.default") || "");
|
|
447
398
|
setSubmitDisabledTips(tips);
|
|
448
399
|
await enterProductStep();
|
|
449
|
-
} else if (mode === "multiple_orders") {
|
|
450
|
-
import_antd.Modal.info({
|
|
451
|
-
title: import_utils.locales.getText("pisell2.scan.order.step.error"),
|
|
452
|
-
content: String(
|
|
453
|
-
import_utils.locales.getText("pisell2.scan.order.multiple.orders.tip") || ""
|
|
454
|
-
).trim(),
|
|
455
|
-
okText: String(
|
|
456
|
-
import_utils.locales.getText("pisell2.scan.order.multiple.orders.confirm") || "I Got It"
|
|
457
|
-
),
|
|
458
|
-
maskClosable: false,
|
|
459
|
-
onOk: () => {
|
|
460
|
-
navigateToHome();
|
|
461
|
-
}
|
|
462
|
-
});
|
|
463
400
|
} else if (mode === "resource_busy") {
|
|
464
401
|
if (Number(order_id) !== 0) {
|
|
465
|
-
if (!
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
handleOrderDetail(order_id);
|
|
475
|
-
return;
|
|
476
|
-
}
|
|
477
|
-
import_antd.Modal.info({
|
|
478
|
-
title: import_utils.locales.getText(
|
|
479
|
-
"pisell2.scan.order.add.on.login.required.title"
|
|
480
|
-
),
|
|
481
|
-
content: String(
|
|
482
|
-
import_utils.locales.getText(
|
|
483
|
-
"pisell2.scan.order.add.on.login.required"
|
|
484
|
-
) || ""
|
|
485
|
-
).trim(),
|
|
486
|
-
okText: String(import_utils.locales.getText("pisell2.event.confirm") || "OK"),
|
|
487
|
-
maskClosable: false,
|
|
488
|
-
onOk: () => {
|
|
489
|
-
openLoginForOrderDetail();
|
|
490
|
-
}
|
|
491
|
-
});
|
|
402
|
+
if (!isLogin) {
|
|
403
|
+
(_a2 = scanOrderModule == null ? void 0 : scanOrderModule.setUIState) == null ? void 0 : _a2.call(scanOrderModule, "pendingStep", currentStep);
|
|
404
|
+
openLoginModal({
|
|
405
|
+
callback: (status) => {
|
|
406
|
+
var _a3, _b2;
|
|
407
|
+
if (status === "success") {
|
|
408
|
+
(_a3 = scanOrderModule == null ? void 0 : scanOrderModule.deleteUIState) == null ? void 0 : _a3.call(scanOrderModule, "pendingStep");
|
|
409
|
+
handleOrderDetail(order_id);
|
|
410
|
+
return;
|
|
492
411
|
}
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
412
|
+
(_b2 = scanOrderModule == null ? void 0 : scanOrderModule.deleteUIState) == null ? void 0 : _b2.call(scanOrderModule, "pendingStep");
|
|
413
|
+
location.replace("/");
|
|
414
|
+
}
|
|
415
|
+
});
|
|
496
416
|
} else {
|
|
497
417
|
handleOrderDetail(order_id);
|
|
498
418
|
}
|
|
499
419
|
} else {
|
|
500
|
-
|
|
501
|
-
|
|
420
|
+
let content = resolveLocalizedText(errorTips);
|
|
421
|
+
content = String(
|
|
422
|
+
import_utils.locales.getText("pisell2.scan.order.resource.status.exception") || ""
|
|
502
423
|
);
|
|
503
424
|
import_antd.Modal.info({
|
|
504
|
-
title: import_utils.locales.getText("pisell2.scan.order.
|
|
505
|
-
content:
|
|
506
|
-
okText: String(
|
|
507
|
-
import_utils.locales.getText("pisell2.scan.order.add.on.unavailable.confirm") || "Got it"
|
|
508
|
-
),
|
|
425
|
+
title: import_utils.locales.getText("pisell2.scan.order.step.error"),
|
|
426
|
+
content: content.trim(),
|
|
427
|
+
okText: String(import_utils.locales.getText("pisell2.event.confirm") || "OK"),
|
|
509
428
|
maskClosable: false,
|
|
510
429
|
onOk: () => {
|
|
511
430
|
location.replace("/");
|
|
@@ -537,7 +456,7 @@ function ReadyState() {
|
|
|
537
456
|
}
|
|
538
457
|
};
|
|
539
458
|
if (!isCacheHydrated) return;
|
|
540
|
-
|
|
459
|
+
checkResourceAvailable();
|
|
541
460
|
}, [isCacheHydrated]);
|
|
542
461
|
(0, import_react.useEffect)(() => {
|
|
543
462
|
window.scrollTo({
|
|
@@ -643,7 +562,7 @@ function ReadyState() {
|
|
|
643
562
|
});
|
|
644
563
|
return;
|
|
645
564
|
}
|
|
646
|
-
if (!
|
|
565
|
+
if (!isLogin) {
|
|
647
566
|
(_a2 = scanOrderModule == null ? void 0 : scanOrderModule.setUIState) == null ? void 0 : _a2.call(scanOrderModule, "pendingStep", "check");
|
|
648
567
|
openLoginModal({
|
|
649
568
|
callback: (status) => {
|
|
@@ -191,9 +191,7 @@ function Menu(props) {
|
|
|
191
191
|
setting: { can_input: true, item_max_length: 1, is_detail_open: false }
|
|
192
192
|
},
|
|
193
193
|
callback: async (data) => {
|
|
194
|
-
var _a2, _b, _c;
|
|
195
194
|
if (data == null ? void 0 : data.isCancel) return;
|
|
196
|
-
if (((_a2 = data == null ? void 0 : data.origin) == null ? void 0 : _a2.is_track) && !((_b = data == null ? void 0 : data.origin) == null ? void 0 : _b.over_sold) && ((_c = data == null ? void 0 : data.origin) == null ? void 0 : _c.stock_quantity) <= 0) return;
|
|
197
195
|
const orderProduct = (0, import_transformProductDetail.transformProductDetailToOrderProduct)({
|
|
198
196
|
payload: data,
|
|
199
197
|
fallbackProductId: (item == null ? void 0 : item.product_id) ?? (item == null ? void 0 : item.id),
|
|
@@ -101,13 +101,6 @@ var useScanOrderLogin = () => {
|
|
|
101
101
|
const isLogin = !!((_b = (_a = utils == null ? void 0 : utils.token) == null ? void 0 : _a.get) == null ? void 0 : _b.call(_a));
|
|
102
102
|
const openLoginModal = (params) => {
|
|
103
103
|
const { callback } = params || {};
|
|
104
|
-
const { pubsub } = utils;
|
|
105
|
-
pubsub.once("pisell1.login.success", (res) => {
|
|
106
|
-
if (res === "success") {
|
|
107
|
-
callback(res);
|
|
108
|
-
}
|
|
109
|
-
callback("close");
|
|
110
|
-
});
|
|
111
104
|
utils.action({
|
|
112
105
|
type: "pisell1.login",
|
|
113
106
|
data: {
|