@pisell/private-materials 6.12.163 → 6.12.164
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/preview.js +1 -1
- package/build/lowcode/render/default/view.js +15 -15
- package/build/lowcode/view.js +15 -15
- package/es/components/bigSale/components/ProductList/index.js +1 -1
- package/es/components/bigSale/dialog.js +5 -4
- package/es/components/bigSale/hooks/useSelectFloorMapResourceForBigSale.js +67 -24
- package/es/components/bigSale/templates/Standard/index.js +5 -3
- package/es/components/bigSale/utils/floorResourceSelection.js +106 -0
- package/es/components/bigSale/utils/orderIdentity.js +16 -0
- package/es/components/checkout/plugin.js +1 -1
- package/es/components/pay/toB/components/EFTPOS/index.js +1 -1
- package/es/components/ticketBooking/dialog.js +1 -1
- package/es/components/ticketBooking/hooks/pisellos/useProducts.js +1 -1
- package/es/plus/pisellReservation/utils/reservationTicketBookingHostParams.js +26 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/CardCom/index.js +23 -2
- package/es/plus/productSelect/ProductCard/SkuCard/components/CardWrapper/index.js +18 -1
- package/es/plus/saleDetail/tmpl/B/components/Pay/index.js +34 -24
- package/es/plus/salesSdk/services/refundPayments.js +1 -0
- package/es/plus/salesSdk/types.d.ts +9 -1
- package/es/pro/skuDetailModal/index.js +1 -1
- package/lib/components/bigSale/components/ProductList/index.js +1 -1
- package/lib/components/bigSale/dialog.js +5 -4
- package/lib/components/bigSale/hooks/useSelectFloorMapResourceForBigSale.js +67 -24
- package/lib/components/bigSale/templates/Standard/index.js +5 -3
- package/lib/components/bigSale/utils/floorResourceSelection.js +110 -0
- package/lib/components/bigSale/utils/orderIdentity.js +16 -0
- package/lib/components/checkout/plugin.js +1 -1
- package/lib/components/pay/toB/components/EFTPOS/index.js +1 -1
- package/lib/components/ticketBooking/dialog.js +1 -1
- package/lib/components/ticketBooking/hooks/pisellos/useProducts.js +1 -1
- package/lib/plus/pisellReservation/utils/reservationTicketBookingHostParams.js +26 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/CardCom/index.js +23 -2
- package/lib/plus/productSelect/ProductCard/SkuCard/components/CardWrapper/index.js +18 -1
- package/lib/plus/saleDetail/tmpl/B/components/Pay/index.js +33 -23
- package/lib/plus/salesSdk/services/refundPayments.js +1 -0
- package/lib/plus/salesSdk/types.d.ts +9 -1
- package/lib/pro/skuDetailModal/index.js +1 -1
- package/package.json +2 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const require_runtime = require("../../../../../_virtual/_rolldown/runtime.js");
|
|
2
2
|
const require_asyncToGenerator = require("../../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js");
|
|
3
3
|
const require_useEngineContext = require("../../../../../hooks/useEngineContext.js");
|
|
4
|
-
const require_index = require("../../../../../utils/index.js");
|
|
5
4
|
const require_useLogger = require("../../../../../hooks/useLogger.js");
|
|
5
|
+
const require_index = require("../../../../../utils/index.js");
|
|
6
6
|
const require_EFTPos = require("../../../../eftposPay/EFTPos.js");
|
|
7
7
|
let react = require("react");
|
|
8
8
|
react = require_runtime.__toESM(react);
|
|
@@ -4,8 +4,8 @@ const require_asyncToGenerator = require("../../_virtual/_@oxc-project_runtime@0
|
|
|
4
4
|
const require_useEngineContext = require("../../hooks/useEngineContext.js");
|
|
5
5
|
const require_index = require("../../pro/compensatedPisellContainer/index.js");
|
|
6
6
|
const require_withResponsive = require("../../responsive/withResponsive.js");
|
|
7
|
-
const require_index$1 = require("../../utils/index.js");
|
|
8
7
|
const require_useLogger = require("../../hooks/useLogger.js");
|
|
8
|
+
const require_index$1 = require("../../utils/index.js");
|
|
9
9
|
const require_serve = require("./serve.js");
|
|
10
10
|
const require_locales = require("./locales.js");
|
|
11
11
|
const require_formResourcePage = require("../../plus/pisellReservation/serve/formResourcePage.js");
|
|
@@ -3,8 +3,8 @@ const require_objectSpread2 = require("../../../../_virtual/_@oxc-project_runtim
|
|
|
3
3
|
const require_asyncToGenerator = require("../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js");
|
|
4
4
|
const require_useEngineContext = require("../../../../hooks/useEngineContext.js");
|
|
5
5
|
const require_bookingTicket = require("./bookingTicket.js");
|
|
6
|
-
const require_usePromotion = require("../../../booking/hooks/usePromotion.js");
|
|
7
6
|
const require_useLogger = require("../../../../hooks/useLogger.js");
|
|
7
|
+
const require_usePromotion = require("../../../booking/hooks/usePromotion.js");
|
|
8
8
|
let dayjs = require("dayjs");
|
|
9
9
|
dayjs = require_runtime.__toESM(dayjs);
|
|
10
10
|
let react = require("react");
|
|
@@ -49,6 +49,31 @@ function buildResourcePayloadFromReservationRow(row) {
|
|
|
49
49
|
deleted_at: null
|
|
50
50
|
}] };
|
|
51
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* 换桌时生成 booking.resources 协议数组。
|
|
54
|
+
*
|
|
55
|
+
* 只替换资源身份;资源占用人数沿用原 booking,避免换桌时改变人数或其它预约字段。
|
|
56
|
+
*/
|
|
57
|
+
function buildReplacementBookingResourcesFromReservationRow(row, currentBooking) {
|
|
58
|
+
var _capacityCandidates$m;
|
|
59
|
+
const resourceMap = buildResourcePayloadFromReservationRow(row);
|
|
60
|
+
const sourceResource = Object.values(resourceMap).flat()[0];
|
|
61
|
+
if (!sourceResource || Number(sourceResource.relation_id) <= 0) throw new Error("[BigSale] 所选桌台缺少有效资源 ID");
|
|
62
|
+
const currentResource = Array.isArray(currentBooking.resources) ? currentBooking.resources[0] : void 0;
|
|
63
|
+
const capacity = (_capacityCandidates$m = [
|
|
64
|
+
currentResource === null || currentResource === void 0 ? void 0 : currentResource.capacity,
|
|
65
|
+
currentBooking.number,
|
|
66
|
+
sourceResource.capacity
|
|
67
|
+
].map((value) => Number(value)).find((value) => Number.isFinite(value) && value >= 0)) !== null && _capacityCandidates$m !== void 0 ? _capacityCandidates$m : 0;
|
|
68
|
+
return [{
|
|
69
|
+
form_id: sourceResource.form_id,
|
|
70
|
+
relation_type: sourceResource.relation_type || "form",
|
|
71
|
+
relation_id: sourceResource.relation_id,
|
|
72
|
+
capacity,
|
|
73
|
+
like_status: sourceResource.like_status || "common",
|
|
74
|
+
metadata: sourceResource.metadata
|
|
75
|
+
}];
|
|
76
|
+
}
|
|
52
77
|
function buildInitialExtendCapacityFromRuleProduct(product) {
|
|
53
78
|
const capacitys = product === null || product === void 0 ? void 0 : product.capacity;
|
|
54
79
|
if ((capacitys === null || capacitys === void 0 ? void 0 : capacitys.type) !== "custom" || !Array.isArray(capacitys.custom)) return [{
|
|
@@ -140,6 +165,7 @@ function openNewReservationBookingFromHost(input) {
|
|
|
140
165
|
return true;
|
|
141
166
|
}
|
|
142
167
|
//#endregion
|
|
168
|
+
exports.buildReplacementBookingResourcesFromReservationRow = buildReplacementBookingResourcesFromReservationRow;
|
|
143
169
|
exports.buildResourcePayloadFromReservationRow = buildResourcePayloadFromReservationRow;
|
|
144
170
|
exports.buildServiceItemFromReservationRuleProduct = buildServiceItemFromReservationRuleProduct;
|
|
145
171
|
exports.openNewReservationBookingFromHost = openNewReservationBookingFromHost;
|
|
@@ -2,6 +2,7 @@ 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
3
|
const require_status = require("../../status.js");
|
|
4
4
|
const require_index = require("../Action/index.js");
|
|
5
|
+
const require_useLogger = require("../../../../../../hooks/useLogger.js");
|
|
5
6
|
const require_index$1 = require("../CardWrapper/index.js");
|
|
6
7
|
const require_index$2 = require("../Cover/index.js");
|
|
7
8
|
const require_useDynamicComponents = require("../../hooks/useDynamicComponents.js");
|
|
@@ -17,6 +18,7 @@ const CardCom = ({ props, className }) => {
|
|
|
17
18
|
var _productCardDefault$s, _dataSource$sortKeys3;
|
|
18
19
|
const [isFold, setIsFold] = (0, react.useState)(false);
|
|
19
20
|
require_useInitLocalesOnce.default(require_locales.default);
|
|
21
|
+
const logger = require_useLogger.default();
|
|
20
22
|
const { skuCardConfig, skuImageConfig, dataSource, skuActionConfig, skuTextConfig, style, rightStyle, onSelectCover, onSelectInfo, selectionTrigger = "pointerUp" } = props;
|
|
21
23
|
const { renderComponent } = require_useDynamicComponents.useDynamicComponents();
|
|
22
24
|
const { layoutDirection, displayMode, isFoldable } = skuCardConfig || (require_status.productCardDefault === null || require_status.productCardDefault === void 0 ? void 0 : require_status.productCardDefault.skuCardConfig) || {};
|
|
@@ -25,12 +27,31 @@ const CardCom = ({ props, className }) => {
|
|
|
25
27
|
const { paddingY, justifyContent, alignItems, slot } = (skuTextConfig === null || skuTextConfig === void 0 ? void 0 : skuTextConfig.infoConfig) || (require_status.productCardDefault === null || require_status.productCardDefault === void 0 || (_productCardDefault$s = require_status.productCardDefault.skuTextConfig) === null || _productCardDefault$s === void 0 ? void 0 : _productCardDefault$s.infoConfig) || {};
|
|
26
28
|
const handleSelect = (0, react.useCallback)((event, callback) => {
|
|
27
29
|
event.stopPropagation();
|
|
30
|
+
const reportProductSelection = () => {
|
|
31
|
+
var _logger$addLog, _dataSource$id, _dataSource$title;
|
|
32
|
+
logger === null || logger === void 0 || (_logger$addLog = logger.addLog) === null || _logger$addLog === void 0 || _logger$addLog.call(logger, {
|
|
33
|
+
type: "info",
|
|
34
|
+
title: `BigSale商品卡-${selectionTrigger}触发商品选择`,
|
|
35
|
+
metadata: {
|
|
36
|
+
productId: (_dataSource$id = dataSource === null || dataSource === void 0 ? void 0 : dataSource.id) !== null && _dataSource$id !== void 0 ? _dataSource$id : dataSource === null || dataSource === void 0 ? void 0 : dataSource.product_id,
|
|
37
|
+
productTitle: (_dataSource$title = dataSource === null || dataSource === void 0 ? void 0 : dataSource.title) !== null && _dataSource$title !== void 0 ? _dataSource$title : dataSource === null || dataSource === void 0 ? void 0 : dataSource.name
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
};
|
|
28
41
|
if (selectionTrigger === "click") {
|
|
42
|
+
reportProductSelection();
|
|
29
43
|
callback === null || callback === void 0 || callback(dataSource);
|
|
30
44
|
return;
|
|
31
45
|
}
|
|
32
|
-
requestAnimationFrame(() => requestAnimationFrame(() =>
|
|
33
|
-
|
|
46
|
+
requestAnimationFrame(() => requestAnimationFrame(() => {
|
|
47
|
+
reportProductSelection();
|
|
48
|
+
callback === null || callback === void 0 || callback(dataSource);
|
|
49
|
+
}));
|
|
50
|
+
}, [
|
|
51
|
+
dataSource,
|
|
52
|
+
logger === null || logger === void 0 ? void 0 : logger.addLog,
|
|
53
|
+
selectionTrigger
|
|
54
|
+
]);
|
|
34
55
|
/**
|
|
35
56
|
* @title: 文本区域样式
|
|
36
57
|
* @description:
|
|
@@ -4,6 +4,7 @@ const require_status = require("../../status.js");
|
|
|
4
4
|
const require_index = require("../Action/index.js");
|
|
5
5
|
const require_index$1 = require("../TooltipTags/index.js");
|
|
6
6
|
const require_index$2 = require("../CardMask/index.js");
|
|
7
|
+
const require_useLogger = require("../../../../../../hooks/useLogger.js");
|
|
7
8
|
let react = require("react");
|
|
8
9
|
react = require_runtime.__toESM(react);
|
|
9
10
|
let _pisell_materials = require("@pisell/materials");
|
|
@@ -12,6 +13,7 @@ classnames = require_runtime.__toESM(classnames);
|
|
|
12
13
|
require("./index.less");
|
|
13
14
|
//#region src/plus/productSelect/ProductCard/SkuCard/components/CardWrapper/index.tsx
|
|
14
15
|
const CardWrapper = (props) => {
|
|
16
|
+
const logger = require_useLogger.default();
|
|
15
17
|
const { children, className, style, skuCardConfig, skuActionConfig, skuStatusOverlayConfig, dataSource, onCardClick, isSelected, selectionTrigger = "pointerUp" } = props;
|
|
16
18
|
const { paddingX, paddingY, background, marginY, marginX, radius, borderWidth, borderColor, isBorderVisible, layoutDirection } = skuCardConfig || (require_status.productCardDefault === null || require_status.productCardDefault === void 0 ? void 0 : require_status.productCardDefault.skuCardConfig) || {};
|
|
17
19
|
const { method } = skuActionConfig || (require_status.productCardDefault === null || require_status.productCardDefault === void 0 ? void 0 : require_status.productCardDefault.skuActionConfig) || {};
|
|
@@ -36,11 +38,26 @@ const CardWrapper = (props) => {
|
|
|
36
38
|
marginY
|
|
37
39
|
]);
|
|
38
40
|
const handleCardSelect = () => {
|
|
41
|
+
const reportProductSelection = () => {
|
|
42
|
+
var _logger$addLog, _dataSource$id, _dataSource$title;
|
|
43
|
+
logger === null || logger === void 0 || (_logger$addLog = logger.addLog) === null || _logger$addLog === void 0 || _logger$addLog.call(logger, {
|
|
44
|
+
type: "info",
|
|
45
|
+
title: `BigSale商品卡外层-${selectionTrigger}触发商品选择`,
|
|
46
|
+
metadata: {
|
|
47
|
+
productId: (_dataSource$id = dataSource === null || dataSource === void 0 ? void 0 : dataSource.id) !== null && _dataSource$id !== void 0 ? _dataSource$id : dataSource === null || dataSource === void 0 ? void 0 : dataSource.product_id,
|
|
48
|
+
productTitle: (_dataSource$title = dataSource === null || dataSource === void 0 ? void 0 : dataSource.title) !== null && _dataSource$title !== void 0 ? _dataSource$title : dataSource === null || dataSource === void 0 ? void 0 : dataSource.name
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
};
|
|
39
52
|
if (selectionTrigger === "click") {
|
|
53
|
+
reportProductSelection();
|
|
40
54
|
onCardClick === null || onCardClick === void 0 || onCardClick(dataSource);
|
|
41
55
|
return;
|
|
42
56
|
}
|
|
43
|
-
requestAnimationFrame(() => requestAnimationFrame(() =>
|
|
57
|
+
requestAnimationFrame(() => requestAnimationFrame(() => {
|
|
58
|
+
reportProductSelection();
|
|
59
|
+
onCardClick === null || onCardClick === void 0 || onCardClick(dataSource);
|
|
60
|
+
}));
|
|
44
61
|
};
|
|
45
62
|
return /* @__PURE__ */ react.default.createElement("div", {
|
|
46
63
|
className: (0, classnames.default)(`${require_status.PREFIX}__card-wrapper`, (skuStatusOverlayConfig === null || skuStatusOverlayConfig === void 0 ? void 0 : skuStatusOverlayConfig.isOpen) && `pisell-product-sku__card-wrapper-overlay`, className),
|
|
@@ -364,11 +364,12 @@ function getPayV2RefundMethods() {
|
|
|
364
364
|
iconType: "pisell2-credit-card-02"
|
|
365
365
|
}];
|
|
366
366
|
}
|
|
367
|
-
function buildNormalRefundPayments(selected, editedAmounts) {
|
|
368
|
-
|
|
367
|
+
function buildNormalRefundPayments(selected, editedAmounts, shopWalletPassId) {
|
|
368
|
+
const normalizedShopWalletPassId = String(shopWalletPassId || "").trim();
|
|
369
|
+
return selected.map((transaction) => require_objectSpread2._objectSpread2({
|
|
369
370
|
id: transaction.payment.orderPaymentId,
|
|
370
371
|
amount: editedAmounts.get(transaction.key) || toDecimal(transaction.refundableAmount).toFixed(2)
|
|
371
|
-
}));
|
|
372
|
+
}, normalizedShopWalletPassId && isCashRefundTransaction(transaction) ? { metadata: { shop_wallet_pass_id: normalizedShopWalletPassId } } : {}));
|
|
372
373
|
}
|
|
373
374
|
function PayV2RefundModalConnected({ context, onClose, open }) {
|
|
374
375
|
var _engineContext$appHel;
|
|
@@ -418,6 +419,14 @@ function PayV2RefundModalConnected({ context, onClose, open }) {
|
|
|
418
419
|
return next;
|
|
419
420
|
});
|
|
420
421
|
}, []);
|
|
422
|
+
const buildNormalRefundPaymentsForSubmit = (0, react.useCallback)(function() {
|
|
423
|
+
var _ref10 = require_asyncToGenerator._asyncToGenerator(function* (selected) {
|
|
424
|
+
return buildNormalRefundPayments(selected, editedAmounts, selected.some(isCashRefundTransaction) ? yield require_utils$1.getShopWalletPassId(interaction) : null);
|
|
425
|
+
});
|
|
426
|
+
return function(_x) {
|
|
427
|
+
return _ref10.apply(this, arguments);
|
|
428
|
+
};
|
|
429
|
+
}(), [editedAmounts, interaction]);
|
|
421
430
|
const openCashDrawer = (0, react.useCallback)(() => {
|
|
422
431
|
try {
|
|
423
432
|
var _interaction$utils, _interaction$utils$po;
|
|
@@ -451,13 +460,12 @@ function PayV2RefundModalConnected({ context, onClose, open }) {
|
|
|
451
460
|
Toast
|
|
452
461
|
]);
|
|
453
462
|
const submitNormalRefund = (0, react.useCallback)(function() {
|
|
454
|
-
var
|
|
455
|
-
const payments = buildNormalRefundPayments(selected, editedAmounts);
|
|
456
|
-
const submittedRefundAmount = payments.reduce((total, payment) => total.plus(toDecimal(payment.amount)), new decimal_js.default(0));
|
|
463
|
+
var _ref11 = require_asyncToGenerator._asyncToGenerator(function* (selected, cancelOrder, note) {
|
|
457
464
|
const shouldOpenCashDrawer = selected.some(isCashRefundTransaction);
|
|
458
465
|
setSubmitting(true);
|
|
459
466
|
try {
|
|
460
|
-
|
|
467
|
+
const payments = yield buildNormalRefundPaymentsForSubmit(selected);
|
|
468
|
+
finishSuccessfulRefund(payments.reduce((total, payment) => total.plus(toDecimal(payment.amount)), new decimal_js.default(0)), (yield context.sales.refundPayments(payments, {
|
|
461
469
|
cancelOrder,
|
|
462
470
|
note
|
|
463
471
|
})).refreshError, shouldOpenCashDrawer);
|
|
@@ -467,17 +475,17 @@ function PayV2RefundModalConnected({ context, onClose, open }) {
|
|
|
467
475
|
setSubmitting(false);
|
|
468
476
|
}
|
|
469
477
|
});
|
|
470
|
-
return function(
|
|
471
|
-
return
|
|
478
|
+
return function(_x2, _x3, _x4) {
|
|
479
|
+
return _ref11.apply(this, arguments);
|
|
472
480
|
};
|
|
473
481
|
}(), [
|
|
482
|
+
buildNormalRefundPaymentsForSubmit,
|
|
474
483
|
context.sales,
|
|
475
|
-
editedAmounts,
|
|
476
484
|
finishSuccessfulRefund,
|
|
477
485
|
getErrorText
|
|
478
486
|
]);
|
|
479
487
|
const submitSpiMx51Refund = (0, react.useCallback)(function() {
|
|
480
|
-
var
|
|
488
|
+
var _ref12 = require_asyncToGenerator._asyncToGenerator(function* (transaction, normalTransactions, cancelOrder, note) {
|
|
481
489
|
if (transaction.payment.orderPaymentId === void 0 || transaction.payment.orderPaymentId === null || !transaction.payment.paymentMethod.code) {
|
|
482
490
|
antd.message.error(String(_pisell_utils.locales.getText("pisell2.sale-detail.refund-modal.eftpos-missing-identity")));
|
|
483
491
|
return;
|
|
@@ -486,13 +494,13 @@ function PayV2RefundModalConnected({ context, onClose, open }) {
|
|
|
486
494
|
const paymentMethodCode = transaction.payment.paymentMethod.code;
|
|
487
495
|
const amount = editedAmounts.get(transaction.key) || toDecimal(transaction.refundableAmount).toFixed(2);
|
|
488
496
|
const refundUuid = createRefundPaymentNumber();
|
|
489
|
-
const normalPayments = buildNormalRefundPayments(normalTransactions, editedAmounts);
|
|
490
|
-
const normalRefundAmount = normalPayments.reduce((total, payment) => total.plus(toDecimal(payment.amount)), new decimal_js.default(0));
|
|
491
497
|
const shouldOpenCashDrawer = normalTransactions.some(isCashRefundTransaction);
|
|
492
498
|
setSubmitting(true);
|
|
493
499
|
let nativeRefundSucceeded = false;
|
|
494
500
|
try {
|
|
495
501
|
var _engineContext$appHel2, _engineContext$appHel3, _engineContext$appHel4, _nativeResult$code, _nativeResult$data, _nativeResult$data2, _transaction$payment$;
|
|
502
|
+
const normalPayments = yield buildNormalRefundPaymentsForSubmit(normalTransactions);
|
|
503
|
+
const normalRefundAmount = normalPayments.reduce((total, payment) => total.plus(toDecimal(payment.amount)), new decimal_js.default(0));
|
|
496
504
|
const mx51Plugin = engineContext === null || engineContext === void 0 || (_engineContext$appHel2 = engineContext.appHelper) === null || _engineContext$appHel2 === void 0 || (_engineContext$appHel2 = _engineContext$appHel2.utils) === null || _engineContext$appHel2 === void 0 || (_engineContext$appHel3 = _engineContext$appHel2.getApp) === null || _engineContext$appHel3 === void 0 || (_engineContext$appHel3 = _engineContext$appHel3.call(_engineContext$appHel2)) === null || _engineContext$appHel3 === void 0 || (_engineContext$appHel4 = _engineContext$appHel3.getPlugin) === null || _engineContext$appHel4 === void 0 ? void 0 : _engineContext$appHel4.call(_engineContext$appHel3, "mx51");
|
|
497
505
|
if (typeof (mx51Plugin === null || mx51Plugin === void 0 ? void 0 : mx51Plugin.refund) !== "function") throw new Error(String(_pisell_utils.locales.getText("pisell2.sale-detail.refund-modal.eftpos-open-failed")));
|
|
498
506
|
const nativeResult = yield mx51Plugin.refund({
|
|
@@ -534,10 +542,11 @@ function PayV2RefundModalConnected({ context, onClose, open }) {
|
|
|
534
542
|
setSubmitting(false);
|
|
535
543
|
}
|
|
536
544
|
});
|
|
537
|
-
return function(
|
|
538
|
-
return
|
|
545
|
+
return function(_x5, _x6, _x7, _x8) {
|
|
546
|
+
return _ref12.apply(this, arguments);
|
|
539
547
|
};
|
|
540
548
|
}(), [
|
|
549
|
+
buildNormalRefundPaymentsForSubmit,
|
|
541
550
|
context.sales,
|
|
542
551
|
editedAmounts,
|
|
543
552
|
engineContext,
|
|
@@ -546,7 +555,7 @@ function PayV2RefundModalConnected({ context, onClose, open }) {
|
|
|
546
555
|
onClose
|
|
547
556
|
]);
|
|
548
557
|
const submitEftposRefund = (0, react.useCallback)(function() {
|
|
549
|
-
var
|
|
558
|
+
var _ref13 = require_asyncToGenerator._asyncToGenerator(function* (transaction, normalTransactions, cancelOrder, note) {
|
|
550
559
|
if (!transaction.eftposProvider || !transaction.originalPaymentNumber || !transaction.salesId || transaction.payment.orderPaymentId === void 0 || transaction.payment.orderPaymentId === null || !transaction.payment.paymentMethod.code) {
|
|
551
560
|
antd.message.error(String(_pisell_utils.locales.getText("pisell2.sale-detail.refund-modal.eftpos-missing-identity")));
|
|
552
561
|
return;
|
|
@@ -555,15 +564,15 @@ function PayV2RefundModalConnected({ context, onClose, open }) {
|
|
|
555
564
|
const orderPaymentId = transaction.payment.orderPaymentId;
|
|
556
565
|
const paymentMethodCode = transaction.payment.paymentMethod.code;
|
|
557
566
|
const amount = editedAmounts.get(transaction.key) || toDecimal(transaction.refundableAmount).toFixed(2);
|
|
558
|
-
const normalPayments = buildNormalRefundPayments(normalTransactions, editedAmounts);
|
|
559
|
-
const normalRefundAmount = normalPayments.reduce((total, payment) => total.plus(toDecimal(payment.amount)), new decimal_js.default(0));
|
|
560
567
|
const shouldOpenCashDrawer = normalTransactions.some(isCashRefundTransaction);
|
|
561
568
|
setSubmitting(true);
|
|
562
569
|
eftposSuccessHandlingRef.current = false;
|
|
563
|
-
const deviceNumber = yield require_utils$1.getCurrentDeviceNumber(interaction);
|
|
564
570
|
let opened = false;
|
|
565
571
|
try {
|
|
566
572
|
var _piPaymentRef$current, _context$sales$tempOr3, _context$sales$salesD3;
|
|
573
|
+
const normalPayments = yield buildNormalRefundPaymentsForSubmit(normalTransactions);
|
|
574
|
+
const normalRefundAmount = normalPayments.reduce((total, payment) => total.plus(toDecimal(payment.amount)), new decimal_js.default(0));
|
|
575
|
+
const deviceNumber = yield require_utils$1.getCurrentDeviceNumber(interaction);
|
|
567
576
|
opened = Boolean((_piPaymentRef$current = piPaymentRef.current) === null || _piPaymentRef$current === void 0 ? void 0 : _piPaymentRef$current.open({
|
|
568
577
|
provider: transaction.eftposProvider,
|
|
569
578
|
mode: require_index.PaymentMode.Refund,
|
|
@@ -632,10 +641,11 @@ function PayV2RefundModalConnected({ context, onClose, open }) {
|
|
|
632
641
|
antd.message.error(String(_pisell_utils.locales.getText("pisell2.sale-detail.refund-modal.eftpos-open-failed")));
|
|
633
642
|
}
|
|
634
643
|
});
|
|
635
|
-
return function(
|
|
636
|
-
return
|
|
644
|
+
return function(_x9, _x10, _x11, _x12) {
|
|
645
|
+
return _ref13.apply(this, arguments);
|
|
637
646
|
};
|
|
638
647
|
}(), [
|
|
648
|
+
buildNormalRefundPaymentsForSubmit,
|
|
639
649
|
context.sales,
|
|
640
650
|
editedAmounts,
|
|
641
651
|
finishSuccessfulRefund,
|
|
@@ -697,10 +707,10 @@ function PayV2RefundModalConnected({ context, onClose, open }) {
|
|
|
697
707
|
}));
|
|
698
708
|
}
|
|
699
709
|
function Pay({ context }) {
|
|
700
|
-
var
|
|
710
|
+
var _ref14, _context$summary$summ2;
|
|
701
711
|
const paymentMethodNameMap = require_usePaymentMethodNameMap.usePaymentMethodNameMap();
|
|
702
712
|
const tempOrder = context.sales.tempOrder;
|
|
703
|
-
const summary = (
|
|
713
|
+
const summary = (_ref14 = (_context$summary$summ2 = context.summary.summary) !== null && _context$summary$summ2 !== void 0 ? _context$summary$summ2 : tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.summary) !== null && _ref14 !== void 0 ? _ref14 : null;
|
|
704
714
|
const symbol = (tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.currency_symbol) || "$";
|
|
705
715
|
const payments = Array.isArray(tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.payments) ? tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.payments : [];
|
|
706
716
|
const overviewItems = [
|
|
@@ -10,6 +10,7 @@ function _refundOrderPayments() {
|
|
|
10
10
|
_refundOrderPayments = require_asyncToGenerator._asyncToGenerator(function* (orderId, payments, options = {}) {
|
|
11
11
|
var _options$note$trim, _options$note;
|
|
12
12
|
const payload = require_objectSpread2._objectSpread2({
|
|
13
|
+
platform: "pos",
|
|
13
14
|
note: (_options$note$trim = (_options$note = options.note) === null || _options$note === void 0 ? void 0 : _options$note.trim()) !== null && _options$note$trim !== void 0 ? _options$note$trim : "",
|
|
14
15
|
content: [],
|
|
15
16
|
is_notice: 0,
|
|
@@ -179,7 +179,8 @@ interface SalesSdkRefundPaymentInput {
|
|
|
179
179
|
product_voucher?: unknown;
|
|
180
180
|
payment_method_name?: string;
|
|
181
181
|
metadata?: {
|
|
182
|
-
|
|
182
|
+
/** 现金退款归属的钱箱 ID。 */shop_wallet_pass_id?: string;
|
|
183
|
+
unique_refund_number?: string;
|
|
183
184
|
manual_marking_flag?: 1;
|
|
184
185
|
};
|
|
185
186
|
}
|
|
@@ -577,6 +578,11 @@ interface UpdateOrderProductParams {
|
|
|
577
578
|
*/
|
|
578
579
|
allow_booking_discount_reapply?: boolean;
|
|
579
580
|
}
|
|
581
|
+
/** Order.updateOrderBooking 入参;仅覆盖 updates 中显式给出的 booking 字段。 */
|
|
582
|
+
interface UpdateOrderBookingParams {
|
|
583
|
+
unique_identification_number: string;
|
|
584
|
+
updates: Record<string, any>;
|
|
585
|
+
}
|
|
580
586
|
/** Order.updateOrderProductQuantity 入参;行定位语义与 updateOrderProduct / removeProductFromOrder 一致 */
|
|
581
587
|
interface UpdateOrderProductQuantityParams extends ScanOrderOrderProductIdentity {
|
|
582
588
|
num: number;
|
|
@@ -944,6 +950,8 @@ interface BookingTicketHandle {
|
|
|
944
950
|
}) => Promise<ScanOrderOrderProduct[]>;
|
|
945
951
|
updateOrderProduct: (params: UpdateOrderProductParams) => Promise<ScanOrderOrderProduct[]>;
|
|
946
952
|
updateOrderProducts?: (paramsList: UpdateOrderProductParams[]) => Promise<ScanOrderOrderProduct[]>;
|
|
953
|
+
/** 按 booking UID 更新预约;OS 会保留未出现在 updates 中的原字段。 */
|
|
954
|
+
updateOrderBooking?: (params: UpdateOrderBookingParams) => Record<string, any>[];
|
|
947
955
|
updateOrderProductQuantity: (params: UpdateOrderProductQuantityParams) => Promise<ScanOrderOrderProduct[]>;
|
|
948
956
|
removeProductFromOrder: (identity: ScanOrderOrderProductIdentity, options?: {
|
|
949
957
|
preserveDisplayPosition?: {
|
|
@@ -12,6 +12,7 @@ const require_withResponsive = require("../../responsive/withResponsive.js");
|
|
|
12
12
|
const require_index$1 = require("../../plus/noteModal/index.js");
|
|
13
13
|
const require_index$2 = require("../priceKeyboard/components/discountKeyboard/index.js");
|
|
14
14
|
const require_index$3 = require("../NumericStepper/index.js");
|
|
15
|
+
const require_useLogger = require("../../hooks/useLogger.js");
|
|
15
16
|
const require_stock = require("../../shared/locales/stock.js");
|
|
16
17
|
const require_resolveSkuValue = require("../../plus/skuOptionsSelection/utils/resolveSkuValue.js");
|
|
17
18
|
const require_index$4 = require("../../plus/skuOptionsSelection/index.js");
|
|
@@ -20,7 +21,6 @@ const require_locales$1 = require("./flow/locales.js");
|
|
|
20
21
|
const require_useLocale = require("../../hooks/useLocale.js");
|
|
21
22
|
const require_utils$3 = require("./utils.js");
|
|
22
23
|
const require_useToast = require("../../hooks/useToast.js");
|
|
23
|
-
const require_useLogger = require("../../hooks/useLogger.js");
|
|
24
24
|
const require_LoadingPanel = require("./LoadingPanel.js");
|
|
25
25
|
const require_index$5 = require("./components/CollapsibleSection/index.js");
|
|
26
26
|
const require_utils$4 = require("./components/weighing/utils.js");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/private-materials",
|
|
3
|
-
"version": "6.12.
|
|
3
|
+
"version": "6.12.164",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -70,9 +70,9 @@
|
|
|
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/utils": "3.0.4",
|
|
73
74
|
"@pisell/icon": "0.0.11",
|
|
74
75
|
"@pisell/date-picker": "3.0.10",
|
|
75
|
-
"@pisell/utils": "3.0.4",
|
|
76
76
|
"@pisell/materials": "6.12.47"
|
|
77
77
|
},
|
|
78
78
|
"peerDependencies": {
|