@pisell/private-materials 6.2.25 → 6.2.27
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 +143 -159
- 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/deposit/components/PolicyModal/index.js +1 -1
- package/es/components/booking/components/customSelect/index.js +1 -0
- package/es/components/booking/components/customiseItemModal/index.js +5 -1
- package/es/components/booking/components/formItemChildrenWrap/index.d.ts +0 -1
- package/es/components/booking/forms/table/index.d.ts +0 -1
- package/es/components/booking/hooks/useClearCart.js +11 -8
- package/es/components/booking/info/addServiceVariant/index.d.ts +0 -1
- package/es/components/booking/info/client/index.js +3 -2
- package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
- package/es/components/booking/info/hooks/useInfoHolder.js +13 -14
- package/es/components/booking/info/index.d.ts +0 -1
- package/es/components/booking/info/service/Lists.js +37 -27
- package/es/components/booking/info/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info/service/editService/constants.d.ts +1 -0
- package/es/components/booking/info/service/editService/constants.js +3 -0
- package/es/components/booking/info/service/editService/index.js +15 -10
- package/es/components/booking/info/service/like/index.d.ts +0 -1
- package/es/components/booking/info/service2/utils.js +29 -21
- package/es/components/booking/info2/index.js +1 -0
- package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info2/service/addService/utils.js +6 -3
- package/es/components/booking/info2/service/addTimeModal/index.js +3 -0
- package/es/components/booking/info2/service/editService/Resources/index.js +5 -0
- package/es/components/booking/info2/service/editService/index.js +265 -170
- package/es/components/booking/info2/service/index.js +22 -19
- package/es/components/booking/info2/utilsByBooking.js +2 -1
- package/es/components/booking/materiels/duration/index.js +9 -2
- package/es/components/booking/materiels/holder/index.d.ts +0 -1
- package/es/components/booking/materiels/startTime/index.d.ts +0 -1
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/eftpos/deviceList/index.d.ts +0 -1
- package/es/components/eftpos/form/index.d.ts +0 -1
- package/es/components/eftpos/group/index.d.ts +0 -1
- package/es/components/eftpos/hooks.d.ts +0 -1
- package/es/components/eftpos/icon/apiKey.d.ts +0 -1
- package/es/components/eftpos/icon/device.d.ts +0 -1
- package/es/components/eftpos/receipt/index.d.ts +0 -1
- package/es/components/eftpos/surcharge/index.d.ts +0 -1
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/app.d.ts +0 -1
- package/es/components/eftposPay/component/alert/warn.d.ts +0 -1
- package/es/components/eftposPay/component/header/titlebar.d.ts +0 -1
- package/es/components/eftposPay/component/step/index.d.ts +0 -1
- package/es/components/eftposPay/component/step/step.d.ts +0 -1
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +2 -2
- package/es/components/eftposPay/store/index.d.ts +5 -5
- package/es/components/eftposPay/tyro/hooks.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +0 -1
- package/es/components/productExtension/fields/Forms/index.d.ts +0 -1
- package/es/components/schedules/calendar/calendarItem.d.ts +0 -1
- package/es/components/schedules/components/CurrentDay/index.d.ts +0 -1
- package/es/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +0 -1
- package/es/components/schedules/products/index.d.ts +0 -1
- package/es/components/schedules/resources/relationProduct/index.d.ts +0 -1
- package/es/components/shoppingCart/components/Cart/Product.js +77 -51
- package/es/components/shoppingCart/components/Cart/index.js +21 -18
- package/es/components/shoppingCart/components/Cart/index.less +14 -0
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +171 -151
- package/es/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -1
- package/es/components/ticketBooking/components/addServiceVariant/utils.js +4 -3
- package/es/components/ticketBooking/components/timeBar/index.js +77 -73
- package/es/components/ticketBooking/index.less +1 -1
- package/es/components/ticketBooking/utils/index.js +13 -8
- package/es/plus/clientName/index.d.ts +0 -1
- package/es/pro/pisellNumberSelector/index.less +1 -1
- package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.js +1 -1
- package/lib/components/booking/components/customSelect/index.js +1 -0
- package/lib/components/booking/components/customiseItemModal/index.js +7 -1
- package/lib/components/booking/components/formItemChildrenWrap/index.d.ts +0 -1
- package/lib/components/booking/forms/table/index.d.ts +0 -1
- package/lib/components/booking/hooks/useClearCart.js +16 -13
- package/lib/components/booking/info/addServiceVariant/index.d.ts +0 -1
- package/lib/components/booking/info/client/index.js +5 -4
- package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
- package/lib/components/booking/info/hooks/useInfoHolder.js +12 -13
- package/lib/components/booking/info/index.d.ts +0 -1
- package/lib/components/booking/info/service/Lists.js +36 -24
- package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info/service/editService/constants.d.ts +1 -0
- package/lib/components/booking/info/service/editService/constants.js +31 -0
- package/lib/components/booking/info/service/editService/index.js +7 -1
- package/lib/components/booking/info/service/like/index.d.ts +0 -1
- package/lib/components/booking/info/service2/utils.js +26 -17
- package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info2/service/addService/utils.js +4 -2
- package/lib/components/booking/info2/service/addTimeModal/index.js +3 -0
- package/lib/components/booking/info2/service/editService/Resources/index.js +2 -0
- package/lib/components/booking/info2/service/editService/index.js +138 -74
- package/lib/components/booking/info2/service/index.js +14 -10
- package/lib/components/booking/info2/utilsByBooking.js +2 -1
- package/lib/components/booking/materiels/duration/index.js +7 -2
- package/lib/components/booking/materiels/holder/index.d.ts +0 -1
- package/lib/components/booking/materiels/startTime/index.d.ts +0 -1
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/eftpos/deviceList/index.d.ts +0 -1
- package/lib/components/eftpos/form/index.d.ts +0 -1
- package/lib/components/eftpos/group/index.d.ts +0 -1
- package/lib/components/eftpos/hooks.d.ts +0 -1
- package/lib/components/eftpos/icon/apiKey.d.ts +0 -1
- package/lib/components/eftpos/icon/device.d.ts +0 -1
- package/lib/components/eftpos/receipt/index.d.ts +0 -1
- package/lib/components/eftpos/surcharge/index.d.ts +0 -1
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/app.d.ts +0 -1
- package/lib/components/eftposPay/component/alert/warn.d.ts +0 -1
- package/lib/components/eftposPay/component/header/titlebar.d.ts +0 -1
- package/lib/components/eftposPay/component/step/index.d.ts +0 -1
- package/lib/components/eftposPay/component/step/step.d.ts +0 -1
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +2 -2
- package/lib/components/eftposPay/store/index.d.ts +5 -5
- package/lib/components/eftposPay/tyro/hooks.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +0 -1
- package/lib/components/productExtension/fields/Forms/index.d.ts +0 -1
- package/lib/components/schedules/calendar/calendarItem.d.ts +0 -1
- package/lib/components/schedules/components/CurrentDay/index.d.ts +0 -1
- package/lib/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +0 -1
- package/lib/components/schedules/products/index.d.ts +0 -1
- package/lib/components/schedules/resources/relationProduct/index.d.ts +0 -1
- package/lib/components/shoppingCart/components/Cart/Product.js +58 -31
- package/lib/components/shoppingCart/components/Cart/index.js +18 -15
- package/lib/components/shoppingCart/components/Cart/index.less +14 -0
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +140 -122
- package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -1
- package/lib/components/ticketBooking/components/addServiceVariant/utils.js +2 -1
- package/lib/components/ticketBooking/components/timeBar/index.js +98 -94
- package/lib/components/ticketBooking/index.less +1 -1
- package/lib/components/ticketBooking/utils/index.js +4 -4
- package/lib/plus/clientName/index.d.ts +0 -1
- package/lib/pro/pisellNumberSelector/index.less +1 -1
- package/package.json +4 -4
@@ -102,7 +102,7 @@ var DepositModal = function DepositModal(props) {
|
|
102
102
|
minHeight: '300px'
|
103
103
|
},
|
104
104
|
destroyOnClose: true,
|
105
|
-
title: (item === null || item === void 0 ? void 0 : item.title) || (policy === null || policy === void 0 ? void 0 : policy.title) ||
|
105
|
+
title: (item === null || item === void 0 ? void 0 : item.title) || (policy === null || policy === void 0 ? void 0 : policy.title) || undefined,
|
106
106
|
onCancel: onCancel,
|
107
107
|
mobileModalHeight: 'auto',
|
108
108
|
className: 'policy-modal-wrap',
|
@@ -74,6 +74,7 @@ var CustomSelect = function CustomSelect(props, ref) {
|
|
74
74
|
showDropDown = _props$showDropDown === void 0 ? true : _props$showDropDown,
|
75
75
|
propsHandleOpenModal = props.handleOpenModal,
|
76
76
|
handleDayChange = props.handleDayChange;
|
77
|
+
console.log('custom select');
|
77
78
|
var searchRef = useRef();
|
78
79
|
|
79
80
|
// 当前选择的值
|
@@ -269,7 +269,11 @@ var CustomiseItemModal = function CustomiseItemModal(_ref) {
|
|
269
269
|
step: 1,
|
270
270
|
disabled: disabled,
|
271
271
|
onChange: function onChange(value) {
|
272
|
-
|
272
|
+
if (value < 1) {
|
273
|
+
setQuantity(1);
|
274
|
+
} else {
|
275
|
+
setQuantity(value);
|
276
|
+
}
|
273
277
|
},
|
274
278
|
size: "middle",
|
275
279
|
enablePriceAdjust: true
|
@@ -2,12 +2,12 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
|
|
2
2
|
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; }
|
3
3
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
4
4
|
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); }
|
5
|
-
import React from 'react';
|
5
|
+
import React, { useMemo } from 'react';
|
6
6
|
import classNames from 'classnames';
|
7
7
|
import { Iconfont } from '@pisell/materials';
|
8
8
|
import { locales } from "@pisell/utils";
|
9
9
|
var useClearCart = function useClearCart(state, dispatch) {
|
10
|
-
var _state$
|
10
|
+
var _state$service3;
|
11
11
|
var handleClear = function handleClear() {
|
12
12
|
// 清除购物车
|
13
13
|
dispatch({
|
@@ -17,11 +17,14 @@ var useClearCart = function useClearCart(state, dispatch) {
|
|
17
17
|
}
|
18
18
|
});
|
19
19
|
};
|
20
|
-
return
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
20
|
+
return useMemo(function () {
|
21
|
+
var _state$service, _state$service2;
|
22
|
+
return !!((_state$service = state.service) !== null && _state$service !== void 0 && (_state$service = _state$service.value) !== null && _state$service !== void 0 && _state$service.length) && !state.channelDisabledEdit && /*#__PURE__*/React.createElement("span", {
|
23
|
+
className: classNames('pisell-lowcode__booking-service-clear-btn', _defineProperty({}, 'pisell-lowcode__booking-service-clear-btn-disabled', !((_state$service2 = state.service) !== null && _state$service2 !== void 0 && (_state$service2 = _state$service2.value) !== null && _state$service2 !== void 0 && _state$service2.length))),
|
24
|
+
onClick: handleClear
|
25
|
+
}, /*#__PURE__*/React.createElement(Iconfont, {
|
26
|
+
type: "pisell2-trash-01"
|
27
|
+
}), " ", /*#__PURE__*/React.createElement("span", null, locales.getText('pisell2.booking.info.text.clear-cart')));
|
28
|
+
}, [(_state$service3 = state.service) === null || _state$service3 === void 0 || (_state$service3 = _state$service3.value) === null || _state$service3 === void 0 ? void 0 : _state$service3.length, state.channelDisabledEdit]);
|
26
29
|
};
|
27
30
|
export default useClearCart;
|
@@ -36,7 +36,7 @@ import { getWaiverTitle } from "../clientVariant/utils";
|
|
36
36
|
import useGetHolderList from "../hooks/useGetHolderList";
|
37
37
|
var isLoadClient = false;
|
38
38
|
var Client = function Client() {
|
39
|
-
var _state$client$value2, _state$client$value3, _state$client$value4, _state$client$value5, _state$client$value6, _state$client$value7, _state$client$value8, _state$client$value9, _state$client$value10, _state$client$value11;
|
39
|
+
var _state$client$value2, _state$client4, _state$client$value3, _state$client$value4, _state$client$value5, _state$client$value6, _state$client$value7, _state$client$value8, _state$client$value9, _state$client$value10, _state$client$value11;
|
40
40
|
var modalRef = useRef();
|
41
41
|
var _useState = useState(false),
|
42
42
|
_useState2 = _slicedToArray(_useState, 2),
|
@@ -397,6 +397,7 @@ var Client = function Client() {
|
|
397
397
|
}, locales.getText('pisell2.text.load-more'))) : null;
|
398
398
|
}, [loadLoading, params, state.client.clients.length]);
|
399
399
|
var customSelect = useMemo(function () {
|
400
|
+
console.log('render customSelect');
|
400
401
|
return /*#__PURE__*/React.createElement(CustomSelect, {
|
401
402
|
autoFocus: !state.isTerminal,
|
402
403
|
modalOpen: state.modalOpen,
|
@@ -459,7 +460,7 @@ var Client = function Client() {
|
|
459
460
|
return true;
|
460
461
|
}
|
461
462
|
});
|
462
|
-
}, [state, renderList, loading, franchiseeLoading, params.search, loadMore]);
|
463
|
+
}, [state.isTerminal, state.modalOpen, (_state$client4 = state.client) === null || _state$client4 === void 0 ? void 0 : _state$client4.value, state.drawerMask, renderList, loading, franchiseeLoading, params.search, loadMore]);
|
463
464
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
464
465
|
className: "pisell-lowcode__booking-client",
|
465
466
|
onClick: function onClick() {
|
@@ -4,6 +4,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
4
4
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
5
5
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
6
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); }
|
7
|
+
import { useMemoizedFn } from "ahooks";
|
7
8
|
import { useEffect, useMemo, useRef } from "react";
|
8
9
|
import useHolderConfig from "./useHolderConfig";
|
9
10
|
import { isOpenAddTime } from "../utils";
|
@@ -33,25 +34,23 @@ var useInfoHolder = function useInfoHolder(state, dispatch) {
|
|
33
34
|
var showAddTimeModal = useMemo(function () {
|
34
35
|
return isOpenAddTime(state);
|
35
36
|
}, [state, appointment_card.quick_time]);
|
36
|
-
var handleEdit = function
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
}, 100);
|
47
|
-
};
|
37
|
+
var handleEdit = useMemoizedFn(function (cacheItem, type) {
|
38
|
+
var isNoSpecAndPackage = getIsNoSpecAndPackage(cacheItem);
|
39
|
+
if (isNoSpecAndPackage) {
|
40
|
+
var _editNormalServiceRef;
|
41
|
+
(_editNormalServiceRef = editNormalServiceRef.current) === null || _editNormalServiceRef === void 0 || _editNormalServiceRef.init(cacheItem);
|
42
|
+
} else {
|
43
|
+
var _detailRef$current, _detailRef$current$in;
|
44
|
+
(_detailRef$current = detailRef.current) === null || _detailRef$current === void 0 || (_detailRef$current$in = _detailRef$current.init) === null || _detailRef$current$in === void 0 || _detailRef$current$in.call(_detailRef$current, cacheItem, false, type === 'edit_product');
|
45
|
+
}
|
46
|
+
});
|
48
47
|
var dispatchService = function dispatchService(type, payload) {
|
49
48
|
dispatch({
|
50
49
|
type: type,
|
51
50
|
payload: _objectSpread({}, payload)
|
52
51
|
});
|
53
52
|
};
|
54
|
-
var handleAction = function
|
53
|
+
var handleAction = useMemoizedFn(function (dataSource) {
|
55
54
|
var cacheItem = getProductExtend({
|
56
55
|
cacheItem: _objectSpread(_objectSpread({}, dataSource._origin), {}, {
|
57
56
|
new: 0
|
@@ -65,7 +64,7 @@ var useInfoHolder = function useInfoHolder(state, dispatch) {
|
|
65
64
|
cacheItem: cacheItem
|
66
65
|
}
|
67
66
|
});
|
68
|
-
};
|
67
|
+
});
|
69
68
|
return {
|
70
69
|
detailRef: detailRef,
|
71
70
|
handleEdit: handleEdit,
|
@@ -14,7 +14,7 @@ import { useMemoizedFn } from 'ahooks';
|
|
14
14
|
import { getProductExtend } from "../../info2/service/addService/utils";
|
15
15
|
import useAddHolder from "../hooks/useAddHolder";
|
16
16
|
var Lists = function Lists(_ref) {
|
17
|
-
var _state$
|
17
|
+
var _state$service2;
|
18
18
|
var onEdit = _ref.onEdit,
|
19
19
|
onChange = _ref.onChange,
|
20
20
|
onAction = _ref.onAction,
|
@@ -36,6 +36,8 @@ var Lists = function Lists(_ref) {
|
|
36
36
|
* @Date: 2024-11-29 16:35
|
37
37
|
*/
|
38
38
|
var handleChange = useMemoizedFn(function (currentItem, type, other) {
|
39
|
+
console.time('handleChange');
|
40
|
+
console.log(window.pp1 = performance.now(), '打开商品');
|
39
41
|
if (state.disabledEdit || state.disableEventBookingEdit) {
|
40
42
|
return;
|
41
43
|
}
|
@@ -59,9 +61,7 @@ var Lists = function Lists(_ref) {
|
|
59
61
|
editModal: true,
|
60
62
|
cacheItem: cacheItem
|
61
63
|
});
|
62
|
-
return onEdit === null || onEdit === void 0 ? void 0 : onEdit(
|
63
|
-
new: 0
|
64
|
-
}), type);
|
64
|
+
return onEdit === null || onEdit === void 0 ? void 0 : onEdit(cacheItem, type);
|
65
65
|
}
|
66
66
|
var params = {
|
67
67
|
editModal: false,
|
@@ -97,28 +97,38 @@ var Lists = function Lists(_ref) {
|
|
97
97
|
productCardStyleConfig: (_state$bookingConfig = state.bookingConfig) === null || _state$bookingConfig === void 0 || (_state$bookingConfig = _state$bookingConfig.config) === null || _state$bookingConfig === void 0 ? void 0 : _state$bookingConfig.cart_settings_tab
|
98
98
|
};
|
99
99
|
}, [state === null || state === void 0 ? void 0 : state.bookingId, state === null || state === void 0 ? void 0 : state.disabledEdit, isShowChangeHolder, state.isBookingCreatePage, state.bookingConfig]);
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
100
|
+
var products = useMemo(function () {
|
101
|
+
var _state$service;
|
102
|
+
console.time('products');
|
103
|
+
var p = formatProducts((state === null || state === void 0 || (_state$service = state.service) === null || _state$service === void 0 ? void 0 : _state$service.value) || [], state, false, true, isParallelResource);
|
104
|
+
console.timeEnd('products');
|
105
|
+
return p;
|
106
|
+
}, [state === null || state === void 0 || (_state$service2 = state.service) === null || _state$service2 === void 0 ? void 0 : _state$service2.value, state]);
|
107
|
+
return useMemo(function () {
|
108
|
+
console.log('render List');
|
109
|
+
return /*#__PURE__*/React.createElement(CartContext.Provider, {
|
110
|
+
value: {
|
111
|
+
state: state
|
112
|
+
}
|
113
|
+
}, /*#__PURE__*/React.createElement(ShoppingCart, {
|
114
|
+
scenario: state.isBookingTicket2 ? 'booking2' : undefined,
|
115
|
+
isParallelResource: isParallelResource,
|
116
|
+
onAction: onAction,
|
117
|
+
onChange: handleChange,
|
118
|
+
isOpenGroup: false,
|
119
|
+
isHideClearCart: true,
|
120
|
+
onAddProduct: function onAddProduct() {
|
121
|
+
return onChange({
|
122
|
+
addModal: true
|
123
|
+
});
|
124
|
+
}
|
125
|
+
// onActiveKey={handleActiveKey}
|
126
|
+
// collapseParams={CollapseParams}
|
127
|
+
,
|
128
|
+
productParams: _objectSpread(_objectSpread({}, productParams), {}, {
|
129
|
+
products: products
|
130
|
+
})
|
131
|
+
}));
|
132
|
+
}, [products, state, productParams]);
|
123
133
|
};
|
124
134
|
export default Lists;
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const getIsPartyRoomResourceShop: (id: number) => boolean;
|
@@ -45,12 +45,15 @@ import Like from "../like";
|
|
45
45
|
import { editSessionProduct, getMultiDayPrices } from "../../utils";
|
46
46
|
import { useService } from "../serviceManager";
|
47
47
|
import EditTabs from "./EditTabs";
|
48
|
+
import { getIsPartyRoomResourceShop } from "./constants";
|
49
|
+
import useEngineContext from "../../../../../hooks/useEngineContext";
|
48
50
|
var submitLock = false;
|
49
51
|
var Info = function Info(_, ref) {
|
50
52
|
var _state$bookingConfig2, _state$service$cacheI4, _state$service$cacheI6, _state$service$cacheI7, _state$service4, _state$service6, _state$service8, _state$date, _state$date$format, _state$date2, _window$BaseMaterials, _state$service$cacheI13, _state$service10, _state$service$cacheI14, _state$bookingConfig4;
|
51
53
|
var _Form$useForm = Form.useForm(),
|
52
54
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
53
55
|
form = _Form$useForm2[0];
|
56
|
+
var context = useEngineContext();
|
54
57
|
var useTotal = Form.useWatch('total', form);
|
55
58
|
var useLikeStatus = Form.useWatch('like_status', form);
|
56
59
|
var useResource = Form.useWatch('resource', form);
|
@@ -569,7 +572,7 @@ var Info = function Info(_, ref) {
|
|
569
572
|
*/
|
570
573
|
var getResourcesData = /*#__PURE__*/function () {
|
571
574
|
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
572
|
-
var params, format, startDate, endDate, _formatDayTime, startDateTime, endDateTime, data, _list;
|
575
|
+
var _context$appHelper$ut, _context$appHelper$ut2, params, format, startDate, endDate, _formatDayTime, startDateTime, endDateTime, isPartyRoomResourceShop, codes, data, _list;
|
573
576
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
574
577
|
while (1) switch (_context3.prev = _context3.next) {
|
575
578
|
case 0:
|
@@ -602,16 +605,18 @@ var Info = function Info(_, ref) {
|
|
602
605
|
case 13:
|
603
606
|
params.with_date_times = state.date.value.format('YYYY-MM-DD');
|
604
607
|
case 14:
|
605
|
-
|
608
|
+
isPartyRoomResourceShop = getIsPartyRoomResourceShop((_context$appHelper$ut = context.appHelper.utils.store) === null || _context$appHelper$ut === void 0 || (_context$appHelper$ut2 = _context$appHelper$ut.getState) === null || _context$appHelper$ut2 === void 0 || (_context$appHelper$ut2 = _context$appHelper$ut2.call(_context$appHelper$ut)) === null || _context$appHelper$ut2 === void 0 || (_context$appHelper$ut2 = _context$appHelper$ut2.global) === null || _context$appHelper$ut2 === void 0 || (_context$appHelper$ut2 = _context$appHelper$ut2.globalConfig) === null || _context$appHelper$ut2 === void 0 ? void 0 : _context$appHelper$ut2.id);
|
609
|
+
codes = isPartyRoomResourceShop ? ['resources', 'therapist', 'table', 'party_room'] : ['resources', 'therapist', 'table'];
|
610
|
+
_context3.next = 18;
|
606
611
|
return state.apis.getResources(_objectSpread({
|
607
612
|
skip: 1,
|
608
613
|
num: 1000,
|
609
|
-
codes:
|
614
|
+
codes: codes,
|
610
615
|
_config: {
|
611
616
|
abort: true
|
612
617
|
}
|
613
618
|
}, params));
|
614
|
-
case
|
619
|
+
case 18:
|
615
620
|
data = _context3.sent;
|
616
621
|
// 合并无资源
|
617
622
|
_list = [getNoResource()].concat((data === null || data === void 0 ? void 0 : data.list) || []);
|
@@ -621,19 +626,19 @@ var Info = function Info(_, ref) {
|
|
621
626
|
resourcesOrigin: _list
|
622
627
|
}
|
623
628
|
});
|
624
|
-
_context3.next =
|
629
|
+
_context3.next = 26;
|
625
630
|
break;
|
626
|
-
case
|
627
|
-
_context3.prev =
|
631
|
+
case 23:
|
632
|
+
_context3.prev = 23;
|
628
633
|
_context3.t0 = _context3["catch"](1);
|
629
634
|
console.log(_context3.t0, 'err');
|
630
|
-
case
|
635
|
+
case 26:
|
631
636
|
setResourceLoading(false);
|
632
|
-
case
|
637
|
+
case 27:
|
633
638
|
case "end":
|
634
639
|
return _context3.stop();
|
635
640
|
}
|
636
|
-
}, _callee3, null, [[1,
|
641
|
+
}, _callee3, null, [[1, 23]]);
|
637
642
|
}));
|
638
643
|
return function getResourcesData() {
|
639
644
|
return _ref5.apply(this, arguments);
|
@@ -365,6 +365,15 @@ export var updateServices = function updateServices(state, currentItem, type, ot
|
|
365
365
|
products = handleChangeResource(products, currentItem, other, state);
|
366
366
|
return products;
|
367
367
|
}
|
368
|
+
if (type === 'num') {
|
369
|
+
return products.map(function (product) {
|
370
|
+
if (product._id === currentItem._id) {
|
371
|
+
product._extend.quantity = other.num;
|
372
|
+
return product;
|
373
|
+
}
|
374
|
+
return product;
|
375
|
+
});
|
376
|
+
}
|
368
377
|
|
369
378
|
// 更新商品的holder_id
|
370
379
|
if (type === 'update_holders') {
|
@@ -701,29 +710,28 @@ export var formatProducts = function formatProducts(lists, state) {
|
|
701
710
|
_origin: item
|
702
711
|
});
|
703
712
|
};
|
704
|
-
|
705
|
-
// 将商品分为组商品和非组商品
|
706
|
-
lists.forEach(function (item) {
|
707
|
-
var _item$_extend28;
|
708
|
-
if (!(item !== null && item !== void 0 && (_item$_extend28 = item._extend) !== null && _item$_extend28 !== void 0 && _item$_extend28.groupId)) {
|
709
|
-
normalList.push(formItem(item));
|
710
|
-
} else {
|
711
|
-
groupList.push(item);
|
712
|
-
}
|
713
|
-
});
|
714
|
-
|
715
|
-
// 根据item._extend.groupId 进行分组
|
716
|
-
var groups = groupList.reduce(function (prev, item) {
|
717
|
-
var _item$_extend29;
|
718
|
-
var groupId = item === null || item === void 0 || (_item$_extend29 = item._extend) === null || _item$_extend29 === void 0 ? void 0 : _item$_extend29.groupId;
|
719
|
-
if (!prev[groupId]) {
|
720
|
-
prev[groupId] = [];
|
721
|
-
}
|
722
|
-
prev[groupId].push(item);
|
723
|
-
return prev;
|
724
|
-
}, {});
|
725
713
|
console.log(normalList, 'normalList');
|
726
714
|
if (isRenderGroup) {
|
715
|
+
// 将商品分为组商品和非组商品
|
716
|
+
lists.forEach(function (item) {
|
717
|
+
var _item$_extend28;
|
718
|
+
if (!(item !== null && item !== void 0 && (_item$_extend28 = item._extend) !== null && _item$_extend28 !== void 0 && _item$_extend28.groupId)) {
|
719
|
+
normalList.push(formItem(item));
|
720
|
+
} else {
|
721
|
+
groupList.push(item);
|
722
|
+
}
|
723
|
+
});
|
724
|
+
|
725
|
+
// 根据item._extend.groupId 进行分组
|
726
|
+
var groups = groupList.reduce(function (prev, item) {
|
727
|
+
var _item$_extend29;
|
728
|
+
var groupId = item === null || item === void 0 || (_item$_extend29 = item._extend) === null || _item$_extend29 === void 0 ? void 0 : _item$_extend29.groupId;
|
729
|
+
if (!prev[groupId]) {
|
730
|
+
prev[groupId] = [];
|
731
|
+
}
|
732
|
+
prev[groupId].push(item);
|
733
|
+
return prev;
|
734
|
+
}, {});
|
727
735
|
return Object.values(groups).map(function (d) {
|
728
736
|
return formItem(concatBookings(d));
|
729
737
|
}).concat(normalList);
|
@@ -82,6 +82,7 @@ var Info = Provider(function (props) {
|
|
82
82
|
}, []);
|
83
83
|
useMemo(function () {
|
84
84
|
var _context$appHelper, _context$appHelper$ge, _context$appHelper2, _context$appHelper2$i, _context$appHelper3;
|
85
|
+
// TODO: 优化 内部每次设置state会触发两次渲染
|
85
86
|
var isFranchisee = context === null || context === void 0 || (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 || (_context$appHelper = _context$appHelper.utils) === null || _context$appHelper === void 0 || (_context$appHelper = _context$appHelper.businessUtils) === null || _context$appHelper === void 0 || (_context$appHelper$ge = _context$appHelper.getAppByModal) === null || _context$appHelper$ge === void 0 ? void 0 : _context$appHelper$ge.call(_context$appHelper, 'franchisee');
|
86
87
|
modal.dispatch({
|
87
88
|
type: 'setState',
|
@@ -128,7 +128,8 @@ export var getTimeObj = function getTimeObj(_ref4) {
|
|
128
128
|
cacheItem: cacheItem,
|
129
129
|
useStartTime: useStartTime,
|
130
130
|
currentResource: currentResource,
|
131
|
-
|
131
|
+
// 没有使用该参数
|
132
|
+
// state,
|
132
133
|
durationProps: durationProps
|
133
134
|
});
|
134
135
|
var obj = sliceDayIntoFiveMinutes((_state$bookingConfig2 = state.bookingConfig) === null || _state$bookingConfig2 === void 0 || (_state$bookingConfig2 = _state$bookingConfig2.config) === null || _state$bookingConfig2 === void 0 || (_state$bookingConfig2 = _state$bookingConfig2.basic) === null || _state$bookingConfig2 === void 0 ? void 0 : _state$bookingConfig2.service_time, locales.locale);
|
@@ -286,7 +287,9 @@ export var setDefaultResource = function setDefaultResource(_ref6) {
|
|
286
287
|
defaultOriginalResource = renderList;
|
287
288
|
}
|
288
289
|
var defaultResource = defaultOriginalResource.map(function (d) {
|
289
|
-
return
|
290
|
+
return {
|
291
|
+
// ...d,
|
292
|
+
children: d.children,
|
290
293
|
relation_type: d.relation_type,
|
291
294
|
form_id: item.form_id,
|
292
295
|
relation_id: d.id,
|
@@ -297,7 +300,7 @@ export var setDefaultResource = function setDefaultResource(_ref6) {
|
|
297
300
|
form_name: item.title,
|
298
301
|
resource_name: d.main_field
|
299
302
|
}
|
300
|
-
}
|
303
|
+
};
|
301
304
|
});
|
302
305
|
obj[item.form_id] = defaultResource;
|
303
306
|
};
|
@@ -70,6 +70,7 @@ var AddTimeModal = function AddTimeModal() {
|
|
70
70
|
_useState10 = _slicedToArray(_useState9, 2),
|
71
71
|
renderList = _useState10[0],
|
72
72
|
setRenderList = _useState10[1];
|
73
|
+
console.log(renderList, 'renderListrenderList');
|
73
74
|
var context = useEngineContext();
|
74
75
|
var _context$appHelper$ut = (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils,
|
75
76
|
interaction = _context$appHelper$ut.interaction;
|
@@ -148,6 +149,7 @@ var AddTimeModal = function AddTimeModal() {
|
|
148
149
|
}
|
149
150
|
return arr.filter(Boolean);
|
150
151
|
}, [(_state$service = state.service) === null || _state$service === void 0 || (_state$service = _state$service.cacheItem) === null || _state$service === void 0 || (_state$service = _state$service._extend) === null || _state$service === void 0 ? void 0 : _state$service.resource]);
|
152
|
+
console.log(currentResource, 'currentResource');
|
151
153
|
var getTimeUsableStatus = function getTimeUsableStatus(time) {
|
152
154
|
var _state$service$cacheI3;
|
153
155
|
if (!((_state$service$cacheI3 = state.service.cacheItem) !== null && _state$service$cacheI3 !== void 0 && _state$service$cacheI3._extend) || !currentResource.length) {
|
@@ -270,6 +272,7 @@ var AddTimeModal = function AddTimeModal() {
|
|
270
272
|
case 3:
|
271
273
|
newList = _context2.sent;
|
272
274
|
list = newList.map(function (d) {
|
275
|
+
debugger;
|
273
276
|
// 是否可用
|
274
277
|
var isUsable = isUsableProduct(d.add_time, state.service.cacheItem);
|
275
278
|
return _objectSpread(_objectSpread({}, d), {}, {
|
@@ -189,9 +189,14 @@ var Resources = function Resources(_ref, ref) {
|
|
189
189
|
var getIsAutoAllocation = function getIsAutoAllocation(id) {
|
190
190
|
return getAutoAllocationStorage(id);
|
191
191
|
};
|
192
|
+
console.log('resourcesss');
|
193
|
+
|
194
|
+
/* todo: 此处value变化渲染三次 */
|
195
|
+
|
192
196
|
return /*#__PURE__*/React.createElement(React.Fragment, null, data.map(function (item) {
|
193
197
|
var _cur$2;
|
194
198
|
var cur = _value[item.form_id];
|
199
|
+
console.log(cur, 'curcur');
|
195
200
|
var errors = (cur || []).reduce(function (pre, d) {
|
196
201
|
return pre.concat((d === null || d === void 0 ? void 0 : d.errors) || []);
|
197
202
|
}, []);
|