@pisell/private-materials 6.5.4 → 6.5.6
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/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +160 -146
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +9 -9
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +9 -9
- package/es/components/booking/addons/model.d.ts +1 -10
- package/es/components/booking/components/actionButtons/index.js +37 -42
- package/es/components/booking/components/actionButtons/index.less +0 -28
- package/es/components/booking/components/footer/amount.d.ts +3 -3
- package/es/components/booking/components/footer/amount.js +51 -31
- package/es/components/booking/components/footer/index.js +177 -68
- package/es/components/booking/components/footer/utils.js +62 -33
- package/es/components/booking/forms/model.d.ts +1 -10
- package/es/components/booking/info/model.d.ts +1 -10
- package/es/components/booking/info/model.js +5 -0
- package/es/components/booking/info/service/addService/index.js +2 -1
- package/es/components/booking/info/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info/service2/utils.d.ts +1 -1
- package/es/components/booking/info2/index.js +42 -2
- package/es/components/booking/info2/service/addService/index.js +2 -1
- package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info2/service/editService/index.js +12 -4
- package/es/components/booking/model.d.ts +1 -9
- package/es/components/booking/notes/model.d.ts +1 -10
- package/es/components/booking/payments/model.d.ts +1 -10
- package/es/components/booking/utils.js +10 -5
- package/es/components/checkout/PaymentModal.d.ts +2 -0
- package/es/components/checkout/PaymentModal.js +462 -263
- package/es/components/checkout/components/AdditionalModule/index.less +1 -1
- package/es/components/checkout/components/AmountSummary/index.js +176 -65
- package/es/components/checkout/components/AmountSummary/index.less +13 -0
- package/es/components/checkout/components/CashPaymentModule/index.d.ts +5 -3
- package/es/components/checkout/components/CashPaymentModule/index.js +110 -132
- package/es/components/checkout/components/CashPaymentModule/index.less +200 -176
- package/es/components/checkout/components/PaymentDetailModal/index.js +2 -2
- package/es/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.d.ts +29 -0
- package/es/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.js +214 -0
- package/es/components/checkout/components/PaymentOptionsModule/index.d.ts +2 -4
- package/es/components/checkout/components/PaymentOptionsModule/index.js +12 -114
- package/es/components/checkout/components/PaymentOptionsModule/index.less +23 -0
- package/es/components/checkout/components/PaymentResultToast/index.js +38 -8
- package/es/components/checkout/components/PaymentResultToast/types.d.ts +2 -0
- package/es/components/checkout/components/SavePayLaterHandler/index.js +1 -1
- package/es/components/checkout/components/SearchAndClientModule/index.js +40 -39
- package/es/components/checkout/components/WalletPassModule/index.js +4 -3
- package/es/components/checkout/components/WalletPassModule/utils.js +10 -4
- package/es/components/checkout/hooks/useWalletPass.js +11 -4
- package/es/components/checkout/index.less +1 -1
- package/es/components/checkout/locales.d.ts +36 -0
- package/es/components/checkout/locales.js +43 -4
- package/es/components/checkout/types.d.ts +1 -0
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/store/index.d.ts +3 -3
- package/es/components/pay/toC/model.d.ts +1 -9
- package/es/components/schedules/model.d.ts +1 -9
- package/es/components/shoppingCart/components/Cart/Product.js +143 -71
- package/es/components/shoppingCart/components/Cart/index.js +1 -1
- package/es/components/shoppingCart/components/Cart/index.less +31 -0
- package/es/components/shoppingCart/locales.d.ts +3 -0
- package/es/components/shoppingCart/locales.js +12 -3
- package/es/components/ticketBooking/components/addServiceVariant/addService.d.ts +0 -1
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +9 -12
- package/es/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -1
- package/es/components/ticketBooking/components/menuBar/index.js +3 -1
- package/es/components/ticketBooking/components/menuBar/index.less +7 -0
- package/es/components/ticketBooking/components/ticketBooking/index.d.ts +0 -1
- package/es/components/ticketBooking/hooks/pisellos/useCustomer.js +7 -7
- package/es/components/ticketBooking/index.d.ts +0 -1
- package/es/components/ticketBooking/utils/index.d.ts +1 -1
- package/es/components/ticketBooking/utils/index.js +2 -1
- package/es/components/wallet/Detail/model.d.ts +1 -13
- package/es/components/wallet/DiscountCard/model.d.ts +1 -14
- package/es/components/wallet/PointCard/model.d.ts +1 -13
- package/es/components/wallet/RechargeableCard/model.d.ts +1 -29
- package/es/components/wallet/Voucher/model.d.ts +1 -13
- package/es/components/wallet/model.d.ts +1 -9
- package/es/pro/pisellPriceKeyboardPopover/PisellPriceKeyboardPopover.js +1 -1
- package/es/pro/pisellSimplePriceKeyboardPopover/PisellPriceKeyboardPopover.d.ts +5 -0
- package/es/pro/pisellSimplePriceKeyboardPopover/PisellPriceKeyboardPopover.js +148 -0
- package/es/pro/pisellSimplePriceKeyboardPopover/PisellPriceKeyboardPopover.less +23 -0
- package/es/pro/pisellSimplePriceKeyboardPopover/index.d.ts +2 -0
- package/es/pro/pisellSimplePriceKeyboardPopover/index.js +1 -0
- package/es/pro/pisellSimplePriceKeyboardPopover/types.d.ts +33 -0
- package/es/pro/pisellSimplePriceKeyboardPopover/types.js +1 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.d.ts +5 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.js +331 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/CashKeyboardSimple.d.ts +13 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/CashKeyboardSimple.js +349 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/index.d.ts +12 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/index.js +49 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/index.less +103 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/locales.d.ts +39 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/locales.js +41 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/types.d.ts +97 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/types.js +1 -0
- package/es/pro/priceKeyboard/components/discountKeyboard/index.d.ts +22 -0
- package/es/pro/priceKeyboard/components/discountKeyboard/index.js +465 -0
- package/es/pro/priceKeyboard/components/discountKeyboard/index.less +47 -0
- package/es/pro/priceKeyboard/components/discountKeyboard/locales.d.ts +42 -0
- package/es/pro/priceKeyboard/components/discountKeyboard/locales.js +44 -0
- package/es/pro/priceKeyboard/components/discountKeyboard/types.d.ts +17 -0
- package/es/pro/priceKeyboard/components/discountKeyboard/types.js +1 -0
- package/es/pro/priceKeyboard/components/paymentKeyboard/index.d.ts +12 -0
- package/es/pro/priceKeyboard/components/paymentKeyboard/index.js +444 -0
- package/es/pro/priceKeyboard/components/paymentKeyboard/index.less +64 -0
- package/es/pro/priceKeyboard/components/paymentKeyboard/locales.d.ts +45 -0
- package/es/pro/priceKeyboard/components/paymentKeyboard/locales.js +47 -0
- package/es/pro/priceKeyboard/components/paymentKeyboard/types.d.ts +39 -0
- package/es/pro/priceKeyboard/components/paymentKeyboard/types.js +1 -0
- package/es/pro/priceKeyboard/components/shortcuts/index.d.ts +17 -0
- package/es/pro/priceKeyboard/components/shortcuts/index.js +47 -0
- package/es/pro/priceKeyboard/components/shortcuts/index.less +39 -0
- package/es/pro/priceKeyboard/hooks/keyActions.d.ts +28 -0
- package/es/pro/priceKeyboard/hooks/keyActions.js +252 -0
- package/es/pro/priceKeyboard/hooks/rightItems.d.ts +28 -0
- package/es/pro/priceKeyboard/hooks/rightItems.js +50 -0
- package/es/pro/priceKeyboard/index.d.ts +3 -0
- package/es/pro/priceKeyboard/index.js +3 -0
- package/es/pro/priceKeyboard/index.less +215 -0
- package/es/pro/priceKeyboard/utils.d.ts +31 -0
- package/es/pro/priceKeyboard/utils.js +51 -0
- package/es/pro/skuDetailModal/index.js +19 -16
- package/lib/components/booking/addons/model.d.ts +1 -10
- package/lib/components/booking/components/actionButtons/index.js +31 -28
- package/lib/components/booking/components/actionButtons/index.less +0 -28
- package/lib/components/booking/components/footer/amount.d.ts +3 -3
- package/lib/components/booking/components/footer/amount.js +49 -34
- package/lib/components/booking/components/footer/index.js +114 -40
- package/lib/components/booking/components/footer/utils.js +35 -7
- package/lib/components/booking/forms/model.d.ts +1 -10
- package/lib/components/booking/info/model.d.ts +1 -10
- package/lib/components/booking/info/model.js +3 -0
- package/lib/components/booking/info/service/addService/index.js +2 -1
- package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info/service2/utils.d.ts +1 -1
- package/lib/components/booking/info2/index.js +18 -1
- package/lib/components/booking/info2/service/addService/index.js +2 -1
- package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info2/service/editService/index.js +12 -4
- package/lib/components/booking/model.d.ts +1 -9
- package/lib/components/booking/notes/model.d.ts +1 -10
- package/lib/components/booking/payments/model.d.ts +1 -10
- package/lib/components/booking/utils.js +10 -5
- package/lib/components/checkout/PaymentModal.d.ts +2 -0
- package/lib/components/checkout/PaymentModal.js +208 -91
- package/lib/components/checkout/components/AdditionalModule/index.less +1 -1
- package/lib/components/checkout/components/AmountSummary/index.js +120 -50
- package/lib/components/checkout/components/AmountSummary/index.less +13 -0
- package/lib/components/checkout/components/CashPaymentModule/index.d.ts +5 -3
- package/lib/components/checkout/components/CashPaymentModule/index.js +101 -134
- package/lib/components/checkout/components/CashPaymentModule/index.less +200 -176
- package/lib/components/checkout/components/PaymentDetailModal/index.js +2 -2
- package/lib/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.d.ts +29 -0
- package/lib/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.js +163 -0
- package/lib/components/checkout/components/PaymentOptionsModule/index.d.ts +2 -4
- package/lib/components/checkout/components/PaymentOptionsModule/index.js +11 -123
- package/lib/components/checkout/components/PaymentOptionsModule/index.less +23 -0
- package/lib/components/checkout/components/PaymentResultToast/index.js +26 -1
- package/lib/components/checkout/components/PaymentResultToast/types.d.ts +2 -0
- package/lib/components/checkout/components/SavePayLaterHandler/index.js +1 -1
- package/lib/components/checkout/components/SearchAndClientModule/index.js +3 -29
- package/lib/components/checkout/components/WalletPassModule/index.js +4 -3
- package/lib/components/checkout/components/WalletPassModule/utils.js +8 -4
- package/lib/components/checkout/hooks/useWalletPass.js +11 -6
- package/lib/components/checkout/index.less +1 -1
- package/lib/components/checkout/locales.d.ts +36 -0
- package/lib/components/checkout/locales.js +43 -4
- package/lib/components/checkout/types.d.ts +1 -0
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/store/index.d.ts +3 -3
- package/lib/components/pay/toC/model.d.ts +1 -9
- package/lib/components/schedules/model.d.ts +1 -9
- package/lib/components/shoppingCart/components/Cart/Product.js +111 -51
- package/lib/components/shoppingCart/components/Cart/index.js +1 -1
- package/lib/components/shoppingCart/components/Cart/index.less +31 -0
- package/lib/components/shoppingCart/locales.d.ts +3 -0
- package/lib/components/shoppingCart/locales.js +6 -3
- package/lib/components/ticketBooking/components/addServiceVariant/addService.d.ts +0 -1
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +1 -4
- package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -1
- package/lib/components/ticketBooking/components/menuBar/index.js +1 -1
- package/lib/components/ticketBooking/components/menuBar/index.less +7 -0
- package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +0 -1
- package/lib/components/ticketBooking/hooks/pisellos/useCustomer.js +7 -7
- package/lib/components/ticketBooking/index.d.ts +0 -1
- package/lib/components/ticketBooking/utils/index.d.ts +1 -1
- package/lib/components/ticketBooking/utils/index.js +2 -1
- package/lib/components/wallet/Detail/model.d.ts +1 -13
- package/lib/components/wallet/DiscountCard/model.d.ts +1 -14
- package/lib/components/wallet/PointCard/model.d.ts +1 -13
- package/lib/components/wallet/RechargeableCard/model.d.ts +1 -29
- package/lib/components/wallet/Voucher/model.d.ts +1 -13
- package/lib/components/wallet/model.d.ts +1 -9
- package/lib/pro/pisellPriceKeyboardPopover/PisellPriceKeyboardPopover.js +2 -2
- package/lib/pro/pisellSimplePriceKeyboardPopover/PisellPriceKeyboardPopover.d.ts +5 -0
- package/lib/pro/pisellSimplePriceKeyboardPopover/PisellPriceKeyboardPopover.js +144 -0
- package/lib/pro/pisellSimplePriceKeyboardPopover/PisellPriceKeyboardPopover.less +23 -0
- package/lib/pro/pisellSimplePriceKeyboardPopover/index.d.ts +2 -0
- package/lib/pro/pisellSimplePriceKeyboardPopover/index.js +35 -0
- package/lib/pro/pisellSimplePriceKeyboardPopover/types.d.ts +33 -0
- package/lib/pro/pisellSimplePriceKeyboardPopover/types.js +17 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.d.ts +5 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.js +360 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/CashKeyboardSimple.d.ts +13 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/CashKeyboardSimple.js +399 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/index.d.ts +12 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/index.js +76 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/index.less +103 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/locales.d.ts +39 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/locales.js +65 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/types.d.ts +97 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/types.js +17 -0
- package/lib/pro/priceKeyboard/components/discountKeyboard/index.d.ts +22 -0
- package/lib/pro/priceKeyboard/components/discountKeyboard/index.js +504 -0
- package/lib/pro/priceKeyboard/components/discountKeyboard/index.less +47 -0
- package/lib/pro/priceKeyboard/components/discountKeyboard/locales.d.ts +42 -0
- package/lib/pro/priceKeyboard/components/discountKeyboard/locales.js +68 -0
- package/lib/pro/priceKeyboard/components/discountKeyboard/types.d.ts +17 -0
- package/lib/pro/priceKeyboard/components/discountKeyboard/types.js +17 -0
- package/lib/pro/priceKeyboard/components/paymentKeyboard/index.d.ts +12 -0
- package/lib/pro/priceKeyboard/components/paymentKeyboard/index.js +488 -0
- package/lib/pro/priceKeyboard/components/paymentKeyboard/index.less +64 -0
- package/lib/pro/priceKeyboard/components/paymentKeyboard/locales.d.ts +45 -0
- package/lib/pro/priceKeyboard/components/paymentKeyboard/locales.js +71 -0
- package/lib/pro/priceKeyboard/components/paymentKeyboard/types.d.ts +39 -0
- package/lib/pro/priceKeyboard/components/paymentKeyboard/types.js +17 -0
- package/lib/pro/priceKeyboard/components/shortcuts/index.d.ts +17 -0
- package/lib/pro/priceKeyboard/components/shortcuts/index.js +79 -0
- package/lib/pro/priceKeyboard/components/shortcuts/index.less +39 -0
- package/lib/pro/priceKeyboard/hooks/keyActions.d.ts +28 -0
- package/lib/pro/priceKeyboard/hooks/keyActions.js +176 -0
- package/lib/pro/priceKeyboard/hooks/rightItems.d.ts +28 -0
- package/lib/pro/priceKeyboard/hooks/rightItems.js +81 -0
- package/lib/pro/priceKeyboard/index.d.ts +3 -0
- package/lib/pro/priceKeyboard/index.js +45 -0
- package/lib/pro/priceKeyboard/index.less +215 -0
- package/lib/pro/priceKeyboard/utils.d.ts +31 -0
- package/lib/pro/priceKeyboard/utils.js +75 -0
- package/lib/pro/skuDetailModal/index.js +18 -22
- package/package.json +12 -12
@@ -1,10 +1 @@
|
|
1
|
-
|
2
|
-
import { FormState } from "../model";
|
3
|
-
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
4
|
-
state: FormState;
|
5
|
-
} & {
|
6
|
-
dispatch: (params: {
|
7
|
-
type: string;
|
8
|
-
payload: any;
|
9
|
-
}) => void;
|
10
|
-
}>;
|
1
|
+
export declare const Provider: any, Context: any;
|
@@ -16,11 +16,11 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
16
16
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
17
17
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
18
18
|
import React, { useMemo, useState, useEffect } from 'react';
|
19
|
-
import { createPortal } from 'react-dom';
|
20
19
|
import { Button } from 'antd';
|
20
|
+
import Decimal from 'decimal.js';
|
21
21
|
import { Trash01, Calculator, PlusCircle, Sale03 } from '@pisell/icon';
|
22
22
|
import { locales } from '@pisell/utils';
|
23
|
-
import {
|
23
|
+
import { useToast } from '@pisell/materials';
|
24
24
|
import dayjs from 'dayjs';
|
25
25
|
import ClearCartModal from "../clearCartModal";
|
26
26
|
import CustomiseItemModal from "../customiseItemModal";
|
@@ -32,6 +32,7 @@ import { useMemoizedFn } from 'ahooks';
|
|
32
32
|
import useEngineContext, { usePisellOS } from "../../../../hooks/useEngineContext";
|
33
33
|
import useScanManager from "../../../ticketBooking/hooks/pisellos/useScanManager";
|
34
34
|
import { useShopDiscount } from "../../../appointmentBooking/hooks";
|
35
|
+
import { DiscountKeyboard } from "../../../../pro/priceKeyboard";
|
35
36
|
// Toast 内容包装器,统一设置行高
|
36
37
|
var createToastContent = function createToastContent(text) {
|
37
38
|
return /*#__PURE__*/React.createElement("div", {
|
@@ -174,6 +175,11 @@ var ActionButtons = function ActionButtons(_ref) {
|
|
174
175
|
}
|
175
176
|
}, [state, hasCartItems]);
|
176
177
|
|
178
|
+
// 手动折扣后订单总价
|
179
|
+
var currentTotalPriceAfterDiscount = useMemo(function () {
|
180
|
+
return new Decimal(currentTotalPrice).minus(state.shop_discount || 0).toNumber();
|
181
|
+
}, [state.shop_discount, currentTotalPrice]);
|
182
|
+
|
177
183
|
// 折扣券列表状态
|
178
184
|
var _useState9 = useState([]),
|
179
185
|
_useState10 = _slicedToArray(_useState9, 2),
|
@@ -264,6 +270,14 @@ var ActionButtons = function ActionButtons(_ref) {
|
|
264
270
|
shop_discount: '0'
|
265
271
|
}
|
266
272
|
});
|
273
|
+
|
274
|
+
// 清空部分支付
|
275
|
+
dispatch({
|
276
|
+
type: 'setPaymentPaid',
|
277
|
+
payload: {
|
278
|
+
value: {}
|
279
|
+
}
|
280
|
+
});
|
267
281
|
setShowClearModal(false);
|
268
282
|
Toast === null || Toast === void 0 || Toast.success(createToastContent(locales.getText('pisell2.action-buttons.clear-success')));
|
269
283
|
};
|
@@ -327,6 +341,14 @@ var ActionButtons = function ActionButtons(_ref) {
|
|
327
341
|
}
|
328
342
|
});
|
329
343
|
|
344
|
+
// 清空部分支付
|
345
|
+
dispatch({
|
346
|
+
type: 'setPaymentPaid',
|
347
|
+
payload: {
|
348
|
+
value: {}
|
349
|
+
}
|
350
|
+
});
|
351
|
+
|
330
352
|
// TODO: 如果需要重置更多信息,可以在这里添加
|
331
353
|
// 比如重置优惠券、表单数据、宠物信息等
|
332
354
|
|
@@ -359,28 +381,7 @@ var ActionButtons = function ActionButtons(_ref) {
|
|
359
381
|
}, [(_state$service8 = state.service) === null || _state$service8 === void 0 ? void 0 : _state$service8.value, (_state$addons4 = state.addons) === null || _state$addons4 === void 0 ? void 0 : _state$addons4.value]);
|
360
382
|
|
361
383
|
// 处理价格调整完成
|
362
|
-
var handlePriceAdjustConfirm = function handlePriceAdjustConfirm(
|
363
|
-
// 使用 getSumTotal 计算商品总金额
|
364
|
-
var _getSumTotal2 = getSumTotal(state, _objectSpread({
|
365
|
-
isEdit: true,
|
366
|
-
ScheduleModule: ScheduleModule
|
367
|
-
}, getDataFromHost())),
|
368
|
-
productAmount = _getSumTotal2.productAmount;
|
369
|
-
|
370
|
-
// 计算折扣金额(商品总金额 - 新价格)
|
371
|
-
// 存储正数:正数表示折扣,0表示无折扣
|
372
|
-
var discountAmount = Math.max(0, productAmount - newPrice);
|
373
|
-
|
374
|
-
// 转换为金额字符串格式(2位小数)
|
375
|
-
// const discountAmountStr = formatAmount(discountAmount, 2, '');
|
376
|
-
|
377
|
-
// console.log('=== 价格调整调试信息 ===');
|
378
|
-
// console.log('商品总金额 (productAmount):', productAmount);
|
379
|
-
// console.log('用户输入新价格 (newPrice):', newPrice);
|
380
|
-
// console.log('折扣金额 (discountAmount):', discountAmount);
|
381
|
-
// console.log('折扣金额字符串 (discountAmountStr):', discountAmountStr);
|
382
|
-
// console.log('当前 state.shop_discount:', state.shop_discount);
|
383
|
-
|
384
|
+
var handlePriceAdjustConfirm = function handlePriceAdjustConfirm(discountAmount) {
|
384
385
|
// 更新 shop_discount 到 state 根级别(存储为字符串)
|
385
386
|
dispatch({
|
386
387
|
type: 'setState',
|
@@ -388,9 +389,6 @@ var ActionButtons = function ActionButtons(_ref) {
|
|
388
389
|
shop_discount: discountAmount
|
389
390
|
}
|
390
391
|
});
|
391
|
-
|
392
|
-
// console.log('dispatch 已调用');
|
393
|
-
|
394
392
|
setShowPriceAdjustModal(false);
|
395
393
|
|
396
394
|
// 显示成功提示
|
@@ -515,22 +513,19 @@ var ActionButtons = function ActionButtons(_ref) {
|
|
515
513
|
},
|
516
514
|
onClearItemsOnly: handleClearItemsOnly,
|
517
515
|
onClearAllAndReset: handleClearAllAndReset
|
518
|
-
}),
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
}
|
526
|
-
}), /*#__PURE__*/React.createElement("div", {
|
527
|
-
className: "pisell-price-adjust-container"
|
528
|
-
}, /*#__PURE__*/React.createElement(PisellAdjustPrice, {
|
516
|
+
}), /*#__PURE__*/React.createElement(DiscountKeyboard, {
|
517
|
+
containerProps: {
|
518
|
+
renderType: 'modal',
|
519
|
+
open: showPriceAdjustModal,
|
520
|
+
onCancel: function onCancel() {
|
521
|
+
return setShowPriceAdjustModal(false);
|
522
|
+
}
|
523
|
+
},
|
529
524
|
selectType: "dark",
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
})
|
525
|
+
originalValue: currentTotalPrice,
|
526
|
+
defaultValue: currentTotalPriceAfterDiscount,
|
527
|
+
onEnter: handlePriceAdjustConfirm
|
528
|
+
}), /*#__PURE__*/React.createElement(CustomiseItemModal, {
|
534
529
|
visible: showCustomiseModal,
|
535
530
|
onClose: function onClose() {
|
536
531
|
return setShowCustomiseModal(false);
|
@@ -185,31 +185,3 @@
|
|
185
185
|
font-weight: 400 !important;
|
186
186
|
color: inherit !important;
|
187
187
|
}
|
188
|
-
|
189
|
-
// 价格调整覆盖层样式 - 现在通过 Portal 渲染到 document.body
|
190
|
-
.pisell-price-adjust-overlay {
|
191
|
-
position: fixed;
|
192
|
-
top: 0;
|
193
|
-
left: 0;
|
194
|
-
right: 0;
|
195
|
-
bottom: 0;
|
196
|
-
z-index: 9999; // 由于现在渲染到 document.body,使用更高的 z-index
|
197
|
-
display: flex;
|
198
|
-
align-items: center;
|
199
|
-
justify-content: center;
|
200
|
-
}
|
201
|
-
|
202
|
-
.pisell-price-adjust-backdrop {
|
203
|
-
position: absolute;
|
204
|
-
top: 0;
|
205
|
-
left: 0;
|
206
|
-
right: 0;
|
207
|
-
bottom: 0;
|
208
|
-
background: transparent; // 纯透明遮罩
|
209
|
-
cursor: pointer; // 显示点击手势
|
210
|
-
}
|
211
|
-
|
212
|
-
.pisell-price-adjust-container {
|
213
|
-
position: relative;
|
214
|
-
z-index: 10000; // 确保键盘在遮罩之上
|
215
|
-
}
|
@@ -23,12 +23,12 @@ export declare const getSumTotal: (state: any, options: {
|
|
23
23
|
surcharge: any;
|
24
24
|
otherAmount: any;
|
25
25
|
sumTotalAmount: number;
|
26
|
-
paidAmount:
|
26
|
+
paidAmount: any;
|
27
27
|
notPaidAmount: number;
|
28
28
|
paySurchargeFee: number;
|
29
29
|
expectAmount: number;
|
30
|
-
actualPaidAmount:
|
31
|
-
orderPaidAmount:
|
30
|
+
actualPaidAmount: any;
|
31
|
+
orderPaidAmount: any;
|
32
32
|
totalRefundAmount: number;
|
33
33
|
dueAmount: number;
|
34
34
|
roundingAmount: number;
|
@@ -12,22 +12,22 @@ import { formatAmount } from '@pisell/utils';
|
|
12
12
|
import Decimal from 'decimal.js';
|
13
13
|
import { isDayBooking, isDayBookingProduct, isNormalProductByDurationSchedule } from "../../info/service2/utils";
|
14
14
|
export var getRelationDetailsTotal = function getRelationDetailsTotal(relation_details) {
|
15
|
-
var total = 0;
|
15
|
+
var total = new Decimal(0);
|
16
16
|
var _iterator = _createForOfIteratorHelper(relation_details),
|
17
17
|
_step;
|
18
18
|
try {
|
19
19
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
20
20
|
var item = _step.value;
|
21
|
-
var number = item.product_quantity || item.num;
|
22
|
-
var price = item.selling_price || item.payment_price || item.price;
|
23
|
-
total
|
21
|
+
var number = new Decimal(item.product_quantity || item.num || 0);
|
22
|
+
var price = new Decimal(item.selling_price || item.payment_price || item.price || 0);
|
23
|
+
total = total.add(price.mul(number));
|
24
24
|
}
|
25
25
|
} catch (err) {
|
26
26
|
_iterator.e(err);
|
27
27
|
} finally {
|
28
28
|
_iterator.f();
|
29
29
|
}
|
30
|
-
return total;
|
30
|
+
return total.toNumber();
|
31
31
|
};
|
32
32
|
/**
|
33
33
|
* 总金额
|
@@ -35,8 +35,8 @@ export var getRelationDetailsTotal = function getRelationDetailsTotal(relation_d
|
|
35
35
|
* @returns
|
36
36
|
*/
|
37
37
|
var getProductExpectAmount = function getProductExpectAmount(state, isEdit) {
|
38
|
-
var price = 0;
|
39
|
-
var duration = 0;
|
38
|
+
var price = new Decimal(0);
|
39
|
+
var duration = new Decimal(0);
|
40
40
|
// 是否是跨日预约
|
41
41
|
var isDay = isDayBooking(state);
|
42
42
|
if (isEdit) {
|
@@ -52,19 +52,23 @@ var getProductExpectAmount = function getProductExpectAmount(state, isEdit) {
|
|
52
52
|
var item = _step2.value;
|
53
53
|
// 跨日预约
|
54
54
|
if (isDay || isNormalProductByDurationSchedule(item)) {
|
55
|
-
var quantity = item._extend.quantity || 1;
|
56
|
-
|
55
|
+
var quantity = new Decimal(item._extend.quantity || 1);
|
56
|
+
var itemTotal = new Decimal(item._extend.total || 0);
|
57
|
+
price = price.add(itemTotal.mul(quantity));
|
57
58
|
|
58
59
|
// 普通商品不能加到时长上
|
59
|
-
var _duration = isDayBookingProduct(item, state) ? item._extend.duration : 0;
|
60
|
-
duration
|
60
|
+
var _duration = isDayBookingProduct(item, state) ? new Decimal(item._extend.duration || 0) : new Decimal(0);
|
61
|
+
duration = duration.add(_duration);
|
61
62
|
} else {
|
62
|
-
var _quantity = item._extend.quantity || 1;
|
63
|
-
|
63
|
+
var _quantity = new Decimal(item._extend.quantity || 1);
|
64
|
+
var _itemTotal = new Decimal(item._extend.total || 0);
|
65
|
+
price = price.add(_itemTotal.mul(_quantity));
|
64
66
|
|
65
67
|
// 附加商品
|
66
|
-
|
67
|
-
|
68
|
+
var relationTotal = new Decimal(getRelationDetailsTotal(item._extend.relation_details || []));
|
69
|
+
price = price.add(relationTotal);
|
70
|
+
var itemDuration = new Decimal(flexibleObj.getValue(item._extend.duration) || 0);
|
71
|
+
duration = duration.add(itemDuration);
|
68
72
|
}
|
69
73
|
}
|
70
74
|
} catch (err) {
|
@@ -81,8 +85,9 @@ var getProductExpectAmount = function getProductExpectAmount(state, isEdit) {
|
|
81
85
|
try {
|
82
86
|
for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
|
83
87
|
var _item = _step3.value;
|
84
|
-
var _quantity2 = _item._extend.quantity || 1;
|
85
|
-
|
88
|
+
var _quantity2 = new Decimal(_item._extend.quantity || 1);
|
89
|
+
var _itemTotal2 = new Decimal(_item._extend.total || 0);
|
90
|
+
price = price.add(_itemTotal2.mul(_quantity2));
|
86
91
|
}
|
87
92
|
} catch (err) {
|
88
93
|
_iterator3.e(err);
|
@@ -93,24 +98,24 @@ var getProductExpectAmount = function getProductExpectAmount(state, isEdit) {
|
|
93
98
|
}
|
94
99
|
} else {
|
95
100
|
var _state$bookingDetail, _state$service2;
|
96
|
-
price =
|
101
|
+
price = new Decimal(((_state$bookingDetail = state.bookingDetail) === null || _state$bookingDetail === void 0 ? void 0 : _state$bookingDetail.product_expect_amount) || 0);
|
97
102
|
var services = (state === null || state === void 0 || (_state$service2 = state.service) === null || _state$service2 === void 0 ? void 0 : _state$service2.value) || [];
|
98
103
|
duration = services.reduce(function (pre, cur) {
|
99
|
-
var current = 0;
|
104
|
+
var current = new Decimal(0);
|
100
105
|
if (isDay) {
|
101
106
|
// 普通商品不能加到时长上
|
102
|
-
var _duration2 = isDayBookingProduct(cur, state) ? cur._extend.duration : 0;
|
103
|
-
current = _duration2
|
107
|
+
var _duration2 = isDayBookingProduct(cur, state) ? new Decimal(cur._extend.duration || 0) : new Decimal(0);
|
108
|
+
current = _duration2;
|
104
109
|
} else {
|
105
110
|
var _cur$_extend;
|
106
|
-
current = flexibleObj.getValue(((_cur$_extend = cur._extend) === null || _cur$_extend === void 0 ? void 0 : _cur$_extend.duration) || 0);
|
111
|
+
current = new Decimal(flexibleObj.getValue(((_cur$_extend = cur._extend) === null || _cur$_extend === void 0 ? void 0 : _cur$_extend.duration) || 0) || 0);
|
107
112
|
}
|
108
|
-
return pre
|
109
|
-
}, 0);
|
113
|
+
return pre.add(current);
|
114
|
+
}, new Decimal(0));
|
110
115
|
}
|
111
116
|
return {
|
112
|
-
productExpectAmount:
|
113
|
-
duration: getDiscountTime(duration, isDay)
|
117
|
+
productExpectAmount: price.toNumber(),
|
118
|
+
duration: getDiscountTime(duration.toNumber(), isDay)
|
114
119
|
};
|
115
120
|
};
|
116
121
|
var getProductItemTax = function getProductItemTax(item, state, options) {
|
@@ -337,7 +342,9 @@ var getPaySurchargeFee = function getPaySurchargeFee(state) {
|
|
337
342
|
|
338
343
|
// 新增为 0
|
339
344
|
if (!bookingDetail || !bookingId) return 0;
|
340
|
-
|
345
|
+
var processingFee = new Decimal(bookingDetail.pay_processing_fee || 0);
|
346
|
+
var gatewayFee = new Decimal(bookingDetail.gateway_fee || 0);
|
347
|
+
return processingFee.add(gatewayFee).toNumber();
|
341
348
|
};
|
342
349
|
|
343
350
|
/**
|
@@ -617,9 +624,15 @@ var getSurchargeAmount = function getSurchargeAmount(state, surcharge, options)
|
|
617
624
|
* @returns
|
618
625
|
*/
|
619
626
|
var getPaidAmount = function getPaidAmount(state) {
|
620
|
-
var _state$bookingDetail4;
|
627
|
+
var _state$paymentPaid, _state$bookingDetail4;
|
621
628
|
var bookingDetail = state.bookingDetail,
|
622
629
|
bookingId = state.bookingId;
|
630
|
+
|
631
|
+
// 检测是否有 checkout 编辑订单已付金额
|
632
|
+
if ((_state$paymentPaid = state.paymentPaid) !== null && _state$paymentPaid !== void 0 && (_state$paymentPaid = _state$paymentPaid.value) !== null && _state$paymentPaid !== void 0 && _state$paymentPaid.paidAmount) {
|
633
|
+
var _state$paymentPaid2;
|
634
|
+
return (_state$paymentPaid2 = state.paymentPaid) === null || _state$paymentPaid2 === void 0 || (_state$paymentPaid2 = _state$paymentPaid2.value) === null || _state$paymentPaid2 === void 0 ? void 0 : _state$paymentPaid2.paidAmount;
|
635
|
+
}
|
623
636
|
// 新增为 0
|
624
637
|
if (!bookingDetail || !bookingId) return 0;
|
625
638
|
return Number((_state$bookingDetail4 = state.bookingDetail) === null || _state$bookingDetail4 === void 0 ? void 0 : _state$bookingDetail4.paid_amount) || 0;
|
@@ -631,9 +644,14 @@ var getPaidAmount = function getPaidAmount(state) {
|
|
631
644
|
* @returns
|
632
645
|
*/
|
633
646
|
var getOrderPaidAmount = function getOrderPaidAmount(state) {
|
634
|
-
var _state$bookingDetail5;
|
647
|
+
var _state$paymentPaid3, _state$bookingDetail5;
|
635
648
|
var bookingDetail = state.bookingDetail,
|
636
649
|
bookingId = state.bookingId;
|
650
|
+
// 检测是否有 checkout 编辑订单已付金额
|
651
|
+
if ((_state$paymentPaid3 = state.paymentPaid) !== null && _state$paymentPaid3 !== void 0 && (_state$paymentPaid3 = _state$paymentPaid3.value) !== null && _state$paymentPaid3 !== void 0 && _state$paymentPaid3.paidAmountWithoutSurcharge) {
|
652
|
+
var _state$paymentPaid4;
|
653
|
+
return (_state$paymentPaid4 = state.paymentPaid) === null || _state$paymentPaid4 === void 0 || (_state$paymentPaid4 = _state$paymentPaid4.value) === null || _state$paymentPaid4 === void 0 ? void 0 : _state$paymentPaid4.paidAmountWithoutSurcharge;
|
654
|
+
}
|
637
655
|
// 新增为 0
|
638
656
|
if (!bookingDetail || !bookingId) return 0;
|
639
657
|
return Number((_state$bookingDetail5 = state.bookingDetail) === null || _state$bookingDetail5 === void 0 ? void 0 : _state$bookingDetail5.order_paid_amount) || 0;
|
@@ -751,13 +769,15 @@ export var getSumTotal = function getSumTotal(state, options) {
|
|
751
769
|
});
|
752
770
|
|
753
771
|
// 未支付的金额 负数代表着欠款
|
754
|
-
var
|
772
|
+
var sumTotalAmountDecimal = new Decimal(formatAmount(sumTotalAmount, 2, '') || 0);
|
773
|
+
var orderPaidAmountDecimal = new Decimal(orderPaidAmount || 0);
|
774
|
+
var notPaidAmount = sumTotalAmountDecimal.sub(orderPaidAmountDecimal).toNumber();
|
755
775
|
|
756
776
|
// 实付金额 已付金额
|
757
777
|
var actualPaidAmount = paidAmount;
|
758
778
|
|
759
779
|
// 欠款金额
|
760
|
-
var dueAmount = notPaidAmount < 0 ? Number(formatAmount(notPaidAmount
|
780
|
+
var dueAmount = notPaidAmount < 0 ? Number(formatAmount(new Decimal(notPaidAmount).add(new Decimal(totalRefundAmount)).toNumber(), 2, '')) : 0;
|
761
781
|
return {
|
762
782
|
productAmount: productExpectAmount,
|
763
783
|
duration: duration,
|