@pisell/private-materials 3.0.15 → 3.0.17
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.d.ts +1 -1
- package/es/components/booking/addons/index.js +148 -32
- package/es/components/booking/addons/model.d.ts +1 -2
- 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/TabProduct/tabs/index.less +4 -1
- 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/index.js +4 -1
- 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/forms.d.ts +1 -1
- package/es/components/booking/forms/index.d.ts +1 -1
- package/es/components/booking/forms/model.d.ts +1 -2
- package/es/components/booking/forms/single/index.js +16 -82
- package/es/components/booking/index.d.ts +1 -1
- package/es/components/booking/info/index.d.ts +1 -1
- package/es/components/booking/info/model.d.ts +1 -2
- package/es/components/booking/info/service/addService/index.js +141 -71
- 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 -100
- package/es/components/booking/info/service/serve.d.ts +1 -0
- package/es/components/booking/info/service/serve.js +21 -0
- 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/info/utils.d.ts +1 -0
- package/es/components/booking/info/utils.js +8 -0
- package/es/components/booking/model.d.ts +1 -2
- package/es/components/booking/notes/index.d.ts +1 -1
- package/es/components/booking/notes/model.d.ts +1 -2
- package/es/components/booking/payments/index.d.ts +1 -1
- package/es/components/booking/payments/model.d.ts +1 -2
- package/es/components/booking/utils.d.ts +16 -0
- package/es/components/booking/utils.js +37 -0
- package/es/components/productExtension/fields/SelectResourcesTable/index.js +2 -1
- package/es/components/productExtension/locales.js +5 -5
- package/es/components/schedules/index.d.ts +1 -1
- package/es/components/schedules/model.d.ts +1 -2
- package/lib/components/booking/addons/index.d.ts +1 -1
- package/lib/components/booking/addons/index.js +159 -35
- package/lib/components/booking/addons/model.d.ts +1 -2
- 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/TabProduct/tabs/index.less +4 -1
- 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/index.js +3 -0
- 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/forms.d.ts +1 -1
- package/lib/components/booking/forms/index.d.ts +1 -1
- package/lib/components/booking/forms/model.d.ts +1 -2
- package/lib/components/booking/forms/single/index.js +12 -48
- package/lib/components/booking/index.d.ts +1 -1
- package/lib/components/booking/info/index.d.ts +1 -1
- package/lib/components/booking/info/model.d.ts +1 -2
- package/lib/components/booking/info/service/addService/index.js +68 -34
- 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 -100
- package/lib/components/booking/info/service/serve.d.ts +1 -0
- package/lib/components/booking/info/service/serve.js +30 -0
- 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/info/utils.d.ts +1 -0
- package/lib/components/booking/info/utils.js +35 -0
- package/lib/components/booking/model.d.ts +1 -2
- package/lib/components/booking/notes/index.d.ts +1 -1
- package/lib/components/booking/notes/model.d.ts +1 -2
- package/lib/components/booking/payments/index.d.ts +1 -1
- package/lib/components/booking/payments/model.d.ts +1 -2
- package/lib/components/booking/utils.d.ts +16 -0
- package/lib/components/booking/utils.js +29 -0
- package/lib/components/productExtension/fields/SelectResourcesTable/index.js +1 -1
- package/lib/components/productExtension/locales.js +5 -5
- package/lib/components/schedules/index.d.ts +1 -1
- package/lib/components/schedules/model.d.ts +1 -2
- package/package.json +3 -3
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
.pisell-lowcode__booking-service-wrap {
|
|
2
|
-
margin-top: 16px;
|
|
3
|
-
}
|
|
4
|
-
.pisell-lowcode__booking-service-item {
|
|
5
|
-
width: 100%;
|
|
6
|
-
border-radius: 8px;
|
|
7
|
-
border: 1px solid #D5D7DA;
|
|
8
|
-
margin-bottom: 16px;
|
|
9
|
-
position: relative;
|
|
10
|
-
overflow: hidden;
|
|
11
|
-
padding: 16px 20px;
|
|
12
|
-
display: flex;
|
|
13
|
-
flex-direction: column;
|
|
14
|
-
justify-content: center;
|
|
15
|
-
gap: 4px;
|
|
16
|
-
cursor: pointer;
|
|
17
|
-
background-color: #fff;
|
|
18
|
-
|
|
19
|
-
&:last-child {
|
|
20
|
-
margin-bottom: 0;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
&::before {
|
|
24
|
-
content: '';
|
|
25
|
-
position: absolute;
|
|
26
|
-
left: 0;
|
|
27
|
-
top: 0;
|
|
28
|
-
width: 6px;
|
|
29
|
-
height: 100%;
|
|
30
|
-
background: #80BCFE;
|
|
31
|
-
z-index: 2;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.pisell-lowcode__booking-service-item-title {
|
|
35
|
-
color: var(--gray-900, #101828);
|
|
36
|
-
|
|
37
|
-
font-size: 16px;
|
|
38
|
-
font-style: normal;
|
|
39
|
-
font-weight: 600;
|
|
40
|
-
line-height: 24px;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.pisell-lowcode__booking-service-item-date {
|
|
44
|
-
color: var(--gray-500, #667085);
|
|
45
|
-
|
|
46
|
-
font-size: 14px;
|
|
47
|
-
font-style: normal;
|
|
48
|
-
font-weight: 400;
|
|
49
|
-
line-height: 20px;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
.pisell-lowcode__booking-service-item-technician {
|
|
53
|
-
color: var(--gray-500, #667085);
|
|
54
|
-
|
|
55
|
-
font-size: 14px;
|
|
56
|
-
font-style: normal;
|
|
57
|
-
font-weight: 400;
|
|
58
|
-
line-height: 20px;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
.pisell-lowcode__booking-service-item-price-wrap {
|
|
62
|
-
.pisell-lowcode__booking-service-item-price {
|
|
63
|
-
color: var(--gray-500, #667085);
|
|
64
|
-
|
|
65
|
-
font-size: 14px;
|
|
66
|
-
font-style: normal;
|
|
67
|
-
font-weight: 400;
|
|
68
|
-
line-height: 20px;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
.pisell-lowcode__booking-service-item-original-price {
|
|
72
|
-
color: var(--gray-500, #667085);
|
|
73
|
-
|
|
74
|
-
font-size: 14px;
|
|
75
|
-
font-style: normal;
|
|
76
|
-
font-weight: 400;
|
|
77
|
-
line-height: 20px;
|
|
78
|
-
margin-left: 8px;
|
|
79
|
-
text-decoration: line-through;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.pisell-lowcode__booking-service-item-discount-reason {
|
|
86
|
-
color: var(--gray-500, #667085);
|
|
87
|
-
|
|
88
|
-
font-size: 14px;
|
|
89
|
-
font-style: normal;
|
|
90
|
-
font-weight: 400;
|
|
91
|
-
line-height: 20px;
|
|
92
|
-
white-space: break-spaces;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.pisell-lowcode__booking-service-item-error {
|
|
96
|
-
border: none;
|
|
97
|
-
margin: 0 -20px -16px;
|
|
98
|
-
border-radius: 0 0 8px 8px;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getProductDetail: (id: string, params: any) => Promise<any>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/components/booking/info/service/serve.ts
|
|
20
|
+
var serve_exports = {};
|
|
21
|
+
__export(serve_exports, {
|
|
22
|
+
getProductDetail: () => getProductDetail
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(serve_exports);
|
|
25
|
+
var import_utils = require("../../utils");
|
|
26
|
+
var getProductDetail = async (id, params) => import_utils.request.getRequest().get(`/shop/product/query/${id}`, params);
|
|
27
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
28
|
+
0 && (module.exports = {
|
|
29
|
+
getProductDetail
|
|
30
|
+
});
|
|
@@ -0,0 +1,98 @@
|
|
|
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/serviceItem/index.tsx
|
|
30
|
+
var serviceItem_exports = {};
|
|
31
|
+
__export(serviceItem_exports, {
|
|
32
|
+
default: () => serviceItem_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(serviceItem_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_like = __toESM(require("../like"));
|
|
37
|
+
var import_utils = require("../../../utils");
|
|
38
|
+
var import_utils2 = require("@pisell/utils");
|
|
39
|
+
var import_collapsibleList = __toESM(require("../../../components/collapsibleList"));
|
|
40
|
+
var import_utils3 = require("../../../components/collapsibleList/utils");
|
|
41
|
+
var import_antd = require("antd");
|
|
42
|
+
var import_index = require("./index.less");
|
|
43
|
+
var ServiceItem = ({
|
|
44
|
+
d,
|
|
45
|
+
handleEditService,
|
|
46
|
+
state,
|
|
47
|
+
handleLike,
|
|
48
|
+
resourceItem,
|
|
49
|
+
errorMessage
|
|
50
|
+
}) => {
|
|
51
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i;
|
|
52
|
+
let resourceName = (resourceItem == null ? void 0 : resourceItem.labelText) || d.relation_form_name;
|
|
53
|
+
const isDiscount = (0, import_react.useMemo)(() => {
|
|
54
|
+
var _a2, _b2;
|
|
55
|
+
return Number((_a2 = d._extend) == null ? void 0 : _a2.total) != Number((_b2 = d._extend) == null ? void 0 : _b2.origin_total);
|
|
56
|
+
}, [(_a = d._extend) == null ? void 0 : _a.total, (_b = d._extend) == null ? void 0 : _b.origin_total]);
|
|
57
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
58
|
+
"div",
|
|
59
|
+
{
|
|
60
|
+
key: d._id,
|
|
61
|
+
className: "pisell-lowcode__booking-service-item",
|
|
62
|
+
onClick: () => {
|
|
63
|
+
handleEditService(d);
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
d.id ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-item-title" }, d.title) : null,
|
|
67
|
+
d._extend ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-item-date" }, (0, import_utils.getServiceTime)(d, state.date.value)), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-item-technician" }, d._extend.resource ? /* @__PURE__ */ import_react.default.createElement(
|
|
68
|
+
import_like.default,
|
|
69
|
+
{
|
|
70
|
+
style: { marginRight: 4 },
|
|
71
|
+
status: d._extend.like_status,
|
|
72
|
+
onChange: (e) => {
|
|
73
|
+
handleLike(e, d);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
) : null, resourceName)) : null,
|
|
77
|
+
(((_d = (_c = d._extend) == null ? void 0 : _c.other) == null ? void 0 : _d.bundle) || []).length ? /* @__PURE__ */ import_react.default.createElement(
|
|
78
|
+
import_collapsibleList.default,
|
|
79
|
+
{
|
|
80
|
+
border: true,
|
|
81
|
+
list: ((_f = (_e = d._extend) == null ? void 0 : _e.other) == null ? void 0 : _f.bundle) || [],
|
|
82
|
+
renderItem: (item) => (0, import_utils3.renderBundles)(item, state.amountSymbol)
|
|
83
|
+
}
|
|
84
|
+
) : null,
|
|
85
|
+
d.id ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-item-price-wrap" }, /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-lowcode__booking-service-item-price" }, (0, import_utils2.formatAmount)((_g = d._extend) == null ? void 0 : _g.total, 2, state.amountSymbol)), isDiscount ? /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-lowcode__booking-service-item-original-price" }, (0, import_utils2.formatAmount)(d._extend.origin_total, 2, state.amountSymbol)) : null)) : null,
|
|
86
|
+
isDiscount && ((_h = d._extend) == null ? void 0 : _h.discount_reason) ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-item-discount-reason" }, /* @__PURE__ */ import_react.default.createElement("span", null, import_utils2.locales.getText("pisell2.text.discount-reason"), ":"), " ", (_i = d._extend) == null ? void 0 : _i.discount_reason) : null,
|
|
87
|
+
errorMessage ? /* @__PURE__ */ import_react.default.createElement(
|
|
88
|
+
import_antd.Alert,
|
|
89
|
+
{
|
|
90
|
+
message: errorMessage,
|
|
91
|
+
type: "warning",
|
|
92
|
+
showIcon: true,
|
|
93
|
+
className: "pisell-lowcode__booking-service-item-error"
|
|
94
|
+
}
|
|
95
|
+
) : null
|
|
96
|
+
);
|
|
97
|
+
};
|
|
98
|
+
var serviceItem_default = ServiceItem;
|
|
@@ -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
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getIsBundleOrCombination: (productDetail: any) => boolean;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/components/booking/info/utils.ts
|
|
20
|
+
var utils_exports = {};
|
|
21
|
+
__export(utils_exports, {
|
|
22
|
+
getIsBundleOrCombination: () => getIsBundleOrCombination
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(utils_exports);
|
|
25
|
+
var getIsBundleOrCombination = (productDetail) => {
|
|
26
|
+
var _a, _b, _c;
|
|
27
|
+
if (((_a = productDetail == null ? void 0 : productDetail.bundle_group) == null ? void 0 : _a.length) || ((_b = productDetail == null ? void 0 : productDetail.option_group) == null ? void 0 : _b.length) || ((_c = productDetail == null ? void 0 : productDetail.variant) == null ? void 0 : _c.length)) {
|
|
28
|
+
return true;
|
|
29
|
+
}
|
|
30
|
+
return false;
|
|
31
|
+
};
|
|
32
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
33
|
+
0 && (module.exports = {
|
|
34
|
+
getIsBundleOrCombination
|
|
35
|
+
});
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export interface FormState {
|
|
3
2
|
amountSymbol: string;
|
|
4
3
|
apis: {
|
|
@@ -87,7 +86,7 @@ export declare const walkInData: {
|
|
|
87
86
|
id: number;
|
|
88
87
|
nickname: string;
|
|
89
88
|
};
|
|
90
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
89
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
|
|
91
90
|
state: FormState;
|
|
92
91
|
} & {
|
|
93
92
|
dispatch: (params: {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { FormState } from "../model";
|
|
3
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
2
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
|
|
4
3
|
state: FormState;
|
|
5
4
|
} & {
|
|
6
5
|
dispatch: (params: {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { FormState } from "../model";
|
|
3
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
2
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
|
|
4
3
|
state: FormState;
|
|
5
4
|
} & {
|
|
6
5
|
dispatch: (params: {
|
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
import dayjs from 'dayjs';
|
|
2
|
+
declare type RType = (url: string, data?: {} | undefined, config?: {} | undefined) => Promise<any>;
|
|
3
|
+
declare class Request {
|
|
4
|
+
private request;
|
|
5
|
+
constructor();
|
|
6
|
+
setRequest(val: any): void;
|
|
7
|
+
getRequest(): {
|
|
8
|
+
get: RType;
|
|
9
|
+
post: RType;
|
|
10
|
+
put: RType;
|
|
11
|
+
remove: RType;
|
|
12
|
+
custom: RType;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export declare const request: Request;
|
|
2
16
|
export declare const getDiscountTime: (service_times: number) => string;
|
|
3
17
|
export declare const sliceDayIntoFiveMinutes: (config: any, locale: string) => {
|
|
4
18
|
timeSlices: {
|
|
@@ -79,6 +93,7 @@ export declare const deleteCacheParams: () => void;
|
|
|
79
93
|
* @Date: 2024-01-26 14:09
|
|
80
94
|
*/
|
|
81
95
|
export declare const getServerItemExtend: (state: any, cacheItem: any, timeObj: any) => any;
|
|
96
|
+
export declare const getProductTotalPrice: (item: any) => number;
|
|
82
97
|
/**
|
|
83
98
|
* @title: 判断 duration
|
|
84
99
|
* @description: 用于处理不同格式的duration
|
|
@@ -95,3 +110,4 @@ export declare const getDuration: (duration: number | {
|
|
|
95
110
|
value: number;
|
|
96
111
|
} | "flexible";
|
|
97
112
|
export declare const isWalkIn: (customer_id?: number | string) => boolean;
|
|
113
|
+
export {};
|
|
@@ -41,17 +41,31 @@ __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,
|
|
47
48
|
getShopOpeningHours: () => getShopOpeningHours,
|
|
48
49
|
isWalkIn: () => isWalkIn,
|
|
50
|
+
request: () => request,
|
|
49
51
|
sliceDayIntoFiveMinutes: () => sliceDayIntoFiveMinutes
|
|
50
52
|
});
|
|
51
53
|
module.exports = __toCommonJS(utils_exports);
|
|
52
54
|
var import_dayjs = __toESM(require("dayjs"));
|
|
53
55
|
var import_utils = require("@pisell/utils");
|
|
54
56
|
var import_lodash = require("lodash");
|
|
57
|
+
var Request = class {
|
|
58
|
+
constructor() {
|
|
59
|
+
this.request = {};
|
|
60
|
+
}
|
|
61
|
+
setRequest(val) {
|
|
62
|
+
this.request = val;
|
|
63
|
+
}
|
|
64
|
+
getRequest() {
|
|
65
|
+
return this.request;
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
var request = new Request();
|
|
55
69
|
var getDiscountTime = (service_times) => {
|
|
56
70
|
if (!service_times) {
|
|
57
71
|
return "";
|
|
@@ -415,6 +429,19 @@ var getServerItemExtend = (state, cacheItem, timeObj) => {
|
|
|
415
429
|
};
|
|
416
430
|
return _extend;
|
|
417
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
|
+
};
|
|
418
445
|
var getDuration = (duration) => {
|
|
419
446
|
if (typeof duration === "number") {
|
|
420
447
|
return duration;
|
|
@@ -452,10 +479,12 @@ var isWalkIn = (customer_id) => {
|
|
|
452
479
|
getEndDate,
|
|
453
480
|
getErrorList,
|
|
454
481
|
getLastServer,
|
|
482
|
+
getProductTotalPrice,
|
|
455
483
|
getServerItemExtend,
|
|
456
484
|
getServiceTime,
|
|
457
485
|
getServiceTimes,
|
|
458
486
|
getShopOpeningHours,
|
|
459
487
|
isWalkIn,
|
|
488
|
+
request,
|
|
460
489
|
sliceDayIntoFiveMinutes
|
|
461
490
|
});
|
|
@@ -49,7 +49,7 @@ var SelectResourcesTable = ({ value, onChange }) => {
|
|
|
49
49
|
const [data, setData] = (0, import_react.useState)([]);
|
|
50
50
|
const _getData = async () => {
|
|
51
51
|
let _getFormTypes = (0, import_server.getFormTypes)(
|
|
52
|
-
{ type: "manual", num: 500, skip: 1 },
|
|
52
|
+
{ type: "manual", num: 500, skip: 1, status: "published" },
|
|
53
53
|
{ useCache: true }
|
|
54
54
|
);
|
|
55
55
|
let _getAllResource = (0, import_server.getAllResource)(
|