@pisell/private-materials 6.4.81 → 6.4.83
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 +164 -150
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +11 -11
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +11 -11
- package/es/components/appointmentBooking/components/Footer/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +0 -1
- package/es/components/booking/addons/model.d.ts +1 -10
- package/es/components/booking/components/TabProduct/index.d.ts +0 -1
- package/es/components/booking/components/footer/index.js +15 -3
- package/es/components/booking/components/footer/utils.js +55 -37
- package/es/components/booking/components/formItemChildrenWrap/index.d.ts +0 -1
- package/es/components/booking/forms/model.d.ts +1 -10
- package/es/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
- package/es/components/booking/forms/table/index.d.ts +0 -1
- package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
- package/es/components/booking/info/dateRange/index.d.ts +0 -1
- package/es/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
- package/es/components/booking/info/model.d.ts +1 -10
- package/es/components/booking/info/service/like/index.d.ts +0 -1
- package/es/components/booking/materiels/holder/index.d.ts +0 -1
- 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/checkout/PaymentModal.d.ts +13 -5
- package/es/components/checkout/PaymentModal.js +93 -149
- package/es/components/checkout/components/PaymentDetailModal/index.js +2 -2
- package/es/components/checkout/components/SearchAndClientModule/index.js +39 -40
- package/es/components/checkout/hooks/useWalletPass.d.ts +1 -1
- package/es/components/checkout/plugin.d.ts +2 -0
- package/es/components/checkout/plugin.js +303 -0
- package/es/components/checkout/utils/PaymentResultToastUtils.d.ts +0 -1
- package/es/components/eftpos/deviceList/index.d.ts +0 -1
- package/es/components/eftpos/form/index.d.ts +0 -1
- package/es/components/eftpos/group/index.d.ts +0 -1
- package/es/components/eftpos/hooks.d.ts +0 -1
- package/es/components/eftpos/icon/apiKey.d.ts +0 -1
- package/es/components/eftpos/icon/device.d.ts +0 -1
- package/es/components/eftpos/receipt/index.d.ts +0 -1
- package/es/components/eftposPay/component/alert/warn.d.ts +0 -1
- package/es/components/eftposPay/component/header/titlebar.d.ts +0 -1
- package/es/components/eftposPay/component/step/index.d.ts +0 -1
- package/es/components/eftposPay/component/step/step.d.ts +0 -1
- package/es/components/eftposPay/store/index.d.ts +2 -2
- package/es/components/eftposPay/tyro/hooks.d.ts +0 -1
- package/es/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
- package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
- package/es/components/pay/toC/model.d.ts +1 -9
- package/es/components/productExtension/fields/Actor/index.d.ts +0 -1
- package/es/components/productExtension/fields/Forms/index.d.ts +0 -1
- package/es/components/schedules/calendar/calendarItem.d.ts +0 -1
- package/es/components/schedules/components/CurrentDay/index.d.ts +0 -1
- package/es/components/schedules/model.d.ts +1 -9
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +0 -1
- package/es/components/schedules/products/index.d.ts +0 -1
- package/es/components/schedules/resources/relationProduct/index.d.ts +0 -1
- package/es/components/shoppingCart/components/Empty/index.d.ts +0 -1
- package/es/components/shoppingCart/components/Render/index.d.ts +0 -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/components/workSpaceList/components/Modal/index.d.ts +0 -1
- package/es/index.d.ts +1 -0
- package/es/index.js +2 -1
- package/es/plus/clientName/index.d.ts +0 -1
- package/es/pro/pisellPaymentList/example.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Footer/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +0 -1
- package/lib/components/booking/addons/model.d.ts +1 -10
- package/lib/components/booking/components/TabProduct/index.d.ts +0 -1
- package/lib/components/booking/components/footer/index.js +15 -3
- package/lib/components/booking/components/footer/utils.js +18 -1
- package/lib/components/booking/components/formItemChildrenWrap/index.d.ts +0 -1
- package/lib/components/booking/forms/model.d.ts +1 -10
- package/lib/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
- package/lib/components/booking/forms/table/index.d.ts +0 -1
- package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
- package/lib/components/booking/info/dateRange/index.d.ts +0 -1
- package/lib/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
- package/lib/components/booking/info/model.d.ts +1 -10
- package/lib/components/booking/info/service/like/index.d.ts +0 -1
- package/lib/components/booking/materiels/holder/index.d.ts +0 -1
- 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/checkout/PaymentModal.d.ts +13 -5
- package/lib/components/checkout/PaymentModal.js +92 -139
- package/lib/components/checkout/components/PaymentDetailModal/index.js +2 -2
- package/lib/components/checkout/components/SearchAndClientModule/index.js +29 -3
- package/lib/components/checkout/hooks/useWalletPass.d.ts +1 -1
- package/lib/components/checkout/plugin.d.ts +2 -0
- package/lib/components/checkout/plugin.js +263 -0
- package/lib/components/checkout/utils/PaymentResultToastUtils.d.ts +0 -1
- package/lib/components/eftpos/deviceList/index.d.ts +0 -1
- package/lib/components/eftpos/form/index.d.ts +0 -1
- package/lib/components/eftpos/group/index.d.ts +0 -1
- package/lib/components/eftpos/hooks.d.ts +0 -1
- package/lib/components/eftpos/icon/apiKey.d.ts +0 -1
- package/lib/components/eftpos/icon/device.d.ts +0 -1
- package/lib/components/eftpos/receipt/index.d.ts +0 -1
- package/lib/components/eftposPay/component/alert/warn.d.ts +0 -1
- package/lib/components/eftposPay/component/header/titlebar.d.ts +0 -1
- package/lib/components/eftposPay/component/step/index.d.ts +0 -1
- package/lib/components/eftposPay/component/step/step.d.ts +0 -1
- package/lib/components/eftposPay/store/index.d.ts +2 -2
- package/lib/components/eftposPay/tyro/hooks.d.ts +0 -1
- package/lib/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
- package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
- package/lib/components/pay/toC/model.d.ts +1 -9
- package/lib/components/productExtension/fields/Actor/index.d.ts +0 -1
- package/lib/components/productExtension/fields/Forms/index.d.ts +0 -1
- package/lib/components/schedules/calendar/calendarItem.d.ts +0 -1
- package/lib/components/schedules/components/CurrentDay/index.d.ts +0 -1
- package/lib/components/schedules/model.d.ts +1 -9
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +0 -1
- package/lib/components/schedules/products/index.d.ts +0 -1
- package/lib/components/schedules/resources/relationProduct/index.d.ts +0 -1
- package/lib/components/shoppingCart/components/Empty/index.d.ts +0 -1
- package/lib/components/shoppingCart/components/Render/index.d.ts +0 -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/components/workSpaceList/components/Modal/index.d.ts +0 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -0
- package/lib/plus/clientName/index.d.ts +0 -1
- package/lib/pro/pisellPaymentList/example.d.ts +0 -1
- package/lowcode/payment-modal/meta.ts +135 -0
- package/package.json +3 -3
- package/es/components/checkout/PaymentPlugin.d.ts +0 -2
- package/es/components/checkout/PaymentPlugin.js +0 -199
- package/lib/components/checkout/PaymentPlugin.d.ts +0 -2
- package/lib/components/checkout/PaymentPlugin.js +0 -181
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
2
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
4
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
5
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -33,7 +32,6 @@ import WalletPassModule from "./components/WalletPassModule";
|
|
|
33
32
|
import PaymentOptionsModule, { SHOW_METHODS_CODE } from "./components/PaymentOptionsModule";
|
|
34
33
|
import CashPaymentModule from "./components/CashPaymentModule";
|
|
35
34
|
import AdditionalModule from "./components/AdditionalModule";
|
|
36
|
-
import { getSumTotal } from "../booking/components/footer/amount";
|
|
37
35
|
import { closePaymentResultToast, closeAllPaymentResultToasts, setTillButton } from "./components/PaymentResultToast";
|
|
38
36
|
import { formatCurrency, calculateStatusClassName, calculateAutoCloseConfig, displayPaymentResultToast, createShowSuccessToast } from "./utils/PaymentResultToastUtils";
|
|
39
37
|
import { Printer, FileCheck02, RefreshCw05, CreditCard02, MessageTextSquare02, ArrowLeft, DotsVertical } from '@pisell/icon';
|
|
@@ -65,15 +63,13 @@ var CheckoutHooks = {
|
|
|
65
63
|
|
|
66
64
|
// 支付弹窗主体内容组件
|
|
67
65
|
var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
68
|
-
var _parentModuleConfig$s
|
|
66
|
+
var _parentModuleConfig$s;
|
|
69
67
|
var cartData = _ref.cartData,
|
|
70
68
|
orderInfo = _ref.orderInfo,
|
|
71
69
|
isModalOpen = _ref.isModalOpen,
|
|
72
70
|
onPaymentComplete = _ref.onPaymentComplete,
|
|
73
71
|
onPaymentCancel = _ref.onPaymentCancel,
|
|
74
72
|
onStatusChange = _ref.onStatusChange,
|
|
75
|
-
dispatch = _ref.dispatch,
|
|
76
|
-
state = _ref.state,
|
|
77
73
|
showingCashToastRef = _ref.showingCashToastRef,
|
|
78
74
|
onToastClose = _ref.onToastClose,
|
|
79
75
|
orderNote = _ref.orderNote,
|
|
@@ -91,7 +87,16 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
91
87
|
generateActionButtons = _ref.generateActionButtons,
|
|
92
88
|
paymentResultToastConfig = _ref.paymentResultToastConfig,
|
|
93
89
|
updateOrderInfo = _ref.updateOrderInfo,
|
|
94
|
-
setCurrentEditOrderId = _ref.setCurrentEditOrderId
|
|
90
|
+
setCurrentEditOrderId = _ref.setCurrentEditOrderId,
|
|
91
|
+
config = _ref.config,
|
|
92
|
+
paymentResultDisplayMode = _ref.paymentResultDisplayMode,
|
|
93
|
+
shopDiscount = _ref.shopDiscount,
|
|
94
|
+
client = _ref.client,
|
|
95
|
+
currentTotalPrice = _ref.currentTotalPrice,
|
|
96
|
+
onChangeShopDiscount = _ref.onChangeShopDiscount,
|
|
97
|
+
onChangeOrderNote = _ref.onChangeOrderNote,
|
|
98
|
+
onDeleteOrderNote = _ref.onDeleteOrderNote,
|
|
99
|
+
any = _ref.config;
|
|
95
100
|
var context = useEngineContext();
|
|
96
101
|
var utils = context.appHelper.utils || {};
|
|
97
102
|
var pisellos = utils.pisellos,
|
|
@@ -229,7 +234,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
229
234
|
/** 支付类型,跟支付列表上对应的支付方式保持一致 */
|
|
230
235
|
code: cashPaymentMethod === null || cashPaymentMethod === void 0 ? void 0 : cashPaymentMethod.code,
|
|
231
236
|
/** 支付类型id,跟支付列表上对应的支付方式保持一致 */
|
|
232
|
-
|
|
237
|
+
custom_payment_id: cashPaymentMethod === null || cashPaymentMethod === void 0 ? void 0 : cashPaymentMethod.id,
|
|
233
238
|
/** 支付类型名称,跟支付列表上对应的支付方式保持一致 */
|
|
234
239
|
name: cashPaymentMethod === null || cashPaymentMethod === void 0 ? void 0 : cashPaymentMethod.name,
|
|
235
240
|
/** 支付类型type,跟支付列表上对应的支付方式保持一致 */
|
|
@@ -341,7 +346,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
341
346
|
// 支付金额
|
|
342
347
|
code: code,
|
|
343
348
|
// 支付类型code
|
|
344
|
-
|
|
349
|
+
custom_payment_id: id,
|
|
345
350
|
// 支付类型id
|
|
346
351
|
name: name,
|
|
347
352
|
// 支付类型name
|
|
@@ -409,7 +414,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
409
414
|
/** 支付类型,跟支付列表上对应的支付方式保持一致 */
|
|
410
415
|
code: method.code,
|
|
411
416
|
/** 支付类型id,跟支付列表上对应的支付方式保持一致 */
|
|
412
|
-
|
|
417
|
+
custom_payment_id: method.id,
|
|
413
418
|
/** 支付类型名称,跟支付列表上对应的支付方式保持一致 */
|
|
414
419
|
name: method.name,
|
|
415
420
|
/** 支付类型type,跟支付列表上对应的支付方式保持一致 */
|
|
@@ -576,7 +581,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
576
581
|
// );
|
|
577
582
|
var orderPaymentAddedUnsubscribe = core.effects.on(CheckoutHooks.OnOrderPaymentAdded, executeIfActive( /*#__PURE__*/function () {
|
|
578
583
|
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(data) {
|
|
579
|
-
var orderInfo, balanceDueAmount,
|
|
584
|
+
var orderInfo, balanceDueAmount, autoCloseConfig, _paymentItems, _totalAmount, serviceChargeTotal, isToastMode, paymentMethodName, isCashPayment, _interaction$utils3, _interaction$utils3$p;
|
|
580
585
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
581
586
|
while (1) switch (_context5.prev = _context5.next) {
|
|
582
587
|
case 0:
|
|
@@ -617,7 +622,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
617
622
|
}
|
|
618
623
|
console.log(_totalAmount, _paymentItems);
|
|
619
624
|
// 弹窗模式判断
|
|
620
|
-
isToastMode =
|
|
625
|
+
isToastMode = paymentResultDisplayMode !== 'modal';
|
|
621
626
|
if (!isToastMode) {
|
|
622
627
|
autoCloseConfig.autoClose = false;
|
|
623
628
|
autoCloseConfig.autoCloseDelay = 0;
|
|
@@ -910,64 +915,11 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
910
915
|
return walletPassRef.current.handleSearchIdentificationCode(keyword);
|
|
911
916
|
}
|
|
912
917
|
}, []);
|
|
913
|
-
var getDataFromHost = function getDataFromHost() {
|
|
914
|
-
try {
|
|
915
|
-
var is_price_include_tax = getData('is_price_include_tax');
|
|
916
|
-
var tax_rate = getData('tax_rate') || '10';
|
|
917
|
-
var tax_title = getData('tax_title') || 'GST';
|
|
918
|
-
var surcharge_list = getData('surcharge_list');
|
|
919
|
-
var schedule_list = getData('schedule_list');
|
|
920
|
-
var scheduleById = {};
|
|
921
|
-
// 提前转换,节省附加费计算时的遍历时间
|
|
922
|
-
if (Array.isArray(schedule_list)) {
|
|
923
|
-
var _iterator = _createForOfIteratorHelper(schedule_list),
|
|
924
|
-
_step;
|
|
925
|
-
try {
|
|
926
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
927
|
-
var item = _step.value;
|
|
928
|
-
scheduleById[item.id] = item;
|
|
929
|
-
}
|
|
930
|
-
} catch (err) {
|
|
931
|
-
_iterator.e(err);
|
|
932
|
-
} finally {
|
|
933
|
-
_iterator.f();
|
|
934
|
-
}
|
|
935
|
-
}
|
|
936
|
-
return {
|
|
937
|
-
is_price_include_tax: is_price_include_tax,
|
|
938
|
-
tax_rate: tax_rate,
|
|
939
|
-
tax_title: tax_title,
|
|
940
|
-
surcharge_list: surcharge_list,
|
|
941
|
-
schedule_list: schedule_list,
|
|
942
|
-
scheduleById: scheduleById
|
|
943
|
-
};
|
|
944
|
-
} catch (error) {
|
|
945
|
-
console.error(error);
|
|
946
|
-
return {};
|
|
947
|
-
}
|
|
948
|
-
};
|
|
949
|
-
|
|
950
|
-
// 计算当前订单总价(不包含税费那些,所以应该是产品总价)
|
|
951
|
-
var currentTotalPrice = useMemo(function () {
|
|
952
|
-
if (!showPriceAdjustModal) return 0;
|
|
953
|
-
var ScheduleModule = pisellosAllModule.ScheduleModule;
|
|
954
|
-
try {
|
|
955
|
-
var _getSumTotal = getSumTotal(state, _objectSpread({
|
|
956
|
-
isEdit: true,
|
|
957
|
-
ScheduleModule: ScheduleModule
|
|
958
|
-
}, getDataFromHost())),
|
|
959
|
-
productAmount = _getSumTotal.productAmount;
|
|
960
|
-
return productAmount;
|
|
961
|
-
} catch (error) {
|
|
962
|
-
console.error('计算总价失败:', error);
|
|
963
|
-
return 0;
|
|
964
|
-
}
|
|
965
|
-
}, [state, showPriceAdjustModal]);
|
|
966
918
|
|
|
967
919
|
// 手动折扣后订单总价
|
|
968
920
|
var currentTotalPriceAfterDiscount = useMemo(function () {
|
|
969
|
-
return new Decimal(currentTotalPrice).minus(
|
|
970
|
-
}, [
|
|
921
|
+
return new Decimal(currentTotalPrice || 0).minus(shopDiscount || 0).toNumber();
|
|
922
|
+
}, [shopDiscount, currentTotalPrice]);
|
|
971
923
|
var handleSelectWalletChange = useMemoizedFn( /*#__PURE__*/function () {
|
|
972
924
|
var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(select) {
|
|
973
925
|
var voucherItems, data;
|
|
@@ -1031,14 +983,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1031
983
|
case 0:
|
|
1032
984
|
try {
|
|
1033
985
|
if (checkoutModule && orderInfo !== null && orderInfo !== void 0 && orderInfo.totalAmount) {
|
|
1034
|
-
|
|
1035
|
-
dispatch({
|
|
1036
|
-
type: 'setState',
|
|
1037
|
-
payload: {
|
|
1038
|
-
shop_discount: discountAmount
|
|
1039
|
-
}
|
|
1040
|
-
});
|
|
1041
|
-
}
|
|
986
|
+
onChangeShopDiscount === null || onChangeShopDiscount === void 0 || onChangeShopDiscount(discountAmount);
|
|
1042
987
|
}
|
|
1043
988
|
} catch (error) {
|
|
1044
989
|
console.error('Failed to adjust price:', error);
|
|
@@ -1170,8 +1115,8 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1170
1115
|
};
|
|
1171
1116
|
});
|
|
1172
1117
|
var getCustomerInfo = function getCustomerInfo() {
|
|
1173
|
-
var
|
|
1174
|
-
|
|
1118
|
+
var _client$contacts;
|
|
1119
|
+
// const client = state?.client?.value;
|
|
1175
1120
|
|
|
1176
1121
|
// 修复逻辑:只有在 undefined 或 null 时才使用默认值,空字符串应该保留
|
|
1177
1122
|
var getValidName = function getValidName(value) {
|
|
@@ -1236,13 +1181,11 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1236
1181
|
};
|
|
1237
1182
|
}();
|
|
1238
1183
|
var searchAndClientProps = useMemo(function () {
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
return {};
|
|
1245
|
-
}, [paymentItems]);
|
|
1184
|
+
return {
|
|
1185
|
+
disabledSwitch: (config === null || config === void 0 ? void 0 : config.disabledSwitchClient) || false
|
|
1186
|
+
};
|
|
1187
|
+
}, [paymentItems, config]);
|
|
1188
|
+
console.log(searchAndClientProps, 'searchAndClientProps');
|
|
1246
1189
|
var roundingFunction = /*#__PURE__*/function () {
|
|
1247
1190
|
var _ref17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(amount) {
|
|
1248
1191
|
var res;
|
|
@@ -1267,9 +1210,8 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1267
1210
|
|
|
1268
1211
|
// 处理PaymentModal区域的点击事件
|
|
1269
1212
|
var handleModalClick = useCallback(function (event) {
|
|
1270
|
-
var _state$bookingConfig2;
|
|
1271
1213
|
// 关闭所有Toast
|
|
1272
|
-
var isToastMode =
|
|
1214
|
+
var isToastMode = paymentResultDisplayMode !== 'modal';
|
|
1273
1215
|
if (isToastMode) {
|
|
1274
1216
|
closeAllPaymentResultToasts();
|
|
1275
1217
|
}
|
|
@@ -1293,14 +1235,14 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1293
1235
|
},
|
|
1294
1236
|
onSearch: handleSearch
|
|
1295
1237
|
}, searchAndClientProps)), moduleConfig.showWalletPass && /*#__PURE__*/React.createElement(WalletPassModule, {
|
|
1296
|
-
clientId:
|
|
1238
|
+
clientId: client === null || client === void 0 ? void 0 : client.id,
|
|
1297
1239
|
customAmount: balanceDueAmount,
|
|
1298
1240
|
orderInfo: orderInfo || undefined,
|
|
1299
1241
|
ref: walletPassRef,
|
|
1300
1242
|
paymentItems: paymentItems,
|
|
1301
1243
|
onSelectChange: handleSelectWalletChange
|
|
1302
1244
|
})), /*#__PURE__*/React.createElement(AmountSummary, {
|
|
1303
|
-
amountSymbol:
|
|
1245
|
+
amountSymbol: getData('shop_symbol'),
|
|
1304
1246
|
orderInfo: orderInfo || undefined,
|
|
1305
1247
|
cartData: cartData,
|
|
1306
1248
|
open_deposit: open_deposit,
|
|
@@ -1308,7 +1250,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1308
1250
|
balanceDueAmount: balanceDueAmount,
|
|
1309
1251
|
paymentItems: paymentItems,
|
|
1310
1252
|
walletPassData: walletPassData,
|
|
1311
|
-
clientInfo:
|
|
1253
|
+
clientInfo: client,
|
|
1312
1254
|
onAmountChange: handleAmountChange,
|
|
1313
1255
|
onDepositStatusChange: handleDepositStatusChange,
|
|
1314
1256
|
onBalanceDueAmountClick: handleButtonClick,
|
|
@@ -1341,7 +1283,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1341
1283
|
gridRow: (paymentOptionList === null || paymentOptionList === void 0 ? void 0 : paymentOptionList.length) > 3 ? '1 / 3' : '1'
|
|
1342
1284
|
} : {}
|
|
1343
1285
|
}, /*#__PURE__*/React.createElement(PaymentOptionsModule, {
|
|
1344
|
-
amountSymbol:
|
|
1286
|
+
amountSymbol: getData('shop_symbol'),
|
|
1345
1287
|
orderInfo: orderInfo || undefined,
|
|
1346
1288
|
onClick: onPaymentOptionClick,
|
|
1347
1289
|
paymentMethods: paymentMethods,
|
|
@@ -1393,7 +1335,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1393
1335
|
onEnter: handlePriceAdjustConfirm
|
|
1394
1336
|
}), /*#__PURE__*/React.createElement(SavePayLaterHandler, {
|
|
1395
1337
|
ref: savePayLaterHandlerRef,
|
|
1396
|
-
amountSymbol:
|
|
1338
|
+
amountSymbol: getData('shop_symbol'),
|
|
1397
1339
|
walletPassData: walletPassData,
|
|
1398
1340
|
onSavePayLater: handleSavePayLater
|
|
1399
1341
|
}), /*#__PURE__*/React.createElement(PaymentKeyboard, {
|
|
@@ -1441,10 +1383,20 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
1441
1383
|
data = _ref18.data,
|
|
1442
1384
|
callback = _ref18.callback,
|
|
1443
1385
|
onClose = _ref18.onClose,
|
|
1444
|
-
dispatch = _ref18.dispatch,
|
|
1445
|
-
state = _ref18.state,
|
|
1446
1386
|
setEditCartMode = _ref18.setEditCartMode,
|
|
1447
|
-
editOrderId = _ref18.editOrderId
|
|
1387
|
+
editOrderId = _ref18.editOrderId,
|
|
1388
|
+
paymentResultDisplayMode = _ref18.paymentResultDisplayMode,
|
|
1389
|
+
shopDiscount = _ref18.shopDiscount,
|
|
1390
|
+
client = _ref18.client,
|
|
1391
|
+
currentTotalPrice = _ref18.currentTotalPrice,
|
|
1392
|
+
onChangeShopDiscount = _ref18.onChangeShopDiscount,
|
|
1393
|
+
onChangeOrderNote = _ref18.onChangeOrderNote,
|
|
1394
|
+
onDeleteOrderNote = _ref18.onDeleteOrderNote,
|
|
1395
|
+
_ref18$config = _ref18.config,
|
|
1396
|
+
config = _ref18$config === void 0 ? {
|
|
1397
|
+
showHeaderCenter: true,
|
|
1398
|
+
showHeaderRightButton: true
|
|
1399
|
+
} : _ref18$config;
|
|
1448
1400
|
var context = useEngineContext();
|
|
1449
1401
|
locales.init(checkoutLocales, ((_context$appHelper$ut = context.appHelper.utils) === null || _context$appHelper$ut === void 0 || (_context$appHelper$ut2 = _context$appHelper$ut.getApp) === null || _context$appHelper$ut2 === void 0 || (_context$appHelper$ut2 = _context$appHelper$ut2.call(_context$appHelper$ut)) === null || _context$appHelper$ut2 === void 0 || (_context$appHelper$ut2 = _context$appHelper$ut2.locales) === null || _context$appHelper$ut2 === void 0 || (_context$appHelper$ut3 = _context$appHelper$ut2.getLocale) === null || _context$appHelper$ut3 === void 0 ? void 0 : _context$appHelper$ut3.call(_context$appHelper$ut2)) || ((_context$appHelper$ut4 = context.appHelper.utils) === null || _context$appHelper$ut4 === void 0 || (_context$appHelper$ut4 = _context$appHelper$ut4.storage) === null || _context$appHelper$ut4 === void 0 ? void 0 : _context$appHelper$ut4.get('umi_locale')) || 'en');
|
|
1450
1402
|
var _ref19 = (context === null || context === void 0 || (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils) || {},
|
|
@@ -1661,15 +1613,7 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
1661
1613
|
Toast === null || Toast === void 0 || Toast.success(locales.getText('pisell2.checkout.order-note.updated-successfully'));
|
|
1662
1614
|
case 13:
|
|
1663
1615
|
// 同时把购物车的也给改了
|
|
1664
|
-
|
|
1665
|
-
dispatch({
|
|
1666
|
-
type: 'setNotes',
|
|
1667
|
-
payload: {
|
|
1668
|
-
orderNote: noteValue,
|
|
1669
|
-
edit: true
|
|
1670
|
-
}
|
|
1671
|
-
});
|
|
1672
|
-
}
|
|
1616
|
+
onChangeOrderNote === null || onChangeOrderNote === void 0 || onChangeOrderNote(noteValue);
|
|
1673
1617
|
|
|
1674
1618
|
// 根据打开来源执行不同的逻辑
|
|
1675
1619
|
if (noteModalSource === 'payment-result-toast') {
|
|
@@ -1718,15 +1662,7 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
1718
1662
|
Toast === null || Toast === void 0 || Toast.success(locales.getText('pisell2.checkout.order-note.deleted-successfully'));
|
|
1719
1663
|
case 7:
|
|
1720
1664
|
// 同时把购物车的也给改了
|
|
1721
|
-
|
|
1722
|
-
dispatch({
|
|
1723
|
-
type: 'setNotes',
|
|
1724
|
-
payload: {
|
|
1725
|
-
orderNote: '',
|
|
1726
|
-
edit: true
|
|
1727
|
-
}
|
|
1728
|
-
});
|
|
1729
|
-
}
|
|
1665
|
+
onDeleteOrderNote === null || onDeleteOrderNote === void 0 || onDeleteOrderNote();
|
|
1730
1666
|
_context18.next = 14;
|
|
1731
1667
|
break;
|
|
1732
1668
|
case 10:
|
|
@@ -2050,9 +1986,9 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
2050
1986
|
handlePaymentCancel(false);
|
|
2051
1987
|
}
|
|
2052
1988
|
}
|
|
2053
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
1989
|
+
})), (config === null || config === void 0 ? void 0 : config.showHeaderCenter) && /*#__PURE__*/React.createElement("div", {
|
|
2054
1990
|
className: "header__center"
|
|
2055
|
-
}, translation('order.total'), "\uFF1A", formatCurrency(totalAmount,
|
|
1991
|
+
}, translation('order.total'), "\uFF1A", formatCurrency(totalAmount, getData('shop_symbol'))), (config === null || config === void 0 ? void 0 : config.showHeaderRightButton) && /*#__PURE__*/React.createElement("div", {
|
|
2056
1992
|
className: "header__right"
|
|
2057
1993
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
2058
1994
|
size: "small",
|
|
@@ -2078,7 +2014,7 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
2078
2014
|
useEffect(function () {
|
|
2079
2015
|
var initCheckoutData = /*#__PURE__*/function () {
|
|
2080
2016
|
var _ref28 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23() {
|
|
2081
|
-
var checkout, shop_wallet_pass_id, newData, _newData$subtotal_inf, _newData$subtotal_inf2, _orderInfo2, _data$subtotal_info, _data$subtotal_info2, _orderInfo4;
|
|
2017
|
+
var checkout, shop_wallet_pass_id, newData, existPayment, _newData$subtotal_inf, _newData$subtotal_inf2, _orderInfo2, _data$subtotal_info, _data$subtotal_info2, _orderInfo4;
|
|
2082
2018
|
return _regeneratorRuntime().wrap(function _callee23$(_context23) {
|
|
2083
2019
|
while (1) switch (_context23.prev = _context23.next) {
|
|
2084
2020
|
case 0:
|
|
@@ -2086,7 +2022,7 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
2086
2022
|
// 获取 checkout 模块并处理订单数据
|
|
2087
2023
|
checkout = pisellos === null || pisellos === void 0 ? void 0 : pisellos.getModule('checkout');
|
|
2088
2024
|
if (!(checkout && data && !isLocalOrderCreated.current)) {
|
|
2089
|
-
_context23.next =
|
|
2025
|
+
_context23.next = 26;
|
|
2090
2026
|
break;
|
|
2091
2027
|
}
|
|
2092
2028
|
isLocalOrderCreated.current = true;
|
|
@@ -2106,24 +2042,26 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
2106
2042
|
order_rounding_setting: getData('order_rounding_setting'),
|
|
2107
2043
|
shop_wallet_pass_id: shop_wallet_pass_id
|
|
2108
2044
|
});
|
|
2109
|
-
newData = cloneDeep(data);
|
|
2045
|
+
newData = cloneDeep(data);
|
|
2046
|
+
existPayment = newData.existPayment; // setTotalAmount(newData.total.expectAmount);
|
|
2110
2047
|
// 先往 checkout 解决方案推送一条 local 数据
|
|
2111
2048
|
if (!(editOrderId || currentEditOrderId)) {
|
|
2112
|
-
_context23.next =
|
|
2049
|
+
_context23.next = 15;
|
|
2113
2050
|
break;
|
|
2114
2051
|
}
|
|
2115
|
-
_context23.next =
|
|
2052
|
+
_context23.next = 13;
|
|
2116
2053
|
return checkout.updateLocalOrderAsync({
|
|
2117
2054
|
orderId: editOrderId || currentEditOrderId,
|
|
2118
2055
|
orderData: newData.order_info,
|
|
2119
2056
|
cartSummary: (_newData$subtotal_inf = newData.subtotal_info) === null || _newData$subtotal_inf === void 0 ? void 0 : _newData$subtotal_inf.subTotalList,
|
|
2120
2057
|
autoPayment: true,
|
|
2121
|
-
totalInfo: newData.subtotal_info
|
|
2058
|
+
totalInfo: newData.subtotal_info,
|
|
2059
|
+
existPayment: existPayment
|
|
2122
2060
|
});
|
|
2123
|
-
case
|
|
2124
|
-
_context23.next =
|
|
2061
|
+
case 13:
|
|
2062
|
+
_context23.next = 18;
|
|
2125
2063
|
break;
|
|
2126
|
-
case
|
|
2064
|
+
case 15:
|
|
2127
2065
|
logger === null || logger === void 0 || logger.addLog({
|
|
2128
2066
|
type: 'info',
|
|
2129
2067
|
title: '正常创建 createLocalOrderAsync',
|
|
@@ -2131,14 +2069,14 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
2131
2069
|
data: data
|
|
2132
2070
|
}
|
|
2133
2071
|
});
|
|
2134
|
-
_context23.next =
|
|
2072
|
+
_context23.next = 18;
|
|
2135
2073
|
return checkout.createLocalOrderAsync({
|
|
2136
2074
|
orderData: newData.order_info,
|
|
2137
2075
|
cartSummary: (_newData$subtotal_inf2 = newData.subtotal_info) === null || _newData$subtotal_inf2 === void 0 ? void 0 : _newData$subtotal_inf2.subTotalList,
|
|
2138
2076
|
autoPayment: true,
|
|
2139
2077
|
totalInfo: newData.subtotal_info
|
|
2140
2078
|
});
|
|
2141
|
-
case
|
|
2079
|
+
case 18:
|
|
2142
2080
|
// 获取订单总金额
|
|
2143
2081
|
_orderInfo2 = checkout.getCurrentOrderInfo();
|
|
2144
2082
|
console.log(_orderInfo2);
|
|
@@ -2159,7 +2097,7 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
2159
2097
|
unsubscribeRef.current = checkout.core.effects.on('checkout:onOrderSynced', executeIfActive( /*#__PURE__*/function () {
|
|
2160
2098
|
var _ref29 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22(data) {
|
|
2161
2099
|
var _data$response, _responseData$payment2;
|
|
2162
|
-
var currentOrderId, responseData, paymentStatus, orderTotalAmount, gapAmount, currentChangeGivenAmount, failureReason,
|
|
2100
|
+
var currentOrderId, responseData, paymentStatus, orderTotalAmount, gapAmount, currentChangeGivenAmount, failureReason, _responseData$payment3, params, statusClassName, autoCloseConfig, enabledAutoPrint, _interaction$utils6, _interaction$utils6$a, _orderInfo3, isToastMode, paymentResult;
|
|
2163
2101
|
return _regeneratorRuntime().wrap(function _callee22$(_context22) {
|
|
2164
2102
|
while (1) switch (_context22.prev = _context22.next) {
|
|
2165
2103
|
case 0:
|
|
@@ -2263,7 +2201,7 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
2263
2201
|
enabledAutoPrint = _context22.sent;
|
|
2264
2202
|
case 27:
|
|
2265
2203
|
_orderInfo3 = checkout.getCurrentOrderInfo(); // 弹窗模式判断
|
|
2266
|
-
isToastMode =
|
|
2204
|
+
isToastMode = paymentResultDisplayMode !== 'modal';
|
|
2267
2205
|
if (!isToastMode) {
|
|
2268
2206
|
autoCloseConfig.autoClose = false;
|
|
2269
2207
|
autoCloseConfig.autoCloseDelay = 0;
|
|
@@ -2310,24 +2248,24 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
2310
2248
|
return _ref29.apply(this, arguments);
|
|
2311
2249
|
};
|
|
2312
2250
|
}()));
|
|
2313
|
-
_context23.next =
|
|
2251
|
+
_context23.next = 43;
|
|
2314
2252
|
break;
|
|
2315
|
-
case
|
|
2253
|
+
case 26:
|
|
2316
2254
|
if (!isLocalOrderCreated.current) {
|
|
2317
|
-
_context23.next =
|
|
2255
|
+
_context23.next = 43;
|
|
2318
2256
|
break;
|
|
2319
2257
|
}
|
|
2320
2258
|
// // 如果本地订单已创建,这时候还更新了 data,则需要销毁当前的订单数据,然后更新新的订单数据了
|
|
2321
2259
|
console.log('🔄 PaymentModal: data changed, updating checkout data...');
|
|
2322
2260
|
isLocalOrderCreated.current = false;
|
|
2323
|
-
_context23.next =
|
|
2261
|
+
_context23.next = 31;
|
|
2324
2262
|
return checkout.cancelCurrentOrderAsync();
|
|
2325
|
-
case
|
|
2263
|
+
case 31:
|
|
2326
2264
|
if (!(editOrderId || currentEditOrderId)) {
|
|
2327
|
-
_context23.next =
|
|
2265
|
+
_context23.next = 36;
|
|
2328
2266
|
break;
|
|
2329
2267
|
}
|
|
2330
|
-
_context23.next =
|
|
2268
|
+
_context23.next = 34;
|
|
2331
2269
|
return checkout.updateLocalOrderAsync({
|
|
2332
2270
|
orderId: editOrderId || currentEditOrderId,
|
|
2333
2271
|
orderData: data === null || data === void 0 ? void 0 : data.order_info,
|
|
@@ -2335,10 +2273,10 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
2335
2273
|
autoPayment: true,
|
|
2336
2274
|
totalInfo: data === null || data === void 0 ? void 0 : data.subtotal_info
|
|
2337
2275
|
});
|
|
2338
|
-
case
|
|
2339
|
-
_context23.next =
|
|
2276
|
+
case 34:
|
|
2277
|
+
_context23.next = 39;
|
|
2340
2278
|
break;
|
|
2341
|
-
case
|
|
2279
|
+
case 36:
|
|
2342
2280
|
logger === null || logger === void 0 || logger.addLog({
|
|
2343
2281
|
type: 'info',
|
|
2344
2282
|
title: '含有 localOrderCreate, 调用 createLocalOrderAsync',
|
|
@@ -2346,14 +2284,14 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
2346
2284
|
data: data
|
|
2347
2285
|
}
|
|
2348
2286
|
});
|
|
2349
|
-
_context23.next =
|
|
2287
|
+
_context23.next = 39;
|
|
2350
2288
|
return checkout.createLocalOrderAsync({
|
|
2351
2289
|
orderData: data === null || data === void 0 ? void 0 : data.order_info,
|
|
2352
2290
|
cartSummary: data === null || data === void 0 || (_data$subtotal_info2 = data.subtotal_info) === null || _data$subtotal_info2 === void 0 ? void 0 : _data$subtotal_info2.subTotalList,
|
|
2353
2291
|
autoPayment: true,
|
|
2354
2292
|
totalInfo: data === null || data === void 0 ? void 0 : data.subtotal_info
|
|
2355
2293
|
});
|
|
2356
|
-
case
|
|
2294
|
+
case 39:
|
|
2357
2295
|
// 获取订单总金额
|
|
2358
2296
|
_orderInfo4 = checkout.getCurrentOrderInfo();
|
|
2359
2297
|
if (_orderInfo4 && _orderInfo4.totalAmount) {
|
|
@@ -2361,11 +2299,11 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
2361
2299
|
}
|
|
2362
2300
|
setOrderInfo(_orderInfo4);
|
|
2363
2301
|
isLocalOrderCreated.current = true;
|
|
2364
|
-
case
|
|
2365
|
-
_context23.next =
|
|
2302
|
+
case 43:
|
|
2303
|
+
_context23.next = 50;
|
|
2366
2304
|
break;
|
|
2367
|
-
case
|
|
2368
|
-
_context23.prev =
|
|
2305
|
+
case 45:
|
|
2306
|
+
_context23.prev = 45;
|
|
2369
2307
|
_context23.t0 = _context23["catch"](0);
|
|
2370
2308
|
console.error('Failed to initialize checkout data:', _context23.t0);
|
|
2371
2309
|
logger === null || logger === void 0 || logger.addLog({
|
|
@@ -2377,11 +2315,11 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
2377
2315
|
});
|
|
2378
2316
|
// 如果订单创建失败,弹出提示让重新加载 app
|
|
2379
2317
|
setShowCreateErrorModal(true);
|
|
2380
|
-
case
|
|
2318
|
+
case 50:
|
|
2381
2319
|
case "end":
|
|
2382
2320
|
return _context23.stop();
|
|
2383
2321
|
}
|
|
2384
|
-
}, _callee23, null, [[0,
|
|
2322
|
+
}, _callee23, null, [[0, 45]]);
|
|
2385
2323
|
}));
|
|
2386
2324
|
return function initCheckoutData() {
|
|
2387
2325
|
return _ref28.apply(this, arguments);
|
|
@@ -2408,12 +2346,12 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
2408
2346
|
getData: getData,
|
|
2409
2347
|
interaction: interaction,
|
|
2410
2348
|
Toast: Toast,
|
|
2411
|
-
state: state,
|
|
2412
2349
|
onToastClose: handleToastClose
|
|
2413
2350
|
};
|
|
2414
2351
|
|
|
2415
2352
|
// 支付结果弹窗按钮生成函数
|
|
2416
|
-
var generateActionButtons = function generateActionButtons(paymentStatus
|
|
2353
|
+
var generateActionButtons = function generateActionButtons(paymentStatus) {
|
|
2354
|
+
var enabledAutoPrint = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
2417
2355
|
var getClassName = function getClassName(suffix) {
|
|
2418
2356
|
return "payment-result-toast-".concat(suffix);
|
|
2419
2357
|
};
|
|
@@ -2822,8 +2760,13 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
2822
2760
|
onPaymentCancel: handlePaymentCancel
|
|
2823
2761
|
// onStatusChange={(status) => console.log('Status changed:', status)}
|
|
2824
2762
|
,
|
|
2825
|
-
|
|
2826
|
-
|
|
2763
|
+
paymentResultDisplayMode: paymentResultDisplayMode,
|
|
2764
|
+
shopDiscount: shopDiscount,
|
|
2765
|
+
client: client,
|
|
2766
|
+
currentTotalPrice: currentTotalPrice,
|
|
2767
|
+
onChangeShopDiscount: onChangeShopDiscount,
|
|
2768
|
+
onChangeOrderNote: onChangeOrderNote,
|
|
2769
|
+
onDeleteOrderNote: onDeleteOrderNote,
|
|
2827
2770
|
showingCashToastRef: showingCashToastRef,
|
|
2828
2771
|
onToastClose: handleToastClose,
|
|
2829
2772
|
orderNote: orderNote,
|
|
@@ -2845,7 +2788,8 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
2845
2788
|
},
|
|
2846
2789
|
setCurrentEditOrderId: function setCurrentEditOrderId(orderId) {
|
|
2847
2790
|
return _setCurrentEditOrderId(orderId);
|
|
2848
|
-
}
|
|
2791
|
+
},
|
|
2792
|
+
config: config
|
|
2849
2793
|
})), noteModalOpen && /*#__PURE__*/createPortal( /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(NoteModal, {
|
|
2850
2794
|
open: noteModalOpen,
|
|
2851
2795
|
title: locales.getText('pisell2.text.add-order-notes'),
|
|
@@ -169,7 +169,7 @@ function PaymentDetailModal(_ref) {
|
|
|
169
169
|
className: classNames('payment-item-content')
|
|
170
170
|
}, /*#__PURE__*/React.createElement("div", {
|
|
171
171
|
className: classNames('payment-item-text')
|
|
172
|
-
}, item.name, " - ", new Date().toLocaleDateString(), ' ', getText('pisell2.checkout.payment-detail.by') || 'by', ' ', getCustomerInfo().nickname), /*#__PURE__*/React.createElement("div", {
|
|
172
|
+
}, item.name, " - ", item.created_at || new Date().toLocaleDateString(), ' ', getText('pisell2.checkout.payment-detail.by') || 'by', ' ', getCustomerInfo().nickname), /*#__PURE__*/React.createElement("div", {
|
|
173
173
|
className: classNames('payment-item-actions')
|
|
174
174
|
}, /*#__PURE__*/React.createElement("div", {
|
|
175
175
|
className: classNames('payment-item-amount')
|
|
@@ -202,7 +202,7 @@ function PaymentDetailModal(_ref) {
|
|
|
202
202
|
className: classNames('payment-item-content')
|
|
203
203
|
}, /*#__PURE__*/React.createElement("div", {
|
|
204
204
|
className: classNames('payment-item-text')
|
|
205
|
-
}, item.name, " - ", new Date().toLocaleDateString(), ' ', getText('pisell2.checkout.payment-detail.by') || 'by', ' ', getCustomerInfo().nickname), /*#__PURE__*/React.createElement("div", {
|
|
205
|
+
}, item.name, " - ", item.created_at || new Date().toLocaleDateString(), ' ', getText('pisell2.checkout.payment-detail.by') || 'by', ' ', getCustomerInfo().nickname), /*#__PURE__*/React.createElement("div", {
|
|
206
206
|
className: classNames('payment-item-actions')
|
|
207
207
|
}, /*#__PURE__*/React.createElement("div", {
|
|
208
208
|
className: classNames('payment-item-amount')
|