@pisell/private-materials 3.0.199 → 3.0.201
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 +142 -142
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +10 -10
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +10 -10
- package/es/components/booking/addons/model.d.ts +1 -1
- package/es/components/booking/components/customSelect/index.d.ts +1 -0
- package/es/components/booking/components/customSelect/index.js +6 -2
- package/es/components/booking/components/footer/AppointmentProductModal/index.d.ts +3 -0
- package/es/components/booking/components/footer/AppointmentProductModal/index.js +38 -0
- package/es/components/booking/components/footer/AppointmentProductModal/index.less +0 -0
- package/es/components/booking/components/footer/amount.js +45 -22
- package/es/components/booking/components/footer/index.js +84 -40
- package/es/components/booking/components/footer/utils.js +243 -32
- package/es/components/booking/info/addServiceVariant/index.js +8 -1
- package/es/components/booking/info/clientVariant/vertical/SelectDrawer.d.ts +1 -0
- package/es/components/booking/info/clientVariant/vertical/SelectDrawer.js +14 -13
- package/es/components/booking/info/clientVariant/vertical/index.js +33 -4
- package/es/components/booking/info/dateRange/index.d.ts +5 -0
- package/es/components/booking/info/dateRange/index.js +98 -0
- package/es/components/booking/info/dateRange/index.less +21 -0
- package/es/components/booking/info/main.js +20 -8
- package/es/components/booking/info/model.js +3 -0
- package/es/components/booking/info/pet/ChangePetModal/index.d.ts +4 -0
- package/es/components/booking/info/pet/ChangePetModal/index.js +119 -0
- package/es/components/booking/info/pet/ChangePetModal/index.less +4 -0
- package/es/components/booking/info/pet/index.js +54 -5
- package/es/components/booking/info/service/addService/index.js +142 -22
- package/es/components/booking/info/service/addService/index.less +13 -3
- package/es/components/booking/info/service/addService/utils.d.ts +11 -2
- package/es/components/booking/info/service/addService/utils.js +49 -24
- package/es/components/booking/info/service/editService/index.js +255 -44
- package/es/components/booking/info/service/editService/index.less +18 -13
- package/es/components/booking/info/service2/Lists.d.ts +3 -0
- package/es/components/booking/info/service2/Lists.js +158 -0
- package/es/components/booking/info/service2/hooks/useSelectPet.d.ts +6 -0
- package/es/components/booking/info/service2/hooks/useSelectPet.js +54 -0
- package/es/components/booking/info/service2/index.d.ts +3 -0
- package/es/components/booking/info/service2/index.js +58 -0
- package/es/components/booking/info/service2/status.d.ts +31 -0
- package/es/components/booking/info/service2/status.js +78 -0
- package/es/components/booking/info/service2/utils.d.ts +145 -0
- package/es/components/booking/info/service2/utils.js +438 -0
- package/es/components/booking/info/utils.d.ts +9 -0
- package/es/components/booking/info/utils.js +13 -0
- package/es/components/booking/locales.d.ts +60 -0
- package/es/components/booking/locales.js +75 -3
- package/es/components/booking/materiels/holder/index.d.ts +7 -0
- package/es/components/booking/materiels/holder/index.js +51 -0
- package/es/components/booking/model.d.ts +4 -1
- package/es/components/booking/model.js +4 -2
- package/es/components/booking/payments/index.d.ts +1 -1
- package/es/components/booking/utils.d.ts +12 -3
- package/es/components/booking/utils.js +139 -23
- package/es/components/eftpos/form/index.js +6 -12
- package/es/components/eftpos/group/index.d.ts +2 -1
- package/es/components/eftpos/group/index.js +2 -1
- package/es/components/eftpos/index.js +2 -2
- package/es/components/eftposPay/helper.d.ts +0 -1
- package/es/components/eftposPay/helper.js +0 -14
- package/es/components/eftposPay/tyro/index.js +20 -51
- package/es/components/shoppingCart/Provider.d.ts +3 -0
- package/es/components/shoppingCart/Provider.js +86 -0
- package/es/components/shoppingCart/components/Cart/Product.d.ts +4 -0
- package/es/components/shoppingCart/components/Cart/Product.js +96 -0
- package/es/components/shoppingCart/components/Cart/index.d.ts +4 -0
- package/es/components/shoppingCart/components/Cart/index.js +72 -0
- package/es/components/shoppingCart/components/Cart/index.less +68 -0
- package/es/components/shoppingCart/components/Empty/index.d.ts +4 -0
- package/es/components/shoppingCart/components/Empty/index.js +14 -0
- package/es/components/shoppingCart/components/Empty/index.less +19 -0
- package/es/components/shoppingCart/components/Render/index.d.ts +4 -0
- package/es/components/shoppingCart/components/Render/index.js +68 -0
- package/es/components/shoppingCart/components/Render/index.less +2 -0
- package/es/components/shoppingCart/components/SelectHolderModal/index.d.ts +4 -0
- package/es/components/shoppingCart/components/SelectHolderModal/index.js +124 -0
- package/es/components/shoppingCart/components/SelectHolderModal/index.less +32 -0
- package/es/components/shoppingCart/hooks/useAddService.d.ts +3 -0
- package/es/components/shoppingCart/hooks/useAddService.js +23 -0
- package/es/components/shoppingCart/hooks/useClearCart.d.ts +3 -0
- package/es/components/shoppingCart/hooks/useClearCart.js +54 -0
- package/es/components/shoppingCart/hooks/useContext.d.ts +1 -0
- package/es/components/shoppingCart/hooks/useContext.js +5 -0
- package/es/components/shoppingCart/index.d.ts +4 -0
- package/es/components/shoppingCart/index.js +24 -0
- package/es/components/shoppingCart/locales.d.ts +33 -0
- package/es/components/shoppingCart/locales.js +38 -0
- package/es/components/shoppingCart/mock.d.ts +40 -0
- package/es/components/shoppingCart/mock.js +40 -0
- package/es/components/shoppingCart/status.d.ts +2 -0
- package/es/components/shoppingCart/status.js +22 -0
- package/es/components/shoppingCart/type.d.ts +39 -0
- package/es/components/shoppingCart/type.js +1 -0
- package/es/components/shoppingCart/utils.d.ts +63 -0
- package/es/components/shoppingCart/utils.js +119 -0
- package/es/index.d.ts +1 -0
- package/es/index.js +2 -1
- package/lib/components/booking/addons/model.d.ts +1 -1
- package/lib/components/booking/components/customSelect/index.d.ts +1 -0
- package/lib/components/booking/components/customSelect/index.js +6 -2
- package/lib/components/booking/components/footer/AppointmentProductModal/index.d.ts +3 -0
- package/lib/components/booking/components/footer/AppointmentProductModal/index.js +60 -0
- package/lib/components/booking/components/footer/AppointmentProductModal/index.less +0 -0
- package/lib/components/booking/components/footer/amount.js +26 -8
- package/lib/components/booking/components/footer/index.js +25 -4
- package/lib/components/booking/components/footer/utils.js +157 -31
- package/lib/components/booking/info/addServiceVariant/index.js +5 -0
- package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.d.ts +1 -0
- package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.js +8 -7
- package/lib/components/booking/info/clientVariant/vertical/index.js +36 -10
- package/lib/components/booking/info/dateRange/index.d.ts +5 -0
- package/lib/components/booking/info/dateRange/index.js +111 -0
- package/lib/components/booking/info/dateRange/index.less +21 -0
- package/lib/components/booking/info/main.js +11 -4
- package/lib/components/booking/info/model.js +3 -0
- package/lib/components/booking/info/pet/ChangePetModal/index.d.ts +4 -0
- package/lib/components/booking/info/pet/ChangePetModal/index.js +111 -0
- package/lib/components/booking/info/pet/ChangePetModal/index.less +4 -0
- package/lib/components/booking/info/pet/index.js +61 -25
- package/lib/components/booking/info/service/addService/index.js +107 -34
- package/lib/components/booking/info/service/addService/index.less +13 -3
- package/lib/components/booking/info/service/addService/utils.d.ts +11 -2
- package/lib/components/booking/info/service/addService/utils.js +31 -10
- package/lib/components/booking/info/service/editService/index.js +293 -125
- package/lib/components/booking/info/service/editService/index.less +18 -13
- package/lib/components/booking/info/service2/Lists.d.ts +3 -0
- package/lib/components/booking/info/service2/Lists.js +113 -0
- package/lib/components/booking/info/service2/hooks/useSelectPet.d.ts +6 -0
- package/lib/components/booking/info/service2/hooks/useSelectPet.js +50 -0
- package/lib/components/booking/info/service2/index.d.ts +3 -0
- package/lib/components/booking/info/service2/index.js +75 -0
- package/lib/components/booking/info/service2/status.d.ts +31 -0
- package/lib/components/booking/info/service2/status.js +81 -0
- package/lib/components/booking/info/service2/utils.d.ts +145 -0
- package/lib/components/booking/info/service2/utils.js +322 -0
- package/lib/components/booking/info/utils.d.ts +9 -0
- package/lib/components/booking/info/utils.js +6 -0
- package/lib/components/booking/locales.d.ts +60 -0
- package/lib/components/booking/locales.js +63 -3
- package/lib/components/booking/materiels/holder/index.d.ts +7 -0
- package/lib/components/booking/materiels/holder/index.js +65 -0
- package/lib/components/booking/model.d.ts +4 -1
- package/lib/components/booking/model.js +4 -2
- package/lib/components/booking/payments/index.d.ts +1 -1
- package/lib/components/booking/utils.d.ts +12 -3
- package/lib/components/booking/utils.js +87 -15
- package/lib/components/eftpos/form/index.js +6 -12
- package/lib/components/eftpos/group/index.d.ts +2 -1
- package/lib/components/eftpos/group/index.js +1 -0
- package/lib/components/eftpos/index.js +2 -2
- package/lib/components/eftposPay/helper.d.ts +0 -1
- package/lib/components/eftposPay/helper.js +0 -21
- package/lib/components/eftposPay/tyro/index.js +7 -36
- package/lib/components/shoppingCart/Provider.d.ts +3 -0
- package/lib/components/shoppingCart/Provider.js +110 -0
- package/lib/components/shoppingCart/components/Cart/Product.d.ts +4 -0
- package/lib/components/shoppingCart/components/Cart/Product.js +89 -0
- package/lib/components/shoppingCart/components/Cart/index.d.ts +4 -0
- package/lib/components/shoppingCart/components/Cart/index.js +77 -0
- package/lib/components/shoppingCart/components/Cart/index.less +68 -0
- package/lib/components/shoppingCart/components/Empty/index.d.ts +4 -0
- package/lib/components/shoppingCart/components/Empty/index.js +43 -0
- package/lib/components/shoppingCart/components/Empty/index.less +19 -0
- package/lib/components/shoppingCart/components/Render/index.d.ts +4 -0
- package/lib/components/shoppingCart/components/Render/index.js +79 -0
- package/lib/components/shoppingCart/components/Render/index.less +2 -0
- package/lib/components/shoppingCart/components/SelectHolderModal/index.d.ts +4 -0
- package/lib/components/shoppingCart/components/SelectHolderModal/index.js +116 -0
- package/lib/components/shoppingCart/components/SelectHolderModal/index.less +32 -0
- package/lib/components/shoppingCart/hooks/useAddService.d.ts +3 -0
- package/lib/components/shoppingCart/hooks/useAddService.js +55 -0
- package/lib/components/shoppingCart/hooks/useClearCart.d.ts +3 -0
- package/lib/components/shoppingCart/hooks/useClearCart.js +71 -0
- package/lib/components/shoppingCart/hooks/useContext.d.ts +1 -0
- package/lib/components/shoppingCart/hooks/useContext.js +31 -0
- package/lib/components/shoppingCart/index.d.ts +4 -0
- package/lib/components/shoppingCart/index.js +60 -0
- package/lib/components/shoppingCart/locales.d.ts +33 -0
- package/lib/components/shoppingCart/locales.js +56 -0
- package/lib/components/shoppingCart/mock.d.ts +40 -0
- package/lib/components/shoppingCart/mock.js +76 -0
- package/lib/components/shoppingCart/status.d.ts +2 -0
- package/lib/components/shoppingCart/status.js +60 -0
- package/lib/components/shoppingCart/type.d.ts +39 -0
- package/lib/components/shoppingCart/type.js +17 -0
- package/lib/components/shoppingCart/utils.d.ts +63 -0
- package/lib/components/shoppingCart/utils.js +92 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +3 -0
- package/lowcode/shopping-cart/meta.ts +98 -0
- package/package.json +4 -4
- package/es/components/eftpos/receipt/index.d.ts +0 -24
- package/es/components/eftpos/receipt/index.js +0 -96
- package/lib/components/eftpos/receipt/index.d.ts +0 -24
- package/lib/components/eftpos/receipt/index.js +0 -88
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import React, { useEffect, useMemo, useState } from 'react';
|
|
8
|
+
import { CalendarOutlined } from '@ant-design/icons';
|
|
9
|
+
import classNames from 'classnames';
|
|
10
|
+
import dayjs from 'dayjs';
|
|
11
|
+
import { DatePicker, Page } from '@pisell/materials';
|
|
12
|
+
import "./index.less";
|
|
13
|
+
|
|
14
|
+
// 禁用之前的日期
|
|
15
|
+
export var disabledDate = function disabledDate(current, position, currentDate) {
|
|
16
|
+
if (position === 'start') {
|
|
17
|
+
return false;
|
|
18
|
+
}
|
|
19
|
+
if (position === 'end' && current.endOf('day') && currentDate !== null && currentDate !== void 0 && currentDate[0]) {
|
|
20
|
+
// 结束日期最大 = 开始日期 + 8个月
|
|
21
|
+
var endDisabled = currentDate === null || currentDate === void 0 ? void 0 : currentDate[0].add(8, 'months').format('YYYY-MM-DD');
|
|
22
|
+
return dayjs(endDisabled) < current.startOf('day') || current.startOf('day') <= (currentDate === null || currentDate === void 0 ? void 0 : currentDate[0]);
|
|
23
|
+
}
|
|
24
|
+
return current && current <= (currentDate === null || currentDate === void 0 ? void 0 : currentDate[0]);
|
|
25
|
+
};
|
|
26
|
+
var DateRange = function DateRange(_ref) {
|
|
27
|
+
var state = _ref.state,
|
|
28
|
+
dispatch = _ref.dispatch,
|
|
29
|
+
key = _ref.key;
|
|
30
|
+
var _useState = useState([]),
|
|
31
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
32
|
+
value = _useState2[0],
|
|
33
|
+
setValue = _useState2[1];
|
|
34
|
+
useEffect(function () {
|
|
35
|
+
var _state$date, _state$date2;
|
|
36
|
+
var lists = [(_state$date = state.date) === null || _state$date === void 0 ? void 0 : _state$date.value, (_state$date2 = state.date) === null || _state$date2 === void 0 ? void 0 : _state$date2.end_date];
|
|
37
|
+
setValue(lists);
|
|
38
|
+
console.log('lists', lists);
|
|
39
|
+
}, [state.date]);
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @title: 点击确定
|
|
43
|
+
* @description:
|
|
44
|
+
* @param {any} e
|
|
45
|
+
* @return {*}
|
|
46
|
+
* @Author: WangHan
|
|
47
|
+
* @Date: 2024-12-12 15:39
|
|
48
|
+
*/
|
|
49
|
+
var dateChange = function dateChange(e) {
|
|
50
|
+
dispatch({
|
|
51
|
+
type: 'setDate',
|
|
52
|
+
payload: {
|
|
53
|
+
value: e[0],
|
|
54
|
+
end_date: e[1],
|
|
55
|
+
edit: true
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* @title: 格式化语言
|
|
62
|
+
* @description:
|
|
63
|
+
* @param {*} useMemo
|
|
64
|
+
* @return {*}
|
|
65
|
+
* @Author: WangHan
|
|
66
|
+
* @Date: 2024-12-09 17:47
|
|
67
|
+
*/
|
|
68
|
+
var formatLocale = useMemo(function () {
|
|
69
|
+
var locale = state === null || state === void 0 ? void 0 : state.locale;
|
|
70
|
+
var isEn = locale === 'en' || locale === 'en-US';
|
|
71
|
+
var _format = isEn ? 'DD/MM/YYYY' : 'YYYY-MM-DD';
|
|
72
|
+
return _format;
|
|
73
|
+
}, [state === null || state === void 0 ? void 0 : state.locale, state.date]);
|
|
74
|
+
return useMemo(function () {
|
|
75
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
76
|
+
className: classNames('pisell-lowcode__booking-service-header-date-range', {
|
|
77
|
+
'pisell-lowcode__booking-service-header-date-range-terminal': state.isTerminalDayBookingPage
|
|
78
|
+
})
|
|
79
|
+
}, /*#__PURE__*/React.createElement(Page, null, /*#__PURE__*/React.createElement(DatePicker.RangePicker, {
|
|
80
|
+
key: key,
|
|
81
|
+
inputReadOnly: true,
|
|
82
|
+
allowClear: false,
|
|
83
|
+
size: "large",
|
|
84
|
+
style: {
|
|
85
|
+
width: '100%',
|
|
86
|
+
padding: 0
|
|
87
|
+
},
|
|
88
|
+
suffixIcon: !state.disabledEdit ? /*#__PURE__*/React.createElement(CalendarOutlined, null) : null,
|
|
89
|
+
disabledDate: disabledDate,
|
|
90
|
+
value: [value[0], value[1]],
|
|
91
|
+
onChange: dateChange,
|
|
92
|
+
format: formatLocale,
|
|
93
|
+
isHideCustomSelect: true,
|
|
94
|
+
endDateDays: 1
|
|
95
|
+
}))));
|
|
96
|
+
}, [value, state.disabledEdit, state === null || state === void 0 ? void 0 : state.locale]);
|
|
97
|
+
};
|
|
98
|
+
export default DateRange;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
.pisell-lowcode__booking-service-header-date-range {
|
|
2
|
+
flex: 1.1;
|
|
3
|
+
margin-top: 16px;
|
|
4
|
+
|
|
5
|
+
.pisell-date-range-picker > div > div {
|
|
6
|
+
height: 44px !important;
|
|
7
|
+
cursor: pointer !important;
|
|
8
|
+
input {
|
|
9
|
+
cursor: pointer;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.anticon-calendar {
|
|
14
|
+
font-size: 20px;
|
|
15
|
+
color: #667085;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.pisell-lowcode__booking-service-header-date-range-terminal {
|
|
20
|
+
margin-top: 0;
|
|
21
|
+
}
|
|
@@ -23,17 +23,20 @@ import Notes from "./notes";
|
|
|
23
23
|
import "./index.less";
|
|
24
24
|
import classNames from 'classnames';
|
|
25
25
|
import { Skeleton } from 'antd';
|
|
26
|
+
import { Service2Cart } from "./service2";
|
|
27
|
+
import { isDayBooking, isTerminalDayBooking } from "./service2/utils";
|
|
26
28
|
import useCreateBookingPageHeader from "../hooks/useCreateBookingPageHeader";
|
|
27
29
|
var defaultModules = {
|
|
28
30
|
client: 1,
|
|
29
31
|
date: 1,
|
|
30
32
|
service: 1,
|
|
31
33
|
holder: 1,
|
|
32
|
-
note: 1
|
|
34
|
+
note: 1,
|
|
35
|
+
service2: 0
|
|
33
36
|
};
|
|
34
37
|
locales.init(localeTexts, localStorage.getItem('umi_locale') || 'en');
|
|
35
38
|
var Info = Provider(function (props) {
|
|
36
|
-
var _modal$state2, _modal$state2$booking, _modal$state2$booking2, _modal$state2$booking3, _modal$
|
|
39
|
+
var _modal$state2, _modal$state2$booking, _modal$state2$booking2, _modal$state2$booking3, _modal$state5, _modal$state5$notes, _context$appHelper4, _context$appHelper4$u, _classNames, _modal$state6, _React$createElement;
|
|
37
40
|
// return <Payments {...props} />;
|
|
38
41
|
var style = props.style,
|
|
39
42
|
globalState = props.globalState,
|
|
@@ -105,15 +108,24 @@ var Info = Provider(function (props) {
|
|
|
105
108
|
});
|
|
106
109
|
}, [globalState === null || globalState === void 0 ? void 0 : globalState.bookingId, modal.state, modal.dispatch, globalState === null || globalState === void 0 ? void 0 : globalState.renderType]);
|
|
107
110
|
var notes = useMemo(function () {
|
|
108
|
-
var _modal$
|
|
111
|
+
var _modal$state4, _modal$state4$notes;
|
|
109
112
|
if (!modules.note) {
|
|
110
113
|
return null;
|
|
111
114
|
}
|
|
115
|
+
|
|
116
|
+
// 跨日预约一直显示备注
|
|
117
|
+
if (isDayBooking(globalState)) {
|
|
118
|
+
var _modal$state3, _modal$state3$notes;
|
|
119
|
+
return /*#__PURE__*/React.createElement(AddNote, {
|
|
120
|
+
value: (_modal$state3 = modal.state) === null || _modal$state3 === void 0 ? void 0 : (_modal$state3$notes = _modal$state3.notes) === null || _modal$state3$notes === void 0 ? void 0 : _modal$state3$notes.orderNote,
|
|
121
|
+
onChange: addNote
|
|
122
|
+
});
|
|
123
|
+
}
|
|
112
124
|
return globalState !== null && globalState !== void 0 && globalState.bookingId ? globalState.renderType === 'eventBooking' || globalState.isBookingCreatePage ? /*#__PURE__*/React.createElement(Notes, null) : null : /*#__PURE__*/React.createElement(AddNote, {
|
|
113
|
-
value: (_modal$
|
|
125
|
+
value: (_modal$state4 = modal.state) === null || _modal$state4 === void 0 ? void 0 : (_modal$state4$notes = _modal$state4.notes) === null || _modal$state4$notes === void 0 ? void 0 : _modal$state4$notes.orderNote,
|
|
114
126
|
onChange: addNote
|
|
115
127
|
});
|
|
116
|
-
}, [modules.note, globalState === null || globalState === void 0 ? void 0 : globalState.bookingId, globalState.render, (_modal$
|
|
128
|
+
}, [modules.note, globalState === null || globalState === void 0 ? void 0 : globalState.bookingId, globalState.render, (_modal$state5 = modal.state) === null || _modal$state5 === void 0 ? void 0 : (_modal$state5$notes = _modal$state5.notes) === null || _modal$state5$notes === void 0 ? void 0 : _modal$state5$notes.orderNote]);
|
|
117
129
|
return /*#__PURE__*/React.createElement(React.Fragment, null, !!modal.state.setGlobalState ? /*#__PURE__*/React.createElement(TabPane, (_React$createElement = {
|
|
118
130
|
style: style,
|
|
119
131
|
header: header,
|
|
@@ -124,9 +136,9 @@ var Info = Provider(function (props) {
|
|
|
124
136
|
})
|
|
125
137
|
}, _defineProperty(_React$createElement, "style", {
|
|
126
138
|
height: context !== null && context !== void 0 && (_context$appHelper4 = context.appHelper) !== null && _context$appHelper4 !== void 0 && (_context$appHelper4$u = _context$appHelper4.utils) !== null && _context$appHelper4$u !== void 0 && _context$appHelper4$u.isMobile ? '100%' : '100vh'
|
|
127
|
-
}), _defineProperty(_React$createElement, "bodyClassName", classNames('booking-info-warp', (_classNames = {}, _defineProperty(_classNames, 'create-booking-page-info-wrap', isBookingCreatePage), _defineProperty(_classNames, 'create-booking-page-info-wrap-create', isBookingCreatePageCreateMode), _classNames))), _React$createElement), /*#__PURE__*/React.createElement("div", {
|
|
139
|
+
}), _defineProperty(_React$createElement, "bodyClassName", classNames('booking-info-warp', (_classNames = {}, _defineProperty(_classNames, 'create-booking-page-info-wrap', isBookingCreatePage), _defineProperty(_classNames, 'create-booking-page-info-wrap-create', isBookingCreatePageCreateMode && !isTerminalDayBooking(modal.state)), _classNames))), _React$createElement), /*#__PURE__*/React.createElement("div", {
|
|
128
140
|
className: "booking-info"
|
|
129
|
-
}, createHeader, modules.client ? /*#__PURE__*/React.createElement(Client, null) : null, modules.holder && !((_modal$
|
|
141
|
+
}, createHeader, modules.client ? /*#__PURE__*/React.createElement(Client, null) : null, modules.holder && !((_modal$state6 = modal.state) !== null && _modal$state6 !== void 0 && _modal$state6.disabledEdit) ? /*#__PURE__*/React.createElement(React.Fragment, null, params.type === 'form' ? /*#__PURE__*/React.createElement(Pet, null) : null) : null, modules.date ? /*#__PURE__*/React.createElement(DateCom, null) : null, /*#__PURE__*/React.createElement(Skeleton, {
|
|
130
142
|
loading: globalState.loading,
|
|
131
143
|
round: true,
|
|
132
144
|
active: true,
|
|
@@ -134,6 +146,6 @@ var Info = Provider(function (props) {
|
|
|
134
146
|
style: {
|
|
135
147
|
paddingTop: 20
|
|
136
148
|
}
|
|
137
|
-
}, modules.service ? /*#__PURE__*/React.createElement(React.Fragment, null, modal.state.date.value ? /*#__PURE__*/React.createElement(Service, null) : null) : null, notes, slot ? slot : null))) : null);
|
|
149
|
+
}, modules.service ? /*#__PURE__*/React.createElement(React.Fragment, null, modal.state.date.value ? /*#__PURE__*/React.createElement(Service, null) : null) : null, modules.service2 ? /*#__PURE__*/React.createElement(React.Fragment, null, modal.state.date.value ? /*#__PURE__*/React.createElement(Service2Cart, null) : null) : null, notes, slot ? slot : null))) : null);
|
|
138
150
|
});
|
|
139
151
|
export default Info;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
+
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(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
+
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
8
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
10
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
11
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
12
|
+
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."); }
|
|
13
|
+
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); }
|
|
14
|
+
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; }
|
|
15
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
16
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
17
|
+
import React, { useState, forwardRef, useImperativeHandle } from 'react';
|
|
18
|
+
import { locales } from '@pisell/utils';
|
|
19
|
+
import { PisellModal } from '@pisell/materials';
|
|
20
|
+
import { appointmentTypes } from "../../service2/status";
|
|
21
|
+
import "./index.less";
|
|
22
|
+
var ChangePetModal = function ChangePetModal(props, ref) {
|
|
23
|
+
var _useState = useState(false),
|
|
24
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
25
|
+
open = _useState2[0],
|
|
26
|
+
setOpen = _useState2[1];
|
|
27
|
+
var _useState3 = useState({}),
|
|
28
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
29
|
+
params = _useState4[0],
|
|
30
|
+
setParams = _useState4[1];
|
|
31
|
+
useImperativeHandle(ref, function () {
|
|
32
|
+
return {
|
|
33
|
+
open: function open(e) {
|
|
34
|
+
setParams(e);
|
|
35
|
+
setOpen(true);
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* @title: 确认之后的操作
|
|
42
|
+
* @description:
|
|
43
|
+
* @param {string} type
|
|
44
|
+
* @return {*}
|
|
45
|
+
* @Author: WangHan
|
|
46
|
+
* @Date: 2024-12-12 22:56
|
|
47
|
+
*/
|
|
48
|
+
var handleProduct = function handleProduct(type) {
|
|
49
|
+
var ids = params.ids,
|
|
50
|
+
service = params.service,
|
|
51
|
+
dispatch = params.dispatch,
|
|
52
|
+
setGlobalState = params.setGlobalState,
|
|
53
|
+
state = params.state;
|
|
54
|
+
var _service = _toConsumableArray(service || []);
|
|
55
|
+
if (type === 'ok') {
|
|
56
|
+
var _service2;
|
|
57
|
+
// 将商品放在open items中
|
|
58
|
+
_service = (_service2 = _service) === null || _service2 === void 0 ? void 0 : _service2.map(function (item) {
|
|
59
|
+
if (ids !== null && ids !== void 0 && ids.includes(item._extend.holder_id)) {
|
|
60
|
+
return _objectSpread(_objectSpread({}, item), {}, {
|
|
61
|
+
_extend: _objectSpread(_objectSpread({}, item._extend || {}), {}, {
|
|
62
|
+
holder_id: 0
|
|
63
|
+
})
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
return item;
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
// 预约商品不能放在open items中, 所以过滤掉 holder_id为0 并且是预约商品的数据
|
|
70
|
+
_service = _service.filter(function (item) {
|
|
71
|
+
var _item$_extend;
|
|
72
|
+
return !((item === null || item === void 0 ? void 0 : (_item$_extend = item._extend) === null || _item$_extend === void 0 ? void 0 : _item$_extend.holder_id) === 0 && appointmentTypes.includes(item.extension_type));
|
|
73
|
+
});
|
|
74
|
+
} else {
|
|
75
|
+
// 将商品数据清空
|
|
76
|
+
_service = _service.filter(function (item) {
|
|
77
|
+
return !ids.includes(item._extend.holder_id);
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
// 更新服务商品列表
|
|
82
|
+
if (dispatch) {
|
|
83
|
+
dispatch({
|
|
84
|
+
type: 'setService',
|
|
85
|
+
payload: {
|
|
86
|
+
value: _toConsumableArray(_service),
|
|
87
|
+
edit: true
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
} else {
|
|
91
|
+
setGlobalState({
|
|
92
|
+
service: _objectSpread(_objectSpread({}, state.service), {}, {
|
|
93
|
+
edit: true,
|
|
94
|
+
value: _toConsumableArray(_service)
|
|
95
|
+
})
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
setOpen(false);
|
|
99
|
+
};
|
|
100
|
+
return /*#__PURE__*/React.createElement(PisellModal.Information, {
|
|
101
|
+
open: open,
|
|
102
|
+
platform: "pc",
|
|
103
|
+
width: 432,
|
|
104
|
+
title: locales.getText('pisell2.text.change.pet.title'),
|
|
105
|
+
describe: /*#__PURE__*/React.createElement("div", {
|
|
106
|
+
className: "pisell2-change-pet-modal-content"
|
|
107
|
+
}, /*#__PURE__*/React.createElement("span", null, locales.getText('pisell2.text.change.pet.content')), /*#__PURE__*/React.createElement("span", null, locales.getText('pisell2.text.change.pet.content1'))),
|
|
108
|
+
cancelText: locales.getText('pisell2.text.change.pet.cancel'),
|
|
109
|
+
okText: locales.getText('pisell2.text.change.pet.confirm'),
|
|
110
|
+
closable: true,
|
|
111
|
+
onOk: function onOk() {
|
|
112
|
+
return handleProduct('ok');
|
|
113
|
+
},
|
|
114
|
+
onCancel: function onCancel() {
|
|
115
|
+
return handleProduct('cancel');
|
|
116
|
+
}
|
|
117
|
+
});
|
|
118
|
+
};
|
|
119
|
+
export default /*#__PURE__*/forwardRef(ChangePetModal);
|
|
@@ -18,7 +18,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
18
18
|
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; }
|
|
19
19
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
20
20
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
21
|
-
import React, { useContext, useEffect, useMemo, useState } from 'react';
|
|
21
|
+
import React, { useContext, useEffect, useMemo, useState, useRef } from 'react';
|
|
22
22
|
import User01 from '@pisell/icon/es/User01';
|
|
23
23
|
import { Context } from "../model";
|
|
24
24
|
import { Avatar, Skeleton, Button } from 'antd';
|
|
@@ -28,7 +28,9 @@ import FormsCom from "../../forms/forms";
|
|
|
28
28
|
import { changeFormValues, sortFormValues } from "../../forms/format";
|
|
29
29
|
import { isWalkIn } from "../../utils";
|
|
30
30
|
import useEngineContext from "../../../../hooks/useEngineContext";
|
|
31
|
-
import { useMemoizedFn } from
|
|
31
|
+
import { useMemoizedFn } from 'ahooks';
|
|
32
|
+
import { isDayBooking } from "../../info/service2/utils";
|
|
33
|
+
import ChangePetModal from "./ChangePetModal";
|
|
32
34
|
var defaultParams = {
|
|
33
35
|
skip: 1,
|
|
34
36
|
num: 20,
|
|
@@ -64,6 +66,7 @@ var Pet = function Pet(props) {
|
|
|
64
66
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
65
67
|
params = _useState8[0],
|
|
66
68
|
setParams = _useState8[1];
|
|
69
|
+
var changePetRef = useRef(null);
|
|
67
70
|
state = state || (props === null || props === void 0 ? void 0 : props.state);
|
|
68
71
|
dispatch = dispatch || (props === null || props === void 0 ? void 0 : props.dispatch);
|
|
69
72
|
// board设置, 获取预约主体
|
|
@@ -298,10 +301,19 @@ var Pet = function Pet(props) {
|
|
|
298
301
|
var cur = _toConsumableArray(state.pet.value[petForm.form_id] || []);
|
|
299
302
|
var options = ((_state$pet3 = state.pet) === null || _state$pet3 === void 0 ? void 0 : (_state$pet3$formData = _state$pet3.formData) === null || _state$pet3$formData === void 0 ? void 0 : (_state$pet3$formData$ = _state$pet3$formData[0]) === null || _state$pet3$formData$ === void 0 ? void 0 : _state$pet3$formData$.options) || [];
|
|
300
303
|
if (res.type === 'delete') {
|
|
304
|
+
var isDay = isDayBooking(state);
|
|
305
|
+
|
|
306
|
+
// 跨日预约在不能编辑情况下不能删除
|
|
307
|
+
if (isDay && state.disabledEdit) return cur;
|
|
301
308
|
cur = cur.filter(function (d) {
|
|
302
309
|
return d.form_record_id !== item.form_record_id;
|
|
303
310
|
});
|
|
304
311
|
_addCallback();
|
|
312
|
+
|
|
313
|
+
// 跨日预约移除的时候则删除商品数据
|
|
314
|
+
if (isDay) {
|
|
315
|
+
handleDayChange(item);
|
|
316
|
+
}
|
|
305
317
|
} else {
|
|
306
318
|
var obj = {
|
|
307
319
|
customer: item === null || item === void 0 ? void 0 : item.customer,
|
|
@@ -476,6 +488,41 @@ var Pet = function Pet(props) {
|
|
|
476
488
|
}
|
|
477
489
|
}, locales.getText('pisell2.text.load-more'))) : null;
|
|
478
490
|
}, [loadLoading, params, (_state$pet9 = state.pet) === null || _state$pet9 === void 0 ? void 0 : (_state$pet9$formData = _state$pet9.formData) === null || _state$pet9$formData === void 0 ? void 0 : (_state$pet9$formData$ = _state$pet9$formData[0]) === null || _state$pet9$formData$ === void 0 ? void 0 : (_state$pet9$formData$2 = _state$pet9$formData$.options) === null || _state$pet9$formData$2 === void 0 ? void 0 : _state$pet9$formData$2.length]);
|
|
491
|
+
var handleDayChange = function handleDayChange(e) {
|
|
492
|
+
var _state$service$value;
|
|
493
|
+
var id = e === null || e === void 0 ? void 0 : e.form_record_id;
|
|
494
|
+
var service = (_state$service$value = state.service.value) === null || _state$service$value === void 0 ? void 0 : _state$service$value.filter(function (item) {
|
|
495
|
+
return item._extend.holder_id === id;
|
|
496
|
+
});
|
|
497
|
+
|
|
498
|
+
// 有form_id 并且购物车下有商品数据
|
|
499
|
+
if (id && service !== null && service !== void 0 && service.length) {
|
|
500
|
+
var _state$service;
|
|
501
|
+
changePetRef === null || changePetRef === void 0 ? void 0 : changePetRef.current.open({
|
|
502
|
+
ids: [id],
|
|
503
|
+
dispatch: dispatch,
|
|
504
|
+
service: ((_state$service = state.service) === null || _state$service === void 0 ? void 0 : _state$service.value) || []
|
|
505
|
+
});
|
|
506
|
+
}
|
|
507
|
+
};
|
|
508
|
+
|
|
509
|
+
/**
|
|
510
|
+
* @title: 跨日预约其他自定义方法
|
|
511
|
+
* @description:
|
|
512
|
+
* @param {*} useMemo
|
|
513
|
+
* @return {*}
|
|
514
|
+
* @Author: WangHan
|
|
515
|
+
* @Date: 2024-12-12 22:30
|
|
516
|
+
*/
|
|
517
|
+
var dayCustomSelect = useMemo(function () {
|
|
518
|
+
var isDay = isDayBooking(state);
|
|
519
|
+
if (isDay) {
|
|
520
|
+
return {
|
|
521
|
+
handleDayChange: handleDayChange
|
|
522
|
+
};
|
|
523
|
+
}
|
|
524
|
+
return {};
|
|
525
|
+
}, [state.renderType, state.service.value]);
|
|
479
526
|
return useMemo(function () {
|
|
480
527
|
var _state$client11;
|
|
481
528
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -502,7 +549,7 @@ var Pet = function Pet(props) {
|
|
|
502
549
|
value: state.pet.value,
|
|
503
550
|
onChange: onValueChange,
|
|
504
551
|
client: (_state$client11 = state.client) === null || _state$client11 === void 0 ? void 0 : _state$client11.value,
|
|
505
|
-
customSelectProps: {
|
|
552
|
+
customSelectProps: _objectSpread({
|
|
506
553
|
loading: loading,
|
|
507
554
|
handleViewItem: handleViewItem,
|
|
508
555
|
virtualListHeight: window.innerHeight - 213 - 57 - 16,
|
|
@@ -520,7 +567,7 @@ var Pet = function Pet(props) {
|
|
|
520
567
|
},
|
|
521
568
|
handleOpenModal: handleOpenModal,
|
|
522
569
|
previewItemTitleRender: previewItemTitleRender
|
|
523
|
-
},
|
|
570
|
+
}, dayCustomSelect),
|
|
524
571
|
optionRender: function optionRender(item) {
|
|
525
572
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Avatar, {
|
|
526
573
|
className: "pisell-lowcode__booking-pet-list-item-avatar",
|
|
@@ -578,7 +625,9 @@ var Pet = function Pet(props) {
|
|
|
578
625
|
return addCallback;
|
|
579
626
|
}()
|
|
580
627
|
}, addButtonProps)
|
|
581
|
-
}))
|
|
628
|
+
})), /*#__PURE__*/React.createElement(ChangePetModal, {
|
|
629
|
+
ref: changePetRef
|
|
630
|
+
}));
|
|
582
631
|
}, [valueLoading, hideTitle, state.pet.value, state.pet.formData, state.action, state.modalOpen, state.pet.value, (_state$client12 = state.client) === null || _state$client12 === void 0 ? void 0 : _state$client12.value, loading, state.disabledEdit, state.isTerminal, state.disableEventBookingEdit, params.search, loadMore, addButtonProps, state.isBookingCreatePage]);
|
|
583
632
|
};
|
|
584
633
|
export default Pet;
|