@pisell/private-materials 6.5.26 → 6.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +2 -2
- package/build/lowcode/preview.js +146 -165
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +9 -9
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +9 -9
- package/es/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -1
- package/es/components/appointmentBooking/components/Cart/Item/index.js +4 -2
- package/es/components/appointmentBooking/components/ConfirmInformation/index.js +273 -76
- package/es/components/appointmentBooking/components/ConfirmInformation/index.less +15 -0
- package/es/components/appointmentBooking/hooks.d.ts +1 -0
- package/es/components/appointmentBooking/hooks.js +30 -30
- package/es/components/appointmentBooking/locales.d.ts +3 -0
- package/es/components/appointmentBooking/locales.js +9 -6
- package/es/components/booking/components/actionButtons/index.js +34 -20
- package/es/components/booking/components/customSelect/index.js +1 -1
- package/es/components/booking/components/footer/amount.js +25 -8
- package/es/components/booking/components/footer/index.js +66 -33
- package/es/components/booking/components/footer/utils.d.ts +7 -0
- package/es/components/booking/components/footer/utils.js +126 -99
- package/es/components/booking/components/voucher/index.js +25 -9
- package/es/components/booking/dashboard/serve.js +1 -6
- package/es/components/booking/forms/footer.js +24 -10
- package/es/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
- package/es/components/booking/forms/serve.js +2 -12
- package/es/components/booking/hooks/useQuotation.js +69 -21
- package/es/components/booking/info/client/index.js +28 -13
- package/es/components/booking/info/client/serve.js +2 -11
- package/es/components/booking/info/clientVariant/hooks/useClientFn.js +16 -10
- package/es/components/booking/info/clientVariant/vertical/SelectDrawer.js +10 -2
- package/es/components/booking/info/clientVariant/vertical/index.js +1 -1
- package/es/components/booking/info/hooks/useHolderConfig.d.ts +1 -0
- package/es/components/booking/info/hooks/useHolderConfig.js +9 -2
- package/es/components/booking/info/main.js +3 -2
- package/es/components/booking/info/model.js +5 -0
- package/es/components/booking/info/pet/serve.js +1 -6
- package/es/components/booking/info/service/Lists.d.ts +1 -1
- package/es/components/booking/info/service/Lists.js +10 -4
- package/es/components/booking/info/service/addTimeModal/serve.js +1 -11
- package/es/components/booking/info/service/serve.d.ts +14 -0
- package/es/components/booking/info/service/serve.js +25 -18
- package/es/components/booking/info/service2/Group/utils.js +2 -0
- package/es/components/booking/info/service2/utils.d.ts +1 -33
- package/es/components/booking/info/service2/utils.js +92 -56
- package/es/components/booking/info/utils.js +5 -0
- package/es/components/booking/info2/cartClientCard/index.js +49 -9
- package/es/components/booking/info2/index.js +3 -2
- package/es/components/booking/info2/serve.js +1 -6
- package/es/components/booking/info2/service/addService/index.js +146 -89
- package/es/components/booking/info2/service/addService/utils.d.ts +8 -0
- package/es/components/booking/info2/service/addService/utils.js +83 -14
- package/es/components/booking/info2/service/contactInfoMode/index.d.ts +2 -0
- package/es/components/booking/info2/service/contactInfoMode/index.js +94 -0
- package/es/components/booking/info2/service/editService/Holder/index.d.ts +12 -0
- package/es/components/booking/info2/service/editService/Holder/index.js +193 -0
- package/es/components/booking/info2/service/editService/Holder/index.less +63 -0
- package/es/components/booking/info2/service/editService/index.js +313 -57
- package/es/components/booking/info2/utilsByBooking.js +19 -14
- package/es/components/booking/locales.d.ts +36 -0
- package/es/components/booking/locales.js +48 -3
- package/es/components/booking/model.d.ts +4 -0
- package/es/components/booking/model.js +3 -0
- package/es/components/booking/utils/confirmHolderModal.d.ts +13 -0
- package/es/components/booking/utils/confirmHolderModal.js +318 -0
- package/es/components/booking/utils/confirmHolderModal.less +40 -0
- package/es/components/booking/utils/selectHolderModal.d.ts +24 -0
- package/es/components/booking/utils/selectHolderModal.js +407 -0
- package/es/components/booking/utils.d.ts +16 -7
- package/es/components/booking/utils.js +26 -37
- package/es/components/checkout/PaymentModal.js +61 -30
- package/es/components/checkout/components/CashPaymentModule/index.js +1 -7
- package/es/components/checkout/components/ScrollableList/index.js +0 -1
- package/es/components/checkout/locales.d.ts +3 -0
- package/es/components/checkout/locales.js +3 -0
- package/es/components/eftposPay/linkly/index.js +64 -2
- package/es/components/eftposPay/tyro/index.js +12 -0
- package/es/components/list/List.js +3 -0
- package/es/components/pay/toB/components/MX51/index.js +14 -44
- package/es/components/pay/toB/types/index.d.ts +0 -12
- package/es/components/pay/toB/types/index.js +0 -4
- package/es/components/shoppingCart/components/Cart/Product.js +6 -3
- package/es/components/shoppingCart/type.d.ts +1 -0
- package/es/components/ticketBooking/components/ProductDisplayAdapter/index.less +0 -12
- package/es/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.d.ts +18 -0
- package/es/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.js +119 -0
- package/es/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.less +0 -0
- package/es/components/ticketBooking/components/addServiceVariant/addService.d.ts +0 -2
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +419 -794
- package/es/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -2
- package/es/components/ticketBooking/components/addServiceVariant/index.js +4 -4
- package/es/components/ticketBooking/components/addServiceVariant/utils.js +1 -2
- package/es/components/ticketBooking/components/menuBar/index.js +109 -12
- package/es/components/ticketBooking/components/ticketBooking/index.d.ts +2 -4
- package/es/components/ticketBooking/components/ticketBooking/index.js +32 -61
- package/es/components/ticketBooking/components/ticketBooking/index.less +2 -1
- package/es/components/ticketBooking/components/timeBar/index.d.ts +0 -1
- package/es/components/ticketBooking/components/timeBar/index.js +1 -4
- package/es/components/ticketBooking/hooks/pisellos/useProducts.d.ts +0 -4
- package/es/components/ticketBooking/hooks/pisellos/useProducts.js +122 -170
- package/es/components/ticketBooking/index.d.ts +0 -1
- package/es/components/ticketBooking/index.js +0 -2
- package/es/components/ticketBooking/serve.js +17 -119
- package/es/components/ticketBooking/utils/index.d.ts +7 -1
- package/es/components/ticketBooking/utils/index.js +44 -28
- package/es/hooks/useEngineContext.d.ts +0 -1
- package/es/hooks/useEngineContext.js +0 -7
- package/es/index.d.ts +4 -0
- package/es/index.js +5 -1
- package/es/plus/clientCard/locales.js +3 -3
- package/es/plus/clinetSearch/index.js +28 -30
- package/es/plus/clinetSearch/locales.d.ts +3 -0
- package/es/plus/clinetSearch/locales.js +7 -4
- package/es/plus/clinetSearch/types.d.ts +12 -0
- package/es/plus/contactInfo/components/Avatar/index.d.ts +10 -0
- package/es/plus/contactInfo/components/Avatar/index.js +30 -0
- package/es/plus/contactInfo/components/SwipeAction/index.d.ts +46 -0
- package/es/plus/contactInfo/components/SwipeAction/index.js +360 -0
- package/es/plus/contactInfo/components/SwipeAction/index.less +74 -0
- package/es/plus/contactInfo/index.d.ts +6 -0
- package/es/plus/contactInfo/index.js +198 -0
- package/es/plus/contactInfo/index.less +621 -0
- package/es/plus/contactInfo/locales.d.ts +15 -0
- package/es/plus/contactInfo/locales.js +14 -0
- package/es/plus/contactInfo/types.d.ts +91 -0
- package/es/plus/contactInfo/types.js +1 -0
- package/es/plus/contactInfo/utils.d.ts +7 -0
- package/es/plus/contactInfo/utils.js +50 -0
- package/es/plus/contactInfoModal/ContactInfoContent.d.ts +3 -0
- package/es/plus/contactInfoModal/ContactInfoContent.js +74 -0
- package/es/plus/contactInfoModal/index.d.ts +41 -0
- package/es/plus/contactInfoModal/index.js +155 -0
- package/es/plus/contactInfoModal/index.less +19 -0
- package/es/plus/contactInfoModal/locales.d.ts +66 -0
- package/es/plus/contactInfoModal/locales.js +65 -0
- package/es/plus/productSelect/ProductCard/SkuCard/components/CardWrapper/index.js +1 -1
- package/es/plus/productSelect/ProductCard/index.js +1 -1
- package/es/plus/selectHolder/components/ErrorTip/index.d.ts +3 -0
- package/es/plus/selectHolder/components/ErrorTip/index.js +14 -0
- package/es/plus/selectHolder/components/ErrorTip/index.less +51 -0
- package/es/plus/selectHolder/components/HolderItem/index.d.ts +6 -0
- package/es/plus/selectHolder/components/HolderItem/index.js +77 -0
- package/es/plus/selectHolder/components/HolderItem/index.less +105 -0
- package/es/plus/selectHolder/components/HolderList/index.d.ts +30 -0
- package/es/plus/selectHolder/components/HolderList/index.js +43 -0
- package/es/plus/selectHolder/index.d.ts +7 -0
- package/es/plus/selectHolder/index.js +273 -0
- package/es/plus/selectHolder/index.less +137 -0
- package/es/plus/selectHolder/locales.d.ts +24 -0
- package/es/plus/selectHolder/locales.js +29 -0
- package/es/plus/selectHolder/types.d.ts +104 -0
- package/es/plus/selectHolder/types.js +1 -0
- package/es/plus/selectHolder/utils.d.ts +9 -0
- package/es/plus/selectHolder/utils.js +16 -0
- package/es/pro/comprehensiveSearch/components/searchSection/locales.js +3 -3
- package/es/pro/comprehensiveSearch/locales.js +1 -1
- package/es/pro/multiDayTimeSelect/MultiDayTimeSelect.d.ts +9 -0
- package/es/pro/multiDayTimeSelect/MultiDayTimeSelect.js +357 -0
- package/es/pro/multiDayTimeSelect/MultiDayTimeSelect.less +8 -0
- package/es/pro/multiDayTimeSelect/index.d.ts +3 -0
- package/es/pro/multiDayTimeSelect/index.js +1 -0
- package/es/pro/multiDayTimeSelect/types.d.ts +28 -0
- package/es/pro/multiDayTimeSelect/types.js +1 -0
- package/es/pro/skuDetailModal/types.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -1
- package/lib/components/appointmentBooking/components/Cart/Item/index.js +6 -3
- package/lib/components/appointmentBooking/components/ConfirmInformation/index.js +156 -13
- package/lib/components/appointmentBooking/components/ConfirmInformation/index.less +15 -0
- package/lib/components/appointmentBooking/hooks.d.ts +1 -0
- package/lib/components/appointmentBooking/hooks.js +73 -35
- package/lib/components/appointmentBooking/locales.d.ts +3 -0
- package/lib/components/appointmentBooking/locales.js +6 -3
- package/lib/components/booking/components/actionButtons/index.js +11 -2
- package/lib/components/booking/components/customSelect/index.js +1 -1
- package/lib/components/booking/components/footer/amount.js +23 -6
- package/lib/components/booking/components/footer/index.js +26 -5
- package/lib/components/booking/components/footer/utils.d.ts +7 -0
- package/lib/components/booking/components/footer/utils.js +120 -82
- package/lib/components/booking/components/voucher/index.js +10 -1
- package/lib/components/booking/dashboard/serve.js +1 -6
- package/lib/components/booking/forms/footer.js +29 -11
- package/lib/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
- package/lib/components/booking/forms/serve.js +2 -12
- package/lib/components/booking/hooks/useQuotation.js +45 -13
- package/lib/components/booking/info/client/index.js +14 -1
- package/lib/components/booking/info/client/serve.js +2 -13
- package/lib/components/booking/info/clientVariant/hooks/useClientFn.js +7 -2
- package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.js +11 -4
- package/lib/components/booking/info/clientVariant/vertical/index.js +34 -17
- package/lib/components/booking/info/hooks/useHolderConfig.d.ts +1 -0
- package/lib/components/booking/info/hooks/useHolderConfig.js +8 -3
- package/lib/components/booking/info/main.js +5 -4
- package/lib/components/booking/info/model.js +5 -0
- package/lib/components/booking/info/pet/serve.js +1 -6
- package/lib/components/booking/info/service/Lists.d.ts +1 -1
- package/lib/components/booking/info/service/Lists.js +5 -3
- package/lib/components/booking/info/service/addTimeModal/serve.js +1 -7
- package/lib/components/booking/info/service/serve.d.ts +14 -0
- package/lib/components/booking/info/service/serve.js +8 -17
- package/lib/components/booking/info/service2/Group/utils.js +2 -0
- package/lib/components/booking/info/service2/utils.d.ts +1 -33
- package/lib/components/booking/info/service2/utils.js +38 -29
- package/lib/components/booking/info/utils.js +4 -0
- package/lib/components/booking/info2/cartClientCard/index.js +34 -5
- package/lib/components/booking/info2/index.js +11 -5
- package/lib/components/booking/info2/serve.js +1 -6
- package/lib/components/booking/info2/service/addService/index.js +22 -3
- package/lib/components/booking/info2/service/addService/utils.d.ts +8 -0
- package/lib/components/booking/info2/service/addService/utils.js +48 -11
- package/lib/components/booking/info2/service/contactInfoMode/index.d.ts +2 -0
- package/lib/components/booking/info2/service/contactInfoMode/index.js +111 -0
- package/lib/components/booking/info2/service/editService/Holder/index.d.ts +12 -0
- package/lib/components/booking/info2/service/editService/Holder/index.js +199 -0
- package/lib/components/booking/info2/service/editService/Holder/index.less +63 -0
- package/lib/components/booking/info2/service/editService/index.js +254 -32
- package/lib/components/booking/info2/utilsByBooking.js +26 -19
- package/lib/components/booking/locales.d.ts +36 -0
- package/lib/components/booking/locales.js +42 -3
- package/lib/components/booking/model.d.ts +4 -0
- package/lib/components/booking/model.js +3 -0
- package/lib/components/booking/utils/confirmHolderModal.d.ts +13 -0
- package/lib/components/booking/utils/confirmHolderModal.js +253 -0
- package/lib/components/booking/utils/confirmHolderModal.less +40 -0
- package/lib/components/booking/utils/selectHolderModal.d.ts +24 -0
- package/lib/components/booking/utils/selectHolderModal.js +319 -0
- package/lib/components/booking/utils.d.ts +16 -7
- package/lib/components/booking/utils.js +18 -21
- package/lib/components/checkout/PaymentModal.js +41 -18
- package/lib/components/checkout/components/CashPaymentModule/index.js +1 -7
- package/lib/components/checkout/components/ScrollableList/index.js +0 -1
- package/lib/components/checkout/locales.d.ts +3 -0
- package/lib/components/checkout/locales.js +3 -0
- package/lib/components/eftposPay/linkly/index.js +31 -1
- package/lib/components/eftposPay/tyro/index.js +12 -0
- package/lib/components/list/List.js +3 -0
- package/lib/components/pay/toB/components/MX51/index.js +12 -37
- package/lib/components/pay/toB/types/index.d.ts +0 -12
- package/lib/components/shoppingCart/components/Cart/Product.js +7 -3
- package/lib/components/shoppingCart/type.d.ts +1 -0
- package/lib/components/ticketBooking/components/ProductDisplayAdapter/index.less +0 -12
- package/lib/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.d.ts +18 -0
- package/lib/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.js +118 -0
- package/lib/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.less +0 -0
- package/lib/components/ticketBooking/components/addServiceVariant/addService.d.ts +0 -2
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +279 -313
- package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -2
- package/lib/components/ticketBooking/components/addServiceVariant/index.js +5 -3
- package/lib/components/ticketBooking/components/addServiceVariant/utils.js +1 -2
- package/lib/components/ticketBooking/components/menuBar/index.js +42 -6
- package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +2 -4
- package/lib/components/ticketBooking/components/ticketBooking/index.js +12 -49
- package/lib/components/ticketBooking/components/ticketBooking/index.less +2 -1
- package/lib/components/ticketBooking/components/timeBar/index.d.ts +0 -1
- package/lib/components/ticketBooking/components/timeBar/index.js +1 -3
- package/lib/components/ticketBooking/hooks/pisellos/useProducts.d.ts +0 -4
- package/lib/components/ticketBooking/hooks/pisellos/useProducts.js +69 -98
- package/lib/components/ticketBooking/index.d.ts +0 -1
- package/lib/components/ticketBooking/index.js +0 -2
- package/lib/components/ticketBooking/serve.js +15 -117
- package/lib/components/ticketBooking/utils/index.d.ts +7 -1
- package/lib/components/ticketBooking/utils/index.js +29 -23
- package/lib/hooks/useEngineContext.d.ts +0 -1
- package/lib/hooks/useEngineContext.js +2 -10
- package/lib/index.d.ts +4 -0
- package/lib/index.js +12 -0
- package/lib/plus/clientCard/locales.js +3 -3
- package/lib/plus/clinetSearch/index.js +17 -8
- package/lib/plus/clinetSearch/locales.d.ts +3 -0
- package/lib/plus/clinetSearch/locales.js +7 -4
- package/lib/plus/clinetSearch/types.d.ts +12 -0
- package/lib/plus/contactInfo/components/Avatar/index.d.ts +10 -0
- package/lib/plus/contactInfo/components/Avatar/index.js +56 -0
- package/lib/plus/contactInfo/components/SwipeAction/index.d.ts +46 -0
- package/lib/plus/contactInfo/components/SwipeAction/index.js +373 -0
- package/lib/plus/contactInfo/components/SwipeAction/index.less +74 -0
- package/lib/plus/contactInfo/index.d.ts +6 -0
- package/lib/plus/contactInfo/index.js +226 -0
- package/lib/plus/contactInfo/index.less +621 -0
- package/lib/plus/contactInfo/locales.d.ts +15 -0
- package/lib/plus/contactInfo/locales.js +38 -0
- package/lib/plus/contactInfo/types.d.ts +91 -0
- package/lib/plus/contactInfo/types.js +17 -0
- package/lib/plus/contactInfo/utils.d.ts +7 -0
- package/lib/plus/contactInfo/utils.js +64 -0
- package/lib/plus/contactInfoModal/ContactInfoContent.d.ts +3 -0
- package/lib/plus/contactInfoModal/ContactInfoContent.js +129 -0
- package/lib/plus/contactInfoModal/index.d.ts +41 -0
- package/lib/plus/contactInfoModal/index.js +139 -0
- package/lib/plus/contactInfoModal/index.less +19 -0
- package/lib/plus/contactInfoModal/locales.d.ts +66 -0
- package/lib/plus/contactInfoModal/locales.js +89 -0
- package/lib/plus/productSelect/ProductCard/SkuCard/components/CardWrapper/index.js +1 -1
- package/lib/plus/productSelect/ProductCard/index.js +1 -1
- package/lib/plus/selectHolder/components/ErrorTip/index.d.ts +3 -0
- package/lib/plus/selectHolder/components/ErrorTip/index.js +30 -0
- package/lib/plus/selectHolder/components/ErrorTip/index.less +51 -0
- package/lib/plus/selectHolder/components/HolderItem/index.d.ts +6 -0
- package/lib/plus/selectHolder/components/HolderItem/index.js +101 -0
- package/lib/plus/selectHolder/components/HolderItem/index.less +105 -0
- package/lib/plus/selectHolder/components/HolderList/index.d.ts +30 -0
- package/lib/plus/selectHolder/components/HolderList/index.js +63 -0
- package/lib/plus/selectHolder/index.d.ts +7 -0
- package/lib/plus/selectHolder/index.js +223 -0
- package/lib/plus/selectHolder/index.less +137 -0
- package/lib/plus/selectHolder/locales.d.ts +24 -0
- package/lib/plus/selectHolder/locales.js +47 -0
- package/lib/plus/selectHolder/types.d.ts +104 -0
- package/lib/plus/selectHolder/types.js +17 -0
- package/lib/plus/selectHolder/utils.d.ts +9 -0
- package/lib/plus/selectHolder/utils.js +34 -0
- package/lib/pro/comprehensiveSearch/components/searchSection/locales.js +3 -3
- package/lib/pro/comprehensiveSearch/locales.js +1 -1
- package/lib/pro/multiDayTimeSelect/MultiDayTimeSelect.d.ts +9 -0
- package/lib/pro/multiDayTimeSelect/MultiDayTimeSelect.js +304 -0
- package/lib/pro/multiDayTimeSelect/MultiDayTimeSelect.less +8 -0
- package/lib/pro/multiDayTimeSelect/index.d.ts +3 -0
- package/lib/{hooks/printer.js → pro/multiDayTimeSelect/index.js} +6 -31
- package/lib/pro/multiDayTimeSelect/types.d.ts +28 -0
- package/lib/pro/multiDayTimeSelect/types.js +17 -0
- package/lib/pro/skuDetailModal/types.d.ts +1 -0
- package/lowcode/contact-info/fragments/cardStyle.ts +68 -0
- package/lowcode/contact-info/fragments/nameStyle.ts +33 -0
- package/lowcode/contact-info/fragments/pisellAvatar.ts +103 -0
- package/lowcode/contact-info/fragments/textStyle.ts +33 -0
- package/lowcode/contact-info/meta.ts +199 -0
- package/lowcode/contact-info-modal/meta.ts +98 -0
- package/lowcode/event-select-holder/meta.ts +2 -2
- package/lowcode/select-holder/meta.ts +220 -0
- package/lowcode/select-holder/snippets.ts +41 -0
- package/package.json +13 -11
- package/es/hooks/printer.d.ts +0 -4
- package/es/hooks/printer.js +0 -35
- package/lib/hooks/printer.d.ts +0 -4
|
@@ -17,7 +17,7 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
17
17
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
18
18
|
import React, { useRef, useState, useEffect, useCallback, useMemo, useImperativeHandle, forwardRef } from 'react';
|
|
19
19
|
import Decimal from 'decimal.js';
|
|
20
|
-
import { locales } from '@pisell/utils';
|
|
20
|
+
import { locales, webPrint } from '@pisell/utils';
|
|
21
21
|
import { getLocale } from "../../utils/locales";
|
|
22
22
|
import { useMemoizedFn } from 'ahooks';
|
|
23
23
|
import { createPortal } from 'react-dom';
|
|
@@ -46,7 +46,6 @@ 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 usePrinter from "../../hooks/printer";
|
|
50
49
|
import { DiscountKeyboard } from "../../pro/priceKeyboard";
|
|
51
50
|
import { useActiveExecute } from "../ticketBooking/hooks/pisellos";
|
|
52
51
|
|
|
@@ -150,8 +149,6 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
150
149
|
_useState18 = _slicedToArray(_useState17, 2),
|
|
151
150
|
walletPassData = _useState18[0],
|
|
152
151
|
setWalletPassData = _useState18[1];
|
|
153
|
-
var _usePrinter = usePrinter(),
|
|
154
|
-
nativePrint = _usePrinter.nativePrint;
|
|
155
152
|
var _useState19 = useState(false),
|
|
156
153
|
_useState20 = _slicedToArray(_useState19, 2),
|
|
157
154
|
syncingLock = _useState20[0],
|
|
@@ -806,12 +803,11 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
806
803
|
data: {
|
|
807
804
|
order_id: responseData.order_id,
|
|
808
805
|
machine_code_print_info: responseData === null || responseData === void 0 ? void 0 : responseData.machine_code_print_info,
|
|
809
|
-
small_ticket_data: responseData === null || responseData === void 0 || (_responseData$payment = responseData.payment_info) === null || _responseData$payment === void 0 ? void 0 : _responseData$payment.small_ticket_data
|
|
810
|
-
machine_code_print_info_v2: responseData === null || responseData === void 0 ? void 0 : responseData.machine_code_print_info_v2
|
|
806
|
+
small_ticket_data: responseData === null || responseData === void 0 || (_responseData$payment = responseData.payment_info) === null || _responseData$payment === void 0 ? void 0 : _responseData$payment.small_ticket_data
|
|
811
807
|
}
|
|
812
808
|
};
|
|
813
809
|
console.log('print_order_onOrderSynced_params>>>>', params);
|
|
814
|
-
|
|
810
|
+
webPrint(params, function (res) {
|
|
815
811
|
console.log('print_order_onOrderSynced_res>>>>', res);
|
|
816
812
|
});
|
|
817
813
|
} catch (error) {
|
|
@@ -1093,7 +1089,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1093
1089
|
}
|
|
1094
1090
|
};
|
|
1095
1091
|
try {
|
|
1096
|
-
|
|
1092
|
+
webPrint(params, function (res) {
|
|
1097
1093
|
console.log('handleButtonClick_print-receipt_res>>>>', res);
|
|
1098
1094
|
if (!(res !== null && res !== void 0 && res.result)) {
|
|
1099
1095
|
Toast === null || Toast === void 0 || Toast.error((res === null || res === void 0 ? void 0 : res.msg) || '');
|
|
@@ -1414,15 +1410,17 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
1414
1410
|
_useState34 = _slicedToArray(_useState33, 2),
|
|
1415
1411
|
showRetryModal = _useState34[0],
|
|
1416
1412
|
setShowRetryModal = _useState34[1];
|
|
1417
|
-
var _useState35 = useState(
|
|
1413
|
+
var _useState35 = useState(false),
|
|
1418
1414
|
_useState36 = _slicedToArray(_useState35, 2),
|
|
1419
|
-
|
|
1420
|
-
|
|
1415
|
+
showCreateErrorModal = _useState36[0],
|
|
1416
|
+
setShowCreateErrorModal = _useState36[1];
|
|
1417
|
+
var _useState37 = useState(editOrderId || 0),
|
|
1418
|
+
_useState38 = _slicedToArray(_useState37, 2),
|
|
1419
|
+
currentEditOrderId = _useState38[0],
|
|
1420
|
+
_setCurrentEditOrderId = _useState38[1];
|
|
1421
1421
|
var _useActiveExecute2 = useActiveExecute(),
|
|
1422
1422
|
executeIfActive = _useActiveExecute2.executeIfActive;
|
|
1423
1423
|
var Toast = useToast();
|
|
1424
|
-
var _usePrinter2 = usePrinter(),
|
|
1425
|
-
nativePrint = _usePrinter2.nativePrint;
|
|
1426
1424
|
|
|
1427
1425
|
// 重试处理函数(逻辑由用户自己实现)
|
|
1428
1426
|
var handleRetry = /*#__PURE__*/function () {
|
|
@@ -1554,18 +1552,18 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
1554
1552
|
}, []);
|
|
1555
1553
|
|
|
1556
1554
|
// 订单备注相关状态
|
|
1557
|
-
var
|
|
1558
|
-
_useState38 = _slicedToArray(_useState37, 2),
|
|
1559
|
-
noteModalOpen = _useState38[0],
|
|
1560
|
-
setNoteModalOpen = _useState38[1];
|
|
1561
|
-
var _useState39 = useState(''),
|
|
1555
|
+
var _useState39 = useState(false),
|
|
1562
1556
|
_useState40 = _slicedToArray(_useState39, 2),
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
var _useState41 = useState('
|
|
1557
|
+
noteModalOpen = _useState40[0],
|
|
1558
|
+
setNoteModalOpen = _useState40[1];
|
|
1559
|
+
var _useState41 = useState(''),
|
|
1566
1560
|
_useState42 = _slicedToArray(_useState41, 2),
|
|
1567
|
-
|
|
1568
|
-
|
|
1561
|
+
orderNote = _useState42[0],
|
|
1562
|
+
setOrderNote = _useState42[1];
|
|
1563
|
+
var _useState43 = useState('payment-content'),
|
|
1564
|
+
_useState44 = _slicedToArray(_useState43, 2),
|
|
1565
|
+
noteModalSource = _useState44[0],
|
|
1566
|
+
setNoteModalSource = _useState44[1];
|
|
1569
1567
|
|
|
1570
1568
|
// 订单备注相关处理函数
|
|
1571
1569
|
var handleNoteConfirm = /*#__PURE__*/function () {
|
|
@@ -2149,8 +2147,7 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
2149
2147
|
data: {
|
|
2150
2148
|
order_id: responseData.order_id,
|
|
2151
2149
|
machine_code_print_info: responseData === null || responseData === void 0 ? void 0 : responseData.machine_code_print_info,
|
|
2152
|
-
small_ticket_data: responseData === null || responseData === void 0 || (_responseData$payment3 = responseData.payment_info) === null || _responseData$payment3 === void 0 ? void 0 : _responseData$payment3.small_ticket_data
|
|
2153
|
-
machine_code_print_info_v2: responseData === null || responseData === void 0 ? void 0 : responseData.machine_code_print_info_v2
|
|
2150
|
+
small_ticket_data: responseData === null || responseData === void 0 || (_responseData$payment3 = responseData.payment_info) === null || _responseData$payment3 === void 0 ? void 0 : _responseData$payment3.small_ticket_data
|
|
2154
2151
|
}
|
|
2155
2152
|
};
|
|
2156
2153
|
console.log('print_order_onOrderSynced_params>>>>', params);
|
|
@@ -2161,7 +2158,7 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
2161
2158
|
params: params
|
|
2162
2159
|
}
|
|
2163
2160
|
});
|
|
2164
|
-
|
|
2161
|
+
webPrint(params, function (res) {
|
|
2165
2162
|
console.log('print_order_onOrderSynced_res>>>>', res);
|
|
2166
2163
|
logger === null || logger === void 0 || logger.addLog({
|
|
2167
2164
|
type: 'info',
|
|
@@ -2295,7 +2292,7 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
2295
2292
|
setOrderInfo(_orderInfo4);
|
|
2296
2293
|
isLocalOrderCreated.current = true;
|
|
2297
2294
|
case 42:
|
|
2298
|
-
_context23.next =
|
|
2295
|
+
_context23.next = 49;
|
|
2299
2296
|
break;
|
|
2300
2297
|
case 44:
|
|
2301
2298
|
_context23.prev = 44;
|
|
@@ -2308,7 +2305,9 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
2308
2305
|
error: _context23.t0
|
|
2309
2306
|
}
|
|
2310
2307
|
});
|
|
2311
|
-
|
|
2308
|
+
// 如果订单创建失败,弹出提示让重新加载 app
|
|
2309
|
+
setShowCreateErrorModal(true);
|
|
2310
|
+
case 49:
|
|
2312
2311
|
case "end":
|
|
2313
2312
|
return _context23.stop();
|
|
2314
2313
|
}
|
|
@@ -2440,7 +2439,7 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
2440
2439
|
}
|
|
2441
2440
|
};
|
|
2442
2441
|
try {
|
|
2443
|
-
|
|
2442
|
+
webPrint(params, function (res) {
|
|
2444
2443
|
console.log('handleButtonClick_print-receipt_res>>>>', res);
|
|
2445
2444
|
if (!(res !== null && res !== void 0 && res.result)) {
|
|
2446
2445
|
Toast === null || Toast === void 0 || Toast.error((res === null || res === void 0 ? void 0 : res.msg) || '');
|
|
@@ -2814,7 +2813,39 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
2814
2813
|
width: '100%',
|
|
2815
2814
|
marginTop: '80px'
|
|
2816
2815
|
}
|
|
2817
|
-
}, locales.getText('retry') || '重试')))
|
|
2816
|
+
}, locales.getText('retry') || '重试'))), /*#__PURE__*/React.createElement(PisellContainer, {
|
|
2817
|
+
renderType: "modal",
|
|
2818
|
+
props: {
|
|
2819
|
+
open: showCreateErrorModal,
|
|
2820
|
+
title: locales.getText('pisell2.checkout.tips'),
|
|
2821
|
+
footer: null,
|
|
2822
|
+
keyboard: false,
|
|
2823
|
+
onCancel: function onCancel() {
|
|
2824
|
+
setShowCreateErrorModal(false);
|
|
2825
|
+
} // 禁用关闭
|
|
2826
|
+
}
|
|
2827
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
2828
|
+
style: {
|
|
2829
|
+
textAlign: 'center',
|
|
2830
|
+
padding: '20px'
|
|
2831
|
+
}
|
|
2832
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
2833
|
+
style: {
|
|
2834
|
+
marginBottom: '16px',
|
|
2835
|
+
fontSize: '16px'
|
|
2836
|
+
}
|
|
2837
|
+
}, locales.getText('pisell2.checkout.order-create-failed')), /*#__PURE__*/React.createElement(Button, {
|
|
2838
|
+
type: "primary",
|
|
2839
|
+
size: "large",
|
|
2840
|
+
onClick: function onClick() {
|
|
2841
|
+
setShowCreateErrorModal(false);
|
|
2842
|
+
window.location.reload();
|
|
2843
|
+
},
|
|
2844
|
+
style: {
|
|
2845
|
+
width: '100%',
|
|
2846
|
+
marginTop: '80px'
|
|
2847
|
+
}
|
|
2848
|
+
}, locales.getText('confirm') || '确认'))));
|
|
2818
2849
|
};
|
|
2819
2850
|
|
|
2820
2851
|
// 导出类型供外部使用
|
|
@@ -14,8 +14,8 @@ import useEngineContext from "../../../../hooks/useEngineContext";
|
|
|
14
14
|
import { locales, formatAmount } from '@pisell/utils';
|
|
15
15
|
import checkoutLocales from "../../locales";
|
|
16
16
|
import useToast from "../../../../hooks/useToast";
|
|
17
|
-
import { useDebounceFn } from 'ahooks';
|
|
18
17
|
import { CashKeyboard } from "../../../../pro/priceKeyboard";
|
|
18
|
+
import { useDebounceFn } from 'ahooks';
|
|
19
19
|
import "./index.less";
|
|
20
20
|
export function CashPaymentModule(_ref) {
|
|
21
21
|
var amountSymbol = _ref.amountSymbol,
|
|
@@ -65,12 +65,6 @@ export function CashPaymentModule(_ref) {
|
|
|
65
65
|
|
|
66
66
|
// 检查是否应该禁用输入框:原本disabled为true 或者 订单金额为0
|
|
67
67
|
var isInputDisabled = disabled || Number(customAmount || 0) === 0;
|
|
68
|
-
var handleAmountClick = function handleAmountClick(clickedAmount) {
|
|
69
|
-
if (isAmountButtonsDisabled) return;
|
|
70
|
-
var amountStr = clickedAmount.toString();
|
|
71
|
-
setAmount(amountStr);
|
|
72
|
-
setRoundingAmount(0);
|
|
73
|
-
};
|
|
74
68
|
var handleCashPayInternal = function handleCashPayInternal() {
|
|
75
69
|
if (isAmountButtonsDisabled) return;
|
|
76
70
|
if (onPaymentComplete) {
|
|
@@ -241,7 +241,6 @@ var ScrollableList = function ScrollableList(_ref) {
|
|
|
241
241
|
style: getGridStyle()
|
|
242
242
|
}, children)), isScrollable && /*#__PURE__*/React.createElement("button", {
|
|
243
243
|
style: _objectSpread(_objectSpread({}, bottomGradientStyle), {}, {
|
|
244
|
-
width: '100%',
|
|
245
244
|
border: 'none',
|
|
246
245
|
background: 'linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #A78BE1 100%)'
|
|
247
246
|
}, gradientStyle),
|
|
@@ -154,6 +154,7 @@ declare const _default: {
|
|
|
154
154
|
'wallet-pass-module-customer-name-walk-in': string;
|
|
155
155
|
'pisell2.amount-summary.amount-cannot-be-zero': string;
|
|
156
156
|
'pisell2.checkout.order-sync-failed': string;
|
|
157
|
+
'pisell2.checkout.order-create-failed': string;
|
|
157
158
|
'pisell2.checkout.sync-retry-hint': string;
|
|
158
159
|
'pisell2.checkout.tips': string;
|
|
159
160
|
retry: string;
|
|
@@ -322,6 +323,7 @@ declare const _default: {
|
|
|
322
323
|
'wallet-pass-module-customer-name-walk-in': string;
|
|
323
324
|
'pisell2.amount-summary.amount-cannot-be-zero': string;
|
|
324
325
|
'pisell2.checkout.order-sync-failed': string;
|
|
326
|
+
'pisell2.checkout.order-create-failed': string;
|
|
325
327
|
'pisell2.checkout.sync-retry-hint': string;
|
|
326
328
|
'pisell2.checkout.tips': string;
|
|
327
329
|
retry: string;
|
|
@@ -490,6 +492,7 @@ declare const _default: {
|
|
|
490
492
|
'wallet-pass-module-customer-name-walk-in': string;
|
|
491
493
|
'pisell2.amount-summary.amount-cannot-be-zero': string;
|
|
492
494
|
'pisell2.checkout.order-sync-failed': string;
|
|
495
|
+
'pisell2.checkout.order-create-failed': string;
|
|
493
496
|
'pisell2.checkout.sync-retry-hint': string;
|
|
494
497
|
'pisell2.checkout.tips': string;
|
|
495
498
|
retry: string;
|
|
@@ -200,6 +200,7 @@ export default {
|
|
|
200
200
|
'pisell2.amount-summary.amount-cannot-be-zero': 'The amount cannot be 0',
|
|
201
201
|
// Order sync errors
|
|
202
202
|
'pisell2.checkout.order-sync-failed': 'Order sync failed, please check your network',
|
|
203
|
+
'pisell2.checkout.order-create-failed': 'Order create failed, please refresh app',
|
|
203
204
|
'pisell2.checkout.sync-retry-hint': 'Network error, please click the retry button to resync the order',
|
|
204
205
|
'pisell2.checkout.tips': 'Tips',
|
|
205
206
|
'retry': 'Retry',
|
|
@@ -418,6 +419,7 @@ export default {
|
|
|
418
419
|
'pisell2.amount-summary.amount-cannot-be-zero': '金额不能为0',
|
|
419
420
|
// Order sync errors
|
|
420
421
|
'pisell2.checkout.order-sync-failed': '订单同步失败,请检查网络',
|
|
422
|
+
'pisell2.checkout.order-create-failed': '订单创建失败,请重启APP',
|
|
421
423
|
'pisell2.checkout.sync-retry-hint': '网络异常,请点击重试按钮重新同步订单',
|
|
422
424
|
'pisell2.checkout.tips': '提示',
|
|
423
425
|
'retry': '重试',
|
|
@@ -636,6 +638,7 @@ export default {
|
|
|
636
638
|
'pisell2.amount-summary.amount-cannot-be-zero': '金額不能為0',
|
|
637
639
|
// Order sync errors
|
|
638
640
|
'pisell2.checkout.order-sync-failed': '訂單同步失敗,請檢查網絡',
|
|
641
|
+
'pisell2.checkout.order-create-failed': '订单创建失败,请重启APP',
|
|
639
642
|
'pisell2.checkout.sync-retry-hint': '網絡異常,請點擊重試按鈕重新同步訂單',
|
|
640
643
|
'pisell2.checkout.tips': '提示',
|
|
641
644
|
'retry': '重試',
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
3
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
2
5
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
6
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
7
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -6,7 +9,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
6
9
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
10
|
import React, { useEffect, useRef } from 'react';
|
|
8
11
|
import { Button } from 'antd';
|
|
9
|
-
import { locales } from '@pisell/utils';
|
|
12
|
+
import { locales, sendWarningLog } from '@pisell/utils';
|
|
10
13
|
import { useContextData, useDispatch, updateCustom, updateState, updateNextStep } from "../store";
|
|
11
14
|
import { useFail, useStoreRef } from "../hooks";
|
|
12
15
|
import useEngineContext from "../../../hooks/useEngineContext";
|
|
@@ -101,6 +104,7 @@ var Linkly = function Linkly(_ref) {
|
|
|
101
104
|
failRef.current = fail;
|
|
102
105
|
}, [fail]);
|
|
103
106
|
useEffect(function () {
|
|
107
|
+
var _utils$isTerminal, _utils$interaction;
|
|
104
108
|
if (statusRef.current === StatusEnum.Success || statusRef.current === StatusEnum.Fail) {
|
|
105
109
|
return;
|
|
106
110
|
}
|
|
@@ -114,7 +118,65 @@ var Linkly = function Linkly(_ref) {
|
|
|
114
118
|
resultQuery();
|
|
115
119
|
return;
|
|
116
120
|
}
|
|
117
|
-
|
|
121
|
+
|
|
122
|
+
// 如果是terminal环境,判定当前页面是否处于活跃状态
|
|
123
|
+
if (utils !== null && utils !== void 0 && (_utils$isTerminal = utils.isTerminal) !== null && _utils$isTerminal !== void 0 && _utils$isTerminal.call(utils) && utils !== null && utils !== void 0 && (_utils$interaction = utils.interaction) !== null && _utils$interaction !== void 0 && (_utils$interaction = _utils$interaction.utils) !== null && _utils$interaction !== void 0 && _utils$interaction.asyncDataManager) {
|
|
124
|
+
var _payOrRefund = /*#__PURE__*/function () {
|
|
125
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
126
|
+
var _utils$interaction2, _utils$interaction2$a, activeStatus;
|
|
127
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
128
|
+
while (1) switch (_context.prev = _context.next) {
|
|
129
|
+
case 0:
|
|
130
|
+
_context.prev = 0;
|
|
131
|
+
_context.next = 3;
|
|
132
|
+
return utils === null || utils === void 0 || (_utils$interaction2 = utils.interaction) === null || _utils$interaction2 === void 0 || (_utils$interaction2 = _utils$interaction2.utils) === null || _utils$interaction2 === void 0 || (_utils$interaction2$a = _utils$interaction2.asyncDataManager) === null || _utils$interaction2$a === void 0 ? void 0 : _utils$interaction2$a.call(_utils$interaction2, {
|
|
133
|
+
module: 'get',
|
|
134
|
+
key: 'pay_webview_active'
|
|
135
|
+
});
|
|
136
|
+
case 3:
|
|
137
|
+
activeStatus = _context.sent;
|
|
138
|
+
// 强判定不为 unActive 则进行支付,为了兼容老版本
|
|
139
|
+
if (activeStatus !== 'unActive') {
|
|
140
|
+
payOrRefund(resultQuery, handleLinklySuccess);
|
|
141
|
+
} else {
|
|
142
|
+
sendWarningLog({
|
|
143
|
+
title: 'Linkly-支付-当前页面非活跃状态,无法进行支付',
|
|
144
|
+
content: [{
|
|
145
|
+
key: 'response',
|
|
146
|
+
value: JSON.stringify({
|
|
147
|
+
activeStatus: activeStatus
|
|
148
|
+
})
|
|
149
|
+
}]
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
_context.next = 11;
|
|
153
|
+
break;
|
|
154
|
+
case 7:
|
|
155
|
+
_context.prev = 7;
|
|
156
|
+
_context.t0 = _context["catch"](0);
|
|
157
|
+
sendWarningLog({
|
|
158
|
+
title: 'Linkly-支付-获取当前页面活跃状态失败',
|
|
159
|
+
content: [{
|
|
160
|
+
key: 'error',
|
|
161
|
+
value: JSON.stringify(_context.t0)
|
|
162
|
+
}]
|
|
163
|
+
});
|
|
164
|
+
// 如果获取活跃状态失败,则进行支付,防止流程卡死
|
|
165
|
+
payOrRefund(resultQuery, handleLinklySuccess);
|
|
166
|
+
case 11:
|
|
167
|
+
case "end":
|
|
168
|
+
return _context.stop();
|
|
169
|
+
}
|
|
170
|
+
}, _callee, null, [[0, 7]]);
|
|
171
|
+
}));
|
|
172
|
+
return function _payOrRefund() {
|
|
173
|
+
return _ref2.apply(this, arguments);
|
|
174
|
+
};
|
|
175
|
+
}();
|
|
176
|
+
_payOrRefund();
|
|
177
|
+
} else {
|
|
178
|
+
payOrRefund(resultQuery, handleLinklySuccess);
|
|
179
|
+
}
|
|
118
180
|
}, []);
|
|
119
181
|
useEffect(function () {
|
|
120
182
|
return function () {
|
|
@@ -180,6 +180,12 @@ export default (function (_ref) {
|
|
|
180
180
|
response: {},
|
|
181
181
|
metadata: {
|
|
182
182
|
receipt: []
|
|
183
|
+
},
|
|
184
|
+
_config: {
|
|
185
|
+
retry: {
|
|
186
|
+
count: 10,
|
|
187
|
+
delay: 500
|
|
188
|
+
}
|
|
183
189
|
}
|
|
184
190
|
}).then(function (res) {
|
|
185
191
|
requestIdRef.current = res.data.id;
|
|
@@ -254,6 +260,12 @@ export default (function (_ref) {
|
|
|
254
260
|
response: {},
|
|
255
261
|
metadata: {
|
|
256
262
|
receipt: []
|
|
263
|
+
},
|
|
264
|
+
_config: {
|
|
265
|
+
retry: {
|
|
266
|
+
count: 10,
|
|
267
|
+
delay: 500
|
|
268
|
+
}
|
|
257
269
|
}
|
|
258
270
|
}).then(function (res) {
|
|
259
271
|
requestIdRef.current = res.data.id;
|
|
@@ -179,6 +179,9 @@ var List = function List(props) {
|
|
|
179
179
|
var processedData = useMemo(function () {
|
|
180
180
|
// 如果正在加载且没有数据,使用模拟数据
|
|
181
181
|
var sourceData = loading ? MOCK_LIST_DATA : data || [];
|
|
182
|
+
console.log("processedData recalculating: tabStyle=".concat(tabStyle, ", activeTab=").concat(activeTab, ", tabItems=").concat(tabItems.length, ", dataLength=").concat(sourceData.length));
|
|
183
|
+
console.log("sourceData sample: ".concat(JSON.stringify(sourceData.slice(0, 2), null, 2)));
|
|
184
|
+
console.log("tabGroup: ".concat(tabGroup));
|
|
182
185
|
|
|
183
186
|
// 如果tab样式是anchor,需要按分组显示数据
|
|
184
187
|
if (tabStyle === 'anchor' && tabItems.length > 0) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { forwardRef, useImperativeHandle } from 'react';
|
|
2
|
+
import { webPayment } from '@pisell/utils';
|
|
2
3
|
import useLogger from "../../../../../hooks/useLogger";
|
|
3
|
-
import useEngineContext from "../../../../../hooks/useEngineContext";
|
|
4
4
|
var getUuid = function getUuid() {
|
|
5
5
|
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxx'.replace(/[xy]/g, function (c) {
|
|
6
6
|
var r = Math.random() * 16 | 0;
|
|
@@ -9,10 +9,7 @@ var getUuid = function getUuid() {
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
var MX51 = function MX51(props, ref) {
|
|
12
|
-
var _context$appHelper;
|
|
13
12
|
var logger = useLogger();
|
|
14
|
-
var context = useEngineContext();
|
|
15
|
-
var action = context === null || context === void 0 || (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 || (_context$appHelper = _context$appHelper.utils) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.action;
|
|
16
13
|
var onOpen = function onOpen(_ref) {
|
|
17
14
|
var data = _ref.data,
|
|
18
15
|
payCallback = _ref.payCallback;
|
|
@@ -36,47 +33,20 @@ var MX51 = function MX51(props, ref) {
|
|
|
36
33
|
params: newData
|
|
37
34
|
}
|
|
38
35
|
});
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
// 判断是否是同一个支付
|
|
50
|
-
isSame = (_res === null || _res === void 0 ? void 0 : _res.uniquePaymentNumber) === uniquePaymentNumber;
|
|
51
|
-
if (isSame) {
|
|
52
|
-
payCallback === null || payCallback === void 0 || payCallback(_res);
|
|
53
|
-
}
|
|
54
|
-
} else {
|
|
55
|
-
var _res2$data, _res2$data2;
|
|
56
|
-
// 原生调用场景结果
|
|
57
|
-
var _res2 = res;
|
|
58
|
-
// 转换为MX51PayResult类型,上层调用需要
|
|
59
|
-
var newRes = {
|
|
60
|
-
result: (_res2 === null || _res2 === void 0 ? void 0 : _res2.code) == '200' ? true : false,
|
|
61
|
-
msg: _res2 === null || _res2 === void 0 ? void 0 : _res2.msg,
|
|
62
|
-
amount: _res2 === null || _res2 === void 0 || (_res2$data = _res2.data) === null || _res2$data === void 0 ? void 0 : _res2$data.amount,
|
|
63
|
-
surcharge: _res2 === null || _res2 === void 0 || (_res2$data2 = _res2.data) === null || _res2$data2 === void 0 ? void 0 : _res2$data2.surcharge,
|
|
64
|
-
uniquePaymentNumber: _res2 === null || _res2 === void 0 ? void 0 : _res2.uuid
|
|
65
|
-
};
|
|
66
|
-
// 判断是否是同一个支付
|
|
67
|
-
isSame = (_res2 === null || _res2 === void 0 ? void 0 : _res2.uuid) === uniquePaymentNumber;
|
|
68
|
-
if (isSame) {
|
|
69
|
-
payCallback === null || payCallback === void 0 || payCallback(newRes);
|
|
70
|
-
}
|
|
36
|
+
// 通过jsbridge调用mx51支付
|
|
37
|
+
webPayment(newData, function (res) {
|
|
38
|
+
// 判断是否是同一个支付
|
|
39
|
+
var isSame = (res === null || res === void 0 ? void 0 : res.uniquePaymentNumber) === uniquePaymentNumber;
|
|
40
|
+
logger === null || logger === void 0 || logger.addLog({
|
|
41
|
+
type: 'info',
|
|
42
|
+
title: 'ToB_MX51_onOpen_callback',
|
|
43
|
+
metadata: {
|
|
44
|
+
msg: isSame ? 'uniquePaymentNumber一致' : 'uniquePaymentNumber不一致',
|
|
45
|
+
res: res
|
|
71
46
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
metadata: {
|
|
76
|
-
msg: isSame ? '交易流水号一致' : '交易流水号不一致',
|
|
77
|
-
res: res
|
|
78
|
-
}
|
|
79
|
-
});
|
|
47
|
+
});
|
|
48
|
+
if (isSame) {
|
|
49
|
+
payCallback === null || payCallback === void 0 || payCallback(res);
|
|
80
50
|
}
|
|
81
51
|
});
|
|
82
52
|
};
|
|
@@ -58,15 +58,3 @@ export interface MX51PayResult {
|
|
|
58
58
|
surcharge: number;
|
|
59
59
|
uniquePaymentNumber: string;
|
|
60
60
|
}
|
|
61
|
-
/**
|
|
62
|
-
* @title 原生MX51支付结果
|
|
63
|
-
*/
|
|
64
|
-
export interface NativeMX51PayResult {
|
|
65
|
-
code: string;
|
|
66
|
-
msg?: string;
|
|
67
|
-
data: {
|
|
68
|
-
amount: number;
|
|
69
|
-
surcharge: number;
|
|
70
|
-
};
|
|
71
|
-
uuid: string;
|
|
72
|
-
}
|
|
@@ -33,6 +33,7 @@ var Product = function Product(props) {
|
|
|
33
33
|
platform = state.platform,
|
|
34
34
|
isShowChangeResource = state.isShowChangeResource,
|
|
35
35
|
isShowDelete = state.isShowDelete,
|
|
36
|
+
isShowAmountFooter = state.isShowAmountFooter,
|
|
36
37
|
isShowChangeHolder = state.isShowChangeHolder,
|
|
37
38
|
isShowHolder = state.isShowHolder,
|
|
38
39
|
isShowAddHolderButton = state.isShowAddHolderButton,
|
|
@@ -75,15 +76,17 @@ var Product = function Product(props) {
|
|
|
75
76
|
isShowDelete: isShowDelete,
|
|
76
77
|
isShowHolder: isShowHolder,
|
|
77
78
|
isShowAddHolderButton: isShowAddHolderButton,
|
|
78
|
-
isShowEditProduct: isShowEditProduct
|
|
79
|
+
isShowEditProduct: isShowEditProduct,
|
|
80
|
+
isShowAmountFooter: isShowAmountFooter
|
|
79
81
|
};
|
|
80
|
-
}, [isShowNote, isShowPackageNote, disabledEdit, isShowChangeResource, isShowDelete, isShowHolder, isShowAddHolderButton, isShowChangeHolder, isShowEditProduct]);
|
|
82
|
+
}, [isShowNote, isShowPackageNote, disabledEdit, isShowChangeResource, isShowDelete, isShowHolder, isShowAddHolderButton, isShowChangeHolder, isShowEditProduct, isShowAmountFooter]);
|
|
81
83
|
var getProductCardStyleProps = useMemoizedFn(function (type) {
|
|
82
84
|
var conf = productCardStyleConfig["".concat(type, "_product_card_style")];
|
|
83
85
|
if (state.scenario !== 'booking2') return {};
|
|
84
86
|
return {
|
|
85
87
|
isShowImage: conf === null || conf === void 0 ? void 0 : conf.show_product_image,
|
|
86
|
-
isShowDelete: conf === null || conf === void 0 ? void 0 : conf.show_remove_button,
|
|
88
|
+
isShowDelete: (conf === null || conf === void 0 ? void 0 : conf.show_remove_button) && isShowDelete,
|
|
89
|
+
isShowAmountFooter: isShowAmountFooter,
|
|
87
90
|
disabledEdit: true
|
|
88
91
|
};
|
|
89
92
|
});
|
|
@@ -1,18 +1,6 @@
|
|
|
1
1
|
.sku-list-container {
|
|
2
2
|
height: 100%;
|
|
3
3
|
background-color: #4e4e4e;
|
|
4
|
-
.empty-content {
|
|
5
|
-
.empty-icon-wrapper {
|
|
6
|
-
.empty-default-icon {
|
|
7
|
-
color: rgba(255, 255, 255, 0.8) !important;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
.empty-inner {
|
|
11
|
-
.empty-text {
|
|
12
|
-
color: rgba(255, 255, 255, 0.8) !important;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
4
|
.sku-list {
|
|
17
5
|
background-color: #4e4e4e;
|
|
18
6
|
overflow: auto;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Dayjs } from 'dayjs';
|
|
3
|
+
import './MultiDayTimeSelectModal.less';
|
|
4
|
+
interface MultiDayTimeSelectModalProps {
|
|
5
|
+
open: boolean;
|
|
6
|
+
productName?: string;
|
|
7
|
+
locale?: string;
|
|
8
|
+
defaultStartDate?: Dayjs;
|
|
9
|
+
loading?: boolean;
|
|
10
|
+
/** 最大天数,默认30天 */
|
|
11
|
+
maxDays?: number;
|
|
12
|
+
/** 开始时间和结束时间是否分离 */
|
|
13
|
+
separateStartEnd?: boolean;
|
|
14
|
+
onConfirm: (startDate: Dayjs, endDate: Dayjs, duration: number) => void;
|
|
15
|
+
onCancel: () => void;
|
|
16
|
+
}
|
|
17
|
+
declare const MultiDayTimeSelectModal: React.FC<MultiDayTimeSelectModalProps>;
|
|
18
|
+
export default MultiDayTimeSelectModal;
|