@pisell/private-materials 6.4.42 → 6.4.43
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 +146 -146
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +8 -8
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +8 -8
- 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 +13 -2
- package/es/components/booking/components/footer/index.js +168 -68
- package/es/components/booking/components/footer/utils.js +62 -33
- package/es/components/booking/info/model.js +5 -0
- package/es/components/booking/info/service/addService/index.js +2 -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/editService/index.js +12 -4
- package/es/components/checkout/PaymentModal.d.ts +2 -0
- package/es/components/checkout/PaymentModal.js +395 -240
- package/es/components/checkout/components/AdditionalModule/index.less +1 -1
- package/es/components/checkout/components/AmountSummary/index.js +161 -54
- package/es/components/checkout/components/CashPaymentModule/index.d.ts +5 -3
- package/es/components/checkout/components/CashPaymentModule/index.js +114 -137
- 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 +210 -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 +29 -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 +3 -2
- package/es/components/checkout/components/WalletPassModule/utils.js +6 -1
- package/es/components/checkout/hooks/useWalletPass.d.ts +1 -1
- package/es/components/checkout/hooks/useWalletPass.js +2 -0
- package/es/components/checkout/index.less +1 -1
- package/es/components/checkout/locales.d.ts +33 -0
- package/es/components/checkout/locales.js +39 -3
- package/es/components/checkout/types.d.ts +1 -0
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/store/index.d.ts +2 -2
- 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/utils/index.js +2 -1
- 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 +4 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.js +310 -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 +11 -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 +442 -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 +11 -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 +27 -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/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 +10 -4
- package/lib/components/booking/components/footer/index.js +107 -40
- package/lib/components/booking/components/footer/utils.js +35 -7
- package/lib/components/booking/info/model.js +3 -0
- package/lib/components/booking/info/service/addService/index.js +2 -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/editService/index.js +12 -4
- package/lib/components/checkout/PaymentModal.d.ts +2 -0
- package/lib/components/checkout/PaymentModal.js +152 -73
- package/lib/components/checkout/components/AdditionalModule/index.less +1 -1
- package/lib/components/checkout/components/AmountSummary/index.js +114 -40
- package/lib/components/checkout/components/CashPaymentModule/index.d.ts +5 -3
- package/lib/components/checkout/components/CashPaymentModule/index.js +103 -140
- 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 +172 -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 +29 -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 +3 -2
- package/lib/components/checkout/components/WalletPassModule/utils.js +4 -1
- package/lib/components/checkout/hooks/useWalletPass.d.ts +1 -1
- package/lib/components/checkout/hooks/useWalletPass.js +2 -0
- package/lib/components/checkout/index.less +1 -1
- package/lib/components/checkout/locales.d.ts +33 -0
- package/lib/components/checkout/locales.js +39 -3
- package/lib/components/checkout/types.d.ts +1 -0
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/store/index.d.ts +2 -2
- 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/index.js +5 -1
- package/lib/components/ticketBooking/utils/index.js +2 -1
- 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 +4 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.js +332 -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 +11 -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 +485 -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 +11 -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 +27 -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 +4 -4
@@ -16,11 +16,11 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
16
16
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
17
17
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
18
18
|
import React, { useMemo, useState, useEffect } from 'react';
|
19
|
-
import { createPortal } from 'react-dom';
|
20
19
|
import { Button } from 'antd';
|
20
|
+
import Decimal from 'decimal.js';
|
21
21
|
import { Trash01, Calculator, PlusCircle, Sale03 } from '@pisell/icon';
|
22
22
|
import { locales } from '@pisell/utils';
|
23
|
-
import {
|
23
|
+
import { useToast } from '@pisell/materials';
|
24
24
|
import dayjs from 'dayjs';
|
25
25
|
import ClearCartModal from "../clearCartModal";
|
26
26
|
import CustomiseItemModal from "../customiseItemModal";
|
@@ -31,6 +31,7 @@ import { useCustomer } from "../../../ticketBooking/hooks/pisellos/useCustomer";
|
|
31
31
|
import { useMemoizedFn } from 'ahooks';
|
32
32
|
import useEngineContext, { usePisellOS } from "../../../../hooks/useEngineContext";
|
33
33
|
import useScanManager from "../../../ticketBooking/hooks/pisellos/useScanManager";
|
34
|
+
import { DiscountKeyboard } from "../../../../pro/priceKeyboard";
|
34
35
|
// Toast 内容包装器,统一设置行高
|
35
36
|
var createToastContent = function createToastContent(text) {
|
36
37
|
return /*#__PURE__*/React.createElement("div", {
|
@@ -172,6 +173,11 @@ var ActionButtons = function ActionButtons(_ref) {
|
|
172
173
|
}
|
173
174
|
}, [state, hasCartItems]);
|
174
175
|
|
176
|
+
// 手动折扣后订单总价
|
177
|
+
var currentTotalPriceAfterDiscount = useMemo(function () {
|
178
|
+
return new Decimal(currentTotalPrice).minus(state.shop_discount || 0).toNumber();
|
179
|
+
}, [state.shop_discount, currentTotalPrice]);
|
180
|
+
|
175
181
|
// 折扣券列表状态
|
176
182
|
var _useState9 = useState([]),
|
177
183
|
_useState10 = _slicedToArray(_useState9, 2),
|
@@ -262,6 +268,14 @@ var ActionButtons = function ActionButtons(_ref) {
|
|
262
268
|
shop_discount: '0'
|
263
269
|
}
|
264
270
|
});
|
271
|
+
|
272
|
+
// 清空部分支付
|
273
|
+
dispatch({
|
274
|
+
type: 'setPaymentPaid',
|
275
|
+
payload: {
|
276
|
+
value: {}
|
277
|
+
}
|
278
|
+
});
|
265
279
|
setShowClearModal(false);
|
266
280
|
Toast === null || Toast === void 0 || Toast.success(createToastContent(locales.getText('pisell2.action-buttons.clear-success')));
|
267
281
|
};
|
@@ -325,6 +339,14 @@ var ActionButtons = function ActionButtons(_ref) {
|
|
325
339
|
}
|
326
340
|
});
|
327
341
|
|
342
|
+
// 清空部分支付
|
343
|
+
dispatch({
|
344
|
+
type: 'setPaymentPaid',
|
345
|
+
payload: {
|
346
|
+
value: {}
|
347
|
+
}
|
348
|
+
});
|
349
|
+
|
328
350
|
// TODO: 如果需要重置更多信息,可以在这里添加
|
329
351
|
// 比如重置优惠券、表单数据、宠物信息等
|
330
352
|
|
@@ -355,28 +377,7 @@ var ActionButtons = function ActionButtons(_ref) {
|
|
355
377
|
}, [(_state$service8 = state.service) === null || _state$service8 === void 0 ? void 0 : _state$service8.value, (_state$addons4 = state.addons) === null || _state$addons4 === void 0 ? void 0 : _state$addons4.value]);
|
356
378
|
|
357
379
|
// 处理价格调整完成
|
358
|
-
var handlePriceAdjustConfirm = function handlePriceAdjustConfirm(
|
359
|
-
// 使用 getSumTotal 计算商品总金额
|
360
|
-
var _getSumTotal2 = getSumTotal(state, _objectSpread({
|
361
|
-
isEdit: true,
|
362
|
-
ScheduleModule: ScheduleModule
|
363
|
-
}, getDataFromHost())),
|
364
|
-
productAmount = _getSumTotal2.productAmount;
|
365
|
-
|
366
|
-
// 计算折扣金额(商品总金额 - 新价格)
|
367
|
-
// 存储正数:正数表示折扣,0表示无折扣
|
368
|
-
var discountAmount = Math.max(0, productAmount - newPrice);
|
369
|
-
|
370
|
-
// 转换为金额字符串格式(2位小数)
|
371
|
-
// const discountAmountStr = formatAmount(discountAmount, 2, '');
|
372
|
-
|
373
|
-
// console.log('=== 价格调整调试信息 ===');
|
374
|
-
// console.log('商品总金额 (productAmount):', productAmount);
|
375
|
-
// console.log('用户输入新价格 (newPrice):', newPrice);
|
376
|
-
// console.log('折扣金额 (discountAmount):', discountAmount);
|
377
|
-
// console.log('折扣金额字符串 (discountAmountStr):', discountAmountStr);
|
378
|
-
// console.log('当前 state.shop_discount:', state.shop_discount);
|
379
|
-
|
380
|
+
var handlePriceAdjustConfirm = function handlePriceAdjustConfirm(discountAmount) {
|
380
381
|
// 更新 shop_discount 到 state 根级别(存储为字符串)
|
381
382
|
dispatch({
|
382
383
|
type: 'setState',
|
@@ -384,9 +385,6 @@ var ActionButtons = function ActionButtons(_ref) {
|
|
384
385
|
shop_discount: discountAmount
|
385
386
|
}
|
386
387
|
});
|
387
|
-
|
388
|
-
// console.log('dispatch 已调用');
|
389
|
-
|
390
388
|
setShowPriceAdjustModal(false);
|
391
389
|
|
392
390
|
// 显示成功提示
|
@@ -511,22 +509,19 @@ var ActionButtons = function ActionButtons(_ref) {
|
|
511
509
|
},
|
512
510
|
onClearItemsOnly: handleClearItemsOnly,
|
513
511
|
onClearAllAndReset: handleClearAllAndReset
|
514
|
-
}),
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
}
|
522
|
-
}), /*#__PURE__*/React.createElement("div", {
|
523
|
-
className: "pisell-price-adjust-container"
|
524
|
-
}, /*#__PURE__*/React.createElement(PisellAdjustPrice, {
|
512
|
+
}), /*#__PURE__*/React.createElement(DiscountKeyboard, {
|
513
|
+
containerProps: {
|
514
|
+
renderType: 'modal',
|
515
|
+
open: showPriceAdjustModal,
|
516
|
+
onCancel: function onCancel() {
|
517
|
+
return setShowPriceAdjustModal(false);
|
518
|
+
}
|
519
|
+
},
|
525
520
|
selectType: "dark",
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
})
|
521
|
+
originalValue: currentTotalPrice,
|
522
|
+
defaultValue: currentTotalPriceAfterDiscount,
|
523
|
+
onEnter: handlePriceAdjustConfirm
|
524
|
+
}), /*#__PURE__*/React.createElement(CustomiseItemModal, {
|
530
525
|
visible: showCustomiseModal,
|
531
526
|
onClose: function onClose() {
|
532
527
|
return setShowCustomiseModal(false);
|
@@ -185,31 +185,3 @@
|
|
185
185
|
font-weight: 400 !important;
|
186
186
|
color: inherit !important;
|
187
187
|
}
|
188
|
-
|
189
|
-
// 价格调整覆盖层样式 - 现在通过 Portal 渲染到 document.body
|
190
|
-
.pisell-price-adjust-overlay {
|
191
|
-
position: fixed;
|
192
|
-
top: 0;
|
193
|
-
left: 0;
|
194
|
-
right: 0;
|
195
|
-
bottom: 0;
|
196
|
-
z-index: 9999; // 由于现在渲染到 document.body,使用更高的 z-index
|
197
|
-
display: flex;
|
198
|
-
align-items: center;
|
199
|
-
justify-content: center;
|
200
|
-
}
|
201
|
-
|
202
|
-
.pisell-price-adjust-backdrop {
|
203
|
-
position: absolute;
|
204
|
-
top: 0;
|
205
|
-
left: 0;
|
206
|
-
right: 0;
|
207
|
-
bottom: 0;
|
208
|
-
background: transparent; // 纯透明遮罩
|
209
|
-
cursor: pointer; // 显示点击手势
|
210
|
-
}
|
211
|
-
|
212
|
-
.pisell-price-adjust-container {
|
213
|
-
position: relative;
|
214
|
-
z-index: 10000; // 确保键盘在遮罩之上
|
215
|
-
}
|
@@ -23,12 +23,12 @@ export declare const getSumTotal: (state: any, options: {
|
|
23
23
|
surcharge: any;
|
24
24
|
otherAmount: any;
|
25
25
|
sumTotalAmount: number;
|
26
|
-
paidAmount:
|
26
|
+
paidAmount: any;
|
27
27
|
notPaidAmount: number;
|
28
28
|
paySurchargeFee: number;
|
29
29
|
expectAmount: number;
|
30
|
-
actualPaidAmount:
|
31
|
-
orderPaidAmount:
|
30
|
+
actualPaidAmount: any;
|
31
|
+
orderPaidAmount: any;
|
32
32
|
totalRefundAmount: number;
|
33
33
|
dueAmount: number;
|
34
34
|
roundingAmount: number;
|
@@ -617,9 +617,15 @@ var getSurchargeAmount = function getSurchargeAmount(state, surcharge, options)
|
|
617
617
|
* @returns
|
618
618
|
*/
|
619
619
|
var getPaidAmount = function getPaidAmount(state) {
|
620
|
-
var _state$bookingDetail4;
|
620
|
+
var _state$paymentPaid, _state$bookingDetail4;
|
621
621
|
var bookingDetail = state.bookingDetail,
|
622
622
|
bookingId = state.bookingId;
|
623
|
+
|
624
|
+
// 检测是否有 checkout 编辑订单已付金额
|
625
|
+
if ((_state$paymentPaid = state.paymentPaid) !== null && _state$paymentPaid !== void 0 && (_state$paymentPaid = _state$paymentPaid.value) !== null && _state$paymentPaid !== void 0 && _state$paymentPaid.paidAmount) {
|
626
|
+
var _state$paymentPaid2;
|
627
|
+
return (_state$paymentPaid2 = state.paymentPaid) === null || _state$paymentPaid2 === void 0 || (_state$paymentPaid2 = _state$paymentPaid2.value) === null || _state$paymentPaid2 === void 0 ? void 0 : _state$paymentPaid2.paidAmount;
|
628
|
+
}
|
623
629
|
// 新增为 0
|
624
630
|
if (!bookingDetail || !bookingId) return 0;
|
625
631
|
return Number((_state$bookingDetail4 = state.bookingDetail) === null || _state$bookingDetail4 === void 0 ? void 0 : _state$bookingDetail4.paid_amount) || 0;
|
@@ -631,9 +637,14 @@ var getPaidAmount = function getPaidAmount(state) {
|
|
631
637
|
* @returns
|
632
638
|
*/
|
633
639
|
var getOrderPaidAmount = function getOrderPaidAmount(state) {
|
634
|
-
var _state$bookingDetail5;
|
640
|
+
var _state$paymentPaid3, _state$bookingDetail5;
|
635
641
|
var bookingDetail = state.bookingDetail,
|
636
642
|
bookingId = state.bookingId;
|
643
|
+
// 检测是否有 checkout 编辑订单已付金额
|
644
|
+
if ((_state$paymentPaid3 = state.paymentPaid) !== null && _state$paymentPaid3 !== void 0 && (_state$paymentPaid3 = _state$paymentPaid3.value) !== null && _state$paymentPaid3 !== void 0 && _state$paymentPaid3.paidAmountWithoutSurcharge) {
|
645
|
+
var _state$paymentPaid4;
|
646
|
+
return (_state$paymentPaid4 = state.paymentPaid) === null || _state$paymentPaid4 === void 0 || (_state$paymentPaid4 = _state$paymentPaid4.value) === null || _state$paymentPaid4 === void 0 ? void 0 : _state$paymentPaid4.paidAmountWithoutSurcharge;
|
647
|
+
}
|
637
648
|
// 新增为 0
|
638
649
|
if (!bookingDetail || !bookingId) return 0;
|
639
650
|
return Number((_state$bookingDetail5 = state.bookingDetail) === null || _state$bookingDetail5 === void 0 ? void 0 : _state$bookingDetail5.order_paid_amount) || 0;
|
@@ -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, 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,37 @@ var Footer = function Footer(props) {
|
|
848
895
|
}
|
849
896
|
return _context6.abrupt("return", values);
|
850
897
|
case 27:
|
898
|
+
if (!editOrderId) {
|
899
|
+
_context6.next = 37;
|
900
|
+
break;
|
901
|
+
}
|
902
|
+
checkout = pisellos.getModule('checkout');
|
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:
|
851
929
|
// 区分是新增还是编辑
|
852
930
|
api = state.bookingId ? editApi : createApi; // 增加日志记录
|
853
931
|
sendWarningLog({
|
@@ -891,43 +969,43 @@ var Footer = function Footer(props) {
|
|
891
969
|
|
892
970
|
// 如果有addons改动, 则先保存
|
893
971
|
if (!addonsEdit) {
|
894
|
-
_context6.next =
|
972
|
+
_context6.next = 42;
|
895
973
|
break;
|
896
974
|
}
|
897
|
-
_context6.next =
|
975
|
+
_context6.next = 42;
|
898
976
|
return handleSaveAddons();
|
899
|
-
case
|
977
|
+
case 42:
|
900
978
|
if (!infoEdit) {
|
901
|
-
_context6.next =
|
979
|
+
_context6.next = 47;
|
902
980
|
break;
|
903
981
|
}
|
904
|
-
_context6.next =
|
905
|
-
return api(values, state.bookingId);
|
906
|
-
case
|
982
|
+
_context6.next = 45;
|
983
|
+
return api(values, state.bookingId || editOrderId);
|
984
|
+
case 45:
|
907
985
|
callbackData = _context6.sent;
|
908
986
|
if (messageShow) {
|
909
987
|
message.success(locales.getText(state.bookingId ? 'pisell2.text.appointment-updated' : 'pisell2.text.created-successfully'));
|
910
988
|
}
|
911
|
-
case
|
989
|
+
case 47:
|
912
990
|
// 回调关闭弹窗
|
913
991
|
state === null || state === void 0 || state.callback(callbackData, type);
|
914
992
|
_setLoading(false);
|
915
993
|
|
916
994
|
// return数据 checkout时需要
|
917
995
|
return _context6.abrupt("return", callbackData || values);
|
918
|
-
case
|
919
|
-
_context6.prev =
|
996
|
+
case 52:
|
997
|
+
_context6.prev = 52;
|
920
998
|
_context6.t1 = _context6["catch"](21);
|
921
999
|
console.log(_context6.t1);
|
922
1000
|
if ((_context6.t1 === null || _context6.t1 === void 0 ? void 0 : _context6.t1.code) === 70101) {
|
923
1001
|
message.error(_context6.t1 === null || _context6.t1 === void 0 ? void 0 : _context6.t1.message);
|
924
1002
|
}
|
925
1003
|
_setLoading(false);
|
926
|
-
case
|
1004
|
+
case 57:
|
927
1005
|
case "end":
|
928
1006
|
return _context6.stop();
|
929
1007
|
}
|
930
|
-
}, _callee6, null, [[21,
|
1008
|
+
}, _callee6, null, [[21, 52]]);
|
931
1009
|
}));
|
932
1010
|
return function handleSave(_x5) {
|
933
1011
|
return _ref7.apply(this, arguments);
|
@@ -1006,8 +1084,8 @@ var Footer = function Footer(props) {
|
|
1006
1084
|
});
|
1007
1085
|
};
|
1008
1086
|
var paymentRefundedStatus = useMemo(function () {
|
1009
|
-
var _state$
|
1010
|
-
return ['partially_refunded', 'refunded'].includes(state === null || state === void 0 || (_state$
|
1087
|
+
var _state$bookingDetail6;
|
1088
|
+
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
1089
|
}, [state === null || state === void 0 ? void 0 : state.bookingDetail]);
|
1012
1090
|
|
1013
1091
|
/**
|
@@ -1044,12 +1122,12 @@ var Footer = function Footer(props) {
|
|
1044
1122
|
onClick: function onClick() {
|
1045
1123
|
handleCheckout();
|
1046
1124
|
},
|
1047
|
-
disabled: isDisabled || isDisabledCheckOutForNegativeOrder
|
1125
|
+
disabled: isDisabled || isDisabledCheckOutForNegativeOrder || arrearsText !== ''
|
1048
1126
|
}, locales.getText('pisell2.text.checkout')));
|
1049
|
-
}, [isEdit, checkoutLoading, isDisabled, state, source]);
|
1127
|
+
}, [isEdit, checkoutLoading, isDisabled, state, source, arrearsText]);
|
1050
1128
|
var handleMenuClick = /*#__PURE__*/function () {
|
1051
1129
|
var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(e) {
|
1052
|
-
var id, customer, res, _state$
|
1130
|
+
var id, customer, res, _state$bookingDetail7, _state$bookingDetail8;
|
1053
1131
|
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
1054
1132
|
while (1) switch (_context8.prev = _context8.next) {
|
1055
1133
|
case 0:
|
@@ -1077,10 +1155,10 @@ var Footer = function Footer(props) {
|
|
1077
1155
|
type: 'pisell1.sendPayLinkEmail',
|
1078
1156
|
data: {
|
1079
1157
|
id: id,
|
1080
|
-
is_deposit: state.bookingDetail.is_deposit || Number((_state$
|
1158
|
+
is_deposit: state.bookingDetail.is_deposit || Number((_state$bookingDetail7 = state.bookingDetail) === null || _state$bookingDetail7 === void 0 ? void 0 : _state$bookingDetail7.deposit_amount),
|
1081
1159
|
deposit_payment_time: state.bookingDetail.deposit_payment_time,
|
1082
1160
|
customer: customer,
|
1083
|
-
contacts: (_state$
|
1161
|
+
contacts: (_state$bookingDetail8 = state.bookingDetail) === null || _state$bookingDetail8 === void 0 ? void 0 : _state$bookingDetail8.contacts
|
1084
1162
|
},
|
1085
1163
|
callback: function callback() {}
|
1086
1164
|
});
|
@@ -1361,10 +1439,10 @@ var Footer = function Footer(props) {
|
|
1361
1439
|
* @Date: 2024-01-30 16:58
|
1362
1440
|
*/
|
1363
1441
|
var isCheckout = useMemo(function () {
|
1364
|
-
var _state$
|
1442
|
+
var _state$bookingDetail9, _state$bookingDetail10;
|
1365
1443
|
var list = ['unfulfilled', 'partially_paid', 'unpaid', 'payment_processing'];
|
1366
1444
|
// (支付状态 = 已支付 || 部分付款 || 未付款 || 支付处理中) && 预约状态 !== 已取消
|
1367
|
-
if (!state.bookingId || ((_state$
|
1445
|
+
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
1446
|
return true;
|
1369
1447
|
} else {
|
1370
1448
|
if (total.notPaidAmount > 0) {
|
@@ -1471,7 +1549,7 @@ var Footer = function Footer(props) {
|
|
1471
1549
|
return [];
|
1472
1550
|
}, [buttons, total, isEdit, checkoutLoading, isDisabled, source, buttonMap, loading, isCheckout, state, isTeam, isShowClearAll]);
|
1473
1551
|
var moreButton = useMemo(function () {
|
1474
|
-
var _state$
|
1552
|
+
var _state$bookingDetail11;
|
1475
1553
|
var arr = [];
|
1476
1554
|
if (!state.bookingId) {
|
1477
1555
|
return [];
|
@@ -1484,15 +1562,15 @@ var Footer = function Footer(props) {
|
|
1484
1562
|
}
|
1485
1563
|
|
1486
1564
|
// 如果订单已退款, 则不展示任何按钮
|
1487
|
-
if ((state === null || state === void 0 || (_state$
|
1565
|
+
if ((state === null || state === void 0 || (_state$bookingDetail11 = state.bookingDetail) === null || _state$bookingDetail11 === void 0 ? void 0 : _state$bookingDetail11.payment_status) === 'refunded') {
|
1488
1566
|
return [];
|
1489
1567
|
}
|
1490
1568
|
|
1491
1569
|
// 如果外部没有按钮, 则rebook按钮放在外面
|
1492
1570
|
if (_buttons.length !== 0) {
|
1493
|
-
var _state$
|
1571
|
+
var _state$bookingDetail12;
|
1494
1572
|
// 支付链接, 部分退款时, 不展示支付链接
|
1495
|
-
if (state.bookingId && isShowPaymentLink && (state === null || state === void 0 || (_state$
|
1573
|
+
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
1574
|
arr.push(actionMap.paymentLink);
|
1497
1575
|
}
|
1498
1576
|
}
|
@@ -1526,20 +1604,7 @@ var Footer = function Footer(props) {
|
|
1526
1604
|
// 取消订单
|
1527
1605
|
// arr.push(actionMap.cancelOrder);
|
1528
1606
|
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]);
|
1607
|
+
}, [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
1608
|
|
1544
1609
|
/**
|
1545
1610
|
* @title: 总计文案
|
@@ -1576,27 +1641,6 @@ var Footer = function Footer(props) {
|
|
1576
1641
|
return str;
|
1577
1642
|
}, [state, total, state.bookingId, isOnlyDeposit]);
|
1578
1643
|
|
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
1644
|
/**
|
1601
1645
|
* @title: 是否显示footer loading
|
1602
1646
|
* @description: 避免数据未获取完时页面闪动
|
@@ -1728,6 +1772,52 @@ var Footer = function Footer(props) {
|
|
1728
1772
|
|
1729
1773
|
// 清空商品券
|
1730
1774
|
shopDiscount === null || shopDiscount === void 0 || (_shopDiscount$clear = shopDiscount.clear) === null || _shopDiscount$clear === void 0 || _shopDiscount$clear.call(shopDiscount);
|
1775
|
+
setEditOrderId(0);
|
1776
|
+
};
|
1777
|
+
|
1778
|
+
// 购物车进入编辑状态
|
1779
|
+
var setEditCartMode = function setEditCartMode(order_id, payData) {
|
1780
|
+
var closeModal = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
1781
|
+
setEditOrderId(order_id);
|
1782
|
+
// 关闭 checkout 弹窗
|
1783
|
+
if (closeModal) {
|
1784
|
+
setIsPaymentModalOpen(false);
|
1785
|
+
}
|
1786
|
+
// 给当前购物车中的商品添加一个编辑标识
|
1787
|
+
// 标记当前商品为编辑模式
|
1788
|
+
dispatch({
|
1789
|
+
type: 'setService',
|
1790
|
+
payload: {
|
1791
|
+
value: state.service.value.map(function (item) {
|
1792
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
1793
|
+
edit: true,
|
1794
|
+
booking_id: 'checkout_edit',
|
1795
|
+
discount_list: item.discount_list.map(function (d) {
|
1796
|
+
return _objectSpread(_objectSpread({}, d), {}, {
|
1797
|
+
id: d.discount.resource_id
|
1798
|
+
});
|
1799
|
+
})
|
1800
|
+
});
|
1801
|
+
})
|
1802
|
+
}
|
1803
|
+
});
|
1804
|
+
// 存储部分支付数据
|
1805
|
+
dispatch({
|
1806
|
+
type: 'setPaymentPaid',
|
1807
|
+
payload: {
|
1808
|
+
value: {
|
1809
|
+
paidAmount: payData.paidAmount,
|
1810
|
+
paidAmountWithoutSurcharge: payData.paidAmountWithoutSurcharge
|
1811
|
+
}
|
1812
|
+
}
|
1813
|
+
});
|
1814
|
+
// 需要重新拉取商品券、折扣卡列表,避免商品券被重新抵扣
|
1815
|
+
shopDiscount.loadPrepareConfig({
|
1816
|
+
customerId: state.client.value.id,
|
1817
|
+
action: 'create',
|
1818
|
+
with_good_pass: 1,
|
1819
|
+
with_discount_card: 1
|
1820
|
+
});
|
1731
1821
|
};
|
1732
1822
|
return /*#__PURE__*/React.createElement(Skeleton, {
|
1733
1823
|
title: false,
|
@@ -1807,8 +1897,10 @@ var Footer = function Footer(props) {
|
|
1807
1897
|
onCancel: handleNoteCancel
|
1808
1898
|
}), isPaymentModalOpen && /*#__PURE__*/React.createElement(PaymentModal, {
|
1809
1899
|
open: true,
|
1900
|
+
editOrderId: editOrderId,
|
1810
1901
|
data: paymentModalData,
|
1811
1902
|
callback: paymentCallback || undefined,
|
1903
|
+
setEditCartMode: setEditCartMode,
|
1812
1904
|
state: state,
|
1813
1905
|
dispatch: dispatch,
|
1814
1906
|
onClose: function onClose(reset) {
|
@@ -1816,6 +1908,14 @@ var Footer = function Footer(props) {
|
|
1816
1908
|
setIsPaymentModalOpen(false);
|
1817
1909
|
setPaymentModalData(null);
|
1818
1910
|
setPaymentCallback(null);
|
1911
|
+
// 清除编辑模式
|
1912
|
+
setEditOrderId(0);
|
1913
|
+
dispatch({
|
1914
|
+
type: 'setPaymentPaid',
|
1915
|
+
payload: {
|
1916
|
+
value: {}
|
1917
|
+
}
|
1918
|
+
});
|
1819
1919
|
// if (reset) {
|
1820
1920
|
// handleClearAllAndReset();
|
1821
1921
|
// }
|