@pisell/private-materials 6.8.64 → 6.8.65
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 +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/businessModel/SalesModel/index.d.ts +1 -0
- package/es/components/Sales/Summary/utils.d.ts +1 -1
- package/es/components/appointmentBooking/components/Cart/Item/Total.d.ts +0 -1
- package/es/components/appointmentBooking/components/Cart/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Deposit/index.d.ts +0 -1
- 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/appointmentBooking/deposit/components/PolicyModal/index.d.ts +0 -1
- package/es/components/booking/addons/model.d.ts +1 -10
- package/es/components/booking/deposit/index.d.ts +1 -0
- package/es/components/booking/forms/footer.d.ts +0 -1
- package/es/components/booking/forms/model.d.ts +1 -10
- package/es/components/booking/forms/sendModal/useSendModal.d.ts +0 -1
- package/es/components/booking/hooks/useClearCart.d.ts +0 -1
- package/es/components/booking/info/addServiceVariant/index.d.ts +1 -0
- package/es/components/booking/info/dateRange/index.d.ts +0 -1
- package/es/components/booking/info/header/index.d.ts +1 -0
- package/es/components/booking/info/hooks/useInfoHolder.d.ts +1 -0
- package/es/components/booking/info/index.d.ts +1 -0
- package/es/components/booking/info/model.d.ts +1 -10
- package/es/components/booking/info/notes/index.d.ts +1 -0
- package/es/components/booking/info/service/Lists.d.ts +1 -0
- package/es/components/booking/info/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info/service/serviceList/index.d.ts +1 -0
- package/es/components/booking/info/service2/Lists.d.ts +1 -0
- package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info2/service/editService/index.js +1 -1
- package/es/components/booking/info2/service/serviceList/index.d.ts +1 -0
- package/es/components/booking/model.d.ts +1 -9
- package/es/components/booking/notes/NoteBlock/index.d.ts +1 -0
- package/es/components/booking/notes/addNote/index.d.ts +1 -0
- package/es/components/booking/notes/model.d.ts +1 -10
- package/es/components/booking/payments/model.d.ts +1 -10
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/checkout/PaymentModal.js +187 -116
- package/es/components/checkout/hooks/useWalletPass.d.ts +1 -1
- package/es/components/eftpos/surcharge/index.d.ts +1 -0
- package/es/components/eftposPay/component/fail/failCustom.d.ts +0 -1
- package/es/components/eftposPay/component/fail/unknow.d.ts +0 -1
- package/es/components/eftposPay/hooks.d.ts +2 -2
- package/es/components/eftposPay/pay.d.ts +0 -1
- package/es/components/eftposPay/store/index.d.ts +5 -5
- 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/Cart/Item/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Cart/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Event/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Footer/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Information/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Resource/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/bookingDetailModal/components/BookingOptions.d.ts +0 -1
- package/es/components/eventBooking/components/scheduleCalendar/components/ScheduleTimeItem/index.d.ts +0 -1
- package/es/components/pay/toB/components/CardGroup/index.d.ts +1 -0
- package/es/components/pay/toB/components/Content/Header.d.ts +1 -0
- package/es/components/pay/toB/types/index.d.ts +1 -1
- package/es/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/ThreedsLoading/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/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/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +0 -1
- package/es/components/pisellSelectCustomerModal/RightPanel/index.d.ts +1 -0
- package/es/components/productExtension/index.d.ts +1 -0
- package/es/components/productSelect/components/productGroup/index.d.ts +1 -0
- package/es/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +1 -0
- package/es/components/schedules/model.d.ts +1 -9
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +1 -0
- package/es/components/shoppingCart/hooks/useAddService.d.ts +0 -1
- package/es/components/shoppingCart/hooks/useClearCart.d.ts +0 -1
- package/es/components/taxSelect/index.d.ts +1 -0
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +1 -1
- package/es/components/workSpaceList/components/Modal/index.d.ts +0 -1
- package/es/plus/clinetSearch/Add/BirthdayField/index.d.ts +1 -0
- package/es/plus/clinetSearch/Add/GenderField/index.d.ts +1 -0
- package/es/plus/clinetSearch/Add/PhoneField/index.d.ts +1 -0
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardA1/index.d.ts +1 -0
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardA2/index.d.ts +1 -0
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardA5/index.d.ts +1 -0
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardA9/index.d.ts +1 -0
- package/es/plus/productSelect/ProductCard/SkuCard/SkuCardCustom/index.d.ts +1 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/CardCom/index.d.ts +1 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Cover/index.d.ts +1 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/SubTitle/index.d.ts +1 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/Title/index.d.ts +1 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/TooltipTags/index.d.ts +1 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/WarningLists/index.d.ts +1 -0
- package/es/plus/productSelect/ProductCard/SkuCard/index.d.ts +1 -0
- package/es/plus/saasCreateOrganization/index.d.ts +1 -0
- package/es/plus/saasRegister/components/VertifyEmail.d.ts +0 -1
- package/es/plus/selectHolder/components/ErrorTip/index.d.ts +0 -1
- package/es/plus/skuOptionsSelection/components/NormalCard/index.d.ts +1 -0
- package/es/plus/skuOptionsSelection/components/OptionsCard/index.d.ts +0 -1
- package/es/plus/walletPassGallery/components/passList/index.d.ts +0 -1
- package/es/plus/walletPassGallery/components/timelineSection/index.d.ts +0 -1
- package/es/pro/Selector/demo.d.ts +1 -0
- package/es/pro/pisellPaymentList/example.d.ts +0 -1
- package/es/pro/priceKeyboard/components/cashKeyboard/index.d.ts +1 -0
- package/lib/businessModel/SalesModel/index.d.ts +1 -0
- package/lib/components/Sales/Summary/utils.d.ts +1 -1
- package/lib/components/appointmentBooking/components/Cart/Item/Total.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Cart/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Deposit/index.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/appointmentBooking/deposit/components/PolicyModal/index.d.ts +0 -1
- package/lib/components/booking/addons/model.d.ts +1 -10
- package/lib/components/booking/deposit/index.d.ts +1 -0
- package/lib/components/booking/forms/footer.d.ts +0 -1
- package/lib/components/booking/forms/model.d.ts +1 -10
- package/lib/components/booking/forms/sendModal/useSendModal.d.ts +0 -1
- package/lib/components/booking/hooks/useClearCart.d.ts +0 -1
- package/lib/components/booking/info/addServiceVariant/index.d.ts +1 -0
- package/lib/components/booking/info/dateRange/index.d.ts +0 -1
- package/lib/components/booking/info/header/index.d.ts +1 -0
- package/lib/components/booking/info/hooks/useInfoHolder.d.ts +1 -0
- package/lib/components/booking/info/index.d.ts +1 -0
- package/lib/components/booking/info/model.d.ts +1 -10
- package/lib/components/booking/info/notes/index.d.ts +1 -0
- package/lib/components/booking/info/service/Lists.d.ts +1 -0
- package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info/service/serviceList/index.d.ts +1 -0
- package/lib/components/booking/info/service2/Lists.d.ts +1 -0
- package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info2/service/editService/index.js +1 -1
- package/lib/components/booking/info2/service/serviceList/index.d.ts +1 -0
- package/lib/components/booking/model.d.ts +1 -9
- package/lib/components/booking/notes/NoteBlock/index.d.ts +1 -0
- package/lib/components/booking/notes/addNote/index.d.ts +1 -0
- package/lib/components/booking/notes/model.d.ts +1 -10
- package/lib/components/booking/payments/model.d.ts +1 -10
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/checkout/PaymentModal.js +60 -8
- package/lib/components/checkout/hooks/useWalletPass.d.ts +1 -1
- package/lib/components/eftpos/surcharge/index.d.ts +1 -0
- package/lib/components/eftposPay/component/fail/failCustom.d.ts +0 -1
- package/lib/components/eftposPay/component/fail/unknow.d.ts +0 -1
- package/lib/components/eftposPay/hooks.d.ts +2 -2
- package/lib/components/eftposPay/pay.d.ts +0 -1
- package/lib/components/eftposPay/store/index.d.ts +5 -5
- 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/Cart/Item/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Cart/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Event/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Footer/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Information/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Resource/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/bookingDetailModal/components/BookingOptions.d.ts +0 -1
- package/lib/components/eventBooking/components/scheduleCalendar/components/ScheduleTimeItem/index.d.ts +0 -1
- package/lib/components/pay/toB/components/CardGroup/index.d.ts +1 -0
- package/lib/components/pay/toB/components/Content/Header.d.ts +1 -0
- package/lib/components/pay/toB/types/index.d.ts +1 -1
- package/lib/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/ThreedsLoading/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/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/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +0 -1
- package/lib/components/pisellSelectCustomerModal/RightPanel/index.d.ts +1 -0
- package/lib/components/productExtension/index.d.ts +1 -0
- package/lib/components/productSelect/components/productGroup/index.d.ts +1 -0
- package/lib/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +1 -0
- package/lib/components/schedules/model.d.ts +1 -9
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +1 -0
- package/lib/components/shoppingCart/hooks/useAddService.d.ts +0 -1
- package/lib/components/shoppingCart/hooks/useClearCart.d.ts +0 -1
- package/lib/components/taxSelect/index.d.ts +1 -0
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +1 -1
- package/lib/components/workSpaceList/components/Modal/index.d.ts +0 -1
- package/lib/plus/clinetSearch/Add/BirthdayField/index.d.ts +1 -0
- package/lib/plus/clinetSearch/Add/GenderField/index.d.ts +1 -0
- package/lib/plus/clinetSearch/Add/PhoneField/index.d.ts +1 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardA1/index.d.ts +1 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardA2/index.d.ts +1 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardA5/index.d.ts +1 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardA9/index.d.ts +1 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardCustom/index.d.ts +1 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/CardCom/index.d.ts +1 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Cover/index.d.ts +1 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/SubTitle/index.d.ts +1 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/Title/index.d.ts +1 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/TooltipTags/index.d.ts +1 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/WarningLists/index.d.ts +1 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/index.d.ts +1 -0
- package/lib/plus/saasCreateOrganization/index.d.ts +1 -0
- package/lib/plus/saasRegister/components/VertifyEmail.d.ts +0 -1
- package/lib/plus/selectHolder/components/ErrorTip/index.d.ts +0 -1
- package/lib/plus/skuOptionsSelection/components/NormalCard/index.d.ts +1 -0
- package/lib/plus/skuOptionsSelection/components/OptionsCard/index.d.ts +0 -1
- package/lib/plus/walletPassGallery/components/passList/index.d.ts +0 -1
- package/lib/plus/walletPassGallery/components/timelineSection/index.d.ts +0 -1
- package/lib/pro/Selector/demo.d.ts +1 -0
- package/lib/pro/pisellPaymentList/example.d.ts +0 -1
- package/lib/pro/priceKeyboard/components/cashKeyboard/index.d.ts +1 -0
- package/package.json +3 -3
|
@@ -277,7 +277,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
277
277
|
var onPaymentOptionClick = /*#__PURE__*/function () {
|
|
278
278
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(method) {
|
|
279
279
|
var _method$totalAmount;
|
|
280
|
-
var _ref4, id, code, name, type, finalAmount, eftposCodes, mx51Code, payType, _paymentMethodsRef$cu, data, isSynced, _Toast$loading,
|
|
280
|
+
var _ref4, id, code, name, type, finalAmount, eftposCodes, mx51Code, payType, _paymentMethodsRef$cu, _orderId, _paymentMethodsRef$cu2, data, isSynced, _Toast$loading, _orderId2, _method$metadata, service_charge, _interaction$utils2, _interaction$utils2$p;
|
|
281
281
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
282
282
|
while (1) switch (_context2.prev = _context2.next) {
|
|
283
283
|
case 0:
|
|
@@ -294,38 +294,107 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
294
294
|
payType = '';
|
|
295
295
|
if (eftposCodes.includes((method === null || method === void 0 ? void 0 : method.code) || '')) {
|
|
296
296
|
payType = 'eftpos';
|
|
297
|
-
} else if ((method === null || method === void 0 ? void 0 : method.code) === mx51Code) {
|
|
298
|
-
payType = 'mx51';
|
|
299
297
|
}
|
|
300
|
-
if (
|
|
301
|
-
|
|
298
|
+
// } else if (method?.code === mx51Code) {
|
|
299
|
+
// payType = 'mx51';
|
|
300
|
+
// }
|
|
301
|
+
if (!((method === null || method === void 0 ? void 0 : method.code) === 'mx51Code')) {
|
|
302
|
+
_context2.next = 14;
|
|
302
303
|
break;
|
|
303
304
|
}
|
|
304
305
|
_context2.next = 11;
|
|
305
|
-
return checkoutModule.
|
|
306
|
+
return checkoutModule.getCurrentOrderId();
|
|
306
307
|
case 11:
|
|
308
|
+
_orderId = _context2.sent;
|
|
309
|
+
(_paymentMethodsRef$cu = paymentMethodsRef.current) === null || _paymentMethodsRef$cu === void 0 || _paymentMethodsRef$cu.onPay(payType, {
|
|
310
|
+
source: 'normal',
|
|
311
|
+
data: {
|
|
312
|
+
payMethod: {
|
|
313
|
+
id: id,
|
|
314
|
+
code: code,
|
|
315
|
+
name: name,
|
|
316
|
+
type: type
|
|
317
|
+
},
|
|
318
|
+
params: {
|
|
319
|
+
orderId: _orderId,
|
|
320
|
+
symbol: getData('shop_symbol'),
|
|
321
|
+
amount: finalAmount,
|
|
322
|
+
surcharge: processSurcharge(method.surcharge)
|
|
323
|
+
},
|
|
324
|
+
mode: 'pay'
|
|
325
|
+
},
|
|
326
|
+
callback: function callback(_ref5) {
|
|
327
|
+
var status = _ref5.status,
|
|
328
|
+
data = _ref5.data,
|
|
329
|
+
msg = _ref5.msg;
|
|
330
|
+
console.log('eftpos_pay_result>>>>>>', status, data, msg);
|
|
331
|
+
if (status === 'success') {
|
|
332
|
+
var payResultParams = {
|
|
333
|
+
amount: Number(data === null || data === void 0 ? void 0 : data.amount),
|
|
334
|
+
// 支付金额
|
|
335
|
+
code: code,
|
|
336
|
+
// 支付类型code
|
|
337
|
+
custom_payment_id: id,
|
|
338
|
+
// 支付类型id
|
|
339
|
+
name: name,
|
|
340
|
+
// 支付类型name
|
|
341
|
+
type: type,
|
|
342
|
+
// 支付类型type
|
|
343
|
+
voucher_id: '',
|
|
344
|
+
service_charge: {},
|
|
345
|
+
metadata: {
|
|
346
|
+
unique_payment_number: data === null || data === void 0 ? void 0 : data.uniquePaymentNumber
|
|
347
|
+
}
|
|
348
|
+
};
|
|
349
|
+
if (payType === 'mx51') {
|
|
350
|
+
// 如果支付服务费跟传入的手续费不一致,则以MX51的支付服务费为准
|
|
351
|
+
if (Number((data === null || data === void 0 ? void 0 : data.surcharge) || 0) !== Number((method === null || method === void 0 ? void 0 : method.surcharge) || 0)) {
|
|
352
|
+
payResultParams.service_charge = {
|
|
353
|
+
amount: (data === null || data === void 0 ? void 0 : data.surcharge) || '0',
|
|
354
|
+
percentage: '0'
|
|
355
|
+
};
|
|
356
|
+
} else {
|
|
357
|
+
payResultParams.service_charge = {
|
|
358
|
+
amount: (method === null || method === void 0 ? void 0 : method.fixed) || '0',
|
|
359
|
+
percentage: (method === null || method === void 0 ? void 0 : method.percentage) || '0'
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
checkoutModule === null || checkoutModule === void 0 || checkoutModule.addPaymentItemAsync(payResultParams);
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
});
|
|
367
|
+
return _context2.abrupt("return");
|
|
368
|
+
case 14:
|
|
369
|
+
if (!payType) {
|
|
370
|
+
_context2.next = 32;
|
|
371
|
+
break;
|
|
372
|
+
}
|
|
373
|
+
_context2.next = 17;
|
|
374
|
+
return checkoutModule.isCurrentOrderSynced();
|
|
375
|
+
case 17:
|
|
307
376
|
isSynced = _context2.sent;
|
|
308
377
|
if (isSynced) {
|
|
309
|
-
_context2.next =
|
|
378
|
+
_context2.next = 25;
|
|
310
379
|
break;
|
|
311
380
|
}
|
|
312
381
|
Toast === null || Toast === void 0 || (_Toast$loading = Toast.loading) === null || _Toast$loading === void 0 || _Toast$loading.call(Toast, '', 0);
|
|
313
|
-
_context2.next =
|
|
382
|
+
_context2.next = 22;
|
|
314
383
|
return checkoutModule.manualSyncOrderAsync();
|
|
315
|
-
case
|
|
384
|
+
case 22:
|
|
316
385
|
data = _context2.sent;
|
|
317
|
-
_context2.next =
|
|
386
|
+
_context2.next = 29;
|
|
318
387
|
break;
|
|
319
|
-
case
|
|
320
|
-
_context2.next =
|
|
388
|
+
case 25:
|
|
389
|
+
_context2.next = 27;
|
|
321
390
|
return checkoutModule.getCurrentOrderId();
|
|
322
|
-
case
|
|
323
|
-
|
|
391
|
+
case 27:
|
|
392
|
+
_orderId2 = _context2.sent;
|
|
324
393
|
data = {
|
|
325
|
-
orderId:
|
|
394
|
+
orderId: _orderId2
|
|
326
395
|
};
|
|
327
|
-
case
|
|
328
|
-
(_paymentMethodsRef$
|
|
396
|
+
case 29:
|
|
397
|
+
(_paymentMethodsRef$cu2 = paymentMethodsRef.current) === null || _paymentMethodsRef$cu2 === void 0 || _paymentMethodsRef$cu2.onPay(payType, {
|
|
329
398
|
source: 'normal',
|
|
330
399
|
data: {
|
|
331
400
|
payMethod: {
|
|
@@ -342,10 +411,10 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
342
411
|
},
|
|
343
412
|
mode: 'pay'
|
|
344
413
|
},
|
|
345
|
-
callback: function callback(
|
|
346
|
-
var status =
|
|
347
|
-
data =
|
|
348
|
-
msg =
|
|
414
|
+
callback: function callback(_ref6) {
|
|
415
|
+
var status = _ref6.status,
|
|
416
|
+
data = _ref6.data,
|
|
417
|
+
msg = _ref6.msg;
|
|
349
418
|
console.log('eftpos_pay_result>>>>>>', status, data, msg);
|
|
350
419
|
if (status === 'success') {
|
|
351
420
|
var payResultParams = {
|
|
@@ -388,9 +457,9 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
388
457
|
}
|
|
389
458
|
}
|
|
390
459
|
});
|
|
391
|
-
_context2.next =
|
|
460
|
+
_context2.next = 37;
|
|
392
461
|
break;
|
|
393
|
-
case
|
|
462
|
+
case 32:
|
|
394
463
|
service_charge = null;
|
|
395
464
|
if (method !== null && method !== void 0 && method.fixed || method !== null && method !== void 0 && method.percentage) {
|
|
396
465
|
service_charge = {
|
|
@@ -415,7 +484,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
415
484
|
});
|
|
416
485
|
}
|
|
417
486
|
// 从支付方式列表中查找现金支付方式
|
|
418
|
-
_context2.next =
|
|
487
|
+
_context2.next = 37;
|
|
419
488
|
return checkoutModule === null || checkoutModule === void 0 ? void 0 : checkoutModule.addPaymentItemAsync({
|
|
420
489
|
amount: finalAmount,
|
|
421
490
|
/** 支付类型,跟支付列表上对应的支付方式保持一致 */
|
|
@@ -431,7 +500,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
431
500
|
/** 支付手续费 */
|
|
432
501
|
service_charge: service_charge
|
|
433
502
|
});
|
|
434
|
-
case
|
|
503
|
+
case 37:
|
|
435
504
|
case "end":
|
|
436
505
|
return _context2.stop();
|
|
437
506
|
}
|
|
@@ -469,7 +538,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
469
538
|
}
|
|
470
539
|
if (checkoutModule && isModalOpen) {
|
|
471
540
|
checkoutModule.getPaymentMethodsAsync().then( /*#__PURE__*/function () {
|
|
472
|
-
var
|
|
541
|
+
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(paymentMethods) {
|
|
473
542
|
var reorderedPaymentMethods, isShowCashPayment;
|
|
474
543
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
475
544
|
while (1) switch (_context3.prev = _context3.next) {
|
|
@@ -495,7 +564,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
495
564
|
}, _callee3);
|
|
496
565
|
}));
|
|
497
566
|
return function (_x3) {
|
|
498
|
-
return
|
|
567
|
+
return _ref7.apply(this, arguments);
|
|
499
568
|
};
|
|
500
569
|
}());
|
|
501
570
|
checkoutModule.getCurrentOrderPaymentItemsAsync().then(function (items) {
|
|
@@ -522,7 +591,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
522
591
|
var core = checkoutModule.core;
|
|
523
592
|
if (core.effects && typeof core.effects.on === 'function') {
|
|
524
593
|
var unsubscribe = core.effects.on(CheckoutHooks.OnStateAmountChanged, executeIfActive( /*#__PURE__*/function () {
|
|
525
|
-
var
|
|
594
|
+
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(data) {
|
|
526
595
|
var _Toast$success, _Toast$success2, items;
|
|
527
596
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
528
597
|
while (1) switch (_context4.prev = _context4.next) {
|
|
@@ -549,7 +618,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
549
618
|
}, _callee4);
|
|
550
619
|
}));
|
|
551
620
|
return function (_x4) {
|
|
552
|
-
return
|
|
621
|
+
return _ref8.apply(this, arguments);
|
|
553
622
|
};
|
|
554
623
|
}()));
|
|
555
624
|
var amountChangedUnsubscribe = core.effects.on(CheckoutHooks.OnBalanceDueAmountChanged, executeIfActive(function (data) {
|
|
@@ -587,7 +656,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
587
656
|
// }
|
|
588
657
|
// );
|
|
589
658
|
var orderPaymentAddedUnsubscribe = core.effects.on(CheckoutHooks.OnOrderPaymentAdded, executeIfActive( /*#__PURE__*/function () {
|
|
590
|
-
var
|
|
659
|
+
var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(data) {
|
|
591
660
|
var orderInfo, balanceDueAmount, autoCloseConfig, _paymentItems, _totalAmount, serviceChargeTotal, isToastMode, paymentMethodName, isCashPayment, _interaction$utils3, _interaction$utils3$p;
|
|
592
661
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
593
662
|
while (1) switch (_context5.prev = _context5.next) {
|
|
@@ -681,7 +750,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
681
750
|
}, _callee5);
|
|
682
751
|
}));
|
|
683
752
|
return function (_x5) {
|
|
684
|
-
return
|
|
753
|
+
return _ref9.apply(this, arguments);
|
|
685
754
|
};
|
|
686
755
|
}()));
|
|
687
756
|
return function () {
|
|
@@ -710,7 +779,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
710
779
|
|
|
711
780
|
// 处理金额修改
|
|
712
781
|
var handleAmountChange = useCallback( /*#__PURE__*/function () {
|
|
713
|
-
var
|
|
782
|
+
var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(newAmount) {
|
|
714
783
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
715
784
|
while (1) switch (_context6.prev = _context6.next) {
|
|
716
785
|
case 0:
|
|
@@ -736,13 +805,13 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
736
805
|
}, _callee6, null, [[1, 7]]);
|
|
737
806
|
}));
|
|
738
807
|
return function (_x6) {
|
|
739
|
-
return
|
|
808
|
+
return _ref10.apply(this, arguments);
|
|
740
809
|
};
|
|
741
810
|
}(), [checkoutModule]);
|
|
742
811
|
|
|
743
812
|
// 处理押金状态变更
|
|
744
813
|
var handleDepositStatusChange = useCallback( /*#__PURE__*/function () {
|
|
745
|
-
var
|
|
814
|
+
var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(isDeposit) {
|
|
746
815
|
var depositStatus;
|
|
747
816
|
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
748
817
|
while (1) switch (_context7.prev = _context7.next) {
|
|
@@ -770,13 +839,13 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
770
839
|
}, _callee7, null, [[1, 8]]);
|
|
771
840
|
}));
|
|
772
841
|
return function (_x7) {
|
|
773
|
-
return
|
|
842
|
+
return _ref11.apply(this, arguments);
|
|
774
843
|
};
|
|
775
844
|
}(), [checkoutModule]);
|
|
776
845
|
|
|
777
846
|
// 当 walletpass 直接就满足订单支付时,触发此方法
|
|
778
847
|
var handleWalletPassConfirmPay = /*#__PURE__*/function () {
|
|
779
|
-
var
|
|
848
|
+
var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(action) {
|
|
780
849
|
var result, _result$response, _orderInfo, responseData, _responseData$payment, params;
|
|
781
850
|
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
782
851
|
while (1) switch (_context8.prev = _context8.next) {
|
|
@@ -851,13 +920,13 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
851
920
|
}, _callee8);
|
|
852
921
|
}));
|
|
853
922
|
return function handleWalletPassConfirmPay(_x8) {
|
|
854
|
-
return
|
|
923
|
+
return _ref12.apply(this, arguments);
|
|
855
924
|
};
|
|
856
925
|
}();
|
|
857
926
|
|
|
858
927
|
// 处理 Save & Pay Later 的钱包余额确认
|
|
859
928
|
var handleSavePayLater = useCallback( /*#__PURE__*/function () {
|
|
860
|
-
var
|
|
929
|
+
var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(action) {
|
|
861
930
|
var res;
|
|
862
931
|
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
863
932
|
while (1) switch (_context9.prev = _context9.next) {
|
|
@@ -909,7 +978,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
909
978
|
}, _callee9);
|
|
910
979
|
}));
|
|
911
980
|
return function (_x9) {
|
|
912
|
-
return
|
|
981
|
+
return _ref13.apply(this, arguments);
|
|
913
982
|
};
|
|
914
983
|
}(), [checkoutModule, onPaymentCancel]);
|
|
915
984
|
var moduleConfig = {
|
|
@@ -929,7 +998,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
929
998
|
return new Decimal(currentTotalPrice || 0).minus(shopDiscount || 0).toNumber();
|
|
930
999
|
}, [shopDiscount, currentTotalPrice]);
|
|
931
1000
|
var handleSelectWalletChange = useMemoizedFn( /*#__PURE__*/function () {
|
|
932
|
-
var
|
|
1001
|
+
var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(select) {
|
|
933
1002
|
var voucherItems, data;
|
|
934
1003
|
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
935
1004
|
while (1) switch (_context10.prev = _context10.next) {
|
|
@@ -979,13 +1048,13 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
979
1048
|
}, _callee10);
|
|
980
1049
|
}));
|
|
981
1050
|
return function (_x10) {
|
|
982
|
-
return
|
|
1051
|
+
return _ref14.apply(this, arguments);
|
|
983
1052
|
};
|
|
984
1053
|
}());
|
|
985
1054
|
|
|
986
1055
|
// 手动折扣相关处理函数
|
|
987
1056
|
var handlePriceAdjustConfirm = /*#__PURE__*/function () {
|
|
988
|
-
var
|
|
1057
|
+
var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(discountAmount) {
|
|
989
1058
|
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
990
1059
|
while (1) switch (_context11.prev = _context11.next) {
|
|
991
1060
|
case 0:
|
|
@@ -1004,13 +1073,13 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1004
1073
|
}, _callee11);
|
|
1005
1074
|
}));
|
|
1006
1075
|
return function handlePriceAdjustConfirm(_x11) {
|
|
1007
|
-
return
|
|
1076
|
+
return _ref15.apply(this, arguments);
|
|
1008
1077
|
};
|
|
1009
1078
|
}();
|
|
1010
1079
|
var handleButtonClick = /*#__PURE__*/function () {
|
|
1011
|
-
var
|
|
1080
|
+
var _ref16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(key) {
|
|
1012
1081
|
var _savePayLaterHandlerR;
|
|
1013
|
-
var data, isSynced,
|
|
1082
|
+
var data, isSynced, _orderId3, params, _paymentItems2;
|
|
1014
1083
|
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
1015
1084
|
while (1) switch (_context12.prev = _context12.next) {
|
|
1016
1085
|
case 0:
|
|
@@ -1047,9 +1116,9 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1047
1116
|
_context12.next = 21;
|
|
1048
1117
|
return checkoutModule.getCurrentOrderId();
|
|
1049
1118
|
case 21:
|
|
1050
|
-
|
|
1119
|
+
_orderId3 = _context12.sent;
|
|
1051
1120
|
data = {
|
|
1052
|
-
orderId:
|
|
1121
|
+
orderId: _orderId3
|
|
1053
1122
|
};
|
|
1054
1123
|
case 23:
|
|
1055
1124
|
console.log('handleButtonClick_print-receipt_data>>>>', data);
|
|
@@ -1112,7 +1181,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1112
1181
|
}, _callee12);
|
|
1113
1182
|
}));
|
|
1114
1183
|
return function handleButtonClick(_x12) {
|
|
1115
|
-
return
|
|
1184
|
+
return _ref16.apply(this, arguments);
|
|
1116
1185
|
};
|
|
1117
1186
|
}();
|
|
1118
1187
|
|
|
@@ -1140,7 +1209,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1140
1209
|
};
|
|
1141
1210
|
};
|
|
1142
1211
|
var handleSendCustomerPaymentLink = /*#__PURE__*/function () {
|
|
1143
|
-
var
|
|
1212
|
+
var _ref17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(data) {
|
|
1144
1213
|
var order, stateAmount, isCurrentOrderSynced, res;
|
|
1145
1214
|
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
1146
1215
|
while (1) switch (_context13.prev = _context13.next) {
|
|
@@ -1185,7 +1254,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1185
1254
|
}, _callee13);
|
|
1186
1255
|
}));
|
|
1187
1256
|
return function handleSendCustomerPaymentLink(_x13) {
|
|
1188
|
-
return
|
|
1257
|
+
return _ref17.apply(this, arguments);
|
|
1189
1258
|
};
|
|
1190
1259
|
}();
|
|
1191
1260
|
var searchAndClientProps = useMemo(function () {
|
|
@@ -1195,7 +1264,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1195
1264
|
}, [paymentItems, config]);
|
|
1196
1265
|
console.log(searchAndClientProps, 'searchAndClientProps');
|
|
1197
1266
|
var roundingFunction = /*#__PURE__*/function () {
|
|
1198
|
-
var
|
|
1267
|
+
var _ref18 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(amount) {
|
|
1199
1268
|
var res;
|
|
1200
1269
|
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
|
1201
1270
|
while (1) switch (_context14.prev = _context14.next) {
|
|
@@ -1212,7 +1281,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1212
1281
|
}, _callee14);
|
|
1213
1282
|
}));
|
|
1214
1283
|
return function roundingFunction(_x14) {
|
|
1215
|
-
return
|
|
1284
|
+
return _ref18.apply(this, arguments);
|
|
1216
1285
|
};
|
|
1217
1286
|
}();
|
|
1218
1287
|
|
|
@@ -1385,33 +1454,33 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1385
1454
|
|
|
1386
1455
|
// 主要的支付弹窗组件
|
|
1387
1456
|
|
|
1388
|
-
var PaymentModal = function PaymentModal(
|
|
1457
|
+
var PaymentModal = function PaymentModal(_ref19) {
|
|
1389
1458
|
var _context$appHelper$ut, _context$appHelper$ut2, _context$appHelper$ut3, _context$appHelper$ut4, _context$appHelper;
|
|
1390
|
-
var open =
|
|
1391
|
-
data =
|
|
1392
|
-
callback =
|
|
1393
|
-
onClose =
|
|
1394
|
-
setEditCartMode =
|
|
1395
|
-
editOrderId =
|
|
1396
|
-
paymentResultDisplayMode =
|
|
1397
|
-
shopDiscount =
|
|
1398
|
-
client =
|
|
1399
|
-
currentTotalPrice =
|
|
1400
|
-
onChangeShopDiscount =
|
|
1401
|
-
onChangeOrderNote =
|
|
1402
|
-
onDeleteOrderNote =
|
|
1403
|
-
|
|
1404
|
-
config =
|
|
1459
|
+
var open = _ref19.open,
|
|
1460
|
+
data = _ref19.data,
|
|
1461
|
+
callback = _ref19.callback,
|
|
1462
|
+
onClose = _ref19.onClose,
|
|
1463
|
+
setEditCartMode = _ref19.setEditCartMode,
|
|
1464
|
+
editOrderId = _ref19.editOrderId,
|
|
1465
|
+
paymentResultDisplayMode = _ref19.paymentResultDisplayMode,
|
|
1466
|
+
shopDiscount = _ref19.shopDiscount,
|
|
1467
|
+
client = _ref19.client,
|
|
1468
|
+
currentTotalPrice = _ref19.currentTotalPrice,
|
|
1469
|
+
onChangeShopDiscount = _ref19.onChangeShopDiscount,
|
|
1470
|
+
onChangeOrderNote = _ref19.onChangeOrderNote,
|
|
1471
|
+
onDeleteOrderNote = _ref19.onDeleteOrderNote,
|
|
1472
|
+
_ref19$config = _ref19.config,
|
|
1473
|
+
config = _ref19$config === void 0 ? {
|
|
1405
1474
|
showHeaderCenter: true,
|
|
1406
1475
|
showHeaderRightButton: true
|
|
1407
|
-
} :
|
|
1476
|
+
} : _ref19$config;
|
|
1408
1477
|
var context = useEngineContext();
|
|
1409
1478
|
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');
|
|
1410
|
-
var
|
|
1411
|
-
pisellos =
|
|
1412
|
-
getData =
|
|
1413
|
-
interaction =
|
|
1414
|
-
isWebPos =
|
|
1479
|
+
var _ref20 = (context === null || context === void 0 || (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils) || {},
|
|
1480
|
+
pisellos = _ref20.pisellos,
|
|
1481
|
+
getData = _ref20.getData,
|
|
1482
|
+
interaction = _ref20.interaction,
|
|
1483
|
+
isWebPos = _ref20.isWebPos;
|
|
1415
1484
|
var _useState27 = useState(null),
|
|
1416
1485
|
_useState28 = _slicedToArray(_useState27, 2),
|
|
1417
1486
|
orderInfo = _useState28[0],
|
|
@@ -1448,7 +1517,7 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
1448
1517
|
|
|
1449
1518
|
// 重试处理函数(逻辑由用户自己实现)
|
|
1450
1519
|
var handleRetry = /*#__PURE__*/function () {
|
|
1451
|
-
var
|
|
1520
|
+
var _ref21 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15() {
|
|
1452
1521
|
var checkoutModule, res;
|
|
1453
1522
|
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
|
1454
1523
|
while (1) switch (_context15.prev = _context15.next) {
|
|
@@ -1482,7 +1551,7 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
1482
1551
|
}, _callee15);
|
|
1483
1552
|
}));
|
|
1484
1553
|
return function handleRetry() {
|
|
1485
|
-
return
|
|
1554
|
+
return _ref21.apply(this, arguments);
|
|
1486
1555
|
};
|
|
1487
1556
|
}();
|
|
1488
1557
|
|
|
@@ -1510,7 +1579,7 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
1510
1579
|
useEffect(function () {
|
|
1511
1580
|
var _interaction$utils5;
|
|
1512
1581
|
var initTillButtonData = /*#__PURE__*/function () {
|
|
1513
|
-
var
|
|
1582
|
+
var _ref22 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16() {
|
|
1514
1583
|
var _interaction$utils4, _interaction$utils4$a, tillButtonData;
|
|
1515
1584
|
return _regeneratorRuntime().wrap(function _callee16$(_context16) {
|
|
1516
1585
|
while (1) switch (_context16.prev = _context16.next) {
|
|
@@ -1543,7 +1612,7 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
1543
1612
|
}, _callee16, null, [[1, 9]]);
|
|
1544
1613
|
}));
|
|
1545
1614
|
return function initTillButtonData() {
|
|
1546
|
-
return
|
|
1615
|
+
return _ref22.apply(this, arguments);
|
|
1547
1616
|
};
|
|
1548
1617
|
}();
|
|
1549
1618
|
|
|
@@ -1591,8 +1660,8 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
1591
1660
|
|
|
1592
1661
|
// 订单备注相关处理函数
|
|
1593
1662
|
var handleNoteConfirm = /*#__PURE__*/function () {
|
|
1594
|
-
var
|
|
1595
|
-
var checkoutModule,
|
|
1663
|
+
var _ref23 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(noteValue) {
|
|
1664
|
+
var checkoutModule, _orderId4, _checkoutModule$editO, _checkoutModule, _checkoutModule$updat;
|
|
1596
1665
|
return _regeneratorRuntime().wrap(function _callee17$(_context17) {
|
|
1597
1666
|
while (1) switch (_context17.prev = _context17.next) {
|
|
1598
1667
|
case 0:
|
|
@@ -1601,9 +1670,9 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
1601
1670
|
break;
|
|
1602
1671
|
}
|
|
1603
1672
|
checkoutModule = pisellos === null || pisellos === void 0 ? void 0 : pisellos.getModule('checkout');
|
|
1604
|
-
|
|
1673
|
+
_orderId4 = checkoutModule === null || checkoutModule === void 0 ? void 0 : checkoutModule.getCurrentOrderId();
|
|
1605
1674
|
if (checkoutModule) {
|
|
1606
|
-
(_checkoutModule$editO = checkoutModule.editOrderNoteByOrderIdAsync) === null || _checkoutModule$editO === void 0 || _checkoutModule$editO.call(checkoutModule,
|
|
1675
|
+
(_checkoutModule$editO = checkoutModule.editOrderNoteByOrderIdAsync) === null || _checkoutModule$editO === void 0 || _checkoutModule$editO.call(checkoutModule, _orderId4, noteValue);
|
|
1607
1676
|
setOrderNote(noteValue);
|
|
1608
1677
|
Toast === null || Toast === void 0 || Toast.success(locales.getText('pisell2.checkout.order-note.updated-successfully'));
|
|
1609
1678
|
}
|
|
@@ -1650,11 +1719,11 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
1650
1719
|
}, _callee17, null, [[6, 17]]);
|
|
1651
1720
|
}));
|
|
1652
1721
|
return function handleNoteConfirm(_x15) {
|
|
1653
|
-
return
|
|
1722
|
+
return _ref23.apply(this, arguments);
|
|
1654
1723
|
};
|
|
1655
1724
|
}();
|
|
1656
1725
|
var handleNoteDelete = /*#__PURE__*/function () {
|
|
1657
|
-
var
|
|
1726
|
+
var _ref24 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18() {
|
|
1658
1727
|
var checkoutModule, _checkoutModule$updat2;
|
|
1659
1728
|
return _regeneratorRuntime().wrap(function _callee18$(_context18) {
|
|
1660
1729
|
while (1) switch (_context18.prev = _context18.next) {
|
|
@@ -1689,7 +1758,7 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
1689
1758
|
}, _callee18, null, [[0, 10]]);
|
|
1690
1759
|
}));
|
|
1691
1760
|
return function handleNoteDelete() {
|
|
1692
|
-
return
|
|
1761
|
+
return _ref24.apply(this, arguments);
|
|
1693
1762
|
};
|
|
1694
1763
|
}();
|
|
1695
1764
|
var handleNoteCancel = function handleNoteCancel() {
|
|
@@ -1728,20 +1797,20 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
1728
1797
|
}
|
|
1729
1798
|
};
|
|
1730
1799
|
var handleNoteConfirm = /*#__PURE__*/function () {
|
|
1731
|
-
var
|
|
1732
|
-
var checkoutModule,
|
|
1800
|
+
var _ref25 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(noteValue) {
|
|
1801
|
+
var checkoutModule, _orderId5, _checkoutModule$editO2;
|
|
1733
1802
|
return _regeneratorRuntime().wrap(function _callee19$(_context19) {
|
|
1734
1803
|
while (1) switch (_context19.prev = _context19.next) {
|
|
1735
1804
|
case 0:
|
|
1736
1805
|
_context19.prev = 0;
|
|
1737
1806
|
checkoutModule = pisellos === null || pisellos === void 0 ? void 0 : pisellos.getModule('checkout');
|
|
1738
|
-
|
|
1739
|
-
if (!(checkoutModule &&
|
|
1807
|
+
_orderId5 = checkoutModule === null || checkoutModule === void 0 ? void 0 : checkoutModule.getCurrentOrderId();
|
|
1808
|
+
if (!(checkoutModule && _orderId5)) {
|
|
1740
1809
|
_context19.next = 8;
|
|
1741
1810
|
break;
|
|
1742
1811
|
}
|
|
1743
1812
|
_context19.next = 6;
|
|
1744
|
-
return (_checkoutModule$editO2 = checkoutModule.editOrderNoteByOrderIdAsync) === null || _checkoutModule$editO2 === void 0 ? void 0 : _checkoutModule$editO2.call(checkoutModule,
|
|
1813
|
+
return (_checkoutModule$editO2 = checkoutModule.editOrderNoteByOrderIdAsync) === null || _checkoutModule$editO2 === void 0 ? void 0 : _checkoutModule$editO2.call(checkoutModule, _orderId5, noteValue);
|
|
1745
1814
|
case 6:
|
|
1746
1815
|
setOrderNote(noteValue);
|
|
1747
1816
|
showToast('success', locales.getText('pisell2.checkout.order-note.updated-successfully'));
|
|
@@ -1766,24 +1835,24 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
1766
1835
|
}, _callee19, null, [[0, 10]]);
|
|
1767
1836
|
}));
|
|
1768
1837
|
return function handleNoteConfirm(_x16) {
|
|
1769
|
-
return
|
|
1838
|
+
return _ref25.apply(this, arguments);
|
|
1770
1839
|
};
|
|
1771
1840
|
}();
|
|
1772
1841
|
var handleNoteDelete = /*#__PURE__*/function () {
|
|
1773
|
-
var
|
|
1774
|
-
var checkoutModule,
|
|
1842
|
+
var _ref26 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20() {
|
|
1843
|
+
var checkoutModule, _orderId6, _checkoutModule$editO3;
|
|
1775
1844
|
return _regeneratorRuntime().wrap(function _callee20$(_context20) {
|
|
1776
1845
|
while (1) switch (_context20.prev = _context20.next) {
|
|
1777
1846
|
case 0:
|
|
1778
1847
|
_context20.prev = 0;
|
|
1779
1848
|
checkoutModule = pisellos === null || pisellos === void 0 ? void 0 : pisellos.getModule('checkout');
|
|
1780
|
-
|
|
1781
|
-
if (!(checkoutModule &&
|
|
1849
|
+
_orderId6 = checkoutModule === null || checkoutModule === void 0 ? void 0 : checkoutModule.getCurrentOrderId();
|
|
1850
|
+
if (!(checkoutModule && _orderId6)) {
|
|
1782
1851
|
_context20.next = 8;
|
|
1783
1852
|
break;
|
|
1784
1853
|
}
|
|
1785
1854
|
_context20.next = 6;
|
|
1786
|
-
return (_checkoutModule$editO3 = checkoutModule.editOrderNoteByOrderIdAsync) === null || _checkoutModule$editO3 === void 0 ? void 0 : _checkoutModule$editO3.call(checkoutModule,
|
|
1855
|
+
return (_checkoutModule$editO3 = checkoutModule.editOrderNoteByOrderIdAsync) === null || _checkoutModule$editO3 === void 0 ? void 0 : _checkoutModule$editO3.call(checkoutModule, _orderId6, '');
|
|
1787
1856
|
case 6:
|
|
1788
1857
|
setOrderNote('');
|
|
1789
1858
|
showToast('success', locales.getText('pisell2.checkout.order-note.deleted-successfully'));
|
|
@@ -1808,7 +1877,7 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
1808
1877
|
}, _callee20, null, [[0, 10]]);
|
|
1809
1878
|
}));
|
|
1810
1879
|
return function handleNoteDelete() {
|
|
1811
|
-
return
|
|
1880
|
+
return _ref26.apply(this, arguments);
|
|
1812
1881
|
};
|
|
1813
1882
|
}();
|
|
1814
1883
|
var handleNoteCancel = function handleNoteCancel() {
|
|
@@ -1823,9 +1892,9 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
1823
1892
|
var currentLocale = ((_context$appHelper$ut5 = context.appHelper.utils) === null || _context$appHelper$ut5 === void 0 || (_context$appHelper$ut6 = _context$appHelper$ut5.getApp) === null || _context$appHelper$ut6 === void 0 || (_context$appHelper$ut6 = _context$appHelper$ut6.call(_context$appHelper$ut5)) === null || _context$appHelper$ut6 === void 0 || (_context$appHelper$ut6 = _context$appHelper$ut6.locales) === null || _context$appHelper$ut6 === void 0 || (_context$appHelper$ut7 = _context$appHelper$ut6.getLocale) === null || _context$appHelper$ut7 === void 0 ? void 0 : _context$appHelper$ut7.call(_context$appHelper$ut6)) || ((_context$appHelper$ut8 = context.appHelper.utils) === null || _context$appHelper$ut8 === void 0 || (_context$appHelper$ut8 = _context$appHelper$ut8.storage) === null || _context$appHelper$ut8 === void 0 ? void 0 : _context$appHelper$ut8.get('umi_locale')) || 'en';
|
|
1824
1893
|
|
|
1825
1894
|
// 创建一个临时的Context Provider来传递正确的语言环境
|
|
1826
|
-
var EngineContextProvider = function EngineContextProvider(
|
|
1895
|
+
var EngineContextProvider = function EngineContextProvider(_ref27) {
|
|
1827
1896
|
var _context$engine;
|
|
1828
|
-
var children =
|
|
1897
|
+
var children = _ref27.children;
|
|
1829
1898
|
var tempEngineContext = _objectSpread(_objectSpread({}, context), {}, {
|
|
1830
1899
|
engine: _objectSpread(_objectSpread({}, context.engine), {}, {
|
|
1831
1900
|
props: _objectSpread(_objectSpread({}, (_context$engine = context.engine) === null || _context$engine === void 0 ? void 0 : _context$engine.props), {}, {
|
|
@@ -1931,7 +2000,7 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
1931
2000
|
|
|
1932
2001
|
// 如果订单已经同步过,此时点击左上角返回,需要通知购物车进入编辑态
|
|
1933
2002
|
var handleSetEditCartMode = /*#__PURE__*/function () {
|
|
1934
|
-
var
|
|
2003
|
+
var _ref28 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21() {
|
|
1935
2004
|
var closeModal,
|
|
1936
2005
|
checkout,
|
|
1937
2006
|
orderId,
|
|
@@ -1971,7 +2040,7 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
1971
2040
|
}, _callee21);
|
|
1972
2041
|
}));
|
|
1973
2042
|
return function handleSetEditCartMode() {
|
|
1974
|
-
return
|
|
2043
|
+
return _ref28.apply(this, arguments);
|
|
1975
2044
|
};
|
|
1976
2045
|
}();
|
|
1977
2046
|
|
|
@@ -1989,8 +2058,10 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
1989
2058
|
size: "small",
|
|
1990
2059
|
type: "text",
|
|
1991
2060
|
onClick: function onClick() {
|
|
2061
|
+
var _checkout$getCurrentO;
|
|
1992
2062
|
var checkout = pisellos.getModule('checkout');
|
|
1993
|
-
|
|
2063
|
+
// 如果订单是 unpaid(弃单) ,则不进入编辑状态,直接关闭弹窗
|
|
2064
|
+
if (checkout.isCurrentOrderSynced() && ((_checkout$getCurrentO = checkout.getCurrentOrderInfo()) === null || _checkout$getCurrentO === void 0 ? void 0 : _checkout$getCurrentO.payment_status) !== 'unpaid') {
|
|
1994
2065
|
handleSetEditCartMode(true);
|
|
1995
2066
|
} else {
|
|
1996
2067
|
handlePaymentCancel(false);
|
|
@@ -2023,7 +2094,7 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
2023
2094
|
// 初始化checkout数据
|
|
2024
2095
|
useEffect(function () {
|
|
2025
2096
|
var initCheckoutData = /*#__PURE__*/function () {
|
|
2026
|
-
var
|
|
2097
|
+
var _ref29 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23() {
|
|
2027
2098
|
var checkout, _getData, shop_wallet_pass_id, newData, existPayment, _newData$subtotal_inf, _newData$subtotal_inf2, _orderInfo2, _data$subtotal_info, _data$subtotal_info2, _orderInfo4, domain;
|
|
2028
2099
|
return _regeneratorRuntime().wrap(function _callee23$(_context23) {
|
|
2029
2100
|
while (1) switch (_context23.prev = _context23.next) {
|
|
@@ -2105,7 +2176,7 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
2105
2176
|
}
|
|
2106
2177
|
// 监听订单同步完成,同步完成后显示订单完成 toast,关闭当前弹窗
|
|
2107
2178
|
unsubscribeRef.current = checkout.core.effects.on('checkout:onOrderSynced', executeIfActive( /*#__PURE__*/function () {
|
|
2108
|
-
var
|
|
2179
|
+
var _ref30 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22(data) {
|
|
2109
2180
|
var _data$response, _responseData$payment2;
|
|
2110
2181
|
var currentOrderId, responseData, paymentStatus, orderTotalAmount, gapAmount, currentChangeGivenAmount, failureReason, _responseData$payment3, params, statusClassName, autoCloseConfig, enabledAutoPrint, _interaction$utils6, _interaction$utils6$a, _orderInfo3, isToastMode, paymentResult;
|
|
2111
2182
|
return _regeneratorRuntime().wrap(function _callee22$(_context22) {
|
|
@@ -2256,7 +2327,7 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
2256
2327
|
}, _callee22);
|
|
2257
2328
|
}));
|
|
2258
2329
|
return function (_x17) {
|
|
2259
|
-
return
|
|
2330
|
+
return _ref30.apply(this, arguments);
|
|
2260
2331
|
};
|
|
2261
2332
|
}()));
|
|
2262
2333
|
_context23.next = 46;
|
|
@@ -2338,7 +2409,7 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
2338
2409
|
}, _callee23, null, [[0, 48]]);
|
|
2339
2410
|
}));
|
|
2340
2411
|
return function initCheckoutData() {
|
|
2341
|
-
return
|
|
2412
|
+
return _ref29.apply(this, arguments);
|
|
2342
2413
|
};
|
|
2343
2414
|
}();
|
|
2344
2415
|
if (data) {
|
|
@@ -2374,9 +2445,9 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
2374
2445
|
|
|
2375
2446
|
// 通用回调函数
|
|
2376
2447
|
var handleDetailsClick = /*#__PURE__*/function () {
|
|
2377
|
-
var
|
|
2448
|
+
var _ref31 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24() {
|
|
2378
2449
|
var _context$appHelper2;
|
|
2379
|
-
var _context$appHelper$ut9, isTerminal, isWebPos, checkout,
|
|
2450
|
+
var _context$appHelper$ut9, isTerminal, isWebPos, checkout, _orderId7;
|
|
2380
2451
|
return _regeneratorRuntime().wrap(function _callee24$(_context24) {
|
|
2381
2452
|
while (1) switch (_context24.prev = _context24.next) {
|
|
2382
2453
|
case 0:
|
|
@@ -2394,12 +2465,12 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
2394
2465
|
_context24.next = 6;
|
|
2395
2466
|
return checkout.getCurrentOrderId();
|
|
2396
2467
|
case 6:
|
|
2397
|
-
|
|
2468
|
+
_orderId7 = _context24.sent;
|
|
2398
2469
|
return _context24.abrupt("return", interaction.utils.postMessageToApp({
|
|
2399
2470
|
module: 'booking',
|
|
2400
2471
|
key: 'view_order',
|
|
2401
2472
|
data: {
|
|
2402
|
-
order_id:
|
|
2473
|
+
order_id: _orderId7
|
|
2403
2474
|
},
|
|
2404
2475
|
origin: '/booking'
|
|
2405
2476
|
}));
|
|
@@ -2410,12 +2481,12 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
2410
2481
|
}, _callee24);
|
|
2411
2482
|
}));
|
|
2412
2483
|
return function handleDetailsClick() {
|
|
2413
|
-
return
|
|
2484
|
+
return _ref31.apply(this, arguments);
|
|
2414
2485
|
};
|
|
2415
2486
|
}();
|
|
2416
2487
|
var handlePrintReceiptClick = /*#__PURE__*/function () {
|
|
2417
|
-
var
|
|
2418
|
-
var checkoutModule, data, isSynced,
|
|
2488
|
+
var _ref32 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee25() {
|
|
2489
|
+
var checkoutModule, data, isSynced, _orderId8, params;
|
|
2419
2490
|
return _regeneratorRuntime().wrap(function _callee25$(_context25) {
|
|
2420
2491
|
while (1) switch (_context25.prev = _context25.next) {
|
|
2421
2492
|
case 0:
|
|
@@ -2449,9 +2520,9 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
2449
2520
|
_context25.next = 15;
|
|
2450
2521
|
return checkoutModule.getCurrentOrderId();
|
|
2451
2522
|
case 15:
|
|
2452
|
-
|
|
2523
|
+
_orderId8 = _context25.sent;
|
|
2453
2524
|
data = {
|
|
2454
|
-
orderId:
|
|
2525
|
+
orderId: _orderId8
|
|
2455
2526
|
};
|
|
2456
2527
|
case 17:
|
|
2457
2528
|
// data.orderId 就是订单号,可以用来打印小票
|
|
@@ -2480,7 +2551,7 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
2480
2551
|
}, _callee25);
|
|
2481
2552
|
}));
|
|
2482
2553
|
return function handlePrintReceiptClick() {
|
|
2483
|
-
return
|
|
2554
|
+
return _ref32.apply(this, arguments);
|
|
2484
2555
|
};
|
|
2485
2556
|
}();
|
|
2486
2557
|
var handleRetryClick = function handleRetryClick() {
|