@pisell/private-materials 3.2.21 → 3.2.23
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 +8 -8
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +8 -8
- package/es/components/appointmentBooking/assets/guests.svg +1 -0
- package/es/components/appointmentBooking/components/Cart/ContinueButton/index.js +83 -104
- package/es/components/appointmentBooking/components/Cart/Item/Total.js +1 -0
- package/es/components/appointmentBooking/components/Cart/Item/index.js +36 -17
- package/es/components/appointmentBooking/components/Cart/Item/index.less +7 -4
- package/es/components/appointmentBooking/components/Cart/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Content/index.js +11 -11
- package/es/components/appointmentBooking/components/Date/index.js +49 -32
- package/es/components/appointmentBooking/components/Date/index.less +5 -0
- package/es/components/appointmentBooking/components/Guest/index.js +8 -21
- package/es/components/appointmentBooking/components/Header/index.js +44 -7
- package/es/components/appointmentBooking/components/Resource/index.d.ts +1 -1
- package/es/components/appointmentBooking/components/Resource/index.js +28 -20
- package/es/components/appointmentBooking/components/Resource/index.less +5 -0
- package/es/components/appointmentBooking/components/Services/index.js +20 -9
- package/es/components/appointmentBooking/components/TimeSlicing/index.js +47 -32
- package/es/components/appointmentBooking/components/TimeSlicing/index.less +4 -0
- package/es/components/appointmentBooking/components/Voucher/index.d.ts +4 -0
- package/es/components/appointmentBooking/components/Voucher/index.js +238 -0
- package/es/components/appointmentBooking/components/Voucher/index.less +26 -0
- package/es/components/appointmentBooking/context.d.ts +2 -0
- package/es/components/appointmentBooking/context.js +7 -1
- package/es/components/appointmentBooking/hooks.d.ts +46 -9
- package/es/components/appointmentBooking/hooks.js +162 -121
- package/es/components/appointmentBooking/index.js +12 -7
- package/es/components/appointmentBooking/locales.d.ts +57 -0
- package/es/components/appointmentBooking/locales.js +60 -3
- package/es/components/appointmentBooking/utils.d.ts +19 -0
- package/es/components/appointmentBooking/utils.js +71 -2
- package/es/components/booking/addons/index.js +1 -0
- package/es/components/booking/components/TabProduct/index.d.ts +1 -0
- package/es/components/booking/components/TabProduct/productItem/index.d.ts +1 -0
- package/es/components/booking/components/footer/index.js +5 -1
- package/es/components/booking/components/footer/utils.js +18 -2
- package/es/components/booking/components/voucher/index.d.ts +3 -0
- package/es/components/booking/components/voucher/index.js +238 -0
- package/es/components/booking/components/voucher/index.less +88 -0
- package/es/components/booking/components/voucher/pisellGoodPassCard/index.d.ts +47 -0
- package/es/components/booking/components/voucher/pisellGoodPassCard/index.js +115 -0
- package/es/components/booking/components/voucher/pisellGoodPassCard/index.less +52 -0
- package/es/components/booking/hooks/useIsBooking4Shop.d.ts +1 -0
- package/es/components/booking/hooks/useIsBooking4Shop.js +10 -0
- package/es/components/booking/info/clientVariant/hooks/useClientFn.d.ts +1 -0
- package/es/components/booking/info/date/index.d.ts +1 -0
- package/es/components/booking/info/dateRange/index.d.ts +1 -0
- package/es/components/booking/info/notes/index.d.ts +1 -0
- package/es/components/booking/info/service/actions/index.d.ts +1 -0
- package/es/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
- package/es/components/booking/info/service/serviceItem/index.d.ts +1 -0
- package/es/components/booking/info/service/serviceList/index.d.ts +1 -0
- package/es/components/booking/info/service2/Lists.d.ts +1 -0
- package/es/components/booking/info/utils.js +1 -1
- package/es/components/booking/info2/service/actions/index.d.ts +1 -0
- package/es/components/booking/info2/service/editService/index.js +9 -0
- package/es/components/booking/info2/service/serviceItem/index.d.ts +1 -0
- package/es/components/booking/info2/service/serviceList/index.d.ts +1 -0
- package/es/components/booking/locales.d.ts +18 -0
- package/es/components/booking/locales.js +21 -3
- package/es/components/booking/materiels/duration/index.d.ts +1 -0
- package/es/components/booking/materiels/holder/index.d.ts +1 -0
- package/es/components/booking/materiels/startTime/index.d.ts +1 -0
- package/es/components/booking/payments/index.js +1 -0
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/eftposPay/hooks.d.ts +2 -2
- package/es/components/eftposPay/store/index.d.ts +6 -6
- package/es/components/eventBooking/components/Provider/Cart/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Information/index.d.ts +3 -0
- package/es/components/productExtension/fields/Actor/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
- package/es/components/shoppingCart/components/Cart/Product.js +3 -0
- package/es/components/shoppingCart/components/Cart/index.d.ts +1 -0
- package/es/components/shoppingCart/components/Empty/index.d.ts +1 -0
- package/es/components/shoppingCart/components/Render/index.d.ts +1 -0
- package/es/components/shoppingCart/hooks/useAddService.d.ts +1 -0
- package/es/components/shoppingCart/hooks/useClearCart.js +4 -3
- package/es/components/shoppingCart/index.d.ts +1 -0
- package/es/components/shoppingCart/type.d.ts +1 -0
- package/es/components/wallet/Detail/index.js +20 -14
- package/es/components/wallet/Voucher/index.js +1 -0
- package/es/components/wallet/index.js +15 -1
- package/es/components/wallet/locales.d.ts +3 -0
- package/es/components/wallet/locales.js +3 -0
- package/es/components/wallet/model.d.ts +1 -1
- package/es/components/wallet/utils/formatUtils.js +1 -1
- package/es/components/walletList/index.js +5 -1
- package/lib/components/appointmentBooking/assets/guests.svg +1 -0
- package/lib/components/appointmentBooking/components/Cart/ContinueButton/index.js +37 -27
- package/lib/components/appointmentBooking/components/Cart/Item/Total.js +1 -0
- package/lib/components/appointmentBooking/components/Cart/Item/index.js +24 -11
- package/lib/components/appointmentBooking/components/Cart/Item/index.less +7 -4
- package/lib/components/appointmentBooking/components/Cart/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Content/index.js +3 -5
- package/lib/components/appointmentBooking/components/Date/index.js +53 -47
- package/lib/components/appointmentBooking/components/Date/index.less +5 -0
- package/lib/components/appointmentBooking/components/Guest/index.js +6 -5
- package/lib/components/appointmentBooking/components/Header/index.js +25 -3
- package/lib/components/appointmentBooking/components/Resource/index.d.ts +1 -1
- package/lib/components/appointmentBooking/components/Resource/index.js +16 -17
- package/lib/components/appointmentBooking/components/Resource/index.less +5 -0
- package/lib/components/appointmentBooking/components/Services/index.js +21 -2
- package/lib/components/appointmentBooking/components/TimeSlicing/index.js +23 -21
- package/lib/components/appointmentBooking/components/TimeSlicing/index.less +4 -0
- package/lib/components/appointmentBooking/components/Voucher/index.d.ts +4 -0
- package/lib/components/appointmentBooking/components/Voucher/index.js +221 -0
- package/lib/components/appointmentBooking/components/Voucher/index.less +26 -0
- package/lib/components/appointmentBooking/context.d.ts +2 -0
- package/lib/components/appointmentBooking/context.js +4 -1
- package/lib/components/appointmentBooking/hooks.d.ts +46 -9
- package/lib/components/appointmentBooking/hooks.js +36 -43
- package/lib/components/appointmentBooking/index.js +11 -7
- package/lib/components/appointmentBooking/locales.d.ts +57 -0
- package/lib/components/appointmentBooking/locales.js +60 -3
- package/lib/components/appointmentBooking/utils.d.ts +19 -0
- package/lib/components/appointmentBooking/utils.js +42 -2
- package/lib/components/booking/addons/index.js +1 -1
- package/lib/components/booking/components/TabProduct/index.d.ts +1 -0
- package/lib/components/booking/components/TabProduct/productItem/index.d.ts +1 -0
- package/lib/components/booking/components/footer/index.js +2 -1
- package/lib/components/booking/components/footer/utils.js +4 -1
- package/lib/components/booking/components/voucher/index.d.ts +3 -0
- package/lib/components/booking/components/voucher/index.js +222 -0
- package/lib/components/booking/components/voucher/index.less +88 -0
- package/lib/components/booking/components/voucher/pisellGoodPassCard/index.d.ts +47 -0
- package/lib/components/booking/components/voucher/pisellGoodPassCard/index.js +109 -0
- package/lib/components/booking/components/voucher/pisellGoodPassCard/index.less +52 -0
- package/lib/components/booking/hooks/useIsBooking4Shop.d.ts +1 -0
- package/lib/components/booking/hooks/useIsBooking4Shop.js +51 -0
- package/lib/components/booking/info/clientVariant/hooks/useClientFn.d.ts +1 -0
- package/lib/components/booking/info/date/index.d.ts +1 -0
- package/lib/components/booking/info/dateRange/index.d.ts +1 -0
- package/lib/components/booking/info/notes/index.d.ts +1 -0
- package/lib/components/booking/info/service/actions/index.d.ts +1 -0
- package/lib/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
- package/lib/components/booking/info/service/serviceItem/index.d.ts +1 -0
- package/lib/components/booking/info/service/serviceList/index.d.ts +1 -0
- package/lib/components/booking/info/service2/Lists.d.ts +1 -0
- package/lib/components/booking/info/utils.js +1 -1
- package/lib/components/booking/info2/service/actions/index.d.ts +1 -0
- package/lib/components/booking/info2/service/editService/index.js +8 -0
- package/lib/components/booking/info2/service/serviceItem/index.d.ts +1 -0
- package/lib/components/booking/info2/service/serviceList/index.d.ts +1 -0
- package/lib/components/booking/locales.d.ts +18 -0
- package/lib/components/booking/locales.js +21 -3
- package/lib/components/booking/materiels/duration/index.d.ts +1 -0
- package/lib/components/booking/materiels/holder/index.d.ts +1 -0
- package/lib/components/booking/materiels/startTime/index.d.ts +1 -0
- package/lib/components/booking/payments/index.js +1 -1
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/eftposPay/hooks.d.ts +2 -2
- package/lib/components/eftposPay/store/index.d.ts +6 -6
- package/lib/components/eventBooking/components/Provider/Cart/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Information/index.d.ts +3 -0
- package/lib/components/productExtension/fields/Actor/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
- package/lib/components/shoppingCart/components/Cart/Product.js +1 -0
- package/lib/components/shoppingCart/components/Cart/index.d.ts +1 -0
- package/lib/components/shoppingCart/components/Empty/index.d.ts +1 -0
- package/lib/components/shoppingCart/components/Render/index.d.ts +1 -0
- package/lib/components/shoppingCart/hooks/useAddService.d.ts +1 -0
- package/lib/components/shoppingCart/hooks/useClearCart.js +3 -2
- package/lib/components/shoppingCart/index.d.ts +1 -0
- package/lib/components/shoppingCart/type.d.ts +1 -0
- package/lib/components/wallet/Detail/index.js +6 -1
- package/lib/components/wallet/Voucher/index.js +1 -0
- package/lib/components/wallet/index.js +15 -1
- package/lib/components/wallet/locales.d.ts +3 -0
- package/lib/components/wallet/locales.js +3 -0
- package/lib/components/wallet/model.d.ts +1 -1
- package/lib/components/wallet/utils/formatUtils.js +1 -1
- package/lib/components/walletList/index.js +6 -2
- package/package.json +3 -3
|
@@ -6,14 +6,10 @@ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" !=
|
|
|
6
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
7
|
import React, { useMemo, useState } from 'react';
|
|
8
8
|
import { Dropdown } from 'antd';
|
|
9
|
-
import { Button, Iconfont, PisellCard, PisellAvatar } from '@pisell/materials';
|
|
9
|
+
import { Button, Iconfont, PisellCard, PisellAvatar, PisellToast } from '@pisell/materials';
|
|
10
10
|
import { locales, isMobile, getUniqueId } from '@pisell/utils';
|
|
11
|
-
// import SelectHolderModal from '../Provider/SelectHolderModal';
|
|
12
|
-
// import InformationOptionsModal from '../Provider/InformationOptionsModal/index';
|
|
13
|
-
// import RemoveOptionConfirmModal from '../Provider/RemoveOptionConfirmModal';
|
|
14
|
-
import { useAppointmentBookingAccount } from "../../hooks";
|
|
15
11
|
import { useAppointmentBookingContext } from "../../context";
|
|
16
|
-
|
|
12
|
+
import { useAppointmentBookingAccount } from "../../hooks";
|
|
17
13
|
import { formatGuest } from "../../utils";
|
|
18
14
|
import "./index.less";
|
|
19
15
|
var Guest = function Guest() {
|
|
@@ -21,19 +17,6 @@ var Guest = function Guest() {
|
|
|
21
17
|
_useState2 = _slicedToArray(_useState, 2),
|
|
22
18
|
openOption = _useState2[0],
|
|
23
19
|
setOpenOption = _useState2[1];
|
|
24
|
-
// 编辑哪个holder
|
|
25
|
-
var _useState3 = useState(null),
|
|
26
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
27
|
-
holderItem = _useState4[0],
|
|
28
|
-
setHolderItem = _useState4[1];
|
|
29
|
-
// 移除确认
|
|
30
|
-
var _useState5 = useState(false),
|
|
31
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
32
|
-
removeOpen = _useState6[0],
|
|
33
|
-
setRemoveOpen = _useState6[1];
|
|
34
|
-
|
|
35
|
-
// const appointmentBooking = useAppointmentBooking();
|
|
36
|
-
// const { products } = useAppointmentBookingCart();
|
|
37
20
|
var _useAppointmentBookin = useAppointmentBookingContext(),
|
|
38
21
|
carts = _useAppointmentBookin.carts,
|
|
39
22
|
appointmentBooking = _useAppointmentBookin.appointmentBooking;
|
|
@@ -104,7 +87,6 @@ var Guest = function Guest() {
|
|
|
104
87
|
return /*#__PURE__*/React.createElement(Button, {
|
|
105
88
|
size: "large",
|
|
106
89
|
onClick: function onClick() {
|
|
107
|
-
setHolderItem(item);
|
|
108
90
|
setOpenOption(true);
|
|
109
91
|
}
|
|
110
92
|
}, locales.getText('pisell2.event.option'));
|
|
@@ -113,7 +95,6 @@ var Guest = function Guest() {
|
|
|
113
95
|
menu: {
|
|
114
96
|
items: _options,
|
|
115
97
|
onClick: function onClick(e) {
|
|
116
|
-
setHolderItem(item);
|
|
117
98
|
handleClick(e, item);
|
|
118
99
|
}
|
|
119
100
|
},
|
|
@@ -122,6 +103,12 @@ var Guest = function Guest() {
|
|
|
122
103
|
}, /*#__PURE__*/React.createElement(Button, null, locales.getText('pisell2.event.option')));
|
|
123
104
|
};
|
|
124
105
|
var handleAddGuest = function handleAddGuest() {
|
|
106
|
+
// 最多添加6个人
|
|
107
|
+
if (accountLists.length >= 6) {
|
|
108
|
+
return PisellToast({
|
|
109
|
+
content: locales.getText('pisell2.appointment.max.guest')
|
|
110
|
+
});
|
|
111
|
+
}
|
|
125
112
|
var guest = {
|
|
126
113
|
id: getUniqueId(),
|
|
127
114
|
username: "Guest".concat(accountLists.length + 1),
|
|
@@ -1,14 +1,35 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import { locales } from '@pisell/utils';
|
|
2
3
|
import ProgressBar from "../../../eventBooking/components/progressBar";
|
|
3
4
|
import { useAppointmentBookingContext } from "../../context";
|
|
4
5
|
import "./index.less";
|
|
5
6
|
var Header = function Header() {
|
|
6
|
-
var _currentStep$
|
|
7
|
-
// const appointmentBooking = useAppointmentBooking();
|
|
8
|
-
// const { currentStep } = useAppointmentBookingStep();
|
|
7
|
+
var _currentStep$step3, _currentStep$step5;
|
|
9
8
|
var _useAppointmentBookin = useAppointmentBookingContext(),
|
|
10
9
|
currentStep = _useAppointmentBookin.currentStep,
|
|
11
|
-
appointmentBooking = _useAppointmentBookin.appointmentBooking
|
|
10
|
+
appointmentBooking = _useAppointmentBookin.appointmentBooking,
|
|
11
|
+
resources = _useAppointmentBookin.resources;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @title: 获取资源名称
|
|
15
|
+
* @description:
|
|
16
|
+
* @param {*} useMemo
|
|
17
|
+
* @return {*}
|
|
18
|
+
* @Author: WangHan
|
|
19
|
+
* @Date: 2025-04-15 21:37
|
|
20
|
+
*/
|
|
21
|
+
var stepName = useMemo(function () {
|
|
22
|
+
var _currentStep$step, _currentStep$step2;
|
|
23
|
+
var key = currentStep === null || currentStep === void 0 || (_currentStep$step = currentStep.step) === null || _currentStep$step === void 0 ? void 0 : _currentStep$step.key;
|
|
24
|
+
|
|
25
|
+
// 选择资源则获取资源列表的第一个名称
|
|
26
|
+
if (key === 'select-resource') {
|
|
27
|
+
var _resources$;
|
|
28
|
+
var name = (resources === null || resources === void 0 || (_resources$ = resources[0]) === null || _resources$ === void 0 || (_resources$ = _resources$.resources) === null || _resources$ === void 0 || (_resources$ = _resources$[0]) === null || _resources$ === void 0 ? void 0 : _resources$.title) || '';
|
|
29
|
+
return locales.getText('pisell2.event.select.category')(name);
|
|
30
|
+
}
|
|
31
|
+
return currentStep === null || currentStep === void 0 || (_currentStep$step2 = currentStep.step) === null || _currentStep$step2 === void 0 ? void 0 : _currentStep$step2.description;
|
|
32
|
+
}, [currentStep === null || currentStep === void 0 || (_currentStep$step3 = currentStep.step) === null || _currentStep$step3 === void 0 ? void 0 : _currentStep$step3.key, resources]);
|
|
12
33
|
|
|
13
34
|
/**
|
|
14
35
|
* @title: 返回
|
|
@@ -18,6 +39,22 @@ var Header = function Header() {
|
|
|
18
39
|
* @Date: 2025-01-18 22:28
|
|
19
40
|
*/
|
|
20
41
|
var handleBack = function handleBack() {
|
|
42
|
+
var _currentStep$step4;
|
|
43
|
+
var key = currentStep === null || currentStep === void 0 || (_currentStep$step4 = currentStep.step) === null || _currentStep$step4 === void 0 ? void 0 : _currentStep$step4.key;
|
|
44
|
+
|
|
45
|
+
// 删除缓存
|
|
46
|
+
var types = {
|
|
47
|
+
'select-time': 'time',
|
|
48
|
+
'select-resource': 'resource'
|
|
49
|
+
};
|
|
50
|
+
if (types[key]) {
|
|
51
|
+
appointmentBooking.deleteCartItemInfo(types[key]);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
// 清空选中的日期
|
|
55
|
+
if (key === 'select-date') {
|
|
56
|
+
appointmentBooking.clearDateRange();
|
|
57
|
+
}
|
|
21
58
|
appointmentBooking.back();
|
|
22
59
|
};
|
|
23
60
|
|
|
@@ -32,8 +69,8 @@ var Header = function Header() {
|
|
|
32
69
|
appointmentBooking.close();
|
|
33
70
|
};
|
|
34
71
|
return /*#__PURE__*/React.createElement(ProgressBar, {
|
|
35
|
-
title: currentStep === null || currentStep === void 0 || (_currentStep$
|
|
36
|
-
description:
|
|
72
|
+
title: currentStep === null || currentStep === void 0 || (_currentStep$step5 = currentStep.step) === null || _currentStep$step5 === void 0 ? void 0 : _currentStep$step5.title,
|
|
73
|
+
description: stepName,
|
|
37
74
|
showBack: (currentStep === null || currentStep === void 0 ? void 0 : currentStep.index) > 0,
|
|
38
75
|
onBack: function onBack() {
|
|
39
76
|
return handleBack();
|
|
@@ -7,13 +7,13 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
7
7
|
import React, { useState, useEffect, useMemo } from 'react';
|
|
8
8
|
import { Skeleton } from 'antd';
|
|
9
9
|
import ResourceDisplay from "../../../eventBooking/components/resourceDisplay";
|
|
10
|
-
import { PisellCustomCheckboxGroup } from '@pisell/materials';
|
|
10
|
+
import { PisellCustomCheckboxGroup, PisellToast } from '@pisell/materials';
|
|
11
11
|
import { useAppointmentBookingResource } from "../../hooks";
|
|
12
12
|
import { useAppointmentBookingContext } from "../../context";
|
|
13
|
-
import
|
|
13
|
+
import guestsImg from "../../assets/guests.svg";
|
|
14
|
+
import { isMobile, locales } from '@pisell/utils';
|
|
14
15
|
import "./index.less";
|
|
15
|
-
var Resource = function Resource(
|
|
16
|
-
var onChange = _ref.onChange;
|
|
16
|
+
var Resource = function Resource() {
|
|
17
17
|
var _useState = useState(0),
|
|
18
18
|
_useState2 = _slicedToArray(_useState, 2),
|
|
19
19
|
selectedResource = _useState2[0],
|
|
@@ -26,33 +26,34 @@ var Resource = function Resource(_ref) {
|
|
|
26
26
|
resourceOtherParams = _useAppointmentBookin.resourceOtherParams;
|
|
27
27
|
var _useAppointmentBookin2 = useAppointmentBookingResource(),
|
|
28
28
|
getResourceList = _useAppointmentBookin2.getResourceList,
|
|
29
|
-
getResourceTimeSlot = _useAppointmentBookin2.getResourceTimeSlot,
|
|
30
29
|
autoSelectAllProductResources = _useAppointmentBookin2.autoSelectAllProductResources;
|
|
31
|
-
// const { products } = useAppointmentBookingCart();
|
|
32
30
|
console.log(resources, carts, appointmentBooking, 'lists, products');
|
|
33
31
|
useEffect(function () {
|
|
32
|
+
var _resources$;
|
|
34
33
|
var _resources = getResourceList();
|
|
35
|
-
|
|
34
|
+
var code = _resources === null || _resources === void 0 || (_resources$ = _resources[0]) === null || _resources$ === void 0 || (_resources$ = _resources$.resources) === null || _resources$ === void 0 || (_resources$ = _resources$[0]) === null || _resources$ === void 0 ? void 0 : _resources$.code;
|
|
35
|
+
autoSelectAllProductResources(code);
|
|
36
36
|
}, []);
|
|
37
37
|
useEffect(function () {
|
|
38
38
|
var _resourceOtherParams$;
|
|
39
|
-
|
|
39
|
+
// 无可用时间提示
|
|
40
40
|
if ((resourceOtherParams === null || resourceOtherParams === void 0 || (_resourceOtherParams$ = resourceOtherParams.errorList) === null || _resourceOtherParams$ === void 0 ? void 0 : _resourceOtherParams$.length) > 0) {
|
|
41
|
-
return
|
|
41
|
+
return PisellToast({
|
|
42
|
+
content: locales.getText('pisell2.appointment.no.available.time')
|
|
43
|
+
});
|
|
42
44
|
}
|
|
43
45
|
}, [resourceOtherParams === null || resourceOtherParams === void 0 ? void 0 : resourceOtherParams.errorList]);
|
|
44
46
|
var anyResource = [{
|
|
45
47
|
id: 0,
|
|
46
|
-
image:
|
|
48
|
+
image: guestsImg,
|
|
47
49
|
title: 'Any professional',
|
|
48
50
|
subtitle: 'for maximum availability'
|
|
49
51
|
}];
|
|
50
52
|
var currentResource = useMemo(function () {
|
|
51
53
|
if (resources.length && carts.length) {
|
|
52
|
-
console.log(resources, carts, 'lists, products');
|
|
53
54
|
if (carts.length === 1) {
|
|
54
|
-
var _resources
|
|
55
|
-
return (_resources$ = resources[0]) === null || _resources$ === void 0 || (_resources$ = _resources
|
|
55
|
+
var _resources$2;
|
|
56
|
+
return (_resources$2 = resources[0]) === null || _resources$2 === void 0 || (_resources$2 = _resources$2.resources) === null || _resources$2 === void 0 ? void 0 : _resources$2[0];
|
|
56
57
|
} else {
|
|
57
58
|
return {
|
|
58
59
|
renderList: []
|
|
@@ -66,15 +67,21 @@ var Resource = function Resource(_ref) {
|
|
|
66
67
|
}, [currentResource]);
|
|
67
68
|
var _onClick = function onClick(e) {
|
|
68
69
|
setSelectedResource(e.id);
|
|
69
|
-
console.log(currentResource, e, 'whcurrentResourcecurrentResource');
|
|
70
|
+
console.log(currentResource, e, carts, 'whcurrentResourcecurrentResource');
|
|
70
71
|
if (e.id) {
|
|
71
|
-
var
|
|
72
|
-
getResourceTimeSlot(
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
72
|
+
var _carts$;
|
|
73
|
+
// getResourceTimeSlot('resources');
|
|
74
|
+
return appointmentBooking.updateCart({
|
|
75
|
+
_id: carts === null || carts === void 0 || (_carts$ = carts[0]) === null || _carts$ === void 0 ? void 0 : _carts$._id,
|
|
76
|
+
resources: [e]
|
|
76
77
|
});
|
|
77
78
|
|
|
79
|
+
// getResourceTimeSlot({
|
|
80
|
+
// product: resources?.[0]?.product,
|
|
81
|
+
// resources: currentResource?.renderList,
|
|
82
|
+
// currentResourceId: e.id,
|
|
83
|
+
// });
|
|
84
|
+
|
|
78
85
|
// onChange({
|
|
79
86
|
// times: times,
|
|
80
87
|
// product: resources?.[0]?.product,
|
|
@@ -97,7 +104,8 @@ var Resource = function Resource(_ref) {
|
|
|
97
104
|
dataSource: item,
|
|
98
105
|
direction: "vertical",
|
|
99
106
|
children: !(item !== null && item !== void 0 && item.image) ? item === null || item === void 0 || (_item$title = item.title) === null || _item$title === void 0 ? void 0 : _item$title.charAt(0).toUpperCase() : null,
|
|
100
|
-
selected: selectedResource === (item === null || item === void 0 ? void 0 : item.id)
|
|
107
|
+
selected: selectedResource === (item === null || item === void 0 ? void 0 : item.id),
|
|
108
|
+
className: !item.id ? 'appointment-resource-guest-card' : ''
|
|
101
109
|
});
|
|
102
110
|
},
|
|
103
111
|
columns: isMobile() ? 2 : 3,
|
|
@@ -11,14 +11,16 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
11
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
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
13
|
import React, { useRef, useState, useMemo, useEffect } from 'react';
|
|
14
|
+
import { Input } from 'antd';
|
|
14
15
|
import SearchLg from '@pisell/icon/es/SearchLg';
|
|
15
16
|
import { locales } from '@pisell/utils';
|
|
16
|
-
import { PisellEmpty } from '@pisell/materials';
|
|
17
|
-
import { Input } from 'antd';
|
|
17
|
+
import { PisellEmpty, PisellToast } from '@pisell/materials';
|
|
18
18
|
import TabProduct from "../../../booking/components/TabProduct";
|
|
19
19
|
import { formatProductListByCategory } from "../../../booking/utils";
|
|
20
20
|
import useEngineContext from "../../../../hooks/useEngineContext";
|
|
21
21
|
import { useAppointmentBookingContext } from "../../context";
|
|
22
|
+
import { useAppointmentBookingAccount, useAppointmentBooking } from "../../hooks";
|
|
23
|
+
import { formatCurrentUser } from "../../utils";
|
|
22
24
|
import "./index.less";
|
|
23
25
|
var Services = function Services() {
|
|
24
26
|
var searchRef = useRef();
|
|
@@ -29,11 +31,23 @@ var Services = function Services() {
|
|
|
29
31
|
var context = useEngineContext();
|
|
30
32
|
var _ref = context.appHelper || {},
|
|
31
33
|
utils = _ref.utils;
|
|
34
|
+
var appointmentBooking = useAppointmentBooking();
|
|
32
35
|
var _useAppointmentBookin = useAppointmentBookingContext(),
|
|
33
|
-
appointmentBooking = _useAppointmentBookin.appointmentBooking,
|
|
34
36
|
products = _useAppointmentBookin.products,
|
|
35
37
|
setProducts = _useAppointmentBookin.setProducts;
|
|
38
|
+
var _useAppointmentBookin2 = useAppointmentBookingAccount(),
|
|
39
|
+
accountLists = _useAppointmentBookin2.accountLists;
|
|
40
|
+
var accountRef = useRef(accountLists);
|
|
41
|
+
var currentUser = formatCurrentUser();
|
|
36
42
|
useEffect(function () {
|
|
43
|
+
console.log(accountLists, accountRef, 'wh978896786');
|
|
44
|
+
}, [accountLists, accountRef]);
|
|
45
|
+
useEffect(function () {
|
|
46
|
+
var _accountRef$current;
|
|
47
|
+
console.log(accountRef.current, currentUser, 'accountRef');
|
|
48
|
+
if (!((_accountRef$current = accountRef.current) !== null && _accountRef$current !== void 0 && _accountRef$current.length) && currentUser) {
|
|
49
|
+
appointmentBooking.addAccount([currentUser]);
|
|
50
|
+
}
|
|
37
51
|
var _ref2 = appointmentBooking.otherParams || {},
|
|
38
52
|
productModuleParams = _ref2.productModuleParams;
|
|
39
53
|
appointmentBooking.loadProducts(productModuleParams).then(function (res) {
|
|
@@ -53,12 +67,9 @@ var Services = function Services() {
|
|
|
53
67
|
return item.status === 1;
|
|
54
68
|
});
|
|
55
69
|
if (!activeStatus) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
// 'pisell2.appointment.no.available.service'
|
|
60
|
-
// ),
|
|
61
|
-
// });
|
|
70
|
+
return PisellToast({
|
|
71
|
+
content: locales.getText('pisell2.appointment.no.available.service')
|
|
72
|
+
});
|
|
62
73
|
}
|
|
63
74
|
var product = _objectSpread(_objectSpread({}, data), {}, {
|
|
64
75
|
options: (data === null || data === void 0 ? void 0 : data.option) || []
|
|
@@ -8,8 +8,9 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
8
8
|
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; }
|
|
9
9
|
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; } }
|
|
10
10
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
|
-
import React, { useState } from 'react';
|
|
12
|
-
import { Iconfont } from '@pisell/materials';
|
|
11
|
+
import React, { useEffect, useState } from 'react';
|
|
12
|
+
import { Iconfont, PisellEmpty } from '@pisell/materials';
|
|
13
|
+
import { locales } from '@pisell/utils';
|
|
13
14
|
import { useAppointmentBookingContext } from "../../context";
|
|
14
15
|
import "./index.less";
|
|
15
16
|
var Resource = function Resource(_ref) {
|
|
@@ -22,49 +23,61 @@ var Resource = function Resource(_ref) {
|
|
|
22
23
|
times = _useAppointmentBookin.times,
|
|
23
24
|
resources = _useAppointmentBookin.resources,
|
|
24
25
|
appointmentBooking = _useAppointmentBookin.appointmentBooking,
|
|
25
|
-
carts = _useAppointmentBookin.carts
|
|
26
|
+
carts = _useAppointmentBookin.carts,
|
|
27
|
+
setSelectedTime = _useAppointmentBookin.setSelectedTime;
|
|
26
28
|
console.log(params, resources, times, 'wh8765');
|
|
27
|
-
var
|
|
28
|
-
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(
|
|
29
|
-
var
|
|
30
|
-
var data, _resources$2, _resources$3, _resources, aa;
|
|
29
|
+
var getAutoSelect = /*#__PURE__*/function () {
|
|
30
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(val) {
|
|
31
|
+
var _yield$appointmentBoo, errorList, result;
|
|
31
32
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
32
33
|
while (1) switch (_context.prev = _context.next) {
|
|
33
34
|
case 0:
|
|
34
|
-
|
|
35
|
+
setSelectedTime(val);
|
|
35
36
|
_context.next = 3;
|
|
36
|
-
return appointmentBooking.
|
|
37
|
-
resourceProductData: resources === null || resources === void 0 ? void 0 : resources[0],
|
|
38
|
-
resources: resources === null || resources === void 0 || (_resources$ = resources[0]) === null || _resources$ === void 0 || (_resources$ = _resources$.resources) === null || _resources$ === void 0 || (_resources$ = _resources$[1]) === null || _resources$ === void 0 ? void 0 : _resources$.renderList,
|
|
39
|
-
timeSlots: e
|
|
40
|
-
});
|
|
37
|
+
return appointmentBooking.autoSelectAllProductResources('sites', val);
|
|
41
38
|
case 3:
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
resourceProductData: resources === null || resources === void 0 ? void 0 : resources[0],
|
|
51
|
-
selectedResources: _resources,
|
|
52
|
-
timeSlots: e
|
|
53
|
-
});
|
|
54
|
-
case 8:
|
|
55
|
-
aa = _context.sent;
|
|
56
|
-
console.log(data, _resources, aa, 'wh9879676');
|
|
57
|
-
case 10:
|
|
39
|
+
_yield$appointmentBoo = _context.sent;
|
|
40
|
+
errorList = _yield$appointmentBoo.errorList;
|
|
41
|
+
_context.next = 7;
|
|
42
|
+
return appointmentBooking.submitTimeSlot(val);
|
|
43
|
+
case 7:
|
|
44
|
+
result = _context.sent;
|
|
45
|
+
console.log(errorList, result, 'wh9896788');
|
|
46
|
+
case 9:
|
|
58
47
|
case "end":
|
|
59
48
|
return _context.stop();
|
|
60
49
|
}
|
|
61
50
|
}, _callee);
|
|
62
51
|
}));
|
|
63
|
-
return function
|
|
52
|
+
return function getAutoSelect(_x) {
|
|
64
53
|
return _ref2.apply(this, arguments);
|
|
65
54
|
};
|
|
66
55
|
}();
|
|
67
|
-
|
|
56
|
+
useEffect(function () {
|
|
57
|
+
if ((times === null || times === void 0 ? void 0 : times.length) > 0) {
|
|
58
|
+
var _times$;
|
|
59
|
+
setSelectedResource(times === null || times === void 0 || (_times$ = times[0]) === null || _times$ === void 0 ? void 0 : _times$.start_time);
|
|
60
|
+
getAutoSelect(times === null || times === void 0 ? void 0 : times[0]);
|
|
61
|
+
}
|
|
62
|
+
}, [times]);
|
|
63
|
+
var _onClick = /*#__PURE__*/function () {
|
|
64
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(e) {
|
|
65
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
66
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
67
|
+
case 0:
|
|
68
|
+
setSelectedResource(e === null || e === void 0 ? void 0 : e.start_time);
|
|
69
|
+
getAutoSelect(e);
|
|
70
|
+
case 2:
|
|
71
|
+
case "end":
|
|
72
|
+
return _context2.stop();
|
|
73
|
+
}
|
|
74
|
+
}, _callee2);
|
|
75
|
+
}));
|
|
76
|
+
return function onClick(_x2) {
|
|
77
|
+
return _ref3.apply(this, arguments);
|
|
78
|
+
};
|
|
79
|
+
}();
|
|
80
|
+
return (times === null || times === void 0 ? void 0 : times.length) > 0 ? /*#__PURE__*/React.createElement("div", {
|
|
68
81
|
className: 'appointment-time-slicing-wrap'
|
|
69
82
|
}, times.map(function (item, index) {
|
|
70
83
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -77,6 +90,8 @@ var Resource = function Resource(_ref) {
|
|
|
77
90
|
type: "pisell2-chevron-right",
|
|
78
91
|
className: "icon"
|
|
79
92
|
}));
|
|
80
|
-
}))
|
|
93
|
+
})) : /*#__PURE__*/React.createElement(PisellEmpty, {
|
|
94
|
+
description: locales.getText('pisell2.appointment.booking.empty.time')
|
|
95
|
+
});
|
|
81
96
|
};
|
|
82
97
|
export default Resource;
|