@pisell/private-materials 6.12.236 → 6.12.237
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 +12 -12
- package/build/lowcode/view.js +12 -12
- 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/Kiosk/index.js +1 -0
- package/es/components/checkout/PaymentModal.js +111 -2
- package/es/components/pay/toC/PaymentMethods/MWCreditCard/Add/index.js +10 -3
- package/es/components/pay/toC/utils.js +5 -1
- 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/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/components/WalletPass/WalletPassRecordCard.js +1 -1
- package/es/plus/saleDetail/tmpl/B/components/WalletPass/utils/format.js +14 -4
- package/es/plus/saleDetail/tmpl/B/components/WalletPass/utils/vouchers.js +25 -10
- package/es/plus/saleDetail/tmpl/B/index.js +1 -0
- 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/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/es/pro/compensatedPisellContainer/floatingLayer/index.js +13 -1
- package/lib/components/checkout/PaymentModal.js +111 -2
- package/lib/components/pay/toC/PaymentMethods/MWCreditCard/Add/index.js +10 -3
- package/lib/components/pay/toC/utils.js +5 -0
- package/lib/plus/saleDetail/tmpl/B/components/WalletPass/WalletPassRecordCard.js +1 -1
- package/lib/plus/saleDetail/tmpl/B/components/WalletPass/utils/format.js +16 -3
- package/lib/plus/saleDetail/tmpl/B/components/WalletPass/utils/vouchers.js +24 -9
- package/lib/pro/compensatedPisellContainer/floatingLayer/index.js +13 -1
- package/package.json +3 -3
- package/es/private-materials/lowcode/authmodal/meta.d.ts +0 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import useEngineContext from "../../../../hooks/useEngineContext.js";
|
|
2
2
|
import { subscribeBookingDateChange } from "../../../../plus/salesSdk/utils/bookingDate.js";
|
|
3
|
+
import "../../../../plus/salesSdk/index.js";
|
|
3
4
|
import dayjs from "dayjs";
|
|
4
5
|
import { useCallback, useEffect, useState } from "react";
|
|
5
6
|
//#region src/components/bigSale/components/BookingFloatingPanel/useBookingPanelController.ts
|
|
@@ -4,6 +4,7 @@ import withResponsive from "../../../../responsive/withResponsive.js";
|
|
|
4
4
|
import useInitLocalesOnce from "../../../../hooks/useInitLocalesOnce.js";
|
|
5
5
|
import { subscribeBookingDateChange } from "../../../../plus/salesSdk/utils/bookingDate.js";
|
|
6
6
|
import { useSalesSdkBookingContext } from "../../../../plus/salesSdk/context/SalesSdkBookingContext.js";
|
|
7
|
+
import "../../../../plus/salesSdk/index.js";
|
|
7
8
|
import locales_default from "../../locales/index.js";
|
|
8
9
|
import { getPosWeekStartsOn, resolvePosCountryCode } from "../../../../utils/posDateLocale.js";
|
|
9
10
|
import dayjs from "dayjs";
|
|
@@ -5,6 +5,7 @@ import { buildInitBookingContextParams, collectBookingIdsFromTempOrder } from ".
|
|
|
5
5
|
import { useSalesSdk } from "../../plus/salesSdk/hooks/useSalesSdk.js";
|
|
6
6
|
import { useSalesSdkCart } from "../../plus/salesSdk/hooks/useSalesSdkCart.js";
|
|
7
7
|
import { SalesSdkPrepareOrderSwitchContext, SalesSdkRootRefreshContext } from "../../plus/salesSdk/context/SalesSdkProvider.js";
|
|
8
|
+
import "../../plus/salesSdk/index.js";
|
|
8
9
|
import { seedDineInReservationToCart } from "../../plus/pisellReservation/utils/seedDineInReservationToCart.js";
|
|
9
10
|
import { isPersistedBigSaleOrderId } from "./utils/orderIdentity.js";
|
|
10
11
|
import BigSale from "./index.js";
|
|
@@ -4,6 +4,7 @@ import { useSalesSdkCustomer } from "../../../plus/salesSdk/hooks/useSalesSdkCus
|
|
|
4
4
|
import { useSalesSdkBookingContext } from "../../../plus/salesSdk/context/SalesSdkBookingContext.js";
|
|
5
5
|
import { useSalesSdkSummary } from "../../../plus/salesSdk/hooks/useSalesSdkSummary.js";
|
|
6
6
|
import { useSalesSdkProducts } from "../../../plus/salesSdk/hooks/useSalesSdkProducts.js";
|
|
7
|
+
import "../../../plus/salesSdk/index.js";
|
|
7
8
|
import { useMemo } from "react";
|
|
8
9
|
//#region src/components/bigSale/hooks/useBigSaleContext.ts
|
|
9
10
|
/**
|
|
@@ -3,6 +3,7 @@ import useEngineContext from "../../../hooks/useEngineContext.js";
|
|
|
3
3
|
import { buildInitBookingContextParams, collectBookingIdsFromTempOrder } from "../../../plus/salesSdk/utils/buildDefaultLoadProductsParams.js";
|
|
4
4
|
import { useSalesSdkUIHosts } from "../../../plus/salesSdk/context/SalesSdkUIHostsContext.js";
|
|
5
5
|
import { SalesSdkRootRefreshContext } from "../../../plus/salesSdk/context/SalesSdkProvider.js";
|
|
6
|
+
import "../../../plus/salesSdk/index.js";
|
|
6
7
|
import { resolveOrderIdForHostActions } from "../../../plus/pisellReservation/components/bookingDetailModal/bookingDetailHostActions.js";
|
|
7
8
|
import { usePicoCodingOpenData } from "../../../plus/pisellReservation/hooks/usePicoCodingOpenData.js";
|
|
8
9
|
import { buildReplacementBookingResourcesFromReservationRow } from "../../../plus/pisellReservation/utils/reservationTicketBookingHostParams.js";
|
|
@@ -8,6 +8,7 @@ import { useSalesSdk } from "../../plus/salesSdk/hooks/useSalesSdk.js";
|
|
|
8
8
|
import { useSalesSdkCustomer } from "../../plus/salesSdk/hooks/useSalesSdkCustomer.js";
|
|
9
9
|
import { SalesSdkProvider } from "../../plus/salesSdk/context/SalesSdkProvider.js";
|
|
10
10
|
import { SalesSdkBookingContextProvider } from "../../plus/salesSdk/context/SalesSdkBookingContext.js";
|
|
11
|
+
import "../../plus/salesSdk/index.js";
|
|
11
12
|
import { ResponsiveBigSaleBase } from "./Base.js";
|
|
12
13
|
import { isBigSaleProductSelectionFlowScene, resolveBigSaleSelectionFlowConfig } from "./selectionFlowConfig.js";
|
|
13
14
|
import { isKioskPresentation } from "./templateCapabilities.js";
|
|
@@ -10,6 +10,7 @@ import PaymentResultToastV2_default from "../../../checkout/components/PaymentRe
|
|
|
10
10
|
import { freePayApi } from "../../../Sales/Checkout/serve.js";
|
|
11
11
|
import { collectUnassignedHolderLines } from "../../../../plus/salesSdk/utils/holderSubmitValidation.js";
|
|
12
12
|
import { useSalesSdk } from "../../../../plus/salesSdk/hooks/useSalesSdk.js";
|
|
13
|
+
import "../../../../plus/salesSdk/index.js";
|
|
13
14
|
import { usePickSaleDetailContext } from "../../hooks/usePickSaleDetailContext.js";
|
|
14
15
|
import { resolveBigSaleAutoProductListPreferences } from "../../utils/productListPreferences.js";
|
|
15
16
|
import { resolveBigSaleProductDisplayConfig } from "../../hooks/useBigSaleProductListConfig.js";
|
|
@@ -2702,11 +2702,11 @@ const PaymentModal = ({ open, baseSales, baseSalesModuleName, walletPassMode = "
|
|
|
2702
2702
|
}, [interaction, open]);
|
|
2703
2703
|
const checkoutModalScale = useMemo(() => {
|
|
2704
2704
|
if (variant === "smallTablet") return {
|
|
2705
|
-
width: "
|
|
2705
|
+
width: "98%",
|
|
2706
2706
|
heightRatio: .98
|
|
2707
2707
|
};
|
|
2708
2708
|
if (variant === "tablet") return {
|
|
2709
|
-
width: "
|
|
2709
|
+
width: "98%",
|
|
2710
2710
|
heightRatio: .98
|
|
2711
2711
|
};
|
|
2712
2712
|
return {
|
|
@@ -2983,6 +2983,115 @@ const PaymentModal = ({ open, baseSales, baseSalesModuleName, walletPassMode = "
|
|
|
2983
2983
|
if (data === null || data === void 0 || (_data$order_info = data.order_info) === null || _data$order_info === void 0 ? void 0 : _data$order_info.order_note) setOrderNote(data.order_info.order_note);
|
|
2984
2984
|
}, [data]);
|
|
2985
2985
|
const logger = usePaymentLogger();
|
|
2986
|
+
const addPaymentLog = logger === null || logger === void 0 ? void 0 : logger.addLog;
|
|
2987
|
+
const flushPaymentLogs = useCallback(() => {
|
|
2988
|
+
var _logger$storeLog;
|
|
2989
|
+
logger === null || logger === void 0 || (_logger$storeLog = logger.storeLog) === null || _logger$storeLog === void 0 || _logger$storeLog.call(logger, true);
|
|
2990
|
+
}, [logger === null || logger === void 0 ? void 0 : logger.storeLog]);
|
|
2991
|
+
useEffect(() => {
|
|
2992
|
+
var _window$visualViewpor;
|
|
2993
|
+
if (!open || typeof window === "undefined" || typeof document === "undefined") return;
|
|
2994
|
+
const sessionId = `checkout-layout-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
|
|
2995
|
+
let lastLoggedAt = 0;
|
|
2996
|
+
const getRect = (selector) => {
|
|
2997
|
+
const element = document.querySelector(selector);
|
|
2998
|
+
if (!element) return null;
|
|
2999
|
+
const rect = element.getBoundingClientRect();
|
|
3000
|
+
return {
|
|
3001
|
+
width: Number(rect.width.toFixed(2)),
|
|
3002
|
+
height: Number(rect.height.toFixed(2)),
|
|
3003
|
+
top: Number(rect.top.toFixed(2)),
|
|
3004
|
+
left: Number(rect.left.toFixed(2)),
|
|
3005
|
+
right: Number(rect.right.toFixed(2)),
|
|
3006
|
+
bottom: Number(rect.bottom.toFixed(2))
|
|
3007
|
+
};
|
|
3008
|
+
};
|
|
3009
|
+
const logLayout = (reason, force = false) => {
|
|
3010
|
+
const now = Date.now();
|
|
3011
|
+
if (!force && now - lastLoggedAt < 120) return;
|
|
3012
|
+
lastLoggedAt = now;
|
|
3013
|
+
try {
|
|
3014
|
+
var _wrapperStyle$width, _wrapperStyle$maxWidt, _wrapperStyle$transfo, _rootStyle$width, _rootStyle$height;
|
|
3015
|
+
const wrapper = document.querySelector(".payment-modal-modal");
|
|
3016
|
+
const root = document.querySelector(".payment-modal-wrapper");
|
|
3017
|
+
const bodyStyle = window.getComputedStyle(document.body);
|
|
3018
|
+
const wrapperStyle = wrapper ? window.getComputedStyle(wrapper) : null;
|
|
3019
|
+
const rootStyle = root ? window.getComputedStyle(root) : null;
|
|
3020
|
+
const viewport = window.visualViewport;
|
|
3021
|
+
addPaymentLog === null || addPaymentLog === void 0 || addPaymentLog({
|
|
3022
|
+
type: "info",
|
|
3023
|
+
title: "Checkout modal layout diagnostic",
|
|
3024
|
+
metadata: {
|
|
3025
|
+
sessionId,
|
|
3026
|
+
reason,
|
|
3027
|
+
timestamp: new Date(now).toISOString(),
|
|
3028
|
+
variant,
|
|
3029
|
+
configuredWidth: checkoutModalScale.width,
|
|
3030
|
+
window: {
|
|
3031
|
+
innerWidth: window.innerWidth,
|
|
3032
|
+
innerHeight: window.innerHeight,
|
|
3033
|
+
documentClientWidth: document.documentElement.clientWidth,
|
|
3034
|
+
documentClientHeight: document.documentElement.clientHeight,
|
|
3035
|
+
devicePixelRatio: window.devicePixelRatio
|
|
3036
|
+
},
|
|
3037
|
+
visualViewport: viewport ? {
|
|
3038
|
+
width: viewport.width,
|
|
3039
|
+
height: viewport.height,
|
|
3040
|
+
scale: viewport.scale,
|
|
3041
|
+
offsetLeft: viewport.offsetLeft,
|
|
3042
|
+
offsetTop: viewport.offsetTop
|
|
3043
|
+
} : null,
|
|
3044
|
+
body: {
|
|
3045
|
+
transform: bodyStyle.transform,
|
|
3046
|
+
zoom: bodyStyle.zoom
|
|
3047
|
+
},
|
|
3048
|
+
modalWrapper: {
|
|
3049
|
+
rect: getRect(".payment-modal-modal"),
|
|
3050
|
+
width: (_wrapperStyle$width = wrapperStyle === null || wrapperStyle === void 0 ? void 0 : wrapperStyle.width) !== null && _wrapperStyle$width !== void 0 ? _wrapperStyle$width : null,
|
|
3051
|
+
maxWidth: (_wrapperStyle$maxWidt = wrapperStyle === null || wrapperStyle === void 0 ? void 0 : wrapperStyle.maxWidth) !== null && _wrapperStyle$maxWidt !== void 0 ? _wrapperStyle$maxWidt : null,
|
|
3052
|
+
transform: (_wrapperStyle$transfo = wrapperStyle === null || wrapperStyle === void 0 ? void 0 : wrapperStyle.transform) !== null && _wrapperStyle$transfo !== void 0 ? _wrapperStyle$transfo : null
|
|
3053
|
+
},
|
|
3054
|
+
floatingRoot: {
|
|
3055
|
+
rect: getRect(".payment-modal-wrapper"),
|
|
3056
|
+
width: (_rootStyle$width = rootStyle === null || rootStyle === void 0 ? void 0 : rootStyle.width) !== null && _rootStyle$width !== void 0 ? _rootStyle$width : null,
|
|
3057
|
+
height: (_rootStyle$height = rootStyle === null || rootStyle === void 0 ? void 0 : rootStyle.height) !== null && _rootStyle$height !== void 0 ? _rootStyle$height : null
|
|
3058
|
+
}
|
|
3059
|
+
}
|
|
3060
|
+
});
|
|
3061
|
+
flushPaymentLogs();
|
|
3062
|
+
} catch (error) {
|
|
3063
|
+
console.warn("Failed to record checkout modal layout diagnostic", error);
|
|
3064
|
+
}
|
|
3065
|
+
};
|
|
3066
|
+
const handleViewportChange = () => logLayout("viewport-change");
|
|
3067
|
+
const bodyObserver = new MutationObserver(() => logLayout("body-mutation"));
|
|
3068
|
+
bodyObserver.observe(document.body, {
|
|
3069
|
+
attributes: true,
|
|
3070
|
+
attributeFilter: ["style", "class"]
|
|
3071
|
+
});
|
|
3072
|
+
logLayout("modal-open", true);
|
|
3073
|
+
const animationFrame = window.requestAnimationFrame(() => logLayout("next-frame", true));
|
|
3074
|
+
const settleTimer = window.setTimeout(() => logLayout("startup-settled", true), 500);
|
|
3075
|
+
window.addEventListener("resize", handleViewportChange);
|
|
3076
|
+
window.addEventListener("orientationchange", handleViewportChange);
|
|
3077
|
+
(_window$visualViewpor = window.visualViewport) === null || _window$visualViewpor === void 0 || _window$visualViewpor.addEventListener("resize", handleViewportChange);
|
|
3078
|
+
return () => {
|
|
3079
|
+
var _window$visualViewpor2;
|
|
3080
|
+
window.cancelAnimationFrame(animationFrame);
|
|
3081
|
+
window.clearTimeout(settleTimer);
|
|
3082
|
+
window.removeEventListener("resize", handleViewportChange);
|
|
3083
|
+
window.removeEventListener("orientationchange", handleViewportChange);
|
|
3084
|
+
(_window$visualViewpor2 = window.visualViewport) === null || _window$visualViewpor2 === void 0 || _window$visualViewpor2.removeEventListener("resize", handleViewportChange);
|
|
3085
|
+
bodyObserver.disconnect();
|
|
3086
|
+
logLayout("modal-close", true);
|
|
3087
|
+
};
|
|
3088
|
+
}, [
|
|
3089
|
+
addPaymentLog,
|
|
3090
|
+
checkoutModalScale.width,
|
|
3091
|
+
flushPaymentLogs,
|
|
3092
|
+
open,
|
|
3093
|
+
variant
|
|
3094
|
+
]);
|
|
2986
3095
|
const isLocalOrderCreated = useRef(void 0);
|
|
2987
3096
|
const unsubscribeRef = useRef(void 0);
|
|
2988
3097
|
useEffect(() => {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { _asyncToGenerator } from "../../../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js";
|
|
2
|
+
import { isAmex } from "../../../utils.js";
|
|
2
3
|
import { Context } from "../../../model.js";
|
|
3
4
|
import React, { forwardRef, useContext, useImperativeHandle, useMemo, useState } from "react";
|
|
4
5
|
import { Checkbox, Col, Divider, Form, Row } from "antd";
|
|
@@ -55,6 +56,7 @@ const AddMWCreditCard = (props, ref) => {
|
|
|
55
56
|
const { onCreate, shopName = "", btnLoading = false } = props;
|
|
56
57
|
const [open, setOpen] = useState(false);
|
|
57
58
|
const [form] = Form.useForm();
|
|
59
|
+
const cardIsAmex = isAmex(Form.useWatch("card_number", form) || "");
|
|
58
60
|
const { state } = useContext(Context);
|
|
59
61
|
/**
|
|
60
62
|
* @title: 初始化
|
|
@@ -96,7 +98,9 @@ const AddMWCreditCard = (props, ref) => {
|
|
|
96
98
|
console.log(locales.getText("tocPay.text.enterCardNumber"));
|
|
97
99
|
return;
|
|
98
100
|
}
|
|
99
|
-
|
|
101
|
+
const cardNumber = values.card_number.replace(/\D/g, "");
|
|
102
|
+
const amex = isAmex(cardNumber);
|
|
103
|
+
if (cardNumber.length < (amex ? 15 : 16)) {
|
|
100
104
|
PisellToast({
|
|
101
105
|
content: locales.getText("tocPay.text.enterValidCardNumber"),
|
|
102
106
|
duration: 2
|
|
@@ -133,7 +137,7 @@ const AddMWCreditCard = (props, ref) => {
|
|
|
133
137
|
console.log(locales.getText("tocPay.text.enterCVV"));
|
|
134
138
|
return;
|
|
135
139
|
}
|
|
136
|
-
if ((values.card_ccv + "").length
|
|
140
|
+
if ((values.card_ccv + "").length !== (amex ? 4 : 3)) {
|
|
137
141
|
PisellToast({
|
|
138
142
|
content: locales.getText("tocPay.text.enterValidCVV"),
|
|
139
143
|
duration: 2
|
|
@@ -252,7 +256,10 @@ const AddMWCreditCard = (props, ref) => {
|
|
|
252
256
|
required: true,
|
|
253
257
|
message: locales.getText("tocPay.text.incorrectSecurityCode")
|
|
254
258
|
}]
|
|
255
|
-
}, /* @__PURE__ */ React.createElement(PisellInput.SecurityCode, {
|
|
259
|
+
}, /* @__PURE__ */ React.createElement(PisellInput.SecurityCode, {
|
|
260
|
+
maxLength: cardIsAmex ? 4 : 3,
|
|
261
|
+
placeholder: cardIsAmex ? "CID" : "CVC"
|
|
262
|
+
}))), /* @__PURE__ */ React.createElement(Col, { span: 24 }, /* @__PURE__ */ React.createElement(Form.Item, {
|
|
256
263
|
label: locales.getText("tocPay.text.cardholderName"),
|
|
257
264
|
name: "card_name",
|
|
258
265
|
rules: [{
|
|
@@ -96,5 +96,9 @@ const clientPayment = (params) => {
|
|
|
96
96
|
const getUniqueIdempotencyToken = () => {
|
|
97
97
|
return `${dayjs().format("YYYYMMDDHHmmssSSS")}-${getUniqueId()}`;
|
|
98
98
|
};
|
|
99
|
+
const isAmex = (str) => {
|
|
100
|
+
const cardNumber = str.replace(/\D/g, "");
|
|
101
|
+
return cardNumber.startsWith("34") || cardNumber.startsWith("37");
|
|
102
|
+
};
|
|
99
103
|
//#endregion
|
|
100
|
-
export { clientPayment, formatFranchiseeRoute, formatWalletPassList2PreparePayments, formatWalletPassParams, getAvailableMaxAmount, getIsWalletPassAndTripartitePayment, getUniqueIdempotencyToken };
|
|
104
|
+
export { clientPayment, formatFranchiseeRoute, formatWalletPassList2PreparePayments, formatWalletPassParams, getAvailableMaxAmount, getIsWalletPassAndTripartitePayment, getUniqueIdempotencyToken, isAmex };
|
|
@@ -2,6 +2,7 @@ import { _asyncToGenerator } from "../../_virtual/_@oxc-project_runtime@0.122.0/
|
|
|
2
2
|
import useEngineContext from "../../hooks/useEngineContext.js";
|
|
3
3
|
import { useSalesSdk } from "../../plus/salesSdk/hooks/useSalesSdk.js";
|
|
4
4
|
import { getTempOrderSyncPayload, shouldApplySharedTempOrderPayload } from "../../plus/salesSdk/tempOrderSync.js";
|
|
5
|
+
import "../../plus/salesSdk/index.js";
|
|
5
6
|
import { useEffect, useRef } from "react";
|
|
6
7
|
import { useMemoizedFn } from "ahooks";
|
|
7
8
|
//#region src/components/sharedSecondaryBigSale/SharedSecondaryBigSaleReceiver.tsx
|
package/es/index.js
CHANGED
|
@@ -86,6 +86,7 @@ import { useSalesSdkProducts } from "./plus/salesSdk/hooks/useSalesSdkProducts.j
|
|
|
86
86
|
import SalesSdkDemo from "./plus/salesSdk/demo/index.js";
|
|
87
87
|
import { useSalesSdkDish } from "./plus/salesSdk/hooks/useSalesSdkDish.js";
|
|
88
88
|
import { useSyncOsModule } from "./plus/salesSdk/hooks/useSyncOsModule.js";
|
|
89
|
+
import "./plus/salesSdk/index.js";
|
|
89
90
|
import BigSaleRightActionPanel from "./components/BigSaleRightActionPanel/index.js";
|
|
90
91
|
import ResponsiveWrapper from "./components/list/ResponsiveWrapper.js";
|
|
91
92
|
import { resolveBigSaleSelectionFlowConfig } from "./components/bigSale/selectionFlowConfig.js";
|
|
@@ -139,6 +140,7 @@ import PisellVenueControlPage from "./plus/pisellReservation/PisellVenueControlP
|
|
|
139
140
|
import PisellVenueWallPage from "./plus/pisellReservation/PisellVenueWallPage.js";
|
|
140
141
|
import PisellReservationTablePage from "./plus/pisellReservation/PisellReservationTablePage.js";
|
|
141
142
|
import SelectFloorMapResourceDialog from "./plus/pisellReservation/components/SelectFloorMapResourceDialog.js";
|
|
143
|
+
import "./plus/pisellReservation/index.js";
|
|
142
144
|
import { PisellTopology, PisellTopologyCore } from "./plus/pisellTopology/PisellTopology.js";
|
|
143
145
|
import cupProject_default from "./components/ecocup/cupProject/index.js";
|
|
144
146
|
import CupList from "./components/ecocup/cupList/index.js";
|
|
@@ -280,4 +280,4 @@ function attachSelectedSettlement(item, selectedSettlement) {
|
|
|
280
280
|
});
|
|
281
281
|
}
|
|
282
282
|
//#endregion
|
|
283
|
-
export { attachSelectedSettlement, buildSettlementPriceRows, createVirtualOnlySkuDisplayProduct, formatSettlementAmount, formatSettlementSelectionTotal, formatTempOrderSettlementAmount, getSettlementKey, getSettlementOptions, hasSettlementOptions, hasSufficientVirtualCurrencyBalance, isVirtualOnlySettlementProduct, isVirtualSettlementTempOrder, resolveConfiguredUnavailableReason, resolveLegalSettlementAddOnUnitPrice, resolveSettlementOptionEntries, resolveVirtualSettlementErrorMessage, showVirtualSettlementErrorToast };
|
|
283
|
+
export { attachSelectedSettlement, buildSettlementPriceRows, createVirtualOnlySkuDisplayProduct, findFirstVirtualCurrencyAsset, formatSettlementAmount, formatSettlementSelectionTotal, formatTempOrderSettlementAmount, getReservedVirtualSettlementAmount, getSettlementKey, getSettlementOptions, hasSettlementOptions, hasSufficientVirtualCurrencyBalance, isVirtualOnlySettlementProduct, isVirtualSettlementTempOrder, resolveConfiguredUnavailableReason, resolveLegalSettlementAddOnUnitPrice, resolveSettlementOptionEntries, resolveVirtualSettlementErrorMessage, showVirtualSettlementErrorToast };
|
|
@@ -259,4 +259,4 @@ function bookingListToReservationTableRows(bookings) {
|
|
|
259
259
|
return rows;
|
|
260
260
|
}
|
|
261
261
|
//#endregion
|
|
262
|
-
export { applyHostResourceShellToBaseRow, bookingListToReservationTableRows, customerBrief, extractResourceRecordIds, filterBookingsByResourceIds, hostBookingUiPatchFromRecord, mergeBookingsForResourceRecord };
|
|
262
|
+
export { applyHostResourceShellToBaseRow, bookingListToReservationTableRows, customerBrief, extractResourceRecordIds, filterBookingsByResourceIds, hostBookingStatusToCardStatus, hostBookingUiPatchFromRecord, mergeBookingsForResourceRecord };
|
|
@@ -78,4 +78,4 @@ function toastFloorPlanLoadError(err) {
|
|
|
78
78
|
PisellToast({ content: err instanceof Error ? err.message : String(err) });
|
|
79
79
|
}
|
|
80
80
|
//#endregion
|
|
81
|
-
export { PISELL_RESERVATION_FLOOR_PLAN_CODE, ensureShopFloorPlanByCode, saveViewConfigToShopFloorPlan, shopLayoutToSceneElements$1 as shopLayoutToSceneElements, toastFloorPlanLoadError, toastFloorPlanSaveError, unsubscribeShopFloorPlanCodeQuery };
|
|
81
|
+
export { PISELL_RESERVATION_FLOOR_PLAN_CODE, buildDefaultReservationFloorPlanPostBody, ensureShopFloorPlanByCode, putShopFloorPlan, saveViewConfigToShopFloorPlan, shopLayoutToSceneElements$1 as shopLayoutToSceneElements, toastFloorPlanLoadError, toastFloorPlanSaveError, unsubscribeShopFloorPlanCodeQuery };
|
|
@@ -927,4 +927,4 @@ function getReservationDataSourceFormColumns() {
|
|
|
927
927
|
];
|
|
928
928
|
}
|
|
929
929
|
//#endregion
|
|
930
|
-
export { RESERVATION_BOUND_ROUND_TABLE_ELEMENT_KIND, RESERVATION_BOUND_TABLE_ELEMENT_KIND, applyReservationFloorMapLiveLabels, defaultReservationTableRows, getDefaultReservationFloorMapConfig, getReservationDataSourceFormColumns, getReservationFloorMapShellConfig, mergeFloorMapElementKindCategoriesWithDefaults, mergeFloorMapElementKindsWithDefaults };
|
|
930
|
+
export { RESERVATION_BOUND_ROUND_TABLE_ELEMENT_KIND, RESERVATION_BOUND_TABLE_ELEMENT_KIND, applyReservationFloorMapLiveLabels, defaultReservationSceneElements, defaultReservationTableRows, getDefaultReservationFloorMapConfig, getReservationDataSourceFormColumns, getReservationFloorMapShellConfig, mergeFloorMapElementKindCategoriesWithDefaults, mergeFloorMapElementKindsWithDefaults };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import "./serve/formResourcePage.js";
|
|
2
|
+
import "./floorRoomCard/mapRowToFloorRoomCardData.js";
|
|
3
|
+
import "./floorRoomCard/ReservationFloorRoomCard.js";
|
|
4
|
+
import "./floorMap/reservationMock.js";
|
|
5
|
+
import "./floorMap/floorPlanApi.js";
|
|
6
|
+
import "./reservationConstants.js";
|
|
7
|
+
import "./data/bookingToReservationTables.js";
|
|
8
|
+
import "./data/formResourceToReservationTables.js";
|
|
9
|
+
import "./data/salesEmbeddedResourceToTableRows.js";
|
|
10
|
+
import "./floorMap/reservationCards.js";
|
|
11
|
+
import "./PisellReservation.js";
|
|
12
|
+
import "./PisellReservationBookingPage.js";
|
|
13
|
+
import "./PisellVenueControlPage.js";
|
|
14
|
+
import "./PisellVenueWallPage.js";
|
|
15
|
+
import "./PisellReservationTablePage.js";
|
|
16
|
+
import "./components/SelectFloorMapResourceDialog.js";
|
|
17
|
+
export {};
|
|
@@ -11,6 +11,7 @@ import { useSalesSdkCart } from "../salesSdk/hooks/useSalesSdkCart.js";
|
|
|
11
11
|
import { useSalesSdkCustomer } from "../salesSdk/hooks/useSalesSdkCustomer.js";
|
|
12
12
|
import { useSalesSdkBookingContext } from "../salesSdk/context/SalesSdkBookingContext.js";
|
|
13
13
|
import { useSalesSdkSummary } from "../salesSdk/hooks/useSalesSdkSummary.js";
|
|
14
|
+
import "../salesSdk/index.js";
|
|
14
15
|
import locales_default from "./locales.js";
|
|
15
16
|
import locales_default$1 from "./components/LineItem/locales.js";
|
|
16
17
|
import { SaleOrderActionBoundary } from "./actions/index.js";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { _objectSpread2 } from "../../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
|
|
2
2
|
import useEngineContext from "../../../../../hooks/useEngineContext.js";
|
|
3
3
|
import { useSalesSdkBookingContext } from "../../../../salesSdk/context/SalesSdkBookingContext.js";
|
|
4
|
+
import "../../../../salesSdk/index.js";
|
|
4
5
|
import { useMemo } from "react";
|
|
5
6
|
import { useMemoizedFn } from "ahooks";
|
|
6
7
|
//#region src/plus/saleDetail/components/Client/hooks/useClientSelectorProps.ts
|
|
@@ -4,6 +4,7 @@ import { _objectWithoutProperties } from "../../../../_virtual/_@oxc-project_run
|
|
|
4
4
|
import useEngineContext from "../../../../hooks/useEngineContext.js";
|
|
5
5
|
import useLogger from "../../../../hooks/useLogger.js";
|
|
6
6
|
import { useSalesSdk } from "../../../salesSdk/hooks/useSalesSdk.js";
|
|
7
|
+
import "../../../salesSdk/index.js";
|
|
7
8
|
import { invokeLocalReceiptPrint, resolveLocalReceiptPrintModule, resolveSaleDetailOrderIdFromSales } from "./utils.js";
|
|
8
9
|
import { getRemotePrintActions, getWristbandList } from "../../serve.js";
|
|
9
10
|
import { EBizPrintType } from "./types.js";
|
|
@@ -9,6 +9,7 @@ import { useSalesSdk } from "../../../salesSdk/hooks/useSalesSdk.js";
|
|
|
9
9
|
import { useSalesSdkCart } from "../../../salesSdk/hooks/useSalesSdkCart.js";
|
|
10
10
|
import { useSalesSdkGlobalScanActivity } from "../../../salesSdk/context/SalesSdkGlobalScanActivityContext.js";
|
|
11
11
|
import { useSalesSdkSummary } from "../../../salesSdk/hooks/useSalesSdkSummary.js";
|
|
12
|
+
import "../../../salesSdk/index.js";
|
|
12
13
|
import { resolveSaleDetailTempOrder } from "../../utils.js";
|
|
13
14
|
import { getNumericAmount, getSalesHostModule, resolveSaleDetailOrderIdFromSales, resolveSaleDetailOrderIdFromSalesResult, shouldCloseDialogAfterCheckout, updateLocalOrder } from "./utils.js";
|
|
14
15
|
import { deriveSaleOrderSubmitState } from "../../actions/state.js";
|
|
@@ -5,6 +5,7 @@ import { isAppliedPaymentRecord } from "../../../salesSdk/utils/paymentStatus.js
|
|
|
5
5
|
import { useSalesSdk } from "../../../salesSdk/hooks/useSalesSdk.js";
|
|
6
6
|
import { useSalesSdkCart } from "../../../salesSdk/hooks/useSalesSdkCart.js";
|
|
7
7
|
import { useSalesSdkSummary } from "../../../salesSdk/hooks/useSalesSdkSummary.js";
|
|
8
|
+
import "../../../salesSdk/index.js";
|
|
8
9
|
import { resolveSaleDetailTempOrder } from "../../utils.js";
|
|
9
10
|
import React, { memo, useMemo } from "react";
|
|
10
11
|
import { formatAmount, locales } from "@pisell/utils";
|
|
@@ -4,6 +4,7 @@ import { useSalesSdk } from "../salesSdk/hooks/useSalesSdk.js";
|
|
|
4
4
|
import { SalesSdkProvider } from "../salesSdk/context/SalesSdkProvider.js";
|
|
5
5
|
import { SalesSdkDishProvider } from "../salesSdk/context/SalesSdkDishContext.js";
|
|
6
6
|
import { SalesSdkBookingContextProvider } from "../salesSdk/context/SalesSdkBookingContext.js";
|
|
7
|
+
import "../salesSdk/index.js";
|
|
7
8
|
import Base_default from "./Base.js";
|
|
8
9
|
import { resolveSaleDetailOsProps } from "./osProps.js";
|
|
9
10
|
import React, { forwardRef, useImperativeHandle } from "react";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import useStableInstanceId from "../../../../../../hooks/useStableInstanceId.js";
|
|
2
2
|
import { useSalesSdkDish } from "../../../../../salesSdk/hooks/useSalesSdkDish.js";
|
|
3
3
|
import { useCurrentSalesSdkDish } from "../../../../../salesSdk/hooks/useCurrentSalesSdkDish.js";
|
|
4
|
+
import "../../../../../salesSdk/index.js";
|
|
4
5
|
import { SaleDetailStatusOverview } from "../shared/StatusOverview.js";
|
|
5
6
|
import { DishGroupView } from "./DishGroupView.js";
|
|
6
7
|
import dayjs from "dayjs";
|
|
@@ -8,7 +8,7 @@ function WalletPassRecordCard({ record }) {
|
|
|
8
8
|
return /* @__PURE__ */ React.createElement("article", { className: classNames(PREFIX, {
|
|
9
9
|
[`${PREFIX}--received`]: isReceived,
|
|
10
10
|
[`${PREFIX}--used`]: !isReceived
|
|
11
|
-
}) }, /* @__PURE__ */ React.createElement("div", { className: `${PREFIX}__content` }, !isReceived ? /* @__PURE__ */ React.createElement("div", { className: `${PREFIX}__pass-id` }, record.code || "—") : null, /* @__PURE__ */ React.createElement("div", { className: `${PREFIX}__badges` }, /* @__PURE__ */ React.createElement("span", { className: `${PREFIX}__badge ${PREFIX}__badge--${record.status}` }, record.status)), /* @__PURE__ */ React.createElement("div", { className: `${PREFIX}__name` }, record.productName || "—"), /* @__PURE__ */ React.createElement("div", { className: `${PREFIX}__meta` }, record.encoded ? /* @__PURE__ */ React.createElement("span", null, locales.getText("pisell2.sale-detail.walletpass.code"), ":", " ", record.encoded) : null, record.balanceText ? /* @__PURE__ */ React.createElement("span", null, record.balanceText) : null)), /* @__PURE__ */ React.createElement("div", { className: `${PREFIX}__amount` }, /* @__PURE__ */ React.createElement("span", null, record.usageLabel), /* @__PURE__ */ React.createElement("strong", null, record.usageValue)));
|
|
11
|
+
}) }, /* @__PURE__ */ React.createElement("div", { className: `${PREFIX}__content` }, !isReceived ? /* @__PURE__ */ React.createElement("div", { className: `${PREFIX}__pass-id` }, record.code || "—") : null, /* @__PURE__ */ React.createElement("div", { className: `${PREFIX}__badges` }, /* @__PURE__ */ React.createElement("span", { className: `${PREFIX}__badge ${PREFIX}__badge--${record.status}` }, record.status)), /* @__PURE__ */ React.createElement("div", { className: `${PREFIX}__name` }, record.productName || "—"), /* @__PURE__ */ React.createElement("div", { className: `${PREFIX}__meta` }, record.encoded ? /* @__PURE__ */ React.createElement("span", null, locales.getText("pisell2.sale-detail.walletpass.code"), ":", " ", record.encoded) : null, record.balanceText ? /* @__PURE__ */ React.createElement("span", null, record.balanceText) : null)), /* @__PURE__ */ React.createElement("div", { className: `${PREFIX}__amount` }, record.usageLabel ? /* @__PURE__ */ React.createElement("span", null, record.usageLabel) : null, /* @__PURE__ */ React.createElement("strong", null, record.usageValue)));
|
|
12
12
|
}
|
|
13
13
|
//#endregion
|
|
14
14
|
export { WalletPassRecordCard };
|
|
@@ -9,6 +9,9 @@ function formatCount(count, locale) {
|
|
|
9
9
|
const value = Math.round(count || 0);
|
|
10
10
|
return locale === "zh" ? `${value} 次` : `${value} use${value === 1 ? "" : "s"}`;
|
|
11
11
|
}
|
|
12
|
+
function formatCountValue(count) {
|
|
13
|
+
return String(Math.round(count || 0));
|
|
14
|
+
}
|
|
12
15
|
function formatPoints(points, locale) {
|
|
13
16
|
const value = formatPlainNumber(points);
|
|
14
17
|
return locale === "zh" ? `${value} 积分` : `${value} pts`;
|
|
@@ -22,12 +25,19 @@ function getUsageValue(amount, unit, symbol, locale) {
|
|
|
22
25
|
if (unit === "count") return formatCount(amount, locale);
|
|
23
26
|
return formatMoney(amount, symbol);
|
|
24
27
|
}
|
|
25
|
-
function
|
|
28
|
+
function formatPercentage(amount) {
|
|
29
|
+
return `${formatPlainNumber(amount)}%`;
|
|
30
|
+
}
|
|
31
|
+
function formatPercentageBalanceText(amount, locale) {
|
|
32
|
+
const value = formatPercentage(amount);
|
|
33
|
+
return locale === "zh" ? `余额 / 剩余:${value}` : `Balance / remaining: ${value}`;
|
|
34
|
+
}
|
|
35
|
+
function formatBalanceText(amount, unit, symbol, locale, remainingUses, showCountUnit = true) {
|
|
26
36
|
if (amount !== null && Number.isFinite(amount)) {
|
|
27
|
-
const value = unit === "points" ? formatPoints(amount, locale) : unit === "count" ? formatCount(amount, locale) : formatMoney(amount, symbol);
|
|
37
|
+
const value = unit === "points" ? formatPoints(amount, locale) : unit === "count" ? showCountUnit ? formatCount(amount, locale) : formatPlainNumber(amount) : formatMoney(amount, symbol);
|
|
28
38
|
return locale === "zh" ? `余额 / 剩余:${value}` : `Balance / remaining: ${value}`;
|
|
29
39
|
}
|
|
30
|
-
if (remainingUses !== void 0 && remainingUses !== null) return locale === "zh" ? `余额 / 剩余:${formatCount(remainingUses, locale)}` : `Balance / remaining: ${formatCount(remainingUses, locale)}`;
|
|
40
|
+
if (remainingUses !== void 0 && remainingUses !== null) return locale === "zh" ? `余额 / 剩余:${showCountUnit ? formatCount(remainingUses, locale) : formatPlainNumber(remainingUses)}` : `Balance / remaining: ${showCountUnit ? formatCount(remainingUses, locale) : formatPlainNumber(remainingUses)}`;
|
|
31
41
|
return "";
|
|
32
42
|
}
|
|
33
43
|
function maskPassId(value) {
|
|
@@ -36,4 +46,4 @@ function maskPassId(value) {
|
|
|
36
46
|
return text;
|
|
37
47
|
}
|
|
38
48
|
//#endregion
|
|
39
|
-
export { formatBalanceText, getUsageLabel, getUsageValue, maskPassId };
|
|
49
|
+
export { formatBalanceText, formatCountValue, formatPercentage, formatPercentageBalanceText, getUsageLabel, getUsageValue, maskPassId };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { formatBalanceText, getUsageLabel, getUsageValue, maskPassId } from "./format.js";
|
|
1
|
+
import { formatBalanceText, formatCountValue, formatPercentage, formatPercentageBalanceText, getUsageLabel, getUsageValue, maskPassId } from "./format.js";
|
|
2
2
|
import { asRecords, readMoneyFromKeys, readText } from "./read.js";
|
|
3
3
|
import { buildRecord, getRecordTime } from "./recordFactory.js";
|
|
4
4
|
//#region src/plus/saleDetail/tmpl/B/components/WalletPass/utils/vouchers.ts
|
|
@@ -8,6 +8,10 @@ const WALLET_PASS_VOUCHER_TAGS = new Set([
|
|
|
8
8
|
"gift_card",
|
|
9
9
|
"product_voucher"
|
|
10
10
|
]);
|
|
11
|
+
function getVoucherAmountUnit(tag) {
|
|
12
|
+
if (tag === "good_pass") return "count";
|
|
13
|
+
return "money";
|
|
14
|
+
}
|
|
11
15
|
const TICKET_VOUCHER_TAGS = new Set([
|
|
12
16
|
"ticket",
|
|
13
17
|
"product_package_ticket",
|
|
@@ -29,30 +33,41 @@ function isWalletPassVoucher(voucher) {
|
|
|
29
33
|
function normalizeVoucherStatus(voucher) {
|
|
30
34
|
return readText(voucher, ["status"]).trim().toLowerCase().replace(/[\s-]+/g, "_") === "used" ? "used" : "unused";
|
|
31
35
|
}
|
|
32
|
-
function
|
|
36
|
+
function isPercentageDiscountVoucher(voucher, tag) {
|
|
37
|
+
return tag === "product_discount_card" && readText(voucher, ["metadata.discount_card_type"]).trim().toLowerCase() === "percent";
|
|
38
|
+
}
|
|
39
|
+
function readVoucherAmount(voucher, status, amountUnit) {
|
|
40
|
+
var _ref;
|
|
33
41
|
const usedAmount = readMoneyFromKeys(voucher, ["used_par_value"]);
|
|
34
42
|
const issuedAmount = readMoneyFromKeys(voucher, ["par_value"]);
|
|
35
|
-
|
|
43
|
+
const balance = amountUnit === "money" ? null : readMoneyFromKeys(voucher, ["balance"]);
|
|
44
|
+
return Math.max(0, status === "used" ? usedAmount !== null && usedAmount !== void 0 ? usedAmount : 0 : (_ref = issuedAmount !== null && issuedAmount !== void 0 ? issuedAmount : balance) !== null && _ref !== void 0 ? _ref : 0);
|
|
36
45
|
}
|
|
37
|
-
function readVoucherBalance(voucher) {
|
|
46
|
+
function readVoucherBalance(voucher, amountUnit) {
|
|
38
47
|
var _readMoneyFromKeys, _readMoneyFromKeys2;
|
|
48
|
+
if (amountUnit !== "money") {
|
|
49
|
+
const balance = readMoneyFromKeys(voucher, ["balance"]);
|
|
50
|
+
if (balance !== null) return Math.max(0, balance);
|
|
51
|
+
}
|
|
39
52
|
return ((_readMoneyFromKeys = readMoneyFromKeys(voucher, ["par_value"])) !== null && _readMoneyFromKeys !== void 0 ? _readMoneyFromKeys : 0) - ((_readMoneyFromKeys2 = readMoneyFromKeys(voucher, ["used_par_value"])) !== null && _readMoneyFromKeys2 !== void 0 ? _readMoneyFromKeys2 : 0);
|
|
40
53
|
}
|
|
41
54
|
function buildVoucherWalletPassRecord(voucher, index, symbol, locale) {
|
|
42
55
|
if (!isWalletPassVoucher(voucher)) return null;
|
|
43
56
|
const status = normalizeVoucherStatus(voucher);
|
|
44
57
|
const direction = "received";
|
|
45
|
-
const
|
|
46
|
-
const
|
|
58
|
+
const tag = normalizeVoucherTag(voucher);
|
|
59
|
+
const amountUnit = getVoucherAmountUnit(tag);
|
|
60
|
+
const amountValue = readVoucherAmount(voucher, status, amountUnit);
|
|
61
|
+
const isPercentageDiscount = isPercentageDiscountVoucher(voucher, tag);
|
|
47
62
|
const productName = readText(voucher, ["product_name"]);
|
|
48
63
|
const code = maskPassId(readText(voucher, ["code"]));
|
|
49
64
|
const encoded = readText(voucher, ["encoded"]);
|
|
50
|
-
const balance = readVoucherBalance(voucher);
|
|
65
|
+
const balance = readVoucherBalance(voucher, amountUnit);
|
|
51
66
|
const id = String(readText(voucher, ["voucher_id"]) || code || `voucher-${index}`);
|
|
52
67
|
return buildRecord({
|
|
53
68
|
amountUnit,
|
|
54
69
|
amountValue,
|
|
55
|
-
balanceText: formatBalanceText(balance, amountUnit, symbol, locale),
|
|
70
|
+
balanceText: isPercentageDiscount ? formatPercentageBalanceText(balance, locale) : formatBalanceText(balance, amountUnit, symbol, locale, void 0, amountUnit !== "count"),
|
|
56
71
|
code,
|
|
57
72
|
direction,
|
|
58
73
|
encoded,
|
|
@@ -61,8 +76,8 @@ function buildVoucherWalletPassRecord(voucher, index, symbol, locale) {
|
|
|
61
76
|
sortTime: getRecordTime(voucher, index),
|
|
62
77
|
sourceVoucher: voucher,
|
|
63
78
|
status,
|
|
64
|
-
usageLabel: getUsageLabel(status, locale),
|
|
65
|
-
usageValue: getUsageValue(amountValue, amountUnit, symbol, locale)
|
|
79
|
+
usageLabel: isPercentageDiscount ? "" : getUsageLabel(status, locale),
|
|
80
|
+
usageValue: isPercentageDiscount ? formatPercentage(amountValue) : amountUnit === "count" ? formatCountValue(amountValue) : getUsageValue(amountValue, amountUnit, symbol, locale)
|
|
66
81
|
});
|
|
67
82
|
}
|
|
68
83
|
function getVoucherRows(input) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { _objectSpread2 } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
|
|
2
2
|
import useEngineContext from "../../../../hooks/useEngineContext.js";
|
|
3
3
|
import { useCurrentSalesSdkDish } from "../../../salesSdk/hooks/useCurrentSalesSdkDish.js";
|
|
4
|
+
import "../../../salesSdk/index.js";
|
|
4
5
|
import { getInternalNotesByScheduleEvent } from "../../serve.js";
|
|
5
6
|
import { TEMPLATE_B_PAY_ACTIONS, TEMPLATE_B_SUMMARY_ACTIONS } from "../../components/DetailActions/configs/index.js";
|
|
6
7
|
import { DetailActions } from "../../components/DetailActions/index.js";
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import "./hosts/createInstanceHostBridge.js";
|
|
2
|
+
import "./holderConfirm/createHolderConfirmBridge.js";
|
|
3
|
+
import "./giftSelect/createGiftSelectBridge.js";
|
|
4
|
+
import "./context/SalesSdkHostBridgesContext.js";
|
|
5
|
+
import "./utils/formatHolderOptions.js";
|
|
6
|
+
import "./utils/enrichCartLineHolderDisplay.js";
|
|
7
|
+
import "./context/SalesSdkHolderContext.js";
|
|
8
|
+
import "../multiCurrencySettlement/index.js";
|
|
9
|
+
import "./utils/appendPromotionTags.js";
|
|
10
|
+
import "./context/SalesSdkUIHostsContext.js";
|
|
11
|
+
import "./utils/runAddProductFlow.js";
|
|
12
|
+
import "./components/showAddToCartToast.js";
|
|
13
|
+
import "./utils/resolveAddProductDebounceKey.js";
|
|
14
|
+
import "./utils/productSkuOptions.js";
|
|
15
|
+
import "./utils/identity.js";
|
|
16
|
+
import "./utils/resolveInCartQuantityForAddToast.js";
|
|
17
|
+
import "./utils/addProductWithFlowDebounced.js";
|
|
18
|
+
import "./utils/customerAuthGate.js";
|
|
19
|
+
import "./utils/bookingDate.js";
|
|
20
|
+
import "./utils/holderSubmitValidation.js";
|
|
21
|
+
import "./utils/removeOrderProducts.js";
|
|
22
|
+
import "./selectors.js";
|
|
23
|
+
import "./utils/enrich.js";
|
|
24
|
+
import "./giftSelect/createOpenGiftSelectHost.js";
|
|
25
|
+
import "./utils/ensureHoldersBeforeSubmit.js";
|
|
26
|
+
import "./hooks/useSalesSdk.js";
|
|
27
|
+
import "./bookingEditService/BookingEditServiceDrawer.js";
|
|
28
|
+
import "./hosts/BookingEditHostRenderer.js";
|
|
29
|
+
import "./hosts/CustomerAuthHostRenderer.js";
|
|
30
|
+
import "./hooks/useSalesSdkCart.js";
|
|
31
|
+
import "./hooks/useSalesSdkCustomer.js";
|
|
32
|
+
import "./normalProductDetail/NormalProductDetailHostRenderer.js";
|
|
33
|
+
import "./hosts/createOpenBookingEditHost.js";
|
|
34
|
+
import "./hosts/createOpenMultiDaySelectHost.js";
|
|
35
|
+
import "./hosts/createOpenHolderSelectHost.js";
|
|
36
|
+
import "./hosts/createOpenCustomerAuthHost.js";
|
|
37
|
+
import "./demo/hosts/legacyOpenProductDetail.js";
|
|
38
|
+
import "./hosts/createCompositeOpenProductDetailHost.js";
|
|
39
|
+
import "./normalProductDetail/createOpenNormalProductDetailHost.js";
|
|
40
|
+
import "./normalProductDetail/createOpenBookingSelectionFlowHost.js";
|
|
41
|
+
import "./giftSelect/GiftSelectModal.js";
|
|
42
|
+
import "./giftSelect/GiftSelectHostRenderer.js";
|
|
43
|
+
import "./allergy/AllergySelectionModal.js";
|
|
44
|
+
import "./context/SalesSdkProvider.js";
|
|
45
|
+
import "./context/SalesSdkDishContext.js";
|
|
46
|
+
import "./context/SalesSdkBookingContext.js";
|
|
47
|
+
import "./hooks/useSalesSdkSummary.js";
|
|
48
|
+
import "./hooks/useSalesSdkProducts.js";
|
|
49
|
+
import "./demo/index.js";
|
|
50
|
+
import "./hooks/useSalesSdkDish.js";
|
|
51
|
+
import "./hooks/useCurrentSalesSdkDish.js";
|
|
52
|
+
import "./hooks/useSyncOsModule.js";
|
|
53
|
+
export {};
|
|
@@ -31,4 +31,4 @@ function subscribeBookingDateChange(bookingTicket, callback) {
|
|
|
31
31
|
return typeof off === "function" ? off : () => {};
|
|
32
32
|
}
|
|
33
33
|
//#endregion
|
|
34
|
-
export { formatBookingDateTime, subscribeBookingDateChange };
|
|
34
|
+
export { BOOKING_CONTEXT_DATE_EVENT, formatBookingDateTime, subscribeBookingDateChange };
|
|
@@ -71,4 +71,4 @@ function buildHolderListRequestKey(params) {
|
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
73
|
//#endregion
|
|
74
|
-
export { buildHolderListRequestKey, buildHolderListRequestParams, enrichCartBookingHolderDisplay, resolveHolderDisplayConfig };
|
|
74
|
+
export { buildHolderListRequestKey, buildHolderListRequestParams, enrichCartBookingHolderDisplay, pickHolderIdFromBooking, resolveHolderDisplayConfig };
|