@pisell/private-materials 6.12.166 → 6.12.168
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.js +11 -11
- package/build/lowcode/view.js +11 -11
- package/es/components/HDLKiosk/app/ScreenRenderer.js +7 -7
- package/es/components/HDLKiosk/app/views.js +2 -1
- package/es/components/HDLKiosk/app/workflow/barcode.js +12 -35
- package/es/components/HDLKiosk/app/workflow/{guards.js → predicates.js} +9 -9
- package/es/components/HDLKiosk/app/workflow/quick.js +3 -6
- package/es/components/HDLKiosk/app/workflow/registry.js +1 -1
- package/es/components/HDLKiosk/app/workflow/scale.js +3 -12
- package/es/components/HDLKiosk/components/shell/HDLKioskBottomBarHost/index.js +12 -10
- package/es/components/HDLKiosk/components/shell/HDLKioskShell/index.js +1 -0
- package/es/components/HDLKiosk/docs/00-/346/226/207/344/273/266/345/257/274/350/210/252.md +7 -7
- package/es/components/HDLKiosk/docs/01-/346/240/270/345/277/203/350/277/220/350/241/214/346/234/272/345/210/266.md +47 -40
- package/es/components/HDLKiosk/docs/03-/344/270/232/345/212/241/346/265/201/347/250/213/344/270/216/344/272/244/344/272/222/350/247/204/345/210/231.md +3 -3
- package/es/components/HDLKiosk/docs/05-/344/272/244/346/230/223/345/256/211/345/205/250.md +1 -1
- package/es/components/HDLKiosk/docs/07-/345/220/216/347/273/255/345/267/245/344/275/234.md +1 -1
- package/es/components/HDLKiosk/docs/README.md +2 -2
- package/es/components/HDLKiosk/docs//345/256/236/346/226/275/350/277/233/345/272/246.md +3 -3
- package/es/components/HDLKiosk/docs//346/236/266/346/236/204/350/256/276/350/256/241.md +11 -11
- package/es/components/HDLKiosk/index.js +0 -1
- package/es/components/HDLKiosk/kernel/README.md +8 -9
- package/es/components/HDLKiosk/kernel/application/defineApplication.js +18 -19
- package/es/components/HDLKiosk/kernel/application/defineSlice.js +8 -13
- package/es/components/HDLKiosk/kernel/workflow/actor.js +118 -28
- package/es/components/HDLKiosk/kernel/workflow/compiler.js +35 -41
- package/es/components/HDLKiosk/kernel/workflow/selectors.js +9 -0
- package/es/components/HDLKiosk/runtime/HDLKioskWorkflowView.js +10 -9
- package/es/components/HDLKiosk/runtime/controllers/useHDLKioskCustomerController.js +1 -1
- package/es/components/HDLKiosk/runtime/createWorkflowSession.js +3 -3
- package/es/components/HDLKiosk/runtime/domainTransitionRunner.js +9 -9
- package/es/components/HDLKiosk/runtime/workflowEvent.js +9 -4
- package/es/components/HDLKiosk/runtime/workflowLifecycle.js +3 -3
- package/es/components/HDLKiosk/slices/catalog/PrimaryProductPromptDialog/index.js +1 -2
- package/es/components/HDLKiosk/slices/catalog/Screen/index.js +11 -38
- package/es/components/HDLKiosk/slices/catalog/Screen/model.js +1 -5
- package/es/components/HDLKiosk/slices/catalog/slice.js +4 -16
- package/es/components/HDLKiosk/slices/catalog/view.js +4 -6
- package/es/components/HDLKiosk/slices/customization/Screen/index.js +9 -11
- package/es/components/HDLKiosk/slices/customization/operation.js +23 -4
- package/es/components/HDLKiosk/slices/customization/slice.js +5 -9
- package/es/components/HDLKiosk/slices/customization/view.js +3 -2
- package/es/components/HDLKiosk/slices/fulfillment/Screen/index.js +6 -6
- package/es/components/HDLKiosk/slices/fulfillment/slice.js +5 -8
- package/es/components/HDLKiosk/slices/identity/Screen/index.js +18 -12
- package/es/components/HDLKiosk/slices/identity/slice.js +4 -11
- package/es/components/HDLKiosk/slices/index.js +3 -2
- package/es/components/HDLKiosk/slices/payment/Screen/index.js +5 -5
- package/es/components/HDLKiosk/slices/payment/slice.js +7 -8
- package/es/components/HDLKiosk/slices/primaryProductPrompt/slice.js +14 -0
- package/es/components/HDLKiosk/slices/primaryProductPrompt/view.js +23 -0
- package/es/components/HDLKiosk/utils.js +3 -2
- package/es/components/bigSale/templates/HDLKiosk/auth/HDLKioskIdentityAuthPanel.js +17 -2
- package/es/pro/Login2.0/Login2.d.ts +2 -0
- package/es/pro/Login2.0/Login2.js +9 -1
- package/es/pro/Login2.0/Register2.d.ts +2 -0
- package/es/pro/Login2.0/Register2.js +9 -1
- package/lib/components/HDLKiosk/app/ScreenRenderer.js +7 -7
- package/lib/components/HDLKiosk/app/views.js +2 -1
- package/lib/components/HDLKiosk/app/workflow/barcode.js +11 -34
- package/lib/components/HDLKiosk/app/workflow/{guards.js → predicates.js} +9 -9
- package/lib/components/HDLKiosk/app/workflow/quick.js +3 -6
- package/lib/components/HDLKiosk/app/workflow/registry.js +1 -1
- package/lib/components/HDLKiosk/app/workflow/scale.js +3 -12
- package/lib/components/HDLKiosk/components/shell/HDLKioskBottomBarHost/index.js +12 -10
- package/lib/components/HDLKiosk/components/shell/HDLKioskShell/index.js +1 -0
- package/lib/components/HDLKiosk/docs/00-/346/226/207/344/273/266/345/257/274/350/210/252.md +7 -7
- package/lib/components/HDLKiosk/docs/01-/346/240/270/345/277/203/350/277/220/350/241/214/346/234/272/345/210/266.md +47 -40
- package/lib/components/HDLKiosk/docs/03-/344/270/232/345/212/241/346/265/201/347/250/213/344/270/216/344/272/244/344/272/222/350/247/204/345/210/231.md +3 -3
- package/lib/components/HDLKiosk/docs/05-/344/272/244/346/230/223/345/256/211/345/205/250.md +1 -1
- package/lib/components/HDLKiosk/docs/07-/345/220/216/347/273/255/345/267/245/344/275/234.md +1 -1
- package/lib/components/HDLKiosk/docs/README.md +2 -2
- package/lib/components/HDLKiosk/docs//345/256/236/346/226/275/350/277/233/345/272/246.md +3 -3
- package/lib/components/HDLKiosk/docs//346/236/266/346/236/204/350/256/276/350/256/241.md +11 -11
- package/lib/components/HDLKiosk/index.js +0 -1
- package/lib/components/HDLKiosk/kernel/README.md +8 -9
- package/lib/components/HDLKiosk/kernel/application/defineApplication.js +18 -19
- package/lib/components/HDLKiosk/kernel/application/defineSlice.js +8 -14
- package/lib/components/HDLKiosk/kernel/workflow/actor.js +118 -28
- package/lib/components/HDLKiosk/kernel/workflow/compiler.js +35 -41
- package/lib/components/HDLKiosk/kernel/workflow/selectors.js +10 -0
- package/lib/components/HDLKiosk/runtime/HDLKioskWorkflowView.js +10 -9
- package/lib/components/HDLKiosk/runtime/controllers/useHDLKioskCustomerController.js +1 -1
- package/lib/components/HDLKiosk/runtime/createWorkflowSession.js +3 -3
- package/lib/components/HDLKiosk/runtime/domainTransitionRunner.js +9 -9
- package/lib/components/HDLKiosk/runtime/workflowEvent.js +9 -4
- package/lib/components/HDLKiosk/runtime/workflowLifecycle.js +3 -3
- package/lib/components/HDLKiosk/slices/catalog/PrimaryProductPromptDialog/index.js +1 -2
- package/lib/components/HDLKiosk/slices/catalog/Screen/index.js +13 -40
- package/lib/components/HDLKiosk/slices/catalog/Screen/model.js +0 -5
- package/lib/components/HDLKiosk/slices/catalog/slice.js +2 -15
- package/lib/components/HDLKiosk/slices/catalog/view.js +4 -6
- package/lib/components/HDLKiosk/slices/customization/Screen/index.js +9 -11
- package/lib/components/HDLKiosk/slices/customization/operation.js +23 -3
- package/lib/components/HDLKiosk/slices/customization/slice.js +3 -7
- package/lib/components/HDLKiosk/slices/customization/view.js +3 -2
- package/lib/components/HDLKiosk/slices/fulfillment/Screen/index.js +6 -6
- package/lib/components/HDLKiosk/slices/fulfillment/slice.js +4 -7
- package/lib/components/HDLKiosk/slices/identity/Screen/index.js +17 -11
- package/lib/components/HDLKiosk/slices/identity/slice.js +4 -11
- package/lib/components/HDLKiosk/slices/index.js +2 -1
- package/lib/components/HDLKiosk/slices/payment/Screen/index.js +5 -5
- package/lib/components/HDLKiosk/slices/payment/slice.js +6 -7
- package/lib/components/HDLKiosk/slices/primaryProductPrompt/slice.js +14 -0
- package/lib/components/HDLKiosk/slices/primaryProductPrompt/view.js +25 -0
- package/lib/components/HDLKiosk/utils.js +3 -2
- package/lib/components/bigSale/templates/HDLKiosk/auth/HDLKioskIdentityAuthPanel.js +16 -1
- package/lib/pro/Login2.0/Login2.d.ts +2 -0
- package/lib/pro/Login2.0/Login2.js +9 -1
- package/lib/pro/Login2.0/Register2.d.ts +2 -0
- package/lib/pro/Login2.0/Register2.js +9 -1
- package/package.json +4 -4
|
@@ -3,7 +3,7 @@ const require_asyncToGenerator = require("../../../_virtual/_@oxc-project_runtim
|
|
|
3
3
|
const require_coordinator = require("../app/operations/coordinator.js");
|
|
4
4
|
const require_manifest = require("../app/manifest.js");
|
|
5
5
|
const require_registry = require("../app/workflow/registry.js");
|
|
6
|
-
const
|
|
6
|
+
const require_predicates = require("../app/workflow/predicates.js");
|
|
7
7
|
const require_navigationGuards = require("../app/workflow/navigationGuards.js");
|
|
8
8
|
const require_policy = require("../app/workflow/policy.js");
|
|
9
9
|
const require_constants = require("../app/constants.js");
|
|
@@ -27,7 +27,7 @@ function createHDLKioskWorkflowSession(entry, host, options = {}) {
|
|
|
27
27
|
const structuralCompilation = require_compiler.compileWorkflowStructure(require_registry.getBuiltInWorkflowDefinition(entry), {
|
|
28
28
|
operations,
|
|
29
29
|
activities: require_registry.defaultActivityRegistry,
|
|
30
|
-
|
|
30
|
+
predicates: require_predicates.defaultPredicateRegistry,
|
|
31
31
|
navigationGuards: require_navigationGuards.defaultNavigationGuardRegistry,
|
|
32
32
|
workflowIds: require_constants.HDL_WORKFLOW_IDS
|
|
33
33
|
});
|
|
@@ -55,7 +55,7 @@ function createHDLKioskWorkflowSession(entry, host, options = {}) {
|
|
|
55
55
|
const transitionRunner = require_domainTransitionRunner.createHDLKioskTransitionRunner({
|
|
56
56
|
host,
|
|
57
57
|
coordinator,
|
|
58
|
-
|
|
58
|
+
predicates: require_predicates.defaultPredicateRegistry
|
|
59
59
|
});
|
|
60
60
|
const workflowActor = require_actor.createWorkflowActor({
|
|
61
61
|
definition,
|
|
@@ -13,8 +13,8 @@ function createDomainWorkflowError(code, recovery = "staff", cause) {
|
|
|
13
13
|
cause
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
-
function createHDLKioskTransitionRunner({ host, coordinator,
|
|
17
|
-
const emitError = (error, workflowId, stepId,
|
|
16
|
+
function createHDLKioskTransitionRunner({ host, coordinator, predicates, now = Date.now }) {
|
|
17
|
+
const emitError = (error, workflowId, stepId, intent) => {
|
|
18
18
|
try {
|
|
19
19
|
host.telemetry.emit({
|
|
20
20
|
name: "hdlKiosk.error.reported",
|
|
@@ -26,7 +26,7 @@ function createHDLKioskTransitionRunner({ host, coordinator, guards, now = Date.
|
|
|
26
26
|
recovery: error.recovery,
|
|
27
27
|
workflowId,
|
|
28
28
|
nodeId: stepId,
|
|
29
|
-
|
|
29
|
+
intent
|
|
30
30
|
}
|
|
31
31
|
});
|
|
32
32
|
} catch (_unused) {}
|
|
@@ -35,14 +35,14 @@ function createHDLKioskTransitionRunner({ host, coordinator, guards, now = Date.
|
|
|
35
35
|
run: function() {
|
|
36
36
|
var _ref = require_asyncToGenerator._asyncToGenerator(function* ({ workflowId, sessionEpoch, stepId, context, event, transition, executionId }) {
|
|
37
37
|
const exitPolicy = transition.exitPolicy;
|
|
38
|
-
if (exitPolicy === null || exitPolicy === void 0 ? void 0 : exitPolicy.
|
|
39
|
-
if (!
|
|
38
|
+
if (exitPolicy === null || exitPolicy === void 0 ? void 0 : exitPolicy.precondition) try {
|
|
39
|
+
if (!predicates.evaluate(exitPolicy.precondition, {
|
|
40
40
|
workflow: context,
|
|
41
41
|
sales: host.sales.getObservedSnapshot()
|
|
42
42
|
})) return { status: "stay" };
|
|
43
43
|
} catch (cause) {
|
|
44
|
-
const error = createDomainWorkflowError("
|
|
45
|
-
emitError(error, workflowId, stepId, event.
|
|
44
|
+
const error = createDomainWorkflowError("workflowPredicateEvaluationFailed", "staff", cause);
|
|
45
|
+
emitError(error, workflowId, stepId, event.intent);
|
|
46
46
|
return {
|
|
47
47
|
status: "blocked",
|
|
48
48
|
lastError: error
|
|
@@ -50,7 +50,7 @@ function createHDLKioskTransitionRunner({ host, coordinator, guards, now = Date.
|
|
|
50
50
|
}
|
|
51
51
|
const operationInput = "operationInput" in event ? event.operationInput : void 0;
|
|
52
52
|
const command = exitPolicy === null || exitPolicy === void 0 ? void 0 : exitPolicy.command;
|
|
53
|
-
if (!command
|
|
53
|
+
if (!command) return { status: "advance" };
|
|
54
54
|
const result = yield coordinator.execute(command.id, {
|
|
55
55
|
operationId: executionId,
|
|
56
56
|
intentId: event.intentId,
|
|
@@ -59,7 +59,7 @@ function createHDLKioskTransitionRunner({ host, coordinator, guards, now = Date.
|
|
|
59
59
|
});
|
|
60
60
|
if (coordinator.currentSessionEpoch() !== sessionEpoch) {
|
|
61
61
|
const error = createDomainWorkflowError("workflowSessionStale");
|
|
62
|
-
emitError(error, workflowId, stepId, event.
|
|
62
|
+
emitError(error, workflowId, stepId, event.intent);
|
|
63
63
|
return {
|
|
64
64
|
status: "blocked",
|
|
65
65
|
lastError: error
|
|
@@ -4,11 +4,16 @@ const require_objectWithoutProperties = require("../../../_virtual/_@oxc-project
|
|
|
4
4
|
const _excluded = ["kind"];
|
|
5
5
|
function createWorkflowEvent(action, currentActivity, stepId, intentId) {
|
|
6
6
|
if (action.activityId !== currentActivity) return void 0;
|
|
7
|
-
const { kind: _kind } = action,
|
|
8
|
-
return
|
|
9
|
-
type: "
|
|
7
|
+
const { kind: _kind } = action, payload = require_objectWithoutProperties._objectWithoutProperties(action, _excluded);
|
|
8
|
+
return action.kind === "navigation" ? {
|
|
9
|
+
type: "NAVIGATE_BACK",
|
|
10
|
+
stepId,
|
|
11
|
+
activityId: action.activityId,
|
|
12
|
+
intentId
|
|
13
|
+
} : require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({
|
|
14
|
+
type: "ACTIVITY_INTENT",
|
|
10
15
|
stepId
|
|
11
|
-
},
|
|
16
|
+
}, payload), {}, { intentId });
|
|
12
17
|
}
|
|
13
18
|
//#endregion
|
|
14
19
|
exports.createWorkflowEvent = createWorkflowEvent;
|
|
@@ -13,7 +13,7 @@ function createHDLKioskWorkflowLifecycle(host, now = Date.now) {
|
|
|
13
13
|
workflowId: snapshot.workflowId,
|
|
14
14
|
from: fromStepId,
|
|
15
15
|
to: snapshot.nodeId,
|
|
16
|
-
|
|
16
|
+
intent: event.intent
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
} catch (_unused) {}
|
|
@@ -22,7 +22,7 @@ function createHDLKioskWorkflowLifecycle(host, now = Date.now) {
|
|
|
22
22
|
return _ref.apply(this, arguments);
|
|
23
23
|
};
|
|
24
24
|
}(),
|
|
25
|
-
runtimeError: ({ stepId,
|
|
25
|
+
runtimeError: ({ stepId, intent, error }) => {
|
|
26
26
|
try {
|
|
27
27
|
host.telemetry.emit({
|
|
28
28
|
name: "hdlKiosk.error.reported",
|
|
@@ -33,7 +33,7 @@ function createHDLKioskWorkflowLifecycle(host, now = Date.now) {
|
|
|
33
33
|
source: error.source,
|
|
34
34
|
recovery: error.recovery,
|
|
35
35
|
nodeId: stepId,
|
|
36
|
-
|
|
36
|
+
intent
|
|
37
37
|
}
|
|
38
38
|
});
|
|
39
39
|
} catch (_unused2) {}
|
|
@@ -6,8 +6,7 @@ let _pisell_utils = require("@pisell/utils");
|
|
|
6
6
|
//#region src/components/HDLKiosk/slices/catalog/PrimaryProductPromptDialog/index.tsx
|
|
7
7
|
/**
|
|
8
8
|
* 文件角色:在 Barcode 商品列表结账前询问是否需要称重麻辣烫主商品。
|
|
9
|
-
*
|
|
10
|
-
* Activity 的最终 Outcome。
|
|
9
|
+
* 运行机制:由独立 PrimaryProductPrompt Activity 作为 Modal 渲染在 Catalog 上层。
|
|
11
10
|
* 边界:不判断购物车是否已有主商品,不直接接触 Workflow、查询商品或写购物车。
|
|
12
11
|
*/
|
|
13
12
|
function BagIcon() {
|
|
@@ -4,8 +4,7 @@ const require_index = require("../../../../../plus/productSelect/ProductCard/ind
|
|
|
4
4
|
const require_List = require("../../../../list/List.js");
|
|
5
5
|
const require_index$1 = require("../../../../bigSale/components/KioskCategorySidebar/index.js");
|
|
6
6
|
const require_index$2 = require("../../../components/shell/HDLKioskBottomBarHost/index.js");
|
|
7
|
-
const require_index$3 = require("
|
|
8
|
-
const require_index$4 = require("../../../components/shell/HDLKioskOrderSummary/index.js");
|
|
7
|
+
const require_index$3 = require("../../../components/shell/HDLKioskOrderSummary/index.js");
|
|
9
8
|
const require_kioskCatalog = require("../../../../../plus/productSelect/ProductCard/presets/kioskCatalog.js");
|
|
10
9
|
const require_model = require("./model.js");
|
|
11
10
|
let react = require("react");
|
|
@@ -15,7 +14,7 @@ let _pisell_utils = require("@pisell/utils");
|
|
|
15
14
|
/**
|
|
16
15
|
* 文件角色:呈现 retail 风格补充商品目录、分类、搜索和加购反馈。
|
|
17
16
|
* 运行机制:只消费已由 Host 筛选/报价的 Catalog Projection;加购走 Screen Command,
|
|
18
|
-
*
|
|
17
|
+
* Checkout 产生 Activity Intent,Back 产生 Navigation,购物车开合仅为局部 UI。
|
|
19
18
|
* 边界:不调用 loadCatalog/queryProducts,不本地追加订单行,也不计算促销价。
|
|
20
19
|
*/
|
|
21
20
|
/**
|
|
@@ -74,14 +73,13 @@ function PlusIcon() {
|
|
|
74
73
|
"aria-hidden": "true"
|
|
75
74
|
}, /* @__PURE__ */ react.default.createElement("path", { d: "M12 5v14M5 12h14" }));
|
|
76
75
|
}
|
|
77
|
-
function CatalogScreen({ products, loading, errorReference, errorMessage, busy, canReview, canGoBack,
|
|
76
|
+
function CatalogScreen({ products, loading, errorReference, errorMessage, busy, canReview, canGoBack, orderBar, send }) {
|
|
78
77
|
var _categoryById$get;
|
|
79
78
|
const categories = (0, react.useMemo)(() => require_model.createHDLCatalogCategories(products, _pisell_utils.locales.getText("pisell2.hdl-kiosk.catalog-other")), [_pisell_utils.locales.getText("pisell2.hdl-kiosk.catalog-other"), products]);
|
|
80
79
|
const categoryMenuDataSource = (0, react.useMemo)(() => createCatalogCategoryMenuDataSource(categories), [categories]);
|
|
81
80
|
const [activeCategoryPath, setActiveCategoryPath] = (0, react.useState)([]);
|
|
82
81
|
const [query, setQuery] = (0, react.useState)("");
|
|
83
82
|
const [sidebarSearchOpen, setSidebarSearchOpen] = (0, react.useState)(false);
|
|
84
|
-
const [primaryProductPromptOpen, setPrimaryProductPromptOpen] = (0, react.useState)(false);
|
|
85
83
|
const catalogMainRef = (0, react.useRef)(null);
|
|
86
84
|
const categoryPathBeforeSearchRef = (0, react.useRef)([]);
|
|
87
85
|
const categoryById = (0, react.useMemo)(() => indexCatalogCategories(categories), [categories]);
|
|
@@ -109,38 +107,31 @@ function CatalogScreen({ products, loading, errorReference, errorMessage, busy,
|
|
|
109
107
|
const productListItems = (0, react.useMemo)(() => visibleProducts.map(createCatalogProductListItem), [visibleProducts]);
|
|
110
108
|
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");
|
|
111
109
|
const completeCatalog = (0, react.useCallback)(() => {
|
|
112
|
-
if (!busy && canReview) {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}
|
|
117
|
-
send({
|
|
118
|
-
kind: "outcome",
|
|
119
|
-
outcome: "completed"
|
|
120
|
-
});
|
|
121
|
-
}
|
|
110
|
+
if (!busy && canReview) send({
|
|
111
|
+
kind: "intent",
|
|
112
|
+
intent: "complete"
|
|
113
|
+
});
|
|
122
114
|
}, [
|
|
123
115
|
busy,
|
|
124
116
|
canReview,
|
|
125
|
-
promptForPrimaryProduct,
|
|
126
117
|
send
|
|
127
118
|
]);
|
|
128
|
-
const primaryActionLabel =
|
|
119
|
+
const primaryActionLabel = _pisell_utils.locales.getText("pisell2.hdl-kiosk.checkout");
|
|
129
120
|
const { openCart } = require_index$2.useHDLKioskBottomBarController();
|
|
130
121
|
require_index$2.useHDLKioskBottomBar((0, react.useMemo)(() => ({
|
|
131
122
|
ariaLabel: _pisell_utils.locales.getText("pisell2.hdl-kiosk.catalog-actions-label"),
|
|
132
123
|
cartEnabled: canReview,
|
|
133
|
-
overlayActive:
|
|
124
|
+
overlayActive: sidebarSearchOpen,
|
|
134
125
|
leading: canGoBack ? /* @__PURE__ */ react.default.createElement("button", {
|
|
135
126
|
type: "button",
|
|
136
127
|
className: "hdl-floating-bar__button",
|
|
137
128
|
disabled: busy,
|
|
138
129
|
onClick: () => send({
|
|
139
|
-
kind: "
|
|
140
|
-
|
|
130
|
+
kind: "navigation",
|
|
131
|
+
direction: "back"
|
|
141
132
|
})
|
|
142
133
|
}, /* @__PURE__ */ react.default.createElement(BackIcon, null), /* @__PURE__ */ react.default.createElement("span", null, _pisell_utils.locales.getText("pisell2.hdl-kiosk.back"))) : void 0,
|
|
143
|
-
summary: /* @__PURE__ */ react.default.createElement(require_index$
|
|
134
|
+
summary: /* @__PURE__ */ react.default.createElement(require_index$3.HDLKioskOrderSummary, {
|
|
144
135
|
lineCount: orderBar.cartLineCount,
|
|
145
136
|
totalText: orderBar.totalText,
|
|
146
137
|
detailText: orderBar.totalText ? _pisell_utils.locales.getText("pisell2.hdl-kiosk.catalog-cart-hint") : orderBar.totalLabel,
|
|
@@ -178,10 +169,8 @@ function CatalogScreen({ products, loading, errorReference, errorMessage, busy,
|
|
|
178
169
|
canReview,
|
|
179
170
|
openCart,
|
|
180
171
|
orderBar,
|
|
181
|
-
primaryProductPromptOpen,
|
|
182
172
|
sidebarSearchOpen,
|
|
183
173
|
primaryActionLabel,
|
|
184
|
-
primaryAction,
|
|
185
174
|
completeCatalog,
|
|
186
175
|
send
|
|
187
176
|
]));
|
|
@@ -272,23 +261,7 @@ function CatalogScreen({ products, loading, errorReference, errorMessage, busy,
|
|
|
272
261
|
})
|
|
273
262
|
});
|
|
274
263
|
}
|
|
275
|
-
})))))
|
|
276
|
-
busy,
|
|
277
|
-
onDecline: () => {
|
|
278
|
-
setPrimaryProductPromptOpen(false);
|
|
279
|
-
send({
|
|
280
|
-
kind: "outcome",
|
|
281
|
-
outcome: "completed"
|
|
282
|
-
});
|
|
283
|
-
},
|
|
284
|
-
onAccept: () => {
|
|
285
|
-
setPrimaryProductPromptOpen(false);
|
|
286
|
-
send({
|
|
287
|
-
kind: "outcome",
|
|
288
|
-
outcome: "primaryProductRequested"
|
|
289
|
-
});
|
|
290
|
-
}
|
|
291
|
-
}) : null);
|
|
264
|
+
}))))));
|
|
292
265
|
}
|
|
293
266
|
//#endregion
|
|
294
267
|
exports.CatalogScreen = CatalogScreen;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
const require_objectSpread2 = require("../../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js");
|
|
2
2
|
//#region src/components/HDLKiosk/slices/catalog/Screen/model.ts
|
|
3
3
|
const HDL_CATALOG_OTHER_CATEGORY_ID = "__other__";
|
|
4
|
-
/** 扫码目录仍需继续确认主商品;普通目录的商品选择完成后可直接 Checkout。 */
|
|
5
|
-
function resolveCatalogPrimaryAction(activity) {
|
|
6
|
-
return activity === "catalogWithPrimaryProductPrompt" ? "next" : "checkout";
|
|
7
|
-
}
|
|
8
4
|
function bySortThenName(left, right) {
|
|
9
5
|
return right.sort - left.sort || left.name.localeCompare(right.name);
|
|
10
6
|
}
|
|
@@ -77,4 +73,3 @@ function filterHDLCatalogProducts(products, input) {
|
|
|
77
73
|
//#endregion
|
|
78
74
|
exports.createHDLCatalogCategories = createHDLCatalogCategories;
|
|
79
75
|
exports.filterHDLCatalogProducts = filterHDLCatalogProducts;
|
|
80
|
-
exports.resolveCatalogPrimaryAction = resolveCatalogPrimaryAction;
|
|
@@ -1,25 +1,12 @@
|
|
|
1
1
|
const require_defineSlice = require("../../kernel/application/defineSlice.js");
|
|
2
2
|
const require_cart = require("../../app/operations/cart.js");
|
|
3
3
|
//#region src/components/HDLKiosk/slices/catalog/slice.ts
|
|
4
|
-
/** Catalog Slice
|
|
4
|
+
/** Catalog Slice:声明补充商品加购;商品浏览动作不进入 Workflow。 */
|
|
5
5
|
const catalogSlice = require_defineSlice.defineSlice({
|
|
6
6
|
id: "catalog",
|
|
7
7
|
screen: { id: "catalog" },
|
|
8
8
|
commands: { addProduct: require_cart.cartAddProductOperation },
|
|
9
|
-
|
|
10
|
-
completed: require_defineSlice.guard("cart.notEmpty", { navigate: "next" }),
|
|
11
|
-
back: require_defineSlice.back()
|
|
12
|
-
}
|
|
13
|
-
});
|
|
14
|
-
const catalogWithPrimaryProductPromptSlice = require_defineSlice.defineSlice({
|
|
15
|
-
id: "catalogWithPrimaryProductPrompt",
|
|
16
|
-
screen: { id: "catalog" },
|
|
17
|
-
commands: { addProduct: require_cart.cartAddProductOperation },
|
|
18
|
-
outcomes: {
|
|
19
|
-
completed: require_defineSlice.guard("cart.notEmpty", { navigate: "next" }),
|
|
20
|
-
primaryProductRequested: require_defineSlice.guard("cart.notEmpty", { navigate: "next" })
|
|
21
|
-
}
|
|
9
|
+
intents: { complete: require_defineSlice.intentPrecondition("cart.notEmpty", { navigate: "next" }) }
|
|
22
10
|
});
|
|
23
11
|
//#endregion
|
|
24
12
|
exports.catalogSlice = catalogSlice;
|
|
25
|
-
exports.catalogWithPrimaryProductPromptSlice = catalogWithPrimaryProductPromptSlice;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_runtime = require("../../../../_virtual/_rolldown/runtime.js");
|
|
2
2
|
const require_objectSpread2 = require("../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js");
|
|
3
|
+
const require_selectors = require("../../kernel/workflow/selectors.js");
|
|
3
4
|
const require_utils = require("../../utils.js");
|
|
4
|
-
const require_model = require("./Screen/model.js");
|
|
5
5
|
const require_index = require("./Screen/index.js");
|
|
6
6
|
let react = require("react");
|
|
7
7
|
react = require_runtime.__toESM(react);
|
|
@@ -16,8 +16,8 @@ function createCatalogOrderBarModel(sales) {
|
|
|
16
16
|
}, {});
|
|
17
17
|
return Object.freeze(require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, order), {}, { quantitiesByProduct: Object.freeze(quantitiesByProduct) }));
|
|
18
18
|
}
|
|
19
|
-
const renderCatalog = ({
|
|
20
|
-
var _commandState$error
|
|
19
|
+
const renderCatalog = ({ snapshot, viewSnapshot, sales, commandState, catalog, send }) => {
|
|
20
|
+
var _commandState$error;
|
|
21
21
|
const error = require_utils.resolveHDLKioskErrorPresentation({
|
|
22
22
|
error: (_commandState$error = commandState.error) !== null && _commandState$error !== void 0 ? _commandState$error : snapshot.lastError,
|
|
23
23
|
reference: catalog.errorReference,
|
|
@@ -30,9 +30,7 @@ const renderCatalog = ({ node, snapshot, viewSnapshot, sales, commandState, cata
|
|
|
30
30
|
errorMessage: error === null || error === void 0 ? void 0 : error.message,
|
|
31
31
|
busy: viewSnapshot.status === "running",
|
|
32
32
|
canReview: sales.cart.lineCount > 0,
|
|
33
|
-
canGoBack:
|
|
34
|
-
promptForPrimaryProduct: node.activity === "catalogWithPrimaryProductPrompt" && !sales.cart.lines.some((line) => line.productId === snapshot.context.primaryWeightedProductId),
|
|
35
|
-
primaryAction: require_model.resolveCatalogPrimaryAction(node.activity),
|
|
33
|
+
canGoBack: require_selectors.canNavigateBack(snapshot),
|
|
36
34
|
orderBar: createCatalogOrderBarModel(sales),
|
|
37
35
|
send
|
|
38
36
|
});
|
|
@@ -166,7 +166,6 @@ function CustomizationScreen({ product, loading, errorReference, errorMessage, b
|
|
|
166
166
|
const skuOptionsRef = (0, react.useRef)(null);
|
|
167
167
|
const hydratedDraftKeyRef = (0, react.useRef)();
|
|
168
168
|
const [skuValue, setSkuValue] = (0, react.useState)(() => initialSkuValue(product));
|
|
169
|
-
console.log("xxxxxxxxx", product, skuValue);
|
|
170
169
|
const productFacts = (0, react.useMemo)(() => product ? require_product.resolveHDLWeightedProduct(product) : void 0, [product]);
|
|
171
170
|
const draftHydrationKey = JSON.stringify([
|
|
172
171
|
(_productFacts$product = productFacts === null || productFacts === void 0 ? void 0 : productFacts.productId) !== null && _productFacts$product !== void 0 ? _productFacts$product : "",
|
|
@@ -215,8 +214,8 @@ function CustomizationScreen({ product, loading, errorReference, errorMessage, b
|
|
|
215
214
|
}
|
|
216
215
|
const submittedSkuValue = (_skuOptionsRef$curren2 = (_skuOptionsRef$curren3 = skuOptionsRef.current) === null || _skuOptionsRef$curren3 === void 0 ? void 0 : _skuOptionsRef$curren3.getTransformValues()) !== null && _skuOptionsRef$curren2 !== void 0 ? _skuOptionsRef$curren2 : skuValue;
|
|
217
216
|
send({
|
|
218
|
-
kind: "
|
|
219
|
-
|
|
217
|
+
kind: "intent",
|
|
218
|
+
intent: "complete",
|
|
220
219
|
operationInput: {
|
|
221
220
|
productId: productFacts.productId,
|
|
222
221
|
variantId: productFacts.variantId,
|
|
@@ -245,13 +244,12 @@ function CustomizationScreen({ product, loading, errorReference, errorMessage, b
|
|
|
245
244
|
send,
|
|
246
245
|
syncing
|
|
247
246
|
]);
|
|
248
|
-
const
|
|
247
|
+
const omitPrimaryProduct = (0, react.useCallback)(() => {
|
|
249
248
|
var _orderBar$primaryLine10;
|
|
250
|
-
const lineId = (_orderBar$primaryLine10 = orderBar.primaryLine) === null || _orderBar$primaryLine10 === void 0 ? void 0 : _orderBar$primaryLine10.lineId;
|
|
251
249
|
send({
|
|
252
|
-
kind: "
|
|
253
|
-
|
|
254
|
-
operationInput: lineId
|
|
250
|
+
kind: "intent",
|
|
251
|
+
intent: "omit",
|
|
252
|
+
operationInput: { lineId: (_orderBar$primaryLine10 = orderBar.primaryLine) === null || _orderBar$primaryLine10 === void 0 ? void 0 : _orderBar$primaryLine10.lineId }
|
|
255
253
|
});
|
|
256
254
|
}, [(_orderBar$primaryLine11 = orderBar.primaryLine) === null || _orderBar$primaryLine11 === void 0 ? void 0 : _orderBar$primaryLine11.lineId, send]);
|
|
257
255
|
const { openCart } = require_index.useHDLKioskBottomBarController();
|
|
@@ -263,8 +261,8 @@ function CustomizationScreen({ product, loading, errorReference, errorMessage, b
|
|
|
263
261
|
className: "hdl-floating-bar__button",
|
|
264
262
|
disabled: busy || syncing,
|
|
265
263
|
onClick: () => send({
|
|
266
|
-
kind: "
|
|
267
|
-
|
|
264
|
+
kind: "navigation",
|
|
265
|
+
direction: "back"
|
|
268
266
|
})
|
|
269
267
|
}, /* @__PURE__ */ react.default.createElement(BackIcon, null), /* @__PURE__ */ react.default.createElement("span", null, _pisell_utils.locales.getText("pisell2.hdl-kiosk.back"))) : void 0,
|
|
270
268
|
summary: /* @__PURE__ */ react.default.createElement(require_index$1.HDLKioskOrderSummary, {
|
|
@@ -337,7 +335,7 @@ function CustomizationScreen({ product, loading, errorReference, errorMessage, b
|
|
|
337
335
|
type: "button",
|
|
338
336
|
className: "hdl-customization-skip",
|
|
339
337
|
disabled: busy || syncing,
|
|
340
|
-
onClick:
|
|
338
|
+
onClick: omitPrimaryProduct
|
|
341
339
|
}, _pisell_utils.locales.getText("pisell2.hdl-kiosk.customization-skip")));
|
|
342
340
|
}
|
|
343
341
|
//#endregion
|
|
@@ -13,6 +13,25 @@ decimal_js = require_runtime.__toESM(decimal_js);
|
|
|
13
13
|
* SkuValue 和“新增或原行发生变化”的最小 receipt/Projection 事实。
|
|
14
14
|
* 边界:页面输入变化不调用本 Operation;OS 内部的加购弹窗与业务判断不属于 HDLKiosk。
|
|
15
15
|
*/
|
|
16
|
+
const productRemovePrimaryProductOperation = require_types.defineOperation({
|
|
17
|
+
id: "product.removePrimaryProduct",
|
|
18
|
+
conflictScope: "cart",
|
|
19
|
+
timeoutMs: 15e3,
|
|
20
|
+
retry: "explicit-user",
|
|
21
|
+
execute: function() {
|
|
22
|
+
var _ref = require_asyncToGenerator._asyncToGenerator(function* (context, input, signal) {
|
|
23
|
+
if (!input.lineId) return {
|
|
24
|
+
status: "succeeded",
|
|
25
|
+
data: {}
|
|
26
|
+
};
|
|
27
|
+
const mutation = yield context.host.sales.removeLine({ lineId: input.lineId }, signal);
|
|
28
|
+
return require_cartConsistency.finalizeCartMutation(context, mutation, signal, () => mutation.status === "succeeded" && mutation.data.removedLineId === input.lineId || !context.host.sales.getObservedSnapshot().cart.lines.some((item) => item.lineId === input.lineId));
|
|
29
|
+
});
|
|
30
|
+
return function execute(_x, _x2, _x3) {
|
|
31
|
+
return _ref.apply(this, arguments);
|
|
32
|
+
};
|
|
33
|
+
}()
|
|
34
|
+
});
|
|
16
35
|
function hasValidSkuValue(input) {
|
|
17
36
|
const canonical = require_canonicalSkuValue.canonicalizeSkuValue(input.skuValue);
|
|
18
37
|
return Boolean(input.productId && canonical && canonical.productId === input.productId);
|
|
@@ -31,7 +50,7 @@ const productSyncPrimaryWeightedProductOperation = require_types.defineOperation
|
|
|
31
50
|
conflictScope: "cart",
|
|
32
51
|
retry: "explicit-user",
|
|
33
52
|
execute: function() {
|
|
34
|
-
var
|
|
53
|
+
var _ref2 = require_asyncToGenerator._asyncToGenerator(function* (context, input, signal) {
|
|
35
54
|
if (!hasValidSkuValue(input)) return require_errors.operationFailed("customizationInputInvalid", "back");
|
|
36
55
|
const beforeLines = new Map(context.host.sales.getObservedSnapshot().cart.lines.map((line) => [line.lineId, line.quantity]));
|
|
37
56
|
const before = context.host.sales.getObservedSnapshot();
|
|
@@ -54,10 +73,11 @@ const productSyncPrimaryWeightedProductOperation = require_types.defineOperation
|
|
|
54
73
|
return Boolean(confirmedLine && confirmedLine.productId === input.productId && (!(successfulOutcome === null || successfulOutcome === void 0 ? void 0 : successfulOutcome.affectedLineId) || confirmedLine.lineId === successfulOutcome.affectedLineId) && (!input.existingLineId || (successfulOutcome === null || successfulOutcome === void 0 ? void 0 : successfulOutcome.affectedLineId) === input.existingLineId && confirmedLine.lineId === input.existingLineId) && sameWeight(confirmedLine.quantity, input.measurement.netWeightKg) && sameSkuValue(input.skuValue, confirmedLine.skuValue) && (Boolean(input.existingLineId) || !beforeLines.has(confirmedLine.lineId) || beforeLines.get(confirmedLine.lineId) !== confirmedLine.quantity)) || projectionMatches;
|
|
55
74
|
});
|
|
56
75
|
});
|
|
57
|
-
return function execute(
|
|
58
|
-
return
|
|
76
|
+
return function execute(_x4, _x5, _x6) {
|
|
77
|
+
return _ref2.apply(this, arguments);
|
|
59
78
|
};
|
|
60
79
|
}()
|
|
61
80
|
});
|
|
62
81
|
//#endregion
|
|
82
|
+
exports.productRemovePrimaryProductOperation = productRemovePrimaryProductOperation;
|
|
63
83
|
exports.productSyncPrimaryWeightedProductOperation = productSyncPrimaryWeightedProductOperation;
|
|
@@ -7,13 +7,9 @@ const customizationSlice = require_defineSlice.defineSlice({
|
|
|
7
7
|
id: "customization",
|
|
8
8
|
screen: { id: "customization" },
|
|
9
9
|
commands: { removePrimaryProduct: require_cart.cartRemoveLineOperation },
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
when: "inputPresent",
|
|
14
|
-
navigate: "next"
|
|
15
|
-
}),
|
|
16
|
-
back: require_defineSlice.back()
|
|
10
|
+
intents: {
|
|
11
|
+
complete: require_defineSlice.effect(require_operation.productSyncPrimaryWeightedProductOperation, { navigate: "next" }),
|
|
12
|
+
omit: require_defineSlice.effect(require_operation.productRemovePrimaryProductOperation, { navigate: "next" })
|
|
17
13
|
}
|
|
18
14
|
});
|
|
19
15
|
//#endregion
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const require_runtime = require("../../../../_virtual/_rolldown/runtime.js");
|
|
2
|
+
const require_selectors = require("../../kernel/workflow/selectors.js");
|
|
2
3
|
const require_utils = require("../../utils.js");
|
|
3
4
|
const require_index = require("./Screen/index.js");
|
|
4
5
|
let react = require("react");
|
|
@@ -18,7 +19,7 @@ function createCustomizationOrderBarModel(sales, primaryProductId) {
|
|
|
18
19
|
}))[0] : void 0
|
|
19
20
|
});
|
|
20
21
|
}
|
|
21
|
-
const renderCustomization = ({
|
|
22
|
+
const renderCustomization = ({ snapshot, viewSnapshot, sales, commandState, customization, scaleMinimumWeightKg, send }) => {
|
|
22
23
|
var _snapshot$activeOpera, _commandState$error, _customization$produc;
|
|
23
24
|
const syncing = snapshot.status === "running" && ((_snapshot$activeOpera = snapshot.activeOperation) === null || _snapshot$activeOpera === void 0 ? void 0 : _snapshot$activeOpera.definitionId) === "product.syncPrimaryWeightedProduct";
|
|
24
25
|
const error = require_utils.resolveHDLKioskErrorPresentation({
|
|
@@ -33,7 +34,7 @@ const renderCustomization = ({ node, snapshot, viewSnapshot, sales, commandState
|
|
|
33
34
|
errorMessage: error === null || error === void 0 ? void 0 : error.message,
|
|
34
35
|
busy: viewSnapshot.status === "running" && !syncing,
|
|
35
36
|
syncing,
|
|
36
|
-
canGoBack:
|
|
37
|
+
canGoBack: require_selectors.canNavigateBack(snapshot),
|
|
37
38
|
minimumWeightKg: scaleMinimumWeightKg,
|
|
38
39
|
orderBar: createCustomizationOrderBarModel(sales, ((_customization$produc = customization.product) === null || _customization$produc === void 0 ? void 0 : _customization$produc.id) == null ? void 0 : String(customization.product.id)),
|
|
39
40
|
send
|
|
@@ -188,8 +188,8 @@ function FulfillmentScreen({ model, orderBar, send }) {
|
|
|
188
188
|
className: "hdl-floating-bar__button",
|
|
189
189
|
disabled: model.busy,
|
|
190
190
|
onClick: () => send({
|
|
191
|
-
kind: "
|
|
192
|
-
|
|
191
|
+
kind: "navigation",
|
|
192
|
+
direction: "back"
|
|
193
193
|
})
|
|
194
194
|
}, /* @__PURE__ */ react.default.createElement(BackIcon, null), /* @__PURE__ */ react.default.createElement("span", null, _pisell_utils.locales.getText("pisell2.hdl-kiosk.back"))) : void 0,
|
|
195
195
|
summary: /* @__PURE__ */ react.default.createElement(require_index$1.HDLKioskOrderSummary, {
|
|
@@ -225,8 +225,8 @@ function FulfillmentScreen({ model, orderBar, send }) {
|
|
|
225
225
|
className: "hdl-fulfillment-card",
|
|
226
226
|
disabled: model.busy,
|
|
227
227
|
onClick: () => send({
|
|
228
|
-
kind: "
|
|
229
|
-
|
|
228
|
+
kind: "intent",
|
|
229
|
+
intent: "complete",
|
|
230
230
|
contextPatch: { fulfillment: "dine_in" },
|
|
231
231
|
operationInput: { mode: "dine_in" }
|
|
232
232
|
})
|
|
@@ -235,8 +235,8 @@ function FulfillmentScreen({ model, orderBar, send }) {
|
|
|
235
235
|
className: "hdl-fulfillment-card",
|
|
236
236
|
disabled: model.busy,
|
|
237
237
|
onClick: () => send({
|
|
238
|
-
kind: "
|
|
239
|
-
|
|
238
|
+
kind: "intent",
|
|
239
|
+
intent: "complete",
|
|
240
240
|
contextPatch: { fulfillment: "takeaway" },
|
|
241
241
|
operationInput: { mode: "takeaway" }
|
|
242
242
|
})
|
|
@@ -5,13 +5,10 @@ const require_fulfillment = require("../../app/operations/fulfillment.js");
|
|
|
5
5
|
const fulfillmentSlice = require_defineSlice.defineSlice({
|
|
6
6
|
id: "fulfillment",
|
|
7
7
|
screen: { id: "fulfillment" },
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}),
|
|
13
|
-
back: require_defineSlice.back()
|
|
14
|
-
}
|
|
8
|
+
intents: { complete: require_defineSlice.effect(require_fulfillment.setFulfillmentOperation, {
|
|
9
|
+
precondition: "fulfillment.selected",
|
|
10
|
+
navigate: "next"
|
|
11
|
+
}) }
|
|
15
12
|
});
|
|
16
13
|
//#endregion
|
|
17
14
|
exports.fulfillmentSlice = fulfillmentSlice;
|
|
@@ -10,21 +10,26 @@ const QR_CELLS = Object.freeze(Array.from({ length: 49 }, (_, index) => index *
|
|
|
10
10
|
* Quick Order 的前置会员提示页。
|
|
11
11
|
*
|
|
12
12
|
* 宿主可注入认证 UI;未注入时保留 QR / SMS 视觉 fallback。Skip 继续产生
|
|
13
|
-
* identity.
|
|
13
|
+
* identity.omit Intent,由本地 Exit Policy 同步访客后进入下一步。
|
|
14
14
|
*/
|
|
15
15
|
function IdentityScreen({ model, orderBar, send, renderIdentityAuth }) {
|
|
16
|
+
const [authBusy, setAuthBusy] = (0, react.useState)(false);
|
|
17
|
+
const busy = model.busy || authBusy;
|
|
18
|
+
const handleAuthBusyChange = (0, react.useCallback)((nextBusy) => {
|
|
19
|
+
setAuthBusy(nextBusy);
|
|
20
|
+
}, []);
|
|
16
21
|
const hasOrder = Boolean(orderBar && orderBar.cartLineCount > 0);
|
|
17
22
|
const { openCart } = require_index.useHDLKioskBottomBarController();
|
|
18
23
|
require_index.useHDLKioskBottomBar((0, react.useMemo)(() => ({
|
|
19
24
|
ariaLabel: _pisell_utils.locales.getText("pisell2.hdl-kiosk.identity-actions-label"),
|
|
20
|
-
cartEnabled: hasOrder && !
|
|
25
|
+
cartEnabled: hasOrder && !busy,
|
|
21
26
|
variant: "composed",
|
|
22
27
|
summary: orderBar ? /* @__PURE__ */ react.default.createElement(require_index$1.HDLKioskOrderSummary, {
|
|
23
28
|
lineCount: orderBar.cartLineCount,
|
|
24
29
|
totalText: orderBar.totalText,
|
|
25
30
|
detailText: orderBar.totalText ? _pisell_utils.locales.getText("pisell2.hdl-kiosk.catalog-cart-hint") : orderBar.totalLabel,
|
|
26
31
|
cartAriaLabel: _pisell_utils.locales.getText("pisell2.hdl-kiosk.cart-drawer-title"),
|
|
27
|
-
disabled:
|
|
32
|
+
disabled: busy || !hasOrder,
|
|
28
33
|
onOpenCart: openCart
|
|
29
34
|
}) : void 0,
|
|
30
35
|
cartOpenBar: hasOrder ? (controller) => ({
|
|
@@ -32,7 +37,7 @@ function IdentityScreen({ model, orderBar, send, renderIdentityAuth }) {
|
|
|
32
37
|
leading: /* @__PURE__ */ react.default.createElement("button", {
|
|
33
38
|
type: "button",
|
|
34
39
|
className: "hdl-floating-bar__button",
|
|
35
|
-
disabled:
|
|
40
|
+
disabled: busy,
|
|
36
41
|
onClick: controller.onClose
|
|
37
42
|
}, /* @__PURE__ */ react.default.createElement("svg", {
|
|
38
43
|
viewBox: "0 0 24 24",
|
|
@@ -40,17 +45,18 @@ function IdentityScreen({ model, orderBar, send, renderIdentityAuth }) {
|
|
|
40
45
|
}, /* @__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")))
|
|
41
46
|
}) : void 0
|
|
42
47
|
}), [
|
|
48
|
+
busy,
|
|
43
49
|
hasOrder,
|
|
44
|
-
model.busy,
|
|
45
50
|
openCart,
|
|
46
51
|
orderBar
|
|
47
52
|
]));
|
|
48
53
|
const authContent = renderIdentityAuth === null || renderIdentityAuth === void 0 ? void 0 : renderIdentityAuth({
|
|
49
|
-
busy
|
|
54
|
+
busy,
|
|
50
55
|
disabled: model.busy,
|
|
56
|
+
onBusyChange: handleAuthBusyChange,
|
|
51
57
|
onAuthenticated: (customerId) => send({
|
|
52
|
-
kind: "
|
|
53
|
-
|
|
58
|
+
kind: "intent",
|
|
59
|
+
intent: "complete",
|
|
54
60
|
operationInput: { customerId }
|
|
55
61
|
})
|
|
56
62
|
});
|
|
@@ -73,10 +79,10 @@ function IdentityScreen({ model, orderBar, send, renderIdentityAuth }) {
|
|
|
73
79
|
}, _pisell_utils.locales.getText("pisell2.hdl-kiosk.login-via-sms"))), /* @__PURE__ */ react.default.createElement("button", {
|
|
74
80
|
type: "button",
|
|
75
81
|
className: "hdl-identity-screen__skip",
|
|
76
|
-
disabled:
|
|
82
|
+
disabled: busy,
|
|
77
83
|
onClick: () => send({
|
|
78
|
-
kind: "
|
|
79
|
-
|
|
84
|
+
kind: "intent",
|
|
85
|
+
intent: "omit",
|
|
80
86
|
operationInput: {}
|
|
81
87
|
})
|
|
82
88
|
}, _pisell_utils.locales.getText("pisell2.hdl-kiosk.skip")), model.errorReference ? /* @__PURE__ */ react.default.createElement("div", {
|
|
@@ -1,20 +1,13 @@
|
|
|
1
1
|
const require_defineSlice = require("../../kernel/application/defineSlice.js");
|
|
2
2
|
const require_operation = require("./operation.js");
|
|
3
3
|
//#region src/components/HDLKiosk/slices/identity/slice.ts
|
|
4
|
-
/** Identity Slice:声明身份节点的
|
|
4
|
+
/** Identity Slice:声明身份节点的 Intent 与客户同步 Effect;不依赖 React 或 Host 实现。 */
|
|
5
5
|
const identitySlice = require_defineSlice.defineSlice({
|
|
6
6
|
id: "identity",
|
|
7
7
|
screen: { id: "identity" },
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
} },
|
|
12
|
-
outcomes: {
|
|
13
|
-
memberRecognized: require_defineSlice.effect(require_operation.identitySyncOperation, {
|
|
14
|
-
when: "inputPresent",
|
|
15
|
-
navigate: "next"
|
|
16
|
-
}),
|
|
17
|
-
skipped: require_defineSlice.effect(require_operation.identitySyncOperation, { navigate: "next" })
|
|
8
|
+
intents: {
|
|
9
|
+
complete: require_defineSlice.effect(require_operation.identitySyncOperation, { navigate: "next" }),
|
|
10
|
+
omit: require_defineSlice.effect(require_operation.identitySyncOperation, { navigate: "next" })
|
|
18
11
|
}
|
|
19
12
|
});
|
|
20
13
|
//#endregion
|