@pisell/private-materials 6.12.228 → 6.12.230
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 +2 -2
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +2 -2
- package/es/components/HDLKiosk/app/manifest.js +16 -1
- package/es/components/HDLKiosk/docs/00-/346/226/207/344/273/266/345/257/274/350/210/252.md +2 -2
- package/es/components/HDLKiosk/docs/04-/350/256/276/345/244/207/344/270/216/347/247/260/351/207/215.md +15 -31
- package/es/components/HDLKiosk/docs/08-/346/227/240/345/244/264Application/350/277/220/350/241/214/346/227/266/351/207/215/346/236/204/350/256/276/350/256/241.md +1 -1
- package/es/components/HDLKiosk/kernel/application/defineApplication.js +24 -10
- package/es/components/HDLKiosk/kernel/application/defineSlice.js +3 -1
- package/es/components/HDLKiosk/kernel/application/runtime.js +16 -12
- package/es/components/HDLKiosk/kernel/workflow/actor.js +11 -2
- package/es/components/HDLKiosk/locales.js +30 -0
- package/es/components/HDLKiosk/runtime/admissionPolicy.js +2 -2
- package/es/components/HDLKiosk/runtime/application.js +2 -1
- package/es/components/HDLKiosk/runtime/devices/scannerSessionPort.js +2 -1
- package/es/components/HDLKiosk/runtime/devices/scannerSessionRouter.js +36 -8
- package/es/components/HDLKiosk/runtime/operations/writes.js +4 -1
- package/es/components/HDLKiosk/runtime/session/createSession.js +24 -3
- package/es/components/HDLKiosk/slices/catalog/Screen/index.js +4 -8
- package/es/components/HDLKiosk/slices/catalog/slice.js +2 -2
- package/es/components/HDLKiosk/slices/customization/Screen/index.js +24 -20
- package/es/components/HDLKiosk/slices/customization/Screen/index.less +0 -18
- package/es/components/HDLKiosk/slices/identity/Screen/index.js +16 -2
- package/es/components/HDLKiosk/slices/identity/slice.js +2 -0
- package/es/components/HDLKiosk/slices/identity/view.js +9 -6
- package/es/components/HDLKiosk/slices/primaryProductPrompt/slice.js +3 -3
- package/es/components/HDLKiosk/ui/HDLKioskWorkflowView.js +18 -0
- package/es/components/HDLKiosk/ui/controllers/useHDLKioskCustomerController.js +2 -7
- package/es/components/HDLKiosk/utils.js +6 -11
- package/es/components/bigSale/components/BookingFloatingPanel/useBookingPanelController.js +1 -0
- package/es/components/bigSale/components/TimeBar/index.js +1 -0
- package/es/components/bigSale/dialog.js +1 -0
- package/es/components/bigSale/hooks/useBigSaleContext.js +1 -0
- package/es/components/bigSale/hooks/useSelectFloorMapResourceForBigSale.js +1 -0
- package/es/components/bigSale/index.js +1 -0
- package/es/components/bigSale/templates/HDLKiosk/adapter/createHost.js +2 -1
- package/es/components/bigSale/templates/HDLKiosk/adapter/sales/cart.js +6 -2
- package/es/components/bigSale/templates/HDLKiosk/adapter/sales/index.js +4 -14
- package/es/components/bigSale/templates/HDLKiosk/hooks/useBigSaleHDLKioskAdapter.js +28 -4
- package/es/components/bigSale/templates/HDLKiosk/index.js +1 -1
- package/es/components/bigSale/templates/HDLKiosk/utils/transactionState.js +12 -12
- package/es/components/bigSale/templates/Kiosk/index.js +1 -0
- package/es/components/sharedSecondaryBigSale/SharedSecondaryBigSaleReceiver.js +1 -0
- package/es/index.js +2 -0
- package/es/plus/multiCurrencySettlement/index.js +1 -1
- package/es/plus/pisellReservation/data/bookingToReservationTables.js +1 -1
- package/es/plus/pisellReservation/floorMap/floorPlanApi.js +1 -1
- package/es/plus/pisellReservation/floorMap/reservationMock.js +1 -1
- package/es/plus/pisellReservation/index.js +17 -0
- package/es/plus/saasDevice/devicePasscodes/model.js +4 -4
- package/es/plus/saleDetail/Base.js +1 -0
- package/es/plus/saleDetail/components/Client/hooks/useClientSelectorProps.js +1 -0
- package/es/plus/saleDetail/components/DetailActions/PrintAction.js +1 -0
- package/es/plus/saleDetail/components/DetailActions/index.js +1 -0
- package/es/plus/saleDetail/components/SummaryFinancialSections/index.js +1 -0
- package/es/plus/saleDetail/index.js +1 -0
- package/es/plus/saleDetail/tmpl/B/components/Dish/index.js +1 -0
- package/es/plus/saleDetail/tmpl/B/index.js +1 -0
- package/es/plus/salesSdk/context/SalesSdkProvider.js +20 -1
- package/es/plus/salesSdk/hooks/useSalesSdkTempOrderSync.js +117 -27
- package/es/plus/salesSdk/index.js +53 -0
- package/es/plus/salesSdk/utils/addProductWithFlowDebounced.js +1 -1
- package/es/plus/salesSdk/utils/bookingDate.js +1 -1
- package/es/plus/salesSdk/utils/enrichCartLineHolderDisplay.js +1 -1
- package/es/plus/walletPassGallery/components/timelineSection/index.js +4 -4
- package/es/pro/Login2.0/AuthModal.d.ts +1 -1
- package/es/pro/Login2.0/index.d.ts +2 -2
- package/es/pro/Login2.0/shared/types.d.ts +1 -1
- package/lib/components/HDLKiosk/app/manifest.js +16 -1
- package/lib/components/HDLKiosk/docs/00-/346/226/207/344/273/266/345/257/274/350/210/252.md +2 -2
- package/lib/components/HDLKiosk/docs/04-/350/256/276/345/244/207/344/270/216/347/247/260/351/207/215.md +15 -31
- package/lib/components/HDLKiosk/docs/08-/346/227/240/345/244/264Application/350/277/220/350/241/214/346/227/266/351/207/215/346/236/204/350/256/276/350/256/241.md +1 -1
- package/lib/components/HDLKiosk/kernel/application/defineApplication.js +24 -10
- package/lib/components/HDLKiosk/kernel/application/defineSlice.js +3 -0
- package/lib/components/HDLKiosk/kernel/application/runtime.js +16 -12
- package/lib/components/HDLKiosk/kernel/workflow/actor.js +11 -2
- package/lib/components/HDLKiosk/locales.js +30 -0
- package/lib/components/HDLKiosk/runtime/admissionPolicy.js +2 -2
- package/lib/components/HDLKiosk/runtime/application.js +2 -1
- package/lib/components/HDLKiosk/runtime/devices/scannerSessionPort.js +2 -1
- package/lib/components/HDLKiosk/runtime/devices/scannerSessionRouter.js +36 -8
- package/lib/components/HDLKiosk/runtime/operations/writes.js +4 -1
- package/lib/components/HDLKiosk/runtime/session/createSession.js +24 -3
- package/lib/components/HDLKiosk/slices/catalog/Screen/index.js +4 -8
- package/lib/components/HDLKiosk/slices/catalog/slice.js +1 -1
- package/lib/components/HDLKiosk/slices/customization/Screen/index.js +24 -20
- package/lib/components/HDLKiosk/slices/customization/Screen/index.less +0 -18
- package/lib/components/HDLKiosk/slices/identity/Screen/index.js +16 -2
- package/lib/components/HDLKiosk/slices/identity/slice.js +2 -0
- package/lib/components/HDLKiosk/slices/identity/view.js +9 -6
- package/lib/components/HDLKiosk/slices/primaryProductPrompt/slice.js +2 -2
- package/lib/components/HDLKiosk/ui/HDLKioskWorkflowView.js +20 -2
- package/lib/components/HDLKiosk/ui/controllers/useHDLKioskCustomerController.js +2 -7
- package/lib/components/HDLKiosk/utils.js +8 -13
- package/lib/components/bigSale/templates/HDLKiosk/adapter/createHost.js +2 -1
- package/lib/components/bigSale/templates/HDLKiosk/adapter/sales/cart.js +6 -2
- package/lib/components/bigSale/templates/HDLKiosk/adapter/sales/index.js +4 -14
- package/lib/components/bigSale/templates/HDLKiosk/hooks/useBigSaleHDLKioskAdapter.js +28 -4
- package/lib/components/bigSale/templates/HDLKiosk/index.js +1 -1
- package/lib/components/bigSale/templates/HDLKiosk/utils/transactionState.js +12 -12
- package/lib/plus/salesSdk/context/SalesSdkProvider.js +20 -1
- package/lib/plus/salesSdk/hooks/useSalesSdkTempOrderSync.js +117 -27
- package/package.json +2 -2
- package/es/private-materials/lowcode/authmodal/meta.d.ts +0 -1
|
@@ -10,6 +10,8 @@ function createScannerSessionRouter({ host, entrySupported, maxPendingEvents = 5
|
|
|
10
10
|
let queue = [];
|
|
11
11
|
let currentTask;
|
|
12
12
|
let processing = false;
|
|
13
|
+
let sessionReady = false;
|
|
14
|
+
let resolving;
|
|
13
15
|
let generation = 0;
|
|
14
16
|
let rejectionSequence = 0;
|
|
15
17
|
const emitRejected = (task, reason) => {
|
|
@@ -49,7 +51,7 @@ function createScannerSessionRouter({ host, entrySupported, maxPendingEvents = 5
|
|
|
49
51
|
};
|
|
50
52
|
const processQueue = function() {
|
|
51
53
|
var _ref = require_asyncToGenerator._asyncToGenerator(function* () {
|
|
52
|
-
if (processing || phase !== "active" || !listening || !session) return;
|
|
54
|
+
if (processing || !sessionReady || phase !== "active" || !listening || !session) return;
|
|
53
55
|
processing = true;
|
|
54
56
|
const processGeneration = generation;
|
|
55
57
|
try {
|
|
@@ -170,16 +172,32 @@ function createScannerSessionRouter({ host, entrySupported, maxPendingEvents = 5
|
|
|
170
172
|
emitRejected(task, "sessionStartConflict");
|
|
171
173
|
return;
|
|
172
174
|
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
if (
|
|
175
|
+
const controller = new AbortController();
|
|
176
|
+
resolving = controller;
|
|
177
|
+
require_asyncToGenerator._asyncToGenerator(function* () {
|
|
178
|
+
const kind = yield host.sales.resolveBarcode(task.code, controller.signal);
|
|
179
|
+
if (controller.signal.aborted) return;
|
|
180
|
+
if (!kind) {
|
|
181
|
+
closeStart("barcodeNotResolved");
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
const product = kind === "product" || kind === "local_product";
|
|
185
|
+
if (!product && kind !== "wallet" && kind !== "walletPass" && kind !== "customer") {
|
|
186
|
+
closeStart("barcodeTypeUnsupported");
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
return emit({
|
|
190
|
+
channel: product ? "product" : "identity",
|
|
191
|
+
occurrenceId: result.event.eventId,
|
|
192
|
+
correlationId: startId
|
|
193
|
+
});
|
|
194
|
+
})().then((startResult) => {
|
|
195
|
+
if ((startResult === null || startResult === void 0 ? void 0 : startResult.status) === "rejected") closeStart(startResult.reason);
|
|
179
196
|
}).catch(() => closeStart("sessionStartFailed"));
|
|
180
197
|
}, { sources: ["scanner"] });
|
|
181
198
|
return () => {
|
|
182
199
|
listening = false;
|
|
200
|
+
resolving === null || resolving === void 0 || resolving.abort();
|
|
183
201
|
generation += 1;
|
|
184
202
|
rejectQueue("inactive");
|
|
185
203
|
if (phase === "starting" && activeStartId) failSessionStart(activeStartId, "inactive");
|
|
@@ -192,11 +210,20 @@ function createScannerSessionRouter({ host, entrySupported, maxPendingEvents = 5
|
|
|
192
210
|
if (phase !== "starting" || activeStartId !== startId) throw new Error(`Scanner Session attach conflict: ${startId}`);
|
|
193
211
|
activeStartId = void 0;
|
|
194
212
|
session = nextSession;
|
|
213
|
+
sessionReady = !nextSession.whenReady;
|
|
195
214
|
phase = "active";
|
|
196
215
|
let detached = false;
|
|
197
216
|
return Object.freeze({
|
|
198
217
|
activate: () => {
|
|
199
|
-
|
|
218
|
+
if (!nextSession.whenReady) {
|
|
219
|
+
processQueue();
|
|
220
|
+
return;
|
|
221
|
+
}
|
|
222
|
+
nextSession.whenReady().then(() => {
|
|
223
|
+
if (detached || session !== nextSession) return;
|
|
224
|
+
sessionReady = true;
|
|
225
|
+
processQueue();
|
|
226
|
+
});
|
|
200
227
|
},
|
|
201
228
|
dispose: () => {
|
|
202
229
|
if (detached || session !== nextSession) return;
|
|
@@ -212,6 +239,7 @@ function createScannerSessionRouter({ host, entrySupported, maxPendingEvents = 5
|
|
|
212
239
|
},
|
|
213
240
|
dispose: () => {
|
|
214
241
|
if (phase === "disposed") return;
|
|
242
|
+
resolving === null || resolving === void 0 || resolving.abort();
|
|
215
243
|
generation += 1;
|
|
216
244
|
rejectQueue("inactive");
|
|
217
245
|
activeStartId = void 0;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
const require_asyncToGenerator = require("../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js");
|
|
2
|
+
const require_selectors = require("../../../../plus/salesSdk/selectors.js");
|
|
2
3
|
const require_errors = require("./errors.js");
|
|
3
4
|
const require_operations = require("../../app/operations.js");
|
|
4
5
|
const require_types = require("./types.js");
|
|
5
6
|
//#region src/components/HDLKiosk/runtime/operations/writes.ts
|
|
7
|
+
/** 集中实现订单会话、客户、履约、扫码和普通购物车写入。 */
|
|
6
8
|
function forwardFailure(result) {
|
|
7
9
|
return result;
|
|
8
10
|
}
|
|
@@ -57,7 +59,7 @@ const sessionResetOperationBinding = require_types.bindOperation(require_operati
|
|
|
57
59
|
safety: "session-reset"
|
|
58
60
|
});
|
|
59
61
|
function identityMatches(customerId, customer) {
|
|
60
|
-
return customerId ? (customer === null || customer === void 0 ? void 0 : customer.
|
|
62
|
+
return customerId ? !require_selectors.isWalkInCustomer(customer) && String(customer === null || customer === void 0 ? void 0 : customer.id) === customerId : require_selectors.isWalkInCustomer(customer);
|
|
61
63
|
}
|
|
62
64
|
const identitySyncOperationBinding = require_types.bindOperation(require_operations.identitySyncOperation, { execute: function() {
|
|
63
65
|
var _ref = require_asyncToGenerator._asyncToGenerator(function* (context, input, signal) {
|
|
@@ -97,6 +99,7 @@ const barcodeConsumeOperationBinding = require_types.bindOperation(require_opera
|
|
|
97
99
|
const mutation = yield context.host.sales.consumeBarcode(input.code, signal);
|
|
98
100
|
if (mutation.status !== "succeeded") return mutation;
|
|
99
101
|
if (mutation.data.code === "requiresSelection") return mutation;
|
|
102
|
+
if (mutation.data.code === "handled") return mutation;
|
|
100
103
|
if (mutation.data.code !== "added" || mutation.data.cartChangeConfirmed !== true) return require_errors.operationUnknown("barcodeWriteNotConfirmed");
|
|
101
104
|
return finalizeCartMutation(context, mutation, signal);
|
|
102
105
|
});
|
|
@@ -20,7 +20,11 @@ let _pisell_utils = require("@pisell/utils");
|
|
|
20
20
|
* 边界:每次会话创建一次;不持有 React UI,也不复用上一单 Actor。
|
|
21
21
|
*/
|
|
22
22
|
function createHDLKioskWorkflowSession(entry, host, options = {}) {
|
|
23
|
-
var _options$initialConte, _options$lifecycleExt, _options$
|
|
23
|
+
var _options$initialConte, _options$lifecycleExt, _options$cause2, _options$sessionId;
|
|
24
|
+
let markPresented;
|
|
25
|
+
const presented = new Promise((resolve) => {
|
|
26
|
+
markPresented = resolve;
|
|
27
|
+
});
|
|
24
28
|
const operations = require_registry.createHDLKioskOperationRegistry();
|
|
25
29
|
const initialContext = (_options$initialConte = options.initialContext) !== null && _options$initialConte !== void 0 ? _options$initialConte : Object.freeze({
|
|
26
30
|
entry,
|
|
@@ -35,7 +39,13 @@ function createHDLKioskWorkflowSession(entry, host, options = {}) {
|
|
|
35
39
|
initialContext,
|
|
36
40
|
reduceContext: require_workflowContext.reduceHDLKioskWorkflowContext,
|
|
37
41
|
lifecycle: require_lifecycle.composeWorkflowLifecycles([require_workflowLifecycle.createHDLKioskWorkflowLifecycle(host), ...(_options$lifecycleExt = options.lifecycleExtensions) !== null && _options$lifecycleExt !== void 0 ? _options$lifecycleExt : []]),
|
|
38
|
-
navigationContext: (request) =>
|
|
42
|
+
navigationContext: (request) => {
|
|
43
|
+
var _options$cause;
|
|
44
|
+
return require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, request), {}, {
|
|
45
|
+
sales: host.sales.readTransactionState(),
|
|
46
|
+
identity: { scanEntry: entry === "quick" && ((_options$cause = options.cause) === null || _options$cause === void 0 ? void 0 : _options$cause.trigger) === "onScan" }
|
|
47
|
+
});
|
|
48
|
+
},
|
|
39
49
|
createExecution: ({ definition, getSnapshot }) => {
|
|
40
50
|
coordinator = require_coordinator.createOperationCoordinator(host, operations, {
|
|
41
51
|
checkoutRequirementIds: definition.requirements,
|
|
@@ -191,7 +201,7 @@ function createHDLKioskWorkflowSession(entry, host, options = {}) {
|
|
|
191
201
|
throw error;
|
|
192
202
|
}
|
|
193
203
|
const sessionSnapshot = workflowActor.getSnapshot();
|
|
194
|
-
const cause = (_options$
|
|
204
|
+
const cause = (_options$cause2 = options.cause) !== null && _options$cause2 !== void 0 ? _options$cause2 : Object.freeze({
|
|
195
205
|
trigger: "manual",
|
|
196
206
|
channel: definition.id,
|
|
197
207
|
occurrenceId: `${definition.id}:${sessionSnapshot.sessionEpoch}`,
|
|
@@ -214,6 +224,7 @@ function createHDLKioskWorkflowSession(entry, host, options = {}) {
|
|
|
214
224
|
const disposeSession = () => {
|
|
215
225
|
if (disposed) return;
|
|
216
226
|
disposed = true;
|
|
227
|
+
markPresented();
|
|
217
228
|
unsubscribePaymentWorkflow();
|
|
218
229
|
unsubscribeStaffPayment();
|
|
219
230
|
workflowActor.dispose();
|
|
@@ -224,6 +235,16 @@ function createHDLKioskWorkflowSession(entry, host, options = {}) {
|
|
|
224
235
|
workflowId: definition.id,
|
|
225
236
|
cause,
|
|
226
237
|
entry,
|
|
238
|
+
markPresented,
|
|
239
|
+
whenPresented: () => presented,
|
|
240
|
+
settleScan: () => {
|
|
241
|
+
var _definition$nodes$sna4;
|
|
242
|
+
const snapshot = workflowActor.getSnapshot();
|
|
243
|
+
if (!disposed && snapshot.status === "idle" && ((_definition$nodes$sna4 = definition.nodes[snapshot.nodeId]) === null || _definition$nodes$sna4 === void 0 ? void 0 : _definition$nodes$sna4.activity) === "identity") workflowActor.navigate({
|
|
244
|
+
kind: "step",
|
|
245
|
+
stepId: snapshot.nodeId
|
|
246
|
+
}, "scan:settled");
|
|
247
|
+
},
|
|
227
248
|
definition,
|
|
228
249
|
actor: publicActor,
|
|
229
250
|
dispatch: (event) => workflowActor.send(event),
|
|
@@ -141,15 +141,11 @@ function CatalogScreen({ products, currencySymbol, loading, errorReference, erro
|
|
|
141
141
|
}, [errorReference]);
|
|
142
142
|
const title = normalizedQuery ? _pisell_utils.locales.getText("pisell2.hdl-kiosk.catalog-search-results") : (activeCategory === null || activeCategory === void 0 ? void 0 : activeCategory.name) || _pisell_utils.locales.getText("pisell2.hdl-kiosk.catalog-title");
|
|
143
143
|
const completeCatalog = (0, react.useCallback)(() => {
|
|
144
|
-
if (!busy
|
|
144
|
+
if (!busy) send({
|
|
145
145
|
kind: "resolution",
|
|
146
146
|
resolution: "complete"
|
|
147
147
|
});
|
|
148
|
-
}, [
|
|
149
|
-
busy,
|
|
150
|
-
canReview,
|
|
151
|
-
send
|
|
152
|
-
]);
|
|
148
|
+
}, [busy, send]);
|
|
153
149
|
const primaryActionLabel = _pisell_utils.locales.getText("pisell2.hdl-kiosk.cart-drawer-next");
|
|
154
150
|
const { openCart } = require_index$3.useHDLKioskBottomBarController();
|
|
155
151
|
require_index$3.useHDLKioskBottomBar((0, react.useMemo)(() => {
|
|
@@ -178,7 +174,7 @@ function CatalogScreen({ products, currencySymbol, loading, errorReference, erro
|
|
|
178
174
|
trailing: /* @__PURE__ */ react.default.createElement("button", {
|
|
179
175
|
type: "button",
|
|
180
176
|
className: "hdl-floating-bar__button hdl-catalog-next",
|
|
181
|
-
disabled: busy
|
|
177
|
+
disabled: busy,
|
|
182
178
|
onClick: completeCatalog
|
|
183
179
|
}, /* @__PURE__ */ react.default.createElement("span", null, primaryActionLabel), /* @__PURE__ */ react.default.createElement(NextIcon, null)),
|
|
184
180
|
cartOpenBar: (controller) => ({
|
|
@@ -192,7 +188,7 @@ function CatalogScreen({ products, currencySymbol, loading, errorReference, erro
|
|
|
192
188
|
trailing: /* @__PURE__ */ react.default.createElement("button", {
|
|
193
189
|
type: "button",
|
|
194
190
|
className: "hdl-floating-bar__button hdl-catalog-next",
|
|
195
|
-
disabled: busy
|
|
191
|
+
disabled: busy,
|
|
196
192
|
onClick: () => {
|
|
197
193
|
controller.onClose();
|
|
198
194
|
completeCatalog();
|
|
@@ -10,7 +10,7 @@ const catalogSlice = require_defineSlice.defineSlice({
|
|
|
10
10
|
updateQuantity: require_operations.cartUpdateQuantityOperation,
|
|
11
11
|
removeLine: require_operations.cartRemoveLineOperation
|
|
12
12
|
},
|
|
13
|
-
resolutions: { complete: require_defineSlice.
|
|
13
|
+
resolutions: { complete: require_defineSlice.accept() }
|
|
14
14
|
});
|
|
15
15
|
//#endregion
|
|
16
16
|
exports.catalogSlice = catalogSlice;
|
|
@@ -168,7 +168,7 @@ function ProductFallback() {
|
|
|
168
168
|
})));
|
|
169
169
|
}
|
|
170
170
|
function CustomizationScreen({ product, loading, errorReference, errorMessage, busy, syncing, canGoBack, minimumWeightKg, orderBar, send }) {
|
|
171
|
-
var _productFacts$product, _orderBar$primaryLine, _orderBar$primaryLine2, _orderBar$primaryLine3, _orderBar$primaryLine4, _orderBar$primaryLine7, _productFacts$unitPri, _orderBar$primaryLine9
|
|
171
|
+
var _productFacts$product, _orderBar$primaryLine, _orderBar$primaryLine2, _orderBar$primaryLine3, _orderBar$primaryLine4, _orderBar$primaryLine7, _productFacts$unitPri, _orderBar$primaryLine9;
|
|
172
172
|
const Toast = (0, _pisell_materials.useToast)();
|
|
173
173
|
const scaleRuntime = require_scale.useHDLScaleRuntime();
|
|
174
174
|
const scale = require_scale.useHDLScaleSnapshot();
|
|
@@ -261,14 +261,21 @@ function CustomizationScreen({ product, loading, errorReference, errorMessage, b
|
|
|
261
261
|
syncing,
|
|
262
262
|
Toast
|
|
263
263
|
]);
|
|
264
|
-
const
|
|
265
|
-
|
|
264
|
+
const skipCustomization = (0, react.useCallback)(() => {
|
|
265
|
+
if (busy || syncing) return;
|
|
266
266
|
send({
|
|
267
267
|
kind: "resolution",
|
|
268
268
|
resolution: "omit",
|
|
269
|
-
operationInput: {
|
|
269
|
+
operationInput: {}
|
|
270
270
|
});
|
|
271
|
-
}, [
|
|
271
|
+
}, [
|
|
272
|
+
busy,
|
|
273
|
+
send,
|
|
274
|
+
syncing
|
|
275
|
+
]);
|
|
276
|
+
const isWeighing = measurement.gross.greaterThan(0);
|
|
277
|
+
const advance = isWeighing ? submit : skipCustomization;
|
|
278
|
+
const advanceLabel = _pisell_utils.locales.getText(isWeighing ? "pisell2.hdl-kiosk.customization-next" : "pisell2.hdl-kiosk.skip");
|
|
272
279
|
const { openCart } = require_index.useHDLKioskBottomBarController();
|
|
273
280
|
require_index.useHDLKioskBottomBar((0, react.useMemo)(() => {
|
|
274
281
|
var _orderBar$cartItemCou;
|
|
@@ -295,9 +302,9 @@ function CustomizationScreen({ product, loading, errorReference, errorMessage, b
|
|
|
295
302
|
trailing: /* @__PURE__ */ react.default.createElement("button", {
|
|
296
303
|
type: "button",
|
|
297
304
|
className: "hdl-floating-bar__button hdl-customization-next",
|
|
298
|
-
disabled: busy || syncing || loading || !productFacts,
|
|
299
|
-
onClick:
|
|
300
|
-
}, /* @__PURE__ */ react.default.createElement("span", null, busy || syncing ? _pisell_utils.locales.getText("pisell2.hdl-kiosk.working") :
|
|
305
|
+
disabled: busy || syncing || isWeighing && (loading || !productFacts),
|
|
306
|
+
onClick: advance
|
|
307
|
+
}, /* @__PURE__ */ react.default.createElement("span", null, busy || syncing ? _pisell_utils.locales.getText("pisell2.hdl-kiosk.working") : advanceLabel), /* @__PURE__ */ react.default.createElement(NextIcon, null)),
|
|
301
308
|
cartOpenBar: (controller) => ({
|
|
302
309
|
ariaLabel: _pisell_utils.locales.getText("pisell2.hdl-kiosk.customization-actions-label"),
|
|
303
310
|
leading: /* @__PURE__ */ react.default.createElement("button", {
|
|
@@ -309,12 +316,12 @@ function CustomizationScreen({ product, loading, errorReference, errorMessage, b
|
|
|
309
316
|
trailing: /* @__PURE__ */ react.default.createElement("button", {
|
|
310
317
|
type: "button",
|
|
311
318
|
className: "hdl-floating-bar__button hdl-customization-next",
|
|
312
|
-
disabled: busy || syncing || loading || !productFacts,
|
|
319
|
+
disabled: busy || syncing || isWeighing && (loading || !productFacts),
|
|
313
320
|
onClick: () => {
|
|
314
321
|
controller.onClose();
|
|
315
|
-
|
|
322
|
+
advance();
|
|
316
323
|
}
|
|
317
|
-
}, /* @__PURE__ */ react.default.createElement("span", null, _pisell_utils.locales.getText("pisell2.hdl-kiosk.
|
|
324
|
+
}, /* @__PURE__ */ react.default.createElement("span", null, busy || syncing ? _pisell_utils.locales.getText("pisell2.hdl-kiosk.working") : advanceLabel), /* @__PURE__ */ react.default.createElement(NextIcon, null))
|
|
318
325
|
})
|
|
319
326
|
};
|
|
320
327
|
}, [
|
|
@@ -322,12 +329,14 @@ function CustomizationScreen({ product, loading, errorReference, errorMessage, b
|
|
|
322
329
|
canGoBack,
|
|
323
330
|
syncing,
|
|
324
331
|
amountText,
|
|
332
|
+
advance,
|
|
333
|
+
advanceLabel,
|
|
334
|
+
isWeighing,
|
|
335
|
+
productFacts,
|
|
325
336
|
loading,
|
|
326
337
|
openCart,
|
|
327
338
|
orderBar.cartLineCount,
|
|
328
|
-
|
|
329
|
-
send,
|
|
330
|
-
submit
|
|
339
|
+
send
|
|
331
340
|
]));
|
|
332
341
|
return /* @__PURE__ */ react.default.createElement("section", {
|
|
333
342
|
className: "hdl-customization-screen",
|
|
@@ -350,12 +359,7 @@ function CustomizationScreen({ product, loading, errorReference, errorMessage, b
|
|
|
350
359
|
}, loading ? _pisell_utils.locales.getText("pisell2.hdl-kiosk.weighted-product-loading") : _pisell_utils.locales.getText("pisell2.hdl-kiosk.customization-load-failed")), errorReference ? /* @__PURE__ */ react.default.createElement("div", {
|
|
351
360
|
className: "hdl-inline-error",
|
|
352
361
|
role: "alert"
|
|
353
|
-
}, /* @__PURE__ */ react.default.createElement("strong", null, errorMessage || _pisell_utils.locales.getText("pisell2.hdl-kiosk.customization-load-failed")), /* @__PURE__ */ react.default.createElement("small", null, errorReference)) : null)
|
|
354
|
-
type: "button",
|
|
355
|
-
className: "hdl-customization-skip",
|
|
356
|
-
disabled: busy || syncing,
|
|
357
|
-
onClick: omitPrimaryProduct
|
|
358
|
-
}, _pisell_utils.locales.getText("pisell2.hdl-kiosk.customization-skip")));
|
|
362
|
+
}, /* @__PURE__ */ react.default.createElement("strong", null, errorMessage || _pisell_utils.locales.getText("pisell2.hdl-kiosk.customization-load-failed")), /* @__PURE__ */ react.default.createElement("small", null, errorReference)) : null));
|
|
359
363
|
}
|
|
360
364
|
//#endregion
|
|
361
365
|
exports.CustomizationScreen = CustomizationScreen;
|
|
@@ -233,24 +233,6 @@
|
|
|
233
233
|
margin-top: 26px;
|
|
234
234
|
}
|
|
235
235
|
|
|
236
|
-
.hdl-customization-skip {
|
|
237
|
-
position: absolute;
|
|
238
|
-
bottom: max(166px, calc(env(safe-area-inset-bottom) + 151px));
|
|
239
|
-
left: 46px;
|
|
240
|
-
z-index: 9;
|
|
241
|
-
min-height: 63px;
|
|
242
|
-
margin: 0;
|
|
243
|
-
border: 0;
|
|
244
|
-
border-radius: 1079px;
|
|
245
|
-
padding: 0 26px;
|
|
246
|
-
background: linear-gradient(180deg, #d51b22, #a6090e);
|
|
247
|
-
color: #fff;
|
|
248
|
-
box-shadow: 0 15px 32px rgba(178, 13, 18, 0.3);
|
|
249
|
-
font-size: 24px;
|
|
250
|
-
font-weight: 900;
|
|
251
|
-
cursor: pointer;
|
|
252
|
-
}
|
|
253
|
-
|
|
254
236
|
.hdl-customization-next {
|
|
255
237
|
border: 0;
|
|
256
238
|
background: linear-gradient(180deg, #20b8aa, #119184);
|
|
@@ -7,7 +7,7 @@ let _pisell_utils = require("@pisell/utils");
|
|
|
7
7
|
//#region src/components/HDLKiosk/slices/identity/Screen/index.tsx
|
|
8
8
|
const QR_CELLS = Object.freeze(Array.from({ length: 49 }, (_, index) => index * 8 % 5 < 2));
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* 各 Workflow 共用的会员提示页。
|
|
11
11
|
*
|
|
12
12
|
* 宿主可注入认证 UI;未注入时保留 QR / SMS 视觉 fallback。Skip 继续产生
|
|
13
13
|
* identity.omit Resolution,由本地 Exit Policy 同步访客后进入下一步。
|
|
@@ -26,6 +26,18 @@ function IdentityScreen({ model, orderBar, send, renderIdentityAuth }) {
|
|
|
26
26
|
ariaLabel: _pisell_utils.locales.getText("pisell2.hdl-kiosk.identity-actions-label"),
|
|
27
27
|
cartEnabled: hasOrder && !busy,
|
|
28
28
|
variant: "composed",
|
|
29
|
+
leading: /* @__PURE__ */ react.default.createElement("button", {
|
|
30
|
+
type: "button",
|
|
31
|
+
className: "hdl-floating-bar__button",
|
|
32
|
+
disabled: busy || !model.canGoBack,
|
|
33
|
+
onClick: () => send({
|
|
34
|
+
kind: "navigation",
|
|
35
|
+
direction: "back"
|
|
36
|
+
})
|
|
37
|
+
}, /* @__PURE__ */ react.default.createElement("svg", {
|
|
38
|
+
viewBox: "0 0 24 24",
|
|
39
|
+
"aria-hidden": "true"
|
|
40
|
+
}, /* @__PURE__ */ react.default.createElement("path", { d: "m15 5-7 7 7 7M8 12h10" })), /* @__PURE__ */ react.default.createElement("span", null, _pisell_utils.locales.getText("pisell2.hdl-kiosk.back"))),
|
|
29
41
|
summary: orderBar ? /* @__PURE__ */ react.default.createElement(require_index$1.HDLKioskOrderSummary, {
|
|
30
42
|
lineCount: (_orderBar$cartItemCou = orderBar.cartItemCount) !== null && _orderBar$cartItemCou !== void 0 ? _orderBar$cartItemCou : orderBar.cartLineCount,
|
|
31
43
|
totalText: orderBar.totalText,
|
|
@@ -50,8 +62,10 @@ function IdentityScreen({ model, orderBar, send, renderIdentityAuth }) {
|
|
|
50
62
|
}, [
|
|
51
63
|
busy,
|
|
52
64
|
hasOrder,
|
|
65
|
+
model.canGoBack,
|
|
53
66
|
openCart,
|
|
54
|
-
orderBar
|
|
67
|
+
orderBar,
|
|
68
|
+
send
|
|
55
69
|
]));
|
|
56
70
|
const authContent = renderIdentityAuth === null || renderIdentityAuth === void 0 ? void 0 : renderIdentityAuth({
|
|
57
71
|
busy,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
const require_selectors = require("../../../../plus/salesSdk/selectors.js");
|
|
1
2
|
const require_defineSlice = require("../../kernel/application/defineSlice.js");
|
|
2
3
|
const require_operations = require("../../app/operations.js");
|
|
3
4
|
//#region src/components/HDLKiosk/slices/identity/slice.ts
|
|
@@ -5,6 +6,7 @@ const require_operations = require("../../app/operations.js");
|
|
|
5
6
|
const identitySlice = require_defineSlice.defineSlice({
|
|
6
7
|
id: "identity",
|
|
7
8
|
surface: { id: "identity" },
|
|
9
|
+
redirect: ({ sales, identity }) => (identity === null || identity === void 0 ? void 0 : identity.scanEntry) || !require_selectors.isWalkInCustomer(sales === null || sales === void 0 ? void 0 : sales.customer) ? "$next" : void 0,
|
|
8
10
|
resolutions: {
|
|
9
11
|
complete: require_defineSlice.perform(require_operations.identitySyncOperation),
|
|
10
12
|
omit: require_defineSlice.perform(require_operations.identitySyncOperation)
|
|
@@ -5,11 +5,14 @@ let react = require("react");
|
|
|
5
5
|
react = require_runtime.__toESM(react);
|
|
6
6
|
//#region src/components/HDLKiosk/slices/identity/view.tsx
|
|
7
7
|
/** Identity 展示装配:把统一 View Context 转为本 Slice Screen props;不决定流程目标。 */
|
|
8
|
-
const renderIdentity = ({ node, viewSnapshot, sales, businessMode, renderIdentityAuth, send }) =>
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
const renderIdentity = ({ node, viewSnapshot, sales, businessMode, renderIdentityAuth, send }) => {
|
|
9
|
+
if (viewSnapshot.nodeId !== node.id) return null;
|
|
10
|
+
return /* @__PURE__ */ react.default.createElement(require_index.IdentityScreen, {
|
|
11
|
+
model: require_utils.createActivityScreenModel(node.surfaceId, viewSnapshot, node, sales, businessMode),
|
|
12
|
+
orderBar: require_utils.createOrderBarModel(sales),
|
|
13
|
+
send,
|
|
14
|
+
renderIdentityAuth
|
|
15
|
+
});
|
|
16
|
+
};
|
|
14
17
|
//#endregion
|
|
15
18
|
exports.renderIdentity = renderIdentity;
|
|
@@ -6,8 +6,8 @@ const primaryProductPromptSlice = require_defineSlice.defineSlice({
|
|
|
6
6
|
surface: { id: "primaryProductPrompt" },
|
|
7
7
|
presentation: "modal",
|
|
8
8
|
resolutions: {
|
|
9
|
-
complete: require_defineSlice.
|
|
10
|
-
omit: require_defineSlice.
|
|
9
|
+
complete: require_defineSlice.accept(),
|
|
10
|
+
omit: require_defineSlice.accept()
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
13
|
//#endregion
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
const require_runtime = require("../../../_virtual/_rolldown/runtime.js");
|
|
2
|
+
const require_selectors = require("../../../plus/salesSdk/selectors.js");
|
|
2
3
|
const require_useHDLKioskCustomerController = require("./controllers/useHDLKioskCustomerController.js");
|
|
3
4
|
const require_useHDLKioskActionDispatcher = require("./controllers/useHDLKioskActionDispatcher.js");
|
|
4
5
|
const require_useHDLKioskExitController = require("./controllers/useHDLKioskExitController.js");
|
|
5
|
-
const require_selectors = require("../kernel/workflow/selectors.js");
|
|
6
|
+
const require_selectors$1 = require("../kernel/workflow/selectors.js");
|
|
6
7
|
const require_utils = require("../utils.js");
|
|
7
8
|
const require_useHDLKioskScreenData = require("./controllers/useHDLKioskScreenData.js");
|
|
8
9
|
const require_index = require("../components/overlays/EndOrderDialog/index.js");
|
|
@@ -62,11 +63,28 @@ function HDLKioskWorkflowBlockingSurface({ snapshot, title, description, referen
|
|
|
62
63
|
*/
|
|
63
64
|
function HDLKioskWorkflowView({ session, host, sales, config, isActive, exiting, exitError, pendingExit, renderIdentityAuth, renderCartContent, cartOverlayActions, sourceData, paymentResult, onCollaborationStatusChange, back, requestExit, resolveExit, completeOrder, recover }) {
|
|
64
65
|
var _session$definition$n2, _sourceData$tempOrder3, _customer$error, _activeNode$presentat;
|
|
66
|
+
(0, react.useEffect)(() => {
|
|
67
|
+
session.markPresented();
|
|
68
|
+
}, [session]);
|
|
65
69
|
const snapshot = require_snapshots.useWorkflowSnapshot(session.actor);
|
|
66
70
|
const navigationSequence = (0, react.useRef)(0);
|
|
67
71
|
const [memberLoginOpen, setMemberLoginOpen] = (0, react.useState)(false);
|
|
68
72
|
const [paymentOrderConflict, setPaymentOrderConflict] = (0, react.useState)(false);
|
|
69
73
|
const activeNode = session.definition.nodes[snapshot.nodeId];
|
|
74
|
+
(0, react.useEffect)(() => {
|
|
75
|
+
if (!isActive || snapshot.status !== "idle" || activeNode.activity !== "identity" || require_selectors.isWalkInCustomer(sales.customer)) return;
|
|
76
|
+
session.actor.navigate({
|
|
77
|
+
kind: "step",
|
|
78
|
+
stepId: snapshot.nodeId
|
|
79
|
+
}, "identity:customer-updated");
|
|
80
|
+
}, [
|
|
81
|
+
isActive,
|
|
82
|
+
session,
|
|
83
|
+
snapshot.nodeId,
|
|
84
|
+
snapshot.status,
|
|
85
|
+
activeNode.activity,
|
|
86
|
+
sales.customer
|
|
87
|
+
]);
|
|
70
88
|
const customizationStepId = session.definition.stepOrder.find((stepId) => {
|
|
71
89
|
var _session$definition$n;
|
|
72
90
|
return ((_session$definition$n = session.definition.nodes[stepId]) === null || _session$definition$n === void 0 ? void 0 : _session$definition$n.activity) === "customization";
|
|
@@ -269,7 +287,7 @@ function HDLKioskWorkflowView({ session, host, sales, config, isActive, exiting,
|
|
|
269
287
|
memberAction,
|
|
270
288
|
send,
|
|
271
289
|
renderCartContent,
|
|
272
|
-
onEditPrimaryProduct: customizationStepId && config.primaryWeightedProductId && require_selectors.canReopenWorkflowStep(session.definition, snapshot, customizationStepId) ? editPrimaryProduct : void 0
|
|
290
|
+
onEditPrimaryProduct: customizationStepId && config.primaryWeightedProductId && require_selectors$1.canReopenWorkflowStep(session.definition, snapshot, customizationStepId) ? editPrimaryProduct : void 0
|
|
273
291
|
}), endOrderConfirmationOpen ? /* @__PURE__ */ react.default.createElement(require_index.EndOrderDialog, {
|
|
274
292
|
onCancel: cancelEndOrder,
|
|
275
293
|
onConfirm: confirmEndOrder
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
require("../../../../_virtual/_rolldown/runtime.js");
|
|
2
2
|
const require_asyncToGenerator = require("../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js");
|
|
3
|
+
const require_selectors = require("../../../../plus/salesSdk/selectors.js");
|
|
3
4
|
const require_utils = require("../../../../plus/saleDetail/components/Client/utils.js");
|
|
4
5
|
const require_errors = require("../../runtime/operations/errors.js");
|
|
5
6
|
let react = require("react");
|
|
@@ -44,17 +45,11 @@ function maskCustomerPhone(phone) {
|
|
|
44
45
|
});
|
|
45
46
|
}
|
|
46
47
|
function useHDLKioskCustomerController({ session, snapshot, sales, activityId, isActive, loginAvailable, interactionBlocked, sourceCustomer }) {
|
|
47
|
-
var _sourceCustomer$id, _sales$customer;
|
|
48
48
|
const [busy, setBusy] = (0, react.useState)(false);
|
|
49
49
|
const [error, setError] = (0, react.useState)();
|
|
50
50
|
const attempt = (0, react.useRef)(0);
|
|
51
51
|
const inFlight = (0, react.useRef)(false);
|
|
52
|
-
const
|
|
53
|
-
const member = sourceCustomer ? ![
|
|
54
|
-
"0",
|
|
55
|
-
"1",
|
|
56
|
-
""
|
|
57
|
-
].includes(sourceCustomerId) : ((_sales$customer = sales.customer) === null || _sales$customer === void 0 ? void 0 : _sales$customer.member) === true;
|
|
52
|
+
const member = !require_selectors.isWalkInCustomer(sourceCustomer !== null && sourceCustomer !== void 0 ? sourceCustomer : sales.customer);
|
|
58
53
|
const customerName = member ? firstCustomerText(require_utils.getClientDisplayName(require_utils.normalizeCustomer(sourceCustomer))) : void 0;
|
|
59
54
|
const phone = firstCustomerText(sourceCustomer === null || sourceCustomer === void 0 ? void 0 : sourceCustomer.phone);
|
|
60
55
|
const memberName = phone && customerName === phone ? maskCustomerPhone(phone) : customerName;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
require("../../_virtual/_rolldown/runtime.js");
|
|
2
2
|
const require_objectSpread2 = require("../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js");
|
|
3
3
|
const require_resolveSkuValue = require("../../plus/skuOptionsSelection/utils/resolveSkuValue.js");
|
|
4
|
-
const require_selectors = require("
|
|
4
|
+
const require_selectors = require("../../plus/salesSdk/selectors.js");
|
|
5
|
+
const require_selectors$1 = require("./kernel/workflow/selectors.js");
|
|
5
6
|
let _pisell_utils = require("@pisell/utils");
|
|
6
7
|
//#region src/components/HDLKiosk/utils.ts
|
|
7
8
|
const NON_NEGATIVE_MONEY = /^(?:0|[1-9]\d*)(?:\.\d+)?$/;
|
|
@@ -166,19 +167,14 @@ function createOrderBarModel(sales) {
|
|
|
166
167
|
});
|
|
167
168
|
}
|
|
168
169
|
function createCartDrawerModel(sales, primaryWeightedProductId, sourceData) {
|
|
169
|
-
var _sourceData$customer
|
|
170
|
+
var _sourceData$customer;
|
|
170
171
|
const currencySymbol = sales.summary.status === "ready" ? sales.summary.currencySymbol : void 0;
|
|
171
172
|
const totalText = sales.summary.status === "ready" ? formatCurrencyAmount(sales.summary.due, currencySymbol) : void 0;
|
|
172
|
-
const
|
|
173
|
-
const sourceMember = (sourceData === null || sourceData === void 0 ? void 0 : sourceData.customer) ? ![
|
|
174
|
-
"0",
|
|
175
|
-
"1",
|
|
176
|
-
""
|
|
177
|
-
].includes(sourceCustomerId) : void 0;
|
|
173
|
+
const sourceMember = (sourceData === null || sourceData === void 0 ? void 0 : sourceData.customer) ? !require_selectors.isWalkInCustomer(sourceData.customer) : void 0;
|
|
178
174
|
return Object.freeze({
|
|
179
175
|
lineCount: sales.cart.lineCount,
|
|
180
|
-
member: sourceMember !== null && sourceMember !== void 0 ? sourceMember : (
|
|
181
|
-
memberName: sourceMember && typeof (sourceData === null || sourceData === void 0 || (_sourceData$
|
|
176
|
+
member: sourceMember !== null && sourceMember !== void 0 ? sourceMember : !require_selectors.isWalkInCustomer(sales.customer),
|
|
177
|
+
memberName: sourceMember && typeof (sourceData === null || sourceData === void 0 || (_sourceData$customer = sourceData.customer) === null || _sourceData$customer === void 0 ? void 0 : _sourceData$customer.name) === "string" ? sourceData.customer.name : void 0,
|
|
182
178
|
lines: Object.freeze(sales.cart.lines.map((line) => {
|
|
183
179
|
const quantity = Number(line.quantity);
|
|
184
180
|
return Object.freeze({
|
|
@@ -229,7 +225,6 @@ function createActivityScreenModel(surfaceId, snapshot, node, sales, businessMod
|
|
|
229
225
|
description = _pisell_utils.locales.getText("pisell2.hdl-kiosk.checkout-title");
|
|
230
226
|
break;
|
|
231
227
|
}
|
|
232
|
-
const canReviewCatalog = surfaceId !== "catalog" || sales.cart.lineCount > 0;
|
|
233
228
|
const placeholder = node.readiness === "placeholder";
|
|
234
229
|
const placeholderBlocked = placeholder && businessMode === "production";
|
|
235
230
|
const error = resolveHDLKioskErrorPresentation({ error: snapshot.lastError });
|
|
@@ -239,8 +234,8 @@ function createActivityScreenModel(surfaceId, snapshot, node, sales, businessMod
|
|
|
239
234
|
title,
|
|
240
235
|
description,
|
|
241
236
|
busy: snapshot.status === "running",
|
|
242
|
-
canContinue: snapshot.status === "idle" &&
|
|
243
|
-
canGoBack: require_selectors.canRequestBack(snapshot),
|
|
237
|
+
canContinue: snapshot.status === "idle" && !placeholderBlocked && Boolean(node.on.complete),
|
|
238
|
+
canGoBack: require_selectors$1.canRequestBack(snapshot),
|
|
244
239
|
placeholder,
|
|
245
240
|
placeholderBlocked,
|
|
246
241
|
errorMessage: error === null || error === void 0 ? void 0 : error.message,
|
|
@@ -46,13 +46,14 @@ function resolveBigSaleHDLKioskCapabilities(context, options = {}) {
|
|
|
46
46
|
customization: { weightedProduct: scaleAvailable && canUpdateCustomizedProduct }
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
|
-
function createBigSaleHDLKioskHost({ getContext, executeScan, hasScanExecutionSource, devices, getWriteFulfillment, getAuthenticatedCustomer, getPaymentController, telemetry }) {
|
|
49
|
+
function createBigSaleHDLKioskHost({ getContext, executeScan, resolveScan, hasScanExecutionSource, devices, getWriteFulfillment, getAuthenticatedCustomer, getPaymentController, telemetry }) {
|
|
50
50
|
const resolveScaleEventSource = () => (devices === null || devices === void 0 ? void 0 : devices.getSubscribeScaleEvents) ? devices.getSubscribeScaleEvents() : devices === null || devices === void 0 ? void 0 : devices.subscribeScaleEvents;
|
|
51
51
|
return {
|
|
52
52
|
sales: require_index.createBigSaleSalesPort({
|
|
53
53
|
getContext,
|
|
54
54
|
readTransactionState: require_transactionState.createBigSaleTransactionStateReader(getContext),
|
|
55
55
|
executeScan,
|
|
56
|
+
resolveScan,
|
|
56
57
|
getWriteFulfillment,
|
|
57
58
|
getAuthenticatedCustomer,
|
|
58
59
|
getPaymentController
|
|
@@ -38,8 +38,12 @@ function projectConfirmedQuantityLine(products, line, quantity) {
|
|
|
38
38
|
if (!confirmedLine || require_mergeBookingsForDisplay.getMergedBookingSources(line).length === 0) return confirmedLine;
|
|
39
39
|
return require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, confirmedLine), {}, { quantity: String(quantity) });
|
|
40
40
|
}
|
|
41
|
-
function createBigSaleCartOperations({ getContext, readTransactionState, executeScan }) {
|
|
41
|
+
function createBigSaleCartOperations({ getContext, readTransactionState, executeScan, resolveScan }) {
|
|
42
42
|
return {
|
|
43
|
+
resolveBarcode: (code, signal) => {
|
|
44
|
+
var _resolveScan;
|
|
45
|
+
return (_resolveScan = resolveScan === null || resolveScan === void 0 ? void 0 : resolveScan(code, signal)) !== null && _resolveScan !== void 0 ? _resolveScan : Promise.resolve(null);
|
|
46
|
+
},
|
|
43
47
|
consumeBarcode: function() {
|
|
44
48
|
var _ref = require_asyncToGenerator._asyncToGenerator(function* (code, signal) {
|
|
45
49
|
if (signal.aborted) return { status: "cancelled" };
|
|
@@ -58,7 +62,7 @@ function createBigSaleCartOperations({ getContext, readTransactionState, execute
|
|
|
58
62
|
return {
|
|
59
63
|
status: "succeeded",
|
|
60
64
|
data: {
|
|
61
|
-
code: scanResult.status === "pending" ? "requiresSelection" : "added",
|
|
65
|
+
code: scanResult.status === "pending" ? "requiresSelection" : scanResult.kind === "customer" || scanResult.kind === "promotion" ? "handled" : "added",
|
|
62
66
|
cartChangeConfirmed: scanResult.status === "success" && Number((_scanResult$meta$coun = (_scanResult$meta = scanResult.meta) === null || _scanResult$meta === void 0 ? void 0 : _scanResult$meta.count) !== null && _scanResult$meta$coun !== void 0 ? _scanResult$meta$coun : 0) > 0
|
|
63
67
|
}
|
|
64
68
|
};
|