@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
|
@@ -0,0 +1,94 @@
|
|
|
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/components/collapsibleList/index.tsx
|
|
30
|
+
var collapsibleList_exports = {};
|
|
31
|
+
__export(collapsibleList_exports, {
|
|
32
|
+
default: () => collapsibleList_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(collapsibleList_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_utils = require("@pisell/utils");
|
|
37
|
+
var import_classnames = __toESM(require("classnames"));
|
|
38
|
+
var import_index = require("./index.less");
|
|
39
|
+
var MAX_LIMIT = 3;
|
|
40
|
+
var CollapsibleList = (props) => {
|
|
41
|
+
const { list = [], renderItem, className, style, border } = props;
|
|
42
|
+
const [maxLimit, setMaxLimit] = (0, import_react.useState)(MAX_LIMIT);
|
|
43
|
+
const handlePreviewAll = () => {
|
|
44
|
+
let _maxLimit = maxLimit;
|
|
45
|
+
if (_maxLimit === MAX_LIMIT) {
|
|
46
|
+
_maxLimit = 99;
|
|
47
|
+
} else {
|
|
48
|
+
_maxLimit = MAX_LIMIT;
|
|
49
|
+
}
|
|
50
|
+
setMaxLimit(_maxLimit);
|
|
51
|
+
};
|
|
52
|
+
const showAll = (0, import_react.useMemo)(() => {
|
|
53
|
+
return list.length > MAX_LIMIT;
|
|
54
|
+
}, [list]);
|
|
55
|
+
const viewAllText = (0, import_react.useMemo)(() => {
|
|
56
|
+
let _maxLimit = maxLimit;
|
|
57
|
+
if (_maxLimit === MAX_LIMIT) {
|
|
58
|
+
return import_utils.locales.getText("pisell2.text.view-all");
|
|
59
|
+
}
|
|
60
|
+
return import_utils.locales.getText("pisell2.text.view-less");
|
|
61
|
+
}, [maxLimit]);
|
|
62
|
+
const _list = (0, import_react.useMemo)(() => {
|
|
63
|
+
let arr = [...list];
|
|
64
|
+
let _maxLimit = maxLimit;
|
|
65
|
+
if (list.length > _maxLimit) {
|
|
66
|
+
arr = arr.slice(0, _maxLimit);
|
|
67
|
+
}
|
|
68
|
+
return arr;
|
|
69
|
+
}, [list.length, maxLimit]);
|
|
70
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
71
|
+
"div",
|
|
72
|
+
{
|
|
73
|
+
className: (0, import_classnames.default)("pisell2-collapsible-list-wrap", className),
|
|
74
|
+
style
|
|
75
|
+
},
|
|
76
|
+
border ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell2-collapsible-list-top-border" }) : null,
|
|
77
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "pisell2-collapsible-list" }, _list.map((d, i) => {
|
|
78
|
+
return renderItem(d, i);
|
|
79
|
+
})),
|
|
80
|
+
showAll ? /* @__PURE__ */ import_react.default.createElement(
|
|
81
|
+
"div",
|
|
82
|
+
{
|
|
83
|
+
className: "pisell2-collapsible-list-view-all",
|
|
84
|
+
onClick: (e) => {
|
|
85
|
+
e.preventDefault();
|
|
86
|
+
e.stopPropagation();
|
|
87
|
+
handlePreviewAll();
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
viewAllText
|
|
91
|
+
) : null
|
|
92
|
+
);
|
|
93
|
+
};
|
|
94
|
+
var collapsibleList_default = CollapsibleList;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
.pisell2-collapsible-list-wrap {
|
|
2
|
+
.pisell2-collapsible-list-top-border {
|
|
3
|
+
height: 1px;
|
|
4
|
+
background: #f1f1f1;
|
|
5
|
+
width: 100%;
|
|
6
|
+
margin: 8px 0;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.pisell2-collapsible-list {
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
gap: 4px;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.pisell2-collapsible-list-view-all {
|
|
16
|
+
margin-top: 4px;
|
|
17
|
+
color: #7f56d9;
|
|
18
|
+
font-size: 16px;
|
|
19
|
+
font-style: normal;
|
|
20
|
+
font-weight: 700;
|
|
21
|
+
line-height: 24px;
|
|
22
|
+
user-select: none;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
.product-bundle-item {
|
|
29
|
+
width: 100%;
|
|
30
|
+
|
|
31
|
+
.product-bundle-info {
|
|
32
|
+
width: 100%;
|
|
33
|
+
display: flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
justify-content: space-between;
|
|
36
|
+
|
|
37
|
+
.product-bundle-info-title {
|
|
38
|
+
color: var(--gray-500, #667085);
|
|
39
|
+
font-size: 14px;
|
|
40
|
+
font-style: normal;
|
|
41
|
+
font-weight: 500;
|
|
42
|
+
line-height: 20px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.product-bundle-info-num {
|
|
46
|
+
color: var(--Gray-500, #667085);
|
|
47
|
+
font-size: 14px;
|
|
48
|
+
font-style: normal;
|
|
49
|
+
font-weight: 400;
|
|
50
|
+
line-height: 20px;
|
|
51
|
+
flex-shrink: 0;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.product-bundle-option {
|
|
56
|
+
color: var(--gray-500, #667085);
|
|
57
|
+
font-size: 12px;
|
|
58
|
+
margin-top: 4px;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
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/components/collapsibleList/utils.tsx
|
|
30
|
+
var utils_exports = {};
|
|
31
|
+
__export(utils_exports, {
|
|
32
|
+
renderBundles: () => renderBundles
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(utils_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_utils = require("@pisell/utils");
|
|
37
|
+
var renderBundles = (item, amountSymbol) => {
|
|
38
|
+
const options = (item == null ? void 0 : item.option) || [];
|
|
39
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { key: item.id, className: "product-bundle-item" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "product-bundle-info" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "product-bundle-info-title" }, item.title), /* @__PURE__ */ import_react.default.createElement("div", { className: "product-bundle-info-num" }, (0, import_utils.formatAmount)(item.price, 2, amountSymbol), " × ", item.num)), /* @__PURE__ */ import_react.default.createElement("div", { className: "product-bundle-option" }, options.map((option, index) => {
|
|
40
|
+
return /* @__PURE__ */ import_react.default.createElement("span", { key: option.id }, option.name, " x ", option.num, " ", index < options.length - 1 && ",", " ");
|
|
41
|
+
})));
|
|
42
|
+
};
|
|
43
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
44
|
+
0 && (module.exports = {
|
|
45
|
+
renderBundles
|
|
46
|
+
});
|
|
@@ -32,11 +32,11 @@ var getProductAmount = (state, isEdit) => {
|
|
|
32
32
|
if (isEdit) {
|
|
33
33
|
if ((state == null ? void 0 : state.service) || (state == null ? void 0 : state.addons)) {
|
|
34
34
|
for (let item of state == null ? void 0 : state.service.value) {
|
|
35
|
-
price += Number(item._extend.
|
|
35
|
+
price += Number(item._extend.total);
|
|
36
36
|
duration += import_utils.flexibleObj.getValue(item._extend.duration);
|
|
37
37
|
}
|
|
38
38
|
for (let item of state.addons.value) {
|
|
39
|
-
price += Number(item.
|
|
39
|
+
price += Number(item._extend.total) * item._extend.quantity;
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
} else {
|
|
@@ -53,7 +53,7 @@ var getProductAmount = (state, isEdit) => {
|
|
|
53
53
|
};
|
|
54
54
|
var getProductItemTax = (item, bookingDetail) => {
|
|
55
55
|
let price = 0;
|
|
56
|
-
const productDiscountPrice = Number(item.
|
|
56
|
+
const productDiscountPrice = Number(item.total);
|
|
57
57
|
const shopTax = productDiscountPrice * Number(bookingDetail.tax_rate) * Number(item.is_charge_tax);
|
|
58
58
|
const shopTaxRate = 1 + bookingDetail.tax_rate * bookingDetail.is_price_include_tax;
|
|
59
59
|
const res = shopTax / shopTaxRate * item.quantity;
|
|
@@ -61,10 +61,7 @@ var getProductItemTax = (item, bookingDetail) => {
|
|
|
61
61
|
return price;
|
|
62
62
|
};
|
|
63
63
|
var getTotal = (item) => {
|
|
64
|
-
return item._extend.payment_price !== void 0 ? item._extend.payment_price : item._extend.
|
|
65
|
-
};
|
|
66
|
-
var getAddonsTotal = (item) => {
|
|
67
|
-
return item.payment_price !== void 0 ? item.payment_price : item.price;
|
|
64
|
+
return item._extend.payment_price !== void 0 ? item._extend.payment_price : item._extend.total;
|
|
68
65
|
};
|
|
69
66
|
var getTax = (state, isEdit) => {
|
|
70
67
|
var _a;
|
|
@@ -80,7 +77,8 @@ var getTax = (state, isEdit) => {
|
|
|
80
77
|
price += getProductItemTax(
|
|
81
78
|
{
|
|
82
79
|
...item,
|
|
83
|
-
|
|
80
|
+
total: getTotal(item),
|
|
81
|
+
price: item._extend.price,
|
|
84
82
|
quantity: item._extend.quantity
|
|
85
83
|
},
|
|
86
84
|
state.bookingDetail
|
|
@@ -89,8 +87,9 @@ var getTax = (state, isEdit) => {
|
|
|
89
87
|
for (let item of state.addons.value) {
|
|
90
88
|
price += getProductItemTax({
|
|
91
89
|
...item,
|
|
92
|
-
|
|
93
|
-
|
|
90
|
+
total: getTotal(item),
|
|
91
|
+
price: item._extend.price,
|
|
92
|
+
quantity: item._extend.quantity
|
|
94
93
|
}, state.bookingDetail);
|
|
95
94
|
}
|
|
96
95
|
}
|
|
@@ -171,6 +171,9 @@ var Footer = (props) => {
|
|
|
171
171
|
return callbackData;
|
|
172
172
|
} catch (err) {
|
|
173
173
|
console.log(err);
|
|
174
|
+
if ((err == null ? void 0 : err.code) === 70101) {
|
|
175
|
+
import_antd.message.error(err == null ? void 0 : err.message);
|
|
176
|
+
}
|
|
174
177
|
_setLoading(false);
|
|
175
178
|
}
|
|
176
179
|
};
|
|
@@ -1 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @title: 套餐单规格信息
|
|
3
|
+
* @description:
|
|
4
|
+
* @param {any} option
|
|
5
|
+
* @return {*}
|
|
6
|
+
* @Author: zhiwei.Wang
|
|
7
|
+
* @Date: 2024-02-19 09:26
|
|
8
|
+
*/
|
|
9
|
+
export declare const formatProductOption: (option: any) => any;
|
|
10
|
+
/**
|
|
11
|
+
* @title: 套餐信息
|
|
12
|
+
* @description:
|
|
13
|
+
* @param {any} bundle
|
|
14
|
+
* @return {*}
|
|
15
|
+
* @Author: zhiwei.Wang
|
|
16
|
+
* @Date: 2024-02-19 09:26
|
|
17
|
+
*/
|
|
18
|
+
export declare const formatProductBundle: (bundle: any) => any;
|
|
1
19
|
export declare const formatValues: (state: any) => any;
|
|
@@ -19,6 +19,8 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
19
19
|
// src/components/booking/components/footer/utils.ts
|
|
20
20
|
var utils_exports = {};
|
|
21
21
|
__export(utils_exports, {
|
|
22
|
+
formatProductBundle: () => formatProductBundle,
|
|
23
|
+
formatProductOption: () => formatProductOption,
|
|
22
24
|
formatValues: () => formatValues
|
|
23
25
|
});
|
|
24
26
|
module.exports = __toCommonJS(utils_exports);
|
|
@@ -42,28 +44,63 @@ var formatCustomer = (data) => {
|
|
|
42
44
|
country_calling_code: (_l = (_k = data.client) == null ? void 0 : _k.value) == null ? void 0 : _l.country_calling_code
|
|
43
45
|
};
|
|
44
46
|
};
|
|
47
|
+
var formatProductOption = (option) => {
|
|
48
|
+
if (!option) {
|
|
49
|
+
return [];
|
|
50
|
+
}
|
|
51
|
+
return option.map((d) => {
|
|
52
|
+
return {
|
|
53
|
+
"num": d.num,
|
|
54
|
+
"option_group_item_id": d.product_option_item_id,
|
|
55
|
+
"option_group_id": d.option_group_id
|
|
56
|
+
};
|
|
57
|
+
});
|
|
58
|
+
};
|
|
59
|
+
var formatProductBundle = (bundle) => {
|
|
60
|
+
if (!bundle) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
return bundle.map((d) => {
|
|
64
|
+
return {
|
|
65
|
+
"bundle_group_id": d.group_id,
|
|
66
|
+
"bundle_id": d.id,
|
|
67
|
+
"bundle_product_id": d._bundle_product_id,
|
|
68
|
+
"bundle_variant_id": d.bundle_variant_id,
|
|
69
|
+
"num": d.num,
|
|
70
|
+
"extension_id": d.extension_id,
|
|
71
|
+
"extension_type": d.extension_type,
|
|
72
|
+
"option": formatProductOption(d.option)
|
|
73
|
+
};
|
|
74
|
+
});
|
|
75
|
+
};
|
|
45
76
|
var formatBookings = (data) => {
|
|
46
77
|
const list = data.service.value;
|
|
47
78
|
const eventOtherParams = data.eventOtherParams;
|
|
48
79
|
let bookings = [];
|
|
49
80
|
bookings = list.map((item) => {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
81
|
+
var _a, _b;
|
|
82
|
+
const start_date = item._extend.startDate.format("YYYY-MM-DD");
|
|
83
|
+
const end_date = item._extend.endDate.format("YYYY-MM-DD");
|
|
84
|
+
const end_time = item._extend.endDate.format("HH:mm");
|
|
85
|
+
const start_time = item._extend.startDate.format("HH:mm");
|
|
86
|
+
const total = Number(item._extend.total);
|
|
87
|
+
const origin_total = Number(item._extend.origin_total);
|
|
88
|
+
const discount_amount = origin_total - total;
|
|
54
89
|
return {
|
|
55
90
|
"product": {
|
|
56
91
|
"num": item._extend.quantity,
|
|
57
|
-
"price": item.price,
|
|
92
|
+
"price": item._extend.price,
|
|
58
93
|
"product_id": item.id,
|
|
59
|
-
"discount_amount":
|
|
94
|
+
"discount_amount": discount_amount,
|
|
60
95
|
"product_discount_reason": item._extend.discount_reason || "",
|
|
61
96
|
"is_charge_tax": item.is_charge_tax,
|
|
62
97
|
"note": "",
|
|
63
98
|
"discountway": item._extend.discountway || "num",
|
|
64
99
|
"discount_per": item._extend.discount_per,
|
|
65
100
|
"discount_type": item._extend.discount_type || "discount",
|
|
66
|
-
"order_detail_id": item._extend.order_detail_id || 0
|
|
101
|
+
"order_detail_id": item._extend.order_detail_id || 0,
|
|
102
|
+
"product_bundle": formatProductBundle((_b = (_a = item._extend) == null ? void 0 : _a.other) == null ? void 0 : _b.bundle),
|
|
103
|
+
"bundle_edit": item._extend.bundle_edit
|
|
67
104
|
},
|
|
68
105
|
"id": item.booking_id || 0,
|
|
69
106
|
"relation_id": item._extend.relation_id,
|
|
@@ -130,5 +167,7 @@ var formatValues = (state) => {
|
|
|
130
167
|
};
|
|
131
168
|
// Annotate the CommonJS export names for ESM import in node:
|
|
132
169
|
0 && (module.exports = {
|
|
170
|
+
formatProductBundle,
|
|
171
|
+
formatProductOption,
|
|
133
172
|
formatValues
|
|
134
173
|
});
|
|
@@ -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: {
|
|
@@ -37,8 +37,8 @@ var import_FileDownload02 = __toESM(require("@pisell/icon/es/FileDownload02"));
|
|
|
37
37
|
var import_utils = require("@pisell/utils");
|
|
38
38
|
var import_antd = require("antd");
|
|
39
39
|
var import_customSelect = __toESM(require("../../components/customSelect"));
|
|
40
|
+
var import_collapsibleList = __toESM(require("../../components/collapsibleList"));
|
|
40
41
|
var import_index = require("./index.less");
|
|
41
|
-
var MAX_LIMIT = 3;
|
|
42
42
|
var Single = ({
|
|
43
43
|
value,
|
|
44
44
|
onChange,
|
|
@@ -53,7 +53,6 @@ var Single = ({
|
|
|
53
53
|
watch
|
|
54
54
|
}) => {
|
|
55
55
|
var _a, _b;
|
|
56
|
-
const [maxLimit, setMaxLimit] = (0, import_react.useState)({});
|
|
57
56
|
const renderFieldValue = (fieldData, field) => {
|
|
58
57
|
const val = fieldData[field.key];
|
|
59
58
|
if (field.filed_type === "attachment") {
|
|
@@ -107,41 +106,17 @@ var Single = ({
|
|
|
107
106
|
const renderItem = (0, import_react.useCallback)(
|
|
108
107
|
(fieldData) => {
|
|
109
108
|
let _fields = form.field || [];
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
);
|
|
120
|
-
const handlePreviewAll = (d) => {
|
|
121
|
-
let _maxLimit = maxLimit[d.form_record_id] || MAX_LIMIT;
|
|
122
|
-
if (_maxLimit === MAX_LIMIT) {
|
|
123
|
-
_maxLimit = 99;
|
|
124
|
-
} else {
|
|
125
|
-
_maxLimit = MAX_LIMIT;
|
|
126
|
-
}
|
|
127
|
-
setMaxLimit({
|
|
128
|
-
...maxLimit,
|
|
129
|
-
[d.form_record_id]: _maxLimit
|
|
130
|
-
});
|
|
131
|
-
};
|
|
132
|
-
const showAll = (0, import_react.useMemo)(() => {
|
|
133
|
-
let _field = form.field || [];
|
|
134
|
-
return _field.length > MAX_LIMIT;
|
|
135
|
-
}, [maxLimit, form]);
|
|
136
|
-
const viewAllText = (0, import_react.useCallback)(
|
|
137
|
-
(d) => {
|
|
138
|
-
let _maxLimit = maxLimit[d.form_record_id] || MAX_LIMIT;
|
|
139
|
-
if (_maxLimit === MAX_LIMIT) {
|
|
140
|
-
return import_utils.locales.getText("pisell2.text.view-all");
|
|
141
|
-
}
|
|
142
|
-
return import_utils.locales.getText("pisell2.text.view-less");
|
|
109
|
+
return /* @__PURE__ */ import_react.default.createElement(
|
|
110
|
+
import_collapsibleList.default,
|
|
111
|
+
{
|
|
112
|
+
list: _fields,
|
|
113
|
+
renderItem: (field) => {
|
|
114
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "pet-form-item", key: field.key }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pet-form-item-label" }, field.field_column.title), /* @__PURE__ */ import_react.default.createElement("div", { className: "pet-form-item-value" }, renderFieldValue(fieldData, field)));
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
);
|
|
143
118
|
},
|
|
144
|
-
[
|
|
119
|
+
[form]
|
|
145
120
|
);
|
|
146
121
|
const _optionRender = (item) => {
|
|
147
122
|
if (optionRender) {
|
|
@@ -183,18 +158,7 @@ var Single = ({
|
|
|
183
158
|
mode: _mode,
|
|
184
159
|
previewItemClassName: "pisell-lowcode__booking-pet-card",
|
|
185
160
|
previewItemRender: (d) => {
|
|
186
|
-
return
|
|
187
|
-
"div",
|
|
188
|
-
{
|
|
189
|
-
className: "pet-form-view-all",
|
|
190
|
-
onClick: (e) => {
|
|
191
|
-
e.preventDefault();
|
|
192
|
-
e.stopPropagation();
|
|
193
|
-
handlePreviewAll(d);
|
|
194
|
-
}
|
|
195
|
-
},
|
|
196
|
-
viewAllText(d)
|
|
197
|
-
) : null);
|
|
161
|
+
return renderItem(d);
|
|
198
162
|
},
|
|
199
163
|
name: ((_a = form.form) == null ? void 0 : _a.title) || "-",
|
|
200
164
|
addButtonProps: _addButtonProps,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const Booking: (props: any) =>
|
|
1
|
+
declare const Booking: (props: any) => JSX.Element;
|
|
2
2
|
export default Booking;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { FormState } from "../model";
|
|
3
2
|
export declare const walkInData: {
|
|
4
3
|
id: number;
|
|
5
4
|
nickname: string;
|
|
6
5
|
};
|
|
7
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
6
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
|
|
8
7
|
state: FormState;
|
|
9
8
|
} & {
|
|
10
9
|
dispatch: (params: {
|