@pisell/private-materials 3.2.17 → 3.2.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +8 -8
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +7 -7
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +7 -7
- package/es/components/appointmentBooking/components/{Provider/Cart → Cart}/ContinueButton/index.js +19 -10
- package/es/components/appointmentBooking/components/{Provider/Cart → Cart}/Item/Total.js +10 -20
- package/es/components/appointmentBooking/components/Cart/Item/index.js +73 -0
- package/es/components/appointmentBooking/components/Content/index.js +29 -15
- package/es/components/appointmentBooking/components/Date/index.js +77 -12
- package/es/components/appointmentBooking/components/Date/index.less +1 -0
- package/es/components/appointmentBooking/components/Footer/index.js +3 -3
- package/es/components/appointmentBooking/components/Guest/index.d.ts +3 -0
- package/es/components/appointmentBooking/components/{Provider/Information → Guest}/index.js +50 -59
- package/es/components/appointmentBooking/components/Header/index.js +6 -4
- package/es/components/appointmentBooking/components/Resource/index.d.ts +1 -1
- package/es/components/appointmentBooking/components/Resource/index.js +62 -29
- package/es/components/appointmentBooking/components/Resource/index.less +6 -0
- package/es/components/appointmentBooking/components/Services/index.js +25 -135
- package/es/components/appointmentBooking/components/TimeSlicing/index.d.ts +1 -1
- package/es/components/appointmentBooking/components/TimeSlicing/index.js +44 -755
- package/es/components/appointmentBooking/context.d.ts +23 -0
- package/es/components/appointmentBooking/context.js +71 -0
- package/es/components/appointmentBooking/hooks.d.ts +6 -8
- package/es/components/appointmentBooking/hooks.js +119 -62
- package/es/components/appointmentBooking/index.js +2 -3
- package/es/components/appointmentBooking/locales.d.ts +12 -0
- package/es/components/appointmentBooking/locales.js +21 -3
- package/es/components/appointmentBooking/utils.d.ts +12 -0
- package/es/components/appointmentBooking/utils.js +70 -0
- package/lib/components/appointmentBooking/components/{Provider/Cart → Cart}/ContinueButton/index.js +18 -16
- package/lib/components/appointmentBooking/components/{Provider/Cart → Cart}/Item/Total.js +7 -11
- package/lib/components/appointmentBooking/components/{Provider/Cart → Cart}/Item/index.js +22 -21
- package/lib/components/appointmentBooking/components/{Provider/Cart → Cart}/index.js +1 -1
- package/lib/components/appointmentBooking/components/Content/index.js +26 -14
- package/lib/components/appointmentBooking/components/Date/index.js +53 -16
- package/lib/components/appointmentBooking/components/Date/index.less +1 -0
- package/lib/components/appointmentBooking/components/Footer/index.js +3 -3
- package/lib/components/appointmentBooking/components/Guest/index.d.ts +3 -0
- package/lib/components/appointmentBooking/components/{Provider/Information → Guest}/index.js +43 -52
- package/lib/components/appointmentBooking/components/Header/index.js +2 -3
- package/lib/components/appointmentBooking/components/Resource/index.d.ts +1 -1
- package/lib/components/appointmentBooking/components/Resource/index.js +55 -41
- package/lib/components/appointmentBooking/components/Resource/index.less +6 -0
- package/lib/components/appointmentBooking/components/Services/index.js +15 -155
- package/lib/components/appointmentBooking/components/TimeSlicing/index.d.ts +1 -1
- package/lib/components/appointmentBooking/components/TimeSlicing/index.js +17 -941
- package/lib/components/appointmentBooking/context.d.ts +23 -0
- package/lib/components/appointmentBooking/context.js +85 -0
- package/lib/components/appointmentBooking/hooks.d.ts +6 -8
- package/lib/components/appointmentBooking/hooks.js +44 -20
- package/lib/components/appointmentBooking/index.js +2 -5
- package/lib/components/appointmentBooking/locales.d.ts +12 -0
- package/lib/components/appointmentBooking/locales.js +15 -3
- package/lib/components/appointmentBooking/utils.d.ts +12 -0
- package/lib/components/appointmentBooking/utils.js +62 -2
- package/package.json +2 -2
- package/es/components/appointmentBooking/components/Information/index.d.ts +0 -3
- package/es/components/appointmentBooking/components/Information/index.js +0 -178
- package/es/components/appointmentBooking/components/Provider/Cart/Item/index.js +0 -68
- package/es/components/appointmentBooking/components/Provider/Content/index.d.ts +0 -3
- package/es/components/appointmentBooking/components/Provider/Content/index.js +0 -64
- package/es/components/appointmentBooking/components/Provider/Content/index.less +0 -31
- package/es/components/appointmentBooking/components/Provider/EmptyHolderModal/index.d.ts +0 -3
- package/es/components/appointmentBooking/components/Provider/EmptyHolderModal/index.js +0 -34
- package/es/components/appointmentBooking/components/Provider/EmptyHolderModal/index.less +0 -17
- package/es/components/appointmentBooking/components/Provider/Event/index.d.ts +0 -3
- package/es/components/appointmentBooking/components/Provider/Event/index.js +0 -93
- package/es/components/appointmentBooking/components/Provider/Event/index.less +0 -20
- package/es/components/appointmentBooking/components/Provider/Information/index.d.ts +0 -3
- package/es/components/appointmentBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -3
- package/es/components/appointmentBooking/components/Provider/InformationOptionsModal/index.js +0 -34
- package/es/components/appointmentBooking/components/Provider/InformationOptionsModal/index.less +0 -27
- package/es/components/appointmentBooking/components/Provider/OrderProductModal/index.d.ts +0 -3
- package/es/components/appointmentBooking/components/Provider/OrderProductModal/index.js +0 -27
- package/es/components/appointmentBooking/components/Provider/OrderProductModal/index.less +0 -32
- package/es/components/appointmentBooking/components/Provider/RemoveOptionConfirmModal.d.ts +0 -2
- package/es/components/appointmentBooking/components/Provider/RemoveOptionConfirmModal.js +0 -31
- package/es/components/appointmentBooking/components/Provider/Resource/index.d.ts +0 -3
- package/es/components/appointmentBooking/components/Provider/Resource/index.js +0 -79
- package/es/components/appointmentBooking/components/Provider/Resource/index.less +0 -46
- package/es/components/appointmentBooking/components/Provider/SelectHolderModal.d.ts +0 -2
- package/es/components/appointmentBooking/components/Provider/SelectHolderModal.js +0 -90
- package/es/components/appointmentBooking/components/Provider/SelectProduct/index.d.ts +0 -4
- package/es/components/appointmentBooking/components/Provider/SelectProduct/index.js +0 -77
- package/es/components/appointmentBooking/components/Provider/SelectProduct/index.less +0 -131
- package/es/components/booking/info/service2/utils.d.ts +0 -240
- package/es/components/eventBooking/components/Provider/Information/index.d.ts +0 -3
- package/lib/components/appointmentBooking/components/Information/index.d.ts +0 -3
- package/lib/components/appointmentBooking/components/Information/index.js +0 -151
- package/lib/components/appointmentBooking/components/Information/index.less +0 -92
- package/lib/components/appointmentBooking/components/Provider/Cart/Item/index.d.ts +0 -3
- package/lib/components/appointmentBooking/components/Provider/Content/index.d.ts +0 -3
- package/lib/components/appointmentBooking/components/Provider/Content/index.js +0 -90
- package/lib/components/appointmentBooking/components/Provider/Content/index.less +0 -31
- package/lib/components/appointmentBooking/components/Provider/EmptyHolderModal/index.d.ts +0 -3
- package/lib/components/appointmentBooking/components/Provider/EmptyHolderModal/index.js +0 -60
- package/lib/components/appointmentBooking/components/Provider/EmptyHolderModal/index.less +0 -17
- package/lib/components/appointmentBooking/components/Provider/Event/index.d.ts +0 -3
- package/lib/components/appointmentBooking/components/Provider/Event/index.js +0 -100
- package/lib/components/appointmentBooking/components/Provider/Event/index.less +0 -20
- package/lib/components/appointmentBooking/components/Provider/Information/index.d.ts +0 -3
- package/lib/components/appointmentBooking/components/Provider/Information/index.less +0 -92
- package/lib/components/appointmentBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -3
- package/lib/components/appointmentBooking/components/Provider/InformationOptionsModal/index.js +0 -67
- package/lib/components/appointmentBooking/components/Provider/InformationOptionsModal/index.less +0 -27
- package/lib/components/appointmentBooking/components/Provider/OrderProductModal/index.d.ts +0 -3
- package/lib/components/appointmentBooking/components/Provider/OrderProductModal/index.js +0 -57
- package/lib/components/appointmentBooking/components/Provider/OrderProductModal/index.less +0 -32
- package/lib/components/appointmentBooking/components/Provider/RemoveOptionConfirmModal.d.ts +0 -2
- package/lib/components/appointmentBooking/components/Provider/RemoveOptionConfirmModal.js +0 -62
- package/lib/components/appointmentBooking/components/Provider/Resource/index.d.ts +0 -3
- package/lib/components/appointmentBooking/components/Provider/Resource/index.js +0 -90
- package/lib/components/appointmentBooking/components/Provider/Resource/index.less +0 -46
- package/lib/components/appointmentBooking/components/Provider/SelectHolderModal.d.ts +0 -2
- package/lib/components/appointmentBooking/components/Provider/SelectHolderModal.js +0 -97
- package/lib/components/appointmentBooking/components/Provider/SelectProduct/index.d.ts +0 -4
- package/lib/components/appointmentBooking/components/Provider/SelectProduct/index.js +0 -69
- package/lib/components/appointmentBooking/components/Provider/SelectProduct/index.less +0 -131
- package/lib/components/booking/info/service2/utils.d.ts +0 -240
- package/lib/components/eventBooking/components/Provider/Cart/Item/index.d.ts +0 -3
- package/lib/components/eventBooking/components/Provider/Information/index.d.ts +0 -3
- /package/es/components/appointmentBooking/components/{Provider/Cart → Cart}/ContinueButton/index.d.ts +0 -0
- /package/es/components/appointmentBooking/components/{Provider/Cart → Cart}/ContinueButton/index.less +0 -0
- /package/es/components/appointmentBooking/components/{Provider/Cart → Cart}/Item/Total.d.ts +0 -0
- /package/es/components/appointmentBooking/components/{Provider/Cart → Cart}/Item/index.d.ts +0 -0
- /package/es/components/appointmentBooking/components/{Provider/Cart → Cart}/Item/index.less +0 -0
- /package/es/components/appointmentBooking/components/{Provider/Cart → Cart}/index.d.ts +0 -0
- /package/es/components/appointmentBooking/components/{Provider/Cart → Cart}/index.js +0 -0
- /package/es/components/appointmentBooking/components/{Provider/Cart → Cart}/index.less +0 -0
- /package/es/components/appointmentBooking/components/{Information → Guest}/index.less +0 -0
- /package/lib/components/appointmentBooking/components/{Provider/Cart → Cart}/ContinueButton/index.d.ts +0 -0
- /package/lib/components/appointmentBooking/components/{Provider/Cart → Cart}/ContinueButton/index.less +0 -0
- /package/lib/components/appointmentBooking/components/{Provider/Cart → Cart}/Item/Total.d.ts +0 -0
- /package/{es/components/eventBooking/components/Provider → lib/components/appointmentBooking/components}/Cart/Item/index.d.ts +0 -0
- /package/lib/components/appointmentBooking/components/{Provider/Cart → Cart}/Item/index.less +0 -0
- /package/lib/components/appointmentBooking/components/{Provider/Cart → Cart}/index.d.ts +0 -0
- /package/lib/components/appointmentBooking/components/{Provider/Cart → Cart}/index.less +0 -0
- /package/{es/components/appointmentBooking/components/Provider/Information → lib/components/appointmentBooking/components/Guest}/index.less +0 -0
|
@@ -4,26 +4,19 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
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
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
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
-
import React, { useState } from 'react';
|
|
7
|
+
import React, { useMemo, useState } from 'react';
|
|
8
8
|
import { Dropdown } from 'antd';
|
|
9
9
|
import { Button, Iconfont, PisellCard, PisellAvatar } from '@pisell/materials';
|
|
10
|
-
import { locales, isMobile } from '@pisell/utils';
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
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
|
+
import { useAppointmentBookingContext } from "../../context";
|
|
16
|
+
// import appointmentBookingAccount from '../../hooks';
|
|
17
|
+
import { formatGuest } from "../../utils";
|
|
15
18
|
import "./index.less";
|
|
16
|
-
var
|
|
17
|
-
var _useHolder = useHolder(),
|
|
18
|
-
onHolderOpen = _useHolder.onHolderOpen,
|
|
19
|
-
open = _useHolder.open;
|
|
20
|
-
var _useCart = useCart(),
|
|
21
|
-
cartDataHolderList = _useCart.cartDataHolderList;
|
|
22
|
-
var _useHolder2 = useHolder(),
|
|
23
|
-
selectHolder = _useHolder2.selectHolder,
|
|
24
|
-
deleteHolderById = _useHolder2.deleteHolderById;
|
|
25
|
-
var _useStep = useStep(),
|
|
26
|
-
prevStep = _useStep.prevStep;
|
|
19
|
+
var Guest = function Guest() {
|
|
27
20
|
var _useState = useState(false),
|
|
28
21
|
_useState2 = _slicedToArray(_useState, 2),
|
|
29
22
|
openOption = _useState2[0],
|
|
@@ -39,6 +32,18 @@ var Information = function Information() {
|
|
|
39
32
|
removeOpen = _useState6[0],
|
|
40
33
|
setRemoveOpen = _useState6[1];
|
|
41
34
|
|
|
35
|
+
// const appointmentBooking = useAppointmentBooking();
|
|
36
|
+
// const { products } = useAppointmentBookingCart();
|
|
37
|
+
var _useAppointmentBookin = useAppointmentBookingContext(),
|
|
38
|
+
carts = _useAppointmentBookin.carts,
|
|
39
|
+
appointmentBooking = _useAppointmentBookin.appointmentBooking;
|
|
40
|
+
var _useAppointmentBookin2 = useAppointmentBookingAccount(),
|
|
41
|
+
accountLists = _useAppointmentBookin2.accountLists;
|
|
42
|
+
var lists = useMemo(function () {
|
|
43
|
+
var _lists = formatGuest(accountLists, carts);
|
|
44
|
+
return _lists;
|
|
45
|
+
}, [accountLists, carts]);
|
|
46
|
+
|
|
42
47
|
/**
|
|
43
48
|
* @title: 选项
|
|
44
49
|
* @description:
|
|
@@ -50,7 +55,7 @@ var Information = function Information() {
|
|
|
50
55
|
key: 'edit',
|
|
51
56
|
label: /*#__PURE__*/React.createElement("span", {
|
|
52
57
|
className: "dropdown-menu-item"
|
|
53
|
-
}, locales.getText('pisell2.
|
|
58
|
+
}, locales.getText('pisell2.appointment.edit.service'))
|
|
54
59
|
}, {
|
|
55
60
|
key: 'remove',
|
|
56
61
|
label: /*#__PURE__*/React.createElement("span", {
|
|
@@ -70,13 +75,13 @@ var Information = function Information() {
|
|
|
70
75
|
var key = _ref.key;
|
|
71
76
|
// 编辑holder
|
|
72
77
|
if (key === 'edit') {
|
|
73
|
-
|
|
74
|
-
|
|
78
|
+
appointmentBooking.setActiveAccount(item.id);
|
|
79
|
+
appointmentBooking.back();
|
|
75
80
|
return;
|
|
76
81
|
}
|
|
77
82
|
|
|
78
83
|
// 移除holder
|
|
79
|
-
|
|
84
|
+
appointmentBooking.removeAccount(item.id);
|
|
80
85
|
};
|
|
81
86
|
|
|
82
87
|
/**
|
|
@@ -88,6 +93,13 @@ var Information = function Information() {
|
|
|
88
93
|
* @Date: 2025-01-19 11:44
|
|
89
94
|
*/
|
|
90
95
|
var renderOptionButton = function renderOptionButton(item) {
|
|
96
|
+
console.log(item, options, 'wh978776');
|
|
97
|
+
var _options = [].concat(options);
|
|
98
|
+
if (!item.isGuest) {
|
|
99
|
+
_options = _options.filter(function (option) {
|
|
100
|
+
return option.key !== 'remove';
|
|
101
|
+
});
|
|
102
|
+
}
|
|
91
103
|
if (isMobile()) {
|
|
92
104
|
return /*#__PURE__*/React.createElement(Button, {
|
|
93
105
|
size: "large",
|
|
@@ -99,7 +111,7 @@ var Information = function Information() {
|
|
|
99
111
|
}
|
|
100
112
|
return /*#__PURE__*/React.createElement(Dropdown, {
|
|
101
113
|
menu: {
|
|
102
|
-
items:
|
|
114
|
+
items: _options,
|
|
103
115
|
onClick: function onClick(e) {
|
|
104
116
|
setHolderItem(item);
|
|
105
117
|
handleClick(e, item);
|
|
@@ -109,11 +121,19 @@ var Information = function Information() {
|
|
|
109
121
|
overlayClassName: "provider-information-custom-dropdown-menu"
|
|
110
122
|
}, /*#__PURE__*/React.createElement(Button, null, locales.getText('pisell2.event.option')));
|
|
111
123
|
};
|
|
124
|
+
var handleAddGuest = function handleAddGuest() {
|
|
125
|
+
var guest = {
|
|
126
|
+
id: getUniqueId(),
|
|
127
|
+
username: "Guest".concat(accountLists.length + 1),
|
|
128
|
+
isGuest: true
|
|
129
|
+
};
|
|
130
|
+
appointmentBooking.addAccount([guest]);
|
|
131
|
+
appointmentBooking.setActiveAccount(guest.id);
|
|
132
|
+
appointmentBooking.back();
|
|
133
|
+
};
|
|
112
134
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
113
135
|
className: "provider-information-wrap"
|
|
114
|
-
},
|
|
115
|
-
className: "title"
|
|
116
|
-
}, locales.getText('pisell2.event.confirm.information.tip')), cartDataHolderList === null || cartDataHolderList === void 0 ? void 0 : cartDataHolderList.map(function (item) {
|
|
136
|
+
}, lists === null || lists === void 0 ? void 0 : lists.map(function (item) {
|
|
117
137
|
var _item$children;
|
|
118
138
|
return /*#__PURE__*/React.createElement(PisellCard, {
|
|
119
139
|
key: item.id,
|
|
@@ -131,48 +151,19 @@ var Information = function Information() {
|
|
|
131
151
|
className: "information-title"
|
|
132
152
|
}, /*#__PURE__*/React.createElement("span", null, item.name), /*#__PURE__*/React.createElement("span", {
|
|
133
153
|
className: "subtitle"
|
|
134
|
-
}, "".concat(locales.getText('pisell2.
|
|
135
|
-
|
|
136
|
-
className: "child-wrap"
|
|
137
|
-
}, child.name);
|
|
138
|
-
}));
|
|
139
|
-
}), /*#__PURE__*/React.createElement("span", {
|
|
140
|
-
className: "add-tip"
|
|
141
|
-
}, locales.getText('pisell2.event.confirm.information.other')), /*#__PURE__*/React.createElement(Button, {
|
|
154
|
+
}, "".concat(locales.getText('pisell2.appointment.service.title')((_item$children = item.children) === null || _item$children === void 0 ? void 0 : _item$children.length))))), renderOptionButton(item)));
|
|
155
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
|
142
156
|
size: "large",
|
|
143
157
|
style: {
|
|
144
158
|
width: 'max-content'
|
|
145
159
|
},
|
|
146
|
-
onClick:
|
|
147
|
-
onHolderOpen();
|
|
148
|
-
},
|
|
160
|
+
onClick: handleAddGuest,
|
|
149
161
|
className: "provider-information-add-button"
|
|
150
162
|
}, /*#__PURE__*/React.createElement(Iconfont, {
|
|
151
163
|
type: "pisell2-plus",
|
|
152
164
|
style: {
|
|
153
165
|
fontSize: '20px'
|
|
154
166
|
}
|
|
155
|
-
}), locales.getText('pisell2.
|
|
156
|
-
open: open,
|
|
157
|
-
type: "create"
|
|
158
|
-
}), /*#__PURE__*/React.createElement(InformationOptionsModal, {
|
|
159
|
-
options: options,
|
|
160
|
-
open: openOption,
|
|
161
|
-
holderItem: holderItem,
|
|
162
|
-
onCancel: function onCancel() {
|
|
163
|
-
return setOpenOption(false);
|
|
164
|
-
},
|
|
165
|
-
onClick: handleClick
|
|
166
|
-
}), /*#__PURE__*/React.createElement(RemoveOptionConfirmModal, {
|
|
167
|
-
removeOpen: removeOpen,
|
|
168
|
-
onCancel: function onCancel() {
|
|
169
|
-
return setRemoveOpen(false);
|
|
170
|
-
},
|
|
171
|
-
onOk: function onOk() {
|
|
172
|
-
deleteHolderById(holderItem.id);
|
|
173
|
-
setRemoveOpen(false);
|
|
174
|
-
setOpenOption(false);
|
|
175
|
-
}
|
|
176
|
-
}));
|
|
167
|
+
}), locales.getText('pisell2.appointment.add.guest'))));
|
|
177
168
|
};
|
|
178
|
-
export default
|
|
169
|
+
export default Guest;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import ProgressBar from "../../../eventBooking/components/progressBar";
|
|
3
|
-
import {
|
|
3
|
+
import { useAppointmentBookingContext } from "../../context";
|
|
4
4
|
import "./index.less";
|
|
5
5
|
var Header = function Header() {
|
|
6
6
|
var _currentStep$step, _currentStep$step2;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
// const appointmentBooking = useAppointmentBooking();
|
|
8
|
+
// const { currentStep } = useAppointmentBookingStep();
|
|
9
|
+
var _useAppointmentBookin = useAppointmentBookingContext(),
|
|
10
|
+
currentStep = _useAppointmentBookin.currentStep,
|
|
11
|
+
appointmentBooking = _useAppointmentBookin.appointmentBooking;
|
|
10
12
|
|
|
11
13
|
/**
|
|
12
14
|
* @title: 返回
|
|
@@ -4,57 +4,90 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
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
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
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
-
import React, { useState } from 'react';
|
|
7
|
+
import React, { useState, useEffect, useMemo } from 'react';
|
|
8
|
+
import { Skeleton } from 'antd';
|
|
8
9
|
import ResourceDisplay from "../../../eventBooking/components/resourceDisplay";
|
|
9
10
|
import { PisellCustomCheckboxGroup } from '@pisell/materials';
|
|
11
|
+
import { useAppointmentBookingResource } from "../../hooks";
|
|
12
|
+
import { useAppointmentBookingContext } from "../../context";
|
|
10
13
|
import { isMobile } from '@pisell/utils';
|
|
11
14
|
import "./index.less";
|
|
12
|
-
var Resource = function Resource() {
|
|
13
|
-
var
|
|
15
|
+
var Resource = function Resource(_ref) {
|
|
16
|
+
var onChange = _ref.onChange;
|
|
17
|
+
var _useState = useState(0),
|
|
14
18
|
_useState2 = _slicedToArray(_useState, 2),
|
|
15
19
|
selectedResource = _useState2[0],
|
|
16
20
|
setSelectedResource = _useState2[1];
|
|
17
|
-
|
|
21
|
+
// const appointmentBooking = useAppointmentBooking();
|
|
22
|
+
var _useAppointmentBookin = useAppointmentBookingContext(),
|
|
23
|
+
appointmentBooking = _useAppointmentBookin.appointmentBooking,
|
|
24
|
+
resources = _useAppointmentBookin.resources,
|
|
25
|
+
carts = _useAppointmentBookin.carts;
|
|
26
|
+
var _useAppointmentBookin2 = useAppointmentBookingResource(),
|
|
27
|
+
getResourceList = _useAppointmentBookin2.getResourceList,
|
|
28
|
+
getResourceTimeSlot = _useAppointmentBookin2.getResourceTimeSlot;
|
|
29
|
+
// const { products } = useAppointmentBookingCart();
|
|
30
|
+
console.log(resources, carts, appointmentBooking, 'lists, products');
|
|
31
|
+
useEffect(function () {
|
|
32
|
+
getResourceList();
|
|
33
|
+
}, []);
|
|
34
|
+
var anyResource = [{
|
|
18
35
|
id: 0,
|
|
19
36
|
image: 'https://cdn-partners-api.fresha.com/employee-avatars/processed/399178/medium/3b77991b-0ee2-4d0f-9d6f-a7501b39afcd-tempImageHYe20U.jpg',
|
|
20
37
|
title: 'Any professional',
|
|
21
|
-
subtitle: '
|
|
22
|
-
}, {
|
|
23
|
-
id: 'select',
|
|
24
|
-
image: 'https://cdn-partners-api.fresha.com/employee-avatars/processed/399178/medium/3b77991b-0ee2-4d0f-9d6f-a7501b39afcd-tempImageHYe20U.jpg',
|
|
25
|
-
title: 'Select professional per service',
|
|
26
|
-
subtitle: ''
|
|
27
|
-
}, {
|
|
28
|
-
id: 1,
|
|
29
|
-
image: 'https://cdn-partners-api.fresha.com/employee-avatars/processed/399178/medium/3b77991b-0ee2-4d0f-9d6f-a7501b39afcd-tempImageHYe20U.jpg',
|
|
30
|
-
title: 'Bella',
|
|
31
|
-
subtitle: 'Senior beauty/Derma Therapist'
|
|
32
|
-
}, {
|
|
33
|
-
id: 2,
|
|
34
|
-
image: 'https://cdn-partners-api.fresha.com/employee-avatars/processed/399178/medium/3b77991b-0ee2-4d0f-9d6f-a7501b39afcd-tempImageHYe20U.jpg',
|
|
35
|
-
title: 'Bella',
|
|
36
|
-
subtitle: 'Senior beauty/Derma Therapist'
|
|
37
|
-
}, {
|
|
38
|
-
id: 3,
|
|
39
|
-
title: 'Maya',
|
|
40
|
-
subtitle: 'Spa Therapist'
|
|
38
|
+
subtitle: 'for maximum availability'
|
|
41
39
|
}];
|
|
40
|
+
var currentResource = useMemo(function () {
|
|
41
|
+
if (resources.length && carts.length) {
|
|
42
|
+
console.log(resources, carts, 'lists, products');
|
|
43
|
+
if (carts.length === 1) {
|
|
44
|
+
var _resources$;
|
|
45
|
+
return (_resources$ = resources[0]) === null || _resources$ === void 0 || (_resources$ = _resources$.resources) === null || _resources$ === void 0 ? void 0 : _resources$[0];
|
|
46
|
+
} else {
|
|
47
|
+
return {
|
|
48
|
+
renderList: []
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}, [resources, carts]);
|
|
53
|
+
var resourcesResult = useMemo(function () {
|
|
54
|
+
console.log(currentResource, resources, 'wh98765756');
|
|
55
|
+
return anyResource.concat((currentResource === null || currentResource === void 0 ? void 0 : currentResource.renderList) || []);
|
|
56
|
+
}, [currentResource]);
|
|
42
57
|
var _onClick = function onClick(e) {
|
|
43
|
-
console.log(e);
|
|
44
58
|
setSelectedResource(e.id);
|
|
59
|
+
console.log(currentResource, e, 'whcurrentResourcecurrentResource');
|
|
60
|
+
if (e.id) {
|
|
61
|
+
var _resources$2;
|
|
62
|
+
getResourceTimeSlot({
|
|
63
|
+
product: resources === null || resources === void 0 || (_resources$2 = resources[0]) === null || _resources$2 === void 0 ? void 0 : _resources$2.product,
|
|
64
|
+
resources: currentResource === null || currentResource === void 0 ? void 0 : currentResource.renderList,
|
|
65
|
+
currentResourceId: e.id
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
// onChange({
|
|
69
|
+
// times: times,
|
|
70
|
+
// product: resources?.[0]?.product,
|
|
71
|
+
// resources: resources[0]?.resources?.[1]?.renderList || [],
|
|
72
|
+
// });
|
|
73
|
+
}
|
|
45
74
|
};
|
|
46
75
|
return /*#__PURE__*/React.createElement("div", {
|
|
47
76
|
className: 'appointment-resource-wrap'
|
|
48
|
-
}, /*#__PURE__*/React.createElement(
|
|
49
|
-
|
|
77
|
+
}, !(resourcesResult !== null && resourcesResult !== void 0 && resourcesResult.length) ? /*#__PURE__*/React.createElement(Skeleton, {
|
|
78
|
+
loading: true,
|
|
79
|
+
active: true
|
|
80
|
+
}) : /*#__PURE__*/React.createElement(PisellCustomCheckboxGroup, {
|
|
81
|
+
dataSource: resourcesResult,
|
|
50
82
|
renderItem: function renderItem(item) {
|
|
83
|
+
var _item$title;
|
|
51
84
|
return /*#__PURE__*/React.createElement(ResourceDisplay, {
|
|
52
85
|
key: item.id,
|
|
53
86
|
mode: "rule",
|
|
54
87
|
dataSource: item,
|
|
55
88
|
direction: "vertical",
|
|
56
|
-
children: !item.image ? item.title.charAt(0).toUpperCase() : null,
|
|
57
|
-
selected: selectedResource === item.id
|
|
89
|
+
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,
|
|
90
|
+
selected: selectedResource === (item === null || item === void 0 ? void 0 : item.id)
|
|
58
91
|
});
|
|
59
92
|
},
|
|
60
93
|
columns: isMobile() ? 2 : 3,
|
|
@@ -1,10 +1,16 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
1
7
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
8
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
9
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
10
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
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; } }
|
|
6
12
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
-
import React, { useRef, useState, useMemo } from 'react';
|
|
13
|
+
import React, { useRef, useState, useMemo, useEffect } from 'react';
|
|
8
14
|
import SearchLg from '@pisell/icon/es/SearchLg';
|
|
9
15
|
import { locales } from '@pisell/utils';
|
|
10
16
|
import { PisellEmpty } from '@pisell/materials';
|
|
@@ -12,7 +18,7 @@ import { Input } from 'antd';
|
|
|
12
18
|
import TabProduct from "../../../booking/components/TabProduct";
|
|
13
19
|
import { formatProductListByCategory } from "../../../booking/utils";
|
|
14
20
|
import useEngineContext from "../../../../hooks/useEngineContext";
|
|
15
|
-
import {
|
|
21
|
+
import { useAppointmentBookingContext } from "../../context";
|
|
16
22
|
import "./index.less";
|
|
17
23
|
var Services = function Services() {
|
|
18
24
|
var searchRef = useRef();
|
|
@@ -23,137 +29,17 @@ var Services = function Services() {
|
|
|
23
29
|
var context = useEngineContext();
|
|
24
30
|
var _ref = context.appHelper || {},
|
|
25
31
|
utils = _ref.utils;
|
|
26
|
-
var
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
status: 'published',
|
|
38
|
-
stock_quantity: 99998,
|
|
39
|
-
sales_quantity: 3,
|
|
40
|
-
sum_stock: 99998,
|
|
41
|
-
price: '0.01',
|
|
42
|
-
original_price: '0.00',
|
|
43
|
-
cost_price: '0.00',
|
|
44
|
-
cover: '',
|
|
45
|
-
channel_application: ['online-store', 'pos', 'bbc-module:mebook', 'google_reserve'],
|
|
46
|
-
is_track: 1,
|
|
47
|
-
over_sold: 1,
|
|
48
|
-
is_gst: 1,
|
|
49
|
-
code: '11111',
|
|
50
|
-
barcode: '',
|
|
51
|
-
is_delivery: 1,
|
|
52
|
-
weight_unit: 'GRAMS',
|
|
53
|
-
weight_value: '0.00',
|
|
54
|
-
type: 'physical',
|
|
55
|
-
unit: '',
|
|
56
|
-
sort: 9999999,
|
|
57
|
-
bundle_group_count: 0,
|
|
58
|
-
option_group_count: 0,
|
|
59
|
-
is_variant: 0,
|
|
60
|
-
variant_count: 0,
|
|
61
|
-
barcode_formatting: 'None',
|
|
62
|
-
shelf_product_datas: [],
|
|
63
|
-
step_value: 1,
|
|
64
|
-
min_num_unit: 1,
|
|
65
|
-
schedules: [],
|
|
66
|
-
is_charge_tax: 1,
|
|
67
|
-
base_price: '0.01',
|
|
68
|
-
variant: [],
|
|
69
|
-
category: [{
|
|
70
|
-
id: 1268,
|
|
71
|
-
name: '灵活计价',
|
|
72
|
-
icon: '',
|
|
73
|
-
slug: '灵活计价',
|
|
74
|
-
sort: 0
|
|
75
|
-
}]
|
|
76
|
-
}, {
|
|
77
|
-
id: 57472,
|
|
78
|
-
extension_id: 0,
|
|
79
|
-
extension_type: 'normal',
|
|
80
|
-
shop_id: 9,
|
|
81
|
-
title: '测试灵活计价UPC-A',
|
|
82
|
-
slug: '测试灵活计价upc-a',
|
|
83
|
-
status: 'published',
|
|
84
|
-
stock_quantity: 2317,
|
|
85
|
-
sales_quantity: 4,
|
|
86
|
-
sum_stock: 2317,
|
|
87
|
-
price: '0.00',
|
|
88
|
-
original_price: '0.00',
|
|
89
|
-
cost_price: '0.00',
|
|
90
|
-
cover: '',
|
|
91
|
-
channel_application: ['online-store', 'pos', 'bbc-module:mebook', 'google_reserve'],
|
|
92
|
-
is_track: 1,
|
|
93
|
-
over_sold: 0,
|
|
94
|
-
is_gst: 1,
|
|
95
|
-
code: '34523',
|
|
96
|
-
barcode: '',
|
|
97
|
-
is_delivery: 1,
|
|
98
|
-
weight_unit: 'GRAMS',
|
|
99
|
-
weight_value: '0.00',
|
|
100
|
-
type: 'physical',
|
|
101
|
-
unit: '',
|
|
102
|
-
sort: 9999999,
|
|
103
|
-
bundle_group_count: 0,
|
|
104
|
-
option_group_count: 0,
|
|
105
|
-
is_variant: 0,
|
|
106
|
-
variant_count: 0,
|
|
107
|
-
barcode_formatting: 'None',
|
|
108
|
-
shelf_product_datas: [],
|
|
109
|
-
step_value: 1,
|
|
110
|
-
min_num_unit: 1,
|
|
111
|
-
schedules: [],
|
|
112
|
-
is_charge_tax: 1,
|
|
113
|
-
base_price: '0.00',
|
|
114
|
-
variant: [],
|
|
115
|
-
category: []
|
|
116
|
-
}, {
|
|
117
|
-
id: 57470,
|
|
118
|
-
extension_id: 0,
|
|
119
|
-
extension_type: 'normal',
|
|
120
|
-
shop_id: 9,
|
|
121
|
-
title: '测试灵活计价',
|
|
122
|
-
slug: '测试灵活计价',
|
|
123
|
-
status: 'published',
|
|
124
|
-
stock_quantity: 0,
|
|
125
|
-
sales_quantity: 0,
|
|
126
|
-
sum_stock: 0,
|
|
127
|
-
price: '0.00',
|
|
128
|
-
original_price: '0.00',
|
|
129
|
-
cost_price: '0.00',
|
|
130
|
-
cover: '',
|
|
131
|
-
channel_application: ['online-store', 'pos', 'bbc-module:mebook', 'google_reserve'],
|
|
132
|
-
is_track: 1,
|
|
133
|
-
over_sold: 0,
|
|
134
|
-
is_gst: 1,
|
|
135
|
-
code: '23456',
|
|
136
|
-
barcode: '',
|
|
137
|
-
is_delivery: 1,
|
|
138
|
-
weight_unit: 'GRAMS',
|
|
139
|
-
weight_value: '0.00',
|
|
140
|
-
type: 'physical',
|
|
141
|
-
unit: '',
|
|
142
|
-
sort: 9999999,
|
|
143
|
-
bundle_group_count: 0,
|
|
144
|
-
option_group_count: 0,
|
|
145
|
-
is_variant: 0,
|
|
146
|
-
variant_count: 0,
|
|
147
|
-
barcode_formatting: 'None',
|
|
148
|
-
shelf_product_datas: [],
|
|
149
|
-
step_value: 1,
|
|
150
|
-
min_num_unit: 1,
|
|
151
|
-
schedules: [],
|
|
152
|
-
is_charge_tax: 1,
|
|
153
|
-
base_price: '0.00',
|
|
154
|
-
variant: [],
|
|
155
|
-
category: []
|
|
156
|
-
}];
|
|
32
|
+
var _useAppointmentBookin = useAppointmentBookingContext(),
|
|
33
|
+
appointmentBooking = _useAppointmentBookin.appointmentBooking,
|
|
34
|
+
products = _useAppointmentBookin.products,
|
|
35
|
+
setProducts = _useAppointmentBookin.setProducts;
|
|
36
|
+
useEffect(function () {
|
|
37
|
+
var _ref2 = appointmentBooking.otherParams || {},
|
|
38
|
+
productModuleParams = _ref2.productModuleParams;
|
|
39
|
+
appointmentBooking.loadProducts(productModuleParams).then(function (res) {
|
|
40
|
+
setProducts(res || []);
|
|
41
|
+
});
|
|
42
|
+
}, []);
|
|
157
43
|
var handleSelectProduct = function handleSelectProduct(item) {
|
|
158
44
|
utils === null || utils === void 0 || utils.action({
|
|
159
45
|
type: 'pisell1.productDetail',
|
|
@@ -161,8 +47,12 @@ var Services = function Services() {
|
|
|
161
47
|
detail: item
|
|
162
48
|
},
|
|
163
49
|
callback: function callback(data) {
|
|
164
|
-
|
|
165
|
-
|
|
50
|
+
var product = _objectSpread(_objectSpread({}, data), {}, {
|
|
51
|
+
options: (data === null || data === void 0 ? void 0 : data.option) || []
|
|
52
|
+
});
|
|
53
|
+
delete product.option;
|
|
54
|
+
console.log(product, data, appointmentBooking.storeProduct, 'wh978796');
|
|
55
|
+
appointmentBooking.storeProduct(product);
|
|
166
56
|
}
|
|
167
57
|
});
|
|
168
58
|
};
|