@pisell/private-materials 3.3.89 → 3.3.91
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 +11 -11
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +11 -11
- package/es/businessModel/SalesModel/Sales/index.js +4 -37
- package/es/components/Sales/Cart/index.js +1 -5
- package/es/components/Sales/Cart/utils.d.ts +0 -40
- package/es/components/Sales/Cart/utils.js +0 -167
- package/es/components/Sales/Checkout/index.d.ts +0 -4
- package/es/components/Sales/Checkout/index.js +8 -52
- package/es/components/Sales/Checkout/serve.d.ts +0 -13
- package/es/components/Sales/Checkout/serve.js +2 -16
- package/es/components/Sales/Checkout/utils.js +1 -7
- package/es/components/Sales/Resource/index.js +2 -2
- package/es/components/Sales/Resource/serve.d.ts +0 -7
- package/es/components/Sales/Resource/serve.js +0 -10
- package/es/components/Sales/Summary/index.d.ts +0 -10
- package/es/components/Sales/Summary/index.js +2 -17
- package/es/components/Sales/Summary/serve.d.ts +0 -1
- package/es/components/Sales/Summary/serve.js +0 -6
- package/es/components/Sales/Summary/utils.d.ts +1 -16
- package/es/components/Sales/Summary/utils.js +1 -43
- package/es/components/appointmentBooking/components/Cart/Item/index.less +3 -3
- package/es/components/appointmentBooking/components/Content/index.less +1 -1
- package/es/components/appointmentBooking/components/Deposit/index.d.ts +0 -6
- package/es/components/appointmentBooking/components/Deposit/index.js +7 -27
- package/es/components/appointmentBooking/components/Services/index.js +27 -23
- package/es/components/appointmentBooking/deposit/components/PolicyModal/index.js +20 -25
- package/es/components/appointmentBooking/deposit/index.js +2 -4
- package/es/components/appointmentBooking/index.js +0 -14
- package/es/components/appointmentBooking/index.less +1 -1
- package/es/components/booking/components/footer/utils.d.ts +0 -1
- package/es/components/booking/components/footer/utils.js +1 -1
- package/es/components/booking/components/voucher/index.js +2 -2
- package/es/components/booking/info/service2/utils.d.ts +1 -1
- package/es/components/booking/info/service2/utils.js +2 -3
- package/es/components/booking/info2/service/addService/utils.d.ts +0 -10
- package/es/components/booking/info2/service/addService/utils.js +13 -44
- package/es/components/booking/info2/service/editService/Resources/index.js +8 -22
- package/es/components/booking/info2/service/editService/Resources/index.less +0 -6
- package/es/components/booking/info2/utilsByBooking.js +0 -9
- package/es/components/booking/locales.d.ts +0 -3
- package/es/components/booking/locales.js +0 -3
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/const.d.ts +1 -4
- package/es/components/eftposPay/const.js +1 -3
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +2 -2
- package/es/components/eftposPay/hooks.js +1 -3
- package/es/components/eftposPay/index.js +1 -1
- package/es/components/eftposPay/manufacturer.d.ts +0 -1
- package/es/components/eftposPay/manufacturer.js +0 -4
- package/es/components/eftposPay/pay.d.ts +1 -1
- package/es/components/eftposPay/pay.js +2 -6
- package/es/components/eftposPay/store/index.d.ts +4 -4
- package/es/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +17 -29
- package/es/components/eventBooking/components/Provider/Cart/Item/Total.js +6 -10
- package/es/components/eventBooking/components/Provider/Cart/Item/index.js +2 -4
- package/es/components/eventBooking/components/Provider/Event/index.js +4 -13
- package/es/components/eventBooking/components/bookingDetailModal/index.js +4 -22
- package/es/components/eventBooking/index.js +7 -21
- package/es/components/eventBooking/locales.d.ts +0 -24
- package/es/components/eventBooking/locales.js +6 -30
- package/es/components/index.d.ts +1 -3
- package/es/components/index.js +1 -3
- package/es/components/pay/toC/PaymentMethods/index.js +4 -5
- package/es/components/schedules/utils.d.ts +1 -1
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +1 -1
- package/es/components/ticketBooking/components/ticketBooking/index.d.ts +0 -1
- package/es/components/ticketBooking/components/ticketBooking/index.js +138 -257
- package/es/components/ticketBooking/locales.d.ts +146 -164
- package/es/components/ticketBooking/locales.js +147 -195
- package/es/index.d.ts +0 -2
- package/es/index.js +1 -3
- package/es/utils/index.d.ts +1 -1
- package/lib/businessModel/SalesModel/Sales/index.js +8 -22
- package/lib/components/Sales/Cart/index.js +0 -1
- package/lib/components/Sales/Cart/utils.d.ts +0 -40
- package/lib/components/Sales/Cart/utils.js +0 -117
- package/lib/components/Sales/Checkout/index.d.ts +0 -4
- package/lib/components/Sales/Checkout/index.js +7 -39
- package/lib/components/Sales/Checkout/serve.d.ts +0 -13
- package/lib/components/Sales/Checkout/serve.js +2 -7
- package/lib/components/Sales/Checkout/utils.js +0 -2
- package/lib/components/Sales/Resource/index.js +1 -1
- package/lib/components/Sales/Resource/serve.d.ts +0 -7
- package/lib/components/Sales/Resource/serve.js +2 -9
- package/lib/components/Sales/Summary/index.d.ts +0 -10
- package/lib/components/Sales/Summary/index.js +1 -7
- package/lib/components/Sales/Summary/serve.d.ts +0 -1
- package/lib/components/Sales/Summary/serve.js +0 -32
- package/lib/components/Sales/Summary/utils.d.ts +1 -16
- package/lib/components/Sales/Summary/utils.js +1 -30
- package/lib/components/appointmentBooking/components/Cart/Item/index.less +3 -3
- package/lib/components/appointmentBooking/components/Content/index.less +1 -1
- package/lib/components/appointmentBooking/components/Deposit/index.d.ts +0 -6
- package/lib/components/appointmentBooking/components/Deposit/index.js +4 -36
- package/lib/components/appointmentBooking/components/Services/index.js +11 -6
- package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.js +4 -8
- package/lib/components/appointmentBooking/deposit/index.js +2 -4
- package/lib/components/appointmentBooking/index.js +0 -11
- package/lib/components/appointmentBooking/index.less +1 -1
- package/lib/components/booking/components/footer/utils.d.ts +0 -1
- package/lib/components/booking/components/footer/utils.js +0 -2
- package/lib/components/booking/components/voucher/index.js +2 -2
- package/lib/components/booking/info/service2/utils.d.ts +1 -1
- package/lib/components/booking/info/service2/utils.js +2 -2
- package/lib/components/booking/info2/service/addService/utils.d.ts +0 -10
- package/lib/components/booking/info2/service/addService/utils.js +4 -27
- package/lib/components/booking/info2/service/editService/Resources/index.js +10 -54
- package/lib/components/booking/info2/service/editService/Resources/index.less +0 -6
- package/lib/components/booking/info2/utilsByBooking.js +0 -6
- package/lib/components/booking/locales.d.ts +0 -3
- package/lib/components/booking/locales.js +0 -3
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/const.d.ts +1 -4
- package/lib/components/eftposPay/const.js +0 -2
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +2 -2
- package/lib/components/eftposPay/hooks.js +4 -11
- package/lib/components/eftposPay/index.js +1 -1
- package/lib/components/eftposPay/manufacturer.d.ts +0 -1
- package/lib/components/eftposPay/manufacturer.js +0 -6
- package/lib/components/eftposPay/pay.d.ts +1 -1
- package/lib/components/eftposPay/pay.js +2 -13
- package/lib/components/eftposPay/store/index.d.ts +4 -4
- package/lib/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +3 -16
- package/lib/components/eventBooking/components/Provider/Cart/Item/Total.js +5 -8
- package/lib/components/eventBooking/components/Provider/Cart/Item/index.js +2 -4
- package/lib/components/eventBooking/components/Provider/Event/index.js +3 -10
- package/lib/components/eventBooking/components/bookingDetailModal/index.js +4 -10
- package/lib/components/eventBooking/index.js +7 -11
- package/lib/components/eventBooking/locales.d.ts +0 -24
- package/lib/components/eventBooking/locales.js +6 -30
- package/lib/components/index.d.ts +1 -3
- package/lib/components/index.js +0 -6
- package/lib/components/pay/toC/PaymentMethods/index.js +9 -10
- package/lib/components/schedules/utils.d.ts +1 -1
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +1 -1
- package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +0 -1
- package/lib/components/ticketBooking/components/ticketBooking/index.js +139 -263
- package/lib/components/ticketBooking/locales.d.ts +146 -164
- package/lib/components/ticketBooking/locales.js +4 -22
- package/lib/index.d.ts +0 -2
- package/lib/index.js +0 -6
- package/lib/utils/index.d.ts +1 -1
- package/package.json +3 -3
- package/es/components/booking/editBookingModal/index.d.ts +0 -5
- package/es/components/booking/editBookingModal/index.js +0 -386
- package/es/components/booking/editBookingModal/index.less +0 -8
- package/es/components/booking/editBookingModal/locales.d.ts +0 -21
- package/es/components/booking/editBookingModal/locales.js +0 -20
- package/es/components/booking/editBookingModal/mock.d.ts +0 -807
- package/es/components/booking/editBookingModal/mock.js +0 -2993
- package/es/components/booking/editBookingModal/serve.d.ts +0 -51
- package/es/components/booking/editBookingModal/serve.js +0 -288
- package/es/components/booking/editBookingModal/type.d.ts +0 -12
- package/es/components/booking/editBookingModal/type.js +0 -1
- package/es/components/booking/editBookingModal/utils.d.ts +0 -12
- package/es/components/booking/editBookingModal/utils.js +0 -157
- package/es/components/booking/info2/service/editService/ResourcesV2/MaxLengthSelect/index.d.ts +0 -7
- package/es/components/booking/info2/service/editService/ResourcesV2/MaxLengthSelect/index.js +0 -26
- package/es/components/booking/info2/service/editService/ResourcesV2/index.d.ts +0 -10
- package/es/components/booking/info2/service/editService/ResourcesV2/index.js +0 -308
- package/es/components/booking/info2/service/editService/ResourcesV2/index.less +0 -44
- package/es/components/eftposPay/linkly/const.d.ts +0 -23
- package/es/components/eftposPay/linkly/const.js +0 -82
- package/es/components/eftposPay/linkly/hooks/index.d.ts +0 -2
- package/es/components/eftposPay/linkly/hooks/index.js +0 -2
- package/es/components/eftposPay/linkly/hooks/normal.d.ts +0 -30
- package/es/components/eftposPay/linkly/hooks/normal.js +0 -318
- package/es/components/eftposPay/linkly/hooks/useTimeQuery.d.ts +0 -4
- package/es/components/eftposPay/linkly/hooks/useTimeQuery.js +0 -273
- package/es/components/eftposPay/linkly/index.d.ts +0 -2
- package/es/components/eftposPay/linkly/index.js +0 -197
- package/es/components/eftposPay/linkly/service.d.ts +0 -32
- package/es/components/eftposPay/linkly/service.js +0 -73
- package/es/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +0 -2
- package/es/components/eventBooking/components/Provider/Cart/Deposit/index.js +0 -17
- package/es/components/stepController/components/Content/index.d.ts +0 -7
- package/es/components/stepController/components/Content/index.js +0 -9
- package/es/components/stepController/components/Content/index.less +0 -8
- package/es/components/stepController/components/Footer/index.d.ts +0 -8
- package/es/components/stepController/components/Footer/index.js +0 -15
- package/es/components/stepController/components/Footer/index.less +0 -39
- package/es/components/stepController/components/Header/index.d.ts +0 -20
- package/es/components/stepController/components/Header/index.js +0 -97
- package/es/components/stepController/components/Header/index.less +0 -21
- package/es/components/stepController/index.d.ts +0 -5
- package/es/components/stepController/index.js +0 -64
- package/es/components/stepController/index.less +0 -11
- package/es/components/stepController/locales.d.ts +0 -27
- package/es/components/stepController/locales.js +0 -32
- package/es/components/stepController/types.d.ts +0 -23
- package/es/components/stepController/types.js +0 -1
- package/es/components/ticketBooking/utils/formatProductMessage.d.ts +0 -2
- package/es/components/ticketBooking/utils/formatProductMessage.js +0 -62
- package/es/components/ticketBooking/utils/formatTime.d.ts +0 -31
- package/es/components/ticketBooking/utils/formatTime.js +0 -144
- package/es/hooks/useWindowSize.d.ts +0 -5
- package/es/hooks/useWindowSize.js +0 -26
- package/lib/components/booking/editBookingModal/index.d.ts +0 -5
- package/lib/components/booking/editBookingModal/index.js +0 -363
- package/lib/components/booking/editBookingModal/index.less +0 -8
- package/lib/components/booking/editBookingModal/locales.d.ts +0 -21
- package/lib/components/booking/editBookingModal/locales.js +0 -44
- package/lib/components/booking/editBookingModal/mock.d.ts +0 -807
- package/lib/components/booking/editBookingModal/mock.js +0 -3314
- package/lib/components/booking/editBookingModal/serve.d.ts +0 -51
- package/lib/components/booking/editBookingModal/serve.js +0 -178
- package/lib/components/booking/editBookingModal/type.d.ts +0 -12
- package/lib/components/booking/editBookingModal/type.js +0 -17
- package/lib/components/booking/editBookingModal/utils.d.ts +0 -12
- package/lib/components/booking/editBookingModal/utils.js +0 -158
- package/lib/components/booking/info2/service/editService/ResourcesV2/MaxLengthSelect/index.d.ts +0 -7
- package/lib/components/booking/info2/service/editService/ResourcesV2/MaxLengthSelect/index.js +0 -53
- package/lib/components/booking/info2/service/editService/ResourcesV2/index.d.ts +0 -10
- package/lib/components/booking/info2/service/editService/ResourcesV2/index.js +0 -311
- package/lib/components/booking/info2/service/editService/ResourcesV2/index.less +0 -44
- package/lib/components/eftposPay/linkly/const.d.ts +0 -23
- package/lib/components/eftposPay/linkly/const.js +0 -102
- package/lib/components/eftposPay/linkly/hooks/index.d.ts +0 -2
- package/lib/components/eftposPay/linkly/hooks/index.js +0 -25
- package/lib/components/eftposPay/linkly/hooks/normal.d.ts +0 -30
- package/lib/components/eftposPay/linkly/hooks/normal.js +0 -239
- package/lib/components/eftposPay/linkly/hooks/useTimeQuery.d.ts +0 -4
- package/lib/components/eftposPay/linkly/hooks/useTimeQuery.js +0 -222
- package/lib/components/eftposPay/linkly/index.d.ts +0 -2
- package/lib/components/eftposPay/linkly/index.js +0 -208
- package/lib/components/eftposPay/linkly/service.d.ts +0 -32
- package/lib/components/eftposPay/linkly/service.js +0 -55
- package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +0 -2
- package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.js +0 -55
- package/lib/components/stepController/components/Content/index.d.ts +0 -7
- package/lib/components/stepController/components/Content/index.js +0 -40
- package/lib/components/stepController/components/Content/index.less +0 -8
- package/lib/components/stepController/components/Footer/index.d.ts +0 -8
- package/lib/components/stepController/components/Footer/index.js +0 -49
- package/lib/components/stepController/components/Footer/index.less +0 -39
- package/lib/components/stepController/components/Header/index.d.ts +0 -20
- package/lib/components/stepController/components/Header/index.js +0 -104
- package/lib/components/stepController/components/Header/index.less +0 -21
- package/lib/components/stepController/index.d.ts +0 -5
- package/lib/components/stepController/index.js +0 -89
- package/lib/components/stepController/index.less +0 -11
- package/lib/components/stepController/locales.d.ts +0 -27
- package/lib/components/stepController/locales.js +0 -50
- package/lib/components/stepController/types.d.ts +0 -23
- package/lib/components/stepController/types.js +0 -17
- package/lib/components/ticketBooking/utils/formatProductMessage.d.ts +0 -2
- package/lib/components/ticketBooking/utils/formatProductMessage.js +0 -84
- package/lib/components/ticketBooking/utils/formatTime.d.ts +0 -31
- package/lib/components/ticketBooking/utils/formatTime.js +0 -139
- package/lib/hooks/useWindowSize.d.ts +0 -5
- package/lib/hooks/useWindowSize.js +0 -51
- package/lowcode/edit-booking-modal/meta.ts +0 -53
- package/lowcode/step-controller/meta.ts +0 -88
|
@@ -10,11 +10,6 @@ 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
|
-
};
|
|
18
13
|
}
|
|
19
14
|
/**
|
|
20
15
|
* 计算商品小计(不含其他费用)
|
|
@@ -30,7 +25,7 @@ export declare const calculateSubtotal: (items: CartItem[]) => string;
|
|
|
30
25
|
* @return {*}
|
|
31
26
|
* @Author: xiangfeng.xue
|
|
32
27
|
*/
|
|
33
|
-
export declare const calculateTaxFee: (shopInfo: any, items: CartItem[]) => "0.00"
|
|
28
|
+
export declare const calculateTaxFee: (shopInfo: any, items: CartItem[]) => Decimal | "0.00";
|
|
34
29
|
/**
|
|
35
30
|
* 计算所有价格明细
|
|
36
31
|
* @param items - 购物车商品数组
|
|
@@ -38,14 +33,4 @@ export declare const calculateTaxFee: (shopInfo: any, items: CartItem[]) => "0.0
|
|
|
38
33
|
* @returns 价格明细对象
|
|
39
34
|
*/
|
|
40
35
|
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;
|
|
51
36
|
export {};
|
|
@@ -54,53 +54,11 @@ 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);
|
|
60
57
|
return {
|
|
61
58
|
subtotal: subtotal.toFixed(2),
|
|
62
59
|
total: total.toFixed(2),
|
|
63
60
|
taxTitle: shopInfo === null || shopInfo === void 0 ? void 0 : shopInfo.tax_title,
|
|
64
61
|
totalTaxFee: totalTaxFee.toFixed(2),
|
|
65
|
-
isPriceIncludeTax: shopInfo === null || shopInfo === void 0 ? void 0 : shopInfo.is_price_include_tax
|
|
66
|
-
deposit: deposit
|
|
62
|
+
isPriceIncludeTax: shopInfo === null || shopInfo === void 0 ? void 0 : shopInfo.is_price_include_tax
|
|
67
63
|
};
|
|
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;
|
|
106
64
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
.appointment-cart-item-wrap {
|
|
2
|
-
height: calc(
|
|
2
|
+
height: calc(100vh - 100px);
|
|
3
3
|
display: flex;
|
|
4
4
|
flex-direction: column;
|
|
5
5
|
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
flex-direction: column;
|
|
40
40
|
align-items: start;
|
|
41
41
|
|
|
42
|
-
>
|
|
42
|
+
>div {
|
|
43
43
|
display: flex;
|
|
44
44
|
align-items: center;
|
|
45
45
|
justify-content: space-between;
|
|
@@ -105,4 +105,4 @@
|
|
|
105
105
|
flex: none;
|
|
106
106
|
z-index: 10;
|
|
107
107
|
}
|
|
108
|
-
}
|
|
108
|
+
}
|
|
@@ -1,9 +1,3 @@
|
|
|
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;
|
|
8
2
|
declare const Deposit: () => JSX.Element;
|
|
9
3
|
export default Deposit;
|
|
@@ -4,11 +4,12 @@ import AppointmentDeposit from "../../deposit";
|
|
|
4
4
|
import { useAppointmentBookingContext } from "../../context";
|
|
5
5
|
import { locales } from '@pisell/utils';
|
|
6
6
|
import "./index.less";
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
setIsAgreeDepositPolicy =
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
var Deposit = function Deposit() {
|
|
8
|
+
var _useAppointmentBookin = useAppointmentBookingContext(),
|
|
9
|
+
setIsAgreeDepositPolicy = _useAppointmentBookin.setIsAgreeDepositPolicy,
|
|
10
|
+
isAgreeDepositPolicy = _useAppointmentBookin.isAgreeDepositPolicy,
|
|
11
|
+
summary = _useAppointmentBookin.summary;
|
|
12
|
+
var deposit = summary.deposit;
|
|
12
13
|
return /*#__PURE__*/React.createElement("div", {
|
|
13
14
|
className: "appointment-deposit-wrap"
|
|
14
15
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -23,28 +24,7 @@ export var DepositContent = function DepositContent(props) {
|
|
|
23
24
|
isAgreePolicy: isAgreeDepositPolicy,
|
|
24
25
|
onChange: function onChange(value) {
|
|
25
26
|
return setIsAgreeDepositPolicy(value);
|
|
26
|
-
}
|
|
27
|
-
depositProtocolRequest: depositProtocolRequest
|
|
27
|
+
}
|
|
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
|
-
};
|
|
50
30
|
export default Deposit;
|
|
@@ -85,7 +85,9 @@ var Services = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
85
85
|
return checkProductType(item === null || item === void 0 ? void 0 : item.id);
|
|
86
86
|
case 4:
|
|
87
87
|
type = _context2.sent;
|
|
88
|
-
|
|
88
|
+
if (type === 'session') {
|
|
89
|
+
appointmentBooking.openProductDetail(item.id);
|
|
90
|
+
}
|
|
89
91
|
case 6:
|
|
90
92
|
utils === null || utils === void 0 || utils.action({
|
|
91
93
|
type: 'pisell1.productDetail',
|
|
@@ -103,13 +105,6 @@ var Services = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
103
105
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
104
106
|
while (1) switch (_context.prev = _context.next) {
|
|
105
107
|
case 0:
|
|
106
|
-
if (!data.isCancel) {
|
|
107
|
-
_context.next = 3;
|
|
108
|
-
break;
|
|
109
|
-
}
|
|
110
|
-
appointmentBooking.closeProductDetail();
|
|
111
|
-
return _context.abrupt("return");
|
|
112
|
-
case 3:
|
|
113
108
|
product = _objectSpread(_objectSpread({}, data), {}, {
|
|
114
109
|
options: (data === null || data === void 0 ? void 0 : data.option) || []
|
|
115
110
|
});
|
|
@@ -117,21 +112,31 @@ var Services = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
117
112
|
|
|
118
113
|
// 零售模版,直接加入购物车
|
|
119
114
|
if (!isRetailTemplate) {
|
|
120
|
-
_context.next =
|
|
115
|
+
_context.next = 7;
|
|
121
116
|
break;
|
|
122
117
|
}
|
|
123
118
|
if (!(data !== null && data !== void 0 && data.isCancel)) {
|
|
124
|
-
_context.next =
|
|
119
|
+
_context.next = 5;
|
|
125
120
|
break;
|
|
126
121
|
}
|
|
127
122
|
return _context.abrupt("return");
|
|
128
|
-
case
|
|
123
|
+
case 5:
|
|
129
124
|
appointmentBooking.storeProduct(product);
|
|
130
125
|
return _context.abrupt("return");
|
|
126
|
+
case 7:
|
|
127
|
+
if (!(data !== null && data !== void 0 && data.isCancel)) {
|
|
128
|
+
_context.next = 10;
|
|
129
|
+
break;
|
|
130
|
+
}
|
|
131
|
+
if (type === 'session') {
|
|
132
|
+
appointmentBooking.closeProductDetail();
|
|
133
|
+
appointmentBooking.getAvailableDate();
|
|
134
|
+
}
|
|
135
|
+
return _context.abrupt("return");
|
|
131
136
|
case 10:
|
|
132
137
|
session = data === null || data === void 0 ? void 0 : data.session;
|
|
133
138
|
if (!session) {
|
|
134
|
-
_context.next =
|
|
139
|
+
_context.next = 20;
|
|
135
140
|
break;
|
|
136
141
|
}
|
|
137
142
|
startDate = dayjs(session === null || session === void 0 ? void 0 : session.start_at).format('YYYY-MM-DD');
|
|
@@ -143,36 +148,35 @@ var Services = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
143
148
|
endTime: "".concat(endDate, " ").concat(session === null || session === void 0 ? void 0 : session.end_time)
|
|
144
149
|
}
|
|
145
150
|
});
|
|
146
|
-
|
|
151
|
+
appointmentBooking.closeProductDetail();
|
|
152
|
+
_context.next = 18;
|
|
147
153
|
return appointmentBooking.getAvailableDate({
|
|
148
154
|
startDate: startDate,
|
|
149
155
|
endDate: endDate
|
|
150
156
|
});
|
|
151
|
-
case
|
|
152
|
-
_context.next =
|
|
157
|
+
case 18:
|
|
158
|
+
_context.next = 28;
|
|
153
159
|
break;
|
|
154
|
-
case
|
|
160
|
+
case 20:
|
|
155
161
|
resources = (data === null || data === void 0 || (_data$origin = data.origin) === null || _data$origin === void 0 || (_data$origin = _data$origin.product_resource) === null || _data$origin === void 0 ? void 0 : _data$origin.resources) || [];
|
|
156
162
|
activeStatus = resources.find(function (item) {
|
|
157
163
|
return item.status === 1;
|
|
158
164
|
});
|
|
159
165
|
if (!(!activeStatus && !appointmentBooking.isTargetNormalProduct(data === null || data === void 0 ? void 0 : data.origin))) {
|
|
160
|
-
_context.next =
|
|
166
|
+
_context.next = 24;
|
|
161
167
|
break;
|
|
162
168
|
}
|
|
163
169
|
return _context.abrupt("return", Toast(locales.getText('pisell2.appointment.no.available.service')));
|
|
164
|
-
case
|
|
170
|
+
case 24:
|
|
165
171
|
appointmentBooking.storeProduct(product);
|
|
166
172
|
// duration 类型的商品,要获取一下资源,在先选日期的 duration 步骤里目前只能通过这个动作拉取
|
|
167
173
|
if (!(type === 'duration')) {
|
|
168
|
-
_context.next =
|
|
174
|
+
_context.next = 28;
|
|
169
175
|
break;
|
|
170
176
|
}
|
|
171
|
-
_context.next =
|
|
177
|
+
_context.next = 28;
|
|
172
178
|
return appointmentBooking.getAvailableDate();
|
|
173
|
-
case
|
|
174
|
-
appointmentBooking.closeProductDetail();
|
|
175
|
-
|
|
179
|
+
case 28:
|
|
176
180
|
// 先选择日期流程
|
|
177
181
|
if (isDateSelectedFirst) {
|
|
178
182
|
index = (currentStep === null || currentStep === void 0 ? void 0 : currentStep.index) + 2; //先选择日期流程:如果商品类型是duration的商品,则需要增加选择时间步骤
|
|
@@ -12,6 +12,7 @@ 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";
|
|
15
16
|
import "./index.less";
|
|
16
17
|
var DepositModal = function DepositModal(props) {
|
|
17
18
|
var open = props.open,
|
|
@@ -20,8 +21,9 @@ var DepositModal = function DepositModal(props) {
|
|
|
20
21
|
onChange = props.onChange,
|
|
21
22
|
onConfirm = props.onConfirm,
|
|
22
23
|
_props$isHideCheckout = props.isHideCheckout,
|
|
23
|
-
isHideCheckout = _props$isHideCheckout === void 0 ? true : _props$isHideCheckout
|
|
24
|
-
|
|
24
|
+
isHideCheckout = _props$isHideCheckout === void 0 ? true : _props$isHideCheckout;
|
|
25
|
+
var _useAppointmentBookin = useAppointmentBookingContext(),
|
|
26
|
+
appointmentBooking = _useAppointmentBookin.appointmentBooking;
|
|
25
27
|
var _useState = useState(null),
|
|
26
28
|
_useState2 = _slicedToArray(_useState, 2),
|
|
27
29
|
policy = _useState2[0],
|
|
@@ -48,42 +50,35 @@ var DepositModal = function DepositModal(props) {
|
|
|
48
50
|
*/
|
|
49
51
|
var getPolicy = /*#__PURE__*/function () {
|
|
50
52
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(id) {
|
|
51
|
-
var _yield$
|
|
53
|
+
var _yield$appointmentBoo, data;
|
|
52
54
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
53
55
|
while (1) switch (_context.prev = _context.next) {
|
|
54
56
|
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:
|
|
62
57
|
setLoading(true);
|
|
63
|
-
_context.prev =
|
|
64
|
-
_context.next =
|
|
65
|
-
return
|
|
66
|
-
case
|
|
67
|
-
_yield$
|
|
68
|
-
data = _yield$
|
|
58
|
+
_context.prev = 1;
|
|
59
|
+
_context.next = 4;
|
|
60
|
+
return appointmentBooking.getProtocol(id);
|
|
61
|
+
case 4:
|
|
62
|
+
_yield$appointmentBoo = _context.sent;
|
|
63
|
+
data = _yield$appointmentBoo.data;
|
|
69
64
|
setPolicy(data);
|
|
70
65
|
onChange && onChange(data);
|
|
71
|
-
_context.next =
|
|
66
|
+
_context.next = 14;
|
|
72
67
|
break;
|
|
73
|
-
case
|
|
74
|
-
_context.prev =
|
|
75
|
-
_context.t0 = _context["catch"](
|
|
68
|
+
case 10:
|
|
69
|
+
_context.prev = 10;
|
|
70
|
+
_context.t0 = _context["catch"](1);
|
|
76
71
|
console.log(_context.t0);
|
|
77
72
|
onChange && onChange(_context.t0);
|
|
78
|
-
case
|
|
79
|
-
_context.prev =
|
|
73
|
+
case 14:
|
|
74
|
+
_context.prev = 14;
|
|
80
75
|
setLoading(false);
|
|
81
|
-
return _context.finish(
|
|
82
|
-
case
|
|
76
|
+
return _context.finish(14);
|
|
77
|
+
case 17:
|
|
83
78
|
case "end":
|
|
84
79
|
return _context.stop();
|
|
85
80
|
}
|
|
86
|
-
}, _callee, null, [[
|
|
81
|
+
}, _callee, null, [[1, 10, 14, 17]]);
|
|
87
82
|
}));
|
|
88
83
|
return function getPolicy(_x) {
|
|
89
84
|
return _ref.apply(this, arguments);
|
|
@@ -21,8 +21,7 @@ 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
|
|
25
|
-
depositProtocolRequest = props.depositProtocolRequest;
|
|
24
|
+
onChange = props.onChange;
|
|
26
25
|
var context = useEngineContext();
|
|
27
26
|
// 打开协议弹窗
|
|
28
27
|
var _useState = useState(false),
|
|
@@ -96,8 +95,7 @@ var Deposit = function Deposit(props) {
|
|
|
96
95
|
onCancel: function onCancel() {
|
|
97
96
|
return setVisible(false);
|
|
98
97
|
},
|
|
99
|
-
item: policyItem
|
|
100
|
-
depositProtocolRequest: depositProtocolRequest
|
|
98
|
+
item: policyItem
|
|
101
99
|
}));
|
|
102
100
|
};
|
|
103
101
|
export default Deposit;
|
|
@@ -27,20 +27,6 @@ var AppointmentBooking = function AppointmentBooking() {
|
|
|
27
27
|
}
|
|
28
28
|
});
|
|
29
29
|
}, []);
|
|
30
|
-
useEffect(function () {
|
|
31
|
-
var setRealVH = function setRealVH() {
|
|
32
|
-
// window.innerHeight 会返回视口真实的高度(不包括工具栏)
|
|
33
|
-
var vh = window.innerHeight * 0.01;
|
|
34
|
-
document.documentElement.style.setProperty('--vh', "".concat(vh, "px"));
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
// 页面加载和窗口大小变化时都重新计算
|
|
38
|
-
setRealVH();
|
|
39
|
-
window.addEventListener('resize', setRealVH);
|
|
40
|
-
return function () {
|
|
41
|
-
window.removeEventListener('resize', setRealVH);
|
|
42
|
-
};
|
|
43
|
-
}, []);
|
|
44
30
|
return /*#__PURE__*/React.createElement("div", {
|
|
45
31
|
className: "parallel-booking-wrap ".concat(isMobile() ? 'parallel-booking-mobile-wrap' : '')
|
|
46
32
|
}, /*#__PURE__*/React.createElement(AppointmentBookingProvider, null, /*#__PURE__*/React.createElement(Content, null)));
|
|
@@ -27,7 +27,6 @@ export interface ResourceItem {
|
|
|
27
27
|
* @Author: jinglin.tan
|
|
28
28
|
*/
|
|
29
29
|
export declare const checkSubResourcesCapacity: (resource: ResourceItem) => void;
|
|
30
|
-
export declare const checkResourcesFormat: (resources: any[], service: any, isChild?: boolean) => any[];
|
|
31
30
|
/**
|
|
32
31
|
* @title: 格式化商品单价
|
|
33
32
|
* @description:
|
|
@@ -152,7 +152,7 @@ export var checkSubResourcesCapacity = function checkSubResourcesCapacity(resour
|
|
|
152
152
|
});
|
|
153
153
|
}
|
|
154
154
|
};
|
|
155
|
-
|
|
155
|
+
var checkResourcesFormat = function checkResourcesFormat(resources, service, isChild) {
|
|
156
156
|
return resources.map(function (resource) {
|
|
157
157
|
var _resource$children;
|
|
158
158
|
if (!isChild) {
|
|
@@ -26,8 +26,8 @@ import useEngineContext from "../../../../hooks/useEngineContext";
|
|
|
26
26
|
import { PisellInput, PisellGoodPassCard, PisellToast } from '@pisell/materials';
|
|
27
27
|
import { useIsBooking4Shop } from "../../hooks/useIsBooking4Shop";
|
|
28
28
|
import "./index.less";
|
|
29
|
-
import { useMemoizedFn, useDebounceFn, useDebounceEffect } from 'ahooks';
|
|
30
29
|
import { getServiceAddons } from "./utils";
|
|
30
|
+
import { useMemoizedFn, useDebounceFn, useDebounceEffect } from 'ahooks';
|
|
31
31
|
var ShopDiscountHooks = {
|
|
32
32
|
onInited: 'shopDiscount:onInited',
|
|
33
33
|
onDestroy: 'shopDiscount:onDestroy',
|
|
@@ -275,8 +275,8 @@ var VoucherCard = function VoucherCard(props) {
|
|
|
275
275
|
style: {
|
|
276
276
|
width: '100%'
|
|
277
277
|
},
|
|
278
|
-
dataSource: (_state$service2 = state.service) !== null && _state$service2 !== void 0 && (_state$service2 = _state$service2.value) !== null && _state$service2 !== void 0 && _state$service2.length ? availableData : [],
|
|
279
278
|
mixedSort: mixedSort,
|
|
279
|
+
dataSource: (_state$service2 = state.service) !== null && _state$service2 !== void 0 && (_state$service2 = _state$service2.value) !== null && _state$service2 !== void 0 && _state$service2.length ? availableData : [],
|
|
280
280
|
onChange: function onChange(val) {
|
|
281
281
|
var shopDiscount = pisellos.getModule('shopDiscount');
|
|
282
282
|
var detail = shopDiscount.setDiscountSelected({
|
|
@@ -244,4 +244,4 @@ export declare const updateAppointmentServicePrice: (state: any, { start_date, e
|
|
|
244
244
|
* @Author: WangHan
|
|
245
245
|
* @Date: 2024-12-24 11:32
|
|
246
246
|
*/
|
|
247
|
-
export declare const updateServicePrice: (state: any) => Promise<any
|
|
247
|
+
export declare const updateServicePrice: (state: any) => never[] | Promise<any>;
|
|
@@ -495,8 +495,7 @@ var getAllErrorList = function getAllErrorList(item) {
|
|
|
495
495
|
var _ref4 = item._data || {},
|
|
496
496
|
resourceMaps = _ref4.resourceMaps;
|
|
497
497
|
var _ref5 = item._extend || {},
|
|
498
|
-
|
|
499
|
-
resource = _ref5$resource === void 0 ? {} : _ref5$resource;
|
|
498
|
+
resource = _ref5.resource;
|
|
500
499
|
var errorList = [];
|
|
501
500
|
Object.entries(resource).forEach(function (_ref6) {
|
|
502
501
|
var _ref7 = _slicedToArray(_ref6, 2),
|
|
@@ -516,7 +515,7 @@ var mapListItems = function mapListItems(items) {
|
|
|
516
515
|
return {
|
|
517
516
|
id: item.id || item.form_record_id,
|
|
518
517
|
label: item.labelText,
|
|
519
|
-
isError: !item.usable
|
|
518
|
+
isError: !item.usable
|
|
520
519
|
};
|
|
521
520
|
});
|
|
522
521
|
};
|
|
@@ -69,16 +69,6 @@ export declare const setDefaultResource: ({ cacheItem, resources }: any) => any;
|
|
|
69
69
|
* @Date: 2024-09-19 20:26
|
|
70
70
|
*/
|
|
71
71
|
export declare const setDefaultCapacitys: ({ capacitys, cacheItem }: any) => any;
|
|
72
|
-
/**
|
|
73
|
-
* @title: 将商品内关联的资源id还原成数据
|
|
74
|
-
* @description:
|
|
75
|
-
* @param {any} resourcesOriginMap
|
|
76
|
-
* @param {any} cacheItem
|
|
77
|
-
* @return {*}
|
|
78
|
-
* @Author: zhiwei.Wang
|
|
79
|
-
* @Date: 2024-09-19 20:23
|
|
80
|
-
*/
|
|
81
|
-
export declare const getResourceByIds: (resourcesOriginMap: any, cacheItem: any, extraParams?: any) => any[];
|
|
82
72
|
/**
|
|
83
73
|
* @title: 预生成服务的 extend
|
|
84
74
|
* @description:
|
|
@@ -179,23 +179,14 @@ export var formatResources = function formatResources(_ref5) {
|
|
|
179
179
|
var _item = cloneDeep(item);
|
|
180
180
|
_item.renderList = _item.renderList.map(function (d) {
|
|
181
181
|
var res = formatResource(d, _cacheItem, function (newData) {
|
|
182
|
-
var unbound = !item.optional_resource.includes(newData.id) && !item.default_resource.includes(newData.id) && newData.id !== 0;
|
|
183
182
|
return /*#__PURE__*/React.createElement("div", {
|
|
184
183
|
className: "resource-option"
|
|
185
184
|
}, /*#__PURE__*/React.createElement("div", {
|
|
186
185
|
className: "like-wrap"
|
|
187
|
-
}), /*#__PURE__*/React.createElement(
|
|
188
|
-
className: "resource-option-label-text"
|
|
189
|
-
}, newData.labelText), (!newData.usable || unbound) && /*#__PURE__*/React.createElement(AlertTriangle, {
|
|
186
|
+
}), newData.labelText, !newData.usable && /*#__PURE__*/React.createElement(AlertTriangle, {
|
|
190
187
|
className: "resource-option-alert-icon"
|
|
191
188
|
}));
|
|
192
189
|
});
|
|
193
|
-
// 平行资源日历拖拽需求
|
|
194
|
-
// 当拖入为绑定的资源中时,为了展示,会临时创建目标资源对应的resourceItem
|
|
195
|
-
// 但是在 item.optional_resource 中并不包含目标资源id
|
|
196
|
-
if (!item.optional_resource.includes(d.id) && !item.default_resource.includes(d.id) && d.id !== 0) {
|
|
197
|
-
res.unbound = true;
|
|
198
|
-
}
|
|
199
190
|
renderListMaps[res.id] = res;
|
|
200
191
|
return res;
|
|
201
192
|
}).sort(function (a, b) {
|
|
@@ -365,12 +356,10 @@ export var setDefaultCapacitys = function setDefaultCapacitys(_ref7) {
|
|
|
365
356
|
* @Author: zhiwei.Wang
|
|
366
357
|
* @Date: 2024-09-19 20:23
|
|
367
358
|
*/
|
|
368
|
-
|
|
359
|
+
var getResourceByIds = function getResourceByIds(resourcesOriginMap, cacheItem) {
|
|
369
360
|
var _cacheItem$product_re;
|
|
370
361
|
var _resources = _toConsumableArray((cacheItem === null || cacheItem === void 0 || (_cacheItem$product_re = cacheItem.product_resource) === null || _cacheItem$product_re === void 0 ? void 0 : _cacheItem$product_re.resources) || []);
|
|
371
|
-
|
|
372
|
-
_ref8$extraResources = _ref8.extraResources,
|
|
373
|
-
extraResources = _ref8$extraResources === void 0 ? [] : _ref8$extraResources;
|
|
362
|
+
|
|
374
363
|
// 过滤出开启的资源
|
|
375
364
|
_resources = _resources.filter(function (d) {
|
|
376
365
|
return d.status == 1;
|
|
@@ -382,14 +371,6 @@ export var getResourceByIds = function getResourceByIds(resourcesOriginMap, cach
|
|
|
382
371
|
var item = _step2.value;
|
|
383
372
|
var form_id = item.id;
|
|
384
373
|
|
|
385
|
-
// 将未绑定的资源,也放入 SelectOption 列表,避免出现仅展示id的情况
|
|
386
|
-
var extraResourceIds = extraResources.filter(function (_extraItem) {
|
|
387
|
-
return _extraItem.form_id === form_id && !item.optional_resource.includes(_extraItem.id) && !item.default_resource.includes(_extraItem.id);
|
|
388
|
-
}).map(function (_extraItem) {
|
|
389
|
-
return _extraItem.id;
|
|
390
|
-
});
|
|
391
|
-
extraResourceIds = Array.from(new Set(extraResourceIds));
|
|
392
|
-
|
|
393
374
|
// 去重
|
|
394
375
|
item.optional_resource = (item.optional_resource || []).filter(function (d) {
|
|
395
376
|
return item.default_resource.indexOf(d) == -1;
|
|
@@ -412,7 +393,7 @@ export var getResourceByIds = function getResourceByIds(resourcesOriginMap, cach
|
|
|
412
393
|
};
|
|
413
394
|
|
|
414
395
|
// 可选项
|
|
415
|
-
var optional_resource =
|
|
396
|
+
var optional_resource = item.optional_resource.map(function (d) {
|
|
416
397
|
if (!resourcesOriginMap[d]) {
|
|
417
398
|
return null;
|
|
418
399
|
}
|
|
@@ -473,10 +454,10 @@ var getIsAutoClose = function getIsAutoClose(cacheItem) {
|
|
|
473
454
|
}
|
|
474
455
|
}
|
|
475
456
|
}
|
|
476
|
-
return Object.entries(cacheItem._extend.resource).every(function (
|
|
477
|
-
var
|
|
478
|
-
key =
|
|
479
|
-
value =
|
|
457
|
+
return Object.entries(cacheItem._extend.resource).every(function (_ref8) {
|
|
458
|
+
var _ref9 = _slicedToArray(_ref8, 2),
|
|
459
|
+
key = _ref9[0],
|
|
460
|
+
value = _ref9[1];
|
|
480
461
|
return getAutoAllocationStorage(key) && (value === null || value === void 0 ? void 0 : value.length);
|
|
481
462
|
});
|
|
482
463
|
};
|
|
@@ -489,10 +470,10 @@ var getIsAutoClose = function getIsAutoClose(cacheItem) {
|
|
|
489
470
|
* @Author: zhiwei.Wang
|
|
490
471
|
* @Date: 2024-06-01 13:25
|
|
491
472
|
*/
|
|
492
|
-
export var getProductExtend = function getProductExtend(
|
|
493
|
-
var cacheItem =
|
|
494
|
-
state =
|
|
495
|
-
isDisabledTime =
|
|
473
|
+
export var getProductExtend = function getProductExtend(_ref10) {
|
|
474
|
+
var cacheItem = _ref10.cacheItem,
|
|
475
|
+
state = _ref10.state,
|
|
476
|
+
isDisabledTime = _ref10.isDisabledTime;
|
|
496
477
|
// 有endDate 说明是在编辑已经保存过的商品, 没有则是编辑还没保存过的商品
|
|
497
478
|
var isNew = cacheItem.new || !cacheItem._extend.endDate;
|
|
498
479
|
var _cacheItem = _objectSpread({}, cacheItem);
|
|
@@ -589,19 +570,7 @@ export var getProductExtend = function getProductExtend(_ref11) {
|
|
|
589
570
|
_cacheItem._data.capacitys = cacheItem.capacity;
|
|
590
571
|
}
|
|
591
572
|
if (!_cacheItem._data.resourcesOrigin) {
|
|
592
|
-
|
|
593
|
-
// 日历中可以将预约拖入未绑定的资源中,需要兼容未绑定资源的 selectOption展示
|
|
594
|
-
if (Array.isArray(_cacheItem._extend.event_resources)) {
|
|
595
|
-
_cacheItem._extend.event_resources.forEach(function (_item) {
|
|
596
|
-
extraResources.push({
|
|
597
|
-
form_id: _item.form_id,
|
|
598
|
-
id: _item.relation_id
|
|
599
|
-
});
|
|
600
|
-
});
|
|
601
|
-
}
|
|
602
|
-
_cacheItem._data.resourcesOrigin = getResourceByIds(resourcesOriginMap, cacheItem, {
|
|
603
|
-
extraResources: extraResources
|
|
604
|
-
});
|
|
573
|
+
_cacheItem._data.resourcesOrigin = getResourceByIds(resourcesOriginMap, cacheItem);
|
|
605
574
|
}
|
|
606
575
|
if (!_cacheItem._data.resources) {
|
|
607
576
|
// 资源
|