@pisell/private-materials 6.3.177 → 6.3.179
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 +90 -24
- package/es/components/appointmentBooking/components/ConfirmInformation/index.js +24 -20
- package/es/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +1 -0
- 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 +55 -128
- package/es/components/appointmentBooking/utils.d.ts +1 -0
- package/es/components/appointmentBooking/utils.js +54 -33
- package/es/components/booking/components/TabProduct/index.d.ts +1 -0
- package/es/components/booking/components/formItemChildrenWrap/index.d.ts +1 -0
- package/es/components/booking/forms/table/index.d.ts +1 -0
- package/es/components/booking/info/addServiceVariant/index.d.ts +1 -0
- package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
- package/es/components/booking/info/index.d.ts +1 -0
- package/es/components/booking/info/service/like/index.d.ts +1 -0
- package/es/components/ecocup/components/MoreDropdown/index.d.ts +1 -0
- package/es/components/ecocup/cupList/hooks/useColumns.d.ts +1 -0
- package/es/components/ecocup/cupList/hooks/useSummary.d.ts +1 -0
- package/es/components/eftpos/SettlementModal/Action.d.ts +1 -0
- package/es/components/eftpos/SettlementModal/index.d.ts +1 -0
- package/es/components/eftpos/deviceList/index.d.ts +1 -0
- package/es/components/eftpos/form/index.d.ts +1 -0
- package/es/components/eftpos/group/index.d.ts +1 -0
- package/es/components/eftpos/hooks.d.ts +1 -0
- package/es/components/eftpos/icon/apiKey.d.ts +1 -0
- package/es/components/eftpos/icon/device.d.ts +1 -0
- package/es/components/eftpos/receipt/index.d.ts +1 -0
- package/es/components/eftpos/surcharge/index.d.ts +1 -0
- package/es/components/eftposPay/aggregatePayment/utils/payment.js +1 -2
- package/es/components/eftposPay/app.d.ts +1 -0
- package/es/components/eftposPay/component/alert/warn.d.ts +1 -0
- package/es/components/eftposPay/component/header/titlebar.d.ts +1 -0
- package/es/components/eftposPay/component/step/index.d.ts +1 -0
- package/es/components/eftposPay/component/step/step.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/mx51/Action.d.ts +1 -0
- package/es/components/eftposPay/store/index.d.ts +1 -1
- package/es/components/eftposPay/tyro/hooks.d.ts +1 -0
- package/es/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.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/components/scheduleCalendar/calendarItem.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
- package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/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/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/calendar/calendarItem.d.ts +1 -0
- package/es/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +1 -0
- package/es/components/schedules/resources/relationProduct/index.d.ts +1 -0
- package/es/components/shoppingCart/components/Cart/Product.d.ts +1 -0
- 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/systemSettings/registry/components/DataSourceTreeSelect/index.d.ts +1 -0
- package/es/components/ticketBooking/components/addServiceVariant/index.d.ts +1 -0
- package/es/components/venueBooking/components/Cart/index.js +165 -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/components/workSpaceList/components/Modal/index.d.ts +1 -0
- package/es/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +1 -0
- package/es/plus/clientName/index.d.ts +1 -0
- package/es/plus/clinetSearch/Add/PhoneField/index.d.ts +1 -0
- package/es/plus/orderList/components/HandleActions.d.ts +1 -0
- package/es/plus/orderList/components/QuickFilter.d.ts +1 -0
- package/es/plus/orderList/components/Reset.d.ts +1 -0
- package/es/plus/orderList/components/Toolbar.d.ts +1 -0
- package/es/plus/pisellReservation/hooks/useReservationScheduleDebounced.d.ts +1 -0
- package/es/plus/selectHolder/components/ErrorTip/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/pro/Selector/demo.d.ts +1 -0
- package/es/pro/pisellPaymentList/example.d.ts +1 -0
- package/es/utils/buildCartHolderParams.d.ts +97 -0
- package/es/utils/buildCartHolderParams.js +200 -0
- package/lib/businessModel/SalesModel/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Cart/Item/index.js +70 -9
- package/lib/components/appointmentBooking/components/ConfirmInformation/index.js +6 -2
- package/lib/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +1 -0
- 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 +17 -91
- package/lib/components/appointmentBooking/utils.d.ts +1 -0
- package/lib/components/appointmentBooking/utils.js +24 -13
- package/lib/components/booking/components/TabProduct/index.d.ts +1 -0
- package/lib/components/booking/components/formItemChildrenWrap/index.d.ts +1 -0
- package/lib/components/booking/forms/table/index.d.ts +1 -0
- package/lib/components/booking/info/addServiceVariant/index.d.ts +1 -0
- package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
- package/lib/components/booking/info/index.d.ts +1 -0
- package/lib/components/booking/info/service/like/index.d.ts +1 -0
- package/lib/components/ecocup/components/MoreDropdown/index.d.ts +1 -0
- package/lib/components/ecocup/cupList/hooks/useColumns.d.ts +1 -0
- package/lib/components/ecocup/cupList/hooks/useSummary.d.ts +1 -0
- package/lib/components/eftpos/SettlementModal/Action.d.ts +1 -0
- package/lib/components/eftpos/SettlementModal/index.d.ts +1 -0
- package/lib/components/eftpos/deviceList/index.d.ts +1 -0
- package/lib/components/eftpos/form/index.d.ts +1 -0
- package/lib/components/eftpos/group/index.d.ts +1 -0
- package/lib/components/eftpos/hooks.d.ts +1 -0
- package/lib/components/eftpos/icon/apiKey.d.ts +1 -0
- package/lib/components/eftpos/icon/device.d.ts +1 -0
- package/lib/components/eftpos/receipt/index.d.ts +1 -0
- package/lib/components/eftpos/surcharge/index.d.ts +1 -0
- package/lib/components/eftposPay/aggregatePayment/utils/payment.js +1 -2
- package/lib/components/eftposPay/app.d.ts +1 -0
- package/lib/components/eftposPay/component/alert/warn.d.ts +1 -0
- package/lib/components/eftposPay/component/header/titlebar.d.ts +1 -0
- package/lib/components/eftposPay/component/step/index.d.ts +1 -0
- package/lib/components/eftposPay/component/step/step.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/mx51/Action.d.ts +1 -0
- package/lib/components/eftposPay/store/index.d.ts +1 -1
- package/lib/components/eftposPay/tyro/hooks.d.ts +1 -0
- package/lib/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.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/components/scheduleCalendar/calendarItem.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
- package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/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/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/calendar/calendarItem.d.ts +1 -0
- package/lib/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +1 -0
- package/lib/components/schedules/resources/relationProduct/index.d.ts +1 -0
- package/lib/components/shoppingCart/components/Cart/Product.d.ts +1 -0
- 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/systemSettings/registry/components/DataSourceTreeSelect/index.d.ts +1 -0
- package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +1 -0
- package/lib/components/venueBooking/components/Cart/index.js +93 -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/components/workSpaceList/components/Modal/index.d.ts +1 -0
- package/lib/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +1 -0
- package/lib/plus/clientName/index.d.ts +1 -0
- package/lib/plus/clinetSearch/Add/PhoneField/index.d.ts +1 -0
- package/lib/plus/orderList/components/HandleActions.d.ts +1 -0
- package/lib/plus/orderList/components/QuickFilter.d.ts +1 -0
- package/lib/plus/orderList/components/Reset.d.ts +1 -0
- package/lib/plus/orderList/components/Toolbar.d.ts +1 -0
- package/lib/plus/pisellReservation/hooks/useReservationScheduleDebounced.d.ts +1 -0
- package/lib/plus/selectHolder/components/ErrorTip/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/pro/Selector/demo.d.ts +1 -0
- package/lib/pro/pisellPaymentList/example.d.ts +1 -0
- package/lib/utils/buildCartHolderParams.d.ts +97 -0
- package/lib/utils/buildCartHolderParams.js +172 -0
- package/package.json +1 -1
|
@@ -9,9 +9,9 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
9
9
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
10
10
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
11
|
import React, { useMemo, useState, useCallback, useEffect } from 'react';
|
|
12
|
-
import { Input, message
|
|
12
|
+
import { Input, message } from 'antd';
|
|
13
13
|
import { locales } from '@pisell/utils';
|
|
14
|
-
import {
|
|
14
|
+
import { PisellLoading, PisellToast } from '@pisell/materials';
|
|
15
15
|
import Cart from "../Cart";
|
|
16
16
|
import FulfillmentMode from "../FulfillmentMode";
|
|
17
17
|
import ManualPickupRefModal from "../ManualPickupRefModal";
|
|
@@ -25,8 +25,7 @@ export default function Check() {
|
|
|
25
25
|
refreshViewModel = _useScanOrderContext.refreshViewModel,
|
|
26
26
|
tableName = _useScanOrderContext.tableName,
|
|
27
27
|
entryMode = _useScanOrderContext.entryMode,
|
|
28
|
-
clearStepCache = _useScanOrderContext.clearStepCache
|
|
29
|
-
entryContext = _useScanOrderContext.entryContext;
|
|
28
|
+
clearStepCache = _useScanOrderContext.clearStepCache;
|
|
30
29
|
var isAdditionalOrder = entryMode === 'additional_order';
|
|
31
30
|
var _useState = useState(false),
|
|
32
31
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -40,19 +39,15 @@ export default function Check() {
|
|
|
40
39
|
_useState6 = _slicedToArray(_useState5, 2),
|
|
41
40
|
pickupRefOpen = _useState6[0],
|
|
42
41
|
setPickupRefOpen = _useState6[1];
|
|
43
|
-
var _useState7 = useState(false),
|
|
44
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
45
|
-
addOnConfirmOpen = _useState8[0],
|
|
46
|
-
setAddOnConfirmOpen = _useState8[1];
|
|
47
42
|
var utils = contextUtils();
|
|
48
|
-
var
|
|
43
|
+
var _useState7 = useState(null),
|
|
44
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
45
|
+
dineInConfig = _useState8[0],
|
|
46
|
+
setDineInConfig = _useState8[1];
|
|
47
|
+
var _useState9 = useState(''),
|
|
49
48
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
var _useState11 = useState(''),
|
|
53
|
-
_useState12 = _slicedToArray(_useState11, 2),
|
|
54
|
-
channel = _useState12[0],
|
|
55
|
-
setChannel = _useState12[1];
|
|
49
|
+
channel = _useState10[0],
|
|
50
|
+
setChannel = _useState10[1];
|
|
56
51
|
// 去读 pisellos 内的配置
|
|
57
52
|
var getConfig = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
58
53
|
var _otherParams$dineInCo, _otherParams$channel;
|
|
@@ -94,18 +89,6 @@ export default function Check() {
|
|
|
94
89
|
var productsTitle = useMemo(function () {
|
|
95
90
|
return String(locales.getText('pisell2.scan.order.products.title') || 'Products');
|
|
96
91
|
}, []);
|
|
97
|
-
var addOnConfirmTitle = useMemo(function () {
|
|
98
|
-
return String(locales.getText('pisell2.scan.order.add.on.confirm.title') || 'This table has already started ordering');
|
|
99
|
-
}, []);
|
|
100
|
-
var addOnConfirmDescription = useMemo(function () {
|
|
101
|
-
return String(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.');
|
|
102
|
-
}, []);
|
|
103
|
-
var addOnConfirmButtonText = useMemo(function () {
|
|
104
|
-
return String(locales.getText('pisell2.scan.order.add.on.confirm.button') || 'Confirm Add-on Order');
|
|
105
|
-
}, []);
|
|
106
|
-
var addOnReturnButtonText = useMemo(function () {
|
|
107
|
-
return String(locales.getText('pisell2.scan.order.add.on.return.button') || 'Return to Cart');
|
|
108
|
-
}, []);
|
|
109
92
|
var showCheckStepEmptyCartTip = function showCheckStepEmptyCartTip() {
|
|
110
93
|
message.error(locales.getText('pisell2.scan.order.check.cart.empty.tip') || 'Please go back to add products');
|
|
111
94
|
};
|
|
@@ -115,31 +98,9 @@ export default function Check() {
|
|
|
115
98
|
content: content
|
|
116
99
|
});
|
|
117
100
|
}, []);
|
|
118
|
-
var showInventoryInsufficientModal = useCallback(function (error) {
|
|
119
|
-
var _error$data;
|
|
120
|
-
setSubmitting(false);
|
|
121
|
-
var unavailableProducts = Array.isArray(error === null || error === void 0 || (_error$data = error.data) === null || _error$data === void 0 ? void 0 : _error$data.unavailable_products) ? error.data.unavailable_products : [];
|
|
122
|
-
var productNames = unavailableProducts.map(function (product) {
|
|
123
|
-
return String((product === null || product === void 0 ? void 0 : product.title) || (product === null || product === void 0 ? void 0 : product.product_id) || '').trim();
|
|
124
|
-
}).filter(Boolean);
|
|
125
|
-
var title = String(locales.getText('pisell2.scan.order.inventory.insufficient.title') || 'Insufficient inventory');
|
|
126
|
-
var description = String(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.');
|
|
127
|
-
var productsLabel = String(locales.getText('pisell2.scan.order.inventory.insufficient.products.label') || 'Unavailable products:');
|
|
128
|
-
var fallbackMessage = String((error === null || error === void 0 ? void 0 : error.message) || description);
|
|
129
|
-
Modal.info({
|
|
130
|
-
title: title,
|
|
131
|
-
content: /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", null, description), /*#__PURE__*/React.createElement("div", null, productsLabel), productNames.length > 0 ? /*#__PURE__*/React.createElement("ul", null, productNames.map(function (name, index) {
|
|
132
|
-
return /*#__PURE__*/React.createElement("li", {
|
|
133
|
-
key: "".concat(name, "-").concat(index)
|
|
134
|
-
}, name);
|
|
135
|
-
})) : /*#__PURE__*/React.createElement("div", null, fallbackMessage)),
|
|
136
|
-
okText: String(locales.getText('pisell2.event.confirm') || 'OK'),
|
|
137
|
-
maskClosable: false
|
|
138
|
-
});
|
|
139
|
-
}, []);
|
|
140
101
|
var doSubmit = /*#__PURE__*/function () {
|
|
141
102
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
142
|
-
var items, _res$data, res, orderId, shouldPayOnSubmit, channelMap, saleChannel, _res$data2, _viewModel$summary, _utils$history, _utils$history2, link
|
|
103
|
+
var items, _res$data, res, orderId, shouldPayOnSubmit, channelMap, saleChannel, _res$data2, _viewModel$summary, _utils$history, _utils$history2, link;
|
|
143
104
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
144
105
|
while (1) switch (_context3.prev = _context3.next) {
|
|
145
106
|
case 0:
|
|
@@ -163,39 +124,31 @@ export default function Check() {
|
|
|
163
124
|
res = _context3.sent;
|
|
164
125
|
console.log('submitScanOrder >>>>> ', res);
|
|
165
126
|
if (!((res === null || res === void 0 ? void 0 : res.status) === false)) {
|
|
166
|
-
_context3.next = 20;
|
|
167
|
-
break;
|
|
168
|
-
}
|
|
169
|
-
if (!((res === null || res === void 0 ? void 0 : res.code) === 6008)) {
|
|
170
127
|
_context3.next = 17;
|
|
171
128
|
break;
|
|
172
129
|
}
|
|
173
|
-
showInventoryInsufficientModal(res);
|
|
174
|
-
return _context3.abrupt("return");
|
|
175
|
-
case 17:
|
|
176
130
|
setSubmitting(false);
|
|
177
131
|
showSubmitFailedTip(res === null || res === void 0 ? void 0 : res.message);
|
|
178
132
|
return _context3.abrupt("return");
|
|
179
|
-
case
|
|
133
|
+
case 17:
|
|
180
134
|
orderId = res === null || res === void 0 || (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.order_id;
|
|
181
135
|
shouldPayOnSubmit = (dineInConfig === null || dineInConfig === void 0 ? void 0 : dineInConfig['sale.require_payment_on_submit']) && !isAdditionalOrder;
|
|
182
136
|
if (orderId) {
|
|
183
|
-
_context3.next =
|
|
137
|
+
_context3.next = 22;
|
|
184
138
|
break;
|
|
185
139
|
}
|
|
186
140
|
showSubmitFailedTip(res === null || res === void 0 ? void 0 : res.message);
|
|
187
141
|
return _context3.abrupt("return");
|
|
188
|
-
case
|
|
142
|
+
case 22:
|
|
189
143
|
// 下单成功:清空步骤缓存(step / gate / entryContext),避免残留影响下次扫码
|
|
190
144
|
clearStepCache();
|
|
191
145
|
channelMap = {
|
|
192
146
|
'scan_to_order': 'table-order',
|
|
193
|
-
'scan_to_order_2': 'mobile_order'
|
|
194
|
-
'scan_to_order_3': 'scantoorder3'
|
|
147
|
+
'scan_to_order_2': 'mobile_order'
|
|
195
148
|
};
|
|
196
149
|
saleChannel = channelMap[channel] || channel;
|
|
197
150
|
if (!shouldPayOnSubmit) {
|
|
198
|
-
_context3.next =
|
|
151
|
+
_context3.next = 30;
|
|
199
152
|
break;
|
|
200
153
|
}
|
|
201
154
|
setSubmitting(false);
|
|
@@ -233,20 +186,20 @@ export default function Check() {
|
|
|
233
186
|
return callback;
|
|
234
187
|
}()
|
|
235
188
|
});
|
|
236
|
-
_context3.next =
|
|
189
|
+
_context3.next = 48;
|
|
237
190
|
break;
|
|
238
|
-
case
|
|
239
|
-
_context3.prev =
|
|
240
|
-
_context3.next =
|
|
191
|
+
case 30:
|
|
192
|
+
_context3.prev = 30;
|
|
193
|
+
_context3.next = 33;
|
|
241
194
|
return runModuleAction('restoreOrder');
|
|
242
|
-
case
|
|
243
|
-
_context3.next =
|
|
195
|
+
case 33:
|
|
196
|
+
_context3.next = 38;
|
|
244
197
|
break;
|
|
245
|
-
case
|
|
246
|
-
_context3.prev =
|
|
247
|
-
_context3.t0 = _context3["catch"](
|
|
198
|
+
case 35:
|
|
199
|
+
_context3.prev = 35;
|
|
200
|
+
_context3.t0 = _context3["catch"](30);
|
|
248
201
|
console.warn('[scanOrder] restoreOrder before redirect failed', _context3.t0);
|
|
249
|
-
case
|
|
202
|
+
case 38:
|
|
250
203
|
link = "/order/details?id=".concat(orderId);
|
|
251
204
|
if (utils !== null && utils !== void 0 && (_utils$history = utils.history) !== null && _utils$history !== void 0 && _utils$history.replace) {
|
|
252
205
|
utils.history.replace(link);
|
|
@@ -255,75 +208,35 @@ export default function Check() {
|
|
|
255
208
|
} else {
|
|
256
209
|
location.replace(link);
|
|
257
210
|
}
|
|
258
|
-
_context3.prev =
|
|
259
|
-
_context3.next =
|
|
211
|
+
_context3.prev = 40;
|
|
212
|
+
_context3.next = 43;
|
|
260
213
|
return runModuleAction('restoreOrder');
|
|
261
|
-
case
|
|
262
|
-
_context3.next =
|
|
214
|
+
case 43:
|
|
215
|
+
_context3.next = 48;
|
|
263
216
|
break;
|
|
264
|
-
case
|
|
265
|
-
_context3.prev =
|
|
266
|
-
_context3.t1 = _context3["catch"](
|
|
217
|
+
case 45:
|
|
218
|
+
_context3.prev = 45;
|
|
219
|
+
_context3.t1 = _context3["catch"](40);
|
|
267
220
|
console.warn('[scanOrder] restoreOrder after payment failed', _context3.t1);
|
|
268
|
-
case
|
|
269
|
-
_context3.next =
|
|
221
|
+
case 48:
|
|
222
|
+
_context3.next = 50;
|
|
270
223
|
return refreshViewModel();
|
|
271
|
-
case
|
|
272
|
-
_context3.next =
|
|
224
|
+
case 50:
|
|
225
|
+
_context3.next = 56;
|
|
273
226
|
break;
|
|
274
|
-
case
|
|
275
|
-
_context3.prev =
|
|
227
|
+
case 52:
|
|
228
|
+
_context3.prev = 52;
|
|
276
229
|
_context3.t2 = _context3["catch"](5);
|
|
277
230
|
console.error('[scanOrder] submitScanOrder failed', _context3.t2);
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
showSubmitFailedTip(String(locales.getText('pisell2.scan.order.settled.cannot.add.tip') || ''));
|
|
284
|
-
_context3.next = 77;
|
|
285
|
-
break;
|
|
286
|
-
case 63:
|
|
287
|
-
if (!((_context3.t2 === null || _context3.t2 === void 0 ? void 0 : _context3.t2.code) === 670007 && entryContext !== null && entryContext !== void 0 && entryContext.resource_id)) {
|
|
288
|
-
_context3.next = 76;
|
|
289
|
-
break;
|
|
290
|
-
}
|
|
291
|
-
_context3.next = 66;
|
|
292
|
-
return runModuleAction('getReservationResourceSelectType');
|
|
293
|
-
case 66:
|
|
294
|
-
reservationResourceSelectType = _context3.sent;
|
|
295
|
-
_context3.next = 69;
|
|
296
|
-
return runModuleAction('checkAllowAddItems');
|
|
297
|
-
case 69:
|
|
298
|
-
allowAddItems = _context3.sent;
|
|
299
|
-
_context3.next = 72;
|
|
300
|
-
return runModuleAction('syncAdditionalOrderFromResource', entryContext === null || entryContext === void 0 ? void 0 : entryContext.resource_id);
|
|
301
|
-
case 72:
|
|
302
|
-
_res = _context3.sent;
|
|
303
|
-
if (reservationResourceSelectType.resourceSelectType === 'single' && allowAddItems !== null && allowAddItems !== void 0 && allowAddItems.enabled && _res !== null && _res !== void 0 && _res.matched) {
|
|
304
|
-
setSubmitting(false);
|
|
305
|
-
setAddOnConfirmOpen(true);
|
|
306
|
-
} else {
|
|
307
|
-
setSubmitting(false);
|
|
308
|
-
showSubmitFailedTip(_context3.t2 === null || _context3.t2 === void 0 ? void 0 : _context3.t2.message);
|
|
309
|
-
}
|
|
310
|
-
_context3.next = 77;
|
|
311
|
-
break;
|
|
312
|
-
case 76:
|
|
313
|
-
if ((_context3.t2 === null || _context3.t2 === void 0 ? void 0 : _context3.t2.code) === 6008) {
|
|
314
|
-
showInventoryInsufficientModal(_context3.t2);
|
|
315
|
-
} else {
|
|
316
|
-
setSubmitting(false);
|
|
317
|
-
showSubmitFailedTip(_context3.t2 === null || _context3.t2 === void 0 ? void 0 : _context3.t2.message);
|
|
318
|
-
}
|
|
319
|
-
case 77:
|
|
320
|
-
_context3.prev = 77;
|
|
321
|
-
return _context3.finish(77);
|
|
322
|
-
case 79:
|
|
231
|
+
showSubmitFailedTip(_context3.t2 === null || _context3.t2 === void 0 ? void 0 : _context3.t2.message);
|
|
232
|
+
case 56:
|
|
233
|
+
_context3.prev = 56;
|
|
234
|
+
return _context3.finish(56);
|
|
235
|
+
case 58:
|
|
323
236
|
case "end":
|
|
324
237
|
return _context3.stop();
|
|
325
238
|
}
|
|
326
|
-
}, _callee3, null, [[5,
|
|
239
|
+
}, _callee3, null, [[5, 52, 56, 58], [30, 35], [40, 45]]);
|
|
327
240
|
}));
|
|
328
241
|
return function doSubmit() {
|
|
329
242
|
return _ref2.apply(this, arguments);
|
|
@@ -431,35 +344,6 @@ export default function Check() {
|
|
|
431
344
|
if (submitting) return;
|
|
432
345
|
setPickupRefOpen(false);
|
|
433
346
|
};
|
|
434
|
-
var handleAddOnConfirm = /*#__PURE__*/function () {
|
|
435
|
-
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
436
|
-
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
437
|
-
while (1) switch (_context6.prev = _context6.next) {
|
|
438
|
-
case 0:
|
|
439
|
-
if (!submitting) {
|
|
440
|
-
_context6.next = 2;
|
|
441
|
-
break;
|
|
442
|
-
}
|
|
443
|
-
return _context6.abrupt("return");
|
|
444
|
-
case 2:
|
|
445
|
-
setAddOnConfirmOpen(false);
|
|
446
|
-
// 再次提交时,OS 会自动代理到加餐模式。
|
|
447
|
-
_context6.next = 5;
|
|
448
|
-
return doSubmit();
|
|
449
|
-
case 5:
|
|
450
|
-
case "end":
|
|
451
|
-
return _context6.stop();
|
|
452
|
-
}
|
|
453
|
-
}, _callee6);
|
|
454
|
-
}));
|
|
455
|
-
return function handleAddOnConfirm() {
|
|
456
|
-
return _ref5.apply(this, arguments);
|
|
457
|
-
};
|
|
458
|
-
}();
|
|
459
|
-
var handleAddOnReturn = function handleAddOnReturn() {
|
|
460
|
-
if (submitting) return;
|
|
461
|
-
setAddOnConfirmOpen(false);
|
|
462
|
-
};
|
|
463
347
|
var noteContent = /*#__PURE__*/React.createElement("div", {
|
|
464
348
|
className: "pisell-scan-order-check-note"
|
|
465
349
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -500,32 +384,7 @@ export default function Check() {
|
|
|
500
384
|
confirmLoading: submitting,
|
|
501
385
|
onCancel: handlePickupRefCancel,
|
|
502
386
|
onConfirm: handlePickupRefConfirm
|
|
503
|
-
}), /*#__PURE__*/React.createElement(
|
|
504
|
-
open: addOnConfirmOpen,
|
|
505
|
-
footer: null,
|
|
506
|
-
onCancel: handleAddOnReturn,
|
|
507
|
-
maskClosable: false,
|
|
508
|
-
destroyOnClose: true,
|
|
509
|
-
centered: true,
|
|
510
|
-
className: "pisell-scan-order-add-on-confirm-modal"
|
|
511
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
512
|
-
className: "pisell-scan-order-add-on-confirm-body"
|
|
513
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
514
|
-
className: "pisell-scan-order-add-on-confirm-title"
|
|
515
|
-
}, addOnConfirmTitle), /*#__PURE__*/React.createElement("div", {
|
|
516
|
-
className: "pisell-scan-order-add-on-confirm-desc"
|
|
517
|
-
}, addOnConfirmDescription), /*#__PURE__*/React.createElement(Button, {
|
|
518
|
-
type: "primary",
|
|
519
|
-
block: true,
|
|
520
|
-
size: "large",
|
|
521
|
-
loading: submitting,
|
|
522
|
-
onClick: handleAddOnConfirm
|
|
523
|
-
}, addOnConfirmButtonText), /*#__PURE__*/React.createElement(Button, {
|
|
524
|
-
block: true,
|
|
525
|
-
size: "large",
|
|
526
|
-
disabled: submitting,
|
|
527
|
-
onClick: handleAddOnReturn
|
|
528
|
-
}, addOnReturnButtonText))), submitting ? /*#__PURE__*/React.createElement("div", {
|
|
387
|
+
}), submitting ? /*#__PURE__*/React.createElement("div", {
|
|
529
388
|
className: "pisell-scan-order-check-loading-mask"
|
|
530
389
|
}, /*#__PURE__*/React.createElement("div", {
|
|
531
390
|
className: "pisell-scan-order-check-loading-panel"
|
|
@@ -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
|
-
}
|