@pisell/private-materials 3.4.3 → 3.4.4
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 +13 -13
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +4 -4
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +7 -7
- package/es/components/Sales/Cart/index.js +5 -1
- package/es/components/Sales/Cart/utils.d.ts +40 -0
- package/es/components/Sales/Cart/utils.js +187 -0
- package/es/components/Sales/Checkout/index.d.ts +4 -0
- package/es/components/Sales/Checkout/index.js +52 -8
- package/es/components/Sales/Checkout/serve.d.ts +13 -0
- package/es/components/Sales/Checkout/serve.js +16 -2
- package/es/components/Sales/Checkout/utils.d.ts +1 -0
- package/es/components/Sales/Checkout/utils.js +9 -2
- package/es/components/Sales/Customer/index.d.ts +25 -0
- package/es/components/Sales/Event/Detail.d.ts +1 -0
- package/es/components/Sales/Event/Detail.js +45 -11
- package/es/components/Sales/Event/serve.d.ts +10 -0
- package/es/components/Sales/Event/serve.js +25 -0
- package/es/components/Sales/Summary/index.d.ts +10 -0
- package/es/components/Sales/Summary/index.js +17 -2
- package/es/components/Sales/Summary/serve.d.ts +1 -0
- package/es/components/Sales/Summary/serve.js +6 -0
- package/es/components/Sales/Summary/utils.d.ts +16 -1
- package/es/components/Sales/Summary/utils.js +43 -1
- package/es/components/appointmentBooking/components/Content/index.js +15 -1
- package/es/components/appointmentBooking/components/Deposit/index.d.ts +6 -0
- package/es/components/appointmentBooking/components/Deposit/index.js +27 -7
- package/es/components/appointmentBooking/components/Form/index.d.ts +4 -0
- package/es/components/appointmentBooking/components/Form/utils.d.ts +8 -0
- package/es/components/appointmentBooking/deposit/components/PolicyModal/index.js +25 -20
- package/es/components/appointmentBooking/deposit/index.js +4 -2
- package/es/components/booking/components/TabProduct/tabs/index.js +1 -5
- package/es/components/booking/components/browserSelect/index.js +1 -1
- package/es/components/booking/components/footer/index.js +32 -24
- package/es/components/booking/forms/model.js +5 -5
- package/es/components/booking/info/service/Lists.d.ts +2 -0
- package/es/components/booking/info/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info/service/like/index.js +1 -1
- package/es/components/booking/info/utils.js +1 -1
- package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info2/service/index.d.ts +4 -0
- package/es/components/booking/info2/utils.d.ts +4 -0
- package/es/components/booking/info2/utilsByBooking.js +9 -3
- package/es/components/booking/materiels/startTime/index.js +1 -1
- package/es/components/booking/notes/NoteBlock/NoteItem/index.js +1 -1
- package/es/components/booking/notes/NoteBlock/index.js +11 -11
- package/es/components/booking/notes/model.js +5 -5
- package/es/components/booking/payments/model.js +5 -5
- package/es/components/booking/utils.d.ts +2 -2
- 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 +2 -2
- package/es/components/eftposPay/store/index.d.ts +5 -5
- package/es/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +29 -17
- package/es/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +2 -0
- package/es/components/eventBooking/components/Provider/Cart/Deposit/index.js +17 -0
- package/es/components/eventBooking/components/Provider/Cart/Item/Total.js +10 -6
- package/es/components/eventBooking/components/Provider/Cart/Item/index.js +4 -2
- package/es/components/eventBooking/components/bookingDetailModal/index.js +6 -3
- package/es/components/eventBooking/locales.d.ts +24 -0
- package/es/components/eventBooking/locales.js +27 -3
- package/es/components/listComponent/index.js +5 -5
- package/es/components/pay/toC/PaymentMethods/GlobePayAliPayH5/index.js +18 -3
- package/es/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/ThreedsLoading/index.d.ts +1 -1
- package/es/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/ThreedsLoading/index.js +7 -2
- package/es/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/ThreedsLoading/index.less +8 -0
- package/es/components/pay/toC/PaymentMethods/SuperPayAliPayH5/index.js +18 -3
- package/es/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +113 -0
- package/es/components/pay/toC/locales.d.ts +3 -0
- package/es/components/pay/toC/locales.js +3 -0
- package/es/components/pay/toC/utils.d.ts +57 -0
- package/es/components/productExtension/card/index.js +3 -3
- package/es/components/productExtension/fields/Actor/CutOffTime/index.js +1 -1
- package/es/components/productExtension/fields/Forms/index.js +12 -12
- package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.js +1 -1
- package/es/components/productExtension/fields/SelectProducts/server.js +2 -2
- package/es/components/productExtension/fields/SelectResourcesTable/server.js +2 -2
- package/es/components/productExtension/server.js +2 -2
- package/es/components/ruleSetting/ruleBorder/index.js +1 -1
- package/es/components/schedules/calendar/index.js +4 -4
- package/es/components/schedules/calendar/serve.js +2 -2
- package/es/components/schedules/components/CurrentDay/index.js +5 -5
- package/es/components/schedules/components/CurrentDay/serve.js +2 -2
- package/es/components/schedules/components/DropdownSort/index.js +1 -1
- package/es/components/schedules/components/ResourceList/index.js +1 -1
- package/es/components/schedules/components/Search/index.js +5 -5
- package/es/components/schedules/model.js +5 -5
- package/es/components/schedules/openHours/index.js +1 -1
- package/es/components/schedules/openHours/serve.js +2 -2
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.js +1 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.js +5 -5
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.js +4 -4
- package/es/components/schedules/products/ProductDetailDrawer/index.js +3 -3
- package/es/components/schedules/products/serve.js +2 -2
- package/es/components/schedules/products/utils.js +5 -5
- package/es/components/schedules/resources/detail/detailContent.js +2 -2
- package/es/components/schedules/resources/detail/index.js +10 -10
- package/es/components/schedules/resources/list/index.js +2 -2
- package/es/components/schedules/resources/relationProduct/index.js +1 -1
- package/es/components/schedules/resources/serve.js +2 -2
- package/es/components/schedules/schedules/ScheduleDetailDrawer/index.js +9 -9
- package/es/components/schedules/utils.d.ts +1 -1
- package/es/components/schedules/utils.js +4 -4
- package/es/components/selectModal/index.js +2 -2
- package/es/components/shoppingCart/components/Cart/Product.d.ts +3 -0
- package/es/components/ticketBooking/components/menuBar/index.js +38 -2
- package/es/components/ticketBooking/components/menuBar/index.less +8 -0
- package/es/components/ticketBooking/locales.d.ts +174 -0
- package/es/components/ticketBooking/locales.js +6 -3
- package/es/hooks/useComponents.js +1 -1
- package/es/utils/index.d.ts +1 -1
- package/lib/components/Sales/Cart/index.js +1 -0
- package/lib/components/Sales/Cart/utils.d.ts +40 -0
- package/lib/components/Sales/Cart/utils.js +129 -0
- package/lib/components/Sales/Checkout/index.d.ts +4 -0
- package/lib/components/Sales/Checkout/index.js +39 -7
- package/lib/components/Sales/Checkout/serve.d.ts +13 -0
- package/lib/components/Sales/Checkout/serve.js +7 -2
- package/lib/components/Sales/Checkout/utils.d.ts +1 -0
- package/lib/components/Sales/Checkout/utils.js +5 -2
- package/lib/components/Sales/Customer/index.d.ts +25 -0
- package/lib/components/Sales/Event/Detail.d.ts +1 -0
- package/lib/components/Sales/Event/Detail.js +37 -12
- package/lib/components/Sales/Event/serve.d.ts +10 -0
- package/lib/components/Sales/Event/serve.js +7 -0
- package/lib/components/Sales/Summary/index.d.ts +10 -0
- package/lib/components/Sales/Summary/index.js +7 -1
- package/lib/components/Sales/Summary/serve.d.ts +1 -0
- package/lib/components/Sales/Summary/serve.js +32 -0
- package/lib/components/Sales/Summary/utils.d.ts +16 -1
- package/lib/components/Sales/Summary/utils.js +30 -1
- package/lib/components/appointmentBooking/components/Content/index.js +6 -1
- package/lib/components/appointmentBooking/components/Deposit/index.d.ts +6 -0
- package/lib/components/appointmentBooking/components/Deposit/index.js +36 -4
- package/lib/components/appointmentBooking/components/Form/index.d.ts +4 -0
- package/lib/components/appointmentBooking/components/Form/utils.d.ts +8 -0
- package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.js +8 -4
- package/lib/components/appointmentBooking/deposit/index.js +4 -2
- package/lib/components/booking/components/footer/index.js +24 -11
- package/lib/components/booking/info/service/Lists.d.ts +2 -0
- package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info/utils.js +3 -1
- package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info2/service/index.d.ts +4 -0
- package/lib/components/booking/info2/utils.d.ts +4 -0
- package/lib/components/booking/info2/utilsByBooking.js +4 -1
- package/lib/components/booking/utils.d.ts +2 -2
- 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 +2 -2
- package/lib/components/eftposPay/store/index.d.ts +5 -5
- package/lib/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +16 -4
- package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +2 -0
- package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.js +55 -0
- package/lib/components/eventBooking/components/Provider/Cart/Item/Total.js +8 -5
- package/lib/components/eventBooking/components/Provider/Cart/Item/index.js +4 -2
- package/lib/components/eventBooking/components/bookingDetailModal/index.js +4 -3
- package/lib/components/eventBooking/locales.d.ts +24 -0
- package/lib/components/eventBooking/locales.js +27 -3
- package/lib/components/pay/toC/PaymentMethods/GlobePayAliPayH5/index.js +13 -1
- package/lib/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/ThreedsLoading/index.d.ts +1 -1
- package/lib/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/ThreedsLoading/index.js +2 -2
- package/lib/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/ThreedsLoading/index.less +8 -0
- package/lib/components/pay/toC/PaymentMethods/SuperPayAliPayH5/index.js +13 -1
- package/lib/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +113 -0
- package/lib/components/pay/toC/locales.d.ts +3 -0
- package/lib/components/pay/toC/locales.js +3 -0
- package/lib/components/pay/toC/utils.d.ts +57 -0
- package/lib/components/schedules/utils.d.ts +1 -1
- package/lib/components/schedules/utils.js +1 -1
- package/lib/components/shoppingCart/components/Cart/Product.d.ts +3 -0
- package/lib/components/ticketBooking/components/menuBar/index.js +42 -2
- package/lib/components/ticketBooking/components/menuBar/index.less +8 -0
- package/lib/components/ticketBooking/locales.d.ts +174 -0
- package/lib/components/ticketBooking/locales.js +6 -3
- package/lib/utils/index.d.ts +1 -1
- package/package.json +4 -4
|
@@ -7,6 +7,16 @@ interface SummaryContextType {
|
|
|
7
7
|
taxTitle?: string;
|
|
8
8
|
totalTaxFee?: string;
|
|
9
9
|
isPriceIncludeTax?: 0 | 1;
|
|
10
|
+
deposit?: {
|
|
11
|
+
total: string;
|
|
12
|
+
protocols: any[];
|
|
13
|
+
hasDeposit: boolean;
|
|
14
|
+
};
|
|
15
|
+
isAgreeDepositPolicy: boolean;
|
|
16
|
+
setIsAgreeDepositPolicy: (value: boolean) => void;
|
|
17
|
+
getDepositProtocol: (params: {
|
|
18
|
+
id: string;
|
|
19
|
+
}) => Promise<any>;
|
|
10
20
|
}
|
|
11
21
|
interface SummaryProviderProps {
|
|
12
22
|
children: React.ReactNode;
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
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."); }
|
|
3
|
+
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); }
|
|
4
|
+
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; }
|
|
5
|
+
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; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import React, { createContext, useMemo, useState } from 'react';
|
|
2
8
|
import { useCart } from "../Cart";
|
|
3
9
|
import { calculatePriceDetails } from "./utils";
|
|
4
10
|
import { useInit } from "../Init";
|
|
11
|
+
import { getDepositProtocolApi } from "./serve";
|
|
5
12
|
|
|
6
13
|
// 定义上下文接口
|
|
7
14
|
|
|
@@ -16,6 +23,10 @@ export var SummaryProvider = function SummaryProvider(_ref) {
|
|
|
16
23
|
cartData = _useCart.cartData;
|
|
17
24
|
var _useInit = useInit(),
|
|
18
25
|
initData = _useInit.initData;
|
|
26
|
+
var _useState = useState(false),
|
|
27
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
28
|
+
isAgreeDepositPolicy = _useState2[0],
|
|
29
|
+
setIsAgreeDepositPolicy = _useState2[1];
|
|
19
30
|
var summaryData = useMemo(function () {
|
|
20
31
|
return calculatePriceDetails((initData === null || initData === void 0 ? void 0 : initData.shop) || {}, cartData.cartItems);
|
|
21
32
|
}, [cartData.cartItems, initData === null || initData === void 0 ? void 0 : initData.shop]);
|
|
@@ -26,7 +37,11 @@ export var SummaryProvider = function SummaryProvider(_ref) {
|
|
|
26
37
|
total: summaryData.total,
|
|
27
38
|
taxTitle: summaryData.taxTitle,
|
|
28
39
|
totalTaxFee: summaryData.totalTaxFee,
|
|
29
|
-
isPriceIncludeTax: summaryData.isPriceIncludeTax
|
|
40
|
+
isPriceIncludeTax: summaryData.isPriceIncludeTax,
|
|
41
|
+
deposit: summaryData.deposit,
|
|
42
|
+
isAgreeDepositPolicy: isAgreeDepositPolicy,
|
|
43
|
+
setIsAgreeDepositPolicy: setIsAgreeDepositPolicy,
|
|
44
|
+
getDepositProtocol: getDepositProtocolApi
|
|
30
45
|
};
|
|
31
46
|
return /*#__PURE__*/React.createElement(SummaryContext.Provider, {
|
|
32
47
|
value: contextValue
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getDepositProtocolApi: (id: string) => Promise<any>;
|
|
@@ -10,6 +10,11 @@ interface PriceDetail {
|
|
|
10
10
|
taxTitle?: string;
|
|
11
11
|
totalTaxFee?: string;
|
|
12
12
|
isPriceIncludeTax?: 0 | 1;
|
|
13
|
+
deposit?: {
|
|
14
|
+
total: string;
|
|
15
|
+
protocols: any[];
|
|
16
|
+
hasDeposit: boolean;
|
|
17
|
+
};
|
|
13
18
|
}
|
|
14
19
|
/**
|
|
15
20
|
* 计算商品小计(不含其他费用)
|
|
@@ -25,7 +30,7 @@ export declare const calculateSubtotal: (items: CartItem[]) => string;
|
|
|
25
30
|
* @return {*}
|
|
26
31
|
* @Author: xiangfeng.xue
|
|
27
32
|
*/
|
|
28
|
-
export declare const calculateTaxFee: (shopInfo: any, items: CartItem[]) => "0.00"
|
|
33
|
+
export declare const calculateTaxFee: (shopInfo: any, items: CartItem[]) => Decimal | "0.00";
|
|
29
34
|
/**
|
|
30
35
|
* 计算所有价格明细
|
|
31
36
|
* @param items - 购物车商品数组
|
|
@@ -33,4 +38,14 @@ export declare const calculateTaxFee: (shopInfo: any, items: CartItem[]) => "0.0
|
|
|
33
38
|
* @returns 价格明细对象
|
|
34
39
|
*/
|
|
35
40
|
export declare const calculatePriceDetails: (shopInfo: any, items: CartItem[]) => PriceDetail;
|
|
41
|
+
/**
|
|
42
|
+
* @title: 计算定金
|
|
43
|
+
* @param items - 购物车商品数组
|
|
44
|
+
* @returns 定金字符串,保留2位小数
|
|
45
|
+
*/
|
|
46
|
+
export declare const calculateDeposit: (items: CartItem[]) => {
|
|
47
|
+
total: string;
|
|
48
|
+
protocols: any[];
|
|
49
|
+
hasDeposit: never;
|
|
50
|
+
} | undefined;
|
|
36
51
|
export {};
|
|
@@ -54,11 +54,53 @@ export var calculatePriceDetails = function calculatePriceDetails(shopInfo, item
|
|
|
54
54
|
|
|
55
55
|
// 计算总价
|
|
56
56
|
var total = shopInfo !== null && shopInfo !== void 0 && shopInfo.is_price_include_tax ? subtotal : subtotal.plus(totalTaxFee);
|
|
57
|
+
|
|
58
|
+
// 计算定金
|
|
59
|
+
var deposit = calculateDeposit(items);
|
|
57
60
|
return {
|
|
58
61
|
subtotal: subtotal.toFixed(2),
|
|
59
62
|
total: total.toFixed(2),
|
|
60
63
|
taxTitle: shopInfo === null || shopInfo === void 0 ? void 0 : shopInfo.tax_title,
|
|
61
64
|
totalTaxFee: totalTaxFee.toFixed(2),
|
|
62
|
-
isPriceIncludeTax: shopInfo === null || shopInfo === void 0 ? void 0 : shopInfo.is_price_include_tax
|
|
65
|
+
isPriceIncludeTax: shopInfo === null || shopInfo === void 0 ? void 0 : shopInfo.is_price_include_tax,
|
|
66
|
+
deposit: deposit
|
|
63
67
|
};
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* @title: 计算定金
|
|
72
|
+
* @param items - 购物车商品数组
|
|
73
|
+
* @returns 定金字符串,保留2位小数
|
|
74
|
+
*/
|
|
75
|
+
export var calculateDeposit = function calculateDeposit(items) {
|
|
76
|
+
if (!(items !== null && items !== void 0 && items.length)) {
|
|
77
|
+
return undefined;
|
|
78
|
+
}
|
|
79
|
+
var protocols = [];
|
|
80
|
+
var hasDeposit = false;
|
|
81
|
+
var total = items.reduce(function (sum, item) {
|
|
82
|
+
if (item !== null && item !== void 0 && item.deposit) {
|
|
83
|
+
var _item$deposit, _item$deposit2;
|
|
84
|
+
hasDeposit = true;
|
|
85
|
+
var cartItemTotalPrice = new Decimal((item === null || item === void 0 || (_item$deposit = item.deposit) === null || _item$deposit === void 0 ? void 0 : _item$deposit.total) || 0);
|
|
86
|
+
// 将协议数据去重合并
|
|
87
|
+
item === null || item === void 0 || (_item$deposit2 = item.deposit) === null || _item$deposit2 === void 0 || (_item$deposit2 = _item$deposit2.protocols) === null || _item$deposit2 === void 0 || _item$deposit2.forEach(function (protocol) {
|
|
88
|
+
if (protocols.findIndex(function (p) {
|
|
89
|
+
return p.id === protocol.id;
|
|
90
|
+
}) === -1) {
|
|
91
|
+
protocols.push(protocol);
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
return sum.plus(cartItemTotalPrice);
|
|
95
|
+
}
|
|
96
|
+
return sum;
|
|
97
|
+
}, new Decimal(0));
|
|
98
|
+
if (hasDeposit) {
|
|
99
|
+
return {
|
|
100
|
+
total: total.toFixed(2),
|
|
101
|
+
protocols: protocols,
|
|
102
|
+
hasDeposit: hasDeposit
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
return undefined;
|
|
64
106
|
};
|
|
@@ -213,6 +213,19 @@ var Layout = function Layout() {
|
|
|
213
213
|
if (isDateSelectedFirst && key === 'select-date') return false;
|
|
214
214
|
return key !== 'confirm-information';
|
|
215
215
|
}, [isDateSelectedFirst, currentStep === null || currentStep === void 0 || (_currentStep$step8 = currentStep.step) === null || _currentStep$step8 === void 0 ? void 0 : _currentStep$step8.key]);
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* @title: 获取协议方法需要在组件中定义才能传递给子组件,子组件无法获取到context中的方法
|
|
219
|
+
* @description:
|
|
220
|
+
* @param {string} id
|
|
221
|
+
* @return {*}
|
|
222
|
+
* @Author: WangHan
|
|
223
|
+
* @Date: 2025-07-07 10:06
|
|
224
|
+
*/
|
|
225
|
+
var depositProtocolRequest = function depositProtocolRequest(id) {
|
|
226
|
+
var _appointmentBooking$g;
|
|
227
|
+
return appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$g = appointmentBooking.getProtocol) === null || _appointmentBooking$g === void 0 ? void 0 : _appointmentBooking$g.call(appointmentBooking, id);
|
|
228
|
+
};
|
|
216
229
|
return /*#__PURE__*/React.createElement(React.Fragment, null, !isRetailTemplate ? /*#__PURE__*/React.createElement(Header, null) : null, /*#__PURE__*/React.createElement("div", {
|
|
217
230
|
className: "parallel-content-wrap ".concat(isMobile() ? 'parallel-content-mobile-wrap' : '', " ").concat(isRetailTemplate ? 'parallel-content-retail-wrap' : '')
|
|
218
231
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -237,7 +250,8 @@ var Layout = function Layout() {
|
|
|
237
250
|
onChange: function onChange() {
|
|
238
251
|
return setLoading(false);
|
|
239
252
|
},
|
|
240
|
-
isHideCheckout: false
|
|
253
|
+
isHideCheckout: false,
|
|
254
|
+
depositProtocolRequest: depositProtocolRequest
|
|
241
255
|
}) : null);
|
|
242
256
|
};
|
|
243
257
|
export default Layout;
|
|
@@ -1,3 +1,9 @@
|
|
|
1
1
|
import './index.less';
|
|
2
|
+
export declare const DepositContent: (props: {
|
|
3
|
+
isAgreeDepositPolicy: boolean;
|
|
4
|
+
setIsAgreeDepositPolicy: (value: boolean) => void;
|
|
5
|
+
deposit: any;
|
|
6
|
+
depositProtocolRequest?: any;
|
|
7
|
+
}) => JSX.Element;
|
|
2
8
|
declare const Deposit: () => JSX.Element;
|
|
3
9
|
export default Deposit;
|
|
@@ -4,12 +4,11 @@ import AppointmentDeposit from "../../deposit";
|
|
|
4
4
|
import { useAppointmentBookingContext } from "../../context";
|
|
5
5
|
import { locales } from '@pisell/utils';
|
|
6
6
|
import "./index.less";
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
setIsAgreeDepositPolicy =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var deposit = summary.deposit;
|
|
7
|
+
export var DepositContent = function DepositContent(props) {
|
|
8
|
+
var isAgreeDepositPolicy = props.isAgreeDepositPolicy,
|
|
9
|
+
setIsAgreeDepositPolicy = props.setIsAgreeDepositPolicy,
|
|
10
|
+
deposit = props.deposit,
|
|
11
|
+
depositProtocolRequest = props.depositProtocolRequest;
|
|
13
12
|
return /*#__PURE__*/React.createElement("div", {
|
|
14
13
|
className: "appointment-deposit-wrap"
|
|
15
14
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -24,7 +23,28 @@ var Deposit = function Deposit() {
|
|
|
24
23
|
isAgreePolicy: isAgreeDepositPolicy,
|
|
25
24
|
onChange: function onChange(value) {
|
|
26
25
|
return setIsAgreeDepositPolicy(value);
|
|
27
|
-
}
|
|
26
|
+
},
|
|
27
|
+
depositProtocolRequest: depositProtocolRequest
|
|
28
28
|
}));
|
|
29
29
|
};
|
|
30
|
+
var Deposit = function Deposit() {
|
|
31
|
+
var _ref = useAppointmentBookingContext(),
|
|
32
|
+
setIsAgreeDepositPolicy = _ref.setIsAgreeDepositPolicy,
|
|
33
|
+
isAgreeDepositPolicy = _ref.isAgreeDepositPolicy,
|
|
34
|
+
summary = _ref.summary,
|
|
35
|
+
appointmentBooking = _ref.appointmentBooking;
|
|
36
|
+
var deposit = summary.deposit;
|
|
37
|
+
|
|
38
|
+
// 获取协议方法需要在组件中定义才能传递给子组件,子组件无法获取到context中的方法
|
|
39
|
+
var depositProtocolRequest = function depositProtocolRequest(id) {
|
|
40
|
+
var _appointmentBooking$g;
|
|
41
|
+
return appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$g = appointmentBooking.getProtocol) === null || _appointmentBooking$g === void 0 ? void 0 : _appointmentBooking$g.call(appointmentBooking, id);
|
|
42
|
+
};
|
|
43
|
+
return /*#__PURE__*/React.createElement(DepositContent, {
|
|
44
|
+
isAgreeDepositPolicy: !!isAgreeDepositPolicy,
|
|
45
|
+
setIsAgreeDepositPolicy: setIsAgreeDepositPolicy,
|
|
46
|
+
deposit: deposit,
|
|
47
|
+
depositProtocolRequest: depositProtocolRequest
|
|
48
|
+
});
|
|
49
|
+
};
|
|
30
50
|
export default Deposit;
|
|
@@ -12,7 +12,6 @@ import React, { useState, useEffect } from 'react';
|
|
|
12
12
|
import { Spin } from 'antd';
|
|
13
13
|
import { PisellModal, PisellEmpty, Button, Checkbox } from '@pisell/materials';
|
|
14
14
|
import { locales, isMobile } from '@pisell/utils';
|
|
15
|
-
import { useAppointmentBookingContext } from "../../../context";
|
|
16
15
|
import "./index.less";
|
|
17
16
|
var DepositModal = function DepositModal(props) {
|
|
18
17
|
var open = props.open,
|
|
@@ -21,9 +20,8 @@ var DepositModal = function DepositModal(props) {
|
|
|
21
20
|
onChange = props.onChange,
|
|
22
21
|
onConfirm = props.onConfirm,
|
|
23
22
|
_props$isHideCheckout = props.isHideCheckout,
|
|
24
|
-
isHideCheckout = _props$isHideCheckout === void 0 ? true : _props$isHideCheckout
|
|
25
|
-
|
|
26
|
-
appointmentBooking = _useAppointmentBookin.appointmentBooking;
|
|
23
|
+
isHideCheckout = _props$isHideCheckout === void 0 ? true : _props$isHideCheckout,
|
|
24
|
+
depositProtocolRequest = props.depositProtocolRequest;
|
|
27
25
|
var _useState = useState(null),
|
|
28
26
|
_useState2 = _slicedToArray(_useState, 2),
|
|
29
27
|
policy = _useState2[0],
|
|
@@ -50,35 +48,42 @@ var DepositModal = function DepositModal(props) {
|
|
|
50
48
|
*/
|
|
51
49
|
var getPolicy = /*#__PURE__*/function () {
|
|
52
50
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(id) {
|
|
53
|
-
var _yield$
|
|
51
|
+
var _yield$depositProtoco, data;
|
|
54
52
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
55
53
|
while (1) switch (_context.prev = _context.next) {
|
|
56
54
|
case 0:
|
|
55
|
+
if (depositProtocolRequest) {
|
|
56
|
+
_context.next = 3;
|
|
57
|
+
break;
|
|
58
|
+
}
|
|
59
|
+
console.error('depositProtocolRequest is not defined');
|
|
60
|
+
return _context.abrupt("return");
|
|
61
|
+
case 3:
|
|
57
62
|
setLoading(true);
|
|
58
|
-
_context.prev =
|
|
59
|
-
_context.next =
|
|
60
|
-
return
|
|
61
|
-
case
|
|
62
|
-
_yield$
|
|
63
|
-
data = _yield$
|
|
63
|
+
_context.prev = 4;
|
|
64
|
+
_context.next = 7;
|
|
65
|
+
return depositProtocolRequest === null || depositProtocolRequest === void 0 ? void 0 : depositProtocolRequest(id);
|
|
66
|
+
case 7:
|
|
67
|
+
_yield$depositProtoco = _context.sent;
|
|
68
|
+
data = _yield$depositProtoco.data;
|
|
64
69
|
setPolicy(data);
|
|
65
70
|
onChange && onChange(data);
|
|
66
|
-
_context.next =
|
|
71
|
+
_context.next = 17;
|
|
67
72
|
break;
|
|
68
|
-
case
|
|
69
|
-
_context.prev =
|
|
70
|
-
_context.t0 = _context["catch"](
|
|
73
|
+
case 13:
|
|
74
|
+
_context.prev = 13;
|
|
75
|
+
_context.t0 = _context["catch"](4);
|
|
71
76
|
console.log(_context.t0);
|
|
72
77
|
onChange && onChange(_context.t0);
|
|
73
|
-
case 14:
|
|
74
|
-
_context.prev = 14;
|
|
75
|
-
setLoading(false);
|
|
76
|
-
return _context.finish(14);
|
|
77
78
|
case 17:
|
|
79
|
+
_context.prev = 17;
|
|
80
|
+
setLoading(false);
|
|
81
|
+
return _context.finish(17);
|
|
82
|
+
case 20:
|
|
78
83
|
case "end":
|
|
79
84
|
return _context.stop();
|
|
80
85
|
}
|
|
81
|
-
}, _callee, null, [[
|
|
86
|
+
}, _callee, null, [[4, 13, 17, 20]]);
|
|
82
87
|
}));
|
|
83
88
|
return function getPolicy(_x) {
|
|
84
89
|
return _ref.apply(this, arguments);
|
|
@@ -21,7 +21,8 @@ var Deposit = function Deposit(props) {
|
|
|
21
21
|
isAgreePolicy = _props$isAgreePolicy === void 0 ? true : _props$isAgreePolicy,
|
|
22
22
|
_props$isShowTitle = props.isShowTitle,
|
|
23
23
|
isShowTitle = _props$isShowTitle === void 0 ? true : _props$isShowTitle,
|
|
24
|
-
onChange = props.onChange
|
|
24
|
+
onChange = props.onChange,
|
|
25
|
+
depositProtocolRequest = props.depositProtocolRequest;
|
|
25
26
|
var context = useEngineContext();
|
|
26
27
|
// 打开协议弹窗
|
|
27
28
|
var _useState = useState(false),
|
|
@@ -95,7 +96,8 @@ var Deposit = function Deposit(props) {
|
|
|
95
96
|
onCancel: function onCancel() {
|
|
96
97
|
return setVisible(false);
|
|
97
98
|
},
|
|
98
|
-
item: policyItem
|
|
99
|
+
item: policyItem,
|
|
100
|
+
depositProtocolRequest: depositProtocolRequest
|
|
99
101
|
}));
|
|
100
102
|
};
|
|
101
103
|
export default Deposit;
|
|
@@ -2,7 +2,7 @@ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArra
|
|
|
2
2
|
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."); }
|
|
3
3
|
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); }
|
|
4
4
|
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; }
|
|
5
|
-
function _iterableToArrayLimit(
|
|
5
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
6
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
7
|
import React, { useMemo, useState, useEffect, forwardRef, useImperativeHandle } from "react";
|
|
8
8
|
import classNames from "classnames";
|
|
@@ -13,10 +13,6 @@ import "./index.less";
|
|
|
13
13
|
|
|
14
14
|
// tabs 子组件定义
|
|
15
15
|
|
|
16
|
-
// 定义主键类型
|
|
17
|
-
|
|
18
|
-
// Tabs 可传递的参数
|
|
19
|
-
|
|
20
16
|
var Tabs = function Tabs(_ref, ref) {
|
|
21
17
|
var renderTab = _ref.renderTab,
|
|
22
18
|
rowKey = _ref.rowKey,
|
|
@@ -29,7 +29,7 @@ var BrowserSelect = function BrowserSelect(props) {
|
|
|
29
29
|
onChange: function onChange(e) {
|
|
30
30
|
var _resetProps$onChange;
|
|
31
31
|
e.persist();
|
|
32
|
-
(_resetProps$onChange = resetProps.onChange) === null || _resetProps$onChange === void 0
|
|
32
|
+
(_resetProps$onChange = resetProps.onChange) === null || _resetProps$onChange === void 0 ? void 0 : _resetProps$onChange.call(resetProps, e);
|
|
33
33
|
}
|
|
34
34
|
}), _options);
|
|
35
35
|
};
|
|
@@ -47,7 +47,7 @@ import dayjs from 'dayjs';
|
|
|
47
47
|
* @Date: 2024-01-30 16:51
|
|
48
48
|
*/
|
|
49
49
|
var Footer = function Footer(props) {
|
|
50
|
-
var _context$appHelper, _state$bookingConfig2, _state$bookingConfig4, _state$addons2, _businessUtils$getApp, _businessUtils$getApp2, _state$addons4, _state$
|
|
50
|
+
var _context$appHelper, _state$bookingConfig2, _state$bookingConfig4, _state$addons2, _businessUtils$getApp, _businessUtils$getApp2, _state$bookingDetail8, _state$addons4, _state$bookingDetail16, _state$bookingDetail17;
|
|
51
51
|
var state = props.state,
|
|
52
52
|
buttons = props.buttons,
|
|
53
53
|
dispatch = props.dispatch,
|
|
@@ -628,6 +628,10 @@ var Footer = function Footer(props) {
|
|
|
628
628
|
}
|
|
629
629
|
});
|
|
630
630
|
};
|
|
631
|
+
var paymentRefundedStatus = useMemo(function () {
|
|
632
|
+
var _state$bookingDetail;
|
|
633
|
+
return ['partially_refunded', 'refunded'].includes(state === null || state === void 0 || (_state$bookingDetail = state.bookingDetail) === null || _state$bookingDetail === void 0 ? void 0 : _state$bookingDetail.payment_status);
|
|
634
|
+
}, [state === null || state === void 0 ? void 0 : state.bookingDetail]);
|
|
631
635
|
|
|
632
636
|
/**
|
|
633
637
|
* @title: checkout按钮
|
|
@@ -668,7 +672,7 @@ var Footer = function Footer(props) {
|
|
|
668
672
|
}, [isEdit, checkoutLoading, isDisabled, state, source]);
|
|
669
673
|
var handleMenuClick = /*#__PURE__*/function () {
|
|
670
674
|
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(e) {
|
|
671
|
-
var id, customer, res, _state$
|
|
675
|
+
var id, customer, res, _state$bookingDetail2, _state$bookingDetail3;
|
|
672
676
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
673
677
|
while (1) switch (_context6.prev = _context6.next) {
|
|
674
678
|
case 0:
|
|
@@ -696,10 +700,10 @@ var Footer = function Footer(props) {
|
|
|
696
700
|
type: 'pisell1.sendPayLinkEmail',
|
|
697
701
|
data: {
|
|
698
702
|
id: id,
|
|
699
|
-
is_deposit: state.bookingDetail.is_deposit || Number((_state$
|
|
703
|
+
is_deposit: state.bookingDetail.is_deposit || Number((_state$bookingDetail2 = state.bookingDetail) === null || _state$bookingDetail2 === void 0 ? void 0 : _state$bookingDetail2.deposit_amount),
|
|
700
704
|
deposit_payment_time: state.bookingDetail.deposit_payment_time,
|
|
701
705
|
customer: customer,
|
|
702
|
-
contacts: (_state$
|
|
706
|
+
contacts: (_state$bookingDetail3 = state.bookingDetail) === null || _state$bookingDetail3 === void 0 ? void 0 : _state$bookingDetail3.contacts
|
|
703
707
|
},
|
|
704
708
|
callback: function callback() {}
|
|
705
709
|
});
|
|
@@ -925,10 +929,10 @@ var Footer = function Footer(props) {
|
|
|
925
929
|
* @Date: 2024-01-30 16:58
|
|
926
930
|
*/
|
|
927
931
|
var isCheckout = useMemo(function () {
|
|
928
|
-
var _state$
|
|
932
|
+
var _state$bookingDetail4, _state$bookingDetail5;
|
|
929
933
|
var list = ['unfulfilled', 'partially_paid', 'unpaid', 'payment_processing'];
|
|
930
934
|
// (支付状态 = 已支付 || 部分付款 || 未付款 || 支付处理中) && 预约状态 !== 已取消
|
|
931
|
-
if (!state.bookingId || ((_state$
|
|
935
|
+
if (!state.bookingId || ((_state$bookingDetail4 = state.bookingDetail) === null || _state$bookingDetail4 === void 0 || (_state$bookingDetail4 = _state$bookingDetail4.bookings) === null || _state$bookingDetail4 === void 0 ? void 0 : _state$bookingDetail4.appointment_status) !== 'cancelled' && list.includes(state === null || state === void 0 || (_state$bookingDetail5 = state.bookingDetail) === null || _state$bookingDetail5 === void 0 ? void 0 : _state$bookingDetail5.payment_status) && !state.disabledEdit) {
|
|
932
936
|
return true;
|
|
933
937
|
} else {
|
|
934
938
|
if (total.notPaidAmount > 0) {
|
|
@@ -939,7 +943,8 @@ var Footer = function Footer(props) {
|
|
|
939
943
|
}, [state.bookingDetail, total.notPaidAmount]);
|
|
940
944
|
var _buttons = useMemo(function () {
|
|
941
945
|
// 如果预约是取消状态,则不展示任何按钮
|
|
942
|
-
|
|
946
|
+
// 如果订单已退款 | 部分退款,则展示再次预约按钮
|
|
947
|
+
if (state.appointment_status === 'cancelled' || paymentRefundedStatus) {
|
|
943
948
|
return [buttonMap.rebook];
|
|
944
949
|
}
|
|
945
950
|
|
|
@@ -1018,6 +1023,7 @@ var Footer = function Footer(props) {
|
|
|
1018
1023
|
return [];
|
|
1019
1024
|
}, [buttons, total, isEdit, checkoutLoading, isDisabled, source, buttonMap, loading, isCheckout, state, isTeam, isShowClearAll]);
|
|
1020
1025
|
var moreButton = useMemo(function () {
|
|
1026
|
+
var _state$bookingDetail6;
|
|
1021
1027
|
var arr = [];
|
|
1022
1028
|
if (!state.bookingId) {
|
|
1023
1029
|
return [];
|
|
@@ -1029,10 +1035,16 @@ var Footer = function Footer(props) {
|
|
|
1029
1035
|
return [];
|
|
1030
1036
|
}
|
|
1031
1037
|
|
|
1038
|
+
// 如果订单已退款, 则不展示任何按钮
|
|
1039
|
+
if ((state === null || state === void 0 || (_state$bookingDetail6 = state.bookingDetail) === null || _state$bookingDetail6 === void 0 ? void 0 : _state$bookingDetail6.payment_status) === 'refunded') {
|
|
1040
|
+
return [];
|
|
1041
|
+
}
|
|
1042
|
+
|
|
1032
1043
|
// 如果外部没有按钮, 则rebook按钮放在外面
|
|
1033
1044
|
if (_buttons.length !== 0) {
|
|
1034
|
-
|
|
1035
|
-
|
|
1045
|
+
var _state$bookingDetail7;
|
|
1046
|
+
// 支付链接, 部分退款时, 不展示支付链接
|
|
1047
|
+
if (state.bookingId && isShowPaymentLink && (state === null || state === void 0 || (_state$bookingDetail7 = state.bookingDetail) === null || _state$bookingDetail7 === void 0 ? void 0 : _state$bookingDetail7.payment_status) !== 'partially_refunded') {
|
|
1036
1048
|
arr.push(actionMap.paymentLink);
|
|
1037
1049
|
}
|
|
1038
1050
|
}
|
|
@@ -1066,14 +1078,14 @@ var Footer = function Footer(props) {
|
|
|
1066
1078
|
// 取消订单
|
|
1067
1079
|
// arr.push(actionMap.cancelOrder);
|
|
1068
1080
|
return arr;
|
|
1069
|
-
}, [state, total, isShowPaymentLink, source, _buttons.length]);
|
|
1081
|
+
}, [state, total, isShowPaymentLink, source, _buttons.length, state === null || state === void 0 || (_state$bookingDetail8 = state.bookingDetail) === null || _state$bookingDetail8 === void 0 ? void 0 : _state$bookingDetail8.payment_status]);
|
|
1070
1082
|
|
|
1071
1083
|
/**
|
|
1072
1084
|
* 是否只有定金支付
|
|
1073
1085
|
*/
|
|
1074
1086
|
var isOnlyDeposit = useMemo(function () {
|
|
1075
|
-
var _state$
|
|
1076
|
-
if (state !== null && state !== void 0 && (_state$
|
|
1087
|
+
var _state$bookingDetail9, _state$bookingDetail10, _state$bookingDetail11;
|
|
1088
|
+
if (state !== null && state !== void 0 && (_state$bookingDetail9 = state.bookingDetail) !== null && _state$bookingDetail9 !== void 0 && _state$bookingDetail9.deposit_payment_time && state !== null && state !== void 0 && (_state$bookingDetail10 = state.bookingDetail) !== null && _state$bookingDetail10 !== void 0 && (_state$bookingDetail10 = _state$bookingDetail10.payment_types) !== null && _state$bookingDetail10 !== void 0 && (_state$bookingDetail11 = _state$bookingDetail10.every) !== null && _state$bookingDetail11 !== void 0 && _state$bookingDetail11.call(_state$bookingDetail10, function (item) {
|
|
1077
1089
|
return item === 'deposit';
|
|
1078
1090
|
})) {
|
|
1079
1091
|
return true;
|
|
@@ -1094,8 +1106,8 @@ var Footer = function Footer(props) {
|
|
|
1094
1106
|
|
|
1095
1107
|
// 只有定金支付时,直接展示
|
|
1096
1108
|
if (isOnlyDeposit) {
|
|
1097
|
-
var _state$
|
|
1098
|
-
return "".concat(locales.getText('pisell2.text.deposit-paid'), " ").concat(formatAmount(state === null || state === void 0 || (_state$
|
|
1109
|
+
var _state$bookingDetail12;
|
|
1110
|
+
return "".concat(locales.getText('pisell2.text.deposit-paid'), " ").concat(formatAmount(state === null || state === void 0 || (_state$bookingDetail12 = state.bookingDetail) === null || _state$bookingDetail12 === void 0 ? void 0 : _state$bookingDetail12.deposit_paid_amount, 2, (state === null || state === void 0 ? void 0 : state.amountSymbol) || '$'), " ").concat(total.duration ? "(".concat(total.duration, ")") : '');
|
|
1099
1111
|
}
|
|
1100
1112
|
|
|
1101
1113
|
// 有退款金额时, 直接展示 退款:$8.00
|
|
@@ -1217,8 +1229,8 @@ var Footer = function Footer(props) {
|
|
|
1217
1229
|
}
|
|
1218
1230
|
};
|
|
1219
1231
|
var subTotalList = useMemo(function () {
|
|
1220
|
-
var _state$
|
|
1221
|
-
var surcharge = (((_state$
|
|
1232
|
+
var _state$bookingDetail13, _state$bookingDetail14, _state$bookingDetail15;
|
|
1233
|
+
var surcharge = (((_state$bookingDetail13 = state.bookingDetail) === null || _state$bookingDetail13 === void 0 ? void 0 : _state$bookingDetail13.surcharge) || []).map(function (d, index) {
|
|
1222
1234
|
return {
|
|
1223
1235
|
key: "custom_surcharge_".concat(index),
|
|
1224
1236
|
label: d.name[state.locale],
|
|
@@ -1237,9 +1249,9 @@ var Footer = function Footer(props) {
|
|
|
1237
1249
|
key: 'tax',
|
|
1238
1250
|
value: total.tax,
|
|
1239
1251
|
tax: {
|
|
1240
|
-
rate: state === null || state === void 0 || (_state$
|
|
1252
|
+
rate: state === null || state === void 0 || (_state$bookingDetail14 = state.bookingDetail) === null || _state$bookingDetail14 === void 0 ? void 0 : _state$bookingDetail14.tax_rate,
|
|
1241
1253
|
is_price_include_tax: is_price_include_tax(state),
|
|
1242
|
-
title: state === null || state === void 0 || (_state$
|
|
1254
|
+
title: state === null || state === void 0 || (_state$bookingDetail15 = state.bookingDetail) === null || _state$bookingDetail15 === void 0 ? void 0 : _state$bookingDetail15.tax_title
|
|
1243
1255
|
}
|
|
1244
1256
|
},
|
|
1245
1257
|
// 订单折扣
|
|
@@ -1260,7 +1272,7 @@ var Footer = function Footer(props) {
|
|
|
1260
1272
|
value: total.roundingAmount,
|
|
1261
1273
|
label: locales.getText('pisell1.text.rounding')
|
|
1262
1274
|
}]);
|
|
1263
|
-
}, [total, (_state$
|
|
1275
|
+
}, [total, (_state$bookingDetail16 = state.bookingDetail) === null || _state$bookingDetail16 === void 0 ? void 0 : _state$bookingDetail16.surcharge, state, state.bookingId]);
|
|
1264
1276
|
var orderTotalList = useMemo(function () {
|
|
1265
1277
|
return [
|
|
1266
1278
|
// 订单已付金额
|
|
@@ -1291,11 +1303,7 @@ var Footer = function Footer(props) {
|
|
|
1291
1303
|
value: total.totalRefundAmount,
|
|
1292
1304
|
label: locales.getText('pisell2.text.refunded-amount')
|
|
1293
1305
|
}];
|
|
1294
|
-
}, [total, (_state$
|
|
1295
|
-
var paymentRefundedStatus = useMemo(function () {
|
|
1296
|
-
var _state$bookingDetail14;
|
|
1297
|
-
return ['partially_refunded', 'refunded'].includes(state === null || state === void 0 || (_state$bookingDetail14 = state.bookingDetail) === null || _state$bookingDetail14 === void 0 ? void 0 : _state$bookingDetail14.payment_status);
|
|
1298
|
-
}, [state === null || state === void 0 ? void 0 : state.bookingDetail]);
|
|
1306
|
+
}, [total, (_state$bookingDetail17 = state.bookingDetail) === null || _state$bookingDetail17 === void 0 ? void 0 : _state$bookingDetail17.surcharge, state, state.bookingId]);
|
|
1299
1307
|
return /*#__PURE__*/React.createElement(Skeleton, {
|
|
1300
1308
|
title: false,
|
|
1301
1309
|
round: true,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
function _typeof(
|
|
2
|
-
function ownKeys(
|
|
3
|
-
function _objectSpread(
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
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(
|
|
6
|
-
function _toPrimitive(
|
|
5
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
7
|
import { miniRedux } from "@pisell/utils";
|
|
8
8
|
var defaultState = {};
|
|
9
9
|
var _miniRedux = miniRedux({
|
|
@@ -19,7 +19,7 @@ var Like = function Like(_ref) {
|
|
|
19
19
|
}
|
|
20
20
|
e.preventDefault();
|
|
21
21
|
e.stopPropagation();
|
|
22
|
-
onChange === null || onChange === void 0
|
|
22
|
+
onChange === null || onChange === void 0 ? void 0 : onChange(status === "like" ? "common" : "like");
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
25
|
};
|
|
@@ -95,7 +95,7 @@ export var isBooking4Shop = function isBooking4Shop(shopId, renderType) {
|
|
|
95
95
|
if (renderType === 'eventBooking') {
|
|
96
96
|
return false;
|
|
97
97
|
}
|
|
98
|
-
var booking4Shops = [8390, 1350, 1401, 3013, 7154, 7572, 7007, 8119, 7320, 7362, 6497, 6087, 6303, 6726, 8191, 6812, 6813, 6814, 7651, 8586, 8581, 9, 2155, 8030, 1749, 8194, 2327, 8609, 8610, 8782, 1285, 6124, 8727, 5538, 6988, 8872, 6930, 8824, 8913];
|
|
98
|
+
var booking4Shops = [8390, 1350, 1401, 3013, 7154, 7572, 7007, 8119, 7320, 7362, 6497, 6087, 6303, 6726, 8191, 6812, 6813, 6814, 7651, 8586, 8581, 9, 2155, 8030, 1749, 8194, 2327, 8609, 8610, 8782, 1285, 6124, 8727, 5538, 6988, 8872, 6930, 8824, 8913, 8918, 6413];
|
|
99
99
|
return booking4Shops.includes(shopId);
|
|
100
100
|
};
|
|
101
101
|
function generateDateRange(start, end) {
|