@pisell/private-materials 6.12.181 → 6.12.182
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 +10 -10
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +10 -10
- package/es/components/HDLKiosk/app/operations.js +0 -3
- package/es/components/HDLKiosk/components/common/BlockingNotice/index.js +12 -2
- package/es/components/HDLKiosk/components/common/BlockingNotice/index.less +84 -0
- 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 +4 -3
- package/es/components/HDLKiosk/docs/02-Host/351/200/202/351/205/215/344/270/216/344/270/232/345/212/241/346/225/260/346/215/256.md +1 -1
- 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 +2 -2
- package/es/components/HDLKiosk/docs/05-/344/272/244/346/230/223/345/256/211/345/205/250.md +2 -2
- package/es/components/HDLKiosk/docs//346/236/266/346/236/204/350/256/276/350/256/241.md +1 -1
- package/es/components/HDLKiosk/runtime/operations/checkoutSafety.js +2 -1
- package/es/components/HDLKiosk/slices/payment/view.js +2 -2
- package/es/components/HDLKiosk/ui/HDLKioskWorkflowView.js +16 -4
- package/es/components/HDLKiosk/utils.js +2 -2
- package/es/components/bigSale/templates/HDLKiosk/index.js +2 -0
- package/es/components/bigSale/templates/HDLKiosk/payment/HDLKioskPaymentRuntime.js +2 -2
- package/es/components/bigSale/templates/HDLKiosk/payment/noPaymentOrder.js +2 -2
- package/es/components/bigSale/templates/HDLKiosk/utils/transactionState.js +8 -4
- package/lib/components/HDLKiosk/app/operations.js +0 -3
- package/lib/components/HDLKiosk/components/common/BlockingNotice/index.js +12 -2
- package/lib/components/HDLKiosk/components/common/BlockingNotice/index.less +84 -0
- 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 +4 -3
- package/lib/components/HDLKiosk/docs/02-Host/351/200/202/351/205/215/344/270/216/344/270/232/345/212/241/346/225/260/346/215/256.md +1 -1
- 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 +2 -2
- package/lib/components/HDLKiosk/docs/05-/344/272/244/346/230/223/345/256/211/345/205/250.md +2 -2
- package/lib/components/HDLKiosk/docs//346/236/266/346/236/204/350/256/276/350/256/241.md +1 -1
- package/lib/components/HDLKiosk/runtime/operations/checkoutSafety.js +2 -1
- package/lib/components/HDLKiosk/slices/payment/view.js +2 -2
- package/lib/components/HDLKiosk/ui/HDLKioskWorkflowView.js +16 -4
- package/lib/components/HDLKiosk/utils.js +2 -2
- package/lib/components/bigSale/templates/HDLKiosk/index.js +2 -0
- package/lib/components/bigSale/templates/HDLKiosk/payment/HDLKioskPaymentRuntime.js +1 -1
- package/lib/components/bigSale/templates/HDLKiosk/payment/noPaymentOrder.js +1 -1
- package/lib/components/bigSale/templates/HDLKiosk/utils/transactionState.js +8 -4
- package/package.json +2 -2
|
@@ -54,14 +54,14 @@ function createPaymentFeedback(snapshot, sales) {
|
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
56
|
function createCheckoutScreenModel(snapshot, sales, payment, completed = false, resetting = false, sourceData, paymentResult) {
|
|
57
|
-
var
|
|
57
|
+
var _ref, _sourceData$amountDue;
|
|
58
58
|
const tempOrder = completed ? void 0 : sourceData === null || sourceData === void 0 ? void 0 : sourceData.tempOrder;
|
|
59
59
|
const completedOrder = completed ? sourceData === null || sourceData === void 0 ? void 0 : sourceData.completedOrder : void 0;
|
|
60
60
|
const sourceSummary = completed ? void 0 : sourceData === null || sourceData === void 0 ? void 0 : sourceData.summary;
|
|
61
61
|
const paymentSafeToChange = sales.payment.status === "idle" || sales.payment.status === "failed";
|
|
62
62
|
const interactionAvailable = !completed && !resetting && snapshot.status === "idle" && paymentSafeToChange;
|
|
63
63
|
const noPaymentRequired = !completed && require_utils.isZeroCheckoutDue(sales);
|
|
64
|
-
const sourceAmountDue = (
|
|
64
|
+
const sourceAmountDue = (_ref = (_sourceData$amountDue = sourceData === null || sourceData === void 0 ? void 0 : sourceData.amountDue) !== null && _sourceData$amountDue !== void 0 ? _sourceData$amountDue : sourceSummary === null || sourceSummary === void 0 ? void 0 : sourceSummary.amount_gap) !== null && _ref !== void 0 ? _ref : sourceSummary === null || sourceSummary === void 0 ? void 0 : sourceSummary.expect_amount;
|
|
65
65
|
const sourceCurrencySymbol = tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.currency_symbol;
|
|
66
66
|
const totalText = sales.summary.status === "ready" ? require_utils.formatCurrencyAmount(sales.summary.due, sales.summary.currencySymbol) : sourceAmountDue !== void 0 && sourceAmountDue !== null ? require_utils.formatCurrencyAmount(sourceAmountDue, sourceCurrencySymbol) : void 0;
|
|
67
67
|
return Object.freeze({
|
|
@@ -44,11 +44,14 @@ function HDLKioskWorkflowCartOverlay({ model, busy, memberAction, send, renderCa
|
|
|
44
44
|
} : void 0
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
|
-
function HDLKioskWorkflowBlockingSurface({ snapshot, title, description, reference, hideBottomBar = false }) {
|
|
47
|
+
function HDLKioskWorkflowBlockingSurface({ snapshot, title, description, reference, hideBottomBar = false, actionLabel, actionBusy = false, onAction }) {
|
|
48
48
|
return /* @__PURE__ */ react.default.createElement(require_index$4.HDLKioskShell, { snapshot }, /* @__PURE__ */ react.default.createElement(require_index$5.HDLKioskBottomBarHost, { mode: hideBottomBar ? "hidden" : void 0 }, /* @__PURE__ */ react.default.createElement(require_index$1.HDLKioskHeader, null), /* @__PURE__ */ react.default.createElement("main", { className: "hdl-shell__main" }, /* @__PURE__ */ react.default.createElement(require_index$6.BlockingNotice, {
|
|
49
49
|
title,
|
|
50
50
|
description,
|
|
51
|
-
reference
|
|
51
|
+
reference,
|
|
52
|
+
actionLabel,
|
|
53
|
+
actionBusy,
|
|
54
|
+
onAction
|
|
52
55
|
}))));
|
|
53
56
|
}
|
|
54
57
|
/**
|
|
@@ -126,6 +129,9 @@ function HDLKioskWorkflowView({ session, host, sales, config, isActive, returnin
|
|
|
126
129
|
const returnFromPaymentConflict = (0, react.useCallback)(() => {
|
|
127
130
|
returnToEntry("payment-order-conflict");
|
|
128
131
|
}, [returnToEntry]);
|
|
132
|
+
const recoverToEntry = (0, react.useCallback)(() => {
|
|
133
|
+
returnToEntry(snapshot.status === "blocked" ? "blocked-recovery" : "reset-retry");
|
|
134
|
+
}, [returnToEntry, snapshot.status]);
|
|
129
135
|
const customer = require_useHDLKioskCustomerController.useHDLKioskCustomerController({
|
|
130
136
|
session,
|
|
131
137
|
snapshot,
|
|
@@ -198,7 +204,10 @@ function HDLKioskWorkflowView({ session, host, sales, config, isActive, returnin
|
|
|
198
204
|
snapshot,
|
|
199
205
|
title: _pisell_utils.locales.getText("pisell2.hdl-kiosk.reset-failed-title"),
|
|
200
206
|
description: _pisell_utils.locales.getText("pisell2.hdl-kiosk.reset-failed-description"),
|
|
201
|
-
reference: returnError.traceId
|
|
207
|
+
reference: returnError.traceId,
|
|
208
|
+
actionLabel: _pisell_utils.locales.getText(returning ? "pisell2.hdl-kiosk.resetting-order" : "pisell2.hdl-kiosk.back-home"),
|
|
209
|
+
actionBusy: returning,
|
|
210
|
+
onAction: recoverToEntry
|
|
202
211
|
});
|
|
203
212
|
if (snapshot.status === "blocked") {
|
|
204
213
|
var _snapshot$lastError;
|
|
@@ -207,7 +216,10 @@ function HDLKioskWorkflowView({ session, host, sales, config, isActive, returnin
|
|
|
207
216
|
title: _pisell_utils.locales.getText("pisell2.hdl-kiosk.blocked-title"),
|
|
208
217
|
description: _pisell_utils.locales.getText("pisell2.hdl-kiosk.blocked-description"),
|
|
209
218
|
reference: (_snapshot$lastError = snapshot.lastError) === null || _snapshot$lastError === void 0 ? void 0 : _snapshot$lastError.traceId,
|
|
210
|
-
hideBottomBar: true
|
|
219
|
+
hideBottomBar: true,
|
|
220
|
+
actionLabel: _pisell_utils.locales.getText(returning ? "pisell2.hdl-kiosk.resetting-order" : "pisell2.hdl-kiosk.back-home"),
|
|
221
|
+
actionBusy: returning,
|
|
222
|
+
onAction: recoverToEntry
|
|
211
223
|
});
|
|
212
224
|
}
|
|
213
225
|
if (paymentOrderConflict) return /* @__PURE__ */ react.default.createElement(require_index$4.HDLKioskShell, { snapshot }, /* @__PURE__ */ react.default.createElement(require_index$5.HDLKioskBottomBarHost, { mode: "hidden" }, /* @__PURE__ */ react.default.createElement(require_index$1.HDLKioskHeader, null), /* @__PURE__ */ react.default.createElement("main", { className: "hdl-shell__main" }, /* @__PURE__ */ react.default.createElement(require_index$7.PaymentConflictNotice, {
|
|
@@ -48,7 +48,7 @@ function isMergedSourceBookingLine(line, product) {
|
|
|
48
48
|
}
|
|
49
49
|
/** 直接从 sourceData 就近派生 UI 所需字段,不经过 Host 或 Template DTO。 */
|
|
50
50
|
function createSourceDataSalesView(sourceData) {
|
|
51
|
-
var _sourceData$cartItems, _tempOrder$payment_st, _tempOrder$currency_c, _tempOrder$currency_s, _summary$total_amount, _ref9,
|
|
51
|
+
var _sourceData$cartItems, _tempOrder$payment_st, _tempOrder$currency_c, _tempOrder$currency_s, _summary$total_amount, _ref9, _ref10, _sourceData$amountDue, _customer$id, _tempOrder$order_id, _sourceData$salesStat, _summary$product_quan;
|
|
52
52
|
const lines = Object.freeze(((_sourceData$cartItems = sourceData === null || sourceData === void 0 ? void 0 : sourceData.cartItems) !== null && _sourceData$cartItems !== void 0 ? _sourceData$cartItems : []).map((rawLine) => {
|
|
53
53
|
var _ref2, _ref3, _rawLine$_extend$disp, _rawLine$_extend, _product$_extend5, _product$product_sku$, _product$product_sku2, _product$product_sku$2, _product$product_sku3, _ref4, _product$product_sku$3, _product$product_sku4, _product$total, _ref5, _product$image_url, _product$image, _product$main_image, _ref6, _product$product_id2, _ref7, _ref8, _product$title, _rawLine$_extend2;
|
|
54
54
|
const product = readSourceProduct(rawLine);
|
|
@@ -84,7 +84,7 @@ function createSourceDataSalesView(sourceData) {
|
|
|
84
84
|
currency: String((_tempOrder$currency_c = tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.currency_code) !== null && _tempOrder$currency_c !== void 0 ? _tempOrder$currency_c : ""),
|
|
85
85
|
currencySymbol: String((_tempOrder$currency_s = tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.currency_symbol) !== null && _tempOrder$currency_s !== void 0 ? _tempOrder$currency_s : ""),
|
|
86
86
|
total: String((_summary$total_amount = summary.total_amount) !== null && _summary$total_amount !== void 0 ? _summary$total_amount : 0),
|
|
87
|
-
due: String((_ref9 = (
|
|
87
|
+
due: String((_ref9 = (_ref10 = (_sourceData$amountDue = sourceData === null || sourceData === void 0 ? void 0 : sourceData.amountDue) !== null && _sourceData$amountDue !== void 0 ? _sourceData$amountDue : summary.amount_gap) !== null && _ref10 !== void 0 ? _ref10 : summary.expect_amount) !== null && _ref9 !== void 0 ? _ref9 : 0)
|
|
88
88
|
} : { status: "missing" };
|
|
89
89
|
const customerId = String((_customer$id = customer === null || customer === void 0 ? void 0 : customer.id) !== null && _customer$id !== void 0 ? _customer$id : "");
|
|
90
90
|
const fingerprint = [
|
|
@@ -5,6 +5,7 @@ const require_serve = require("../../../ticketBooking/serve.js");
|
|
|
5
5
|
const require_locales = require("../../../HDLKiosk/locales.js");
|
|
6
6
|
const require_index = require("../../../HDLKiosk/index.js");
|
|
7
7
|
const require_config = require("../../../HDLKiosk/app/contracts/config.js");
|
|
8
|
+
const require_transactionState = require("./utils/transactionState.js");
|
|
8
9
|
const require_useBigSaleHDLKioskAdapter = require("./hooks/useBigSaleHDLKioskAdapter.js");
|
|
9
10
|
const require_useHDLKioskEntryPreparationToast = require("./hooks/useHDLKioskEntryPreparationToast.js");
|
|
10
11
|
const require_HDLKioskPaymentRuntime = require("./payment/HDLKioskPaymentRuntime.js");
|
|
@@ -138,6 +139,7 @@ function HDLKioskBigSaleTemplate({ isActive = true, context, businessCode, local
|
|
|
138
139
|
cartItems: (_context$cart$display = context.cart.displayLines) !== null && _context$cart$display !== void 0 ? _context$cart$display : context.cart.items,
|
|
139
140
|
customer: context.customer.selected,
|
|
140
141
|
summary: context.summary.summary,
|
|
142
|
+
amountDue: require_transactionState.resolveBigSaleCurrentAmountDue(context),
|
|
141
143
|
salesStatus: context.sales.status,
|
|
142
144
|
cartConsistencyPending: context.cart.consistencyPending
|
|
143
145
|
},
|
|
@@ -34,7 +34,7 @@ function asKioskMethod(method) {
|
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
36
|
function currentAmount(context) {
|
|
37
|
-
const amount = require_transactionState.
|
|
37
|
+
const amount = require_transactionState.resolveBigSaleCurrentAmountDue(context);
|
|
38
38
|
return typeof amount === "number" && Number.isFinite(amount) && amount > 0 ? amount : 0;
|
|
39
39
|
}
|
|
40
40
|
function HDLKioskPaymentRuntime({ context, controllerRef, onPaymentResultChange }) {
|
|
@@ -23,7 +23,7 @@ function completeBigSaleNoPaymentOrder(_x) {
|
|
|
23
23
|
function _completeBigSaleNoPaymentOrder() {
|
|
24
24
|
_completeBigSaleNoPaymentOrder = require_asyncToGenerator._asyncToGenerator(function* ({ context, signal, onCompleted }) {
|
|
25
25
|
var _data$payment_status;
|
|
26
|
-
if (require_transactionState.
|
|
26
|
+
if (require_transactionState.resolveBigSaleCurrentAmountDue(context) !== 0) return require_normalize.failed("noPaymentAmountInvalid", "back");
|
|
27
27
|
if (signal.aborted) return {
|
|
28
28
|
status: "cancelled",
|
|
29
29
|
reason: "noPaymentAbortedBeforeDispatch"
|
|
@@ -17,8 +17,12 @@ function finiteMoney(value) {
|
|
|
17
17
|
const amount = Number(value);
|
|
18
18
|
return Number.isFinite(amount) ? value : void 0;
|
|
19
19
|
}
|
|
20
|
-
/**
|
|
21
|
-
|
|
20
|
+
/**
|
|
21
|
+
* 解析 HDLKiosk 当前临时订单的实时应付金额。
|
|
22
|
+
* 仅用于提交前 To Pay、Payment Amount Due、支付入口和零元门禁;正式提交返回的
|
|
23
|
+
* order_wait_pay_amount 只负责结果一致性确认,不能反向成为 Kiosk 展示状态。
|
|
24
|
+
*/
|
|
25
|
+
function resolveBigSaleCurrentAmountDue(context) {
|
|
22
26
|
var _context$summary$summ, _context$sales$bookin, _context$sales$bookin2, _finiteMoney;
|
|
23
27
|
const liveOrder = resolveBigSaleLiveTempOrder(context);
|
|
24
28
|
const summary = (_context$summary$summ = context.summary.summary) !== null && _context$summary$summ !== void 0 ? _context$summary$summ : liveOrder === null || liveOrder === void 0 ? void 0 : liveOrder.summary;
|
|
@@ -106,7 +110,7 @@ function projectBigSaleTransactionState(context, observationId = 0) {
|
|
|
106
110
|
const rawLines = (_context$cart$display = context.cart.displayLines) !== null && _context$cart$display !== void 0 ? _context$cart$display : context.cart.items;
|
|
107
111
|
const lines = Object.freeze(rawLines.map(projectBigSaleCartLine).filter((line) => line !== null));
|
|
108
112
|
const summary = context.summary.summary;
|
|
109
|
-
const amountDue =
|
|
113
|
+
const amountDue = resolveBigSaleCurrentAmountDue(context);
|
|
110
114
|
const liveOrder = resolveBigSaleLiveTempOrder(context);
|
|
111
115
|
const normalizedSummary = summary && amountDue !== void 0 ? Object.freeze({
|
|
112
116
|
status: "ready",
|
|
@@ -164,6 +168,6 @@ function createBigSaleTransactionStateReader(getContext) {
|
|
|
164
168
|
//#endregion
|
|
165
169
|
exports.createBigSaleTransactionStateReader = createBigSaleTransactionStateReader;
|
|
166
170
|
exports.projectBigSaleCartLine = projectBigSaleCartLine;
|
|
167
|
-
exports.
|
|
171
|
+
exports.resolveBigSaleCurrentAmountDue = resolveBigSaleCurrentAmountDue;
|
|
168
172
|
exports.resolveBigSaleLineId = resolveBigSaleLineId;
|
|
169
173
|
exports.resolveBigSaleLiveTempOrder = resolveBigSaleLiveTempOrder;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/private-materials",
|
|
3
|
-
"version": "6.12.
|
|
3
|
+
"version": "6.12.182",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -70,8 +70,8 @@
|
|
|
70
70
|
"styled-components": "^6.0.0-rc.3",
|
|
71
71
|
"use-sync-external-store": "^1.6.0",
|
|
72
72
|
"@pisell/pi-payment-sdk": "0.0.3",
|
|
73
|
-
"@pisell/date-picker": "3.0.10",
|
|
74
73
|
"@pisell/icon": "0.0.11",
|
|
74
|
+
"@pisell/date-picker": "3.0.10",
|
|
75
75
|
"@pisell/utils": "3.0.4",
|
|
76
76
|
"@pisell/materials": "6.12.52"
|
|
77
77
|
},
|