@pisell/private-materials 6.3.139 → 6.3.141
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 +5 -5
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +7 -7
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +6 -6
- package/es/components/appointmentBooking/components/Cart/Item/Total.d.ts +1 -0
- package/es/components/appointmentBooking/components/Cart/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Deposit/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Footer/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +1 -0
- package/es/components/booking/forms/footer.d.ts +1 -0
- package/es/components/booking/forms/sendModal/useSendModal.d.ts +1 -0
- package/es/components/booking/hooks/useClearCart.d.ts +1 -0
- package/es/components/booking/info/dateRange/index.d.ts +1 -0
- package/es/components/booking/notes/NoteBlock/index.d.ts +1 -0
- package/es/components/ecocup/components/AddCustomerModal/index.d.ts +1 -0
- package/es/components/ecocup/components/CupActionList/index.d.ts +1 -0
- package/es/components/ecocup/components/CupActionModal/index.d.ts +1 -0
- package/es/components/ecocup/components/CupStatusModal/index.d.ts +1 -0
- package/es/components/ecocup/components/CustomerAndCupModal/index.d.ts +1 -0
- package/es/components/ecocup/components/MoreDropdown/index.d.ts +1 -0
- package/es/components/ecocup/components/SearchBar/index.d.ts +1 -0
- package/es/components/ecocup/components/SettingModal/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/ecocup/cupList/index.d.ts +1 -0
- package/es/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Cart/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Event/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Footer/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Resource/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/bookingDetailModal/components/BookingOptions.d.ts +1 -0
- package/es/components/eventBooking/components/scheduleCalendar/components/ScheduleTimeItem/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
- package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +1 -0
- package/es/components/scanOrder/components/Cart/index.js +127 -56
- package/es/components/scanOrder/components/Cart/index.less +11 -5
- package/es/components/scanOrder/components/Check/index.js +85 -80
- package/es/components/scanOrder/components/Content/index.js +356 -164
- package/es/components/scanOrder/components/Menu/index.d.ts +11 -0
- package/es/components/scanOrder/components/Menu/index.js +140 -169
- package/es/components/scanOrder/components/Voucher/index.d.ts +8 -0
- package/es/components/scanOrder/components/Voucher/index.js +250 -0
- package/es/components/scanOrder/context.js +38 -13
- package/es/components/scanOrder/hooks.js +4 -1
- package/es/components/scanOrder/locales.d.ts +65 -0
- package/es/components/scanOrder/locales.js +65 -0
- package/es/components/scanOrder/types.d.ts +10 -0
- package/es/components/scanOrder/utils/toShoppingCartProducts.d.ts +1 -0
- package/es/components/scanOrder/utils/toShoppingCartProducts.js +137 -9
- package/es/components/scanOrder/utils/transformProductDetail.js +21 -4
- package/es/components/shoppingCart/hooks/useAddService.d.ts +1 -0
- package/es/components/shoppingCart/hooks/useClearCart.d.ts +1 -0
- package/es/components/venueBooking/components/Addons/index.js +42 -33
- package/es/components/venueBooking/components/Cart/index.js +26 -14
- package/es/components/workSpaceList/components/Modal/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/floorMap/useReservationFloorPlan.d.ts +1 -0
- package/es/plus/saasAttendance/settings/components/membersField/index.d.ts +1 -0
- package/es/plus/saasRegister/components/VertifyEmail.d.ts +1 -0
- package/es/plus/selectHolder/components/ErrorTip/index.d.ts +1 -0
- package/es/plus/skuOptionsSelection/components/OptionsCard/OptionItemCard.d.ts +1 -0
- package/es/plus/skuOptionsSelection/components/OptionsCard/index.d.ts +1 -0
- package/es/plus/skuOptionsSelection/components/OptionsModal/index.d.ts +1 -0
- package/es/plus/walletPassGallery/components/timelineSection/index.d.ts +1 -0
- package/es/pro/pisellPhoneKeyboard/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Cart/Item/Total.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Cart/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Deposit/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Footer/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +1 -0
- package/lib/components/booking/forms/footer.d.ts +1 -0
- package/lib/components/booking/forms/sendModal/useSendModal.d.ts +1 -0
- package/lib/components/booking/hooks/useClearCart.d.ts +1 -0
- package/lib/components/booking/info/dateRange/index.d.ts +1 -0
- package/lib/components/booking/notes/NoteBlock/index.d.ts +1 -0
- package/lib/components/ecocup/components/AddCustomerModal/index.d.ts +1 -0
- package/lib/components/ecocup/components/CupActionList/index.d.ts +1 -0
- package/lib/components/ecocup/components/CupActionModal/index.d.ts +1 -0
- package/lib/components/ecocup/components/CupStatusModal/index.d.ts +1 -0
- package/lib/components/ecocup/components/CustomerAndCupModal/index.d.ts +1 -0
- package/lib/components/ecocup/components/MoreDropdown/index.d.ts +1 -0
- package/lib/components/ecocup/components/SearchBar/index.d.ts +1 -0
- package/lib/components/ecocup/components/SettingModal/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/ecocup/cupList/index.d.ts +1 -0
- package/lib/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Cart/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Event/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Footer/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Resource/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/bookingDetailModal/components/BookingOptions.d.ts +1 -0
- package/lib/components/eventBooking/components/scheduleCalendar/components/ScheduleTimeItem/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
- package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +1 -0
- package/lib/components/scanOrder/components/Cart/index.js +79 -24
- package/lib/components/scanOrder/components/Cart/index.less +11 -5
- package/lib/components/scanOrder/components/Check/index.js +28 -23
- package/lib/components/scanOrder/components/Content/index.js +136 -42
- package/lib/components/scanOrder/components/Menu/index.d.ts +11 -0
- package/lib/components/scanOrder/components/Menu/index.js +23 -36
- package/lib/components/scanOrder/components/Voucher/index.d.ts +8 -0
- package/lib/components/scanOrder/components/Voucher/index.js +162 -0
- package/lib/components/scanOrder/context.js +21 -10
- package/lib/components/scanOrder/hooks.js +4 -1
- package/lib/components/scanOrder/locales.d.ts +65 -0
- package/lib/components/scanOrder/locales.js +65 -0
- package/lib/components/scanOrder/types.d.ts +10 -0
- package/lib/components/scanOrder/utils/toShoppingCartProducts.d.ts +1 -0
- package/lib/components/scanOrder/utils/toShoppingCartProducts.js +88 -6
- package/lib/components/scanOrder/utils/transformProductDetail.js +10 -3
- package/lib/components/shoppingCart/hooks/useAddService.d.ts +1 -0
- package/lib/components/shoppingCart/hooks/useClearCart.d.ts +1 -0
- package/lib/components/venueBooking/components/Addons/index.js +15 -8
- package/lib/components/venueBooking/components/Cart/index.js +8 -2
- package/lib/components/workSpaceList/components/Modal/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/floorMap/useReservationFloorPlan.d.ts +1 -0
- package/lib/plus/saasAttendance/settings/components/membersField/index.d.ts +1 -0
- package/lib/plus/saasRegister/components/VertifyEmail.d.ts +1 -0
- package/lib/plus/selectHolder/components/ErrorTip/index.d.ts +1 -0
- package/lib/plus/skuOptionsSelection/components/OptionsCard/OptionItemCard.d.ts +1 -0
- package/lib/plus/skuOptionsSelection/components/OptionsCard/index.d.ts +1 -0
- package/lib/plus/skuOptionsSelection/components/OptionsModal/index.d.ts +1 -0
- package/lib/plus/walletPassGallery/components/timelineSection/index.d.ts +1 -0
- package/lib/pro/pisellPhoneKeyboard/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -9,7 +9,7 @@ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol
|
|
|
9
9
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
10
10
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
11
11
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
12
|
-
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
12
|
+
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
13
13
|
import { isMobile, locales } from '@pisell/utils';
|
|
14
14
|
import { message, Modal } from 'antd';
|
|
15
15
|
import { Button, PisellModal } from '@pisell/materials';
|
|
@@ -78,7 +78,9 @@ function ReadyState() {
|
|
|
78
78
|
scanOrderModule = _useScanOrderContext.scanOrderModule,
|
|
79
79
|
isCacheHydrated = _useScanOrderContext.isCacheHydrated,
|
|
80
80
|
markGate = _useScanOrderContext.markGate,
|
|
81
|
-
isGatePassed = _useScanOrderContext.isGatePassed
|
|
81
|
+
isGatePassed = _useScanOrderContext.isGatePassed,
|
|
82
|
+
resumeStep = _useScanOrderContext.resumeStep,
|
|
83
|
+
consumeResumeStep = _useScanOrderContext.consumeResumeStep;
|
|
82
84
|
var _useScanOrderLogin = useScanOrderLogin(),
|
|
83
85
|
isLogin = _useScanOrderLogin.isLogin,
|
|
84
86
|
openLoginModal = _useScanOrderLogin.openLoginModal;
|
|
@@ -111,20 +113,122 @@ function ReadyState() {
|
|
|
111
113
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
112
114
|
pendingFormPayload = _useState8[0],
|
|
113
115
|
setPendingFormPayload = _useState8[1];
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* 商品列表状态:挂在 ReadyState 而不是 Menu 本地,保证从 check 返回 product 时命中缓存、不重发请求
|
|
119
|
+
* (stepRegistry 切换会让 Menu unmount,本地 useState 会丢;ReadyState 在整段会话内不 unmount)
|
|
120
|
+
* - productListLoadedRef:同步判定是否已有有效结果,避免 setState 异步窗口内重复请求
|
|
121
|
+
* - productListPromiseRef:in-flight promise 去重,让并发调用合并成同一次请求
|
|
122
|
+
*/
|
|
123
|
+
var _useState9 = useState([]),
|
|
124
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
125
|
+
productList = _useState10[0],
|
|
126
|
+
setProductList = _useState10[1];
|
|
127
|
+
var productListLoadedRef = useRef(false);
|
|
128
|
+
var productListPromiseRef = useRef(null);
|
|
129
|
+
var ensureProductListLoaded = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
130
|
+
var request;
|
|
131
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
132
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
133
|
+
case 0:
|
|
134
|
+
if (!productListLoadedRef.current) {
|
|
135
|
+
_context2.next = 2;
|
|
136
|
+
break;
|
|
137
|
+
}
|
|
138
|
+
return _context2.abrupt("return");
|
|
139
|
+
case 2:
|
|
140
|
+
if (!productListPromiseRef.current) {
|
|
141
|
+
_context2.next = 6;
|
|
142
|
+
break;
|
|
143
|
+
}
|
|
144
|
+
_context2.next = 5;
|
|
145
|
+
return productListPromiseRef.current.catch(function () {});
|
|
146
|
+
case 5:
|
|
147
|
+
return _context2.abrupt("return");
|
|
148
|
+
case 6:
|
|
149
|
+
request = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
150
|
+
var res;
|
|
151
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
152
|
+
while (1) switch (_context.prev = _context.next) {
|
|
153
|
+
case 0:
|
|
154
|
+
_context.prev = 0;
|
|
155
|
+
_context.next = 3;
|
|
156
|
+
return runModuleAction('getProductList');
|
|
157
|
+
case 3:
|
|
158
|
+
res = _context.sent;
|
|
159
|
+
if (!Array.isArray(res)) {
|
|
160
|
+
_context.next = 8;
|
|
161
|
+
break;
|
|
162
|
+
}
|
|
163
|
+
productListLoadedRef.current = true;
|
|
164
|
+
setProductList(res);
|
|
165
|
+
return _context.abrupt("return");
|
|
166
|
+
case 8:
|
|
167
|
+
// 非数组错误载荷:沿用原 Menu 内的 Modal.confirm + 跳首页逻辑
|
|
168
|
+
Modal.confirm({
|
|
169
|
+
title: res === null || res === void 0 ? void 0 : res.message,
|
|
170
|
+
okText: String(locales.getText('pisell2.event.confirm') || 'OK'),
|
|
171
|
+
cancelButtonProps: {
|
|
172
|
+
style: {
|
|
173
|
+
display: 'none'
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
maskClosable: false,
|
|
177
|
+
onOk: function onOk() {
|
|
178
|
+
location.replace('/');
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
_context.next = 14;
|
|
182
|
+
break;
|
|
183
|
+
case 11:
|
|
184
|
+
_context.prev = 11;
|
|
185
|
+
_context.t0 = _context["catch"](0);
|
|
186
|
+
console.warn('[scanOrder] getProductList failed', _context.t0);
|
|
187
|
+
case 14:
|
|
188
|
+
_context.prev = 14;
|
|
189
|
+
productListPromiseRef.current = null;
|
|
190
|
+
return _context.finish(14);
|
|
191
|
+
case 17:
|
|
192
|
+
case "end":
|
|
193
|
+
return _context.stop();
|
|
194
|
+
}
|
|
195
|
+
}, _callee, null, [[0, 11, 14, 17]]);
|
|
196
|
+
}))();
|
|
197
|
+
productListPromiseRef.current = request;
|
|
198
|
+
_context2.next = 10;
|
|
199
|
+
return request;
|
|
200
|
+
case 10:
|
|
201
|
+
case "end":
|
|
202
|
+
return _context2.stop();
|
|
203
|
+
}
|
|
204
|
+
}, _callee2);
|
|
205
|
+
})), [runModuleAction]);
|
|
206
|
+
|
|
114
207
|
/** checkResourceAvailable 返回 requestEntryPax === 1 时,在协议/表单之后弹人数并写入 scanOrder otherParams */
|
|
115
208
|
var requestEntryPaxRef = useRef(0);
|
|
116
209
|
var requestPaxMinRef = useRef(1);
|
|
117
210
|
var requestPaxMaxRef = useRef(1);
|
|
118
211
|
var tableFormRecordRef = useRef(null);
|
|
212
|
+
/** 本次会话是否曾实际弹出过入口人数弹窗(商品页返回首页前可二次弹窗) */
|
|
213
|
+
var entryPaxModalWasPresentedRef = useRef(false);
|
|
119
214
|
|
|
120
|
-
/** 根据当前语言从多语言 name
|
|
215
|
+
/** 根据当前语言从多语言 name 对象中取值,兜底当前语言 -> original -> 空串 */
|
|
121
216
|
var getLocalizedName = function getLocalizedName(nameMap) {
|
|
122
217
|
if (!nameMap) return '';
|
|
123
218
|
var currentLocale = locales.getLocale();
|
|
124
|
-
|
|
219
|
+
var localized = nameMap[currentLocale];
|
|
220
|
+
if (typeof localized === 'string' && localized) return localized;
|
|
221
|
+
var original = nameMap.original;
|
|
222
|
+
if (typeof original === 'string' && original) return original;
|
|
223
|
+
return '';
|
|
125
224
|
};
|
|
126
225
|
|
|
127
|
-
/**
|
|
226
|
+
/**
|
|
227
|
+
* 解析可能是纯字符串或多语言对象的文案
|
|
228
|
+
* - 字符串:原样返回
|
|
229
|
+
* - 多语言对象(如 { en, 'zh-CN', original, ... }):取当前语言,兜底 original
|
|
230
|
+
* - 其它:空串
|
|
231
|
+
*/
|
|
128
232
|
var resolveLocalizedText = function resolveLocalizedText(value) {
|
|
129
233
|
if (value == null) return '';
|
|
130
234
|
if (typeof value === 'string') return value;
|
|
@@ -132,11 +236,11 @@ function ReadyState() {
|
|
|
132
236
|
return getLocalizedName(value);
|
|
133
237
|
};
|
|
134
238
|
var normalizeFormPayload = function normalizeFormPayload(formPayload, partyroomBookingPayload) {
|
|
135
|
-
var
|
|
239
|
+
var _ref3, _ref4, _sourcePayload$id;
|
|
136
240
|
var sourcePayload = formPayload !== null && formPayload !== void 0 ? formPayload : partyroomBookingPayload;
|
|
137
241
|
if (!sourcePayload) return null;
|
|
138
242
|
var isPrimitivePayload = typeof sourcePayload === 'number' || typeof sourcePayload === 'string';
|
|
139
|
-
var rawId = isPrimitivePayload ? sourcePayload : (
|
|
243
|
+
var rawId = isPrimitivePayload ? sourcePayload : (_ref3 = (_ref4 = (_sourcePayload$id = sourcePayload === null || sourcePayload === void 0 ? void 0 : sourcePayload.id) !== null && _sourcePayload$id !== void 0 ? _sourcePayload$id : sourcePayload === null || sourcePayload === void 0 ? void 0 : sourcePayload.form_id) !== null && _ref4 !== void 0 ? _ref4 : sourcePayload === null || sourcePayload === void 0 ? void 0 : sourcePayload.resource_form_id) !== null && _ref3 !== void 0 ? _ref3 : sourcePayload === null || sourcePayload === void 0 ? void 0 : sourcePayload.partyroom_booking;
|
|
140
244
|
var formId = Number(rawId);
|
|
141
245
|
if (Number.isNaN(formId) || formId <= 0) return null;
|
|
142
246
|
var sourceDetail = _typeof(sourcePayload) === 'object' && sourcePayload !== null ? sourcePayload : {};
|
|
@@ -148,20 +252,54 @@ function ReadyState() {
|
|
|
148
252
|
};
|
|
149
253
|
};
|
|
150
254
|
var app = utils === null || utils === void 0 || (_utils$getApp = utils.getApp) === null || _utils$getApp === void 0 ? void 0 : _utils$getApp.call(utils);
|
|
255
|
+
|
|
256
|
+
/** 回站点首页(与商品步返回兜底一致) */
|
|
257
|
+
var navigateToHome = function navigateToHome() {
|
|
258
|
+
var _app$history, _app$history2;
|
|
259
|
+
if (app !== null && app !== void 0 && (_app$history = app.history) !== null && _app$history !== void 0 && _app$history.replace) {
|
|
260
|
+
app.history.replace('/');
|
|
261
|
+
} else if (app !== null && app !== void 0 && (_app$history2 = app.history) !== null && _app$history2 !== void 0 && _app$history2.push) {
|
|
262
|
+
app.history.push('/');
|
|
263
|
+
} else {
|
|
264
|
+
location.replace('/');
|
|
265
|
+
}
|
|
266
|
+
};
|
|
267
|
+
|
|
268
|
+
/** 弹出入口人数弹窗,返回有效人数或取消/关闭时为 null */
|
|
269
|
+
var requestEntryPaxModal = function requestEntryPaxModal() {
|
|
270
|
+
return new Promise(function (resolve) {
|
|
271
|
+
var _tableFormRecordRef$c;
|
|
272
|
+
if (typeof (utils === null || utils === void 0 ? void 0 : utils.action) !== 'function') {
|
|
273
|
+
resolve(null);
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
utils.action({
|
|
277
|
+
type: 'pisell1.handlePaxModal',
|
|
278
|
+
data: {
|
|
279
|
+
tableName: getLocalizedName((_tableFormRecordRef$c = tableFormRecordRef.current) === null || _tableFormRecordRef$c === void 0 ? void 0 : _tableFormRecordRef$c.name),
|
|
280
|
+
requestPaxMin: requestPaxMinRef.current,
|
|
281
|
+
requestPaxMax: requestPaxMaxRef.current
|
|
282
|
+
},
|
|
283
|
+
callback: function callback(result) {
|
|
284
|
+
resolve(extractEntryPaxNumber(result));
|
|
285
|
+
}
|
|
286
|
+
});
|
|
287
|
+
});
|
|
288
|
+
};
|
|
289
|
+
|
|
151
290
|
// 跳转到订单详情页
|
|
152
291
|
var handleOrderDetail = function handleOrderDetail(order_id) {
|
|
153
|
-
var _app$
|
|
292
|
+
var _app$history3, _app$history4;
|
|
154
293
|
var link = "/order/details?id=".concat(order_id);
|
|
155
|
-
if (app !== null && app !== void 0 && (_app$
|
|
294
|
+
if (app !== null && app !== void 0 && (_app$history3 = app.history) !== null && _app$history3 !== void 0 && _app$history3.replace) {
|
|
156
295
|
app.history.replace(link);
|
|
157
|
-
} else if (app !== null && app !== void 0 && (_app$
|
|
296
|
+
} else if (app !== null && app !== void 0 && (_app$history4 = app.history) !== null && _app$history4 !== void 0 && _app$history4.push) {
|
|
158
297
|
app.history.push(link);
|
|
159
298
|
} else {
|
|
160
299
|
location.replace(link);
|
|
161
300
|
}
|
|
162
301
|
};
|
|
163
302
|
var handleBack = function handleBack() {
|
|
164
|
-
var _app$history3, _app$history4;
|
|
165
303
|
if (currentStep !== 'product') {
|
|
166
304
|
prevStep();
|
|
167
305
|
return;
|
|
@@ -170,123 +308,153 @@ function ReadyState() {
|
|
|
170
308
|
handleOrderDetail(entryContext.order_id);
|
|
171
309
|
return;
|
|
172
310
|
}
|
|
173
|
-
if (
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
311
|
+
if (entryPaxModalWasPresentedRef.current) {
|
|
312
|
+
void _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
313
|
+
var pax;
|
|
314
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
315
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
316
|
+
case 0:
|
|
317
|
+
_context3.next = 2;
|
|
318
|
+
return requestEntryPaxModal();
|
|
319
|
+
case 2:
|
|
320
|
+
pax = _context3.sent;
|
|
321
|
+
if (!(pax == null)) {
|
|
322
|
+
_context3.next = 6;
|
|
323
|
+
break;
|
|
324
|
+
}
|
|
325
|
+
navigateToHome();
|
|
326
|
+
return _context3.abrupt("return");
|
|
327
|
+
case 6:
|
|
328
|
+
_context3.prev = 6;
|
|
329
|
+
_context3.next = 9;
|
|
330
|
+
return runModuleAction('setEntryPaxNumber', pax);
|
|
331
|
+
case 9:
|
|
332
|
+
_context3.next = 11;
|
|
333
|
+
return refreshViewModel();
|
|
334
|
+
case 11:
|
|
335
|
+
_context3.next = 16;
|
|
336
|
+
break;
|
|
337
|
+
case 13:
|
|
338
|
+
_context3.prev = 13;
|
|
339
|
+
_context3.t0 = _context3["catch"](6);
|
|
340
|
+
console.warn('[scanOrder] setEntryPaxNumber on back pax confirm failed', _context3.t0);
|
|
341
|
+
case 16:
|
|
342
|
+
case "end":
|
|
343
|
+
return _context3.stop();
|
|
344
|
+
}
|
|
345
|
+
}, _callee3, null, [[6, 13]]);
|
|
346
|
+
}))();
|
|
347
|
+
return;
|
|
179
348
|
}
|
|
349
|
+
navigateToHome();
|
|
180
350
|
};
|
|
181
351
|
var enterProductStep = /*#__PURE__*/function () {
|
|
182
|
-
var
|
|
183
|
-
|
|
184
|
-
|
|
352
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
353
|
+
var target;
|
|
354
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
355
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
185
356
|
case 0:
|
|
186
|
-
|
|
187
|
-
|
|
357
|
+
_context4.prev = 0;
|
|
358
|
+
_context4.next = 3;
|
|
188
359
|
return runModuleAction('applyItemRulePrefill');
|
|
189
360
|
case 3:
|
|
190
|
-
|
|
361
|
+
_context4.next = 5;
|
|
191
362
|
return refreshViewModel();
|
|
192
363
|
case 5:
|
|
193
|
-
|
|
364
|
+
_context4.next = 10;
|
|
194
365
|
break;
|
|
195
366
|
case 7:
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
console.warn('[scanOrder] applyItemRulePrefill failed',
|
|
367
|
+
_context4.prev = 7;
|
|
368
|
+
_context4.t0 = _context4["catch"](0);
|
|
369
|
+
console.warn('[scanOrder] applyItemRulePrefill failed', _context4.t0);
|
|
199
370
|
case 10:
|
|
200
|
-
|
|
201
|
-
//
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
371
|
+
_context4.prev = 10;
|
|
372
|
+
// bootstrap 结束后统一由 resumeStep 决定最终去向:
|
|
373
|
+
// - resumeStep === 'check' → 恢复到结算页(此时 dineInConfig 已加载)
|
|
374
|
+
// - 其它(null / 'product') → 正常进入商品页
|
|
375
|
+
target = resumeStep === 'check' ? 'check' : 'product';
|
|
376
|
+
if (resumeStep) consumeResumeStep();
|
|
377
|
+
goToStep(target);
|
|
378
|
+
return _context4.finish(10);
|
|
379
|
+
case 15:
|
|
205
380
|
case "end":
|
|
206
|
-
return
|
|
381
|
+
return _context4.stop();
|
|
207
382
|
}
|
|
208
|
-
},
|
|
383
|
+
}, _callee4, null, [[0, 7, 10, 15]]);
|
|
209
384
|
}));
|
|
210
385
|
return function enterProductStep() {
|
|
211
|
-
return
|
|
386
|
+
return _ref6.apply(this, arguments);
|
|
212
387
|
};
|
|
213
388
|
}();
|
|
214
389
|
|
|
215
390
|
/** 需要时先走人数弹窗与 setOtherParams(entryPaxNumber),再进入商品步 */
|
|
216
391
|
var runEntryPaxGateThenEnterProduct = /*#__PURE__*/function () {
|
|
217
|
-
var
|
|
392
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
218
393
|
var pax;
|
|
219
|
-
return _regeneratorRuntime().wrap(function
|
|
220
|
-
while (1) switch (
|
|
394
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
395
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
221
396
|
case 0:
|
|
222
|
-
if (!(
|
|
223
|
-
|
|
397
|
+
if (!(entryMode === 'additional_order')) {
|
|
398
|
+
_context5.next = 4;
|
|
224
399
|
break;
|
|
225
400
|
}
|
|
226
|
-
|
|
401
|
+
_context5.next = 3;
|
|
227
402
|
return enterProductStep();
|
|
228
403
|
case 3:
|
|
229
|
-
return
|
|
404
|
+
return _context5.abrupt("return");
|
|
230
405
|
case 4:
|
|
231
|
-
if (!
|
|
232
|
-
|
|
406
|
+
if (!(requestEntryPaxRef.current !== 1)) {
|
|
407
|
+
_context5.next = 8;
|
|
233
408
|
break;
|
|
234
409
|
}
|
|
235
|
-
|
|
410
|
+
_context5.next = 7;
|
|
236
411
|
return enterProductStep();
|
|
237
412
|
case 7:
|
|
238
|
-
return
|
|
413
|
+
return _context5.abrupt("return");
|
|
239
414
|
case 8:
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
callback: function callback(result) {
|
|
255
|
-
resolve(extractEntryPaxNumber(result));
|
|
256
|
-
}
|
|
257
|
-
});
|
|
258
|
-
});
|
|
259
|
-
case 10:
|
|
260
|
-
pax = _context2.sent;
|
|
415
|
+
if (!isGatePassed('paxEntered')) {
|
|
416
|
+
_context5.next = 12;
|
|
417
|
+
break;
|
|
418
|
+
}
|
|
419
|
+
_context5.next = 11;
|
|
420
|
+
return enterProductStep();
|
|
421
|
+
case 11:
|
|
422
|
+
return _context5.abrupt("return");
|
|
423
|
+
case 12:
|
|
424
|
+
entryPaxModalWasPresentedRef.current = true;
|
|
425
|
+
_context5.next = 15;
|
|
426
|
+
return requestEntryPaxModal();
|
|
427
|
+
case 15:
|
|
428
|
+
pax = _context5.sent;
|
|
261
429
|
if (!(pax == null)) {
|
|
262
|
-
|
|
430
|
+
_context5.next = 19;
|
|
263
431
|
break;
|
|
264
432
|
}
|
|
265
|
-
|
|
266
|
-
return
|
|
267
|
-
case
|
|
268
|
-
|
|
269
|
-
|
|
433
|
+
navigateToHome();
|
|
434
|
+
return _context5.abrupt("return");
|
|
435
|
+
case 19:
|
|
436
|
+
_context5.prev = 19;
|
|
437
|
+
_context5.next = 22;
|
|
270
438
|
return runModuleAction('setEntryPaxNumber', pax);
|
|
271
|
-
case
|
|
439
|
+
case 22:
|
|
272
440
|
markGate('paxEntered');
|
|
273
|
-
|
|
441
|
+
_context5.next = 28;
|
|
274
442
|
break;
|
|
275
|
-
case 20:
|
|
276
|
-
_context2.prev = 20;
|
|
277
|
-
_context2.t0 = _context2["catch"](14);
|
|
278
|
-
console.warn('[scanOrder] setOtherParams failed', _context2.t0);
|
|
279
|
-
case 23:
|
|
280
|
-
_context2.next = 25;
|
|
281
|
-
return enterProductStep();
|
|
282
443
|
case 25:
|
|
444
|
+
_context5.prev = 25;
|
|
445
|
+
_context5.t0 = _context5["catch"](19);
|
|
446
|
+
console.warn('[scanOrder] setOtherParams failed', _context5.t0);
|
|
447
|
+
case 28:
|
|
448
|
+
_context5.next = 30;
|
|
449
|
+
return enterProductStep();
|
|
450
|
+
case 30:
|
|
283
451
|
case "end":
|
|
284
|
-
return
|
|
452
|
+
return _context5.stop();
|
|
285
453
|
}
|
|
286
|
-
},
|
|
454
|
+
}, _callee5, null, [[19, 25]]);
|
|
287
455
|
}));
|
|
288
456
|
return function runEntryPaxGateThenEnterProduct() {
|
|
289
|
-
return
|
|
457
|
+
return _ref7.apply(this, arguments);
|
|
290
458
|
};
|
|
291
459
|
}();
|
|
292
460
|
var closePolicyAndBack = function closePolicyAndBack() {
|
|
@@ -348,16 +516,16 @@ function ReadyState() {
|
|
|
348
516
|
};
|
|
349
517
|
useEffect(function () {
|
|
350
518
|
var checkResourceAvailable = /*#__PURE__*/function () {
|
|
351
|
-
var
|
|
352
|
-
var hasOrderId, _yield$runModuleActio, mode, order_id, errorTips, policy, form, partyroom_booking, requestEntryPax, requestPaxMin, requestPaxMax, table_form_record, normalizedFormPayload, isAdditionalOrder, normalizedPolicyPayload, tips, content;
|
|
353
|
-
return _regeneratorRuntime().wrap(function
|
|
354
|
-
while (1) switch (
|
|
519
|
+
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
520
|
+
var hasOrderId, _yield$runModuleActio, mode, order_id, errorTips, policy, form, partyroom_booking, requestEntryPax, requestPaxMin, requestPaxMax, table_form_record, normalizedFormPayload, isAdditionalOrder, normalizedPolicyPayload, tips, _scanOrderModule$setU, content;
|
|
521
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
522
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
355
523
|
case 0:
|
|
356
524
|
hasOrderId = !!(entryContext !== null && entryContext !== void 0 && entryContext.order_id);
|
|
357
|
-
|
|
525
|
+
_context6.next = 3;
|
|
358
526
|
return runModuleAction('checkResourceAvailable', entryContext === null || entryContext === void 0 ? void 0 : entryContext.resource_id, hasOrderId);
|
|
359
527
|
case 3:
|
|
360
|
-
_yield$runModuleActio =
|
|
528
|
+
_yield$runModuleActio = _context6.sent;
|
|
361
529
|
mode = _yield$runModuleActio.mode;
|
|
362
530
|
order_id = _yield$runModuleActio.order_id;
|
|
363
531
|
errorTips = _yield$runModuleActio.errorTips;
|
|
@@ -378,14 +546,14 @@ function ReadyState() {
|
|
|
378
546
|
setEntryMode(isAdditionalOrder ? 'additional_order' : 'default');
|
|
379
547
|
// 资源空闲:按需依次弹 协议 -> 表单 -> 人数,最后进入商品选择
|
|
380
548
|
if (!(mode === 'idle')) {
|
|
381
|
-
|
|
549
|
+
_context6.next = 35;
|
|
382
550
|
break;
|
|
383
551
|
}
|
|
384
552
|
normalizedPolicyPayload = _typeof(policy) === 'object' && policy !== null ? policy : {
|
|
385
553
|
id: policy
|
|
386
554
|
}; // 步骤缓存:同一 resourceId 会话内已确认过协议则跳过
|
|
387
555
|
if (!(normalizedPolicyPayload !== null && normalizedPolicyPayload !== void 0 && normalizedPolicyPayload.id && !isGatePassed('policyAccepted'))) {
|
|
388
|
-
|
|
556
|
+
_context6.next = 28;
|
|
389
557
|
break;
|
|
390
558
|
}
|
|
391
559
|
setPendingFormPayload(normalizedFormPayload);
|
|
@@ -393,79 +561,96 @@ function ReadyState() {
|
|
|
393
561
|
open: true,
|
|
394
562
|
content: normalizedPolicyPayload
|
|
395
563
|
});
|
|
396
|
-
return
|
|
564
|
+
return _context6.abrupt("return");
|
|
397
565
|
case 28:
|
|
398
566
|
if (!(normalizedFormPayload && !isGatePassed('formSubmitted'))) {
|
|
399
|
-
|
|
567
|
+
_context6.next = 31;
|
|
400
568
|
break;
|
|
401
569
|
}
|
|
402
570
|
openFormModal(normalizedFormPayload);
|
|
403
|
-
return
|
|
571
|
+
return _context6.abrupt("return");
|
|
404
572
|
case 31:
|
|
405
|
-
|
|
573
|
+
_context6.next = 33;
|
|
406
574
|
return runEntryPaxGateThenEnterProduct();
|
|
407
575
|
case 33:
|
|
408
|
-
|
|
576
|
+
_context6.next = 48;
|
|
409
577
|
break;
|
|
410
578
|
case 35:
|
|
411
579
|
if (!isAdditionalOrder) {
|
|
412
|
-
|
|
413
|
-
break;
|
|
414
|
-
}
|
|
415
|
-
if (!hasOrderId) {
|
|
416
|
-
_context3.next = 41;
|
|
580
|
+
_context6.next = 40;
|
|
417
581
|
break;
|
|
418
582
|
}
|
|
419
|
-
|
|
583
|
+
_context6.next = 38;
|
|
420
584
|
return enterProductStep();
|
|
421
|
-
case
|
|
422
|
-
|
|
423
|
-
break;
|
|
424
|
-
case 41:
|
|
425
|
-
handleOrderDetail(order_id);
|
|
426
|
-
case 42:
|
|
427
|
-
_context3.next = 54;
|
|
585
|
+
case 38:
|
|
586
|
+
_context6.next = 48;
|
|
428
587
|
break;
|
|
429
|
-
case
|
|
588
|
+
case 40:
|
|
430
589
|
if (!(mode === 'submit_disabled')) {
|
|
431
|
-
|
|
590
|
+
_context6.next = 47;
|
|
432
591
|
break;
|
|
433
592
|
}
|
|
434
593
|
// 禁止下单模式:允许进入商品选择,但下一步按钮需被禁用,点击提示 errorTips
|
|
435
594
|
tips = resolveLocalizedText(errorTips) || String(locales.getText('pisell2.scan.order.submit.disabled.default') || '');
|
|
436
595
|
setSubmitDisabledTips(tips);
|
|
437
|
-
|
|
596
|
+
_context6.next = 45;
|
|
438
597
|
return enterProductStep();
|
|
439
|
-
case
|
|
440
|
-
|
|
598
|
+
case 45:
|
|
599
|
+
_context6.next = 48;
|
|
441
600
|
break;
|
|
442
|
-
case
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
601
|
+
case 47:
|
|
602
|
+
if (mode === 'resource_busy') {
|
|
603
|
+
// 如果资源是占用,则跳转到订单详情页
|
|
604
|
+
// 需要检测当前是否已经登录,如果未登录则先登录再跳转
|
|
605
|
+
// 若用户直接关闭登录弹窗(非登录成功),由于当前还卡在 initialize 步骤,
|
|
606
|
+
// 没有合法后续状态,统一兜底回首页避免卡死。
|
|
607
|
+
if (!isLogin) {
|
|
608
|
+
// 登录回流意图:登录成功后 hydrate 阶段消费 pendingStep,避免卡在 init
|
|
609
|
+
scanOrderModule === null || scanOrderModule === void 0 || (_scanOrderModule$setU = scanOrderModule.setUIState) === null || _scanOrderModule$setU === void 0 || _scanOrderModule$setU.call(scanOrderModule, 'pendingStep', currentStep);
|
|
610
|
+
openLoginModal({
|
|
611
|
+
callback: function callback(status) {
|
|
612
|
+
var _scanOrderModule$dele2;
|
|
613
|
+
if (status === 'success') {
|
|
614
|
+
var _scanOrderModule$dele;
|
|
615
|
+
scanOrderModule === null || scanOrderModule === void 0 || (_scanOrderModule$dele = scanOrderModule.deleteUIState) === null || _scanOrderModule$dele === void 0 || _scanOrderModule$dele.call(scanOrderModule, 'pendingStep');
|
|
616
|
+
handleOrderDetail(order_id);
|
|
617
|
+
return;
|
|
618
|
+
}
|
|
619
|
+
scanOrderModule === null || scanOrderModule === void 0 || (_scanOrderModule$dele2 = scanOrderModule.deleteUIState) === null || _scanOrderModule$dele2 === void 0 || _scanOrderModule$dele2.call(scanOrderModule, 'pendingStep');
|
|
620
|
+
location.replace('/');
|
|
621
|
+
}
|
|
622
|
+
});
|
|
448
623
|
} else {
|
|
449
|
-
|
|
624
|
+
handleOrderDetail(order_id);
|
|
450
625
|
}
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
626
|
+
} else {
|
|
627
|
+
// 其他情况,视为不在营业或者异常,返回异常提示
|
|
628
|
+
content = resolveLocalizedText(errorTips);
|
|
629
|
+
if (!content) {
|
|
630
|
+
if (mode === 'resource_block') {
|
|
631
|
+
content = String(locales.getText('pisell2.scan.order.resource.status.exception') || '');
|
|
632
|
+
} else {
|
|
633
|
+
content = String(locales.getText('pisell2.scan.order.store.status.exception') || '');
|
|
634
|
+
}
|
|
459
635
|
}
|
|
460
|
-
|
|
461
|
-
|
|
636
|
+
Modal.info({
|
|
637
|
+
title: locales.getText('pisell2.scan.order.step.error'),
|
|
638
|
+
content: resolveLocalizedText(content).trim(),
|
|
639
|
+
okText: String(locales.getText('pisell2.event.confirm') || 'OK'),
|
|
640
|
+
maskClosable: false,
|
|
641
|
+
onOk: function onOk() {
|
|
642
|
+
location.replace('/');
|
|
643
|
+
}
|
|
644
|
+
});
|
|
645
|
+
}
|
|
646
|
+
case 48:
|
|
462
647
|
case "end":
|
|
463
|
-
return
|
|
648
|
+
return _context6.stop();
|
|
464
649
|
}
|
|
465
|
-
},
|
|
650
|
+
}, _callee6);
|
|
466
651
|
}));
|
|
467
652
|
return function checkResourceAvailable() {
|
|
468
|
-
return
|
|
653
|
+
return _ref8.apply(this, arguments);
|
|
469
654
|
};
|
|
470
655
|
}();
|
|
471
656
|
// 等 ScanOrderProvider 的步骤缓存 hydrate 完成再跑,确保 gate 标记已就位
|
|
@@ -494,7 +679,9 @@ function ReadyState() {
|
|
|
494
679
|
product: /*#__PURE__*/React.createElement(Menu, {
|
|
495
680
|
onCheckout: function onCheckout() {
|
|
496
681
|
return goToStep('check');
|
|
497
|
-
}
|
|
682
|
+
},
|
|
683
|
+
productList: productList,
|
|
684
|
+
onEnsureProductList: ensureProductListLoaded
|
|
498
685
|
}),
|
|
499
686
|
check: /*#__PURE__*/React.createElement(Check, null),
|
|
500
687
|
error: /*#__PURE__*/React.createElement(ErrorState, {
|
|
@@ -564,22 +751,22 @@ function ReadyState() {
|
|
|
564
751
|
|
|
565
752
|
// 跳转到订单确认页
|
|
566
753
|
var gotoCheckOrder = /*#__PURE__*/function () {
|
|
567
|
-
var
|
|
754
|
+
var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
|
|
568
755
|
var _otherParams$dineInCo;
|
|
569
|
-
var firstFailure, failedProductIds, failureTips, otherParams, dineInConfig, isPauseOrder, _dineInConfig$availab;
|
|
570
|
-
return _regeneratorRuntime().wrap(function
|
|
571
|
-
while (1) switch (
|
|
756
|
+
var firstFailure, failedProductIds, failureTips, otherParams, dineInConfig, isPauseOrder, _dineInConfig$availab, _scanOrderModule$setU2;
|
|
757
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
758
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
572
759
|
case 0:
|
|
573
760
|
if (!submitDisabledTips) {
|
|
574
|
-
|
|
761
|
+
_context7.next = 3;
|
|
575
762
|
break;
|
|
576
763
|
}
|
|
577
764
|
message.warning(submitDisabledTips, 2);
|
|
578
|
-
return
|
|
765
|
+
return _context7.abrupt("return");
|
|
579
766
|
case 3:
|
|
580
767
|
firstFailure = Array.isArray(cartValidation === null || cartValidation === void 0 ? void 0 : cartValidation.failures) ? cartValidation.failures[0] : null;
|
|
581
768
|
if (!((cartValidation === null || cartValidation === void 0 ? void 0 : cartValidation.passed) === false)) {
|
|
582
|
-
|
|
769
|
+
_context7.next = 10;
|
|
583
770
|
break;
|
|
584
771
|
}
|
|
585
772
|
failedProductIds = getFirstFailedProductIds();
|
|
@@ -588,17 +775,17 @@ function ReadyState() {
|
|
|
588
775
|
}
|
|
589
776
|
failureTips = String((firstFailure === null || firstFailure === void 0 ? void 0 : firstFailure.validationMessage) || '').trim();
|
|
590
777
|
message.warning(failureTips, 2);
|
|
591
|
-
return
|
|
778
|
+
return _context7.abrupt("return");
|
|
592
779
|
case 10:
|
|
593
|
-
|
|
780
|
+
_context7.next = 12;
|
|
594
781
|
return runModuleAction('getOtherParams');
|
|
595
782
|
case 12:
|
|
596
|
-
otherParams =
|
|
783
|
+
otherParams = _context7.sent;
|
|
597
784
|
console.log('otherParams >>>>> ', otherParams);
|
|
598
785
|
dineInConfig = (_otherParams$dineInCo = otherParams === null || otherParams === void 0 ? void 0 : otherParams.dineInConfig) !== null && _otherParams$dineInCo !== void 0 ? _otherParams$dineInCo : {};
|
|
599
786
|
isPauseOrder = dineInConfig === null || dineInConfig === void 0 ? void 0 : dineInConfig['availability.paused']; // 如果暂停接单直接弹提示,点完确定回首页
|
|
600
787
|
if (!isPauseOrder) {
|
|
601
|
-
|
|
788
|
+
_context7.next = 19;
|
|
602
789
|
break;
|
|
603
790
|
}
|
|
604
791
|
Modal.info({
|
|
@@ -609,28 +796,33 @@ function ReadyState() {
|
|
|
609
796
|
location.replace('/');
|
|
610
797
|
}
|
|
611
798
|
});
|
|
612
|
-
return
|
|
799
|
+
return _context7.abrupt("return");
|
|
613
800
|
case 19:
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
callback: function callback(status) {
|
|
618
|
-
if (status === 'success') {
|
|
619
|
-
goToStep('check');
|
|
620
|
-
}
|
|
621
|
-
}
|
|
622
|
-
});
|
|
623
|
-
} else {
|
|
624
|
-
goToStep('check');
|
|
801
|
+
if (isLogin) {
|
|
802
|
+
_context7.next = 23;
|
|
803
|
+
break;
|
|
625
804
|
}
|
|
626
|
-
|
|
805
|
+
// 登录前落盘跳转意图:弹窗 callback 能触发时由本函数消费,
|
|
806
|
+
// 整页跳转回流时由 Provider 的 hydrate 消费(参见 venueBooking 同名实现)
|
|
807
|
+
scanOrderModule === null || scanOrderModule === void 0 || (_scanOrderModule$setU2 = scanOrderModule.setUIState) === null || _scanOrderModule$setU2 === void 0 || _scanOrderModule$setU2.call(scanOrderModule, 'pendingStep', 'check');
|
|
808
|
+
openLoginModal({
|
|
809
|
+
callback: function callback(status) {
|
|
810
|
+
var _scanOrderModule$dele3;
|
|
811
|
+
scanOrderModule === null || scanOrderModule === void 0 || (_scanOrderModule$dele3 = scanOrderModule.deleteUIState) === null || _scanOrderModule$dele3 === void 0 || _scanOrderModule$dele3.call(scanOrderModule, 'pendingStep');
|
|
812
|
+
if (status === 'success') goToStep('check');
|
|
813
|
+
}
|
|
814
|
+
});
|
|
815
|
+
return _context7.abrupt("return");
|
|
816
|
+
case 23:
|
|
817
|
+
goToStep('check');
|
|
818
|
+
case 24:
|
|
627
819
|
case "end":
|
|
628
|
-
return
|
|
820
|
+
return _context7.stop();
|
|
629
821
|
}
|
|
630
|
-
},
|
|
822
|
+
}, _callee7);
|
|
631
823
|
}));
|
|
632
824
|
return function gotoCheckOrder() {
|
|
633
|
-
return
|
|
825
|
+
return _ref9.apply(this, arguments);
|
|
634
826
|
};
|
|
635
827
|
}();
|
|
636
828
|
var isMobileView = isMobile();
|