@pisell/private-materials 3.0.151 → 3.0.152
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 +12 -12
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +12 -12
- package/es/components/booking/components/footer/index.js +48 -33
- package/es/components/booking/components/footer/utils.js +35 -4
- package/es/components/booking/index.js +1 -1
- package/es/components/booking/info/index.d.ts +4 -12
- package/es/components/booking/info/index.js +12 -122
- package/es/components/booking/info/main.d.ts +12 -0
- package/es/components/booking/info/main.js +124 -0
- package/es/components/booking/info/model.js +0 -1
- package/es/components/booking/info/service/addTimeModal/index.js +4 -4
- package/es/components/booking/info/utils.d.ts +1 -0
- package/es/components/booking/info/utils.js +7 -0
- package/es/components/booking/info2/index.d.ts +12 -0
- package/es/components/booking/info2/index.js +216 -0
- package/es/components/booking/info2/serve.d.ts +6 -0
- package/es/components/booking/info2/serve.js +79 -0
- package/es/components/booking/info2/service/actions/index.d.ts +6 -0
- package/es/components/booking/info2/service/actions/index.js +86 -0
- package/es/components/booking/info2/service/addService/index.d.ts +6 -0
- package/es/components/booking/info2/service/addService/index.js +404 -0
- package/es/components/booking/info2/service/addService/mock.d.ts +214 -0
- package/es/components/booking/info2/service/addService/mock.js +332 -0
- package/es/components/booking/info2/service/addService/utils.d.ts +71 -0
- package/es/components/booking/info2/service/addService/utils.js +510 -0
- package/es/components/booking/info2/service/addTimeModal/index.d.ts +4 -0
- package/es/components/booking/info2/service/addTimeModal/index.js +681 -0
- package/es/components/booking/info2/service/addTimeModal/serve.d.ts +9 -0
- package/es/components/booking/info2/service/addTimeModal/serve.js +73 -0
- package/es/components/booking/info2/service/addTimeModal/utils.d.ts +31 -0
- package/es/components/booking/info2/service/addTimeModal/utils.js +176 -0
- package/es/components/booking/info2/service/editService/Capacity/index.d.ts +4 -0
- package/es/components/booking/info2/service/editService/Capacity/index.js +121 -0
- package/es/components/booking/info2/service/editService/Capacity/index.less +1 -0
- package/es/components/booking/info2/service/editService/Resources/MaxLengthSelect/index.d.ts +7 -0
- package/es/components/booking/info2/service/editService/Resources/MaxLengthSelect/index.js +28 -0
- package/es/components/booking/info2/service/editService/Resources/index.d.ts +4 -0
- package/es/components/booking/info2/service/editService/Resources/index.js +233 -0
- package/es/components/booking/info2/service/editService/Resources/index.less +21 -0
- package/es/components/booking/info2/service/editService/index.d.ts +7 -0
- package/es/components/booking/info2/service/editService/index.js +617 -0
- package/es/components/booking/info2/service/editService/index.less +99 -0
- package/es/components/booking/info2/service/editService/utils.d.ts +11 -0
- package/es/components/booking/info2/service/editService/utils.js +37 -0
- package/es/components/booking/info2/service/index.d.ts +4 -0
- package/es/components/booking/info2/service/index.js +55 -0
- package/es/components/booking/info2/service/serviceItem/index.d.ts +4 -0
- package/es/components/booking/info2/service/serviceItem/index.js +176 -0
- package/es/components/booking/info2/service/serviceItem/index.less +125 -0
- package/es/components/booking/info2/service/serviceList/index.d.ts +6 -0
- package/es/components/booking/info2/service/serviceList/index.js +106 -0
- package/es/components/booking/info2/service/serviceList/index.less +0 -0
- package/es/components/booking/info2/utilsByBooking.d.ts +34 -0
- package/es/components/booking/info2/utilsByBooking.js +349 -0
- package/es/components/booking/locales.d.ts +3 -0
- package/es/components/booking/locales.js +12 -3
- package/es/components/booking/materiels/resources/index.d.ts +2 -2
- package/es/components/booking/materiels/resources/index.js +11 -11
- package/es/components/booking/mock.d.ts +1 -0
- package/es/components/booking/mock.js +66 -0
- package/es/components/booking/notes/index.d.ts +1 -1
- package/es/components/index.d.ts +1 -1
- package/es/components/index.js +1 -1
- package/es/index.d.ts +1 -1
- package/es/index.js +1 -1
- package/lib/components/booking/components/footer/index.js +28 -5
- package/lib/components/booking/components/footer/utils.js +29 -4
- package/lib/components/booking/index.js +2 -2
- package/lib/components/booking/info/index.d.ts +4 -12
- package/lib/components/booking/info/index.js +14 -115
- package/lib/components/booking/info/main.d.ts +12 -0
- package/lib/components/booking/info/main.js +152 -0
- package/lib/components/booking/info/service/addTimeModal/index.js +1 -0
- package/lib/components/booking/info/utils.d.ts +1 -0
- package/lib/components/booking/info/utils.js +9 -0
- package/lib/components/booking/info2/index.d.ts +12 -0
- package/lib/components/booking/info2/index.js +202 -0
- package/lib/components/booking/info2/serve.d.ts +6 -0
- package/lib/components/booking/info2/serve.js +53 -0
- package/lib/components/booking/info2/service/actions/index.d.ts +6 -0
- package/lib/components/booking/info2/service/actions/index.js +102 -0
- package/lib/components/booking/info2/service/addService/index.d.ts +6 -0
- package/lib/components/booking/info2/service/addService/index.js +356 -0
- package/lib/components/booking/info2/service/addService/mock.d.ts +214 -0
- package/lib/components/booking/info2/service/addService/mock.js +398 -0
- package/lib/components/booking/info2/service/addService/utils.d.ts +71 -0
- package/lib/components/booking/info2/service/addService/utils.js +377 -0
- package/lib/components/booking/info2/service/addTimeModal/index.d.ts +4 -0
- package/lib/components/booking/info2/service/addTimeModal/index.js +558 -0
- package/lib/components/booking/info2/service/addTimeModal/serve.d.ts +9 -0
- package/lib/components/booking/info2/service/addTimeModal/serve.js +45 -0
- package/lib/components/booking/info2/service/addTimeModal/utils.d.ts +31 -0
- package/lib/components/booking/info2/service/addTimeModal/utils.js +157 -0
- package/lib/components/booking/info2/service/editService/Capacity/index.d.ts +4 -0
- package/lib/components/booking/info2/service/editService/Capacity/index.js +97 -0
- package/lib/components/booking/info2/service/editService/Capacity/index.less +1 -0
- package/lib/components/booking/info2/service/editService/Resources/MaxLengthSelect/index.d.ts +7 -0
- package/lib/components/booking/info2/service/editService/Resources/MaxLengthSelect/index.js +54 -0
- package/lib/components/booking/info2/service/editService/Resources/index.d.ts +4 -0
- package/lib/components/booking/info2/service/editService/Resources/index.js +212 -0
- package/lib/components/booking/info2/service/editService/Resources/index.less +21 -0
- package/lib/components/booking/info2/service/editService/index.d.ts +7 -0
- package/lib/components/booking/info2/service/editService/index.js +483 -0
- package/lib/components/booking/info2/service/editService/index.less +99 -0
- package/lib/components/booking/info2/service/editService/utils.d.ts +11 -0
- package/lib/components/booking/info2/service/editService/utils.js +0 -0
- package/lib/components/booking/info2/service/index.d.ts +4 -0
- package/lib/components/booking/info2/service/index.js +75 -0
- package/lib/components/booking/info2/service/serviceItem/index.d.ts +4 -0
- package/lib/components/booking/info2/service/serviceItem/index.js +184 -0
- package/lib/components/booking/info2/service/serviceItem/index.less +125 -0
- package/lib/components/booking/info2/service/serviceList/index.d.ts +6 -0
- package/lib/components/booking/info2/service/serviceList/index.js +130 -0
- package/lib/components/booking/info2/service/serviceList/index.less +0 -0
- package/lib/components/booking/info2/utilsByBooking.d.ts +34 -0
- package/lib/components/booking/info2/utilsByBooking.js +257 -0
- package/lib/components/booking/locales.d.ts +3 -0
- package/lib/components/booking/locales.js +6 -3
- package/lib/components/booking/materiels/resources/index.d.ts +2 -2
- package/lib/components/booking/mock.d.ts +1 -0
- package/lib/components/booking/mock.js +67 -2
- package/lib/components/booking/notes/index.d.ts +1 -1
- package/lib/components/eftposPay/tyro/index.js +3 -1
- package/lib/components/index.d.ts +1 -1
- package/lib/components/index.js +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,356 @@
|
|
|
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/info2/service/addService/index.tsx
|
|
30
|
+
var addService_exports = {};
|
|
31
|
+
__export(addService_exports, {
|
|
32
|
+
default: () => addService_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(addService_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_SearchLg = __toESM(require("@pisell/icon/es/SearchLg"));
|
|
37
|
+
var import_drawer = __toESM(require("../../../components/drawer"));
|
|
38
|
+
var import_TabProduct = __toESM(require("../../../components/TabProduct"));
|
|
39
|
+
var import_model = require("../../../info/model");
|
|
40
|
+
var import_addButton = __toESM(require("../../../components/addButton"));
|
|
41
|
+
var import_antd = require("antd");
|
|
42
|
+
var import_addService = require("../../../info/service/addService/index.less");
|
|
43
|
+
var import_useEngineContext = __toESM(require("../../../../../hooks/useEngineContext"));
|
|
44
|
+
var import_serve = require("../../../info/service/serve");
|
|
45
|
+
var import_utils = require("../../../info/utils");
|
|
46
|
+
var import_utils2 = require("./utils");
|
|
47
|
+
var import_utils3 = require("../../../utils");
|
|
48
|
+
var import_utils4 = require("@pisell/utils");
|
|
49
|
+
var import_ahooks = require("ahooks");
|
|
50
|
+
var shopList = [
|
|
51
|
+
2886,
|
|
52
|
+
4422,
|
|
53
|
+
5538,
|
|
54
|
+
6930,
|
|
55
|
+
6814,
|
|
56
|
+
6813,
|
|
57
|
+
6812,
|
|
58
|
+
6087,
|
|
59
|
+
6303,
|
|
60
|
+
6080,
|
|
61
|
+
6978,
|
|
62
|
+
7386,
|
|
63
|
+
6848,
|
|
64
|
+
6305
|
|
65
|
+
];
|
|
66
|
+
var Info = ({ onEdit }) => {
|
|
67
|
+
var _a, _b, _c, _d;
|
|
68
|
+
const [search, setSearch] = (0, import_react.useState)("");
|
|
69
|
+
const { state, dispatch } = (0, import_react.useContext)(import_model.Context);
|
|
70
|
+
const [loading, setLoading] = (0, import_react.useState)(false);
|
|
71
|
+
const searchRef = (0, import_react.useRef)();
|
|
72
|
+
const context = (0, import_useEngineContext.default)();
|
|
73
|
+
import_utils3.request.setRequest(context.appHelper.utils.request);
|
|
74
|
+
const setDefaultService = async (list) => {
|
|
75
|
+
if (state.renderType !== "eventBooking") {
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
if (state.bookingId) {
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
if (list.length !== 1) {
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
let _list = [...state.service.value];
|
|
85
|
+
if (_list.length !== 0) {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
setLoading(true);
|
|
89
|
+
let product = list[0];
|
|
90
|
+
const detail = await (0, import_serve.getProductDetail)(product.id, {
|
|
91
|
+
schedule_date: state.date.value.format("YYYY-MM-DD")
|
|
92
|
+
});
|
|
93
|
+
const isBundleOrCombination = (0, import_utils.getIsBundleOrCombination)(detail.data);
|
|
94
|
+
setLoading(false);
|
|
95
|
+
if (isBundleOrCombination)
|
|
96
|
+
return;
|
|
97
|
+
let _item = {
|
|
98
|
+
...product,
|
|
99
|
+
product_id: product.id,
|
|
100
|
+
_id: (0, import_utils4.getUniqueId)(),
|
|
101
|
+
_extend: {
|
|
102
|
+
start_date: state.date.value,
|
|
103
|
+
startDate: state.date.value,
|
|
104
|
+
endDate: state.date.value,
|
|
105
|
+
start_time: "00:00:00",
|
|
106
|
+
duration: 10,
|
|
107
|
+
quantity: 1,
|
|
108
|
+
price: product.price,
|
|
109
|
+
total: product.price,
|
|
110
|
+
origin_total: product.price,
|
|
111
|
+
product_name: product.title
|
|
112
|
+
}
|
|
113
|
+
};
|
|
114
|
+
_list.push(_item);
|
|
115
|
+
dispatch({
|
|
116
|
+
type: "setService",
|
|
117
|
+
payload: {
|
|
118
|
+
value: _list,
|
|
119
|
+
edit: true
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
const getServices = async () => {
|
|
124
|
+
var _a2;
|
|
125
|
+
setLoading(true);
|
|
126
|
+
let data = await state.apis.getServices({
|
|
127
|
+
skip: 1,
|
|
128
|
+
num: 500,
|
|
129
|
+
extension_type: state.renderType === "eventBooking" ? void 0 : ["product_appointment", "appointment_ticket", "service_product"],
|
|
130
|
+
with: ["category"],
|
|
131
|
+
ids: state.renderType === "eventBooking" ? (_a2 = state.eventOtherParams) == null ? void 0 : _a2.productIds : void 0,
|
|
132
|
+
open_quotation: 1,
|
|
133
|
+
with_schedule: 1,
|
|
134
|
+
with_count: ["bundleGroup", "optionGroup"],
|
|
135
|
+
order_by_string: "sort:desc",
|
|
136
|
+
status: "published",
|
|
137
|
+
_config: {
|
|
138
|
+
useCache: true
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
setLoading(false);
|
|
142
|
+
if (!state.service.addModal) {
|
|
143
|
+
setDefaultService(data == null ? void 0 : data.list);
|
|
144
|
+
}
|
|
145
|
+
dispatch({
|
|
146
|
+
type: "setService",
|
|
147
|
+
payload: {
|
|
148
|
+
services: (data == null ? void 0 : data.list) || []
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
};
|
|
152
|
+
const handleSelectService = () => {
|
|
153
|
+
dispatch({
|
|
154
|
+
type: "setService",
|
|
155
|
+
payload: {
|
|
156
|
+
addModal: true
|
|
157
|
+
}
|
|
158
|
+
});
|
|
159
|
+
if (!state.isTerminal) {
|
|
160
|
+
setTimeout(() => {
|
|
161
|
+
var _a2, _b2;
|
|
162
|
+
(_b2 = (_a2 = searchRef.current) == null ? void 0 : _a2.focus) == null ? void 0 : _b2.call(_a2);
|
|
163
|
+
}, 100);
|
|
164
|
+
}
|
|
165
|
+
};
|
|
166
|
+
const handleSelectProduct = (item, type) => {
|
|
167
|
+
const isEject = type === "detail" || item.bundle_group_count > 0;
|
|
168
|
+
let lock = false;
|
|
169
|
+
state.action({
|
|
170
|
+
type: "pisell1.handleOpenProductModal",
|
|
171
|
+
data: {
|
|
172
|
+
id: item.id,
|
|
173
|
+
date: state.date.value.format("YYYY-MM-DD"),
|
|
174
|
+
showConfig: {
|
|
175
|
+
option: false,
|
|
176
|
+
session: false,
|
|
177
|
+
variant: false,
|
|
178
|
+
package: true
|
|
179
|
+
},
|
|
180
|
+
is_eject: isEject ? 1 : 0
|
|
181
|
+
},
|
|
182
|
+
callback: (e) => {
|
|
183
|
+
var _a2;
|
|
184
|
+
if (lock) {
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
lock = true;
|
|
188
|
+
setTimeout(() => {
|
|
189
|
+
lock = false;
|
|
190
|
+
}, 2e3);
|
|
191
|
+
let cacheItem = {
|
|
192
|
+
...item,
|
|
193
|
+
product_id: item.id,
|
|
194
|
+
_id: (0, import_utils4.getUniqueId)(),
|
|
195
|
+
_key: e.key,
|
|
196
|
+
_extend: {
|
|
197
|
+
start_date: state.date.value,
|
|
198
|
+
quantity: 1,
|
|
199
|
+
price: item.price,
|
|
200
|
+
product_name: item.title,
|
|
201
|
+
other: JSON.parse(JSON.stringify(e))
|
|
202
|
+
},
|
|
203
|
+
new: 1
|
|
204
|
+
};
|
|
205
|
+
let _total = (0, import_utils3.getProductTotalPrice)(cacheItem);
|
|
206
|
+
cacheItem._extend.total = _total;
|
|
207
|
+
cacheItem._extend.origin_total = _total;
|
|
208
|
+
const _isEdit = !!state.service.cacheItem;
|
|
209
|
+
if (_isEdit) {
|
|
210
|
+
cacheItem._id = (_a2 = state.service.cacheItem) == null ? void 0 : _a2._id;
|
|
211
|
+
cacheItem.new = 0;
|
|
212
|
+
}
|
|
213
|
+
cacheItem = (0, import_utils2.getProductExtend)({ cacheItem, state });
|
|
214
|
+
if (state.renderType === "eventBooking") {
|
|
215
|
+
cacheItem.autoClose = false;
|
|
216
|
+
}
|
|
217
|
+
if (cacheItem.autoClose) {
|
|
218
|
+
cacheItem.autoClose = false;
|
|
219
|
+
let _list = [...state.service.value, cacheItem];
|
|
220
|
+
dispatch({
|
|
221
|
+
type: "setService",
|
|
222
|
+
payload: {
|
|
223
|
+
addModal: false,
|
|
224
|
+
value: _list,
|
|
225
|
+
edit: true,
|
|
226
|
+
changeService: false
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
} else {
|
|
230
|
+
dispatch({
|
|
231
|
+
type: "setService",
|
|
232
|
+
payload: {
|
|
233
|
+
editModal: true,
|
|
234
|
+
cacheItem,
|
|
235
|
+
addModal: !cacheItem.autoClose,
|
|
236
|
+
changeService: false
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
onEdit == null ? void 0 : onEdit(cacheItem);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
};
|
|
244
|
+
const renderList = (0, import_react.useMemo)(() => {
|
|
245
|
+
var _a2;
|
|
246
|
+
let _list = ((_a2 = state.service) == null ? void 0 : _a2.services) || [];
|
|
247
|
+
const isIncludes = (str) => {
|
|
248
|
+
return str.toLowerCase().indexOf(search.toLowerCase()) !== -1;
|
|
249
|
+
};
|
|
250
|
+
return (0, import_utils3.formatProductListByCategory)(
|
|
251
|
+
_list,
|
|
252
|
+
search ? (item) => isIncludes(item.title) : void 0
|
|
253
|
+
);
|
|
254
|
+
}, [search, (_a = state.service) == null ? void 0 : _a.services]);
|
|
255
|
+
console.log("state.service.renderList", renderList);
|
|
256
|
+
const isService = (0, import_react.useMemo)(() => {
|
|
257
|
+
return state.service.value.length > 0;
|
|
258
|
+
}, [state.service.value]);
|
|
259
|
+
(0, import_react.useEffect)(() => {
|
|
260
|
+
var _a2, _b2, _c2, _d2, _e, _f, _g;
|
|
261
|
+
if (shopList.includes(
|
|
262
|
+
(_e = (_d2 = (_c2 = (_b2 = (_a2 = context.appHelper.utils.store) == null ? void 0 : _a2.getState) == null ? void 0 : _b2.call(_a2)) == null ? void 0 : _c2.global) == null ? void 0 : _d2.globalConfig) == null ? void 0 : _e.id
|
|
263
|
+
) || state.closeAutoOpenService) {
|
|
264
|
+
return;
|
|
265
|
+
}
|
|
266
|
+
if (state.modalOpen && !state.bookingId && state.renderType !== "eventBooking" && ((_g = (_f = state.service) == null ? void 0 : _f.value) == null ? void 0 : _g.length) === 0) {
|
|
267
|
+
setTimeout(() => {
|
|
268
|
+
handleSelectService();
|
|
269
|
+
}, 10);
|
|
270
|
+
}
|
|
271
|
+
}, [state.modalOpen, state.bookingId, (_b = state.service) == null ? void 0 : _b.value]);
|
|
272
|
+
const showAddButton = (0, import_react.useMemo)(() => {
|
|
273
|
+
return !state.disabledEdit && !state.channelDisabledEdit;
|
|
274
|
+
}, [state.disabledEdit, state.channelDisabledEdit]);
|
|
275
|
+
(0, import_ahooks.useUpdateEffect)(() => {
|
|
276
|
+
if (state.service.addModal) {
|
|
277
|
+
getServices();
|
|
278
|
+
setSearch("");
|
|
279
|
+
}
|
|
280
|
+
}, [state.service.addModal]);
|
|
281
|
+
(0, import_react.useEffect)(() => {
|
|
282
|
+
if (state.renderType === "eventBooking" && state.modalOpen) {
|
|
283
|
+
getServices();
|
|
284
|
+
}
|
|
285
|
+
}, [state.renderType, state.modalOpen]);
|
|
286
|
+
const addButton = (0, import_react.useMemo)(() => {
|
|
287
|
+
if (state.renderType === "eventBooking") {
|
|
288
|
+
return isService ? /* @__PURE__ */ import_react.default.createElement("div", { style: { height: 20 } }) : /* @__PURE__ */ import_react.default.createElement(
|
|
289
|
+
import_addButton.default,
|
|
290
|
+
{
|
|
291
|
+
loading,
|
|
292
|
+
showSub: false,
|
|
293
|
+
title: import_utils4.locales.getText("pisell2.text.add-a-service"),
|
|
294
|
+
subTitle: import_utils4.locales.getText("pisell2.text.add-another-service"),
|
|
295
|
+
onClick: handleSelectService
|
|
296
|
+
}
|
|
297
|
+
);
|
|
298
|
+
}
|
|
299
|
+
return showAddButton ? /* @__PURE__ */ import_react.default.createElement(
|
|
300
|
+
import_addButton.default,
|
|
301
|
+
{
|
|
302
|
+
showSub: isService,
|
|
303
|
+
title: import_utils4.locales.getText("pisell2.text.add-a-service"),
|
|
304
|
+
subTitle: import_utils4.locales.getText("pisell2.text.add-another-service"),
|
|
305
|
+
onClick: handleSelectService
|
|
306
|
+
}
|
|
307
|
+
) : /* @__PURE__ */ import_react.default.createElement("div", { style: { height: 20 } });
|
|
308
|
+
}, [
|
|
309
|
+
state.renderType,
|
|
310
|
+
showAddButton,
|
|
311
|
+
isService,
|
|
312
|
+
state.service.value,
|
|
313
|
+
loading
|
|
314
|
+
]);
|
|
315
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, ((_d = (_c = state.service) == null ? void 0 : _c.cacheItem) == null ? void 0 : _d.autoClose) && /* @__PURE__ */ import_react.default.createElement(import_antd.Skeleton, { loading: true, active: true, round: true }), addButton, /* @__PURE__ */ import_react.default.createElement(
|
|
316
|
+
import_drawer.default,
|
|
317
|
+
{
|
|
318
|
+
open: state.service.addModal,
|
|
319
|
+
title: import_utils4.locales.getText("pisell2.text.select-service"),
|
|
320
|
+
rootClassName: "booking-server-wrap",
|
|
321
|
+
onClose: () => {
|
|
322
|
+
dispatch({
|
|
323
|
+
type: "setService",
|
|
324
|
+
payload: {
|
|
325
|
+
addModal: false,
|
|
326
|
+
changeService: false
|
|
327
|
+
}
|
|
328
|
+
});
|
|
329
|
+
},
|
|
330
|
+
header: /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-header" }, /* @__PURE__ */ import_react.default.createElement(
|
|
331
|
+
import_antd.Input,
|
|
332
|
+
{
|
|
333
|
+
ref: searchRef,
|
|
334
|
+
prefix: /* @__PURE__ */ import_react.default.createElement(import_SearchLg.default, null),
|
|
335
|
+
style: { marginTop: 16, height: 44 },
|
|
336
|
+
placeholder: import_utils4.locales.getText("pisell2.text.search"),
|
|
337
|
+
allowClear: true,
|
|
338
|
+
value: search,
|
|
339
|
+
onChange: (e) => {
|
|
340
|
+
setSearch(e.target.value);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
))
|
|
344
|
+
},
|
|
345
|
+
/* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-body" }, /* @__PURE__ */ import_react.default.createElement(
|
|
346
|
+
import_TabProduct.default,
|
|
347
|
+
{
|
|
348
|
+
list: renderList,
|
|
349
|
+
amountSymbol: state.amountSymbol,
|
|
350
|
+
onChange: handleSelectProduct,
|
|
351
|
+
scrollDom: ".booking-server-wrap .pisell-lowcode-drawer-body"
|
|
352
|
+
}
|
|
353
|
+
))
|
|
354
|
+
));
|
|
355
|
+
};
|
|
356
|
+
var addService_default = Info;
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
id: number;
|
|
3
|
+
shop_id: number;
|
|
4
|
+
source_shop_id: number;
|
|
5
|
+
extension_id: number;
|
|
6
|
+
extension_type: string;
|
|
7
|
+
title: string;
|
|
8
|
+
slug: string;
|
|
9
|
+
title_letter: string;
|
|
10
|
+
category_letter: string;
|
|
11
|
+
vendor_letter: string;
|
|
12
|
+
tag_letter: string;
|
|
13
|
+
subtitle: string;
|
|
14
|
+
description: string;
|
|
15
|
+
cover: string;
|
|
16
|
+
price: string;
|
|
17
|
+
original_price: string;
|
|
18
|
+
cost_price: string;
|
|
19
|
+
sort_price: string;
|
|
20
|
+
is_gst: number;
|
|
21
|
+
is_delivery: number;
|
|
22
|
+
weight_unit: string;
|
|
23
|
+
weight_value: string;
|
|
24
|
+
code: string;
|
|
25
|
+
barcode: string;
|
|
26
|
+
unit: string;
|
|
27
|
+
is_track: number;
|
|
28
|
+
stock_quantity: number;
|
|
29
|
+
sum_stock: number;
|
|
30
|
+
sales_quantity: number;
|
|
31
|
+
order_sales_quantity: number;
|
|
32
|
+
over_sold: number;
|
|
33
|
+
status: string;
|
|
34
|
+
sell_status: number;
|
|
35
|
+
published_time: string;
|
|
36
|
+
shop_update_time: string;
|
|
37
|
+
audit_time: null;
|
|
38
|
+
is_recommend: number;
|
|
39
|
+
audit_status: string;
|
|
40
|
+
shop_status: string;
|
|
41
|
+
weight: number;
|
|
42
|
+
sort: number;
|
|
43
|
+
type: string;
|
|
44
|
+
channel_application: string[];
|
|
45
|
+
channel_id: number;
|
|
46
|
+
rebate_type: string;
|
|
47
|
+
rebate_value: string;
|
|
48
|
+
create_account_id: number;
|
|
49
|
+
update_account_id: number;
|
|
50
|
+
source_product_id: number;
|
|
51
|
+
start_at: null;
|
|
52
|
+
created_at: string;
|
|
53
|
+
updated_at: string;
|
|
54
|
+
deleted_at: null;
|
|
55
|
+
seo: {
|
|
56
|
+
title: string;
|
|
57
|
+
is_set_title: number;
|
|
58
|
+
description: string;
|
|
59
|
+
is_set_desc: number;
|
|
60
|
+
keywords: string;
|
|
61
|
+
is_set_keywords: number;
|
|
62
|
+
};
|
|
63
|
+
service_times: number;
|
|
64
|
+
product_resource: {
|
|
65
|
+
resources: ({
|
|
66
|
+
id: number;
|
|
67
|
+
title: string;
|
|
68
|
+
status: number;
|
|
69
|
+
code: string;
|
|
70
|
+
created_at: string;
|
|
71
|
+
updated_at: string;
|
|
72
|
+
type: string;
|
|
73
|
+
optional_resource: number[];
|
|
74
|
+
default_resource: number[];
|
|
75
|
+
select_type: {
|
|
76
|
+
type: string;
|
|
77
|
+
min: number;
|
|
78
|
+
max: number;
|
|
79
|
+
};
|
|
80
|
+
resource_type_id: number;
|
|
81
|
+
} | {
|
|
82
|
+
id: number;
|
|
83
|
+
title: string;
|
|
84
|
+
status: number;
|
|
85
|
+
code: string;
|
|
86
|
+
created_at: string;
|
|
87
|
+
updated_at: null;
|
|
88
|
+
type: string;
|
|
89
|
+
optional_resource: never[];
|
|
90
|
+
default_resource: never[];
|
|
91
|
+
select_type: {
|
|
92
|
+
type: string;
|
|
93
|
+
min: number;
|
|
94
|
+
max: number;
|
|
95
|
+
};
|
|
96
|
+
resource_type_id: number;
|
|
97
|
+
})[];
|
|
98
|
+
};
|
|
99
|
+
capacity: {
|
|
100
|
+
type: string;
|
|
101
|
+
custom: {
|
|
102
|
+
name: {
|
|
103
|
+
en: string;
|
|
104
|
+
"zh-CN": string;
|
|
105
|
+
"zh-HK": string;
|
|
106
|
+
original: string;
|
|
107
|
+
};
|
|
108
|
+
id: number;
|
|
109
|
+
min: number;
|
|
110
|
+
max: number;
|
|
111
|
+
}[];
|
|
112
|
+
package: {
|
|
113
|
+
product_ids: never[];
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
is_grey: number;
|
|
117
|
+
is_eject: number;
|
|
118
|
+
share_url: string;
|
|
119
|
+
token_check_msg: string;
|
|
120
|
+
is_charge_tax: number;
|
|
121
|
+
media: never[];
|
|
122
|
+
tag: never[];
|
|
123
|
+
vendor: never[];
|
|
124
|
+
category: {
|
|
125
|
+
id: number;
|
|
126
|
+
shop_id: number;
|
|
127
|
+
parent_id: number;
|
|
128
|
+
name: string;
|
|
129
|
+
slug: string;
|
|
130
|
+
icon: string;
|
|
131
|
+
status: string;
|
|
132
|
+
last_applicable_time: number;
|
|
133
|
+
sort: number;
|
|
134
|
+
create_account_id: number;
|
|
135
|
+
update_account_id: number;
|
|
136
|
+
created_at: string;
|
|
137
|
+
updated_at: string;
|
|
138
|
+
}[];
|
|
139
|
+
collection: ({
|
|
140
|
+
id: number;
|
|
141
|
+
shop_id: number;
|
|
142
|
+
title: string;
|
|
143
|
+
title_letter: string;
|
|
144
|
+
description: null;
|
|
145
|
+
cover: string;
|
|
146
|
+
rule_type: string;
|
|
147
|
+
rule: {
|
|
148
|
+
class: string;
|
|
149
|
+
value: number;
|
|
150
|
+
operator: string;
|
|
151
|
+
}[];
|
|
152
|
+
product_quantity: number;
|
|
153
|
+
type: string;
|
|
154
|
+
order_type: string;
|
|
155
|
+
disabled: number;
|
|
156
|
+
create_account_id: number;
|
|
157
|
+
update_account_id: number;
|
|
158
|
+
created_at: string;
|
|
159
|
+
updated_at: string;
|
|
160
|
+
} | {
|
|
161
|
+
id: number;
|
|
162
|
+
shop_id: number;
|
|
163
|
+
title: string;
|
|
164
|
+
title_letter: string;
|
|
165
|
+
description: string;
|
|
166
|
+
cover: string;
|
|
167
|
+
rule_type: string;
|
|
168
|
+
rule: {
|
|
169
|
+
class: string;
|
|
170
|
+
value: string;
|
|
171
|
+
operator: string;
|
|
172
|
+
}[];
|
|
173
|
+
product_quantity: number;
|
|
174
|
+
type: string;
|
|
175
|
+
order_type: string;
|
|
176
|
+
disabled: number;
|
|
177
|
+
create_account_id: number;
|
|
178
|
+
update_account_id: number;
|
|
179
|
+
created_at: string;
|
|
180
|
+
updated_at: string;
|
|
181
|
+
} | {
|
|
182
|
+
id: number;
|
|
183
|
+
shop_id: number;
|
|
184
|
+
title: string;
|
|
185
|
+
title_letter: string;
|
|
186
|
+
description: null;
|
|
187
|
+
cover: string;
|
|
188
|
+
rule_type: string;
|
|
189
|
+
rule: {
|
|
190
|
+
class: string;
|
|
191
|
+
value: string;
|
|
192
|
+
operator: string;
|
|
193
|
+
}[];
|
|
194
|
+
product_quantity: number;
|
|
195
|
+
type: string;
|
|
196
|
+
order_type: string;
|
|
197
|
+
disabled: number;
|
|
198
|
+
create_account_id: number;
|
|
199
|
+
update_account_id: number;
|
|
200
|
+
created_at: string;
|
|
201
|
+
updated_at: string;
|
|
202
|
+
})[];
|
|
203
|
+
variant_group: never[];
|
|
204
|
+
option_group: never[];
|
|
205
|
+
variant: never[];
|
|
206
|
+
shop: {
|
|
207
|
+
id: number;
|
|
208
|
+
name: string;
|
|
209
|
+
default_domain: string;
|
|
210
|
+
default_url: string;
|
|
211
|
+
};
|
|
212
|
+
bundle_group: never[];
|
|
213
|
+
};
|
|
214
|
+
export default _default;
|