@pisell/private-materials 6.5.10 → 6.5.12
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 +2 -2
- package/build/lowcode/preview.js +148 -164
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +3 -3
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +7 -7
- package/es/components/Sales/Summary/utils.d.ts +1 -1
- package/es/components/appointmentBooking/components/Services/index.js +36 -18
- package/es/components/appointmentBooking/hooks.js +6 -0
- package/es/components/booking/components/footer/index.js +24 -5
- package/es/components/booking/editBookingModal/index.js +8 -2
- package/es/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
- package/es/components/booking/info/service2/utils.d.ts +1 -1
- package/es/components/booking/locales.d.ts +6 -0
- package/es/components/booking/locales.js +12 -0
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/checkout/PaymentModal.js +145 -101
- package/es/components/checkout/components/AmountSummary/index.js +6 -4
- package/es/components/checkout/components/CashPaymentModule/index.d.ts +3 -1
- package/es/components/checkout/components/CashPaymentModule/index.js +14 -10
- package/es/components/checkout/components/PaymentDetailModal/index.js +76 -27
- package/es/components/checkout/components/PaymentDetailModal/index.less +23 -2
- package/es/components/checkout/components/PaymentOptionsModule/index.js +4 -1
- package/es/components/checkout/hooks/useWalletPass.d.ts +1 -1
- package/es/components/checkout/hooks/useWalletPass.js +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/linkly/hooks/normal.js +3 -3
- package/es/components/eftposPay/linkly/hooks/useTimeQuery.js +60 -17
- package/es/components/eftposPay/payo/config.js +10 -10
- package/es/components/eftposPay/serve.js +1 -1
- package/es/components/eftposPay/store/index.d.ts +3 -3
- package/es/components/index.d.ts +3 -1
- package/es/components/index.js +3 -1
- package/es/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +6 -3
- package/es/components/pay/toC/PaymentMethods/WalletPass/List/index.d.ts +2 -0
- package/es/components/pay/toC/PaymentMethods/WalletPass/index.js +112 -24
- package/es/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +38 -2
- package/es/components/pay/toC/PaymentMethods/WalletPass/serve.js +78 -0
- package/es/components/pay/toC/PaymentMethods/WalletPass/utils.d.ts +6 -0
- package/es/components/pay/toC/PaymentMethods/WalletPass/utils.js +9 -0
- package/es/components/pay/toC/utils.js +1 -1
- package/es/components/pinModal/hooks.d.ts +7 -0
- package/es/components/pinModal/hooks.js +65 -0
- package/es/components/pinModal/index.d.ts +4 -0
- package/es/components/pinModal/index.js +98 -0
- package/es/components/pinModal/index.less +44 -0
- package/es/components/pinModal/locales.d.ts +27 -0
- package/es/components/pinModal/locales.js +26 -0
- package/es/components/pinModal/serve.d.ts +6 -0
- package/es/components/pinModal/serve.js +11 -0
- package/es/components/pinModal/types.d.ts +0 -0
- package/es/components/pinModal/types.js +0 -0
- package/es/components/pinVerifyModal/hooks.d.ts +7 -0
- package/es/components/pinVerifyModal/hooks.js +80 -0
- package/es/components/pinVerifyModal/index.d.ts +5 -0
- package/es/components/pinVerifyModal/index.js +218 -0
- package/es/components/pinVerifyModal/index.less +92 -0
- package/es/components/pinVerifyModal/locales.d.ts +24 -0
- package/es/components/pinVerifyModal/locales.js +23 -0
- package/es/components/pinVerifyModal/types.d.ts +33 -0
- package/es/components/pinVerifyModal/types.js +1 -0
- package/es/components/schedules/utils.d.ts +1 -1
- package/es/components/ticketBooking/components/ticketBooking/index.d.ts +7 -0
- package/es/components/ticketBooking/components/ticketBooking/index.js +56 -10
- package/es/components/ticketBooking/components/timeBar/index.js +2 -1
- package/es/components/ticketBooking/utils/index.d.ts +1 -1
- package/es/components/walletList/index.js +20 -2
- package/es/index.d.ts +2 -0
- package/es/index.js +3 -1
- package/es/utils/index.d.ts +1 -1
- package/lib/components/Sales/Summary/utils.d.ts +1 -1
- package/lib/components/appointmentBooking/components/Services/index.js +13 -3
- package/lib/components/appointmentBooking/hooks.js +6 -0
- package/lib/components/booking/components/footer/index.js +21 -3
- package/lib/components/booking/editBookingModal/index.js +6 -1
- package/lib/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
- package/lib/components/booking/info/service2/utils.d.ts +1 -1
- package/lib/components/booking/locales.d.ts +6 -0
- package/lib/components/booking/locales.js +6 -0
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/checkout/PaymentModal.js +37 -9
- package/lib/components/checkout/components/AmountSummary/index.js +4 -4
- package/lib/components/checkout/components/CashPaymentModule/index.d.ts +3 -1
- package/lib/components/checkout/components/CashPaymentModule/index.js +6 -3
- package/lib/components/checkout/components/PaymentDetailModal/index.js +47 -14
- package/lib/components/checkout/components/PaymentDetailModal/index.less +23 -2
- package/lib/components/checkout/components/PaymentOptionsModule/index.js +3 -1
- package/lib/components/checkout/hooks/useWalletPass.d.ts +1 -1
- package/lib/components/checkout/hooks/useWalletPass.js +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/linkly/hooks/normal.js +3 -3
- package/lib/components/eftposPay/linkly/hooks/useTimeQuery.js +59 -15
- package/lib/components/eftposPay/payo/config.js +9 -9
- package/lib/components/eftposPay/serve.js +1 -1
- package/lib/components/eftposPay/store/index.d.ts +3 -3
- package/lib/components/index.d.ts +3 -1
- package/lib/components/index.js +6 -0
- package/lib/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +2 -0
- package/lib/components/pay/toC/PaymentMethods/WalletPass/List/index.d.ts +2 -0
- package/lib/components/pay/toC/PaymentMethods/WalletPass/index.js +84 -36
- package/lib/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +38 -2
- package/lib/components/pay/toC/PaymentMethods/WalletPass/serve.js +18 -0
- package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.d.ts +6 -0
- package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.js +7 -2
- package/lib/components/pay/toC/utils.js +1 -1
- package/lib/components/pinModal/hooks.d.ts +7 -0
- package/lib/components/pinModal/hooks.js +85 -0
- package/lib/components/pinModal/index.d.ts +4 -0
- package/lib/components/pinModal/index.js +88 -0
- package/lib/components/pinModal/index.less +44 -0
- package/lib/components/pinModal/locales.d.ts +27 -0
- package/lib/components/pinModal/locales.js +50 -0
- package/lib/components/pinModal/serve.d.ts +6 -0
- package/lib/components/pinModal/serve.js +37 -0
- package/lib/components/pinModal/types.d.ts +0 -0
- package/lib/components/pinModal/types.js +0 -0
- package/lib/components/pinVerifyModal/hooks.d.ts +7 -0
- package/lib/components/pinVerifyModal/hooks.js +93 -0
- package/lib/components/pinVerifyModal/index.d.ts +5 -0
- package/lib/components/pinVerifyModal/index.js +230 -0
- package/lib/components/pinVerifyModal/index.less +92 -0
- package/lib/components/pinVerifyModal/locales.d.ts +24 -0
- package/lib/components/pinVerifyModal/locales.js +47 -0
- package/lib/components/pinVerifyModal/types.d.ts +33 -0
- package/lib/components/pinVerifyModal/types.js +17 -0
- package/lib/components/schedules/utils.d.ts +1 -1
- package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +7 -0
- package/lib/components/ticketBooking/components/ticketBooking/index.js +52 -5
- package/lib/components/ticketBooking/components/timeBar/index.js +2 -1
- package/lib/components/ticketBooking/utils/index.d.ts +1 -1
- package/lib/components/walletList/index.js +19 -2
- package/lib/index.d.ts +2 -0
- package/lib/index.js +6 -0
- package/lib/utils/index.d.ts +1 -1
- package/lowcode/pin-modal/meta.ts +37 -0
- package/lowcode/pin-verify-modal/meta.ts +80 -0
- package/package.json +1 -1
@@ -23,7 +23,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
23
23
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
24
24
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
25
25
|
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
26
|
-
import { locales } from '@pisell/utils';
|
26
|
+
import { locales, sendWarningLog } from '@pisell/utils';
|
27
27
|
import { message } from 'antd';
|
28
28
|
import { Iconfont, PisellModal, useToast } from '@pisell/materials';
|
29
29
|
import { getOrderInfoByCode, getBookingDetail, getEventBookingDetail, getBookingConfig, getServices } from "../../serve";
|
@@ -48,6 +48,7 @@ import { getBookingType } from "../bookingDataPanel/bookingList/utils";
|
|
48
48
|
import { useCustomer } from "../../hooks/pisellos";
|
49
49
|
import { useMemoizedFn } from 'ahooks';
|
50
50
|
import useScanManager from "../../hooks/pisellos/useScanManager";
|
51
|
+
import { useDebounceFn } from 'ahooks';
|
51
52
|
export var _formatBookingDetail = function _formatBookingDetail(data, modalState) {
|
52
53
|
var _bookings$list, _bookings$list2;
|
53
54
|
var customer_id = data.customer_id,
|
@@ -312,8 +313,54 @@ var TicketBooking = function TicketBooking(props) {
|
|
312
313
|
closeScan();
|
313
314
|
};
|
314
315
|
}, []);
|
316
|
+
var _useDebounceFn = useDebounceFn(function (type, orderId) {
|
317
|
+
// 支付成功后清空状态
|
318
|
+
try {
|
319
|
+
var _store$getState;
|
320
|
+
_initFn(function () {});
|
321
|
+
setState({
|
322
|
+
createCount: state.createCount + 1
|
323
|
+
});
|
324
|
+
sendWarningLog({
|
325
|
+
title: '清空购物车',
|
326
|
+
content: [{
|
327
|
+
key: '店铺id',
|
328
|
+
value: store === null || store === void 0 || (_store$getState = store.getState) === null || _store$getState === void 0 || (_store$getState = _store$getState.call(store)) === null || _store$getState === void 0 || (_store$getState = _store$getState.global) === null || _store$getState === void 0 || (_store$getState = _store$getState.globalConfig) === null || _store$getState === void 0 ? void 0 : _store$getState.id
|
329
|
+
}, {
|
330
|
+
key: '订单id',
|
331
|
+
value: orderId
|
332
|
+
}, {
|
333
|
+
key: '类型',
|
334
|
+
value: type
|
335
|
+
}]
|
336
|
+
});
|
337
|
+
} catch (err) {
|
338
|
+
var _store$getState2;
|
339
|
+
sendWarningLog({
|
340
|
+
title: '清空购物车失败',
|
341
|
+
content: [{
|
342
|
+
key: '店铺id',
|
343
|
+
value: store === null || store === void 0 || (_store$getState2 = store.getState) === null || _store$getState2 === void 0 || (_store$getState2 = _store$getState2.call(store)) === null || _store$getState2 === void 0 || (_store$getState2 = _store$getState2.global) === null || _store$getState2 === void 0 || (_store$getState2 = _store$getState2.globalConfig) === null || _store$getState2 === void 0 ? void 0 : _store$getState2.id
|
344
|
+
}, {
|
345
|
+
key: '订单id',
|
346
|
+
value: orderId
|
347
|
+
}, {
|
348
|
+
key: '类型',
|
349
|
+
value: type
|
350
|
+
}, {
|
351
|
+
key: 'error',
|
352
|
+
value: err === null || err === void 0 ? void 0 : err.message
|
353
|
+
}]
|
354
|
+
});
|
355
|
+
}
|
356
|
+
}, {
|
357
|
+
wait: 500,
|
358
|
+
leading: true,
|
359
|
+
trailing: false
|
360
|
+
}),
|
361
|
+
clearAllCart = _useDebounceFn.run;
|
315
362
|
useEffect(function () {
|
316
|
-
var _store$
|
363
|
+
var _store$getState3, _interaction$utils, _interaction$utils2;
|
317
364
|
// bellaswonderland.mypisell.com localStorage可能满了
|
318
365
|
localStorage.removeItem('bookingResourceList');
|
319
366
|
_persistentRef.current = storage.get("drawer-booking") === 'true' ? true : isTerminal();
|
@@ -374,7 +421,7 @@ var TicketBooking = function TicketBooking(props) {
|
|
374
421
|
};
|
375
422
|
} catch (error) {}
|
376
423
|
setState({
|
377
|
-
amountSymbol: (getData === null || getData === void 0 ? void 0 : getData('shop_symbol')) || (store === null || store === void 0 || (_store$
|
424
|
+
amountSymbol: (getData === null || getData === void 0 ? void 0 : getData('shop_symbol')) || (store === null || store === void 0 || (_store$getState3 = store.getState) === null || _store$getState3 === void 0 || (_store$getState3 = _store$getState3.call(store)) === null || _store$getState3 === void 0 || (_store$getState3 = _store$getState3.global) === null || _store$getState3 === void 0 ? void 0 : _store$getState3.symbol) || '$'
|
378
425
|
}, function () {
|
379
426
|
_initStateRef.current = JSON.parse(JSON.stringify(state));
|
380
427
|
_getBoardConfig();
|
@@ -388,6 +435,7 @@ var TicketBooking = function TicketBooking(props) {
|
|
388
435
|
console.log('bookingTicket.clearAllCart');
|
389
436
|
// 支付成功后清空状态
|
390
437
|
_initFn(function () {});
|
438
|
+
_setIntervalTime(true);
|
391
439
|
selectCustomer(null);
|
392
440
|
enableAllScanListeners();
|
393
441
|
setState({
|
@@ -633,8 +681,8 @@ var TicketBooking = function TicketBooking(props) {
|
|
633
681
|
}, 100);
|
634
682
|
};
|
635
683
|
var _setShopOpeningHours = function _setShopOpeningHours() {
|
636
|
-
var _getData, _store$
|
637
|
-
var time = (getData === null || getData === void 0 || (_getData = getData('operating_day_boundary')) === null || _getData === void 0 ? void 0 : _getData.time) || (store === null || store === void 0 || (_store$
|
684
|
+
var _getData, _store$getState4;
|
685
|
+
var time = (getData === null || getData === void 0 || (_getData = getData('operating_day_boundary')) === null || _getData === void 0 ? void 0 : _getData.time) || (store === null || store === void 0 || (_store$getState4 = store.getState) === null || _store$getState4 === void 0 || (_store$getState4 = _store$getState4.call(store)) === null || _store$getState4 === void 0 || (_store$getState4 = _store$getState4.global) === null || _store$getState4 === void 0 || (_store$getState4 = _store$getState4.shopDetail) === null || _store$getState4 === void 0 || (_store$getState4 = _store$getState4.operating_day_boundary) === null || _store$getState4 === void 0 ? void 0 : _store$getState4.time);
|
638
686
|
if (time) {
|
639
687
|
localStorage.setItem('shopOpeningHours', time);
|
640
688
|
}
|
@@ -653,11 +701,10 @@ var TicketBooking = function TicketBooking(props) {
|
|
653
701
|
});
|
654
702
|
case 2:
|
655
703
|
data = _context.sent;
|
656
|
-
console.log('wwww', data);
|
657
704
|
setState({
|
658
705
|
addTimeProducts: (data === null || data === void 0 ? void 0 : data.list) || []
|
659
706
|
});
|
660
|
-
case
|
707
|
+
case 4:
|
661
708
|
case "end":
|
662
709
|
return _context.stop();
|
663
710
|
}
|
@@ -822,9 +869,9 @@ var TicketBooking = function TicketBooking(props) {
|
|
822
869
|
// 储存参数, 添加服务商品时使用
|
823
870
|
sessionStorage.setItem('pisell2.booking.serviceParams', JSON.stringify(data));
|
824
871
|
} else {
|
825
|
-
var _store$
|
872
|
+
var _store$getState5;
|
826
873
|
// 当前时区的时间
|
827
|
-
var timezone = store === null || store === void 0 || (_store$
|
874
|
+
var timezone = store === null || store === void 0 || (_store$getState5 = store.getState) === null || _store$getState5 === void 0 || (_store$getState5 = _store$getState5.call(store)) === null || _store$getState5 === void 0 || (_store$getState5 = _store$getState5.global) === null || _store$getState5 === void 0 || (_store$getState5 = _store$getState5.globalConfig) === null || _store$getState5 === void 0 ? void 0 : _store$getState5.timezone;
|
828
875
|
initState.modalState.date.value = dayjs.tz(new Date(), timezone);
|
829
876
|
// 兜底, 没有传递则清空下
|
830
877
|
sessionStorage.removeItem('pisell2.booking.serviceParams');
|
@@ -1023,7 +1070,6 @@ var TicketBooking = function TicketBooking(props) {
|
|
1023
1070
|
isShowDeposit: state.isShowDeposit,
|
1024
1071
|
disableEventBookingEdit: state.disableEventBookingEdit,
|
1025
1072
|
list: state.list,
|
1026
|
-
intervalSetTime: state.intervalSetTime,
|
1027
1073
|
createCount: state.createCount,
|
1028
1074
|
bookingFunctions: state.bookingFunctions,
|
1029
1075
|
isParallelResourcesBooking: state.isParallelResourcesBooking
|
@@ -9,6 +9,7 @@ import { LeftOutlined, RightOutlined } from '@ant-design/icons';
|
|
9
9
|
import { DatePicker, SelectTime } from '@pisell/materials';
|
10
10
|
import { useMemoizedFn } from 'ahooks';
|
11
11
|
import { Button } from 'antd';
|
12
|
+
import dayjs from 'dayjs';
|
12
13
|
import classNames from 'classnames';
|
13
14
|
import { locales } from '@pisell/utils';
|
14
15
|
import "./index.less";
|
@@ -54,7 +55,7 @@ var TimeBar = function TimeBar(props) {
|
|
54
55
|
setGlobalState({
|
55
56
|
isTimeChange: true
|
56
57
|
});
|
57
|
-
(_props$setIntervalTim5 = props.setIntervalTime) === null || _props$setIntervalTim5 === void 0 || _props$setIntervalTim5.call(props,
|
58
|
+
(_props$setIntervalTim5 = props.setIntervalTime) === null || _props$setIntervalTim5 === void 0 || _props$setIntervalTim5.call(props, timeString === dayjs().format('HH:mm'));
|
58
59
|
});
|
59
60
|
return useMemo(function () {
|
60
61
|
var _state$modalState4, _state$modalState5;
|
@@ -41,7 +41,7 @@ declare type ScanData = {
|
|
41
41
|
};
|
42
42
|
};
|
43
43
|
export declare const formatScanCustomer: (data: ScanData) => {
|
44
|
-
searchType: "
|
44
|
+
searchType: "product" | "customer" | "wallet" | "walletPass" | "local_product";
|
45
45
|
data: any;
|
46
46
|
scanCode: string;
|
47
47
|
} | null;
|
@@ -30,6 +30,7 @@ import "./index.less";
|
|
30
30
|
import classNames from 'classnames';
|
31
31
|
// 导入所有类型
|
32
32
|
import { DEFAULT_CARD_CONFIG } from "./types";
|
33
|
+
import PinModal from "../pinModal";
|
33
34
|
|
34
35
|
// 添加 localStorage 相关的操作函数
|
35
36
|
var STORAGE_KEY = 'pisell_wallet_list_data';
|
@@ -174,6 +175,9 @@ var WalletList = Provider(function (props) {
|
|
174
175
|
var requestIdRef = useRef('');
|
175
176
|
var pubsub = utils === null || utils === void 0 ? void 0 : utils.pubsub;
|
176
177
|
|
178
|
+
// pinModal的ref
|
179
|
+
var pinModalRef = useRef(null);
|
180
|
+
|
177
181
|
//获取登录状态
|
178
182
|
var isUserLoggedIn = useMemo(function () {
|
179
183
|
var _utils$token, _utils$token$get;
|
@@ -584,6 +588,14 @@ var WalletList = Provider(function (props) {
|
|
584
588
|
return _ref3.apply(this, arguments);
|
585
589
|
};
|
586
590
|
}();
|
591
|
+
var _onViewPinClick = function onViewPinClick(card) {
|
592
|
+
if (card !== null && card !== void 0 && card.id) {
|
593
|
+
var _pinModalRef$current;
|
594
|
+
(_pinModalRef$current = pinModalRef.current) === null || _pinModalRef$current === void 0 || _pinModalRef$current.open(card === null || card === void 0 ? void 0 : card.id);
|
595
|
+
} else {
|
596
|
+
console.error('onViewPinClick方法需要传入wallet_detail_id');
|
597
|
+
}
|
598
|
+
};
|
587
599
|
var renderWalletCard = function renderWalletCard(item) {
|
588
600
|
var _dvaStore$core;
|
589
601
|
var code = item.code,
|
@@ -650,7 +662,11 @@ var WalletList = Provider(function (props) {
|
|
650
662
|
});
|
651
663
|
return /*#__PURE__*/React.createElement(WalletCard, _extends({
|
652
664
|
key: id
|
653
|
-
}, cardProps
|
665
|
+
}, cardProps, {
|
666
|
+
onViewPinClick: function onViewPinClick() {
|
667
|
+
return _onViewPinClick(item);
|
668
|
+
}
|
669
|
+
}));
|
654
670
|
};
|
655
671
|
var carouselProps = {
|
656
672
|
className: classNames('pisell-lowcode__walletList'),
|
@@ -809,7 +825,9 @@ var WalletList = Provider(function (props) {
|
|
809
825
|
fontSize: '24px',
|
810
826
|
color: currentIndex === list.length - 1 ? '#D0D5DD' : '#101828'
|
811
827
|
}
|
812
|
-
})))
|
828
|
+
}))), /*#__PURE__*/React.createElement(PinModal, {
|
829
|
+
ref: pinModalRef
|
830
|
+
}));
|
813
831
|
};
|
814
832
|
|
815
833
|
// 最终返回组件内容
|
package/es/index.d.ts
CHANGED
@@ -59,3 +59,5 @@ export { default as ProSkuDetailModal } from './pro/skuDetailModal';
|
|
59
59
|
export { default as SaasLogin } from './plus/saasLogin';
|
60
60
|
export { default as SaasRegister } from './plus/saasRegister';
|
61
61
|
export { default as SaasCreateOrganization } from './plus/saasCreateOrganization';
|
62
|
+
export { default as PinModal } from './components/pinModal';
|
63
|
+
export { default as PinVerifyModal } from './components/pinVerifyModal';
|
package/es/index.js
CHANGED
@@ -62,4 +62,6 @@ export { default as ProPriceRadio } from "./pro/pisellPriceRadio";
|
|
62
62
|
export { default as ProSkuDetailModal } from "./pro/skuDetailModal";
|
63
63
|
export { default as SaasLogin } from "./plus/saasLogin";
|
64
64
|
export { default as SaasRegister } from "./plus/saasRegister";
|
65
|
-
export { default as SaasCreateOrganization } from "./plus/saasCreateOrganization";
|
65
|
+
export { default as SaasCreateOrganization } from "./plus/saasCreateOrganization";
|
66
|
+
export { default as PinModal } from "./components/pinModal";
|
67
|
+
export { default as PinVerifyModal } from "./components/pinVerifyModal";
|
package/es/utils/index.d.ts
CHANGED
@@ -18,6 +18,6 @@ declare let modal: Omit<ModalStaticFunctions, 'warn'>;
|
|
18
18
|
export declare const setModal: (m: Omit<ModalStaticFunctions, 'warn'>) => void;
|
19
19
|
export declare const saveConfirm: () => Promise<{
|
20
20
|
destroy: () => void;
|
21
|
-
update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
|
21
|
+
update: (configUpdate: import("antd/es/modal/interface").ModalFuncProps | ((prevConfig: import("antd/es/modal/interface").ModalFuncProps) => import("antd/es/modal/interface").ModalFuncProps)) => void;
|
22
22
|
}>;
|
23
23
|
export { modal };
|
@@ -30,7 +30,7 @@ export declare const calculateSubtotal: (items: CartItem[]) => string;
|
|
30
30
|
* @return {*}
|
31
31
|
* @Author: xiangfeng.xue
|
32
32
|
*/
|
33
|
-
export declare const calculateTaxFee: (shopInfo: any, items: CartItem[]) =>
|
33
|
+
export declare const calculateTaxFee: (shopInfo: any, items: CartItem[]) => "0.00" | Decimal;
|
34
34
|
/**
|
35
35
|
* 计算所有价格明细
|
36
36
|
* @param items - 购物车商品数组
|
@@ -95,20 +95,27 @@ var Services = (0, import_react.forwardRef)((props, ref) => {
|
|
95
95
|
delete product.option;
|
96
96
|
if (isRetailTemplate) {
|
97
97
|
if (data == null ? void 0 : data.isCancel) return;
|
98
|
-
appointmentBooking.storeProduct(product);
|
98
|
+
const res = appointmentBooking.storeProduct(product);
|
99
|
+
if (!res.success && res.errorCode === "not_enough_stock") {
|
100
|
+
return (0, import_utils2.Toast)(import_utils.locales.getText("pisell2.appointment.unuse.stock"));
|
101
|
+
}
|
99
102
|
return;
|
100
103
|
}
|
101
104
|
const session = data == null ? void 0 : data.session;
|
102
105
|
if (session) {
|
103
106
|
const startDate = (0, import_dayjs.default)(session == null ? void 0 : session.start_at).format("YYYY-MM-DD");
|
104
107
|
const endDate = (0, import_dayjs.default)(session == null ? void 0 : session.end_at).format("YYYY-MM-DD");
|
105
|
-
appointmentBooking.addProductToCart({
|
108
|
+
const res = appointmentBooking.addProductToCart({
|
106
109
|
product: { ...product },
|
107
110
|
date: {
|
108
111
|
startTime: `${startDate} ${session == null ? void 0 : session.start_time}`,
|
109
112
|
endTime: `${endDate} ${session == null ? void 0 : session.end_time}`
|
110
113
|
}
|
111
114
|
});
|
115
|
+
if (!res.success && res.errorCode === "not_enough_stock") {
|
116
|
+
return (0, import_utils2.Toast)(import_utils.locales.getText("pisell2.appointment.unuse.stock"));
|
117
|
+
}
|
118
|
+
appointmentBooking.closeProductDetail();
|
112
119
|
await appointmentBooking.getAvailableDate({
|
113
120
|
startDate,
|
114
121
|
endDate
|
@@ -121,7 +128,10 @@ var Services = (0, import_react.forwardRef)((props, ref) => {
|
|
121
128
|
import_utils.locales.getText("pisell2.appointment.no.available.service")
|
122
129
|
);
|
123
130
|
}
|
124
|
-
appointmentBooking.storeProduct(product);
|
131
|
+
const res = appointmentBooking.storeProduct(product);
|
132
|
+
if (!res.success && res.errorCode === "not_enough_stock") {
|
133
|
+
return (0, import_utils2.Toast)(import_utils.locales.getText("pisell2.appointment.unuse.stock"));
|
134
|
+
}
|
125
135
|
if (type === "duration") {
|
126
136
|
await appointmentBooking.getAvailableDate();
|
127
137
|
}
|
@@ -189,6 +189,12 @@ var useAppointmentBookingStep = () => {
|
|
189
189
|
if (!result) {
|
190
190
|
return (0, import_utils2.Toast)(import_utils.locales.getText("pisell2.appointment.unuse.date"));
|
191
191
|
}
|
192
|
+
const capacityResult = appointmentBooking.checkMaxDurationCapacity();
|
193
|
+
if (!capacityResult.success) {
|
194
|
+
const getMessage = import_utils.locales.getText("pisell2.appointment.unuse.capacity");
|
195
|
+
const message = typeof getMessage === "function" ? getMessage(capacityResult.minAvailableCount) : getMessage;
|
196
|
+
return (0, import_utils2.Toast)(message);
|
197
|
+
}
|
192
198
|
}
|
193
199
|
if (!isRetailTemplate && (currentKey == null ? void 0 : currentKey.startsWith("select-resource"))) {
|
194
200
|
const { hasError, updatedCartList } = (0, import_utils2.checkAndMarkCartRenderError)(currentSelectedResources, appointmentBooking, utils);
|
@@ -463,7 +463,7 @@ var Footer = (props) => {
|
|
463
463
|
JSON.stringify(subTotalList),
|
464
464
|
(_l = (_k = state.client) == null ? void 0 : _k.value) == null ? void 0 : _l.id
|
465
465
|
]);
|
466
|
-
const
|
466
|
+
const handleCheckoutInternal = async () => {
|
467
467
|
(0, import_PaymentResultToast.closeAllPaymentResultToasts)();
|
468
468
|
const isNewOrder = !state.bookingId;
|
469
469
|
if (isEdit) {
|
@@ -524,6 +524,11 @@ var Footer = (props) => {
|
|
524
524
|
}
|
525
525
|
return goCheckout(state.bookingId, isNewOrder);
|
526
526
|
};
|
527
|
+
const { run: handleCheckout } = (0, import_ahooks.useDebounceFn)(handleCheckoutInternal, {
|
528
|
+
wait: 500,
|
529
|
+
leading: true,
|
530
|
+
trailing: false
|
531
|
+
});
|
527
532
|
const handleSaveAddons = async () => {
|
528
533
|
try {
|
529
534
|
let _list = [...state.addons.value];
|
@@ -588,7 +593,7 @@ var Footer = (props) => {
|
|
588
593
|
messageShow = true,
|
589
594
|
noSubmit = false
|
590
595
|
}) => {
|
591
|
-
var _a2;
|
596
|
+
var _a2, _b2, _c2, _d2, _e2;
|
592
597
|
(0, import_PaymentResultToast.closeAllPaymentResultToasts)();
|
593
598
|
if ((0, import_utils2.isDayBooking)(state)) {
|
594
599
|
const isHasDayProducts = handleDaySubmit();
|
@@ -647,7 +652,20 @@ var Footer = (props) => {
|
|
647
652
|
title: "saveBooking",
|
648
653
|
content: [
|
649
654
|
{ key: "下单前数据", value: JSON.stringify(values) },
|
650
|
-
{ key: "日期", value: (0, import_dayjs.default)().format("YYYY-MM-DD HH:mm") }
|
655
|
+
{ key: "日期", value: (0, import_dayjs.default)().format("YYYY-MM-DD HH:mm") },
|
656
|
+
{
|
657
|
+
key: "店铺id",
|
658
|
+
value: (_e2 = (_d2 = (_c2 = (_b2 = store == null ? void 0 : store.getState) == null ? void 0 : _b2.call(store)) == null ? void 0 : _c2.global) == null ? void 0 : _d2.globalConfig) == null ? void 0 : _e2.id
|
659
|
+
},
|
660
|
+
{
|
661
|
+
key: "shopApi",
|
662
|
+
value: JSON.stringify(window == null ? void 0 : window.shopApi, (key, value) => {
|
663
|
+
if (typeof value === "function") {
|
664
|
+
return "function";
|
665
|
+
}
|
666
|
+
return value;
|
667
|
+
})
|
668
|
+
}
|
651
669
|
]
|
652
670
|
});
|
653
671
|
if (addonsEdit) {
|
@@ -113,7 +113,12 @@ var EditBookingModal = (props, ref) => {
|
|
113
113
|
_cloned[_idx] = _targetResource;
|
114
114
|
}
|
115
115
|
} else {
|
116
|
-
_cloned.
|
116
|
+
const _targetIdx = _cloned.findIndex((rs) => {
|
117
|
+
return rs.relation_id == (_targetResource == null ? void 0 : _targetResource.relation_id);
|
118
|
+
});
|
119
|
+
if (_targetIdx === -1) {
|
120
|
+
_cloned.push(_targetResource);
|
121
|
+
}
|
117
122
|
}
|
118
123
|
_initResourceVal = {
|
119
124
|
..._initResourceVal,
|
@@ -4,6 +4,6 @@ declare const useSendModal: (bookingId?: number) => {
|
|
4
4
|
setOpen: import("react").Dispatch<import("react").SetStateAction<boolean>>;
|
5
5
|
handleOpen: () => void;
|
6
6
|
handleValuesChange: (val: any) => void;
|
7
|
-
handleOk: (values: SendModalValues) => Promise<
|
7
|
+
handleOk: (values: SendModalValues) => Promise<boolean | undefined>;
|
8
8
|
};
|
9
9
|
export default useSendModal;
|
@@ -248,4 +248,4 @@ export declare const updateAppointmentServicePrice: (state: any, { start_date, e
|
|
248
248
|
* @Author: WangHan
|
249
249
|
* @Date: 2024-12-24 11:32
|
250
250
|
*/
|
251
|
-
export declare const updateServicePrice: (state: any) => Promise<any
|
251
|
+
export declare const updateServicePrice: (state: any) => never[] | Promise<any>;
|
@@ -156,6 +156,8 @@ declare const _default: {
|
|
156
156
|
'pisell2.text.deposit-delete-message': string;
|
157
157
|
'pisell2.text.deposit-paid': string;
|
158
158
|
"pisell2.text.stock": string;
|
159
|
+
'pisell2.appointment.unuse.stock': string;
|
160
|
+
'pisell2.appointment.unuse.capacity': (count: number) => string;
|
159
161
|
'pisell2.text.payment-link': string;
|
160
162
|
'pisell2.text.send-mail': string;
|
161
163
|
'pisell2.text.copy-to-clipboard': string;
|
@@ -458,6 +460,8 @@ declare const _default: {
|
|
458
460
|
'pisell2.text.deposit-delete-message': string;
|
459
461
|
'pisell2.text.deposit-paid': string;
|
460
462
|
"pisell2.text.stock": string;
|
463
|
+
'pisell2.appointment.unuse.stock': string;
|
464
|
+
'pisell2.appointment.unuse.capacity': (count: number) => string;
|
461
465
|
'pisell2.text.payment-link': string;
|
462
466
|
'pisell2.text.send-mail': string;
|
463
467
|
'pisell2.text.copy-to-clipboard': string;
|
@@ -760,6 +764,8 @@ declare const _default: {
|
|
760
764
|
'pisell2.text.deposit-delete-message': string;
|
761
765
|
'pisell2.text.deposit-paid': string;
|
762
766
|
"pisell2.text.stock": string;
|
767
|
+
'pisell2.appointment.unuse.stock': string;
|
768
|
+
'pisell2.appointment.unuse.capacity': (count: number) => string;
|
763
769
|
'pisell2.text.payment-link': string;
|
764
770
|
'pisell2.text.send-mail': string;
|
765
771
|
'pisell2.text.copy-to-clipboard': string;
|
@@ -200,6 +200,8 @@ var locales_default = {
|
|
200
200
|
"pisell2.text.deposit-delete-message": "It cannot be restored after deletion. Please confirm the operation.",
|
201
201
|
"pisell2.text.deposit-paid": "Deposit paid",
|
202
202
|
"pisell2.text.stock": "Stock",
|
203
|
+
"pisell2.appointment.unuse.stock": "Not enough stock",
|
204
|
+
"pisell2.appointment.unuse.capacity": (count) => `Only ${count} spots available. Please reduce quantity.`,
|
203
205
|
"pisell2.text.payment-link": "Payment link",
|
204
206
|
"pisell2.text.send-mail": "Send email",
|
205
207
|
"pisell2.text.copy-to-clipboard": "Copy to clipboard",
|
@@ -540,6 +542,8 @@ var locales_default = {
|
|
540
542
|
"pisell2.text.deposit-delete-message": "删除后不可恢复,请确认操作",
|
541
543
|
"pisell2.text.deposit-paid": "已付定金",
|
542
544
|
"pisell2.text.stock": "库存",
|
545
|
+
"pisell2.appointment.unuse.stock": "库存不足",
|
546
|
+
"pisell2.appointment.unuse.capacity": (count) => `仅可预约 ${count} 个,请减少数量`,
|
543
547
|
"pisell2.text.payment-link": "付款链接",
|
544
548
|
"pisell2.text.send-mail": "发送邮件",
|
545
549
|
"pisell2.text.copy-to-clipboard": "复制到剪切板",
|
@@ -880,6 +884,8 @@ var locales_default = {
|
|
880
884
|
"pisell2.text.deposit-delete-message": "刪除後不可恢復,請確認操作",
|
881
885
|
"pisell2.text.deposit-paid": "已付定金",
|
882
886
|
"pisell2.text.stock": "庫存",
|
887
|
+
"pisell2.appointment.unuse.stock": "庫存不足",
|
888
|
+
"pisell2.appointment.unuse.capacity": (count) => `僅可預約 ${count} 個,請減少數量`,
|
883
889
|
"pisell2.text.payment-link": "付款鏈接",
|
884
890
|
"pisell2.text.send-mail": "發送郵件",
|
885
891
|
"pisell2.text.copy-to-clipboard": "複製到剪切板",
|
@@ -165,10 +165,10 @@ export declare const getProductTotalPrice: (item: any) => number;
|
|
165
165
|
export declare const getDuration: (duration: number | {
|
166
166
|
type: string;
|
167
167
|
value: number;
|
168
|
-
}) => number |
|
168
|
+
}) => number | {
|
169
169
|
type: string;
|
170
170
|
value: number;
|
171
|
-
};
|
171
|
+
} | "flexible";
|
172
172
|
export declare const isWalkIn: (customer_id?: number | string) => boolean;
|
173
173
|
export declare const getIsEdit: (state: any) => boolean;
|
174
174
|
export {};
|
@@ -109,6 +109,7 @@ var PaymentContent = (0, import_react.forwardRef)(
|
|
109
109
|
const savePayLaterHandlerRef = (0, import_react.useRef)(null);
|
110
110
|
const [customAmount, setCustomAmount] = (0, import_react.useState)("");
|
111
111
|
const [balanceDueAmount, setBalanceDueAmount] = (0, import_react.useState)("");
|
112
|
+
const [balanceDueTotalAmount, setBalanceDueTotalAmount] = (0, import_react.useState)("");
|
112
113
|
const [recommendAmounts, setRecommendAmounts] = (0, import_react.useState)([]);
|
113
114
|
const paymentMethodsRef = (0, import_react.useRef)(null);
|
114
115
|
const [paymentMethods, setPaymentMethods] = (0, import_react.useState)([]);
|
@@ -321,6 +322,7 @@ var PaymentContent = (0, import_react.forwardRef)(
|
|
321
322
|
if (currentAmount) {
|
322
323
|
setCustomAmount(currentAmount);
|
323
324
|
setBalanceDueAmount(currentAmount);
|
325
|
+
setBalanceDueTotalAmount(orderInfo.totalAmount || "0");
|
324
326
|
const currentNote = checkoutModule.getOrderNote();
|
325
327
|
if (currentNote) {
|
326
328
|
setOrderNote(currentNote);
|
@@ -409,6 +411,7 @@ var PaymentContent = (0, import_react.forwardRef)(
|
|
409
411
|
CheckoutHooks.OnBalanceDueAmountChanged,
|
410
412
|
(data) => {
|
411
413
|
setBalanceDueAmount(data.newAmount);
|
414
|
+
setBalanceDueTotalAmount(data.totalAmount || "0");
|
412
415
|
}
|
413
416
|
);
|
414
417
|
const orderSubmitStartUnsubscribe = core.effects.on(
|
@@ -453,17 +456,19 @@ var PaymentContent = (0, import_react.forwardRef)(
|
|
453
456
|
);
|
454
457
|
const paymentItems2 = await checkoutModule.getCurrentOrderPaymentItemsAsync();
|
455
458
|
let totalAmount2 = new import_decimal.default(orderInfo2.isDeposit ? orderInfo2.depositAmount : orderInfo2.totalAmount);
|
456
|
-
if (paymentItems2.length > 0 && paymentItems2.filter((n) => n.isSynced).some((item) => item.service_charge)) {
|
459
|
+
if (paymentItems2.length > 0 && paymentItems2.filter((n) => n.isSynced).some((item) => item.service_charge || item.rounding_amount)) {
|
457
460
|
const serviceChargeTotal = paymentItems2.reduce((acc, item) => {
|
458
461
|
var _a3, _b3;
|
459
462
|
const chargeAmount = new import_decimal.default(((_a3 = item.service_charge) == null ? void 0 : _a3.amount) || 0);
|
460
463
|
const chargePercentage = new import_decimal.default(((_b3 = item.service_charge) == null ? void 0 : _b3.percentage) || 0);
|
461
464
|
const itemAmount = new import_decimal.default(item.amount || 0);
|
462
|
-
|
465
|
+
let itemServiceCharge = chargeAmount.add(chargePercentage.mul(itemAmount));
|
466
|
+
console.log(itemServiceCharge);
|
463
467
|
return acc.add(itemServiceCharge);
|
464
468
|
}, new import_decimal.default(0));
|
465
469
|
totalAmount2 = totalAmount2.add(serviceChargeTotal);
|
466
470
|
}
|
471
|
+
console.log(totalAmount2, paymentItems2);
|
467
472
|
await (0, import_PaymentResultToastUtils.displayPaymentResultToast)(
|
468
473
|
{
|
469
474
|
paymentStatus: "partially_paid",
|
@@ -565,6 +570,9 @@ var PaymentContent = (0, import_react.forwardRef)(
|
|
565
570
|
const result = await checkoutModule.manualSyncOrderAsync();
|
566
571
|
await (showSuccessToast == null ? void 0 : showSuccessToast(result));
|
567
572
|
if (result.success) {
|
573
|
+
checkoutModule.core.effects.emit("checkout:onPaymentStarted", {
|
574
|
+
paymentMethodCode: ""
|
575
|
+
});
|
568
576
|
const orderInfo2 = checkoutModule.getCurrentOrderInfo();
|
569
577
|
setCurrentEditOrderId == null ? void 0 : setCurrentEditOrderId(result.orderId);
|
570
578
|
if (result.is_deposit && Number(orderInfo2.depositAmount) < Number(orderInfo2.totalAmount)) {
|
@@ -934,7 +942,8 @@ var PaymentContent = (0, import_react.forwardRef)(
|
|
934
942
|
amountButtons: recommendAmounts,
|
935
943
|
customAmount,
|
936
944
|
roundingFunction,
|
937
|
-
balanceDueAmount
|
945
|
+
balanceDueAmount,
|
946
|
+
balanceDueTotalAmount
|
938
947
|
}
|
939
948
|
)
|
940
949
|
),
|
@@ -1047,7 +1056,7 @@ var PaymentModal = ({
|
|
1047
1056
|
import_locales2.default,
|
1048
1057
|
((_e = (_d = (_c = (_b = (_a = context.appHelper.utils) == null ? void 0 : _a.getApp) == null ? void 0 : _b.call(_a)) == null ? void 0 : _c.locales) == null ? void 0 : _d.getLocale) == null ? void 0 : _e.call(_d)) || ((_g = (_f = context.appHelper.utils) == null ? void 0 : _f.storage) == null ? void 0 : _g.get("umi_locale")) || "en"
|
1049
1058
|
);
|
1050
|
-
const { pisellos, getData, interaction } = ((_h = context == null ? void 0 : context.appHelper) == null ? void 0 : _h.utils) || {};
|
1059
|
+
const { pisellos, getData, interaction, isWebPos } = ((_h = context == null ? void 0 : context.appHelper) == null ? void 0 : _h.utils) || {};
|
1051
1060
|
const [orderInfo, setOrderInfo] = (0, import_react.useState)(null);
|
1052
1061
|
const [totalAmount, setTotalAmount] = (0, import_react.useState)(0);
|
1053
1062
|
const [actualShowCashPayment, setActualShowCashPayment] = (0, import_react.useState)(true);
|
@@ -1426,6 +1435,13 @@ var PaymentModal = ({
|
|
1426
1435
|
totalInfo: newData.subtotal_info
|
1427
1436
|
});
|
1428
1437
|
} else {
|
1438
|
+
logger == null ? void 0 : logger.addLog({
|
1439
|
+
type: "info",
|
1440
|
+
title: "正常创建 createLocalOrderAsync",
|
1441
|
+
metadata: {
|
1442
|
+
data
|
1443
|
+
}
|
1444
|
+
});
|
1429
1445
|
await checkout.createLocalOrderAsync({
|
1430
1446
|
orderData: newData.order_info,
|
1431
1447
|
cartSummary: (_b2 = newData.subtotal_info) == null ? void 0 : _b2.subTotalList,
|
@@ -1520,10 +1536,15 @@ var PaymentModal = ({
|
|
1520
1536
|
paymentStatus,
|
1521
1537
|
!!currentChangeGivenAmount
|
1522
1538
|
);
|
1523
|
-
|
1524
|
-
|
1525
|
-
|
1526
|
-
}
|
1539
|
+
let enabledAutoPrint = false;
|
1540
|
+
if (isWebPos) {
|
1541
|
+
enabledAutoPrint = false;
|
1542
|
+
} else {
|
1543
|
+
enabledAutoPrint = await ((_e2 = (_d3 = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _d3.asyncDataManager) == null ? void 0 : _e2.call(_d3, {
|
1544
|
+
module: "get",
|
1545
|
+
key: "auto_print_receipt"
|
1546
|
+
}));
|
1547
|
+
}
|
1527
1548
|
const orderInfo3 = checkout.getCurrentOrderInfo();
|
1528
1549
|
await (0, import_PaymentResultToastUtils.displayPaymentResultToast)(
|
1529
1550
|
{
|
@@ -1569,6 +1590,13 @@ var PaymentModal = ({
|
|
1569
1590
|
totalInfo: data == null ? void 0 : data.subtotal_info
|
1570
1591
|
});
|
1571
1592
|
} else {
|
1593
|
+
logger == null ? void 0 : logger.addLog({
|
1594
|
+
type: "info",
|
1595
|
+
title: "含有 localOrderCreate, 调用 createLocalOrderAsync",
|
1596
|
+
metadata: {
|
1597
|
+
data
|
1598
|
+
}
|
1599
|
+
});
|
1572
1600
|
await checkout.createLocalOrderAsync({
|
1573
1601
|
orderData: data == null ? void 0 : data.order_info,
|
1574
1602
|
cartSummary: (_d2 = data == null ? void 0 : data.subtotal_info) == null ? void 0 : _d2.subTotalList,
|
@@ -1623,7 +1651,7 @@ var PaymentModal = ({
|
|
1623
1651
|
setTimeout(() => {
|
1624
1652
|
(0, import_PaymentResultToast.closePaymentResultToast)();
|
1625
1653
|
}, 0);
|
1626
|
-
const { isTerminal, isWebPos } = (_a2 = context.appHelper) == null ? void 0 : _a2.utils;
|
1654
|
+
const { isTerminal, isWebPos: isWebPos2 } = (_a2 = context.appHelper) == null ? void 0 : _a2.utils;
|
1627
1655
|
if (isTerminal == null ? void 0 : isTerminal()) {
|
1628
1656
|
const checkout = pisellos.getModule("checkout");
|
1629
1657
|
const orderId = await checkout.getCurrentOrderId();
|
@@ -365,8 +365,8 @@ function AmountSummary({
|
|
365
365
|
let balanceAmountValue = parseFormattedAmount(getBalanceDueAmount());
|
366
366
|
let balanceDecimal = new import_decimal.default(balanceAmountValue);
|
367
367
|
const syncedVoucherAmount = paymentItems == null ? void 0 : paymentItems.reduce((acc, item) => {
|
368
|
-
if (item.
|
369
|
-
return acc.plus(item.amount).plus(item.rounding_amount);
|
368
|
+
if (item.isSynced && (paymentType === "regular" && item.order_payment_type !== "deposit" || paymentType === "deposit" && item.order_payment_type === "deposit")) {
|
369
|
+
return acc.plus(item.amount).plus(Number(item.rounding_amount) > 0 ? 0 : item.rounding_amount || 0);
|
370
370
|
}
|
371
371
|
return acc;
|
372
372
|
}, new import_decimal.default(0)).toNumber();
|
@@ -447,7 +447,7 @@ function AmountSummary({
|
|
447
447
|
if (paymentType === "regular") {
|
448
448
|
const depositPaidAmount = paymentItems == null ? void 0 : paymentItems.reduce((acc, item) => {
|
449
449
|
if (item.order_payment_type === "deposit") {
|
450
|
-
return acc.plus(item.amount).plus(
|
450
|
+
return acc.plus(item.amount).plus(Number(item.rounding_amount) > 0 ? 0 : item.rounding_amount || 0);
|
451
451
|
}
|
452
452
|
return acc;
|
453
453
|
}, new import_decimal.default(0)).toNumber();
|
@@ -456,7 +456,7 @@ function AmountSummary({
|
|
456
456
|
} else {
|
457
457
|
const depositPaidAmount = paymentItems == null ? void 0 : paymentItems.reduce((acc, item) => {
|
458
458
|
if (item.order_payment_type === "deposit") {
|
459
|
-
return acc.plus(item.amount);
|
459
|
+
return acc.plus(item.amount).plus(Number(item.rounding_amount) > 0 ? 0 : item.rounding_amount || 0);
|
460
460
|
}
|
461
461
|
return acc;
|
462
462
|
}, new import_decimal.default(0)).toNumber();
|
@@ -13,10 +13,12 @@ export interface CashPaymentModuleProps {
|
|
13
13
|
roundingDifference: number;
|
14
14
|
}>;
|
15
15
|
balanceDueAmount?: string;
|
16
|
+
balanceDueTotalAmount?: string;
|
16
17
|
syncingLock?: boolean;
|
17
18
|
}
|
18
19
|
export declare function CashPaymentModule({ amountSymbol, orderInfo, onPaymentComplete, customAmount, amountButtons, // 按钮列表,默认5个推荐金额
|
19
20
|
disabled, // 禁用状态
|
20
|
-
roundingFunction, balanceDueAmount, //
|
21
|
+
roundingFunction, balanceDueAmount, // 当前阶段剩余支付金额(定金或普通支付)
|
22
|
+
balanceDueTotalAmount, // 完整订单剩余待付金额
|
21
23
|
syncingLock, }: CashPaymentModuleProps): JSX.Element;
|
22
24
|
export default CashPaymentModule;
|