@pisell/private-materials 6.8.7 → 6.8.9
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 +7 -7
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +7 -7
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +7 -7
- package/es/components/appointmentBooking/components/Cart/Item/index.js +1 -0
- package/es/components/appointmentBooking/components/Voucher/index.js +16 -0
- package/es/components/booking/addons/model.d.ts +1 -10
- package/es/components/booking/components/actionButtons/index.js +34 -16
- package/es/components/booking/components/footer/amount.js +25 -8
- package/es/components/booking/components/footer/index.js +67 -35
- package/es/components/booking/components/footer/utils.d.ts +7 -0
- package/es/components/booking/components/footer/utils.js +66 -42
- package/es/components/booking/components/voucher/index.js +58 -14
- 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/useQuotation.js +69 -21
- package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -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/model.d.ts +1 -10
- package/es/components/booking/info/service/Lists.d.ts +1 -1
- package/es/components/booking/info/service/Lists.js +8 -2
- package/es/components/booking/info/service/serve.d.ts +14 -0
- package/es/components/booking/info/service/serve.js +21 -0
- 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 +84 -36
- package/es/components/booking/info/utils.js +5 -0
- package/es/components/booking/info2/cartClientCard/index.js +23 -5
- package/es/components/booking/info2/service/addService/index.js +146 -88
- package/es/components/booking/info2/service/addService/utils.d.ts +8 -0
- package/es/components/booking/info2/service/addService/utils.js +78 -9
- 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 +332 -76
- package/es/components/booking/info2/utilsByBooking.js +14 -5
- package/es/components/booking/locales.d.ts +30 -0
- package/es/components/booking/locales.js +39 -3
- package/es/components/booking/model.d.ts +1 -9
- package/es/components/booking/notes/model.d.ts +1 -10
- package/es/components/booking/payments/model.d.ts +1 -10
- package/es/components/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 +11 -3
- package/es/components/booking/utils.js +24 -1
- package/es/components/checkout/PaymentModal.js +15 -10
- package/es/components/eftpos/hooks.d.ts +0 -1
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/store/index.d.ts +2 -2
- package/es/components/eftposPay/tyro/hooks.d.ts +0 -1
- package/es/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
- package/es/components/index.d.ts +1 -2
- package/es/components/index.js +1 -2
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
- package/es/components/pay/toC/model.d.ts +1 -9
- package/es/components/schedules/model.d.ts +1 -9
- package/es/components/shoppingCart/components/Cart/Product.js +6 -3
- package/es/components/shoppingCart/components/Empty/index.d.ts +0 -1
- package/es/components/shoppingCart/type.d.ts +1 -0
- package/es/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.d.ts +18 -0
- package/es/components/{wallet/Detail/serve.js → ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.js} +112 -57
- package/es/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.less +0 -0
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +19 -15
- package/es/components/ticketBooking/components/addServiceVariant/index.js +4 -0
- package/es/components/ticketBooking/components/ticketBooking/index.js +14 -11
- package/es/components/ticketBooking/utils/index.d.ts +10 -2
- package/es/components/ticketBooking/utils/index.js +37 -7
- package/es/components/walletList/index.d.ts +0 -24
- package/es/components/walletList/index.js +173 -41
- package/es/components/walletList/locales.d.ts +9 -0
- package/es/components/walletList/locales.js +12 -3
- package/es/components/walletList/serve.d.ts +19 -0
- package/es/components/walletList/serve.js +94 -5
- package/es/components/walletList/tempHolderSelector/index.d.ts +14 -0
- package/es/components/walletList/tempHolderSelector/index.js +196 -0
- package/es/components/walletList/tempHolderSelector/index.less +63 -0
- package/es/hooks/usePaymentLogger.d.ts +0 -1
- package/es/index.d.ts +2 -1
- package/es/index.js +2 -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/plus/walletEditor/WalletEditor.js +60 -2
- package/es/plus/walletEditor/locales.d.ts +9 -0
- package/es/plus/walletEditor/locales.js +12 -3
- package/es/plus/walletPassGallery/components/passList/index.d.ts +1 -0
- package/es/plus/walletPassGallery/components/passList/index.js +17 -5
- package/es/plus/walletPassGallery/index.js +223 -41
- package/es/plus/walletPassGallery/locales.d.ts +15 -0
- package/es/plus/walletPassGallery/locales.js +29 -5
- package/es/plus/walletPassGallery/serve.d.ts +15 -1
- package/es/plus/walletPassGallery/serve.js +59 -2
- package/es/plus/walletPassGallery/utils.d.ts +48 -0
- package/es/plus/walletPassGallery/utils.js +342 -0
- package/es/pro/multiDayTimeSelect/MultiDayTimeSelect.d.ts +9 -0
- package/es/pro/multiDayTimeSelect/MultiDayTimeSelect.js +355 -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.js +1 -0
- package/lib/components/appointmentBooking/components/Voucher/index.js +17 -0
- package/lib/components/booking/addons/model.d.ts +1 -10
- package/lib/components/booking/components/actionButtons/index.js +11 -0
- package/lib/components/booking/components/footer/amount.js +23 -6
- package/lib/components/booking/components/footer/index.js +25 -4
- package/lib/components/booking/components/footer/utils.d.ts +7 -0
- package/lib/components/booking/components/footer/utils.js +41 -29
- package/lib/components/booking/components/voucher/index.js +48 -6
- 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/useQuotation.js +45 -13
- package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
- 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/model.d.ts +1 -10
- package/lib/components/booking/info/service/Lists.d.ts +1 -1
- package/lib/components/booking/info/service/Lists.js +4 -2
- package/lib/components/booking/info/service/serve.d.ts +14 -0
- package/lib/components/booking/info/service/serve.js +5 -0
- 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 +32 -16
- package/lib/components/booking/info/utils.js +4 -0
- package/lib/components/booking/info2/cartClientCard/index.js +11 -0
- package/lib/components/booking/info2/service/addService/index.js +22 -2
- package/lib/components/booking/info2/service/addService/utils.d.ts +8 -0
- package/lib/components/booking/info2/service/addService/utils.js +47 -9
- 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 +273 -38
- package/lib/components/booking/info2/utilsByBooking.js +19 -8
- package/lib/components/booking/locales.d.ts +30 -0
- package/lib/components/booking/locales.js +33 -3
- package/lib/components/booking/model.d.ts +1 -9
- package/lib/components/booking/notes/model.d.ts +1 -10
- package/lib/components/booking/payments/model.d.ts +1 -10
- package/lib/components/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 +11 -3
- package/lib/components/booking/utils.js +15 -0
- package/lib/components/checkout/PaymentModal.js +5 -2
- package/lib/components/eftpos/hooks.d.ts +0 -1
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/store/index.d.ts +2 -2
- package/lib/components/eftposPay/tyro/hooks.d.ts +0 -1
- package/lib/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
- package/lib/components/index.d.ts +1 -2
- package/lib/components/index.js +0 -3
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
- package/lib/components/pay/toC/model.d.ts +1 -9
- package/lib/components/schedules/model.d.ts +1 -9
- package/lib/components/shoppingCart/components/Cart/Product.js +7 -3
- package/lib/components/shoppingCart/components/Empty/index.d.ts +0 -1
- package/lib/components/shoppingCart/type.d.ts +1 -0
- 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.js +10 -9
- package/lib/components/ticketBooking/components/addServiceVariant/index.js +4 -0
- package/lib/components/ticketBooking/components/ticketBooking/index.js +0 -16
- package/lib/components/ticketBooking/utils/index.d.ts +10 -2
- package/lib/components/ticketBooking/utils/index.js +31 -6
- package/lib/components/walletList/index.d.ts +0 -24
- package/lib/components/walletList/index.js +100 -4
- package/lib/components/walletList/locales.d.ts +9 -0
- package/lib/components/walletList/locales.js +12 -3
- package/lib/components/walletList/serve.d.ts +19 -0
- package/lib/components/walletList/serve.js +26 -3
- package/lib/components/walletList/tempHolderSelector/index.d.ts +14 -0
- package/lib/components/walletList/tempHolderSelector/index.js +166 -0
- package/lib/components/walletList/tempHolderSelector/index.less +63 -0
- package/lib/hooks/usePaymentLogger.d.ts +0 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.js +6 -3
- package/lib/plus/selectHolder/components/ErrorTip/index.d.ts +3 -0
- package/lib/{components/wallet/PointCard/model.js → plus/selectHolder/components/ErrorTip/index.js} +10 -23
- 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/{components/wallet/components/WalletBar → plus/selectHolder/components/HolderList}/index.js +29 -15
- 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/{components/wallet/Voucher → plus/selectHolder}/locales.js +17 -14
- 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/{components/wallet/RechargeableCard/serve.js → plus/selectHolder/utils.js} +11 -10
- package/lib/plus/walletEditor/WalletEditor.js +53 -0
- package/lib/plus/walletEditor/locales.d.ts +9 -0
- package/lib/plus/walletEditor/locales.js +12 -3
- package/lib/plus/walletPassGallery/components/passList/index.d.ts +1 -0
- package/lib/plus/walletPassGallery/components/passList/index.js +16 -4
- package/lib/plus/walletPassGallery/index.js +154 -27
- package/lib/plus/walletPassGallery/locales.d.ts +15 -0
- package/lib/plus/walletPassGallery/locales.js +32 -5
- package/lib/plus/walletPassGallery/serve.d.ts +15 -1
- package/lib/plus/walletPassGallery/serve.js +17 -5
- package/lib/plus/walletPassGallery/utils.d.ts +48 -0
- package/lib/plus/walletPassGallery/utils.js +287 -0
- package/lib/pro/multiDayTimeSelect/MultiDayTimeSelect.d.ts +9 -0
- package/lib/pro/multiDayTimeSelect/MultiDayTimeSelect.js +290 -0
- package/lib/pro/multiDayTimeSelect/MultiDayTimeSelect.less +8 -0
- package/lib/pro/multiDayTimeSelect/index.d.ts +3 -0
- package/lib/{components/wallet/components → pro/multiDayTimeSelect}/index.js +6 -16
- 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/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 +4 -4
- package/es/components/pay/toC/PaymentMethods/MWCreditCard/tds2.d.ts +0 -61
- package/es/components/wallet/Detail/index.d.ts +0 -42
- package/es/components/wallet/Detail/index.js +0 -1182
- package/es/components/wallet/Detail/index.less +0 -386
- package/es/components/wallet/Detail/locales.d.ts +0 -153
- package/es/components/wallet/Detail/locales.js +0 -170
- package/es/components/wallet/Detail/model.d.ts +0 -13
- package/es/components/wallet/Detail/model.js +0 -22
- package/es/components/wallet/Detail/serve.d.ts +0 -39
- package/es/components/wallet/DetailContext.d.ts +0 -25
- package/es/components/wallet/DetailContext.js +0 -162
- package/es/components/wallet/DiscountCard/index.d.ts +0 -3
- package/es/components/wallet/DiscountCard/index.js +0 -218
- package/es/components/wallet/DiscountCard/index.less +0 -9
- package/es/components/wallet/DiscountCard/model.d.ts +0 -14
- package/es/components/wallet/DiscountCard/model.js +0 -22
- package/es/components/wallet/PointCard/index.d.ts +0 -3
- package/es/components/wallet/PointCard/index.js +0 -169
- package/es/components/wallet/PointCard/index.less +0 -9
- package/es/components/wallet/PointCard/model.d.ts +0 -13
- package/es/components/wallet/PointCard/model.js +0 -22
- package/es/components/wallet/RechargeableCard/index.d.ts +0 -13
- package/es/components/wallet/RechargeableCard/index.js +0 -463
- package/es/components/wallet/RechargeableCard/index.less +0 -108
- package/es/components/wallet/RechargeableCard/model.d.ts +0 -29
- package/es/components/wallet/RechargeableCard/model.js +0 -28
- package/es/components/wallet/RechargeableCard/serve.d.ts +0 -23
- package/es/components/wallet/RechargeableCard/serve.js +0 -32
- package/es/components/wallet/Voucher/index.d.ts +0 -12
- package/es/components/wallet/Voucher/index.js +0 -131
- package/es/components/wallet/Voucher/index.less +0 -9
- package/es/components/wallet/Voucher/locales.d.ts +0 -21
- package/es/components/wallet/Voucher/locales.js +0 -20
- package/es/components/wallet/Voucher/model.d.ts +0 -13
- package/es/components/wallet/Voucher/model.js +0 -22
- package/es/components/wallet/carouselArrow.png +0 -0
- package/es/components/wallet/components/FooterButtons/index.d.ts +0 -18
- package/es/components/wallet/components/FooterButtons/index.js +0 -81
- package/es/components/wallet/components/FooterButtons/index.less +0 -91
- package/es/components/wallet/components/UsageRules/index.d.ts +0 -23
- package/es/components/wallet/components/UsageRules/index.js +0 -147
- package/es/components/wallet/components/UsageRules/index.less +0 -157
- package/es/components/wallet/components/WalletBar/index.d.ts +0 -8
- package/es/components/wallet/components/WalletBar/index.js +0 -19
- package/es/components/wallet/components/WalletBar/index.less +0 -36
- package/es/components/wallet/components/WalletCard.d.ts +0 -11
- package/es/components/wallet/components/WalletCard.js +0 -91
- package/es/components/wallet/components/index.d.ts +0 -3
- package/es/components/wallet/components/index.js +0 -4
- package/es/components/wallet/hooks/useWalletCard.d.ts +0 -34
- package/es/components/wallet/hooks/useWalletCard.js +0 -147
- package/es/components/wallet/index.d.ts +0 -10
- package/es/components/wallet/index.js +0 -807
- package/es/components/wallet/index.less +0 -151
- package/es/components/wallet/locales.d.ts +0 -132
- package/es/components/wallet/locales.js +0 -139
- package/es/components/wallet/model.d.ts +0 -37
- package/es/components/wallet/model.js +0 -86
- package/es/components/wallet/serve.d.ts +0 -150
- package/es/components/wallet/serve.js +0 -205
- package/es/components/wallet/utils/formatUtils.d.ts +0 -36
- package/es/components/wallet/utils/formatUtils.js +0 -73
- package/lib/components/pay/toC/PaymentMethods/MWCreditCard/tds2.d.ts +0 -61
- package/lib/components/wallet/Detail/index.d.ts +0 -42
- package/lib/components/wallet/Detail/index.js +0 -874
- package/lib/components/wallet/Detail/index.less +0 -386
- package/lib/components/wallet/Detail/locales.d.ts +0 -153
- package/lib/components/wallet/Detail/locales.js +0 -194
- package/lib/components/wallet/Detail/model.d.ts +0 -13
- package/lib/components/wallet/Detail/model.js +0 -43
- package/lib/components/wallet/Detail/serve.d.ts +0 -39
- package/lib/components/wallet/Detail/serve.js +0 -44
- package/lib/components/wallet/DetailContext.d.ts +0 -25
- package/lib/components/wallet/DetailContext.js +0 -118
- package/lib/components/wallet/DiscountCard/index.d.ts +0 -3
- package/lib/components/wallet/DiscountCard/index.js +0 -209
- package/lib/components/wallet/DiscountCard/index.less +0 -9
- package/lib/components/wallet/DiscountCard/model.d.ts +0 -14
- package/lib/components/wallet/DiscountCard/model.js +0 -43
- package/lib/components/wallet/PointCard/index.d.ts +0 -3
- package/lib/components/wallet/PointCard/index.js +0 -190
- package/lib/components/wallet/PointCard/index.less +0 -9
- package/lib/components/wallet/PointCard/model.d.ts +0 -13
- package/lib/components/wallet/RechargeableCard/index.d.ts +0 -13
- package/lib/components/wallet/RechargeableCard/index.js +0 -380
- package/lib/components/wallet/RechargeableCard/index.less +0 -108
- package/lib/components/wallet/RechargeableCard/model.d.ts +0 -29
- package/lib/components/wallet/RechargeableCard/model.js +0 -49
- package/lib/components/wallet/RechargeableCard/serve.d.ts +0 -23
- package/lib/components/wallet/Voucher/index.d.ts +0 -12
- package/lib/components/wallet/Voucher/index.js +0 -146
- package/lib/components/wallet/Voucher/index.less +0 -9
- package/lib/components/wallet/Voucher/locales.d.ts +0 -21
- package/lib/components/wallet/Voucher/model.d.ts +0 -13
- package/lib/components/wallet/Voucher/model.js +0 -43
- package/lib/components/wallet/carouselArrow.png +0 -0
- package/lib/components/wallet/components/FooterButtons/index.d.ts +0 -18
- package/lib/components/wallet/components/FooterButtons/index.js +0 -109
- package/lib/components/wallet/components/FooterButtons/index.less +0 -91
- package/lib/components/wallet/components/UsageRules/index.d.ts +0 -23
- package/lib/components/wallet/components/UsageRules/index.js +0 -113
- package/lib/components/wallet/components/UsageRules/index.less +0 -157
- package/lib/components/wallet/components/WalletBar/index.d.ts +0 -8
- package/lib/components/wallet/components/WalletBar/index.less +0 -36
- package/lib/components/wallet/components/WalletCard.d.ts +0 -11
- package/lib/components/wallet/components/WalletCard.js +0 -97
- package/lib/components/wallet/components/index.d.ts +0 -3
- package/lib/components/wallet/hooks/useWalletCard.d.ts +0 -34
- package/lib/components/wallet/hooks/useWalletCard.js +0 -111
- package/lib/components/wallet/index.d.ts +0 -10
- package/lib/components/wallet/index.js +0 -580
- package/lib/components/wallet/index.less +0 -151
- package/lib/components/wallet/locales.d.ts +0 -132
- package/lib/components/wallet/locales.js +0 -163
- package/lib/components/wallet/model.d.ts +0 -37
- package/lib/components/wallet/model.js +0 -91
- package/lib/components/wallet/serve.d.ts +0 -150
- package/lib/components/wallet/serve.js +0 -85
- package/lib/components/wallet/utils/formatUtils.d.ts +0 -36
- package/lib/components/wallet/utils/formatUtils.js +0 -73
|
@@ -346,35 +346,35 @@ var formatMetaData = function formatMetaData(item, isMultiDayPrices) {
|
|
|
346
346
|
return metadata;
|
|
347
347
|
};
|
|
348
348
|
var formatProductMetadata = function formatProductMetadata(item) {
|
|
349
|
-
var _item$_extend17, _item$_extend19, _item$_extend21, _item$_extend23, _item$_extend25;
|
|
349
|
+
var _item$_extend17, _item$metadata, _item$_extend19, _item$metadata3, _item$_extend21, _item$metadata5, _item$_extend23, _item$metadata7, _item$_extend25, _item$metadata9;
|
|
350
350
|
var metadata = {};
|
|
351
351
|
|
|
352
352
|
// 主商品+非原价(加减价)子商品附加费
|
|
353
|
-
if ((_item$_extend17 = item._extend) !== null && _item$_extend17 !== void 0 && _item$_extend17.surcharge_fee) {
|
|
354
|
-
var _item$_extend18;
|
|
355
|
-
metadata.main_product_attached_bundle_surcharge_fee = (_item$_extend18 = item._extend) === null || _item$_extend18 === void 0 ? void 0 : _item$_extend18.surcharge_fee;
|
|
353
|
+
if ((_item$_extend17 = item._extend) !== null && _item$_extend17 !== void 0 && _item$_extend17.surcharge_fee || (_item$metadata = item.metadata) !== null && _item$metadata !== void 0 && _item$metadata.main_product_attached_bundle_surcharge_fee) {
|
|
354
|
+
var _item$_extend18, _item$metadata2;
|
|
355
|
+
metadata.main_product_attached_bundle_surcharge_fee = ((_item$_extend18 = item._extend) === null || _item$_extend18 === void 0 ? void 0 : _item$_extend18.surcharge_fee) || ((_item$metadata2 = item.metadata) === null || _item$metadata2 === void 0 ? void 0 : _item$metadata2.main_product_attached_bundle_surcharge_fee);
|
|
356
356
|
}
|
|
357
357
|
|
|
358
358
|
// 主商品+非原价(加减价)子商品税费
|
|
359
|
-
if ((_item$_extend19 = item._extend) !== null && _item$_extend19 !== void 0 && _item$_extend19.main_product_attached_bundle_tax_fee) {
|
|
360
|
-
var _item$_extend20;
|
|
361
|
-
metadata.main_product_attached_bundle_tax_fee = (_item$_extend20 = item._extend) === null || _item$_extend20 === void 0 ? void 0 : _item$_extend20.main_product_attached_bundle_tax_fee;
|
|
359
|
+
if ((_item$_extend19 = item._extend) !== null && _item$_extend19 !== void 0 && _item$_extend19.main_product_attached_bundle_tax_fee || (_item$metadata3 = item.metadata) !== null && _item$metadata3 !== void 0 && _item$metadata3.main_product_attached_bundle_tax_fee) {
|
|
360
|
+
var _item$_extend20, _item$metadata4;
|
|
361
|
+
metadata.main_product_attached_bundle_tax_fee = ((_item$_extend20 = item._extend) === null || _item$_extend20 === void 0 ? void 0 : _item$_extend20.main_product_attached_bundle_tax_fee) || ((_item$metadata4 = item.metadata) === null || _item$metadata4 === void 0 ? void 0 : _item$metadata4.main_product_attached_bundle_tax_fee);
|
|
362
362
|
}
|
|
363
363
|
|
|
364
364
|
// 可选,附加费均摊舍入金额
|
|
365
|
-
if ((_item$_extend21 = item._extend) !== null && _item$_extend21 !== void 0 && _item$_extend21.surcharge_rounding_remainder) {
|
|
366
|
-
var _item$_extend22;
|
|
367
|
-
metadata.surcharge_rounding_remainder = (_item$_extend22 = item._extend) === null || _item$_extend22 === void 0 ? void 0 : _item$_extend22.surcharge_rounding_remainder;
|
|
365
|
+
if ((_item$_extend21 = item._extend) !== null && _item$_extend21 !== void 0 && _item$_extend21.surcharge_rounding_remainder || (_item$metadata5 = item.metadata) !== null && _item$metadata5 !== void 0 && _item$metadata5.surcharge_rounding_remainder) {
|
|
366
|
+
var _item$_extend22, _item$metadata6;
|
|
367
|
+
metadata.surcharge_rounding_remainder = ((_item$_extend22 = item._extend) === null || _item$_extend22 === void 0 ? void 0 : _item$_extend22.surcharge_rounding_remainder) || ((_item$metadata6 = item.metadata) === null || _item$metadata6 === void 0 ? void 0 : _item$metadata6.surcharge_rounding_remainder);
|
|
368
368
|
}
|
|
369
369
|
|
|
370
370
|
// 使用的附加费id列表
|
|
371
|
-
if ((_item$_extend23 = item._extend) !== null && _item$_extend23 !== void 0 && _item$_extend23.relation_surcharge_ids) {
|
|
372
|
-
var _item$_extend24;
|
|
373
|
-
metadata.relation_surcharge_ids = (_item$_extend24 = item._extend) === null || _item$_extend24 === void 0 ? void 0 : _item$_extend24.relation_surcharge_ids;
|
|
371
|
+
if ((_item$_extend23 = item._extend) !== null && _item$_extend23 !== void 0 && _item$_extend23.relation_surcharge_ids || (_item$metadata7 = item.metadata) !== null && _item$metadata7 !== void 0 && _item$metadata7.relation_surcharge_ids) {
|
|
372
|
+
var _item$_extend24, _item$metadata8;
|
|
373
|
+
metadata.relation_surcharge_ids = ((_item$_extend24 = item._extend) === null || _item$_extend24 === void 0 ? void 0 : _item$_extend24.relation_surcharge_ids) || ((_item$metadata8 = item.metadata) === null || _item$metadata8 === void 0 ? void 0 : _item$metadata8.relation_surcharge_ids);
|
|
374
374
|
}
|
|
375
|
-
if ((_item$_extend25 = item._extend) !== null && _item$_extend25 !== void 0 && _item$_extend25.unique_identification_number) {
|
|
376
|
-
var _item$_extend26;
|
|
377
|
-
metadata.unique_identification_number = (_item$_extend26 = item._extend) === null || _item$_extend26 === void 0 ? void 0 : _item$_extend26.unique_identification_number;
|
|
375
|
+
if ((_item$_extend25 = item._extend) !== null && _item$_extend25 !== void 0 && _item$_extend25.unique_identification_number || (_item$metadata9 = item.metadata) !== null && _item$metadata9 !== void 0 && _item$metadata9.unique_identification_number) {
|
|
376
|
+
var _item$_extend26, _item$metadata10;
|
|
377
|
+
metadata.unique_identification_number = ((_item$_extend26 = item._extend) === null || _item$_extend26 === void 0 ? void 0 : _item$_extend26.unique_identification_number) || ((_item$metadata10 = item.metadata) === null || _item$metadata10 === void 0 ? void 0 : _item$metadata10.unique_identification_number);
|
|
378
378
|
}
|
|
379
379
|
return metadata;
|
|
380
380
|
};
|
|
@@ -469,6 +469,7 @@ var formatProducts = function formatProducts(item, quantity) {
|
|
|
469
469
|
if (item.isCustomItem) {
|
|
470
470
|
item.product_id = 0;
|
|
471
471
|
}
|
|
472
|
+
debugger;
|
|
472
473
|
return {
|
|
473
474
|
"name": item.name,
|
|
474
475
|
"num": quantity || item._extend.quantity,
|
|
@@ -574,6 +575,21 @@ var getHolderByIndex = function getHolderByIndex(holder, index) {
|
|
|
574
575
|
});
|
|
575
576
|
};
|
|
576
577
|
|
|
578
|
+
/**
|
|
579
|
+
* @title: 是否包含跨日预约商品
|
|
580
|
+
* @description:
|
|
581
|
+
* @param {any} data
|
|
582
|
+
* @return {*}
|
|
583
|
+
*/
|
|
584
|
+
export var getHasMultiDayProduct = function getHasMultiDayProduct(data) {
|
|
585
|
+
var list = data.service.value;
|
|
586
|
+
var isHas = list.some(function (item) {
|
|
587
|
+
var _item$_extend40;
|
|
588
|
+
return (_item$_extend40 = item._extend) === null || _item$_extend40 === void 0 ? void 0 : _item$_extend40.groupId;
|
|
589
|
+
});
|
|
590
|
+
return isHas;
|
|
591
|
+
};
|
|
592
|
+
|
|
577
593
|
/**
|
|
578
594
|
* @title: 预约商品信息
|
|
579
595
|
* @description:
|
|
@@ -609,7 +625,7 @@ var formatBookings = function formatBookings(data, values) {
|
|
|
609
625
|
var bookings = [];
|
|
610
626
|
var obj = {};
|
|
611
627
|
list.forEach(function (item) {
|
|
612
|
-
var _item$
|
|
628
|
+
var _item$_extend41, _item$_extend46, _item$_extend47, _item$_extend48;
|
|
613
629
|
// 自定义商品直接使用 _extend 中的数据,并将 id 转换为 0 提交给后端
|
|
614
630
|
if (item.isCustomItem) {
|
|
615
631
|
bookings.push(_objectSpread(_objectSpread({}, item._extend), {}, {
|
|
@@ -617,6 +633,9 @@ var formatBookings = function formatBookings(data, values) {
|
|
|
617
633
|
}));
|
|
618
634
|
return;
|
|
619
635
|
}
|
|
636
|
+
|
|
637
|
+
// 当前商品是跨日预约商品
|
|
638
|
+
var isMultiDay = (_item$_extend41 = item._extend) === null || _item$_extend41 === void 0 ? void 0 : _item$_extend41.groupId;
|
|
620
639
|
var start_date = item._extend.startDate.format('YYYY-MM-DD');
|
|
621
640
|
var end_date = item._extend.endDate.format('YYYY-MM-DD');
|
|
622
641
|
var end_time = item._extend.endDate.format('HH:mm');
|
|
@@ -630,9 +649,9 @@ var formatBookings = function formatBookings(data, values) {
|
|
|
630
649
|
|
|
631
650
|
// 跨日预约下的普通商品
|
|
632
651
|
if (isDay) {
|
|
633
|
-
var _item$
|
|
634
|
-
var startDate = ((_item$
|
|
635
|
-
var endDate = ((_item$
|
|
652
|
+
var _item$_extend42, _item$_extend43, _item$_extend44, _item$_extend45;
|
|
653
|
+
var startDate = ((_item$_extend42 = item._extend) === null || _item$_extend42 === void 0 ? void 0 : _item$_extend42.startDate) || ((_item$_extend43 = item._extend) === null || _item$_extend43 === void 0 ? void 0 : _item$_extend43.start_date);
|
|
654
|
+
var endDate = ((_item$_extend44 = item._extend) === null || _item$_extend44 === void 0 ? void 0 : _item$_extend44.endDate) || ((_item$_extend45 = item._extend) === null || _item$_extend45 === void 0 ? void 0 : _item$_extend45.end_date);
|
|
636
655
|
var _formatDayTime = formatDayTime({
|
|
637
656
|
startDate: startDate,
|
|
638
657
|
endDate: endDate
|
|
@@ -654,7 +673,7 @@ var formatBookings = function formatBookings(data, values) {
|
|
|
654
673
|
}
|
|
655
674
|
}, 'minutes');
|
|
656
675
|
}
|
|
657
|
-
if (!((_item$
|
|
676
|
+
if (!((_item$_extend46 = item._extend) !== null && _item$_extend46 !== void 0 && _item$_extend46.unique_identification_number)) {
|
|
658
677
|
var unique_identification_number = getUniqueId();
|
|
659
678
|
item._extend.unique_identification_number = unique_identification_number;
|
|
660
679
|
}
|
|
@@ -662,12 +681,11 @@ var formatBookings = function formatBookings(data, values) {
|
|
|
662
681
|
// 跨日预约处理: 跨日预约所有数据都在list中, 每一组预约通过groupId进行分组
|
|
663
682
|
// 通过obj 记录下每个GroupId第一次出现的时机, 第一次出现需要设置 metadata.multiDayPrices
|
|
664
683
|
// 后续出现不需要设置 metadata.multiDayPrices. 节省体积
|
|
665
|
-
var isSetGroupId = obj[item === null || item === void 0 || (_item$
|
|
666
|
-
if (!((_item$
|
|
684
|
+
var isSetGroupId = obj[item === null || item === void 0 || (_item$_extend47 = item._extend) === null || _item$_extend47 === void 0 ? void 0 : _item$_extend47.groupId];
|
|
685
|
+
if (!((_item$_extend48 = item._extend) !== null && _item$_extend48 !== void 0 && _item$_extend48.unique_identification_number)) {
|
|
667
686
|
var _unique_identification_number = getUniqueId();
|
|
668
687
|
item._extend.unique_identification_number = _unique_identification_number;
|
|
669
688
|
}
|
|
670
|
-
debugger;
|
|
671
689
|
var booking = _objectSpread(_objectSpread({
|
|
672
690
|
schedule_event_id: item === null || item === void 0 ? void 0 : item.booking_id,
|
|
673
691
|
product: formatProducts(item),
|
|
@@ -684,7 +702,7 @@ var formatBookings = function formatBookings(data, values) {
|
|
|
684
702
|
start_time: start_time,
|
|
685
703
|
end_date: end_date,
|
|
686
704
|
start_date: start_date,
|
|
687
|
-
duration: isDay ? 0 : flexibleObj.getValue(item._extend.duration),
|
|
705
|
+
duration: isDay || isMultiDay ? 0 : flexibleObj.getValue(item._extend.duration),
|
|
688
706
|
number: item._extend.capacity ? getSumCapacity({
|
|
689
707
|
cacheItem: item
|
|
690
708
|
}) : item._extend.number || 1,
|
|
@@ -697,7 +715,9 @@ var formatBookings = function formatBookings(data, values) {
|
|
|
697
715
|
if (!isSetGroupId) {
|
|
698
716
|
obj[item._extend.groupId] = true;
|
|
699
717
|
}
|
|
700
|
-
|
|
718
|
+
|
|
719
|
+
// 跨日预约模版或当前是跨日预约商品时
|
|
720
|
+
if (isDay || isMultiDay) {
|
|
701
721
|
bookings.push(booking);
|
|
702
722
|
return;
|
|
703
723
|
}
|
|
@@ -742,16 +762,16 @@ var formatRelationProducts = function formatRelationProducts(data, type) {
|
|
|
742
762
|
var list = ((_data$service = data.service) === null || _data$service === void 0 ? void 0 : _data$service.value) || [];
|
|
743
763
|
// open items 下的商品
|
|
744
764
|
list = list.filter(function (item) {
|
|
745
|
-
var _item$
|
|
765
|
+
var _item$_extend49;
|
|
746
766
|
return (
|
|
747
767
|
// 跨日预约把普通商品加在relationProducts 活动预约按之前逻辑
|
|
748
|
-
type === 'day' ? isNormalProductByDurationSchedule(item) : ((_item$
|
|
768
|
+
type === 'day' ? isNormalProductByDurationSchedule(item) : ((_item$_extend49 = item._extend) === null || _item$_extend49 === void 0 ? void 0 : _item$_extend49.holder_id) && appointmentTypes.includes(item.extension_type)
|
|
749
769
|
);
|
|
750
770
|
});
|
|
751
771
|
var relationProducts = [];
|
|
752
772
|
relationProducts = list.map(function (item) {
|
|
753
|
-
var _item$
|
|
754
|
-
if (!((_item$
|
|
773
|
+
var _item$_extend50;
|
|
774
|
+
if (!((_item$_extend50 = item._extend) !== null && _item$_extend50 !== void 0 && _item$_extend50.unique_identification_number)) {
|
|
755
775
|
var unique_identification_number = getUniqueId();
|
|
756
776
|
item._extend.unique_identification_number = unique_identification_number;
|
|
757
777
|
}
|
|
@@ -770,8 +790,8 @@ var formatNormalProducts = function formatNormalProducts(data) {
|
|
|
770
790
|
});
|
|
771
791
|
var relationProducts = [];
|
|
772
792
|
relationProducts = list.map(function (item) {
|
|
773
|
-
var _item$
|
|
774
|
-
if (!((_item$
|
|
793
|
+
var _item$_extend51;
|
|
794
|
+
if (!((_item$_extend51 = item._extend) !== null && _item$_extend51 !== void 0 && _item$_extend51.unique_identification_number)) {
|
|
775
795
|
var unique_identification_number = getUniqueId();
|
|
776
796
|
item._extend.unique_identification_number = unique_identification_number;
|
|
777
797
|
}
|
|
@@ -827,7 +847,11 @@ export var formatValues = function formatValues(state) {
|
|
|
827
847
|
relation_products: [],
|
|
828
848
|
metadata: {}
|
|
829
849
|
};
|
|
850
|
+
|
|
851
|
+
// 是是跨日预约模版
|
|
830
852
|
var isDay = isDaysBooking(state);
|
|
853
|
+
// 是否包含跨日预约商品
|
|
854
|
+
var isHasMultiDay = getHasMultiDayProduct(state);
|
|
831
855
|
var isEvent = isEventBooking(state);
|
|
832
856
|
if (!state.bookingId || isDay) {
|
|
833
857
|
// 备注
|
|
@@ -850,8 +874,8 @@ export var formatValues = function formatValues(state) {
|
|
|
850
874
|
// 主体
|
|
851
875
|
values.holder = formatHolder(state, values);
|
|
852
876
|
// todo
|
|
853
|
-
if (
|
|
854
|
-
values.relation_products = formatRelationProducts(state,
|
|
877
|
+
if (isEvent) {
|
|
878
|
+
values.relation_products = formatRelationProducts(state, 'event');
|
|
855
879
|
} else {
|
|
856
880
|
var _values$relation_prod;
|
|
857
881
|
values.relation_products = formatNormalProducts(state);
|
|
@@ -872,7 +896,7 @@ export var formatValues = function formatValues(state) {
|
|
|
872
896
|
}
|
|
873
897
|
|
|
874
898
|
// 跨日预约增加多余参数区分
|
|
875
|
-
if (isDay) {
|
|
899
|
+
if (isDay || isHasMultiDay) {
|
|
876
900
|
values.metadata.is_multiday_appointment = 1;
|
|
877
901
|
// is_bundle_price_calculated 用于区分商品的price是总价,还是商品的单价
|
|
878
902
|
// values.is_bundle_price_calculated = 1
|
|
@@ -891,21 +915,21 @@ export var checkHolderIsError = function checkHolderIsError(state) {
|
|
|
891
915
|
var _state$client;
|
|
892
916
|
var errorRowKey = '';
|
|
893
917
|
var holderError = state.service.value.some(function (item) {
|
|
894
|
-
var _item$
|
|
918
|
+
var _item$_extend$holder_, _item$_extend53;
|
|
895
919
|
// 普通商品不需要检测holder
|
|
896
920
|
if (isNormalProductByDurationSchedule(item)) {
|
|
897
921
|
return false;
|
|
898
922
|
}
|
|
899
|
-
if (item._extend.quantity === 1 && !item._extend.holder_id) {
|
|
900
|
-
var _item$_extend50;
|
|
901
|
-
errorRowKey = genRowKey(item === null || item === void 0 || (_item$_extend50 = item._extend) === null || _item$_extend50 === void 0 || (_item$_extend50 = _item$_extend50.other) === null || _item$_extend50 === void 0 ? void 0 : _item$_extend50.rowKey);
|
|
902
|
-
return true;
|
|
903
|
-
}
|
|
904
|
-
if (item._extend.quantity > 1 && ((_item$_extend51 = item._extend) === null || _item$_extend51 === void 0 || (_item$_extend51 = _item$_extend51.holder_id) === null || _item$_extend51 === void 0 ? void 0 : _item$_extend51.length) !== item._extend.quantity) {
|
|
923
|
+
if (item._extend.quantity === 1 && (!item._extend.holder_id || ((_item$_extend$holder_ = item._extend.holder_id) === null || _item$_extend$holder_ === void 0 ? void 0 : _item$_extend$holder_.length) === 0)) {
|
|
905
924
|
var _item$_extend52;
|
|
906
925
|
errorRowKey = genRowKey(item === null || item === void 0 || (_item$_extend52 = item._extend) === null || _item$_extend52 === void 0 || (_item$_extend52 = _item$_extend52.other) === null || _item$_extend52 === void 0 ? void 0 : _item$_extend52.rowKey);
|
|
907
926
|
return true;
|
|
908
927
|
}
|
|
928
|
+
if (item._extend.quantity > 1 && ((_item$_extend53 = item._extend) === null || _item$_extend53 === void 0 || (_item$_extend53 = _item$_extend53.holder_id) === null || _item$_extend53 === void 0 ? void 0 : _item$_extend53.length) !== item._extend.quantity) {
|
|
929
|
+
var _item$_extend54;
|
|
930
|
+
errorRowKey = genRowKey(item === null || item === void 0 || (_item$_extend54 = item._extend) === null || _item$_extend54 === void 0 || (_item$_extend54 = _item$_extend54.other) === null || _item$_extend54 === void 0 ? void 0 : _item$_extend54.rowKey);
|
|
931
|
+
return true;
|
|
932
|
+
}
|
|
909
933
|
return false;
|
|
910
934
|
});
|
|
911
935
|
var clientId = (_state$client = state.client) === null || _state$client === void 0 || (_state$client = _state$client.value) === null || _state$client === void 0 ? void 0 : _state$client.id;
|
|
@@ -2,15 +2,15 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
|
2
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
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
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); }); }; }
|
|
5
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
6
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
7
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
8
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
5
9
|
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; }
|
|
6
10
|
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; }
|
|
7
11
|
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; }
|
|
8
12
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
9
13
|
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); }
|
|
10
|
-
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
11
|
-
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
12
|
-
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
13
|
-
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
14
14
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
15
15
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
16
16
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
@@ -43,7 +43,7 @@ var ShopDiscountHooks = {
|
|
|
43
43
|
};
|
|
44
44
|
var services = {};
|
|
45
45
|
var VoucherCard = function VoucherCard(props) {
|
|
46
|
-
var _context$appHelper, _state$client$value, _state$
|
|
46
|
+
var _context$appHelper, _state$client$value, _state$pet2, _state$service3;
|
|
47
47
|
var context = useEngineContext();
|
|
48
48
|
var state = props.state,
|
|
49
49
|
dispatch = props.dispatch,
|
|
@@ -70,12 +70,15 @@ var VoucherCard = function VoucherCard(props) {
|
|
|
70
70
|
var shopDiscount = useShopDiscountModule();
|
|
71
71
|
var _useActiveExecute = useActiveExecute(),
|
|
72
72
|
executeIfActive = _useActiveExecute.executeIfActive;
|
|
73
|
+
var holderChangedRef = useRef(false);
|
|
73
74
|
var stateRef = useRef(state);
|
|
74
75
|
stateRef.current = state;
|
|
75
76
|
services = state.service;
|
|
76
77
|
|
|
77
78
|
// 将选中的客户数据传递给状态管理
|
|
78
79
|
var changeCustomerToGlobalState = useMemoizedFn(function (value) {
|
|
80
|
+
var _state$client, _state$service;
|
|
81
|
+
var beforeValue = state === null || state === void 0 || (_state$client = state.client) === null || _state$client === void 0 ? void 0 : _state$client.value;
|
|
79
82
|
dispatch({
|
|
80
83
|
type: 'setClient',
|
|
81
84
|
payload: {
|
|
@@ -83,6 +86,22 @@ var VoucherCard = function VoucherCard(props) {
|
|
|
83
86
|
edit: true
|
|
84
87
|
}
|
|
85
88
|
});
|
|
89
|
+
if ((beforeValue === null || beforeValue === void 0 ? void 0 : beforeValue.id) === (value === null || value === void 0 ? void 0 : value.id)) return;
|
|
90
|
+
if (state !== null && state !== void 0 && (_state$service = state.service) !== null && _state$service !== void 0 && (_state$service = _state$service.value) !== null && _state$service !== void 0 && _state$service.length) {
|
|
91
|
+
// 还需要清空商品内的 holder 信息
|
|
92
|
+
dispatch({
|
|
93
|
+
type: 'setService',
|
|
94
|
+
payload: {
|
|
95
|
+
value: state.service.value.map(function (item) {
|
|
96
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
97
|
+
_extend: _objectSpread(_objectSpread({}, item._extend), {}, {
|
|
98
|
+
holder_id: []
|
|
99
|
+
})
|
|
100
|
+
});
|
|
101
|
+
})
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
}
|
|
86
105
|
});
|
|
87
106
|
var _useCustomer = useCustomer({
|
|
88
107
|
changeCustomerToGlobalState: changeCustomerToGlobalState
|
|
@@ -107,7 +126,7 @@ var VoucherCard = function VoucherCard(props) {
|
|
|
107
126
|
var serviceMemo = useMemo(function () {
|
|
108
127
|
var _ref;
|
|
109
128
|
var val = (_ref = state.service.value || []) === null || _ref === void 0 ? void 0 : _ref.map(function (value) {
|
|
110
|
-
var _value$_extend, _value$_extend2;
|
|
129
|
+
var _value$_extend, _value$_extend2, _value$_extend3;
|
|
111
130
|
return {
|
|
112
131
|
booking_id: value.booking_id,
|
|
113
132
|
id: value.id,
|
|
@@ -116,7 +135,8 @@ var VoucherCard = function VoucherCard(props) {
|
|
|
116
135
|
discount_list: value.discount_list,
|
|
117
136
|
origin_total: value === null || value === void 0 || (_value$_extend2 = value._extend) === null || _value$_extend2 === void 0 ? void 0 : _value$_extend2.origin_total,
|
|
118
137
|
quantity: value._extend.quantity,
|
|
119
|
-
startDate: value._extend.startDate
|
|
138
|
+
startDate: value._extend.startDate,
|
|
139
|
+
holder_id: value === null || value === void 0 || (_value$_extend3 = value._extend) === null || _value$_extend3 === void 0 ? void 0 : _value$_extend3.holder_id
|
|
120
140
|
};
|
|
121
141
|
});
|
|
122
142
|
return val;
|
|
@@ -142,20 +162,42 @@ var VoucherCard = function VoucherCard(props) {
|
|
|
142
162
|
var addonsMemo = useMemo(function () {
|
|
143
163
|
var _ref2;
|
|
144
164
|
var val = (_ref2 = state.addons.value || []) === null || _ref2 === void 0 ? void 0 : _ref2.map(function (value) {
|
|
145
|
-
var _value$
|
|
165
|
+
var _value$_extend4, _value$_extend5;
|
|
146
166
|
return {
|
|
147
167
|
booking_id: value.booking_id,
|
|
148
168
|
id: value.id,
|
|
149
169
|
_id: value._id,
|
|
150
170
|
price: value.price,
|
|
151
|
-
total: value === null || value === void 0 || (_value$
|
|
171
|
+
total: value === null || value === void 0 || (_value$_extend4 = value._extend) === null || _value$_extend4 === void 0 ? void 0 : _value$_extend4.total,
|
|
152
172
|
discount_list: value.discount_list,
|
|
153
173
|
_key: value._key,
|
|
154
|
-
num: value === null || value === void 0 || (_value$
|
|
174
|
+
num: value === null || value === void 0 || (_value$_extend5 = value._extend) === null || _value$_extend5 === void 0 ? void 0 : _value$_extend5.quantity
|
|
155
175
|
};
|
|
156
176
|
});
|
|
157
177
|
return val;
|
|
158
178
|
}, [state.addons.value]);
|
|
179
|
+
var holdersMemo = useMemo(function () {
|
|
180
|
+
if (isBooking4Shop) {
|
|
181
|
+
var _state$pet;
|
|
182
|
+
var list = [];
|
|
183
|
+
if ((_state$pet = state.pet) !== null && _state$pet !== void 0 && _state$pet.value) {
|
|
184
|
+
var entries = Object.entries(state.pet.value);
|
|
185
|
+
// 多余 1 个表单类型时,无法计算
|
|
186
|
+
// 同一表单多个 holder 时,os内只取第一个
|
|
187
|
+
if (entries.length === 1) {
|
|
188
|
+
list = entries[0][1];
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
shopDiscount.setHolders(list);
|
|
192
|
+
holderChangedRef.current = true;
|
|
193
|
+
return list || [];
|
|
194
|
+
}
|
|
195
|
+
}, [(_state$pet2 = state.pet) === null || _state$pet2 === void 0 ? void 0 : _state$pet2.value, isBooking4Shop]);
|
|
196
|
+
useEffect(function () {
|
|
197
|
+
var _shopDiscount$setBook, _state$bookingConfig;
|
|
198
|
+
console.log('update booking subject', state.bookingConfig);
|
|
199
|
+
shopDiscount === null || shopDiscount === void 0 || (_shopDiscount$setBook = shopDiscount.setBookingSubject) === null || _shopDiscount$setBook === void 0 || _shopDiscount$setBook.call(shopDiscount, (_state$bookingConfig = state.bookingConfig) === null || _state$bookingConfig === void 0 || (_state$bookingConfig = _state$bookingConfig.config) === null || _state$bookingConfig === void 0 || (_state$bookingConfig = _state$bookingConfig.basic) === null || _state$bookingConfig === void 0 ? void 0 : _state$bookingConfig.appointment_subject);
|
|
200
|
+
}, [state.bookingConfig]);
|
|
159
201
|
var disabled = useMemo(function () {
|
|
160
202
|
var _state$bookingDetail;
|
|
161
203
|
if (['paid', 'partially_paid'].includes((_state$bookingDetail = state.bookingDetail) === null || _state$bookingDetail === void 0 ? void 0 : _state$bookingDetail.payment_status) && [].concat(_toConsumableArray(addonsMemo), _toConsumableArray(serviceMemo)).every(function (item) {
|
|
@@ -166,8 +208,8 @@ var VoucherCard = function VoucherCard(props) {
|
|
|
166
208
|
return false;
|
|
167
209
|
}, [state, addonsMemo, serviceMemo]);
|
|
168
210
|
var _useDebounceFn = useDebounceFn(function () {
|
|
169
|
-
var _state$
|
|
170
|
-
if (serviceValueRef.current === state.service.value && addonsValueRef.current === state.addons.value || !((_state$
|
|
211
|
+
var _state$service2;
|
|
212
|
+
if (serviceValueRef.current === state.service.value && addonsValueRef.current === state.addons.value && !holderChangedRef.current || !((_state$service2 = state.service) !== null && _state$service2 !== void 0 && (_state$service2 = _state$service2.value) !== null && _state$service2 !== void 0 && _state$service2.length)) {
|
|
171
213
|
return;
|
|
172
214
|
}
|
|
173
215
|
if (isBooking4Shop) {
|
|
@@ -175,6 +217,8 @@ var VoucherCard = function VoucherCard(props) {
|
|
|
175
217
|
console.log('input: ', state.service.value);
|
|
176
218
|
console.log('output: ', val);
|
|
177
219
|
productListToValue(val.productList);
|
|
220
|
+
// 重置 holder 变化标识,防止重复计算
|
|
221
|
+
holderChangedRef.current = false;
|
|
178
222
|
}
|
|
179
223
|
}, {
|
|
180
224
|
wait: 1000
|
|
@@ -184,7 +228,7 @@ var VoucherCard = function VoucherCard(props) {
|
|
|
184
228
|
// 更新productList
|
|
185
229
|
useEffect(function () {
|
|
186
230
|
run();
|
|
187
|
-
}, [JSON.stringify(serviceMemo), JSON.stringify(addonsMemo), isBooking4Shop]);
|
|
231
|
+
}, [JSON.stringify(serviceMemo), JSON.stringify(addonsMemo), JSON.stringify(holdersMemo), isBooking4Shop]);
|
|
188
232
|
useEffect(function () {
|
|
189
233
|
if (shopDiscount) {
|
|
190
234
|
var wrappedHandler = executeIfActive(fn);
|
|
@@ -343,7 +387,7 @@ var VoucherCard = function VoucherCard(props) {
|
|
|
343
387
|
width: '100%'
|
|
344
388
|
},
|
|
345
389
|
isInModal: isInModal || false,
|
|
346
|
-
dataSource: (_state$
|
|
390
|
+
dataSource: (_state$service3 = state.service) !== null && _state$service3 !== void 0 && (_state$service3 = _state$service3.value) !== null && _state$service3 !== void 0 && _state$service3.length ? availableData : [],
|
|
347
391
|
mixedSort: mixedSort,
|
|
348
392
|
onChange: function onChange(val) {
|
|
349
393
|
var detail = shopDiscount.setDiscountSelected({
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { FormState } from "../model";
|
|
3
|
-
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
4
|
-
state: FormState;
|
|
5
|
-
} & {
|
|
6
|
-
dispatch: (params: {
|
|
7
|
-
type: string;
|
|
8
|
-
payload: any;
|
|
9
|
-
}) => void;
|
|
10
|
-
}>;
|
|
1
|
+
export declare const Provider: any, Context: any;
|
|
@@ -18,8 +18,9 @@ import { getProductTotalPrice } from "../utils";
|
|
|
18
18
|
import useEngineContext from "../../../hooks/useEngineContext";
|
|
19
19
|
import { locales } from "@pisell/utils";
|
|
20
20
|
import { PisellModal } from "@pisell/materials";
|
|
21
|
-
import {
|
|
21
|
+
import { getNormalAndMultiDayProductPrice } from "../info/service/serve";
|
|
22
22
|
import Decimal from 'decimal.js';
|
|
23
|
+
import dayjs from 'dayjs';
|
|
23
24
|
var formatBundleItemMap = function formatBundleItemMap(product) {
|
|
24
25
|
return product.bundle_group.reduce(function (pre, cur) {
|
|
25
26
|
var curObj = {};
|
|
@@ -53,10 +54,17 @@ var setNewCartValue = function setNewCartValue(cartValue, newProducts) {
|
|
|
53
54
|
// 是否套餐子商品被删除
|
|
54
55
|
var isNotFoundBundle = false;
|
|
55
56
|
var notFoundProducts = [];
|
|
57
|
+
|
|
58
|
+
// 缓存跨日商品的 multiDayPrices,避免同一 groupId 重复计算
|
|
59
|
+
var multiDayPricesCache = new Map();
|
|
56
60
|
var value = cartValue.map(function (item) {
|
|
57
|
-
var _item$_extend, _item$_extend2;
|
|
61
|
+
var _item$_extend, _item$_extend2, _item$_extend3, _item$_extend4;
|
|
62
|
+
// 格式化商品日期用于匹配
|
|
63
|
+
var itemScheduleDate = (_item$_extend = item._extend) !== null && _item$_extend !== void 0 && _item$_extend.startDate ? dayjs(item._extend.startDate).format('YYYY-MM-DD') : '';
|
|
64
|
+
|
|
65
|
+
// 根据 product_id 和 schedule_date 匹配
|
|
58
66
|
var newProduct = newProducts.find(function (newItem) {
|
|
59
|
-
return newItem.id === item.product_id;
|
|
67
|
+
return newItem.id === item.product_id && newItem.schedule_date === itemScheduleDate;
|
|
60
68
|
});
|
|
61
69
|
if (!newProduct) {
|
|
62
70
|
return item;
|
|
@@ -64,7 +72,7 @@ var setNewCartValue = function setNewCartValue(cartValue, newProducts) {
|
|
|
64
72
|
// 是否报价单变更价格更新
|
|
65
73
|
var isChangePrice = newProduct.price != item.price;
|
|
66
74
|
var bundleItemMap = formatBundleItemMap(newProduct);
|
|
67
|
-
var newBundle = (((_item$
|
|
75
|
+
var newBundle = (((_item$_extend2 = item._extend) === null || _item$_extend2 === void 0 || (_item$_extend2 = _item$_extend2.other) === null || _item$_extend2 === void 0 ? void 0 : _item$_extend2.bundle) || []).map(function (bundle) {
|
|
68
76
|
if (!bundleItemMap[bundle.id]) {
|
|
69
77
|
isNotFoundBundle = true;
|
|
70
78
|
if (!notFoundProducts.some(function (p) {
|
|
@@ -95,6 +103,36 @@ var setNewCartValue = function setNewCartValue(cartValue, newProducts) {
|
|
|
95
103
|
});
|
|
96
104
|
});
|
|
97
105
|
|
|
106
|
+
// 处理跨日商品的 multiDayPrices
|
|
107
|
+
if ((_item$_extend3 = item._extend) !== null && _item$_extend3 !== void 0 && _item$_extend3.groupId) {
|
|
108
|
+
// 检查缓存中是否已经计算过该 groupId
|
|
109
|
+
if (!multiDayPricesCache.has(item._extend.groupId)) {
|
|
110
|
+
// 找到该商品所有日期的价格记录
|
|
111
|
+
var productPrices = newProducts.filter(function (p) {
|
|
112
|
+
return p.id === item.product_id;
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
// 构建 multiDayPrices 对象
|
|
116
|
+
var multiDayPrices = {};
|
|
117
|
+
productPrices.forEach(function (priceItem) {
|
|
118
|
+
multiDayPrices[priceItem.schedule_date] = {
|
|
119
|
+
total: Number(priceItem.price),
|
|
120
|
+
origin_total: Number(priceItem.price),
|
|
121
|
+
num: 1,
|
|
122
|
+
quotation_id: priceItem.quotation_id || 0,
|
|
123
|
+
start_date: priceItem.schedule_date,
|
|
124
|
+
end_date: dayjs(priceItem.schedule_date).add(1, 'day').format('YYYY-MM-DD')
|
|
125
|
+
};
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
// 缓存结果
|
|
129
|
+
multiDayPricesCache.set(item._extend.groupId, multiDayPrices);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
// 从缓存获取并设置到商品
|
|
133
|
+
item._extend.multiDayPrices = multiDayPricesCache.get(item._extend.groupId);
|
|
134
|
+
}
|
|
135
|
+
|
|
98
136
|
// 价格都没有变动时返回原始信息
|
|
99
137
|
if (!isChangePrice) {
|
|
100
138
|
return item;
|
|
@@ -110,7 +148,7 @@ var setNewCartValue = function setNewCartValue(cartValue, newProducts) {
|
|
|
110
148
|
// total: newProduct.total,
|
|
111
149
|
bundle_edit: isBundleChange ? 1 : item._extend.bundle_edit,
|
|
112
150
|
other: _objectSpread(_objectSpread({}, item._extend.other), {}, {
|
|
113
|
-
option: (_item$
|
|
151
|
+
option: (_item$_extend4 = item._extend) === null || _item$_extend4 === void 0 || (_item$_extend4 = _item$_extend4.other) === null || _item$_extend4 === void 0 ? void 0 : _item$_extend4.option,
|
|
114
152
|
bundle: newBundle
|
|
115
153
|
})
|
|
116
154
|
})
|
|
@@ -142,7 +180,7 @@ var useQuotation = function useQuotation(state, dispatch) {
|
|
|
142
180
|
cartValueRef.current = state.service.value;
|
|
143
181
|
var getCartQuotation = /*#__PURE__*/function () {
|
|
144
182
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(params) {
|
|
145
|
-
var
|
|
183
|
+
var queryData, data;
|
|
146
184
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
147
185
|
while (1) switch (_context.prev = _context.next) {
|
|
148
186
|
case 0:
|
|
@@ -152,28 +190,38 @@ var useQuotation = function useQuotation(state, dispatch) {
|
|
|
152
190
|
}
|
|
153
191
|
return _context.abrupt("return");
|
|
154
192
|
case 2:
|
|
155
|
-
|
|
193
|
+
if (params !== null && params !== void 0 && params.customer_id) {
|
|
194
|
+
_context.next = 4;
|
|
195
|
+
break;
|
|
196
|
+
}
|
|
197
|
+
return _context.abrupt("return");
|
|
198
|
+
case 4:
|
|
199
|
+
// 构建查询参数:为每个商品生成 { product_id, schedule_date }
|
|
200
|
+
queryData = cartValueRef.current.filter(function (item) {
|
|
156
201
|
return !item.isCustomItem;
|
|
157
202
|
}) // 过滤掉自定义商品
|
|
158
203
|
.map(function (item) {
|
|
159
|
-
|
|
204
|
+
var _item$_extend5;
|
|
205
|
+
return {
|
|
206
|
+
product_id: item.product_id,
|
|
207
|
+
schedule_date: (_item$_extend5 = item._extend) !== null && _item$_extend5 !== void 0 && _item$_extend5.startDate ? dayjs(item._extend.startDate).format('YYYY-MM-DD') : params === null || params === void 0 ? void 0 : params.schedule_date // 如果没有商品日期,使用传入的默认日期
|
|
208
|
+
};
|
|
160
209
|
});
|
|
161
|
-
if (
|
|
162
|
-
_context.next =
|
|
210
|
+
if (queryData.length) {
|
|
211
|
+
_context.next = 7;
|
|
163
212
|
break;
|
|
164
213
|
}
|
|
165
214
|
return _context.abrupt("return");
|
|
166
|
-
case 5:
|
|
167
|
-
_context.next = 7;
|
|
168
|
-
return getProductPrice({
|
|
169
|
-
ids: ids,
|
|
170
|
-
schedule_date: params === null || params === void 0 ? void 0 : params.schedule_date,
|
|
171
|
-
customer_id: params === null || params === void 0 ? void 0 : params.customer_id
|
|
172
|
-
});
|
|
173
215
|
case 7:
|
|
174
|
-
|
|
175
|
-
return
|
|
216
|
+
_context.next = 9;
|
|
217
|
+
return getNormalAndMultiDayProductPrice({
|
|
218
|
+
customer_id: params === null || params === void 0 ? void 0 : params.customer_id,
|
|
219
|
+
data: queryData
|
|
220
|
+
});
|
|
176
221
|
case 9:
|
|
222
|
+
data = _context.sent;
|
|
223
|
+
return _context.abrupt("return", data.data);
|
|
224
|
+
case 11:
|
|
177
225
|
case "end":
|
|
178
226
|
return _context.stop();
|
|
179
227
|
}
|
|
@@ -196,13 +244,13 @@ var useQuotation = function useQuotation(state, dispatch) {
|
|
|
196
244
|
return getCartQuotation(params);
|
|
197
245
|
case 2:
|
|
198
246
|
data = _context2.sent;
|
|
199
|
-
if (data
|
|
247
|
+
if (!(!data || !data.length)) {
|
|
200
248
|
_context2.next = 5;
|
|
201
249
|
break;
|
|
202
250
|
}
|
|
203
251
|
return _context2.abrupt("return");
|
|
204
252
|
case 5:
|
|
205
|
-
_setNewCartValue = setNewCartValue(cartValueRef.current, data
|
|
253
|
+
_setNewCartValue = setNewCartValue(cartValueRef.current, data), isChange = _setNewCartValue.isChange, newCartValue = _setNewCartValue.value, isNotFoundBundle = _setNewCartValue.isNotFoundBundle, notFoundProducts = _setNewCartValue.notFoundProducts;
|
|
206
254
|
if (!isNotFoundBundle) {
|
|
207
255
|
_context2.next = 10;
|
|
208
256
|
break;
|