@pisell/private-materials 6.4.73 → 6.4.75
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 +4 -4
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +5 -5
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +5 -5
- package/es/components/appointmentBooking/components/Footer/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +1 -0
- package/es/components/booking/addons/model.d.ts +10 -1
- package/es/components/booking/components/TabProduct/index.d.ts +1 -0
- package/es/components/booking/components/footer/index.js +62 -53
- package/es/components/booking/components/formItemChildrenWrap/index.d.ts +1 -0
- package/es/components/booking/forms/model.d.ts +10 -1
- package/es/components/booking/forms/table/index.d.ts +1 -0
- package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
- package/es/components/booking/info/model.d.ts +10 -1
- package/es/components/booking/info/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info/service/like/index.d.ts +1 -0
- package/es/components/booking/info/service2/utils.d.ts +1 -1
- package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/es/components/booking/materiels/holder/index.d.ts +1 -0
- package/es/components/booking/model.d.ts +9 -1
- package/es/components/booking/notes/model.d.ts +10 -1
- package/es/components/booking/payments/model.d.ts +10 -1
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/checkout/PaymentModal.js +178 -108
- package/es/components/checkout/components/AdditionalModule/index.d.ts +3 -1
- package/es/components/checkout/components/AdditionalModule/index.js +50 -12
- package/es/components/checkout/components/AmountSummary/index.js +9 -76
- package/es/components/checkout/components/AmountSummary/index.less +1 -1
- package/es/components/checkout/components/CashPaymentModule/index.d.ts +3 -1
- package/es/components/checkout/components/CashPaymentModule/index.js +5 -2
- package/es/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.d.ts +2 -0
- package/es/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.js +6 -1
- package/es/components/checkout/components/PaymentOptionsModule/index.d.ts +1 -0
- package/es/components/checkout/components/PaymentOptionsModule/index.js +2 -1
- package/es/components/checkout/components/PaymentOptionsModule/index.less +4 -0
- package/es/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.d.ts +4 -0
- package/es/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.js +31 -8
- package/es/components/checkout/components/PaymentResultToast/index.js +6 -6
- package/es/components/checkout/components/PaymentResultToast/index.less +94 -33
- package/es/components/checkout/hooks/useWalletPass.d.ts +1 -1
- package/es/components/checkout/index.less +1 -1
- package/es/components/checkout/locales.d.ts +3 -0
- package/es/components/checkout/locales.js +3 -0
- package/es/components/checkout/utils/PaymentResultToastUtils.js +11 -1
- package/es/components/eftpos/deviceList/index.d.ts +1 -0
- package/es/components/eftpos/form/index.d.ts +1 -0
- package/es/components/eftpos/group/index.d.ts +1 -0
- package/es/components/eftpos/hooks.d.ts +1 -0
- package/es/components/eftpos/icon/apiKey.d.ts +1 -0
- package/es/components/eftpos/icon/device.d.ts +1 -0
- package/es/components/eftpos/receipt/index.d.ts +1 -0
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/component/alert/warn.d.ts +1 -0
- package/es/components/eftposPay/component/header/titlebar.d.ts +1 -0
- package/es/components/eftposPay/component/step/index.d.ts +1 -0
- package/es/components/eftposPay/component/step/step.d.ts +1 -0
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +2 -2
- package/es/components/eftposPay/store/index.d.ts +4 -4
- package/es/components/eftposPay/tyro/hooks.d.ts +1 -0
- package/es/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
- package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +1 -0
- package/es/components/pay/toC/model.d.ts +9 -1
- package/es/components/productExtension/fields/Actor/index.d.ts +1 -0
- package/es/components/productExtension/fields/Forms/index.d.ts +1 -0
- package/es/components/schedules/calendar/calendarItem.d.ts +1 -0
- package/es/components/schedules/components/CurrentDay/index.d.ts +1 -0
- package/es/components/schedules/model.d.ts +9 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +1 -0
- package/es/components/schedules/products/index.d.ts +1 -0
- package/es/components/schedules/resources/relationProduct/index.d.ts +1 -0
- package/es/components/shoppingCart/components/Empty/index.d.ts +1 -0
- package/es/components/shoppingCart/components/Render/index.d.ts +1 -0
- package/es/components/ticketBooking/components/timeBar/index.js +112 -7
- package/es/components/ticketBooking/components/timeBar/index.less +59 -0
- package/es/components/ticketBooking/locales.d.ts +6 -0
- package/es/components/ticketBooking/locales.js +9 -3
- package/es/components/ticketBooking/utils/index.d.ts +1 -1
- package/es/components/wallet/Detail/model.d.ts +13 -1
- package/es/components/wallet/DiscountCard/model.d.ts +14 -1
- package/es/components/wallet/PointCard/model.d.ts +13 -1
- package/es/components/wallet/RechargeableCard/model.d.ts +29 -1
- package/es/components/wallet/Voucher/model.d.ts +13 -1
- package/es/components/wallet/model.d.ts +9 -1
- package/es/components/workSpaceList/components/Modal/index.d.ts +1 -0
- package/es/plus/clientName/index.d.ts +1 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Capacity/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/CardMask/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/Countdown/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/Duration/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/MemberPrice/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/Resource/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/Stock/index.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/Time/index.d.ts +1 -1
- package/es/pro/pisellPaymentList/example.d.ts +1 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.js +11 -7
- package/es/pro/priceKeyboard/components/cashKeyboard/index.d.ts +1 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/index.js +4 -2
- package/es/pro/priceKeyboard/components/cashKeyboard/types.d.ts +1 -0
- package/es/pro/priceKeyboard/components/discountKeyboard/index.js +10 -1
- package/es/pro/priceKeyboard/components/discountKeyboard/index.less +14 -0
- package/es/pro/priceKeyboard/components/shortcuts/index.d.ts +1 -0
- package/es/pro/priceKeyboard/components/shortcuts/index.js +5 -2
- package/es/pro/priceKeyboard/components/shortcuts/index.less +4 -0
- package/lib/components/appointmentBooking/components/Footer/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +1 -0
- package/lib/components/booking/addons/model.d.ts +10 -1
- package/lib/components/booking/components/TabProduct/index.d.ts +1 -0
- package/lib/components/booking/components/footer/index.js +15 -8
- package/lib/components/booking/components/formItemChildrenWrap/index.d.ts +1 -0
- package/lib/components/booking/forms/model.d.ts +10 -1
- package/lib/components/booking/forms/table/index.d.ts +1 -0
- package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
- package/lib/components/booking/info/model.d.ts +10 -1
- package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info/service/like/index.d.ts +1 -0
- package/lib/components/booking/info/service2/utils.d.ts +1 -1
- package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/materiels/holder/index.d.ts +1 -0
- package/lib/components/booking/model.d.ts +9 -1
- package/lib/components/booking/notes/model.d.ts +10 -1
- package/lib/components/booking/payments/model.d.ts +10 -1
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/checkout/PaymentModal.js +73 -11
- package/lib/components/checkout/components/AdditionalModule/index.d.ts +3 -1
- package/lib/components/checkout/components/AdditionalModule/index.js +50 -11
- package/lib/components/checkout/components/AmountSummary/index.js +5 -46
- package/lib/components/checkout/components/AmountSummary/index.less +1 -1
- package/lib/components/checkout/components/CashPaymentModule/index.d.ts +3 -1
- package/lib/components/checkout/components/CashPaymentModule/index.js +5 -2
- package/lib/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.d.ts +2 -0
- package/lib/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.js +5 -1
- package/lib/components/checkout/components/PaymentOptionsModule/index.d.ts +1 -0
- package/lib/components/checkout/components/PaymentOptionsModule/index.js +6 -0
- package/lib/components/checkout/components/PaymentOptionsModule/index.less +4 -0
- package/lib/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.d.ts +4 -0
- package/lib/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.js +23 -5
- package/lib/components/checkout/components/PaymentResultToast/index.js +4 -4
- package/lib/components/checkout/components/PaymentResultToast/index.less +94 -33
- package/lib/components/checkout/hooks/useWalletPass.d.ts +1 -1
- package/lib/components/checkout/index.less +1 -1
- package/lib/components/checkout/locales.d.ts +3 -0
- package/lib/components/checkout/locales.js +3 -0
- package/lib/components/checkout/utils/PaymentResultToastUtils.js +11 -1
- package/lib/components/eftpos/deviceList/index.d.ts +1 -0
- package/lib/components/eftpos/form/index.d.ts +1 -0
- package/lib/components/eftpos/group/index.d.ts +1 -0
- package/lib/components/eftpos/hooks.d.ts +1 -0
- package/lib/components/eftpos/icon/apiKey.d.ts +1 -0
- package/lib/components/eftpos/icon/device.d.ts +1 -0
- package/lib/components/eftpos/receipt/index.d.ts +1 -0
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/component/alert/warn.d.ts +1 -0
- package/lib/components/eftposPay/component/header/titlebar.d.ts +1 -0
- package/lib/components/eftposPay/component/step/index.d.ts +1 -0
- package/lib/components/eftposPay/component/step/step.d.ts +1 -0
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +2 -2
- package/lib/components/eftposPay/store/index.d.ts +4 -4
- package/lib/components/eftposPay/tyro/hooks.d.ts +1 -0
- package/lib/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
- package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +1 -0
- package/lib/components/pay/toC/model.d.ts +9 -1
- package/lib/components/productExtension/fields/Actor/index.d.ts +1 -0
- package/lib/components/productExtension/fields/Forms/index.d.ts +1 -0
- package/lib/components/schedules/calendar/calendarItem.d.ts +1 -0
- package/lib/components/schedules/components/CurrentDay/index.d.ts +1 -0
- package/lib/components/schedules/model.d.ts +9 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +1 -0
- package/lib/components/schedules/products/index.d.ts +1 -0
- package/lib/components/schedules/resources/relationProduct/index.d.ts +1 -0
- package/lib/components/shoppingCart/components/Empty/index.d.ts +1 -0
- package/lib/components/shoppingCart/components/Render/index.d.ts +1 -0
- package/lib/components/ticketBooking/components/timeBar/index.js +105 -4
- package/lib/components/ticketBooking/components/timeBar/index.less +59 -0
- package/lib/components/ticketBooking/locales.d.ts +6 -0
- package/lib/components/ticketBooking/locales.js +9 -3
- package/lib/components/ticketBooking/utils/index.d.ts +1 -1
- package/lib/components/wallet/Detail/model.d.ts +13 -1
- package/lib/components/wallet/DiscountCard/model.d.ts +14 -1
- package/lib/components/wallet/PointCard/model.d.ts +13 -1
- package/lib/components/wallet/RechargeableCard/model.d.ts +29 -1
- package/lib/components/wallet/Voucher/model.d.ts +13 -1
- package/lib/components/wallet/model.d.ts +9 -1
- package/lib/components/workSpaceList/components/Modal/index.d.ts +1 -0
- package/lib/plus/clientName/index.d.ts +1 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Capacity/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/CardMask/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Countdown/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Duration/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/MemberPrice/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Resource/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Stock/index.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Time/index.d.ts +1 -1
- package/lib/pro/pisellPaymentList/example.d.ts +1 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.js +9 -5
- package/lib/pro/priceKeyboard/components/cashKeyboard/index.d.ts +1 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/index.js +3 -2
- package/lib/pro/priceKeyboard/components/cashKeyboard/types.d.ts +1 -0
- package/lib/pro/priceKeyboard/components/discountKeyboard/index.js +8 -1
- package/lib/pro/priceKeyboard/components/discountKeyboard/index.less +14 -0
- package/lib/pro/priceKeyboard/components/shortcuts/index.d.ts +1 -0
- package/lib/pro/priceKeyboard/components/shortcuts/index.js +3 -2
- package/lib/pro/priceKeyboard/components/shortcuts/index.less +4 -0
- package/package.json +1 -1
|
@@ -30,7 +30,7 @@ import SendPaymentLinkModal from "./components/SendPaymentLinkModal";
|
|
|
30
30
|
import AmountSummary from "./components/AmountSummary/index";
|
|
31
31
|
import SavePayLaterHandler from "./components/SavePayLaterHandler";
|
|
32
32
|
import WalletPassModule from "./components/WalletPassModule";
|
|
33
|
-
import PaymentOptionsModule from "./components/PaymentOptionsModule";
|
|
33
|
+
import PaymentOptionsModule, { SHOW_METHODS_CODE } from "./components/PaymentOptionsModule";
|
|
34
34
|
import CashPaymentModule from "./components/CashPaymentModule";
|
|
35
35
|
import AdditionalModule from "./components/AdditionalModule";
|
|
36
36
|
import { getSumTotal } from "../booking/components/footer/amount";
|
|
@@ -46,7 +46,7 @@ import { cloneDeep } from 'lodash';
|
|
|
46
46
|
import { getShopWalletPassId, reorderPaymentMethodList } from "./utils";
|
|
47
47
|
import usePaymentLogger from "./hooks/usePaymentLogger";
|
|
48
48
|
import { Button } from 'antd';
|
|
49
|
-
import { DiscountKeyboard } from "../../pro/priceKeyboard";
|
|
49
|
+
import { DiscountKeyboard, PaymentKeyboard } from "../../pro/priceKeyboard";
|
|
50
50
|
import { useActiveExecute } from "../ticketBooking/hooks/pisellos";
|
|
51
51
|
|
|
52
52
|
// Checkout 模块的事件常量
|
|
@@ -124,35 +124,44 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
124
124
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
125
125
|
recommendAmounts = _useState8[0],
|
|
126
126
|
setRecommendAmounts = _useState8[1];
|
|
127
|
-
var
|
|
128
|
-
var _useState9 = useState([]),
|
|
127
|
+
var _useState9 = useState(false),
|
|
129
128
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
var
|
|
129
|
+
showSplitPaymentKeyboard = _useState10[0],
|
|
130
|
+
setShowSplitPaymentKeyboard = _useState10[1];
|
|
131
|
+
var paymentMethodsRef = useRef(null);
|
|
132
|
+
var _useState11 = useState([]),
|
|
133
133
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
var _useState13 = useState(
|
|
134
|
+
paymentMethods = _useState12[0],
|
|
135
|
+
setPaymentMethods = _useState12[1];
|
|
136
|
+
var _useState13 = useState(false),
|
|
137
137
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
138
|
-
|
|
139
|
-
|
|
138
|
+
showCashPayment = _useState14[0],
|
|
139
|
+
setShowCashPayment = _useState14[1];
|
|
140
|
+
var _useState15 = useState(locales.getText('cards.and.digitals') || 'Cards & Digitals'),
|
|
141
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
142
|
+
paymentOptionsTitle = _useState16[0],
|
|
143
|
+
setPaymentOptionsTitle = _useState16[1];
|
|
144
|
+
var paymentOptionList = useMemo(function () {
|
|
145
|
+
return paymentMethods.filter(function (item) {
|
|
146
|
+
return !(item.type === 'app' && item.code === 'EFTPOS_LINKLY') && (['custom'].includes(item.type) || SHOW_METHODS_CODE.includes(item.code));
|
|
147
|
+
});
|
|
148
|
+
}, [paymentMethods]);
|
|
140
149
|
var clientChangedRef = useRef(false);
|
|
141
150
|
var walletPassRef = useRef(null);
|
|
142
151
|
// 已保存的支付项数据
|
|
143
|
-
var
|
|
144
|
-
_useState16 = _slicedToArray(_useState15, 2),
|
|
145
|
-
paymentItems = _useState16[0],
|
|
146
|
-
setPaymentItems = _useState16[1];
|
|
147
|
-
// 钱包卡券数据
|
|
148
|
-
var _useState17 = useState({}),
|
|
152
|
+
var _useState17 = useState([]),
|
|
149
153
|
_useState18 = _slicedToArray(_useState17, 2),
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
154
|
+
paymentItems = _useState18[0],
|
|
155
|
+
setPaymentItems = _useState18[1];
|
|
156
|
+
// 钱包卡券数据
|
|
157
|
+
var _useState19 = useState({}),
|
|
153
158
|
_useState20 = _slicedToArray(_useState19, 2),
|
|
154
|
-
|
|
155
|
-
|
|
159
|
+
walletPassData = _useState20[0],
|
|
160
|
+
setWalletPassData = _useState20[1];
|
|
161
|
+
var _useState21 = useState(false),
|
|
162
|
+
_useState22 = _slicedToArray(_useState21, 2),
|
|
163
|
+
syncingLock = _useState22[0],
|
|
164
|
+
setSyncingLock = _useState22[1];
|
|
156
165
|
var isOrderFree = useMemo(function () {
|
|
157
166
|
if (!customAmount) return false;
|
|
158
167
|
var amount = parseFloat(customAmount);
|
|
@@ -160,14 +169,14 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
160
169
|
}, [customAmount]);
|
|
161
170
|
|
|
162
171
|
// 新增状态:订单备注和手动折扣
|
|
163
|
-
var _useState21 = useState(false),
|
|
164
|
-
_useState22 = _slicedToArray(_useState21, 2),
|
|
165
|
-
paymentLinkModalOpen = _useState22[0],
|
|
166
|
-
setPaymentLinkModalOpen = _useState22[1];
|
|
167
172
|
var _useState23 = useState(false),
|
|
168
173
|
_useState24 = _slicedToArray(_useState23, 2),
|
|
169
|
-
|
|
170
|
-
|
|
174
|
+
paymentLinkModalOpen = _useState24[0],
|
|
175
|
+
setPaymentLinkModalOpen = _useState24[1];
|
|
176
|
+
var _useState25 = useState(false),
|
|
177
|
+
_useState26 = _slicedToArray(_useState25, 2),
|
|
178
|
+
showPriceAdjustModal = _useState26[0],
|
|
179
|
+
setShowPriceAdjustModal = _useState26[1];
|
|
171
180
|
var logger = usePaymentLogger();
|
|
172
181
|
var currency = getData('shop_currency_code') || 'USD';
|
|
173
182
|
|
|
@@ -567,7 +576,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
567
576
|
// );
|
|
568
577
|
var orderPaymentAddedUnsubscribe = core.effects.on(CheckoutHooks.OnOrderPaymentAdded, executeIfActive( /*#__PURE__*/function () {
|
|
569
578
|
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(data) {
|
|
570
|
-
var orderInfo, balanceDueAmount, autoCloseConfig, _paymentItems, _totalAmount, serviceChargeTotal, paymentMethodName, isCashPayment, _interaction$utils3, _interaction$utils3$p;
|
|
579
|
+
var orderInfo, balanceDueAmount, _state$bookingConfig, autoCloseConfig, _paymentItems, _totalAmount, serviceChargeTotal, isToastMode, paymentMethodName, isCashPayment, _interaction$utils3, _interaction$utils3$p;
|
|
571
580
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
572
581
|
while (1) switch (_context5.prev = _context5.next) {
|
|
573
582
|
case 0:
|
|
@@ -577,7 +586,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
577
586
|
updateOrderInfo === null || updateOrderInfo === void 0 || updateOrderInfo(orderInfo);
|
|
578
587
|
balanceDueAmount = checkoutModule.getBalanceDueAmount();
|
|
579
588
|
if (!(Number(balanceDueAmount) > 0)) {
|
|
580
|
-
_context5.next =
|
|
589
|
+
_context5.next = 16;
|
|
581
590
|
break;
|
|
582
591
|
}
|
|
583
592
|
autoCloseConfig = calculateAutoCloseConfig('partially_paid', false); // 获取订单总金额
|
|
@@ -607,9 +616,16 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
607
616
|
_totalAmount = _totalAmount.add(serviceChargeTotal);
|
|
608
617
|
}
|
|
609
618
|
console.log(_totalAmount, _paymentItems);
|
|
619
|
+
// 弹窗模式判断
|
|
620
|
+
isToastMode = (state === null || state === void 0 || (_state$bookingConfig = state.bookingConfig) === null || _state$bookingConfig === void 0 || (_state$bookingConfig = _state$bookingConfig.config) === null || _state$bookingConfig === void 0 || (_state$bookingConfig = _state$bookingConfig.payment_setting) === null || _state$bookingConfig === void 0 ? void 0 : _state$bookingConfig.payment_result_display_mode) !== 'modal';
|
|
621
|
+
if (!isToastMode) {
|
|
622
|
+
autoCloseConfig.autoClose = false;
|
|
623
|
+
autoCloseConfig.autoCloseDelay = 0;
|
|
624
|
+
autoCloseConfig.maskClosable = false;
|
|
625
|
+
}
|
|
610
626
|
|
|
611
627
|
// 根据支付状态展示不同的 toast
|
|
612
|
-
_context5.next =
|
|
628
|
+
_context5.next = 16;
|
|
613
629
|
return displayPaymentResultToast({
|
|
614
630
|
paymentStatus: 'partially_paid',
|
|
615
631
|
orderTotalAmount: _totalAmount.toNumber(),
|
|
@@ -627,7 +643,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
627
643
|
// 不自动关闭Modal,让两个弹窗独立管理
|
|
628
644
|
}
|
|
629
645
|
}));
|
|
630
|
-
case
|
|
646
|
+
case 16:
|
|
631
647
|
// 判断是否为现金支付
|
|
632
648
|
paymentMethodName = data.paymentMethodName || data.name || '';
|
|
633
649
|
isCashPayment = data.paymentMethodCode === 'CASHMANUAL' || /现金|現金/i.test(paymentMethodName) || /cash/i.test(paymentMethodName);
|
|
@@ -646,7 +662,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
646
662
|
}
|
|
647
663
|
});
|
|
648
664
|
}
|
|
649
|
-
case
|
|
665
|
+
case 19:
|
|
650
666
|
case "end":
|
|
651
667
|
return _context5.stop();
|
|
652
668
|
}
|
|
@@ -1047,38 +1063,42 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1047
1063
|
case 0:
|
|
1048
1064
|
console.log('handleButtonClick', key);
|
|
1049
1065
|
_context12.t0 = key;
|
|
1050
|
-
_context12.next = _context12.t0 === 'order-note' ? 4 : _context12.t0 === 'send-link' ? 6 : _context12.t0 === 'print-receipt' ?
|
|
1066
|
+
_context12.next = _context12.t0 === 'order-note' ? 4 : _context12.t0 === 'send-link' ? 6 : _context12.t0 === 'split-payment' ? 8 : _context12.t0 === 'print-receipt' ? 10 : _context12.t0 === 'manual-discount' ? 26 : _context12.t0 === 'save-pay-later' ? 40 : 42;
|
|
1051
1067
|
break;
|
|
1052
1068
|
case 4:
|
|
1053
1069
|
setNoteModalOpen(true);
|
|
1054
|
-
return _context12.abrupt("break",
|
|
1070
|
+
return _context12.abrupt("break", 42);
|
|
1055
1071
|
case 6:
|
|
1056
1072
|
setPaymentLinkModalOpen(true);
|
|
1057
|
-
return _context12.abrupt("break",
|
|
1073
|
+
return _context12.abrupt("break", 42);
|
|
1058
1074
|
case 8:
|
|
1059
|
-
|
|
1060
|
-
|
|
1075
|
+
// 唤醒分账支付键盘
|
|
1076
|
+
setShowSplitPaymentKeyboard(true);
|
|
1077
|
+
return _context12.abrupt("break", 42);
|
|
1061
1078
|
case 10:
|
|
1079
|
+
_context12.next = 12;
|
|
1080
|
+
return checkoutModule.isCurrentOrderSynced();
|
|
1081
|
+
case 12:
|
|
1062
1082
|
isSynced = _context12.sent;
|
|
1063
1083
|
if (isSynced) {
|
|
1064
|
-
_context12.next =
|
|
1084
|
+
_context12.next = 19;
|
|
1065
1085
|
break;
|
|
1066
1086
|
}
|
|
1067
|
-
_context12.next =
|
|
1087
|
+
_context12.next = 16;
|
|
1068
1088
|
return checkoutModule.manualSyncOrderAsync();
|
|
1069
|
-
case
|
|
1089
|
+
case 16:
|
|
1070
1090
|
data = _context12.sent;
|
|
1071
|
-
_context12.next =
|
|
1091
|
+
_context12.next = 23;
|
|
1072
1092
|
break;
|
|
1073
|
-
case 17:
|
|
1074
|
-
_context12.next = 19;
|
|
1075
|
-
return checkoutModule.getCurrentOrderId();
|
|
1076
1093
|
case 19:
|
|
1094
|
+
_context12.next = 21;
|
|
1095
|
+
return checkoutModule.getCurrentOrderId();
|
|
1096
|
+
case 21:
|
|
1077
1097
|
_orderId2 = _context12.sent;
|
|
1078
1098
|
data = {
|
|
1079
1099
|
orderId: _orderId2
|
|
1080
1100
|
};
|
|
1081
|
-
case
|
|
1101
|
+
case 23:
|
|
1082
1102
|
console.log('handleButtonClick_print-receipt_data>>>>', data);
|
|
1083
1103
|
// data.orderId 就是订单号,可以用来打印小票
|
|
1084
1104
|
if (data.orderId) {
|
|
@@ -1099,40 +1119,40 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1099
1119
|
console.error('handleButtonClick_print-receipt_error>>>>', error);
|
|
1100
1120
|
}
|
|
1101
1121
|
}
|
|
1102
|
-
return _context12.abrupt("break",
|
|
1103
|
-
case
|
|
1122
|
+
return _context12.abrupt("break", 42);
|
|
1123
|
+
case 26:
|
|
1104
1124
|
if (orderInfo !== null && orderInfo !== void 0 && orderInfo.totalAmount) {
|
|
1105
|
-
_context12.next =
|
|
1125
|
+
_context12.next = 29;
|
|
1106
1126
|
break;
|
|
1107
1127
|
}
|
|
1108
1128
|
Toast === null || Toast === void 0 || Toast.fail(locales.getText('pisell2.checkout.manual-discount.no-amount'));
|
|
1109
1129
|
return _context12.abrupt("return");
|
|
1110
|
-
case 27:
|
|
1111
|
-
_context12.next = 29;
|
|
1112
|
-
return checkoutModule.getCurrentOrderPaymentItemsAsync();
|
|
1113
1130
|
case 29:
|
|
1131
|
+
_context12.next = 31;
|
|
1132
|
+
return checkoutModule.getCurrentOrderPaymentItemsAsync();
|
|
1133
|
+
case 31:
|
|
1114
1134
|
_paymentItems2 = _context12.sent;
|
|
1115
1135
|
if (!(_paymentItems2 !== null && _paymentItems2 !== void 0 && _paymentItems2.length)) {
|
|
1116
|
-
_context12.next =
|
|
1136
|
+
_context12.next = 35;
|
|
1117
1137
|
break;
|
|
1118
1138
|
}
|
|
1119
1139
|
Toast === null || Toast === void 0 || Toast.fail(locales.getText('pisell2.checkout.manual-discount.has-payment-items'));
|
|
1120
1140
|
return _context12.abrupt("return");
|
|
1121
|
-
case
|
|
1141
|
+
case 35:
|
|
1122
1142
|
if (!(Number(customAmount) <= 0 && Number(orderInfo === null || orderInfo === void 0 ? void 0 : orderInfo.totalAmount) >= 0)) {
|
|
1123
|
-
_context12.next =
|
|
1143
|
+
_context12.next = 38;
|
|
1124
1144
|
break;
|
|
1125
1145
|
}
|
|
1126
1146
|
Toast === null || Toast === void 0 || Toast.fail(locales.getText('pisell2.checkout.manual-discount.no-amount'));
|
|
1127
1147
|
return _context12.abrupt("return");
|
|
1128
|
-
case 36:
|
|
1129
|
-
setShowPriceAdjustModal(true);
|
|
1130
|
-
return _context12.abrupt("break", 40);
|
|
1131
1148
|
case 38:
|
|
1149
|
+
setShowPriceAdjustModal(true);
|
|
1150
|
+
return _context12.abrupt("break", 42);
|
|
1151
|
+
case 40:
|
|
1132
1152
|
// 通过 ref 调用 SavePayLaterHandler 的处理方法
|
|
1133
1153
|
(_savePayLaterHandlerR = savePayLaterHandlerRef.current) === null || _savePayLaterHandlerR === void 0 || _savePayLaterHandlerR.handleSavePayLaterClick();
|
|
1134
|
-
return _context12.abrupt("break",
|
|
1135
|
-
case
|
|
1154
|
+
return _context12.abrupt("break", 42);
|
|
1155
|
+
case 42:
|
|
1136
1156
|
case "end":
|
|
1137
1157
|
return _context12.stop();
|
|
1138
1158
|
}
|
|
@@ -1247,8 +1267,12 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1247
1267
|
|
|
1248
1268
|
// 处理PaymentModal区域的点击事件
|
|
1249
1269
|
var handleModalClick = useCallback(function (event) {
|
|
1270
|
+
var _state$bookingConfig2;
|
|
1250
1271
|
// 关闭所有Toast
|
|
1251
|
-
|
|
1272
|
+
var isToastMode = (state === null || state === void 0 || (_state$bookingConfig2 = state.bookingConfig) === null || _state$bookingConfig2 === void 0 || (_state$bookingConfig2 = _state$bookingConfig2.config) === null || _state$bookingConfig2 === void 0 || (_state$bookingConfig2 = _state$bookingConfig2.payment_setting) === null || _state$bookingConfig2 === void 0 ? void 0 : _state$bookingConfig2.payment_result_display_mode) !== 'modal';
|
|
1273
|
+
if (isToastMode) {
|
|
1274
|
+
closeAllPaymentResultToasts();
|
|
1275
|
+
}
|
|
1252
1276
|
}, []);
|
|
1253
1277
|
return /*#__PURE__*/React.createElement("div", {
|
|
1254
1278
|
ref: checkoutRef,
|
|
@@ -1295,7 +1319,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1295
1319
|
}, showCashPayment && /*#__PURE__*/React.createElement("div", {
|
|
1296
1320
|
style: showCashPayment ? {
|
|
1297
1321
|
gridColumn: '1',
|
|
1298
|
-
gridRow: '1'
|
|
1322
|
+
gridRow: (paymentOptionList === null || paymentOptionList === void 0 ? void 0 : paymentOptionList.length) === 1 ? 'span 2' : '1'
|
|
1299
1323
|
} : {}
|
|
1300
1324
|
}, /*#__PURE__*/React.createElement(CashPaymentModule, {
|
|
1301
1325
|
disabled: isOrderFree,
|
|
@@ -1308,12 +1332,13 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1308
1332
|
customAmount: customAmount,
|
|
1309
1333
|
roundingFunction: roundingFunction,
|
|
1310
1334
|
balanceDueAmount: balanceDueAmount,
|
|
1311
|
-
balanceDueTotalAmount: balanceDueTotalAmount
|
|
1312
|
-
|
|
1335
|
+
balanceDueTotalAmount: balanceDueTotalAmount,
|
|
1336
|
+
shortcutsSize: (paymentOptionList === null || paymentOptionList === void 0 ? void 0 : paymentOptionList.length) === 3 || (paymentOptionList === null || paymentOptionList === void 0 ? void 0 : paymentOptionList.length) === 1 ? 'large' : 'default'
|
|
1337
|
+
})), moduleConfig.showPaymentOptions && (paymentOptionList === null || paymentOptionList === void 0 ? void 0 : paymentOptionList.length) > 0 && /*#__PURE__*/React.createElement("div", {
|
|
1313
1338
|
className: showCashPayment ? '' : 'payment-options-module-container',
|
|
1314
1339
|
style: showCashPayment ? {
|
|
1315
1340
|
gridColumn: '2',
|
|
1316
|
-
gridRow: '1 / 3'
|
|
1341
|
+
gridRow: (paymentOptionList === null || paymentOptionList === void 0 ? void 0 : paymentOptionList.length) > 3 ? '1 / 3' : '1'
|
|
1317
1342
|
} : {}
|
|
1318
1343
|
}, /*#__PURE__*/React.createElement(PaymentOptionsModule, {
|
|
1319
1344
|
amountSymbol: state.amountSymbol,
|
|
@@ -1327,8 +1352,8 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1327
1352
|
})), moduleConfig.showAdditionalModule && /*#__PURE__*/React.createElement("div", {
|
|
1328
1353
|
className: showCashPayment ? '' : 'additional-module-container',
|
|
1329
1354
|
style: showCashPayment ? {
|
|
1330
|
-
gridColumn: '1',
|
|
1331
|
-
gridRow: '2'
|
|
1355
|
+
gridColumn: (paymentOptionList === null || paymentOptionList === void 0 ? void 0 : paymentOptionList.length) > 3 ? '1' : (paymentOptionList === null || paymentOptionList === void 0 ? void 0 : paymentOptionList.length) <= 1 ? '2' : 'span 2',
|
|
1356
|
+
gridRow: (paymentOptionList === null || paymentOptionList === void 0 ? void 0 : paymentOptionList.length) === 0 ? '1' : '2'
|
|
1332
1357
|
} : {}
|
|
1333
1358
|
}, /*#__PURE__*/React.createElement(AdditionalModule, {
|
|
1334
1359
|
orderInfo: orderInfo || undefined,
|
|
@@ -1336,7 +1361,9 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1336
1361
|
handleButtonClick: handleButtonClick,
|
|
1337
1362
|
hasOrderNote: !!orderNote && orderNote.trim().length > 0,
|
|
1338
1363
|
disabled: isOrderFree,
|
|
1339
|
-
showCashPayment: showCashPayment
|
|
1364
|
+
showCashPayment: showCashPayment,
|
|
1365
|
+
isFullWidth: !((paymentOptionList === null || paymentOptionList === void 0 ? void 0 : paymentOptionList.length) > 3 || (paymentOptionList === null || paymentOptionList === void 0 ? void 0 : paymentOptionList.length) <= 1),
|
|
1366
|
+
showMore: !(showCashPayment && (paymentOptionList === null || paymentOptionList === void 0 ? void 0 : paymentOptionList.length) === 0)
|
|
1340
1367
|
}))), /*#__PURE__*/React.createElement(PaymentMethods, {
|
|
1341
1368
|
ref: paymentMethodsRef,
|
|
1342
1369
|
dynamicMaxHeight: dynamicMaxHeight,
|
|
@@ -1358,6 +1385,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1358
1385
|
return setShowPriceAdjustModal(false);
|
|
1359
1386
|
}
|
|
1360
1387
|
},
|
|
1388
|
+
tips: locales.getText('pisell2.checkout.modal.price-adjustment-tips') || 'Changing amount will update order total',
|
|
1361
1389
|
selectType: "dark",
|
|
1362
1390
|
originalValue: currentTotalPrice,
|
|
1363
1391
|
defaultValue: currentTotalPriceAfterDiscount,
|
|
@@ -1368,6 +1396,40 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1368
1396
|
amountSymbol: state.amountSymbol,
|
|
1369
1397
|
walletPassData: walletPassData,
|
|
1370
1398
|
onSavePayLater: handleSavePayLater
|
|
1399
|
+
}), /*#__PURE__*/React.createElement(PaymentKeyboard, {
|
|
1400
|
+
containerProps: {
|
|
1401
|
+
renderType: 'modal',
|
|
1402
|
+
open: showSplitPaymentKeyboard,
|
|
1403
|
+
onCancel: function onCancel() {
|
|
1404
|
+
return setShowSplitPaymentKeyboard(false);
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1407
|
+
// 原始值:此支付阶段的待支付金额,reset时还原为此值
|
|
1408
|
+
,
|
|
1409
|
+
paymentOriginalValue: balanceDueAmount,
|
|
1410
|
+
paymentDefaultValue: String(customAmount || 0),
|
|
1411
|
+
enableExceedMaxAmount: false,
|
|
1412
|
+
payment: {
|
|
1413
|
+
enable: true
|
|
1414
|
+
},
|
|
1415
|
+
surcharge: {
|
|
1416
|
+
enable: false
|
|
1417
|
+
},
|
|
1418
|
+
surchargeDefaultValue: {
|
|
1419
|
+
percent: '0',
|
|
1420
|
+
fixed: '0'
|
|
1421
|
+
},
|
|
1422
|
+
selectType: "light",
|
|
1423
|
+
onChange: function onChange(value) {
|
|
1424
|
+
console.log(value);
|
|
1425
|
+
},
|
|
1426
|
+
doneText: locales.getText('confirm') || '确认',
|
|
1427
|
+
onPay: function onPay(args) {
|
|
1428
|
+
console.log(args);
|
|
1429
|
+
// 处理支付逻辑
|
|
1430
|
+
setShowSplitPaymentKeyboard(false);
|
|
1431
|
+
handleAmountChange(String(args.amount));
|
|
1432
|
+
}
|
|
1371
1433
|
}));
|
|
1372
1434
|
});
|
|
1373
1435
|
|
|
@@ -1390,34 +1452,34 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
1390
1452
|
getData = _ref19.getData,
|
|
1391
1453
|
interaction = _ref19.interaction,
|
|
1392
1454
|
isWebPos = _ref19.isWebPos;
|
|
1393
|
-
var
|
|
1394
|
-
_useState26 = _slicedToArray(_useState25, 2),
|
|
1395
|
-
orderInfo = _useState26[0],
|
|
1396
|
-
setOrderInfo = _useState26[1];
|
|
1397
|
-
var _useState27 = useState(0),
|
|
1455
|
+
var _useState27 = useState(null),
|
|
1398
1456
|
_useState28 = _slicedToArray(_useState27, 2),
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
var _useState29 = useState(
|
|
1457
|
+
orderInfo = _useState28[0],
|
|
1458
|
+
setOrderInfo = _useState28[1];
|
|
1459
|
+
var _useState29 = useState(0),
|
|
1402
1460
|
_useState30 = _slicedToArray(_useState29, 2),
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
var _useState31 = useState(
|
|
1461
|
+
totalAmount = _useState30[0],
|
|
1462
|
+
setTotalAmount = _useState30[1];
|
|
1463
|
+
var _useState31 = useState(true),
|
|
1406
1464
|
_useState32 = _slicedToArray(_useState31, 2),
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
var _useState33 = useState(
|
|
1465
|
+
actualShowCashPayment = _useState32[0],
|
|
1466
|
+
setActualShowCashPayment = _useState32[1];
|
|
1467
|
+
var _useState33 = useState(0),
|
|
1410
1468
|
_useState34 = _slicedToArray(_useState33, 2),
|
|
1411
|
-
|
|
1412
|
-
|
|
1469
|
+
windowHeight = _useState34[0],
|
|
1470
|
+
setWindowHeight = _useState34[1];
|
|
1413
1471
|
var _useState35 = useState(false),
|
|
1414
1472
|
_useState36 = _slicedToArray(_useState35, 2),
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
var _useState37 = useState(
|
|
1473
|
+
showRetryModal = _useState36[0],
|
|
1474
|
+
setShowRetryModal = _useState36[1];
|
|
1475
|
+
var _useState37 = useState(false),
|
|
1418
1476
|
_useState38 = _slicedToArray(_useState37, 2),
|
|
1419
|
-
|
|
1420
|
-
|
|
1477
|
+
showCreateErrorModal = _useState38[0],
|
|
1478
|
+
setShowCreateErrorModal = _useState38[1];
|
|
1479
|
+
var _useState39 = useState(editOrderId || 0),
|
|
1480
|
+
_useState40 = _slicedToArray(_useState39, 2),
|
|
1481
|
+
currentEditOrderId = _useState40[0],
|
|
1482
|
+
_setCurrentEditOrderId = _useState40[1];
|
|
1421
1483
|
var _useActiveExecute2 = useActiveExecute(),
|
|
1422
1484
|
executeIfActive = _useActiveExecute2.executeIfActive;
|
|
1423
1485
|
var Toast = useToast();
|
|
@@ -1552,18 +1614,18 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
1552
1614
|
}, []);
|
|
1553
1615
|
|
|
1554
1616
|
// 订单备注相关状态
|
|
1555
|
-
var
|
|
1556
|
-
_useState40 = _slicedToArray(_useState39, 2),
|
|
1557
|
-
noteModalOpen = _useState40[0],
|
|
1558
|
-
setNoteModalOpen = _useState40[1];
|
|
1559
|
-
var _useState41 = useState(''),
|
|
1617
|
+
var _useState41 = useState(false),
|
|
1560
1618
|
_useState42 = _slicedToArray(_useState41, 2),
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
var _useState43 = useState('
|
|
1619
|
+
noteModalOpen = _useState42[0],
|
|
1620
|
+
setNoteModalOpen = _useState42[1];
|
|
1621
|
+
var _useState43 = useState(''),
|
|
1564
1622
|
_useState44 = _slicedToArray(_useState43, 2),
|
|
1565
|
-
|
|
1566
|
-
|
|
1623
|
+
orderNote = _useState44[0],
|
|
1624
|
+
setOrderNote = _useState44[1];
|
|
1625
|
+
var _useState45 = useState('payment-content'),
|
|
1626
|
+
_useState46 = _slicedToArray(_useState45, 2),
|
|
1627
|
+
noteModalSource = _useState46[0],
|
|
1628
|
+
setNoteModalSource = _useState46[1];
|
|
1567
1629
|
|
|
1568
1630
|
// 订单备注相关处理函数
|
|
1569
1631
|
var handleNoteConfirm = /*#__PURE__*/function () {
|
|
@@ -2097,7 +2159,7 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
2097
2159
|
unsubscribeRef.current = checkout.core.effects.on('checkout:onOrderSynced', executeIfActive( /*#__PURE__*/function () {
|
|
2098
2160
|
var _ref29 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22(data) {
|
|
2099
2161
|
var _data$response, _responseData$payment2;
|
|
2100
|
-
var currentOrderId, responseData, paymentStatus, orderTotalAmount, gapAmount, currentChangeGivenAmount, failureReason, _responseData$payment3, params, statusClassName, autoCloseConfig, enabledAutoPrint, _interaction$utils6, _interaction$utils6$a, _orderInfo3, paymentResult;
|
|
2162
|
+
var currentOrderId, responseData, paymentStatus, orderTotalAmount, gapAmount, currentChangeGivenAmount, failureReason, _state$bookingConfig3, _responseData$payment3, params, statusClassName, autoCloseConfig, enabledAutoPrint, _interaction$utils6, _interaction$utils6$a, _orderInfo3, isToastMode, paymentResult;
|
|
2101
2163
|
return _regeneratorRuntime().wrap(function _callee22$(_context22) {
|
|
2102
2164
|
while (1) switch (_context22.prev = _context22.next) {
|
|
2103
2165
|
case 0:
|
|
@@ -2128,7 +2190,7 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
2128
2190
|
// 获取失败原因
|
|
2129
2191
|
failureReason = responseData === null || responseData === void 0 ? void 0 : responseData.failure_reason; // 根据支付状态弹出对应的支付结果toast
|
|
2130
2192
|
if (!paymentStatus) {
|
|
2131
|
-
_context22.next =
|
|
2193
|
+
_context22.next = 37;
|
|
2132
2194
|
break;
|
|
2133
2195
|
}
|
|
2134
2196
|
// 打印订单完整信息
|
|
@@ -2200,8 +2262,16 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
2200
2262
|
case 26:
|
|
2201
2263
|
enabledAutoPrint = _context22.sent;
|
|
2202
2264
|
case 27:
|
|
2203
|
-
_orderInfo3 = checkout.getCurrentOrderInfo(); //
|
|
2204
|
-
|
|
2265
|
+
_orderInfo3 = checkout.getCurrentOrderInfo(); // 弹窗模式判断
|
|
2266
|
+
isToastMode = (state === null || state === void 0 || (_state$bookingConfig3 = state.bookingConfig) === null || _state$bookingConfig3 === void 0 || (_state$bookingConfig3 = _state$bookingConfig3.config) === null || _state$bookingConfig3 === void 0 || (_state$bookingConfig3 = _state$bookingConfig3.payment_setting) === null || _state$bookingConfig3 === void 0 ? void 0 : _state$bookingConfig3.payment_result_display_mode) !== 'modal';
|
|
2267
|
+
if (!isToastMode) {
|
|
2268
|
+
autoCloseConfig.autoClose = false;
|
|
2269
|
+
autoCloseConfig.autoCloseDelay = 0;
|
|
2270
|
+
autoCloseConfig.maskClosable = false;
|
|
2271
|
+
}
|
|
2272
|
+
|
|
2273
|
+
// 根据支付状态展示不同的 toast
|
|
2274
|
+
_context22.next = 32;
|
|
2205
2275
|
return displayPaymentResultToast({
|
|
2206
2276
|
paymentStatus: paymentStatus,
|
|
2207
2277
|
orderTotalAmount: _orderInfo3.isDeposit ? _orderInfo3.depositAmount : orderTotalAmount,
|
|
@@ -2210,7 +2280,7 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
2210
2280
|
autoCloseConfig: autoCloseConfig,
|
|
2211
2281
|
actionButtons: generateActionButtons(paymentStatus, enabledAutoPrint)
|
|
2212
2282
|
}, paymentResultToastConfig);
|
|
2213
|
-
case
|
|
2283
|
+
case 32:
|
|
2214
2284
|
// 当支付状态为 paid 时,关闭 paymentModal
|
|
2215
2285
|
if (paymentStatus === 'paid') {
|
|
2216
2286
|
handleModalClose();
|
|
@@ -2226,11 +2296,11 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
2226
2296
|
}
|
|
2227
2297
|
});
|
|
2228
2298
|
handlePaymentComplete(paymentResult);
|
|
2229
|
-
_context22.next =
|
|
2299
|
+
_context22.next = 38;
|
|
2230
2300
|
break;
|
|
2231
|
-
case
|
|
2301
|
+
case 37:
|
|
2232
2302
|
handlePaymentComplete(data);
|
|
2233
|
-
case
|
|
2303
|
+
case 38:
|
|
2234
2304
|
case "end":
|
|
2235
2305
|
return _context22.stop();
|
|
2236
2306
|
}
|
|
@@ -8,6 +8,8 @@ interface AdditionalModuleProps {
|
|
|
8
8
|
hasOrderNote?: boolean;
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
showCashPayment?: boolean;
|
|
11
|
+
isFullWidth?: boolean;
|
|
12
|
+
showMore?: boolean;
|
|
11
13
|
}
|
|
12
|
-
declare function AdditionalModule({ orderInfo, customAmount, handleButtonClick, hasOrderNote, disabled, showCashPayment, }: AdditionalModuleProps): JSX.Element;
|
|
14
|
+
declare function AdditionalModule({ orderInfo, customAmount, handleButtonClick, hasOrderNote, disabled, showCashPayment, isFullWidth, showMore }: AdditionalModuleProps): JSX.Element;
|
|
13
15
|
export default AdditionalModule;
|