@pisell/private-materials 6.5.4 → 6.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +160 -146
- 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/booking/addons/model.d.ts +1 -10
- package/es/components/booking/components/actionButtons/index.js +37 -42
- package/es/components/booking/components/actionButtons/index.less +0 -28
- package/es/components/booking/components/footer/amount.d.ts +3 -3
- package/es/components/booking/components/footer/amount.js +51 -31
- package/es/components/booking/components/footer/index.js +177 -68
- package/es/components/booking/components/footer/utils.js +62 -33
- package/es/components/booking/forms/model.d.ts +1 -10
- package/es/components/booking/info/model.d.ts +1 -10
- package/es/components/booking/info/model.js +5 -0
- package/es/components/booking/info/service/addService/index.js +2 -1
- package/es/components/booking/info/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info/service2/utils.d.ts +1 -1
- package/es/components/booking/info2/index.js +42 -2
- package/es/components/booking/info2/service/addService/index.js +2 -1
- package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info2/service/editService/index.js +12 -4
- 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.js +10 -5
- package/es/components/checkout/PaymentModal.d.ts +2 -0
- package/es/components/checkout/PaymentModal.js +462 -263
- package/es/components/checkout/components/AdditionalModule/index.less +1 -1
- package/es/components/checkout/components/AmountSummary/index.js +176 -65
- package/es/components/checkout/components/AmountSummary/index.less +13 -0
- package/es/components/checkout/components/CashPaymentModule/index.d.ts +5 -3
- package/es/components/checkout/components/CashPaymentModule/index.js +110 -132
- package/es/components/checkout/components/CashPaymentModule/index.less +200 -176
- package/es/components/checkout/components/PaymentDetailModal/index.js +2 -2
- package/es/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.d.ts +29 -0
- package/es/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.js +214 -0
- package/es/components/checkout/components/PaymentOptionsModule/index.d.ts +2 -4
- package/es/components/checkout/components/PaymentOptionsModule/index.js +12 -114
- package/es/components/checkout/components/PaymentOptionsModule/index.less +23 -0
- package/es/components/checkout/components/PaymentResultToast/index.js +38 -8
- package/es/components/checkout/components/PaymentResultToast/types.d.ts +2 -0
- package/es/components/checkout/components/SavePayLaterHandler/index.js +1 -1
- package/es/components/checkout/components/SearchAndClientModule/index.js +40 -39
- package/es/components/checkout/components/WalletPassModule/index.js +4 -3
- package/es/components/checkout/components/WalletPassModule/utils.js +10 -4
- package/es/components/checkout/hooks/useWalletPass.js +11 -4
- package/es/components/checkout/index.less +1 -1
- package/es/components/checkout/locales.d.ts +36 -0
- package/es/components/checkout/locales.js +43 -4
- package/es/components/checkout/types.d.ts +1 -0
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/store/index.d.ts +3 -3
- 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 +143 -71
- package/es/components/shoppingCart/components/Cart/index.js +1 -1
- package/es/components/shoppingCart/components/Cart/index.less +31 -0
- package/es/components/shoppingCart/locales.d.ts +3 -0
- package/es/components/shoppingCart/locales.js +12 -3
- package/es/components/ticketBooking/components/addServiceVariant/addService.d.ts +0 -1
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +9 -12
- package/es/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -1
- package/es/components/ticketBooking/components/menuBar/index.js +3 -1
- package/es/components/ticketBooking/components/menuBar/index.less +7 -0
- package/es/components/ticketBooking/components/ticketBooking/index.d.ts +0 -1
- package/es/components/ticketBooking/hooks/pisellos/useCustomer.js +7 -7
- package/es/components/ticketBooking/index.d.ts +0 -1
- package/es/components/ticketBooking/utils/index.d.ts +1 -1
- package/es/components/ticketBooking/utils/index.js +2 -1
- package/es/components/wallet/Detail/model.d.ts +1 -13
- package/es/components/wallet/DiscountCard/model.d.ts +1 -14
- package/es/components/wallet/PointCard/model.d.ts +1 -13
- package/es/components/wallet/RechargeableCard/model.d.ts +1 -29
- package/es/components/wallet/Voucher/model.d.ts +1 -13
- package/es/components/wallet/model.d.ts +1 -9
- package/es/pro/pisellPriceKeyboardPopover/PisellPriceKeyboardPopover.js +1 -1
- package/es/pro/pisellSimplePriceKeyboardPopover/PisellPriceKeyboardPopover.d.ts +5 -0
- package/es/pro/pisellSimplePriceKeyboardPopover/PisellPriceKeyboardPopover.js +148 -0
- package/es/pro/pisellSimplePriceKeyboardPopover/PisellPriceKeyboardPopover.less +23 -0
- package/es/pro/pisellSimplePriceKeyboardPopover/index.d.ts +2 -0
- package/es/pro/pisellSimplePriceKeyboardPopover/index.js +1 -0
- package/es/pro/pisellSimplePriceKeyboardPopover/types.d.ts +33 -0
- package/es/pro/pisellSimplePriceKeyboardPopover/types.js +1 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.d.ts +5 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.js +331 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/CashKeyboardSimple.d.ts +13 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/CashKeyboardSimple.js +349 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/index.d.ts +12 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/index.js +49 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/index.less +103 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/locales.d.ts +39 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/locales.js +41 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/types.d.ts +97 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/types.js +1 -0
- package/es/pro/priceKeyboard/components/discountKeyboard/index.d.ts +22 -0
- package/es/pro/priceKeyboard/components/discountKeyboard/index.js +465 -0
- package/es/pro/priceKeyboard/components/discountKeyboard/index.less +47 -0
- package/es/pro/priceKeyboard/components/discountKeyboard/locales.d.ts +42 -0
- package/es/pro/priceKeyboard/components/discountKeyboard/locales.js +44 -0
- package/es/pro/priceKeyboard/components/discountKeyboard/types.d.ts +17 -0
- package/es/pro/priceKeyboard/components/discountKeyboard/types.js +1 -0
- package/es/pro/priceKeyboard/components/paymentKeyboard/index.d.ts +12 -0
- package/es/pro/priceKeyboard/components/paymentKeyboard/index.js +444 -0
- package/es/pro/priceKeyboard/components/paymentKeyboard/index.less +64 -0
- package/es/pro/priceKeyboard/components/paymentKeyboard/locales.d.ts +45 -0
- package/es/pro/priceKeyboard/components/paymentKeyboard/locales.js +47 -0
- package/es/pro/priceKeyboard/components/paymentKeyboard/types.d.ts +39 -0
- package/es/pro/priceKeyboard/components/paymentKeyboard/types.js +1 -0
- package/es/pro/priceKeyboard/components/shortcuts/index.d.ts +17 -0
- package/es/pro/priceKeyboard/components/shortcuts/index.js +47 -0
- package/es/pro/priceKeyboard/components/shortcuts/index.less +39 -0
- package/es/pro/priceKeyboard/hooks/keyActions.d.ts +28 -0
- package/es/pro/priceKeyboard/hooks/keyActions.js +252 -0
- package/es/pro/priceKeyboard/hooks/rightItems.d.ts +28 -0
- package/es/pro/priceKeyboard/hooks/rightItems.js +50 -0
- package/es/pro/priceKeyboard/index.d.ts +3 -0
- package/es/pro/priceKeyboard/index.js +3 -0
- package/es/pro/priceKeyboard/index.less +215 -0
- package/es/pro/priceKeyboard/utils.d.ts +31 -0
- package/es/pro/priceKeyboard/utils.js +51 -0
- package/es/pro/skuDetailModal/index.js +19 -16
- package/lib/components/booking/addons/model.d.ts +1 -10
- package/lib/components/booking/components/actionButtons/index.js +31 -28
- package/lib/components/booking/components/actionButtons/index.less +0 -28
- package/lib/components/booking/components/footer/amount.d.ts +3 -3
- package/lib/components/booking/components/footer/amount.js +49 -34
- package/lib/components/booking/components/footer/index.js +114 -40
- package/lib/components/booking/components/footer/utils.js +35 -7
- package/lib/components/booking/forms/model.d.ts +1 -10
- package/lib/components/booking/info/model.d.ts +1 -10
- package/lib/components/booking/info/model.js +3 -0
- package/lib/components/booking/info/service/addService/index.js +2 -1
- package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info/service2/utils.d.ts +1 -1
- package/lib/components/booking/info2/index.js +18 -1
- package/lib/components/booking/info2/service/addService/index.js +2 -1
- package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info2/service/editService/index.js +12 -4
- 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.js +10 -5
- package/lib/components/checkout/PaymentModal.d.ts +2 -0
- package/lib/components/checkout/PaymentModal.js +208 -91
- package/lib/components/checkout/components/AdditionalModule/index.less +1 -1
- package/lib/components/checkout/components/AmountSummary/index.js +120 -50
- package/lib/components/checkout/components/AmountSummary/index.less +13 -0
- package/lib/components/checkout/components/CashPaymentModule/index.d.ts +5 -3
- package/lib/components/checkout/components/CashPaymentModule/index.js +101 -134
- package/lib/components/checkout/components/CashPaymentModule/index.less +200 -176
- package/lib/components/checkout/components/PaymentDetailModal/index.js +2 -2
- package/lib/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.d.ts +29 -0
- package/lib/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.js +163 -0
- package/lib/components/checkout/components/PaymentOptionsModule/index.d.ts +2 -4
- package/lib/components/checkout/components/PaymentOptionsModule/index.js +11 -123
- package/lib/components/checkout/components/PaymentOptionsModule/index.less +23 -0
- package/lib/components/checkout/components/PaymentResultToast/index.js +26 -1
- package/lib/components/checkout/components/PaymentResultToast/types.d.ts +2 -0
- package/lib/components/checkout/components/SavePayLaterHandler/index.js +1 -1
- package/lib/components/checkout/components/SearchAndClientModule/index.js +3 -29
- package/lib/components/checkout/components/WalletPassModule/index.js +4 -3
- package/lib/components/checkout/components/WalletPassModule/utils.js +8 -4
- package/lib/components/checkout/hooks/useWalletPass.js +11 -6
- package/lib/components/checkout/index.less +1 -1
- package/lib/components/checkout/locales.d.ts +36 -0
- package/lib/components/checkout/locales.js +43 -4
- package/lib/components/checkout/types.d.ts +1 -0
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/store/index.d.ts +3 -3
- 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 +111 -51
- package/lib/components/shoppingCart/components/Cart/index.js +1 -1
- package/lib/components/shoppingCart/components/Cart/index.less +31 -0
- package/lib/components/shoppingCart/locales.d.ts +3 -0
- package/lib/components/shoppingCart/locales.js +6 -3
- package/lib/components/ticketBooking/components/addServiceVariant/addService.d.ts +0 -1
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +1 -4
- package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -1
- package/lib/components/ticketBooking/components/menuBar/index.js +1 -1
- package/lib/components/ticketBooking/components/menuBar/index.less +7 -0
- package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +0 -1
- package/lib/components/ticketBooking/hooks/pisellos/useCustomer.js +7 -7
- package/lib/components/ticketBooking/index.d.ts +0 -1
- package/lib/components/ticketBooking/utils/index.d.ts +1 -1
- package/lib/components/ticketBooking/utils/index.js +2 -1
- package/lib/components/wallet/Detail/model.d.ts +1 -13
- package/lib/components/wallet/DiscountCard/model.d.ts +1 -14
- package/lib/components/wallet/PointCard/model.d.ts +1 -13
- package/lib/components/wallet/RechargeableCard/model.d.ts +1 -29
- package/lib/components/wallet/Voucher/model.d.ts +1 -13
- package/lib/components/wallet/model.d.ts +1 -9
- package/lib/pro/pisellPriceKeyboardPopover/PisellPriceKeyboardPopover.js +2 -2
- package/lib/pro/pisellSimplePriceKeyboardPopover/PisellPriceKeyboardPopover.d.ts +5 -0
- package/lib/pro/pisellSimplePriceKeyboardPopover/PisellPriceKeyboardPopover.js +144 -0
- package/lib/pro/pisellSimplePriceKeyboardPopover/PisellPriceKeyboardPopover.less +23 -0
- package/lib/pro/pisellSimplePriceKeyboardPopover/index.d.ts +2 -0
- package/lib/pro/pisellSimplePriceKeyboardPopover/index.js +35 -0
- package/lib/pro/pisellSimplePriceKeyboardPopover/types.d.ts +33 -0
- package/lib/pro/pisellSimplePriceKeyboardPopover/types.js +17 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.d.ts +5 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.js +360 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/CashKeyboardSimple.d.ts +13 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/CashKeyboardSimple.js +399 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/index.d.ts +12 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/index.js +76 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/index.less +103 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/locales.d.ts +39 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/locales.js +65 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/types.d.ts +97 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/types.js +17 -0
- package/lib/pro/priceKeyboard/components/discountKeyboard/index.d.ts +22 -0
- package/lib/pro/priceKeyboard/components/discountKeyboard/index.js +504 -0
- package/lib/pro/priceKeyboard/components/discountKeyboard/index.less +47 -0
- package/lib/pro/priceKeyboard/components/discountKeyboard/locales.d.ts +42 -0
- package/lib/pro/priceKeyboard/components/discountKeyboard/locales.js +68 -0
- package/lib/pro/priceKeyboard/components/discountKeyboard/types.d.ts +17 -0
- package/lib/pro/priceKeyboard/components/discountKeyboard/types.js +17 -0
- package/lib/pro/priceKeyboard/components/paymentKeyboard/index.d.ts +12 -0
- package/lib/pro/priceKeyboard/components/paymentKeyboard/index.js +488 -0
- package/lib/pro/priceKeyboard/components/paymentKeyboard/index.less +64 -0
- package/lib/pro/priceKeyboard/components/paymentKeyboard/locales.d.ts +45 -0
- package/lib/pro/priceKeyboard/components/paymentKeyboard/locales.js +71 -0
- package/lib/pro/priceKeyboard/components/paymentKeyboard/types.d.ts +39 -0
- package/lib/pro/priceKeyboard/components/paymentKeyboard/types.js +17 -0
- package/lib/pro/priceKeyboard/components/shortcuts/index.d.ts +17 -0
- package/lib/pro/priceKeyboard/components/shortcuts/index.js +79 -0
- package/lib/pro/priceKeyboard/components/shortcuts/index.less +39 -0
- package/lib/pro/priceKeyboard/hooks/keyActions.d.ts +28 -0
- package/lib/pro/priceKeyboard/hooks/keyActions.js +176 -0
- package/lib/pro/priceKeyboard/hooks/rightItems.d.ts +28 -0
- package/lib/pro/priceKeyboard/hooks/rightItems.js +81 -0
- package/lib/pro/priceKeyboard/index.d.ts +3 -0
- package/lib/pro/priceKeyboard/index.js +45 -0
- package/lib/pro/priceKeyboard/index.less +215 -0
- package/lib/pro/priceKeyboard/utils.d.ts +31 -0
- package/lib/pro/priceKeyboard/utils.js +75 -0
- package/lib/pro/skuDetailModal/index.js +18 -22
- package/package.json +12 -12
@@ -57,7 +57,7 @@ import { useShopDiscount } from "../../../appointmentBooking/hooks";
|
|
57
57
|
* @Date: 2024-01-30 16:51
|
58
58
|
*/
|
59
59
|
var Footer = function Footer(props) {
|
60
|
-
var _context$appHelper, _state$bookingConfig2, _state$bookingConfig4, _state$addons2, _state$bookingDetail, _state$bookingDetail2, _state$client2, _state$notes3, _state$
|
60
|
+
var _context$appHelper, _state$paymentPaid2, _state$bookingConfig2, _state$bookingConfig4, _state$addons2, _state$bookingDetail, _state$bookingDetail2, _state$client2, _state$notes3, _state$bookingDetail13, _state$addons4, _state$notes4;
|
61
61
|
var state = props.state,
|
62
62
|
buttons = props.buttons,
|
63
63
|
dispatch = props.dispatch,
|
@@ -95,10 +95,16 @@ var Footer = function Footer(props) {
|
|
95
95
|
_useState14 = _slicedToArray(_useState13, 2),
|
96
96
|
paymentCallback = _useState14[0],
|
97
97
|
setPaymentCallback = _useState14[1];
|
98
|
-
|
98
|
+
|
99
|
+
// edit order id
|
100
|
+
var _useState15 = useState(0),
|
99
101
|
_useState16 = _slicedToArray(_useState15, 2),
|
100
|
-
|
101
|
-
|
102
|
+
editOrderId = _useState16[0],
|
103
|
+
setEditOrderId = _useState16[1];
|
104
|
+
var _useState17 = useState(false),
|
105
|
+
_useState18 = _slicedToArray(_useState17, 2),
|
106
|
+
isShowPaymentLink = _useState18[0],
|
107
|
+
setIsShowPaymentLink = _useState18[1];
|
102
108
|
var isBooking4Shop = useIsBooking4Shop(state);
|
103
109
|
var appointmentProductRef = useRef(null);
|
104
110
|
var context = useEngineContext();
|
@@ -109,7 +115,8 @@ var Footer = function Footer(props) {
|
|
109
115
|
store = _context$appHelper$ut.store,
|
110
116
|
storage = _context$appHelper$ut.storage,
|
111
117
|
pisellosAllModule = _context$appHelper$ut.pisellosAllModule,
|
112
|
-
getData = _context$appHelper$ut.getData
|
118
|
+
getData = _context$appHelper$ut.getData,
|
119
|
+
pisellos = _context$appHelper$ut.pisellos;
|
113
120
|
var _useScanManager = useScanManager(),
|
114
121
|
disableAllScanListeners = _useScanManager.disableAllScanListeners;
|
115
122
|
var ScheduleModule = pisellosAllModule.ScheduleModule;
|
@@ -161,6 +168,12 @@ var Footer = function Footer(props) {
|
|
161
168
|
console.error(error);
|
162
169
|
}
|
163
170
|
}, []);
|
171
|
+
useEffect(function () {
|
172
|
+
var _state$service, _state$service2, _state$paymentPaid;
|
173
|
+
if ((((_state$service = state.service) === null || _state$service === void 0 || (_state$service = _state$service.value) === null || _state$service === void 0 ? void 0 : _state$service.length) === 0 || !((_state$service2 = state.service) !== null && _state$service2 !== void 0 && _state$service2.value)) && !((_state$paymentPaid = state.paymentPaid) !== null && _state$paymentPaid !== void 0 && (_state$paymentPaid = _state$paymentPaid.value) !== null && _state$paymentPaid !== void 0 && _state$paymentPaid.paidAmount)) {
|
174
|
+
setEditOrderId(0);
|
175
|
+
}
|
176
|
+
}, [state.service.value, (_state$paymentPaid2 = state.paymentPaid) === null || _state$paymentPaid2 === void 0 ? void 0 : _state$paymentPaid2.value]);
|
164
177
|
var _Modal$useModal = Modal.useModal(),
|
165
178
|
_Modal$useModal2 = _slicedToArray(_Modal$useModal, 2),
|
166
179
|
modal = _Modal$useModal2[0],
|
@@ -248,7 +261,7 @@ var Footer = function Footer(props) {
|
|
248
261
|
|
249
262
|
// info 是否有编辑
|
250
263
|
var infoEdit = useMemo(function () {
|
251
|
-
var _state$client, _state$date, _state$pet, _state$
|
264
|
+
var _state$client, _state$date, _state$pet, _state$service3, _state$notes, _state$contacts;
|
252
265
|
if (!state.bookingId) {
|
253
266
|
return true;
|
254
267
|
}
|
@@ -261,7 +274,7 @@ var Footer = function Footer(props) {
|
|
261
274
|
if ((_state$pet = state.pet) !== null && _state$pet !== void 0 && _state$pet.edit) {
|
262
275
|
return true;
|
263
276
|
}
|
264
|
-
if ((_state$
|
277
|
+
if ((_state$service3 = state.service) !== null && _state$service3 !== void 0 && _state$service3.edit) {
|
265
278
|
return true;
|
266
279
|
}
|
267
280
|
if ((_state$notes = state.notes) !== null && _state$notes !== void 0 && _state$notes.edit) {
|
@@ -780,6 +793,40 @@ var Footer = function Footer(props) {
|
|
780
793
|
return _isHasDayProducts;
|
781
794
|
};
|
782
795
|
|
796
|
+
/**
|
797
|
+
* 是否只有定金支付
|
798
|
+
*/
|
799
|
+
var isOnlyDeposit = useMemo(function () {
|
800
|
+
var _state$bookingDetail3, _state$bookingDetail4, _state$bookingDetail5;
|
801
|
+
if (state !== null && state !== void 0 && (_state$bookingDetail3 = state.bookingDetail) !== null && _state$bookingDetail3 !== void 0 && _state$bookingDetail3.deposit_payment_time && state !== null && state !== void 0 && (_state$bookingDetail4 = state.bookingDetail) !== null && _state$bookingDetail4 !== void 0 && (_state$bookingDetail4 = _state$bookingDetail4.payment_types) !== null && _state$bookingDetail4 !== void 0 && (_state$bookingDetail5 = _state$bookingDetail4.every) !== null && _state$bookingDetail5 !== void 0 && _state$bookingDetail5.call(_state$bookingDetail4, function (item) {
|
802
|
+
return item === 'deposit';
|
803
|
+
})) {
|
804
|
+
return true;
|
805
|
+
}
|
806
|
+
return false;
|
807
|
+
}, [state === null || state === void 0 ? void 0 : state.bookingDetail]);
|
808
|
+
|
809
|
+
/**
|
810
|
+
* @title: 欠款文案
|
811
|
+
* @description: 商家欠用户钱
|
812
|
+
* @param {*} useMemo
|
813
|
+
* @return {*}
|
814
|
+
* @Author: zhiwei.Wang
|
815
|
+
* @Date: 2024-01-30 17:01
|
816
|
+
*/
|
817
|
+
var arrearsText = useMemo(function () {
|
818
|
+
var str = '';
|
819
|
+
// 只有定金支付时不展示退款金额
|
820
|
+
if (isOnlyDeposit) {
|
821
|
+
return str;
|
822
|
+
}
|
823
|
+
// 欠款
|
824
|
+
if (total.dueAmount < 0) {
|
825
|
+
str = "".concat(locales.getText('pisell1.text.refund-customer'), ": ").concat(formatAmount(total.dueAmount, 2, (state === null || state === void 0 ? void 0 : state.amountSymbol) || '$'));
|
826
|
+
}
|
827
|
+
return str;
|
828
|
+
}, [state, total, isOnlyDeposit]);
|
829
|
+
|
783
830
|
/**
|
784
831
|
* @title: 保存info
|
785
832
|
* @description:
|
@@ -790,7 +837,7 @@ var Footer = function Footer(props) {
|
|
790
837
|
*/
|
791
838
|
var handleSave = /*#__PURE__*/function () {
|
792
839
|
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(_ref6) {
|
793
|
-
var type, _ref6$messageShow, messageShow, _ref6$noSubmit, noSubmit, isHasDayProducts, _setLoading, _getApis, createBooking, editBooking, editApi, createApi, saveOtherValue, _state$onSave, callbackData, values, api;
|
840
|
+
var type, _ref6$messageShow, messageShow, _ref6$noSubmit, noSubmit, isHasDayProducts, _setLoading, _getApis, createBooking, editBooking, editApi, createApi, saveOtherValue, _state$onSave, callbackData, values, checkout, subtotal_info, res, isNeedDeposit, api;
|
794
841
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
795
842
|
while (1) switch (_context6.prev = _context6.next) {
|
796
843
|
case 0:
|
@@ -848,6 +895,46 @@ var Footer = function Footer(props) {
|
|
848
895
|
}
|
849
896
|
return _context6.abrupt("return", values);
|
850
897
|
case 27:
|
898
|
+
checkout = pisellos.getModule('checkout'); // 如果有 orderid,则应该走更新逻辑
|
899
|
+
if (!editOrderId) {
|
900
|
+
_context6.next = 37;
|
901
|
+
break;
|
902
|
+
}
|
903
|
+
subtotal_info = {
|
904
|
+
subTotalList: cloneDeep(subTotalList),
|
905
|
+
orderTotalList: cloneDeep(orderTotalList),
|
906
|
+
total: cloneDeep(total),
|
907
|
+
showDetail: showDetail
|
908
|
+
};
|
909
|
+
_context6.next = 32;
|
910
|
+
return checkout.updateLocalOrderAsync({
|
911
|
+
orderId: editOrderId,
|
912
|
+
orderData: values,
|
913
|
+
cartSummary: subtotal_info.subTotalList,
|
914
|
+
autoPayment: true,
|
915
|
+
totalInfo: subtotal_info
|
916
|
+
});
|
917
|
+
case 32:
|
918
|
+
_context6.next = 34;
|
919
|
+
return checkout.manualSyncOrderAsync();
|
920
|
+
case 34:
|
921
|
+
res = _context6.sent;
|
922
|
+
if (res.success) {
|
923
|
+
// 回调关闭弹窗
|
924
|
+
state === null || state === void 0 || state.callback(res, type);
|
925
|
+
_setLoading(false);
|
926
|
+
}
|
927
|
+
return _context6.abrupt("return");
|
928
|
+
case 37:
|
929
|
+
// 如果是保存,检查是否需要支付定金
|
930
|
+
if (type === 'save') {
|
931
|
+
isNeedDeposit = checkout.checkIsNeedDepositAsync(values.bookings, values.relation_products);
|
932
|
+
if (isNeedDeposit !== null && isNeedDeposit !== void 0 && isNeedDeposit.hasDeposit) {
|
933
|
+
values.is_deposit = 1;
|
934
|
+
values.deposit_amount = isNeedDeposit === null || isNeedDeposit === void 0 ? void 0 : isNeedDeposit.total;
|
935
|
+
}
|
936
|
+
}
|
937
|
+
|
851
938
|
// 区分是新增还是编辑
|
852
939
|
api = state.bookingId ? editApi : createApi; // 增加日志记录
|
853
940
|
sendWarningLog({
|
@@ -891,43 +978,43 @@ var Footer = function Footer(props) {
|
|
891
978
|
|
892
979
|
// 如果有addons改动, 则先保存
|
893
980
|
if (!addonsEdit) {
|
894
|
-
_context6.next =
|
981
|
+
_context6.next = 43;
|
895
982
|
break;
|
896
983
|
}
|
897
|
-
_context6.next =
|
984
|
+
_context6.next = 43;
|
898
985
|
return handleSaveAddons();
|
899
|
-
case
|
986
|
+
case 43:
|
900
987
|
if (!infoEdit) {
|
901
|
-
_context6.next =
|
988
|
+
_context6.next = 48;
|
902
989
|
break;
|
903
990
|
}
|
904
|
-
_context6.next =
|
905
|
-
return api(values, state.bookingId);
|
906
|
-
case
|
991
|
+
_context6.next = 46;
|
992
|
+
return api(values, state.bookingId || editOrderId);
|
993
|
+
case 46:
|
907
994
|
callbackData = _context6.sent;
|
908
995
|
if (messageShow) {
|
909
996
|
message.success(locales.getText(state.bookingId ? 'pisell2.text.appointment-updated' : 'pisell2.text.created-successfully'));
|
910
997
|
}
|
911
|
-
case
|
998
|
+
case 48:
|
912
999
|
// 回调关闭弹窗
|
913
1000
|
state === null || state === void 0 || state.callback(callbackData, type);
|
914
1001
|
_setLoading(false);
|
915
1002
|
|
916
1003
|
// return数据 checkout时需要
|
917
1004
|
return _context6.abrupt("return", callbackData || values);
|
918
|
-
case
|
919
|
-
_context6.prev =
|
1005
|
+
case 53:
|
1006
|
+
_context6.prev = 53;
|
920
1007
|
_context6.t1 = _context6["catch"](21);
|
921
1008
|
console.log(_context6.t1);
|
922
1009
|
if ((_context6.t1 === null || _context6.t1 === void 0 ? void 0 : _context6.t1.code) === 70101) {
|
923
1010
|
message.error(_context6.t1 === null || _context6.t1 === void 0 ? void 0 : _context6.t1.message);
|
924
1011
|
}
|
925
1012
|
_setLoading(false);
|
926
|
-
case
|
1013
|
+
case 58:
|
927
1014
|
case "end":
|
928
1015
|
return _context6.stop();
|
929
1016
|
}
|
930
|
-
}, _callee6, null, [[21,
|
1017
|
+
}, _callee6, null, [[21, 53]]);
|
931
1018
|
}));
|
932
1019
|
return function handleSave(_x5) {
|
933
1020
|
return _ref7.apply(this, arguments);
|
@@ -1006,8 +1093,8 @@ var Footer = function Footer(props) {
|
|
1006
1093
|
});
|
1007
1094
|
};
|
1008
1095
|
var paymentRefundedStatus = useMemo(function () {
|
1009
|
-
var _state$
|
1010
|
-
return ['partially_refunded', 'refunded'].includes(state === null || state === void 0 || (_state$
|
1096
|
+
var _state$bookingDetail6;
|
1097
|
+
return ['partially_refunded', 'refunded'].includes(state === null || state === void 0 || (_state$bookingDetail6 = state.bookingDetail) === null || _state$bookingDetail6 === void 0 ? void 0 : _state$bookingDetail6.payment_status);
|
1011
1098
|
}, [state === null || state === void 0 ? void 0 : state.bookingDetail]);
|
1012
1099
|
|
1013
1100
|
/**
|
@@ -1044,12 +1131,12 @@ var Footer = function Footer(props) {
|
|
1044
1131
|
onClick: function onClick() {
|
1045
1132
|
handleCheckout();
|
1046
1133
|
},
|
1047
|
-
disabled: isDisabled || isDisabledCheckOutForNegativeOrder
|
1134
|
+
disabled: isDisabled || isDisabledCheckOutForNegativeOrder || arrearsText !== ''
|
1048
1135
|
}, locales.getText('pisell2.text.checkout')));
|
1049
|
-
}, [isEdit, checkoutLoading, isDisabled, state, source]);
|
1136
|
+
}, [isEdit, checkoutLoading, isDisabled, state, source, arrearsText]);
|
1050
1137
|
var handleMenuClick = /*#__PURE__*/function () {
|
1051
1138
|
var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(e) {
|
1052
|
-
var id, customer, res, _state$
|
1139
|
+
var id, customer, res, _state$bookingDetail7, _state$bookingDetail8;
|
1053
1140
|
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
1054
1141
|
while (1) switch (_context8.prev = _context8.next) {
|
1055
1142
|
case 0:
|
@@ -1077,10 +1164,10 @@ var Footer = function Footer(props) {
|
|
1077
1164
|
type: 'pisell1.sendPayLinkEmail',
|
1078
1165
|
data: {
|
1079
1166
|
id: id,
|
1080
|
-
is_deposit: state.bookingDetail.is_deposit || Number((_state$
|
1167
|
+
is_deposit: state.bookingDetail.is_deposit || Number((_state$bookingDetail7 = state.bookingDetail) === null || _state$bookingDetail7 === void 0 ? void 0 : _state$bookingDetail7.deposit_amount),
|
1081
1168
|
deposit_payment_time: state.bookingDetail.deposit_payment_time,
|
1082
1169
|
customer: customer,
|
1083
|
-
contacts: (_state$
|
1170
|
+
contacts: (_state$bookingDetail8 = state.bookingDetail) === null || _state$bookingDetail8 === void 0 ? void 0 : _state$bookingDetail8.contacts
|
1084
1171
|
},
|
1085
1172
|
callback: function callback() {}
|
1086
1173
|
});
|
@@ -1361,10 +1448,10 @@ var Footer = function Footer(props) {
|
|
1361
1448
|
* @Date: 2024-01-30 16:58
|
1362
1449
|
*/
|
1363
1450
|
var isCheckout = useMemo(function () {
|
1364
|
-
var _state$
|
1451
|
+
var _state$bookingDetail9, _state$bookingDetail10;
|
1365
1452
|
var list = ['unfulfilled', 'partially_paid', 'unpaid', 'payment_processing'];
|
1366
1453
|
// (支付状态 = 已支付 || 部分付款 || 未付款 || 支付处理中) && 预约状态 !== 已取消
|
1367
|
-
if (!state.bookingId || ((_state$
|
1454
|
+
if (!state.bookingId || ((_state$bookingDetail9 = state.bookingDetail) === null || _state$bookingDetail9 === void 0 || (_state$bookingDetail9 = _state$bookingDetail9.bookings) === null || _state$bookingDetail9 === void 0 ? void 0 : _state$bookingDetail9.appointment_status) !== 'cancelled' && list.includes(state === null || state === void 0 || (_state$bookingDetail10 = state.bookingDetail) === null || _state$bookingDetail10 === void 0 ? void 0 : _state$bookingDetail10.payment_status) && !state.disabledEdit) {
|
1368
1455
|
return true;
|
1369
1456
|
} else {
|
1370
1457
|
if (total.notPaidAmount > 0) {
|
@@ -1471,7 +1558,7 @@ var Footer = function Footer(props) {
|
|
1471
1558
|
return [];
|
1472
1559
|
}, [buttons, total, isEdit, checkoutLoading, isDisabled, source, buttonMap, loading, isCheckout, state, isTeam, isShowClearAll]);
|
1473
1560
|
var moreButton = useMemo(function () {
|
1474
|
-
var _state$
|
1561
|
+
var _state$bookingDetail11;
|
1475
1562
|
var arr = [];
|
1476
1563
|
if (!state.bookingId) {
|
1477
1564
|
return [];
|
@@ -1484,15 +1571,15 @@ var Footer = function Footer(props) {
|
|
1484
1571
|
}
|
1485
1572
|
|
1486
1573
|
// 如果订单已退款, 则不展示任何按钮
|
1487
|
-
if ((state === null || state === void 0 || (_state$
|
1574
|
+
if ((state === null || state === void 0 || (_state$bookingDetail11 = state.bookingDetail) === null || _state$bookingDetail11 === void 0 ? void 0 : _state$bookingDetail11.payment_status) === 'refunded') {
|
1488
1575
|
return [];
|
1489
1576
|
}
|
1490
1577
|
|
1491
1578
|
// 如果外部没有按钮, 则rebook按钮放在外面
|
1492
1579
|
if (_buttons.length !== 0) {
|
1493
|
-
var _state$
|
1580
|
+
var _state$bookingDetail12;
|
1494
1581
|
// 支付链接, 部分退款时, 不展示支付链接
|
1495
|
-
if (state.bookingId && isShowPaymentLink && (state === null || state === void 0 || (_state$
|
1582
|
+
if (state.bookingId && isShowPaymentLink && (state === null || state === void 0 || (_state$bookingDetail12 = state.bookingDetail) === null || _state$bookingDetail12 === void 0 ? void 0 : _state$bookingDetail12.payment_status) !== 'partially_refunded') {
|
1496
1583
|
arr.push(actionMap.paymentLink);
|
1497
1584
|
}
|
1498
1585
|
}
|
@@ -1526,20 +1613,7 @@ var Footer = function Footer(props) {
|
|
1526
1613
|
// 取消订单
|
1527
1614
|
// arr.push(actionMap.cancelOrder);
|
1528
1615
|
return arr;
|
1529
|
-
}, [state, total, isShowPaymentLink, source, _buttons.length, state === null || state === void 0 || (_state$
|
1530
|
-
|
1531
|
-
/**
|
1532
|
-
* 是否只有定金支付
|
1533
|
-
*/
|
1534
|
-
var isOnlyDeposit = useMemo(function () {
|
1535
|
-
var _state$bookingDetail11, _state$bookingDetail12, _state$bookingDetail13;
|
1536
|
-
if (state !== null && state !== void 0 && (_state$bookingDetail11 = state.bookingDetail) !== null && _state$bookingDetail11 !== void 0 && _state$bookingDetail11.deposit_payment_time && state !== null && state !== void 0 && (_state$bookingDetail12 = state.bookingDetail) !== null && _state$bookingDetail12 !== void 0 && (_state$bookingDetail12 = _state$bookingDetail12.payment_types) !== null && _state$bookingDetail12 !== void 0 && (_state$bookingDetail13 = _state$bookingDetail12.every) !== null && _state$bookingDetail13 !== void 0 && _state$bookingDetail13.call(_state$bookingDetail12, function (item) {
|
1537
|
-
return item === 'deposit';
|
1538
|
-
})) {
|
1539
|
-
return true;
|
1540
|
-
}
|
1541
|
-
return false;
|
1542
|
-
}, [state === null || state === void 0 ? void 0 : state.bookingDetail]);
|
1616
|
+
}, [state, total, isShowPaymentLink, source, _buttons.length, state === null || state === void 0 || (_state$bookingDetail13 = state.bookingDetail) === null || _state$bookingDetail13 === void 0 ? void 0 : _state$bookingDetail13.payment_status]);
|
1543
1617
|
|
1544
1618
|
/**
|
1545
1619
|
* @title: 总计文案
|
@@ -1576,27 +1650,6 @@ var Footer = function Footer(props) {
|
|
1576
1650
|
return str;
|
1577
1651
|
}, [state, total, state.bookingId, isOnlyDeposit]);
|
1578
1652
|
|
1579
|
-
/**
|
1580
|
-
* @title: 欠款文案
|
1581
|
-
* @description: 商家欠用户钱
|
1582
|
-
* @param {*} useMemo
|
1583
|
-
* @return {*}
|
1584
|
-
* @Author: zhiwei.Wang
|
1585
|
-
* @Date: 2024-01-30 17:01
|
1586
|
-
*/
|
1587
|
-
var arrearsText = useMemo(function () {
|
1588
|
-
var str = '';
|
1589
|
-
// 只有定金支付时不展示退款金额
|
1590
|
-
if (isOnlyDeposit) {
|
1591
|
-
return str;
|
1592
|
-
}
|
1593
|
-
// 欠款
|
1594
|
-
if (total.dueAmount < 0) {
|
1595
|
-
str = "".concat(locales.getText('pisell1.text.refund-customer'), ": ").concat(formatAmount(total.dueAmount, 2, (state === null || state === void 0 ? void 0 : state.amountSymbol) || '$'));
|
1596
|
-
}
|
1597
|
-
return str;
|
1598
|
-
}, [state, total, isOnlyDeposit]);
|
1599
|
-
|
1600
1653
|
/**
|
1601
1654
|
* @title: 是否显示footer loading
|
1602
1655
|
* @description: 避免数据未获取完时页面闪动
|
@@ -1728,6 +1781,52 @@ var Footer = function Footer(props) {
|
|
1728
1781
|
|
1729
1782
|
// 清空商品券
|
1730
1783
|
shopDiscount === null || shopDiscount === void 0 || (_shopDiscount$clear = shopDiscount.clear) === null || _shopDiscount$clear === void 0 || _shopDiscount$clear.call(shopDiscount);
|
1784
|
+
setEditOrderId(0);
|
1785
|
+
};
|
1786
|
+
|
1787
|
+
// 购物车进入编辑状态
|
1788
|
+
var setEditCartMode = function setEditCartMode(order_id, payData) {
|
1789
|
+
var closeModal = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
1790
|
+
setEditOrderId(order_id);
|
1791
|
+
// 关闭 checkout 弹窗
|
1792
|
+
if (closeModal) {
|
1793
|
+
setIsPaymentModalOpen(false);
|
1794
|
+
}
|
1795
|
+
// 给当前购物车中的商品添加一个编辑标识
|
1796
|
+
// 标记当前商品为编辑模式
|
1797
|
+
dispatch({
|
1798
|
+
type: 'setService',
|
1799
|
+
payload: {
|
1800
|
+
value: state.service.value.map(function (item) {
|
1801
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
1802
|
+
edit: true,
|
1803
|
+
booking_id: 'checkout_edit',
|
1804
|
+
discount_list: item.discount_list.map(function (d) {
|
1805
|
+
return _objectSpread(_objectSpread({}, d), {}, {
|
1806
|
+
id: d.discount.resource_id
|
1807
|
+
});
|
1808
|
+
})
|
1809
|
+
});
|
1810
|
+
})
|
1811
|
+
}
|
1812
|
+
});
|
1813
|
+
// 存储部分支付数据
|
1814
|
+
dispatch({
|
1815
|
+
type: 'setPaymentPaid',
|
1816
|
+
payload: {
|
1817
|
+
value: {
|
1818
|
+
paidAmount: payData.paidAmount,
|
1819
|
+
paidAmountWithoutSurcharge: payData.paidAmountWithoutSurcharge
|
1820
|
+
}
|
1821
|
+
}
|
1822
|
+
});
|
1823
|
+
// 需要重新拉取商品券、折扣卡列表,避免商品券被重新抵扣
|
1824
|
+
shopDiscount.loadPrepareConfig({
|
1825
|
+
customerId: state.client.value.id,
|
1826
|
+
action: 'create',
|
1827
|
+
with_good_pass: 1,
|
1828
|
+
with_discount_card: 1
|
1829
|
+
});
|
1731
1830
|
};
|
1732
1831
|
return /*#__PURE__*/React.createElement(Skeleton, {
|
1733
1832
|
title: false,
|
@@ -1807,8 +1906,10 @@ var Footer = function Footer(props) {
|
|
1807
1906
|
onCancel: handleNoteCancel
|
1808
1907
|
}), isPaymentModalOpen && /*#__PURE__*/React.createElement(PaymentModal, {
|
1809
1908
|
open: true,
|
1909
|
+
editOrderId: editOrderId,
|
1810
1910
|
data: paymentModalData,
|
1811
1911
|
callback: paymentCallback || undefined,
|
1912
|
+
setEditCartMode: setEditCartMode,
|
1812
1913
|
state: state,
|
1813
1914
|
dispatch: dispatch,
|
1814
1915
|
onClose: function onClose(reset) {
|
@@ -1816,6 +1917,14 @@ var Footer = function Footer(props) {
|
|
1816
1917
|
setIsPaymentModalOpen(false);
|
1817
1918
|
setPaymentModalData(null);
|
1818
1919
|
setPaymentCallback(null);
|
1920
|
+
// 清除编辑模式
|
1921
|
+
setEditOrderId(0);
|
1922
|
+
dispatch({
|
1923
|
+
type: 'setPaymentPaid',
|
1924
|
+
payload: {
|
1925
|
+
value: {}
|
1926
|
+
}
|
1927
|
+
});
|
1819
1928
|
// if (reset) {
|
1820
1929
|
// handleClearAllAndReset();
|
1821
1930
|
// }
|