@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,158 @@
|
|
|
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 _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
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."); }
|
|
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); }
|
|
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; }
|
|
11
|
+
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; } }
|
|
12
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
+
import React, { useContext, useEffect, useMemo, useState } from 'react';
|
|
14
|
+
import { CartContext } from "../../../shoppingCart/Provider";
|
|
15
|
+
import ShoppingCart from "../../../shoppingCart";
|
|
16
|
+
import { Context } from "../model";
|
|
17
|
+
import { formatProducts, formatActiveKey } from "./utils";
|
|
18
|
+
import useSelectPet from "./hooks/useSelectPet";
|
|
19
|
+
import { defaultData } from "./status";
|
|
20
|
+
var Lists = function Lists(_ref) {
|
|
21
|
+
var _state$service;
|
|
22
|
+
var onEdit = _ref.onEdit,
|
|
23
|
+
onChange = _ref.onChange;
|
|
24
|
+
var _useContext = useContext(Context),
|
|
25
|
+
state = _useContext.state;
|
|
26
|
+
var _useState = useState(defaultData),
|
|
27
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
28
|
+
params = _useState2[0],
|
|
29
|
+
setParams = _useState2[1];
|
|
30
|
+
var _useSelectPet = useSelectPet(state),
|
|
31
|
+
holderLists = _useSelectPet.holderLists;
|
|
32
|
+
useEffect(function () {
|
|
33
|
+
var keys = formatActiveKey(holderLists, params === null || params === void 0 ? void 0 : params.platform);
|
|
34
|
+
onChange({
|
|
35
|
+
activeCartId: keys
|
|
36
|
+
}, 'setActiveCartId');
|
|
37
|
+
setParams(_objectSpread(_objectSpread({}, params), {}, {
|
|
38
|
+
activeKey: keys
|
|
39
|
+
}));
|
|
40
|
+
}, [holderLists, params === null || params === void 0 ? void 0 : params.platform]);
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* @title: 点击商品卡片
|
|
44
|
+
* @description:
|
|
45
|
+
* @param {any} item
|
|
46
|
+
* @return {*}
|
|
47
|
+
* @Author: WangHan
|
|
48
|
+
* @Date: 2024-12-09 16:06
|
|
49
|
+
*/
|
|
50
|
+
var handleCard = function handleCard(item) {
|
|
51
|
+
if (state.disabledEdit || state.disableEventBookingEdit) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
onChange({
|
|
55
|
+
editModal: true,
|
|
56
|
+
cacheItem: _objectSpread(_objectSpread({}, item), {}, {
|
|
57
|
+
new: 0
|
|
58
|
+
})
|
|
59
|
+
});
|
|
60
|
+
onEdit === null || onEdit === void 0 ? void 0 : onEdit(_objectSpread(_objectSpread({}, item), {}, {
|
|
61
|
+
new: 0
|
|
62
|
+
}));
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* @title: 更新商品数据
|
|
67
|
+
* @description:
|
|
68
|
+
* @param {any} newState
|
|
69
|
+
* @return {*}
|
|
70
|
+
* @Author: WangHan
|
|
71
|
+
* @Date: 2024-11-29 16:35
|
|
72
|
+
*/
|
|
73
|
+
var handleChange = function handleChange(newState) {
|
|
74
|
+
if (state.disabledEdit || state.disableEventBookingEdit || state.channelDisabledEdit) {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
var params = {
|
|
78
|
+
editModal: false,
|
|
79
|
+
value: newState,
|
|
80
|
+
edit: true,
|
|
81
|
+
cacheItem: null
|
|
82
|
+
};
|
|
83
|
+
onChange(params);
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* @title: 打开哪个折叠面板的keys
|
|
88
|
+
* @description:
|
|
89
|
+
* @param {any} key
|
|
90
|
+
* @return {*}
|
|
91
|
+
* @Author: WangHan
|
|
92
|
+
* @Date: 2024-12-09 16:06
|
|
93
|
+
*/
|
|
94
|
+
var handleActiveKey = function handleActiveKey(key) {
|
|
95
|
+
onChange({
|
|
96
|
+
activeCartId: key
|
|
97
|
+
}, 'setActiveCartId');
|
|
98
|
+
setParams(_objectSpread(_objectSpread({}, params), {}, {
|
|
99
|
+
activeKey: key
|
|
100
|
+
}));
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* @title: 折叠面板参数
|
|
105
|
+
* @description:
|
|
106
|
+
* @param {*} useMemo
|
|
107
|
+
* @return {*}
|
|
108
|
+
* @Author: WangHan
|
|
109
|
+
* @Date: 2024-12-05 15:22
|
|
110
|
+
*/
|
|
111
|
+
var CollapseParams = useMemo(function () {
|
|
112
|
+
var _params = {
|
|
113
|
+
activeKey: params === null || params === void 0 ? void 0 : params.activeKey,
|
|
114
|
+
bordered: false
|
|
115
|
+
};
|
|
116
|
+
return _params;
|
|
117
|
+
}, [params === null || params === void 0 ? void 0 : params.activeKey]);
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* @title: 商品信息
|
|
121
|
+
* @description:
|
|
122
|
+
* @param {*} useMemo
|
|
123
|
+
* @return {*}
|
|
124
|
+
* @Author: WangHan
|
|
125
|
+
* @Date: 2024-12-09 16:07
|
|
126
|
+
*/
|
|
127
|
+
var productParams = useMemo(function () {
|
|
128
|
+
return {
|
|
129
|
+
hideAddBtn: state.isTerminalDayBookingPage,
|
|
130
|
+
isShowNote: true,
|
|
131
|
+
isShowPackageNote: false,
|
|
132
|
+
holders: holderLists,
|
|
133
|
+
isEdit: !!(state !== null && state !== void 0 && state.bookingId),
|
|
134
|
+
disabledEdit: state === null || state === void 0 ? void 0 : state.disabledEdit
|
|
135
|
+
};
|
|
136
|
+
}, [holderLists, state === null || state === void 0 ? void 0 : state.bookingId]);
|
|
137
|
+
return /*#__PURE__*/React.createElement(CartContext.Provider, {
|
|
138
|
+
value: {
|
|
139
|
+
state: state
|
|
140
|
+
}
|
|
141
|
+
}, /*#__PURE__*/React.createElement(ShoppingCart, {
|
|
142
|
+
onCard: handleCard,
|
|
143
|
+
onChange: function onChange(e) {
|
|
144
|
+
return handleChange(e);
|
|
145
|
+
},
|
|
146
|
+
onAddProduct: function onAddProduct() {
|
|
147
|
+
return onChange({
|
|
148
|
+
addModal: true
|
|
149
|
+
});
|
|
150
|
+
},
|
|
151
|
+
onActiveKey: handleActiveKey,
|
|
152
|
+
collapseParams: CollapseParams,
|
|
153
|
+
productParams: _objectSpread(_objectSpread({}, productParams), {}, {
|
|
154
|
+
products: formatProducts(state === null || state === void 0 ? void 0 : (_state$service = state.service) === null || _state$service === void 0 ? void 0 : _state$service.value, state)
|
|
155
|
+
})
|
|
156
|
+
}));
|
|
157
|
+
};
|
|
158
|
+
export default Lists;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { useMemo } from 'react';
|
|
2
|
+
import { formatHolderLists } from "../utils";
|
|
3
|
+
var useSelectPet = function useSelectPet(state) {
|
|
4
|
+
var _state$pet2;
|
|
5
|
+
/**
|
|
6
|
+
* @title: pets数据
|
|
7
|
+
* @description:
|
|
8
|
+
* @param {any} state
|
|
9
|
+
* @return {*}
|
|
10
|
+
* @Author: WangHan
|
|
11
|
+
* @Date: 2024-12-03 11:39
|
|
12
|
+
*/
|
|
13
|
+
var petLists = useMemo(function () {
|
|
14
|
+
var _state$bookingConfig, _state$bookingConfig$, _state$bookingConfig$2, _state$bookingConfig$3, _state$pet, _state$pet$value;
|
|
15
|
+
var form_id = (state === null || state === void 0 ? void 0 : (_state$bookingConfig = state.bookingConfig) === null || _state$bookingConfig === void 0 ? void 0 : (_state$bookingConfig$ = _state$bookingConfig.config) === null || _state$bookingConfig$ === void 0 ? void 0 : (_state$bookingConfig$2 = _state$bookingConfig$.basic) === null || _state$bookingConfig$2 === void 0 ? void 0 : (_state$bookingConfig$3 = _state$bookingConfig$2.appointment_subject) === null || _state$bookingConfig$3 === void 0 ? void 0 : _state$bookingConfig$3.form_id) || 0;
|
|
16
|
+
return (state === null || state === void 0 ? void 0 : (_state$pet = state.pet) === null || _state$pet === void 0 ? void 0 : (_state$pet$value = _state$pet.value) === null || _state$pet$value === void 0 ? void 0 : _state$pet$value[form_id]) || [];
|
|
17
|
+
}, [state === null || state === void 0 ? void 0 : (_state$pet2 = state.pet) === null || _state$pet2 === void 0 ? void 0 : _state$pet2.value]);
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* @title: pets数据加 open items
|
|
21
|
+
* @description:
|
|
22
|
+
* @param {any} state
|
|
23
|
+
* @return {*}
|
|
24
|
+
* @Author: WangHan
|
|
25
|
+
* @Date: 2024-12-03 11:40
|
|
26
|
+
*/
|
|
27
|
+
var holderLists = useMemo(function () {
|
|
28
|
+
var _lists = formatHolderLists(petLists);
|
|
29
|
+
return _lists;
|
|
30
|
+
}, [petLists]);
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @title: 获取pet名称
|
|
34
|
+
* @description:
|
|
35
|
+
* @param {any} state
|
|
36
|
+
* @param {number} id
|
|
37
|
+
* @return {*}
|
|
38
|
+
* @Author: WangHan
|
|
39
|
+
* @Date: 2024-12-03 11:42
|
|
40
|
+
*/
|
|
41
|
+
var getHolderName = function getHolderName(id) {
|
|
42
|
+
if (!holderLists.length) return '';
|
|
43
|
+
var resource = holderLists.find(function (d) {
|
|
44
|
+
return d.id === id;
|
|
45
|
+
});
|
|
46
|
+
return resource === null || resource === void 0 ? void 0 : resource.main_field;
|
|
47
|
+
};
|
|
48
|
+
return {
|
|
49
|
+
petLists: petLists,
|
|
50
|
+
holderLists: holderLists,
|
|
51
|
+
getHolderName: getHolderName
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
export default useSelectPet;
|
|
@@ -0,0 +1,58 @@
|
|
|
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
|
+
import React, { createContext, useContext, useEffect, useRef } from 'react';
|
|
8
|
+
import AddService from "../service/addService";
|
|
9
|
+
import EditService from "../service/editService";
|
|
10
|
+
import { Context } from "../model";
|
|
11
|
+
import Lists from "./Lists";
|
|
12
|
+
export var Service2Context = /*#__PURE__*/createContext({});
|
|
13
|
+
export var Service2Cart = function Service2Cart() {
|
|
14
|
+
var detailRef = useRef();
|
|
15
|
+
var _useContext = useContext(Context),
|
|
16
|
+
state = _useContext.state,
|
|
17
|
+
dispatch = _useContext.dispatch;
|
|
18
|
+
useEffect(function () {
|
|
19
|
+
document.body.id = 'body';
|
|
20
|
+
}, []);
|
|
21
|
+
useEffect(function () {
|
|
22
|
+
console.log(state, 'wh_state33');
|
|
23
|
+
}, [state]);
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* @title: 更新服务
|
|
27
|
+
* @description:
|
|
28
|
+
* @param {string} type
|
|
29
|
+
* @param {any} payload
|
|
30
|
+
* @return {*}
|
|
31
|
+
* @Author: WangHan
|
|
32
|
+
* @Date: 2024-12-09 16:02
|
|
33
|
+
*/
|
|
34
|
+
var dispatchService = function dispatchService(type, payload) {
|
|
35
|
+
dispatch({
|
|
36
|
+
type: type,
|
|
37
|
+
payload: _objectSpread({}, payload)
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
var handleEdit = function handleEdit(cacheItem) {
|
|
41
|
+
setTimeout(function () {
|
|
42
|
+
var _detailRef$current, _detailRef$current$in;
|
|
43
|
+
(_detailRef$current = detailRef.current) === null || _detailRef$current === void 0 ? void 0 : (_detailRef$current$in = _detailRef$current.init) === null || _detailRef$current$in === void 0 ? void 0 : _detailRef$current$in.call(_detailRef$current, cacheItem);
|
|
44
|
+
}, 100);
|
|
45
|
+
};
|
|
46
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
47
|
+
className: "pisell-lowcode__booking-service-wrap"
|
|
48
|
+
}, /*#__PURE__*/React.createElement(Lists, {
|
|
49
|
+
onEdit: handleEdit,
|
|
50
|
+
onChange: function onChange(e, type) {
|
|
51
|
+
return dispatchService(type || 'setService', e);
|
|
52
|
+
}
|
|
53
|
+
}), /*#__PURE__*/React.createElement(AddService, {
|
|
54
|
+
onEdit: handleEdit
|
|
55
|
+
})), /*#__PURE__*/React.createElement(EditService, {
|
|
56
|
+
ref: detailRef
|
|
57
|
+
}));
|
|
58
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { shoppingCartProps } from '../../../shoppingCart/type';
|
|
2
|
+
export declare const defaultData: shoppingCartProps;
|
|
3
|
+
/**
|
|
4
|
+
* @title: 根据是否是跨日预约和是否是terminal打开的,返回日期和输入框占据的列数
|
|
5
|
+
* @description:
|
|
6
|
+
* @param {boolean} isDayBooking
|
|
7
|
+
* @param {boolean} isTerminal
|
|
8
|
+
* @return {*}
|
|
9
|
+
* @Author: WangHan
|
|
10
|
+
* @Date: 2024-12-06 10:29
|
|
11
|
+
*/
|
|
12
|
+
export declare const inputDateCol: (isDayBooking: boolean, isTerminal?: boolean) => {
|
|
13
|
+
date: {};
|
|
14
|
+
input: {};
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* @title: 预约商品扩展类型
|
|
18
|
+
* @description:
|
|
19
|
+
* @return {*}
|
|
20
|
+
* @Author: WangHan
|
|
21
|
+
* @Date: 2024-12-06 14:59
|
|
22
|
+
*/
|
|
23
|
+
export declare const appointmentTypes: string[];
|
|
24
|
+
/**
|
|
25
|
+
* @title: 营业日时间
|
|
26
|
+
* @description:
|
|
27
|
+
* @return {*}
|
|
28
|
+
* @Author: WangHan
|
|
29
|
+
* @Date: 2024-12-06 17:23
|
|
30
|
+
*/
|
|
31
|
+
export declare const openingTime: () => string;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { locales } from '@pisell/utils';
|
|
2
|
+
export var defaultData = {
|
|
3
|
+
isOpenGroup: true,
|
|
4
|
+
carts: [],
|
|
5
|
+
platform: 'shop',
|
|
6
|
+
emptyText: locales.getText('pisell2.text.no.selected'),
|
|
7
|
+
activeKey: [],
|
|
8
|
+
defaultActiveKey: [],
|
|
9
|
+
className: ''
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @title: 根据是否是跨日预约和是否是terminal打开的,返回日期和输入框占据的列数
|
|
14
|
+
* @description:
|
|
15
|
+
* @param {boolean} isDayBooking
|
|
16
|
+
* @param {boolean} isTerminal
|
|
17
|
+
* @return {*}
|
|
18
|
+
* @Author: WangHan
|
|
19
|
+
* @Date: 2024-12-06 10:29
|
|
20
|
+
*/
|
|
21
|
+
export var inputDateCol = function inputDateCol(isDayBooking, isTerminal) {
|
|
22
|
+
var params = {
|
|
23
|
+
date: {},
|
|
24
|
+
input: {}
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
// 不是跨日预约,只有输入框占据一行
|
|
28
|
+
if (!isDayBooking) {
|
|
29
|
+
params.input = {
|
|
30
|
+
span: 24
|
|
31
|
+
};
|
|
32
|
+
return params;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// 如果是terminal打开的需要根据不同的屏幕宽度调整
|
|
36
|
+
if (isTerminal) {
|
|
37
|
+
params.date = {
|
|
38
|
+
sm: 24,
|
|
39
|
+
lg: 24,
|
|
40
|
+
xl: 12
|
|
41
|
+
};
|
|
42
|
+
params.input = {
|
|
43
|
+
sm: 24,
|
|
44
|
+
lg: 24,
|
|
45
|
+
xl: 12
|
|
46
|
+
};
|
|
47
|
+
} else {
|
|
48
|
+
params.date = {
|
|
49
|
+
span: 12
|
|
50
|
+
};
|
|
51
|
+
params.input = {
|
|
52
|
+
span: 12
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
return params;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* @title: 预约商品扩展类型
|
|
60
|
+
* @description:
|
|
61
|
+
* @return {*}
|
|
62
|
+
* @Author: WangHan
|
|
63
|
+
* @Date: 2024-12-06 14:59
|
|
64
|
+
*/
|
|
65
|
+
export var appointmentTypes = ['product_appointment', 'product_add_time'];
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* @title: 营业日时间
|
|
69
|
+
* @description:
|
|
70
|
+
* @return {*}
|
|
71
|
+
* @Author: WangHan
|
|
72
|
+
* @Date: 2024-12-06 17:23
|
|
73
|
+
*/
|
|
74
|
+
export var openingTime = function openingTime() {
|
|
75
|
+
// 营业日时间
|
|
76
|
+
var openingTime = localStorage.getItem('shopOpeningHours');
|
|
77
|
+
return openingTime || '00:00';
|
|
78
|
+
};
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import dayjs from 'dayjs';
|
|
2
|
+
export declare const formatActiveKey: (lists: any[], platform: string) => any[];
|
|
3
|
+
/**
|
|
4
|
+
* @title: 获取资源名称
|
|
5
|
+
* @description:
|
|
6
|
+
* @param {any} id
|
|
7
|
+
* @param {any} state
|
|
8
|
+
* @return {*}
|
|
9
|
+
* @Author: WangHan
|
|
10
|
+
* @Date: 2024-11-29 18:02
|
|
11
|
+
*/
|
|
12
|
+
export declare const getResourceItem: (id: any, state: any) => any;
|
|
13
|
+
/**
|
|
14
|
+
* @title: 错误提示
|
|
15
|
+
* @description:
|
|
16
|
+
* @param {any} service
|
|
17
|
+
* @param {any} resourceItem
|
|
18
|
+
* @return {*}
|
|
19
|
+
* @Author: WangHan
|
|
20
|
+
* @Date: 2024-11-29 18:41
|
|
21
|
+
*/
|
|
22
|
+
export declare const getErrorMessage: (service: any, resourceItem: any, isDay?: boolean) => any;
|
|
23
|
+
/**
|
|
24
|
+
* @title: 格式化主体列表
|
|
25
|
+
* @description:
|
|
26
|
+
* @param {any} lists
|
|
27
|
+
* @param {boolean} isOpenGroup
|
|
28
|
+
* @return {*}
|
|
29
|
+
* @Author: WangHan
|
|
30
|
+
* @Date: 2024-12-04 11:27
|
|
31
|
+
*/
|
|
32
|
+
export declare const formatHolderLists: (lists: any) => any;
|
|
33
|
+
/**
|
|
34
|
+
* @title: 是否是预约商品
|
|
35
|
+
* @description:
|
|
36
|
+
* @return {*}
|
|
37
|
+
* @Author: WangHan
|
|
38
|
+
* @Date: 2024-12-06 11:24
|
|
39
|
+
*/
|
|
40
|
+
export declare const isAppointment: (item: any, state: any) => boolean;
|
|
41
|
+
/**
|
|
42
|
+
* @title: 格式化商品数据
|
|
43
|
+
* @description:
|
|
44
|
+
* @param {any} lists
|
|
45
|
+
* @return {*}
|
|
46
|
+
* @Author: WangHan
|
|
47
|
+
* @Date: 2024-11-29 17:36
|
|
48
|
+
*/
|
|
49
|
+
export declare const formatProducts: (lists: any[], state: any) => any[] | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* @title: 禁用日期
|
|
52
|
+
* @description:
|
|
53
|
+
* @param {any} current
|
|
54
|
+
* @param {string} position
|
|
55
|
+
* @param {any} startDate
|
|
56
|
+
* @return {*}
|
|
57
|
+
* @Author: WangHan
|
|
58
|
+
* @Date: 2024-12-03 17:51
|
|
59
|
+
*/
|
|
60
|
+
export declare const disabledDate: (current: any, position: string, currentDate: any) => any;
|
|
61
|
+
/**
|
|
62
|
+
* @title: 是否是跨日预约
|
|
63
|
+
* @description:
|
|
64
|
+
* @param {any} state
|
|
65
|
+
* @return {*}
|
|
66
|
+
* @Author: WangHan
|
|
67
|
+
* @Date: 2024-12-04 09:49
|
|
68
|
+
*/
|
|
69
|
+
export declare const isDayBooking: (state: any) => boolean;
|
|
70
|
+
/**
|
|
71
|
+
* @title: 是否是terminal上的跨日预约
|
|
72
|
+
* @description:
|
|
73
|
+
* @param {any} state
|
|
74
|
+
* @return {*}
|
|
75
|
+
* @Author: WangHan
|
|
76
|
+
* @Date: 2024-12-04 15:31
|
|
77
|
+
*/
|
|
78
|
+
export declare const isTerminalDayBooking: (state: any) => any;
|
|
79
|
+
export declare const formatDayDate: (_extend: any) => any;
|
|
80
|
+
/**
|
|
81
|
+
* @title: 根据营业日时间格式化时间
|
|
82
|
+
* @description:
|
|
83
|
+
* @param {any} state
|
|
84
|
+
* @return {*}
|
|
85
|
+
* @Author: WangHan
|
|
86
|
+
* @Date: 2024-12-04 12:07
|
|
87
|
+
*/
|
|
88
|
+
export declare const formatDayTime: ({ startDate, endDate }: any) => {
|
|
89
|
+
startDateTime: dayjs.Dayjs;
|
|
90
|
+
endDateTime: dayjs.Dayjs;
|
|
91
|
+
};
|
|
92
|
+
export declare const formatDateTime: (start_date: any, end_date: any) => {
|
|
93
|
+
value: dayjs.Dayjs;
|
|
94
|
+
end_date: dayjs.Dayjs;
|
|
95
|
+
};
|
|
96
|
+
/**
|
|
97
|
+
* @title: 初始化日期
|
|
98
|
+
* @description:
|
|
99
|
+
* @return {*}
|
|
100
|
+
* @Author: WangHan
|
|
101
|
+
* @Date: 2024-12-06 17:24
|
|
102
|
+
*/
|
|
103
|
+
export declare const initDate: () => {
|
|
104
|
+
value: dayjs.Dayjs;
|
|
105
|
+
end_date: dayjs.Dayjs;
|
|
106
|
+
};
|
|
107
|
+
/**
|
|
108
|
+
* @title: 是否有预约商品
|
|
109
|
+
* @description:
|
|
110
|
+
* @return {*}
|
|
111
|
+
* @Author: WangHan
|
|
112
|
+
* @Date: 2024-12-12 15:47
|
|
113
|
+
*/
|
|
114
|
+
export declare const isHasDayAppointmentProduct: (state: any) => boolean;
|
|
115
|
+
/**
|
|
116
|
+
* @title: 过滤出如果是预约商品,则只获取跨日的预约商品
|
|
117
|
+
* @description:
|
|
118
|
+
* @param {any} lists
|
|
119
|
+
* @return {*}
|
|
120
|
+
* @Author: WangHan
|
|
121
|
+
* @Date: 2024-12-13 16:44
|
|
122
|
+
*/
|
|
123
|
+
export declare const getDayProducts: (holderId: number, lists: any, isTerminal?: boolean) => any;
|
|
124
|
+
/**
|
|
125
|
+
* @title: 判断是否打开删除宠物弹窗
|
|
126
|
+
* @description:
|
|
127
|
+
* @param {any} state
|
|
128
|
+
* @param {any} newVal
|
|
129
|
+
* @return {*}
|
|
130
|
+
* @Author: WangHan
|
|
131
|
+
* @Date: 2024-12-16 16:12
|
|
132
|
+
*/
|
|
133
|
+
export declare const isOpenDeletePet: (state: any, newVal: any) => {
|
|
134
|
+
ids: any;
|
|
135
|
+
lists: any;
|
|
136
|
+
};
|
|
137
|
+
/**
|
|
138
|
+
* @title: 当前选中的表单id
|
|
139
|
+
* @description:
|
|
140
|
+
* @param {any} state
|
|
141
|
+
* @return {*}
|
|
142
|
+
* @Author: WangHan
|
|
143
|
+
* @Date: 2024-12-17 14:40
|
|
144
|
+
*/
|
|
145
|
+
export declare const holderId: (state: any) => number;
|