@pisell/private-materials 3.0.16 → 3.0.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +7 -7
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +9 -9
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +8 -8
- package/es/components/booking/addons/index.js +148 -32
- package/es/components/booking/components/TabProduct/selectProductItem/index.js +21 -8
- package/es/components/booking/components/TabProduct/selectProductItem/index.less +34 -27
- package/es/components/booking/components/collapsibleList/index.d.ts +11 -0
- package/es/components/booking/components/collapsibleList/index.js +99 -0
- package/es/components/booking/components/collapsibleList/index.less +61 -0
- package/es/components/booking/components/collapsibleList/utils.d.ts +2 -0
- package/es/components/booking/components/collapsibleList/utils.js +21 -0
- package/es/components/booking/components/footer/amount.js +9 -10
- package/es/components/booking/components/footer/utils.d.ts +18 -0
- package/es/components/booking/components/footer/utils.js +76 -4
- package/es/components/booking/forms/single/index.js +16 -82
- package/es/components/booking/info/service/addService/index.js +47 -24
- package/es/components/booking/info/service/editService/index.js +49 -24
- package/es/components/booking/info/service/editService/index.less +21 -0
- package/es/components/booking/info/service/index.d.ts +2 -2
- package/es/components/booking/info/service/index.js +5 -129
- package/es/components/booking/info/service/index.less +0 -97
- package/es/components/booking/info/service/serviceItem/index.d.ts +4 -0
- package/es/components/booking/info/service/serviceItem/index.js +63 -0
- package/es/components/booking/info/service/serviceItem/index.less +97 -0
- package/es/components/booking/info/service/serviceList/index.d.ts +4 -0
- package/es/components/booking/info/service/serviceList/index.js +105 -0
- package/es/components/booking/info/service/serviceList/index.less +0 -0
- package/es/components/booking/utils.d.ts +1 -0
- package/es/components/booking/utils.js +15 -0
- package/lib/components/booking/addons/index.js +159 -35
- package/lib/components/booking/components/TabProduct/selectProductItem/index.js +33 -8
- package/lib/components/booking/components/TabProduct/selectProductItem/index.less +34 -27
- package/lib/components/booking/components/collapsibleList/index.d.ts +11 -0
- package/lib/components/booking/components/collapsibleList/index.js +94 -0
- package/lib/components/booking/components/collapsibleList/index.less +61 -0
- package/lib/components/booking/components/collapsibleList/utils.d.ts +2 -0
- package/lib/components/booking/components/collapsibleList/utils.js +46 -0
- package/lib/components/booking/components/footer/amount.js +9 -10
- package/lib/components/booking/components/footer/utils.d.ts +18 -0
- package/lib/components/booking/components/footer/utils.js +46 -7
- package/lib/components/booking/forms/single/index.js +12 -48
- package/lib/components/booking/info/service/addService/index.js +57 -36
- package/lib/components/booking/info/service/editService/index.js +76 -56
- package/lib/components/booking/info/service/editService/index.less +21 -0
- package/lib/components/booking/info/service/index.d.ts +2 -2
- package/lib/components/booking/info/service/index.js +4 -112
- package/lib/components/booking/info/service/index.less +0 -97
- package/lib/components/booking/info/service/serviceItem/index.d.ts +4 -0
- package/lib/components/booking/info/service/serviceItem/index.js +98 -0
- package/lib/components/booking/info/service/serviceItem/index.less +97 -0
- package/lib/components/booking/info/service/serviceList/index.d.ts +4 -0
- package/lib/components/booking/info/service/serviceList/index.js +129 -0
- package/lib/components/booking/info/service/serviceList/index.less +0 -0
- package/lib/components/booking/utils.d.ts +1 -0
- package/lib/components/booking/utils.js +15 -0
- package/package.json +2 -2
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
.pisell-lowcode__booking-service-item {
|
|
2
|
+
width: 100%;
|
|
3
|
+
border-radius: 8px;
|
|
4
|
+
border: 1px solid #D5D7DA;
|
|
5
|
+
margin-bottom: 16px;
|
|
6
|
+
position: relative;
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
padding: 16px 20px;
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
gap: 4px;
|
|
13
|
+
cursor: pointer;
|
|
14
|
+
background-color: #fff;
|
|
15
|
+
|
|
16
|
+
&:last-child {
|
|
17
|
+
margin-bottom: 0;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&::before {
|
|
21
|
+
content: '';
|
|
22
|
+
position: absolute;
|
|
23
|
+
left: 0;
|
|
24
|
+
top: 0;
|
|
25
|
+
width: 6px;
|
|
26
|
+
height: 100%;
|
|
27
|
+
background: #80BCFE;
|
|
28
|
+
z-index: 2;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.pisell-lowcode__booking-service-item-title {
|
|
32
|
+
color: var(--gray-900, #101828);
|
|
33
|
+
|
|
34
|
+
font-size: 16px;
|
|
35
|
+
font-style: normal;
|
|
36
|
+
font-weight: 600;
|
|
37
|
+
line-height: 24px;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.pisell-lowcode__booking-service-item-date {
|
|
41
|
+
color: var(--gray-500, #667085);
|
|
42
|
+
|
|
43
|
+
font-size: 14px;
|
|
44
|
+
font-style: normal;
|
|
45
|
+
font-weight: 400;
|
|
46
|
+
line-height: 20px;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.pisell-lowcode__booking-service-item-technician {
|
|
50
|
+
color: var(--gray-500, #667085);
|
|
51
|
+
|
|
52
|
+
font-size: 14px;
|
|
53
|
+
font-style: normal;
|
|
54
|
+
font-weight: 400;
|
|
55
|
+
line-height: 20px;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.pisell-lowcode__booking-service-item-price-wrap {
|
|
59
|
+
.pisell-lowcode__booking-service-item-price {
|
|
60
|
+
color: var(--gray-500, #667085);
|
|
61
|
+
|
|
62
|
+
font-size: 14px;
|
|
63
|
+
font-style: normal;
|
|
64
|
+
font-weight: 400;
|
|
65
|
+
line-height: 20px;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.pisell-lowcode__booking-service-item-original-price {
|
|
69
|
+
color: var(--gray-500, #667085);
|
|
70
|
+
|
|
71
|
+
font-size: 14px;
|
|
72
|
+
font-style: normal;
|
|
73
|
+
font-weight: 400;
|
|
74
|
+
line-height: 20px;
|
|
75
|
+
margin-left: 8px;
|
|
76
|
+
text-decoration: line-through;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.pisell-lowcode__booking-service-item-discount-reason {
|
|
83
|
+
color: var(--gray-500, #667085);
|
|
84
|
+
|
|
85
|
+
font-size: 14px;
|
|
86
|
+
font-style: normal;
|
|
87
|
+
font-weight: 400;
|
|
88
|
+
line-height: 20px;
|
|
89
|
+
white-space: break-spaces;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.pisell-lowcode__booking-service-item-error {
|
|
93
|
+
border: none;
|
|
94
|
+
margin: 0 -20px -16px;
|
|
95
|
+
border-radius: 0 0 8px 8px;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/booking/info/service/serviceList/index.tsx
|
|
30
|
+
var serviceList_exports = {};
|
|
31
|
+
__export(serviceList_exports, {
|
|
32
|
+
default: () => serviceList_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(serviceList_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_utils = require("@pisell/utils");
|
|
37
|
+
var import_index = require("./index.less");
|
|
38
|
+
var import_model = require("../../model");
|
|
39
|
+
var import_mock = require("../../../mock");
|
|
40
|
+
var import_utils2 = require("../../../utils");
|
|
41
|
+
var import_serviceItem = __toESM(require("../serviceItem"));
|
|
42
|
+
var ServiceList = () => {
|
|
43
|
+
const { state, dispatch } = (0, import_react.useContext)(import_model.Context);
|
|
44
|
+
const errorTypes = {
|
|
45
|
+
product: import_utils.locales.getText("pisell2.text.status.service-error-1"),
|
|
46
|
+
time: import_utils.locales.getText("pisell2.text.status.service-error-2"),
|
|
47
|
+
maxLimit: import_utils.locales.getText("pisell2.text.status.service-error-3")
|
|
48
|
+
};
|
|
49
|
+
const handleEditService = (item) => {
|
|
50
|
+
if (state.disabledEdit) {
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
dispatch({
|
|
54
|
+
type: "setService",
|
|
55
|
+
payload: {
|
|
56
|
+
editModal: true,
|
|
57
|
+
cacheItem: { ...item, new: 0 }
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
const getResourceItem = (0, import_react.useCallback)(
|
|
62
|
+
(id) => {
|
|
63
|
+
if (id === 0) {
|
|
64
|
+
return (0, import_mock.getNoResource)();
|
|
65
|
+
}
|
|
66
|
+
return state.service.resources.find((d) => d.form_record_id === id);
|
|
67
|
+
},
|
|
68
|
+
[state.service.resources]
|
|
69
|
+
);
|
|
70
|
+
const getErrorMessage = (0, import_react.useCallback)((service, resourceItem) => {
|
|
71
|
+
const errorList = (0, import_utils2.getErrorList)(resourceItem, service);
|
|
72
|
+
let errorMessage = "";
|
|
73
|
+
if (!service.id) {
|
|
74
|
+
return errorList[0].label;
|
|
75
|
+
}
|
|
76
|
+
if (errorList.length) {
|
|
77
|
+
if (errorList.length > 1) {
|
|
78
|
+
errorMessage = `${errorList.length} ${import_utils.locales.getText(
|
|
79
|
+
"pisell2.text.warnings"
|
|
80
|
+
)}`;
|
|
81
|
+
} else {
|
|
82
|
+
errorMessage = (resourceItem == null ? void 0 : resourceItem.labelText) + " " + errorTypes[errorList[0].type];
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
return errorMessage;
|
|
86
|
+
}, []);
|
|
87
|
+
const handleLike = (status, item) => {
|
|
88
|
+
if (state.disabledEdit) {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
let _list = [...state.service.value];
|
|
92
|
+
let _id = item == null ? void 0 : item._id;
|
|
93
|
+
_list = _list.map(
|
|
94
|
+
(d) => d._id === _id ? {
|
|
95
|
+
...d,
|
|
96
|
+
_extend: {
|
|
97
|
+
...d._extend,
|
|
98
|
+
like_status: status
|
|
99
|
+
}
|
|
100
|
+
} : d
|
|
101
|
+
);
|
|
102
|
+
dispatch({
|
|
103
|
+
type: "setService",
|
|
104
|
+
payload: {
|
|
105
|
+
value: _list,
|
|
106
|
+
edit: true
|
|
107
|
+
}
|
|
108
|
+
});
|
|
109
|
+
};
|
|
110
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "" }, state.service.value.map((d) => {
|
|
111
|
+
var _a;
|
|
112
|
+
const resourceItem = getResourceItem((_a = d._extend) == null ? void 0 : _a.resource);
|
|
113
|
+
let errorMessage = getErrorMessage(d, resourceItem);
|
|
114
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
115
|
+
import_serviceItem.default,
|
|
116
|
+
{
|
|
117
|
+
key: d._id,
|
|
118
|
+
getResourceItem,
|
|
119
|
+
errorMessage,
|
|
120
|
+
resourceItem,
|
|
121
|
+
d,
|
|
122
|
+
handleEditService,
|
|
123
|
+
state,
|
|
124
|
+
handleLike
|
|
125
|
+
}
|
|
126
|
+
);
|
|
127
|
+
}));
|
|
128
|
+
};
|
|
129
|
+
var serviceList_default = ServiceList;
|
|
File without changes
|
|
@@ -93,6 +93,7 @@ export declare const deleteCacheParams: () => void;
|
|
|
93
93
|
* @Date: 2024-01-26 14:09
|
|
94
94
|
*/
|
|
95
95
|
export declare const getServerItemExtend: (state: any, cacheItem: any, timeObj: any) => any;
|
|
96
|
+
export declare const getProductTotalPrice: (item: any) => number;
|
|
96
97
|
/**
|
|
97
98
|
* @title: 判断 duration
|
|
98
99
|
* @description: 用于处理不同格式的duration
|
|
@@ -41,6 +41,7 @@ __export(utils_exports, {
|
|
|
41
41
|
getEndDate: () => getEndDate,
|
|
42
42
|
getErrorList: () => getErrorList,
|
|
43
43
|
getLastServer: () => getLastServer,
|
|
44
|
+
getProductTotalPrice: () => getProductTotalPrice,
|
|
44
45
|
getServerItemExtend: () => getServerItemExtend,
|
|
45
46
|
getServiceTime: () => getServiceTime,
|
|
46
47
|
getServiceTimes: () => getServiceTimes,
|
|
@@ -428,6 +429,19 @@ var getServerItemExtend = (state, cacheItem, timeObj) => {
|
|
|
428
429
|
};
|
|
429
430
|
return _extend;
|
|
430
431
|
};
|
|
432
|
+
var getProductTotalPrice = (item) => {
|
|
433
|
+
var _a;
|
|
434
|
+
let price = 0;
|
|
435
|
+
price += Number(item._extend.price);
|
|
436
|
+
let other = (_a = item._extend) == null ? void 0 : _a.other;
|
|
437
|
+
if (other == null ? void 0 : other.bundle) {
|
|
438
|
+
price = other == null ? void 0 : other.bundle.reduce((accumulator, currentValue) => {
|
|
439
|
+
return accumulator + Number(currentValue.price) * Number(currentValue.num);
|
|
440
|
+
}, price);
|
|
441
|
+
}
|
|
442
|
+
price = price;
|
|
443
|
+
return price;
|
|
444
|
+
};
|
|
431
445
|
var getDuration = (duration) => {
|
|
432
446
|
if (typeof duration === "number") {
|
|
433
447
|
return duration;
|
|
@@ -465,6 +479,7 @@ var isWalkIn = (customer_id) => {
|
|
|
465
479
|
getEndDate,
|
|
466
480
|
getErrorList,
|
|
467
481
|
getLastServer,
|
|
482
|
+
getProductTotalPrice,
|
|
468
483
|
getServerItemExtend,
|
|
469
484
|
getServiceTime,
|
|
470
485
|
getServiceTimes,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/private-materials",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.18",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -58,8 +58,8 @@
|
|
|
58
58
|
"ahooks": "^3.7.6",
|
|
59
59
|
"react-infinite-scroll-component": "^6.1.0",
|
|
60
60
|
"rc-virtual-list": "^3.11.3",
|
|
61
|
-
"@pisell/utils": "1.0.23",
|
|
62
61
|
"@pisell/icon": "0.0.8",
|
|
62
|
+
"@pisell/utils": "1.0.23",
|
|
63
63
|
"@pisell/date-picker": "1.0.68"
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|