@pisell/private-materials 6.6.62 → 6.6.63
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 +8 -8
- 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/components/footer/amount.js +4 -3
- package/es/components/booking/components/footer/utils.js +10 -3
- package/es/components/booking/components/voucher/index.js +1 -1
- package/es/components/booking/info2/service/editService/index.js +76 -8
- package/es/components/booking/info2/service/editService/utils.d.ts +1 -0
- package/es/components/booking/info2/service/editService/utils.js +16 -0
- package/es/components/booking/payments/index.js +1 -1
- package/es/components/checkout/hooks/useWalletPass.d.ts +1 -1
- package/es/components/eftpos/PairModal/hooks.d.ts +27 -0
- package/es/components/eftpos/PairModal/hooks.js +67 -0
- package/es/components/eftpos/PairModal/index.d.ts +11 -0
- package/es/components/eftpos/PairModal/index.js +246 -0
- package/es/components/eftpos/PairModal/index.less +70 -0
- package/es/components/eftpos/SettlementModal/Action.d.ts +7 -0
- package/es/components/eftpos/SettlementModal/Action.js +141 -0
- package/es/components/eftpos/SettlementModal/index.d.ts +7 -0
- package/es/components/eftpos/SettlementModal/index.js +135 -0
- package/es/components/eftpos/SettlementModal/index.less +33 -0
- package/es/components/eftpos/SettlementModal/serve.d.ts +8 -0
- package/es/components/eftpos/SettlementModal/serve.js +171 -0
- package/es/components/eftpos/SettlementModal/types.d.ts +138 -0
- package/es/components/eftpos/SettlementModal/types.js +35 -0
- package/es/components/eftpos/SettlementModal/utils.d.ts +18 -0
- package/es/components/eftpos/SettlementModal/utils.js +351 -0
- package/es/components/eftpos/assets/mx51SCI.svg +15 -0
- package/es/components/eftpos/const.d.ts +3 -1
- package/es/components/eftpos/const.js +2 -0
- package/es/components/eftpos/device.d.ts +3 -1
- package/es/components/eftpos/device.js +14 -3
- package/es/components/eftpos/hooks.d.ts +13 -0
- package/es/components/eftpos/hooks.js +35 -0
- package/es/components/eftpos/index.js +198 -24
- package/es/components/eftpos/index.less +32 -1
- package/es/components/eftpos/locales.d.ts +80 -0
- package/es/components/eftpos/locales.js +205 -25
- package/es/components/eftpos/table.js +47 -3
- package/es/components/eftposPay/aggregatePayment/hooks/useMicropay.d.ts +2 -2
- package/es/components/eftposPay/aggregatePayment/hooks/usePayment.d.ts +8 -0
- package/es/components/eftposPay/aggregatePayment/hooks/usePayment.js +145 -0
- package/es/components/eftposPay/aggregatePayment/index.d.ts +2 -1
- package/es/components/eftposPay/aggregatePayment/index.js +2 -1
- package/es/components/eftposPay/aggregatePayment/mock.d.ts +495 -0
- package/es/components/eftposPay/aggregatePayment/mock.js +567 -0
- package/es/components/eftposPay/aggregatePayment/service.js +1 -0
- package/es/components/eftposPay/aggregatePayment/types.d.ts +12 -12
- package/es/components/eftposPay/aggregatePayment/types.js +4 -8
- package/es/components/eftposPay/aggregatePayment/utils/payment.d.ts +13 -13
- package/es/components/eftposPay/aggregatePayment/utils/payment.js +231 -168
- package/es/components/eftposPay/amount.js +15 -1
- package/es/components/eftposPay/app.js +2 -3
- package/es/components/eftposPay/component/fail/failCustom.js +13 -4
- package/es/components/eftposPay/component/fail/index.js +12 -5
- package/es/components/eftposPay/component/fail/network.js +3 -0
- package/es/components/eftposPay/component/fail/unknow.js +8 -0
- package/es/components/eftposPay/component/manual/index.js +17 -3
- package/es/components/eftposPay/component/signature/index.js +3 -0
- package/es/components/eftposPay/const.d.ts +8 -3
- package/es/components/eftposPay/const.js +2 -0
- package/es/components/eftposPay/device.js +225 -38
- package/es/components/eftposPay/helper.d.ts +3 -0
- package/es/components/eftposPay/helper.js +2 -1
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/index.js +50 -13
- package/es/components/eftposPay/linkly/const.js +1 -1
- package/es/components/eftposPay/linkly/hooks/normal.js +21 -68
- package/es/components/eftposPay/linkly/hooks/useTimeQuery.js +20 -81
- package/es/components/eftposPay/linkly/index.js +11 -23
- package/es/components/eftposPay/locales.d.ts +15 -0
- package/es/components/eftposPay/locales.js +30 -15
- package/es/components/eftposPay/manufacturer.d.ts +1 -0
- package/es/components/eftposPay/manufacturer.js +4 -0
- package/es/components/eftposPay/mx51/Action.d.ts +6 -0
- package/es/components/eftposPay/mx51/Action.js +144 -0
- package/es/components/eftposPay/mx51/const.d.ts +5 -0
- package/es/components/eftposPay/mx51/const.js +69 -0
- package/es/components/eftposPay/mx51/index.d.ts +6 -0
- package/es/components/eftposPay/mx51/index.js +498 -0
- package/es/components/eftposPay/mx51/types.d.ts +142 -0
- package/es/components/eftposPay/mx51/types.js +35 -0
- package/es/components/eftposPay/mx51/utils.d.ts +10 -0
- package/es/components/eftposPay/mx51/utils.js +121 -0
- package/es/components/eftposPay/pay.js +21 -9
- package/es/components/eftposPay/payo/config.js +39 -5
- package/es/components/eftposPay/payo/const.js +1 -1
- package/es/components/eftposPay/payo/hooks.js +3 -12
- package/es/components/eftposPay/payo/payment.js +69 -136
- package/es/components/eftposPay/store/index.d.ts +4 -8
- package/es/components/eftposPay/tip.js +5 -0
- package/es/components/eftposPay/tyro/const.js +1 -1
- package/es/components/eftposPay/tyro/index.js +44 -11
- package/es/components/eftposPay/utils/payLog.d.ts +81 -0
- package/es/components/eftposPay/utils/payLog.js +458 -0
- package/es/components/eftposPay/windcave/const.js +1 -1
- package/es/components/eftposPay/windcave/receiptAction.js +5 -0
- package/es/components/eftposPay/windcave/windcave.js +37 -38
- package/lib/components/booking/components/footer/amount.js +3 -3
- package/lib/components/booking/components/footer/utils.js +12 -5
- package/lib/components/booking/components/voucher/index.js +1 -1
- package/lib/components/booking/info2/service/editService/index.js +56 -5
- package/lib/components/booking/info2/service/editService/utils.d.ts +1 -0
- package/lib/components/booking/info2/service/editService/utils.js +16 -0
- package/lib/components/booking/payments/index.js +1 -1
- package/lib/components/checkout/hooks/useWalletPass.d.ts +1 -1
- package/lib/components/eftpos/PairModal/hooks.d.ts +27 -0
- package/lib/components/eftpos/PairModal/hooks.js +70 -0
- package/lib/components/eftpos/PairModal/index.d.ts +11 -0
- package/lib/components/eftpos/PairModal/index.js +197 -0
- package/lib/components/eftpos/PairModal/index.less +70 -0
- package/lib/components/eftpos/SettlementModal/Action.d.ts +7 -0
- package/lib/components/eftpos/SettlementModal/Action.js +153 -0
- package/lib/components/eftpos/SettlementModal/index.d.ts +7 -0
- package/lib/components/eftpos/SettlementModal/index.js +170 -0
- package/lib/components/eftpos/SettlementModal/index.less +33 -0
- package/lib/components/eftpos/SettlementModal/serve.d.ts +8 -0
- package/lib/components/eftpos/SettlementModal/serve.js +45 -0
- package/lib/components/eftpos/SettlementModal/types.d.ts +138 -0
- package/lib/components/eftpos/SettlementModal/types.js +43 -0
- package/lib/components/eftpos/SettlementModal/utils.d.ts +18 -0
- package/lib/components/eftpos/SettlementModal/utils.js +248 -0
- package/lib/components/eftpos/assets/mx51SCI.svg +15 -0
- package/lib/components/eftpos/const.d.ts +3 -1
- package/lib/components/eftpos/const.js +2 -0
- package/lib/components/eftpos/device.d.ts +3 -1
- package/lib/components/eftpos/device.js +13 -3
- package/lib/components/eftpos/hooks.d.ts +13 -0
- package/lib/components/eftpos/hooks.js +30 -0
- package/lib/components/eftpos/index.js +121 -8
- package/lib/components/eftpos/index.less +32 -1
- package/lib/components/eftpos/locales.d.ts +80 -0
- package/lib/components/eftpos/locales.js +231 -21
- package/lib/components/eftpos/table.js +30 -2
- package/lib/components/eftposPay/aggregatePayment/hooks/useMicropay.d.ts +2 -2
- package/lib/components/eftposPay/aggregatePayment/hooks/usePayment.d.ts +8 -0
- package/lib/components/eftposPay/aggregatePayment/hooks/usePayment.js +171 -0
- package/lib/components/eftposPay/aggregatePayment/index.d.ts +2 -1
- package/lib/components/eftposPay/aggregatePayment/index.js +5 -2
- package/lib/components/eftposPay/aggregatePayment/mock.d.ts +495 -0
- package/lib/components/eftposPay/aggregatePayment/mock.js +679 -0
- package/lib/components/eftposPay/aggregatePayment/types.d.ts +12 -12
- package/lib/components/eftposPay/aggregatePayment/utils/payment.d.ts +13 -13
- package/lib/components/eftposPay/aggregatePayment/utils/payment.js +173 -123
- package/lib/components/eftposPay/amount.js +13 -1
- package/lib/components/eftposPay/app.js +4 -5
- package/lib/components/eftposPay/component/fail/failCustom.js +10 -2
- package/lib/components/eftposPay/component/fail/index.js +10 -2
- package/lib/components/eftposPay/component/fail/network.js +3 -0
- package/lib/components/eftposPay/component/fail/unknow.js +8 -0
- package/lib/components/eftposPay/component/manual/index.js +16 -2
- package/lib/components/eftposPay/component/signature/index.js +3 -0
- package/lib/components/eftposPay/const.d.ts +8 -3
- package/lib/components/eftposPay/const.js +2 -0
- package/lib/components/eftposPay/device.js +114 -25
- package/lib/components/eftposPay/helper.d.ts +3 -0
- package/lib/components/eftposPay/helper.js +2 -1
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/index.js +38 -13
- package/lib/components/eftposPay/linkly/const.js +1 -1
- package/lib/components/eftposPay/linkly/hooks/normal.js +22 -43
- package/lib/components/eftposPay/linkly/hooks/useTimeQuery.js +13 -65
- package/lib/components/eftposPay/linkly/index.js +8 -10
- package/lib/components/eftposPay/locales.d.ts +15 -0
- package/lib/components/eftposPay/locales.js +30 -15
- package/lib/components/eftposPay/manufacturer.d.ts +1 -0
- package/lib/components/eftposPay/manufacturer.js +6 -0
- package/lib/components/eftposPay/mx51/Action.d.ts +6 -0
- package/lib/components/eftposPay/mx51/Action.js +154 -0
- package/lib/components/eftposPay/mx51/const.d.ts +5 -0
- package/lib/components/eftposPay/mx51/const.js +85 -0
- package/lib/components/eftposPay/mx51/index.d.ts +6 -0
- package/lib/components/eftposPay/mx51/index.js +433 -0
- package/lib/components/eftposPay/mx51/types.d.ts +142 -0
- package/lib/components/eftposPay/mx51/types.js +43 -0
- package/lib/components/eftposPay/mx51/utils.d.ts +10 -0
- package/lib/components/eftposPay/mx51/utils.js +115 -0
- package/lib/components/eftposPay/pay.js +13 -3
- package/lib/components/eftposPay/payo/config.js +16 -8
- package/lib/components/eftposPay/payo/const.js +1 -1
- package/lib/components/eftposPay/payo/hooks.js +12 -10
- package/lib/components/eftposPay/payo/payment.js +31 -65
- package/lib/components/eftposPay/store/index.d.ts +4 -8
- package/lib/components/eftposPay/tip.js +5 -0
- package/lib/components/eftposPay/tyro/const.js +1 -1
- package/lib/components/eftposPay/tyro/index.js +21 -17
- package/lib/components/eftposPay/utils/payLog.d.ts +81 -0
- package/lib/components/eftposPay/utils/payLog.js +321 -0
- package/lib/components/eftposPay/windcave/const.js +1 -1
- package/lib/components/eftposPay/windcave/receiptAction.js +5 -0
- package/lib/components/eftposPay/windcave/windcave.js +27 -29
- package/package.json +2 -2
- package/es/components/eftposPay/utils/log/index.d.ts +0 -110
- package/es/components/eftposPay/utils/log/index.js +0 -371
- package/lib/components/eftposPay/utils/log/index.d.ts +0 -110
- package/lib/components/eftposPay/utils/log/index.js +0 -294
|
@@ -519,7 +519,8 @@ var processItemsTax = function processItemsTax(items, state, options) {
|
|
|
519
519
|
}
|
|
520
520
|
return {
|
|
521
521
|
originTax: expectedOriginTax,
|
|
522
|
-
tax: expectedTax
|
|
522
|
+
tax: expectedTax,
|
|
523
|
+
taxDecimal: preciseTax
|
|
523
524
|
};
|
|
524
525
|
};
|
|
525
526
|
|
|
@@ -651,7 +652,7 @@ var getTax = function getTax(state, options) {
|
|
|
651
652
|
computed: computed
|
|
652
653
|
});
|
|
653
654
|
totalOriginTax = totalOriginTax.plus(serviceResult.originTax);
|
|
654
|
-
totalTax = totalTax.plus(serviceResult.
|
|
655
|
+
totalTax = totalTax.plus(serviceResult.taxDecimal);
|
|
655
656
|
}
|
|
656
657
|
|
|
657
658
|
// 处理附加商品
|
|
@@ -662,7 +663,7 @@ var getTax = function getTax(state, options) {
|
|
|
662
663
|
computed: computed
|
|
663
664
|
});
|
|
664
665
|
totalOriginTax = totalOriginTax.plus(addonsResult.originTax);
|
|
665
|
-
totalTax = totalTax.plus(addonsResult.
|
|
666
|
+
totalTax = totalTax.plus(addonsResult.taxDecimal);
|
|
666
667
|
}
|
|
667
668
|
}
|
|
668
669
|
return {
|
|
@@ -108,6 +108,7 @@ export var formatProductBundle = function formatProductBundle(bundle) {
|
|
|
108
108
|
}
|
|
109
109
|
} catch (error) {}
|
|
110
110
|
return bundle.map(function (d) {
|
|
111
|
+
var _d$metadata;
|
|
111
112
|
var option = formatProductOption(d.option);
|
|
112
113
|
var option_price = option.reduce(function (temp, item) {
|
|
113
114
|
return temp + Number(item.num) * item.custom_add_price;
|
|
@@ -135,7 +136,7 @@ export var formatProductBundle = function formatProductBundle(bundle) {
|
|
|
135
136
|
"bundle_selling_price": Math.abs(d === null || d === void 0 ? void 0 : d.price),
|
|
136
137
|
// "bundle_sum_price": d?.original_price || d?.original_total,
|
|
137
138
|
"metadata": {
|
|
138
|
-
custom_product_bundle_map_id: d._id,
|
|
139
|
+
custom_product_bundle_map_id: (d === null || d === void 0 || (_d$metadata = d.metadata) === null || _d$metadata === void 0 ? void 0 : _d$metadata.custom_product_bundle_map_id) || d._id,
|
|
139
140
|
// 子商品单数量附加费
|
|
140
141
|
"surcharge_fee": d.surcharge_fee,
|
|
141
142
|
// 可选,附加费均摊舍入金额
|
|
@@ -481,7 +482,7 @@ export var getMainProductSellingPrice = function getMainProductSellingPrice(item
|
|
|
481
482
|
* @Author: WangHan
|
|
482
483
|
* @Date: 2024-12-07 14:21
|
|
483
484
|
*/
|
|
484
|
-
var formatProducts = function formatProducts(item, quantity) {
|
|
485
|
+
var formatProducts = function formatProducts(item, quantity, options) {
|
|
485
486
|
var _item$_extend39, _getMainProductSellin, _item$_extend40, _item$_extend41, _item$_extend42, _item$_extend43;
|
|
486
487
|
var total = Number(item._extend.total);
|
|
487
488
|
var origin_total = Number(item._extend.origin_total);
|
|
@@ -496,6 +497,9 @@ var formatProducts = function formatProducts(item, quantity) {
|
|
|
496
497
|
d.metadata = _objectSpread(_objectSpread({}, d.metadata), {}, {
|
|
497
498
|
unique_identification_number: "".concat(item._extend.unique_identification_number, "_").concat(d.discount.resource_id)
|
|
498
499
|
});
|
|
500
|
+
if (options !== null && options !== void 0 && options.isServiceEdit && options !== null && options !== void 0 && options.isMultiDay) {
|
|
501
|
+
delete d.id;
|
|
502
|
+
}
|
|
499
503
|
});
|
|
500
504
|
|
|
501
505
|
// 非手动折扣
|
|
@@ -718,7 +722,10 @@ var formatBookings = function formatBookings(data, values) {
|
|
|
718
722
|
item._extend.unique_identification_number = unique_identification_number;
|
|
719
723
|
}
|
|
720
724
|
var booking = _objectSpread(_objectSpread({
|
|
721
|
-
product: formatProducts(item
|
|
725
|
+
product: formatProducts(item, undefined, {
|
|
726
|
+
isServiceEdit: data.service.edit,
|
|
727
|
+
isMultiDay: isMultiDay
|
|
728
|
+
}),
|
|
722
729
|
relation_products: formatRelationDetails(item._extend.relation_details),
|
|
723
730
|
id: item.booking_id || 0,
|
|
724
731
|
relation_id: item._extend.relation_id || 0,
|
|
@@ -128,7 +128,7 @@ var VoucherCard = function VoucherCard(props) {
|
|
|
128
128
|
var val = (_ref = state.service.value || []) === null || _ref === void 0 ? void 0 : _ref.map(function (value) {
|
|
129
129
|
var _value$_extend, _value$_extend2, _value$_extend3;
|
|
130
130
|
return {
|
|
131
|
-
booking_id: value.booking_id,
|
|
131
|
+
// booking_id: value.booking_id,
|
|
132
132
|
id: value.id,
|
|
133
133
|
price: value.price,
|
|
134
134
|
total: value === null || value === void 0 || (_value$_extend = value._extend) === null || _value$_extend === void 0 ? void 0 : _value$_extend.total,
|
|
@@ -19,7 +19,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
19
19
|
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; } }
|
|
20
20
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
21
21
|
import Delete_wght300_24px from '@pisell/icon/es/Delete_wght300_24px';
|
|
22
|
-
import { formatAmount, getUniqueId, locales } from '@pisell/utils';
|
|
22
|
+
import { formatAmount, getUniqueId, locales, sendWarningLog } from '@pisell/utils';
|
|
23
23
|
import React, { forwardRef, useContext, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
24
24
|
import Drawer from "../../../components/drawer";
|
|
25
25
|
import { Context } from "../../../info/model";
|
|
@@ -41,7 +41,7 @@ import { editSessionProduct } from "../../../info/utils";
|
|
|
41
41
|
import { deleteCacheParams, getDays, getProductOriginTotalPrice, getProductTotalPrice, getServiceTimes, isSessionProduct, isWalkIn } from "../../../utils";
|
|
42
42
|
import { getErrorList, getIsNoSpecAndPackage } from "../../utilsByBooking";
|
|
43
43
|
import { formatResources, getDurationProps, getFlexibleOption, getMultiDay, getTimeObj, setDefaultCapacitys } from "../addService/utils";
|
|
44
|
-
import { getProductAllDiscountList,
|
|
44
|
+
import { getProductAllDiscountList, mergeBundles, setProductPrice, mergeBundleWithOriginalPrice } from "./utils";
|
|
45
45
|
import NoteModal from "../../../../../plus/noteModal";
|
|
46
46
|
import { DiscountKeyboard } from "../../../../../pro/priceKeyboard";
|
|
47
47
|
import EditTabs from "../../../info/service/editService/EditTabs";
|
|
@@ -51,6 +51,7 @@ import { createBookingItemsByGroup, getGroupTotalPrice } from "../../../info/ser
|
|
|
51
51
|
import { useShopDiscountModule } from "../../../../ticketBooking/hooks/pisellos/useShopDiscountModule";
|
|
52
52
|
import DiscountChangeModal from "./DiscountChangeModal";
|
|
53
53
|
import Decimal from "decimal.js";
|
|
54
|
+
import useEngineContext from "../../../../../hooks/useEngineContext";
|
|
54
55
|
var submitLock = false;
|
|
55
56
|
var Info = function Info(_, ref) {
|
|
56
57
|
var _state$service4, _state$bookingConfig2, _state$bookingConfig3, _state$service$cacheI5, _state$service$cacheI7, _state$service6, _window$BaseMaterials, _state$service8, _state$service$cacheI12, _state$bookingConfig5, _state$service$cacheI13, _state$service$cacheI14, _state$service9, _state$service$resour2, _state$service$cacheI16, _state$service$cacheI17, _state$client2;
|
|
@@ -71,6 +72,7 @@ var Info = function Info(_, ref) {
|
|
|
71
72
|
_useState2 = _slicedToArray(_useState, 2),
|
|
72
73
|
discountChangeModalOpen = _useState2[0],
|
|
73
74
|
setDiscountChangeModalOpen = _useState2[1];
|
|
75
|
+
var context = useEngineContext();
|
|
74
76
|
var _useContext = useContext(Context),
|
|
75
77
|
state = _useContext.state,
|
|
76
78
|
dispatch = _useContext.dispatch;
|
|
@@ -663,13 +665,19 @@ var Info = function Info(_, ref) {
|
|
|
663
665
|
var values = form.getFieldsValue();
|
|
664
666
|
var isSession = isSessionProduct(item);
|
|
665
667
|
var sessionValue = {};
|
|
668
|
+
var oldSession = {};
|
|
666
669
|
if (isSession) {
|
|
667
|
-
var _item$_extend7, _item$_extend8, _item$_extend9;
|
|
670
|
+
var _item$_extend7, _item$_extend8, _item$_extend9, _item$_extend10, _item$_extend11, _item$_extend12;
|
|
668
671
|
sessionValue.startEndTime = {
|
|
669
672
|
startDate: item === null || item === void 0 || (_item$_extend7 = item._extend) === null || _item$_extend7 === void 0 ? void 0 : _item$_extend7.start_date,
|
|
670
673
|
endDate: item === null || item === void 0 || (_item$_extend8 = item._extend) === null || _item$_extend8 === void 0 ? void 0 : _item$_extend8.end_date,
|
|
671
674
|
duration: item === null || item === void 0 || (_item$_extend9 = item._extend) === null || _item$_extend9 === void 0 ? void 0 : _item$_extend9.duration
|
|
672
675
|
};
|
|
676
|
+
oldSession = {
|
|
677
|
+
start_date: dayjs(item === null || item === void 0 || (_item$_extend10 = item._extend) === null || _item$_extend10 === void 0 ? void 0 : _item$_extend10.start_date).format('YYYY-MM-DD'),
|
|
678
|
+
end_date: dayjs(item === null || item === void 0 || (_item$_extend11 = item._extend) === null || _item$_extend11 === void 0 ? void 0 : _item$_extend11.end_date).format('YYYY-MM-DD'),
|
|
679
|
+
duration: item === null || item === void 0 || (_item$_extend12 = item._extend) === null || _item$_extend12 === void 0 ? void 0 : _item$_extend12.duration
|
|
680
|
+
};
|
|
673
681
|
}
|
|
674
682
|
|
|
675
683
|
// 打开商品详情弹窗
|
|
@@ -687,7 +695,9 @@ var Info = function Info(_, ref) {
|
|
|
687
695
|
},
|
|
688
696
|
isOS: isSession,
|
|
689
697
|
customer_id: (_state$client = state.client) === null || _state$client === void 0 || (_state$client = _state$client.value) === null || _state$client === void 0 ? void 0 : _state$client.id,
|
|
690
|
-
value: _objectSpread(_objectSpread(_objectSpread({}, item._extend.other),
|
|
698
|
+
value: _objectSpread(_objectSpread(_objectSpread({}, item._extend.other), {}, {
|
|
699
|
+
bundle: mergeBundles(item._extend.other)
|
|
700
|
+
}, sessionValue), {}, {
|
|
691
701
|
quantity: values.quantity || item._extend.quantity
|
|
692
702
|
})
|
|
693
703
|
},
|
|
@@ -700,8 +710,8 @@ var Info = function Info(_, ref) {
|
|
|
700
710
|
|
|
701
711
|
// 手动折扣时 合并 bundle price,优先使用编辑前的价格
|
|
702
712
|
if (item.discount_amount) {
|
|
703
|
-
var _item$
|
|
704
|
-
other = mergeBundleWithOriginalPrice(other, ((_item$
|
|
713
|
+
var _item$_extend13;
|
|
714
|
+
other = mergeBundleWithOriginalPrice(other, ((_item$_extend13 = item._extend) === null || _item$_extend13 === void 0 ? void 0 : _item$_extend13.other) || {});
|
|
705
715
|
}
|
|
706
716
|
other.session = e.session;
|
|
707
717
|
|
|
@@ -736,6 +746,37 @@ var Info = function Info(_, ref) {
|
|
|
736
746
|
});
|
|
737
747
|
} catch (err) {}
|
|
738
748
|
var sessionDetail = editSessionProduct(cacheItem, e.session);
|
|
749
|
+
try {
|
|
750
|
+
var _e$session, _e$session2, _e$session3, _e$session4, _e$session5, _context$appHelper, _context$appHelper$ge;
|
|
751
|
+
sendWarningLog({
|
|
752
|
+
title: '修改商品数据',
|
|
753
|
+
content: [{
|
|
754
|
+
key: 'productId',
|
|
755
|
+
value: item.id
|
|
756
|
+
}, {
|
|
757
|
+
key: "isSession",
|
|
758
|
+
value: isSession
|
|
759
|
+
}, {
|
|
760
|
+
key: 'oldSession',
|
|
761
|
+
value: JSON.stringify(oldSession)
|
|
762
|
+
}, {
|
|
763
|
+
key: 'sessionValue',
|
|
764
|
+
value: JSON.stringify({
|
|
765
|
+
startTime: (_e$session = e.session) === null || _e$session === void 0 ? void 0 : _e$session.start_time,
|
|
766
|
+
endTime: (_e$session2 = e.session) === null || _e$session2 === void 0 ? void 0 : _e$session2.end_time,
|
|
767
|
+
startDate: dayjs((_e$session3 = e.session) === null || _e$session3 === void 0 ? void 0 : _e$session3.start_at).format('YYYY-MM-DD'),
|
|
768
|
+
endDate: dayjs((_e$session4 = e.session) === null || _e$session4 === void 0 ? void 0 : _e$session4.end_at).format('YYYY-MM-DD'),
|
|
769
|
+
duration: (_e$session5 = e.session) === null || _e$session5 === void 0 ? void 0 : _e$session5.duration
|
|
770
|
+
})
|
|
771
|
+
}, {
|
|
772
|
+
key: '日期',
|
|
773
|
+
value: dayjs().format('YYYY-MM-DD HH:mm')
|
|
774
|
+
}, {
|
|
775
|
+
key: '店铺id',
|
|
776
|
+
value: (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 || (_context$appHelper = _context$appHelper.utils) === null || _context$appHelper === void 0 || (_context$appHelper = _context$appHelper.store) === null || _context$appHelper === void 0 || (_context$appHelper$ge = _context$appHelper.getState) === null || _context$appHelper$ge === void 0 || (_context$appHelper$ge = _context$appHelper$ge.call(_context$appHelper)) === null || _context$appHelper$ge === void 0 || (_context$appHelper$ge = _context$appHelper$ge.global) === null || _context$appHelper$ge === void 0 || (_context$appHelper$ge = _context$appHelper$ge.globalConfig) === null || _context$appHelper$ge === void 0 ? void 0 : _context$appHelper$ge.id
|
|
777
|
+
}]
|
|
778
|
+
});
|
|
779
|
+
} catch (err) {}
|
|
739
780
|
if (sessionDetail) {
|
|
740
781
|
setTimeout(function () {
|
|
741
782
|
form.setFieldsValue({
|
|
@@ -1223,6 +1264,14 @@ var Info = function Info(_, ref) {
|
|
|
1223
1264
|
var _cacheItem$_extend$ot, _cacheItem$_extend$ot2;
|
|
1224
1265
|
delete cacheItem.discount_list;
|
|
1225
1266
|
(_cacheItem$_extend$ot = cacheItem._extend.other) === null || _cacheItem$_extend$ot === void 0 || (_cacheItem$_extend$ot = _cacheItem$_extend$ot.bundle) === null || _cacheItem$_extend$ot === void 0 || (_cacheItem$_extend$ot2 = _cacheItem$_extend$ot.forEach) === null || _cacheItem$_extend$ot2 === void 0 || _cacheItem$_extend$ot2.call(_cacheItem$_extend$ot, function (bundle) {
|
|
1267
|
+
var _bundle$metadata;
|
|
1268
|
+
var restoredPrice = getBundleOriginalSellingPrice(bundle);
|
|
1269
|
+
if (restoredPrice !== undefined) {
|
|
1270
|
+
bundle.price = restoredPrice;
|
|
1271
|
+
bundle.original_price = restoredPrice;
|
|
1272
|
+
bundle.original_total = restoredPrice;
|
|
1273
|
+
}
|
|
1274
|
+
bundle === null || bundle === void 0 || (_bundle$metadata = bundle.metadata) === null || _bundle$metadata === void 0 || delete _bundle$metadata.custom_product_bundle_map_id;
|
|
1226
1275
|
bundle === null || bundle === void 0 || delete bundle.discount_list;
|
|
1227
1276
|
bundle === null || bundle === void 0 || delete bundle.booking_id;
|
|
1228
1277
|
bundle === null || bundle === void 0 || delete bundle.bundle_selling_price;
|
|
@@ -1230,11 +1279,30 @@ var Info = function Info(_, ref) {
|
|
|
1230
1279
|
});
|
|
1231
1280
|
return cacheItem;
|
|
1232
1281
|
};
|
|
1282
|
+
|
|
1283
|
+
/**
|
|
1284
|
+
* @title: 获取套餐子商品折扣前售价
|
|
1285
|
+
* @description: 编辑订单接口中 bundle_sum_price 是套餐子商品券前售价,original_price/original_total 在折扣卡场景可能已是折后价。
|
|
1286
|
+
* @example
|
|
1287
|
+
* const price = getBundleOriginalSellingPrice({ bundle_sum_price: '8.00', price: 7.2 });
|
|
1288
|
+
*/
|
|
1289
|
+
var getBundleOriginalSellingPrice = function getBundleOriginalSellingPrice(bundle) {
|
|
1290
|
+
var _ref3, _ref4, _ref5, _bundle$bundle_sum_pr;
|
|
1291
|
+
var priceSource = (_ref3 = (_ref4 = (_ref5 = (_bundle$bundle_sum_pr = bundle === null || bundle === void 0 ? void 0 : bundle.bundle_sum_price) !== null && _bundle$bundle_sum_pr !== void 0 ? _bundle$bundle_sum_pr : bundle === null || bundle === void 0 ? void 0 : bundle.original_total) !== null && _ref5 !== void 0 ? _ref5 : bundle === null || bundle === void 0 ? void 0 : bundle.original_price) !== null && _ref4 !== void 0 ? _ref4 : bundle === null || bundle === void 0 ? void 0 : bundle.product_price) !== null && _ref3 !== void 0 ? _ref3 : bundle === null || bundle === void 0 ? void 0 : bundle.price;
|
|
1292
|
+
var price = Number(priceSource);
|
|
1293
|
+
if (!Number.isFinite(price)) {
|
|
1294
|
+
return undefined;
|
|
1295
|
+
}
|
|
1296
|
+
if ((bundle === null || bundle === void 0 ? void 0 : bundle.bundle_sum_type) === 'markdown') {
|
|
1297
|
+
return -Math.abs(price);
|
|
1298
|
+
}
|
|
1299
|
+
return price;
|
|
1300
|
+
};
|
|
1233
1301
|
var handleKeepOriginal = function handleKeepOriginal() {
|
|
1234
1302
|
setDiscountChangeModalOpen(false);
|
|
1235
1303
|
};
|
|
1236
1304
|
var handleContinue = /*#__PURE__*/function () {
|
|
1237
|
-
var
|
|
1305
|
+
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
1238
1306
|
var cacheItem;
|
|
1239
1307
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
1240
1308
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -1253,7 +1321,7 @@ var Info = function Info(_, ref) {
|
|
|
1253
1321
|
}, _callee2);
|
|
1254
1322
|
}));
|
|
1255
1323
|
return function handleContinue() {
|
|
1256
|
-
return
|
|
1324
|
+
return _ref6.apply(this, arguments);
|
|
1257
1325
|
};
|
|
1258
1326
|
}();
|
|
1259
1327
|
var handleRemove = function handleRemove() {
|
|
@@ -32,6 +32,7 @@ export declare const setProductPrice: (cacheItem: any, { newTotal, origin_total
|
|
|
32
32
|
* @returns 折扣列表
|
|
33
33
|
*/
|
|
34
34
|
export declare const getProductAllDiscountList: (cacheItem: any) => any;
|
|
35
|
+
export declare const mergeBundles: (other: any) => any[];
|
|
35
36
|
/**
|
|
36
37
|
* 合并 bundle 数据,基于 id 和 product_id 匹配,price 优先使用 originalOther 中的值
|
|
37
38
|
* @param other - callback 返回的新数据
|
|
@@ -149,6 +149,22 @@ export var getProductAllDiscountList = function getProductAllDiscountList(cacheI
|
|
|
149
149
|
(_discountList = discountList).push.apply(_discountList, _toConsumableArray(bundleDiscountList));
|
|
150
150
|
return discountList;
|
|
151
151
|
};
|
|
152
|
+
export var mergeBundles = function mergeBundles(other) {
|
|
153
|
+
var bundle = (other === null || other === void 0 ? void 0 : other.bundle) || [];
|
|
154
|
+
var newBundle = [];
|
|
155
|
+
bundle.forEach(function (item) {
|
|
156
|
+
var newItem = newBundle.find(function (newItem) {
|
|
157
|
+
return newItem.id === item.id;
|
|
158
|
+
});
|
|
159
|
+
if (newItem) {
|
|
160
|
+
newItem.num += item.num || 1;
|
|
161
|
+
newItem.quantity += item.quantity || 1;
|
|
162
|
+
} else {
|
|
163
|
+
newBundle.push(_objectSpread({}, item));
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
return newBundle;
|
|
167
|
+
};
|
|
152
168
|
|
|
153
169
|
/**
|
|
154
170
|
* 合并 bundle 数据,基于 id 和 product_id 匹配,price 优先使用 originalOther 中的值
|
|
@@ -189,7 +189,7 @@ var Payments = Provider(function (props) {
|
|
|
189
189
|
className: "payment-list-item-surcharge"
|
|
190
190
|
}, "(", locales.getText("pisell2.text.surcharge"), " ", formatAmount(item.service_fee, 2, (state === null || state === void 0 ? void 0 : state.amountSymbol) || "$"), ")") : null, /*#__PURE__*/React.createElement("div", {
|
|
191
191
|
className: "payment-list-item-date"
|
|
192
|
-
}, dayjs(item.payment_time).format("HH:mm YYYY/MM/DD"), /*#__PURE__*/React.createElement("span", {
|
|
192
|
+
}, dayjs(item.payment_time || item.created_at).format("HH:mm YYYY/MM/DD"), /*#__PURE__*/React.createElement("span", {
|
|
193
193
|
className: "payment-list-item-platform-type"
|
|
194
194
|
}, item.platform && locales.getText("pisell2.text.platform.type")(item.platform))))))));
|
|
195
195
|
}
|
|
@@ -17,7 +17,7 @@ export declare const useWalletPass: (props: {
|
|
|
17
17
|
cardData: any;
|
|
18
18
|
handleSelectWallet: (value: number[]) => void;
|
|
19
19
|
selectedWalletIds: any[];
|
|
20
|
-
expiredWalletIds: any;
|
|
20
|
+
expiredWalletIds: any[];
|
|
21
21
|
expiredWalletData: any;
|
|
22
22
|
disabledWalletData: any[];
|
|
23
23
|
clearAllSelectedWallet: () => void;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
interface ModalProps {
|
|
2
|
+
visible?: boolean;
|
|
3
|
+
data?: Record<string, any>;
|
|
4
|
+
onCancel?: () => void;
|
|
5
|
+
onCheck?: () => void;
|
|
6
|
+
onConfirm?: () => void;
|
|
7
|
+
close?: () => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const usePairModal: () => {
|
|
10
|
+
visible: boolean;
|
|
11
|
+
open: (props: ModalProps) => void;
|
|
12
|
+
close: () => void;
|
|
13
|
+
modalProps: ModalProps;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* @title 解除配对
|
|
17
|
+
*/
|
|
18
|
+
export declare const useUnPairRequest: () => {
|
|
19
|
+
run: (params: any) => any;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* @title 检查配对状态
|
|
23
|
+
*/
|
|
24
|
+
export declare const useCheckPairRequest: () => {
|
|
25
|
+
run: (params: any) => any;
|
|
26
|
+
};
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
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; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
+
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."); }
|
|
9
|
+
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); }
|
|
10
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
11
|
+
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; } }
|
|
12
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
+
import { useState } from 'react';
|
|
14
|
+
import { useRequest } from "../hooks";
|
|
15
|
+
export var usePairModal = function usePairModal() {
|
|
16
|
+
var _useState = useState(false),
|
|
17
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
18
|
+
visible = _useState2[0],
|
|
19
|
+
setVisible = _useState2[1];
|
|
20
|
+
var _useState3 = useState({}),
|
|
21
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
22
|
+
modalProps = _useState4[0],
|
|
23
|
+
setModalProps = _useState4[1];
|
|
24
|
+
var open = function open(props) {
|
|
25
|
+
setModalProps(_objectSpread(_objectSpread({}, props || {}), {}, {
|
|
26
|
+
visible: true,
|
|
27
|
+
close: close
|
|
28
|
+
}));
|
|
29
|
+
setVisible(true);
|
|
30
|
+
};
|
|
31
|
+
var close = function close() {
|
|
32
|
+
setVisible(false);
|
|
33
|
+
setModalProps({});
|
|
34
|
+
};
|
|
35
|
+
return {
|
|
36
|
+
visible: visible,
|
|
37
|
+
open: open,
|
|
38
|
+
close: close,
|
|
39
|
+
modalProps: modalProps
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* @title 解除配对
|
|
45
|
+
*/
|
|
46
|
+
export var useUnPairRequest = function useUnPairRequest() {
|
|
47
|
+
var request = useRequest();
|
|
48
|
+
var run = function run(params) {
|
|
49
|
+
return request.post('/shop/pay/card-reader/unpair', params, {});
|
|
50
|
+
};
|
|
51
|
+
return {
|
|
52
|
+
run: run
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* @title 检查配对状态
|
|
58
|
+
*/
|
|
59
|
+
export var useCheckPairRequest = function useCheckPairRequest() {
|
|
60
|
+
var request = useRequest();
|
|
61
|
+
var run = function run(params) {
|
|
62
|
+
return request.post('/shop/pay/card-reader/pairing-info', params, {});
|
|
63
|
+
};
|
|
64
|
+
return {
|
|
65
|
+
run: run
|
|
66
|
+
};
|
|
67
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
interface PairModalProps {
|
|
4
|
+
visible?: boolean;
|
|
5
|
+
data?: Record<string, any>;
|
|
6
|
+
onCancel?: () => void;
|
|
7
|
+
onCheck?: () => void;
|
|
8
|
+
onConfirm?: () => void;
|
|
9
|
+
}
|
|
10
|
+
declare const PairModal: React.FC<PairModalProps>;
|
|
11
|
+
export default PairModal;
|