@pisell/private-materials 3.3.45 → 3.3.47
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/meta.js +1 -1
- package/build/lowcode/render/default/view.js +3 -3
- package/build/lowcode/view.js +3 -3
- package/es/businessModel/SalesModel/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Cart/Item/index.js +3 -0
- package/es/components/appointmentBooking/components/Content/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Content/index.js +7 -1
- package/es/components/appointmentBooking/components/Header/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Header/index.js +2 -2
- package/es/components/appointmentBooking/components/Resource/index.js +30 -12
- package/es/components/appointmentBooking/components/Services/index.js +5 -2
- package/es/components/appointmentBooking/components/TimeSlicing/index.js +7 -4
- package/es/components/appointmentBooking/components/Voucher/index.js +1 -0
- package/es/components/appointmentBooking/context.js +7 -3
- package/es/components/appointmentBooking/hooks.js +129 -68
- package/es/components/appointmentBooking/index.d.ts +1 -0
- package/es/components/appointmentBooking/utils.js +6 -1
- package/es/components/booking/addons/index.js +31 -26
- package/es/components/booking/components/footer/amount.js +2 -2
- package/es/components/booking/components/footer/index.d.ts +1 -0
- package/es/components/booking/components/footer/utils.d.ts +9 -0
- package/es/components/booking/components/footer/utils.js +32 -10
- package/es/components/booking/info/service/Lists.d.ts +1 -0
- package/es/components/booking/info/service/addService/index.d.ts +1 -0
- package/es/components/booking/info/service/addService/index.js +2 -2
- package/es/components/booking/info/service/serviceList/index.d.ts +1 -0
- package/es/components/booking/info/service2/Lists.d.ts +1 -0
- package/es/components/booking/info/service2/utils.d.ts +4 -1
- package/es/components/booking/info/service2/utils.js +21 -2
- package/es/components/booking/info/utils.js +1 -1
- package/es/components/booking/info2/service/addService/index.js +9 -6
- package/es/components/booking/info2/service/addTimeModal/index.d.ts +1 -0
- package/es/components/booking/info2/service/editService/index.js +56 -18
- package/es/components/booking/info2/service/serviceList/index.d.ts +1 -0
- package/es/components/booking/utils.d.ts +3 -2
- package/es/components/booking/utils.js +5 -0
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/store/index.d.ts +2 -2
- package/es/components/eventBooking/components/Provider/Content/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Header/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/SelectHolderModal.d.ts +1 -0
- package/es/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +1 -0
- package/es/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +1 -0
- package/es/components/eventBooking/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/index.d.ts +1 -0
- package/es/components/productExtension/fields/Actor/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
- package/es/components/productExtension/index.d.ts +1 -0
- package/es/components/ruleSetting/index.d.ts +1 -0
- package/es/components/shoppingCart/components/Empty/index.d.ts +1 -0
- package/es/components/shoppingCart/components/Render/index.d.ts +1 -0
- package/es/components/shoppingCart/index.d.ts +1 -0
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +75 -26
- package/es/components/ticketBooking/components/notAvailable/index.d.ts +3 -0
- package/es/components/ticketBooking/components/notAvailable/index.js +39 -0
- package/es/components/ticketBooking/components/ticketBooking/index.d.ts +1 -0
- package/es/components/ticketBooking/index.d.ts +1 -0
- package/es/components/ticketBooking/index.js +1 -1
- package/es/components/ticketBooking/locales.d.ts +6 -0
- package/es/components/ticketBooking/locales.js +9 -3
- package/es/components/ticketBooking/serve.js +98 -92
- package/es/components/ticketBooking/utils/index.d.ts +1 -0
- package/es/components/ticketBooking/utils/index.js +33 -0
- package/es/components/wallet/hooks/useWalletCard.d.ts +1 -0
- package/lib/businessModel/SalesModel/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Cart/Item/index.js +3 -0
- package/lib/components/appointmentBooking/components/Content/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Content/index.js +3 -1
- package/lib/components/appointmentBooking/components/Header/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Header/index.js +1 -1
- package/lib/components/appointmentBooking/components/Resource/index.js +15 -9
- package/lib/components/appointmentBooking/components/Services/index.js +3 -2
- package/lib/components/appointmentBooking/components/TimeSlicing/index.js +4 -3
- package/lib/components/appointmentBooking/components/Voucher/index.js +1 -0
- package/lib/components/appointmentBooking/context.js +7 -3
- package/lib/components/appointmentBooking/hooks.js +73 -12
- package/lib/components/appointmentBooking/index.d.ts +1 -0
- package/lib/components/appointmentBooking/utils.js +2 -0
- package/lib/components/booking/addons/index.js +27 -21
- package/lib/components/booking/components/footer/amount.js +1 -1
- package/lib/components/booking/components/footer/index.d.ts +1 -0
- package/lib/components/booking/components/footer/utils.d.ts +9 -0
- package/lib/components/booking/components/footer/utils.js +24 -7
- package/lib/components/booking/info/service/Lists.d.ts +1 -0
- package/lib/components/booking/info/service/addService/index.d.ts +1 -0
- package/lib/components/booking/info/service/addService/index.js +1 -1
- package/lib/components/booking/info/service/serviceList/index.d.ts +1 -0
- package/lib/components/booking/info/service2/Lists.d.ts +1 -0
- package/lib/components/booking/info/service2/utils.d.ts +4 -1
- package/lib/components/booking/info/service2/utils.js +21 -2
- package/lib/components/booking/info/utils.js +1 -1
- package/lib/components/booking/info2/service/addService/index.js +8 -5
- package/lib/components/booking/info2/service/addTimeModal/index.d.ts +1 -0
- package/lib/components/booking/info2/service/editService/index.js +59 -23
- package/lib/components/booking/info2/service/serviceList/index.d.ts +1 -0
- package/lib/components/booking/utils.d.ts +3 -2
- package/lib/components/booking/utils.js +6 -0
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/store/index.d.ts +2 -2
- package/lib/components/eventBooking/components/Provider/Content/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Header/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/SelectHolderModal.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +1 -0
- package/lib/components/eventBooking/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/index.d.ts +1 -0
- package/lib/components/productExtension/fields/Actor/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
- package/lib/components/productExtension/index.d.ts +1 -0
- package/lib/components/ruleSetting/index.d.ts +1 -0
- package/lib/components/shoppingCart/components/Empty/index.d.ts +1 -0
- package/lib/components/shoppingCart/components/Render/index.d.ts +1 -0
- package/lib/components/shoppingCart/index.d.ts +1 -0
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +74 -20
- package/lib/components/ticketBooking/components/notAvailable/index.d.ts +3 -0
- package/lib/components/ticketBooking/components/notAvailable/index.js +61 -0
- package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +1 -0
- package/lib/components/ticketBooking/index.d.ts +1 -0
- package/lib/components/ticketBooking/index.js +1 -1
- package/lib/components/ticketBooking/locales.d.ts +6 -0
- package/lib/components/ticketBooking/locales.js +9 -3
- package/lib/components/ticketBooking/serve.js +6 -2
- package/lib/components/ticketBooking/utils/index.d.ts +1 -0
- package/lib/components/ticketBooking/utils/index.js +33 -0
- package/lib/components/wallet/hooks/useWalletCard.d.ts +1 -0
- package/package.json +4 -4
|
@@ -18,21 +18,23 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
|
18
18
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
19
19
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
20
20
|
import { getUniqueId, locales } from '@pisell/utils';
|
|
21
|
-
import React, { useEffect, useMemo, useState } from 'react';
|
|
21
|
+
import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
22
22
|
import { useMemoizedFn } from 'ahooks';
|
|
23
23
|
import { PisellToast } from '@pisell/materials';
|
|
24
24
|
import useEngineContext from "../../../../hooks/useEngineContext";
|
|
25
|
-
import { isSessionProduct, request, getProductTotalPrice } from "../../../booking/utils";
|
|
25
|
+
import { isSessionProduct, request, getProductTotalPrice, getIsEject } from "../../../booking/utils";
|
|
26
26
|
import { getProductExtend } from "../../../booking/info2/service/addService/utils";
|
|
27
27
|
import { appointmentTypes } from "../../../booking/info/service2/status";
|
|
28
|
-
import { holderId, isDaysBooking } from "../../../booking/info/service2/utils";
|
|
28
|
+
import { holderId, isDaysBooking, isNormalProductByDurationSchedule } from "../../../booking/info/service2/utils";
|
|
29
29
|
import { getIsBundleOrCombination, isBooking4Shop } from "../../../booking/info/utils";
|
|
30
30
|
import { getProductDetail } from "../../../booking/info/service/serve";
|
|
31
31
|
import { useService } from "../../../booking/info/service/serviceManager";
|
|
32
32
|
import ProductSelect from "../../../productSelect";
|
|
33
33
|
import "./index.less";
|
|
34
|
+
import { addService } from "../../utils";
|
|
35
|
+
import NotAvailable from "../notAvailable";
|
|
34
36
|
var AddSerivce = function AddSerivce(props) {
|
|
35
|
-
var _context$appHelper$ut, _context$appHelper$ut2, _state$client2, _state$
|
|
37
|
+
var _context$appHelper$ut, _context$appHelper$ut2, _state$bookingConfig2, _state$client2, _state$service5, _state$service6;
|
|
36
38
|
var onEdit = props.onEdit,
|
|
37
39
|
state = props.state,
|
|
38
40
|
dispatch = props.dispatch,
|
|
@@ -43,6 +45,8 @@ var AddSerivce = function AddSerivce(props) {
|
|
|
43
45
|
loading = _useState2[0],
|
|
44
46
|
setLoading = _useState2[1];
|
|
45
47
|
var context = useEngineContext();
|
|
48
|
+
var notAvailableRef = useRef(null);
|
|
49
|
+
var isLoadedServiceRef = useRef(false);
|
|
46
50
|
request.setRequest(context.appHelper.utils.request);
|
|
47
51
|
var _useService = useService({
|
|
48
52
|
renderMode: renderMode,
|
|
@@ -57,6 +61,10 @@ var AddSerivce = function AddSerivce(props) {
|
|
|
57
61
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
58
62
|
currentProduct = _useState4[0],
|
|
59
63
|
setCurrentProduct = _useState4[1];
|
|
64
|
+
var menuList = useMemo(function () {
|
|
65
|
+
var _state$bookingConfig;
|
|
66
|
+
return (state === null || state === void 0 || (_state$bookingConfig = state.bookingConfig) === null || _state$bookingConfig === void 0 || (_state$bookingConfig = _state$bookingConfig.config) === null || _state$bookingConfig === void 0 || (_state$bookingConfig = _state$bookingConfig.menu_list_tab) === null || _state$bookingConfig === void 0 ? void 0 : _state$bookingConfig.menu_list) || [];
|
|
67
|
+
}, [state === null || state === void 0 || (_state$bookingConfig2 = state.bookingConfig) === null || _state$bookingConfig2 === void 0 ? void 0 : _state$bookingConfig2.config]);
|
|
60
68
|
var customerId = useMemo(function () {
|
|
61
69
|
var _state$client;
|
|
62
70
|
return ((_state$client = state.client) === null || _state$client === void 0 || (_state$client = _state$client.value) === null || _state$client === void 0 ? void 0 : _state$client.id) || undefined;
|
|
@@ -154,10 +162,28 @@ var AddSerivce = function AddSerivce(props) {
|
|
|
154
162
|
return _ref.apply(this, arguments);
|
|
155
163
|
};
|
|
156
164
|
}();
|
|
165
|
+
var removeNotAvailableService = function removeNotAvailableService(list) {
|
|
166
|
+
var _state$service, _state$service2;
|
|
167
|
+
if (!((_state$service = state.service) !== null && _state$service !== void 0 && (_state$service = _state$service.value) !== null && _state$service !== void 0 && _state$service.length)) return;
|
|
168
|
+
var listMap = list.reduce(function (acc, cur) {
|
|
169
|
+
acc[cur.id] = cur;
|
|
170
|
+
return acc;
|
|
171
|
+
}, {});
|
|
172
|
+
var newValue = (((_state$service2 = state.service) === null || _state$service2 === void 0 ? void 0 : _state$service2.value) || []).filter(function (item) {
|
|
173
|
+
return listMap[item.product_id];
|
|
174
|
+
});
|
|
175
|
+
dispatch({
|
|
176
|
+
type: 'setService',
|
|
177
|
+
payload: {
|
|
178
|
+
value: newValue,
|
|
179
|
+
edit: true
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
};
|
|
157
183
|
var getServices = /*#__PURE__*/function () {
|
|
158
184
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(params) {
|
|
159
|
-
var _state$eventOtherPara;
|
|
160
|
-
var data;
|
|
185
|
+
var _state$eventOtherPara, _data$data2, _data$data3;
|
|
186
|
+
var data, _state$service3, _notAvailableRef$curr, _data$data;
|
|
161
187
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
162
188
|
while (1) switch (_context2.prev = _context2.next) {
|
|
163
189
|
case 0:
|
|
@@ -180,7 +206,8 @@ var AddSerivce = function AddSerivce(props) {
|
|
|
180
206
|
return state.apis.getServices({
|
|
181
207
|
skip: 1,
|
|
182
208
|
num: 500,
|
|
183
|
-
extension_type: state.productExtensionType,
|
|
209
|
+
// extension_type: state.productExtensionType,
|
|
210
|
+
exclude_extension_type: ['product_party', 'product_event', 'product_series_event', 'product_package_ticket', 'ticket', 'event_item'],
|
|
184
211
|
with: ['category'],
|
|
185
212
|
open_quotation: 1,
|
|
186
213
|
with_schedule: 1,
|
|
@@ -188,23 +215,37 @@ var AddSerivce = function AddSerivce(props) {
|
|
|
188
215
|
order_by_string: 'sort:desc',
|
|
189
216
|
status: 'published',
|
|
190
217
|
schedule_date: params === null || params === void 0 ? void 0 : params.schedule_date,
|
|
191
|
-
|
|
218
|
+
schedule_datetime: params === null || params === void 0 ? void 0 : params.schedule_datetime,
|
|
219
|
+
customer_id: params === null || params === void 0 ? void 0 : params.customer_id,
|
|
220
|
+
menu_list_ids: params === null || params === void 0 ? void 0 : params.menu_list_ids,
|
|
221
|
+
_config: {
|
|
222
|
+
fullResult: true,
|
|
223
|
+
customResponse: true
|
|
224
|
+
}
|
|
192
225
|
});
|
|
193
226
|
case 7:
|
|
194
227
|
data = _context2.sent;
|
|
195
228
|
setLoading(false);
|
|
229
|
+
if ((data === null || data === void 0 ? void 0 : data.code) === 607100) {
|
|
230
|
+
// 第一次加载时,或者之前有数据
|
|
231
|
+
if (!isLoadedServiceRef.current || (_state$service3 = state.service) !== null && _state$service3 !== void 0 && (_state$service3 = _state$service3.services) !== null && _state$service3 !== void 0 && _state$service3.length) {
|
|
232
|
+
(_notAvailableRef$curr = notAvailableRef.current) === null || _notAvailableRef$curr === void 0 || _notAvailableRef$curr.open();
|
|
233
|
+
}
|
|
234
|
+
}
|
|
196
235
|
|
|
197
236
|
// 只有自动获取列表的时候才设置商品, 手动点击添加按钮的时候不设置
|
|
198
237
|
if (!state.service.addModal) {
|
|
199
|
-
setDefaultService(data === null || data === void 0 ? void 0 : data.list);
|
|
238
|
+
setDefaultService(data === null || data === void 0 || (_data$data = data.data) === null || _data$data === void 0 ? void 0 : _data$data.list);
|
|
200
239
|
}
|
|
240
|
+
removeNotAvailableService(data === null || data === void 0 || (_data$data2 = data.data) === null || _data$data2 === void 0 ? void 0 : _data$data2.list);
|
|
241
|
+
isLoadedServiceRef.current = true;
|
|
201
242
|
dispatch({
|
|
202
243
|
type: 'setService',
|
|
203
244
|
payload: {
|
|
204
|
-
services: (data === null || data === void 0 ? void 0 :
|
|
245
|
+
services: (data === null || data === void 0 || (_data$data3 = data.data) === null || _data$data3 === void 0 ? void 0 : _data$data3.list) || []
|
|
205
246
|
}
|
|
206
247
|
});
|
|
207
|
-
case
|
|
248
|
+
case 14:
|
|
208
249
|
case "end":
|
|
209
250
|
return _context2.stop();
|
|
210
251
|
}
|
|
@@ -218,7 +259,7 @@ var AddSerivce = function AddSerivce(props) {
|
|
|
218
259
|
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'select';
|
|
219
260
|
var isSession = isSessionProduct(item);
|
|
220
261
|
// 是否有单规格 组合规格 套餐, 或者session商品 如果没有不需要打开弹窗
|
|
221
|
-
var isEject =
|
|
262
|
+
var isEject = getIsEject(item, type);
|
|
222
263
|
var lock = false;
|
|
223
264
|
if (isEject) {
|
|
224
265
|
setCurrentProduct(item);
|
|
@@ -231,10 +272,11 @@ var AddSerivce = function AddSerivce(props) {
|
|
|
231
272
|
id: item.id,
|
|
232
273
|
date: state.date.value.format('YYYY-MM-DD'),
|
|
233
274
|
showConfig: {
|
|
234
|
-
option:
|
|
275
|
+
option: true,
|
|
235
276
|
session: isSession,
|
|
236
|
-
variant:
|
|
237
|
-
package: true
|
|
277
|
+
variant: true,
|
|
278
|
+
package: true,
|
|
279
|
+
number: isNormalProductByDurationSchedule(item)
|
|
238
280
|
},
|
|
239
281
|
is_eject: isEject ? 1 : 0,
|
|
240
282
|
customer_id: customerId,
|
|
@@ -291,7 +333,7 @@ var AddSerivce = function AddSerivce(props) {
|
|
|
291
333
|
_key: e.key,
|
|
292
334
|
_extend: {
|
|
293
335
|
start_date: state.date.value,
|
|
294
|
-
quantity: 1,
|
|
336
|
+
quantity: (e === null || e === void 0 ? void 0 : e.quantity) || 1,
|
|
295
337
|
price: _detail.price,
|
|
296
338
|
product_name: item.title,
|
|
297
339
|
other: other
|
|
@@ -321,7 +363,7 @@ var AddSerivce = function AddSerivce(props) {
|
|
|
321
363
|
}
|
|
322
364
|
if (cacheItem.autoClose) {
|
|
323
365
|
cacheItem.autoClose = false;
|
|
324
|
-
_list =
|
|
366
|
+
_list = addService(state.service.value, cacheItem);
|
|
325
367
|
PisellToast({
|
|
326
368
|
content: locales.getText('pisell2.ticket-booking.add-to-cart')
|
|
327
369
|
});
|
|
@@ -360,8 +402,8 @@ var AddSerivce = function AddSerivce(props) {
|
|
|
360
402
|
});
|
|
361
403
|
});
|
|
362
404
|
var renderList = useMemo(function () {
|
|
363
|
-
var _state$
|
|
364
|
-
var _list = ((_state$
|
|
405
|
+
var _state$service4;
|
|
406
|
+
var _list = ((_state$service4 = state.service) === null || _state$service4 === void 0 ? void 0 : _state$service4.services) || [];
|
|
365
407
|
|
|
366
408
|
// 跨日预约
|
|
367
409
|
if (isDaysBooking(state)) {
|
|
@@ -373,21 +415,26 @@ var AddSerivce = function AddSerivce(props) {
|
|
|
373
415
|
}
|
|
374
416
|
}
|
|
375
417
|
return _list;
|
|
376
|
-
}, [(_state$
|
|
418
|
+
}, [(_state$service5 = state.service) === null || _state$service5 === void 0 ? void 0 : _state$service5.services, state === null || state === void 0 ? void 0 : state.activeCartId]);
|
|
377
419
|
var currentDate = useMemo(function () {
|
|
378
420
|
return state.date.value.format('YYYY-MM-DD');
|
|
379
421
|
}, [state.date.value]);
|
|
422
|
+
var currentDatetime = useMemo(function () {
|
|
423
|
+
return state.date.value.format('YYYY-MM-DD HH:mm:ss');
|
|
424
|
+
}, [state.date.value]);
|
|
380
425
|
useEffect(function () {
|
|
381
|
-
if (renderMode === 'current') {
|
|
426
|
+
if (renderMode === 'current' && state.bookingConfig) {
|
|
382
427
|
getServices({
|
|
383
428
|
schedule_date: currentDate,
|
|
384
|
-
customer_id: customerId
|
|
429
|
+
customer_id: customerId,
|
|
430
|
+
menu_list_ids: menuList,
|
|
431
|
+
schedule_datetime: currentDatetime
|
|
385
432
|
});
|
|
386
433
|
}
|
|
387
|
-
}, [renderMode, currentDate, customerId]);
|
|
434
|
+
}, [renderMode, currentDate, customerId, menuList, currentDatetime]);
|
|
388
435
|
return useMemo(function () {
|
|
389
436
|
if (renderMode === 'current') {
|
|
390
|
-
return /*#__PURE__*/React.createElement(ProductSelect, {
|
|
437
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ProductSelect, {
|
|
391
438
|
dataSource: renderList,
|
|
392
439
|
layout: {
|
|
393
440
|
grid: true,
|
|
@@ -404,9 +451,11 @@ var AddSerivce = function AddSerivce(props) {
|
|
|
404
451
|
isOriginPrice: 1,
|
|
405
452
|
isStock: 1
|
|
406
453
|
}
|
|
407
|
-
})
|
|
454
|
+
}), /*#__PURE__*/React.createElement(NotAvailable, {
|
|
455
|
+
ref: notAvailableRef
|
|
456
|
+
}));
|
|
408
457
|
}
|
|
409
458
|
return null;
|
|
410
|
-
}, [(_state$
|
|
459
|
+
}, [(_state$service6 = state.service) === null || _state$service6 === void 0 || (_state$service6 = _state$service6.cacheItem) === null || _state$service6 === void 0 ? void 0 : _state$service6.autoClose, state.service.addModal, locales, renderList, state.amountSymbol, state.renderType, state === null || state === void 0 ? void 0 : state.activeCartId, holderId(state), loading, currentProduct, isBooking4]);
|
|
411
460
|
};
|
|
412
461
|
export default AddSerivce;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
5
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
6
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
import React, { forwardRef, useImperativeHandle, useState } from 'react';
|
|
8
|
+
import { PisellModal } from '@pisell/materials';
|
|
9
|
+
import { locales } from "@pisell/utils";
|
|
10
|
+
var NotAvailable = function NotAvailable(props, ref) {
|
|
11
|
+
var _useState = useState(false),
|
|
12
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
13
|
+
open = _useState2[0],
|
|
14
|
+
setOpen = _useState2[1];
|
|
15
|
+
useImperativeHandle(ref, function () {
|
|
16
|
+
return {
|
|
17
|
+
open: function open() {
|
|
18
|
+
setOpen(true);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
});
|
|
22
|
+
return /*#__PURE__*/React.createElement(PisellModal.Information, {
|
|
23
|
+
open: open,
|
|
24
|
+
platform: "pc",
|
|
25
|
+
title: locales.getText('pisell2.ticket-booking.not-available-title'),
|
|
26
|
+
describe: "",
|
|
27
|
+
cancelText: locales.getText('pisell2.text.cancel'),
|
|
28
|
+
okText: locales.getText('pisell2.ticket-booking.not-available-ok'),
|
|
29
|
+
cancelVisible: false,
|
|
30
|
+
closable: true,
|
|
31
|
+
onOk: function onOk() {
|
|
32
|
+
return setOpen(false);
|
|
33
|
+
},
|
|
34
|
+
onCancel: function onCancel() {
|
|
35
|
+
return setOpen(false);
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
export default /*#__PURE__*/forwardRef(NotAvailable);
|
|
@@ -128,7 +128,7 @@ var initialState = {
|
|
|
128
128
|
bookingConfigParams: {
|
|
129
129
|
item_type: 'appointment_booking'
|
|
130
130
|
},
|
|
131
|
-
productExtensionType: ['appointment_ticket', 'session_ticket']
|
|
131
|
+
productExtensionType: ['appointment_ticket', 'session_ticket', "product_appointment", "service_product", "session_product", "normal", 'product_appointment']
|
|
132
132
|
};
|
|
133
133
|
export default (function (props) {
|
|
134
134
|
var _context$appHelper$ut;
|
|
@@ -45,6 +45,8 @@ declare const _default: {
|
|
|
45
45
|
"pisell2.ticket-booking.scan": string;
|
|
46
46
|
"pisell2.ticket-booking.create-new": string;
|
|
47
47
|
"pisell2.ticket-booking.add-to-cart": string;
|
|
48
|
+
"pisell2.ticket-booking.not-available-title": string;
|
|
49
|
+
"pisell2.ticket-booking.not-available-ok": string;
|
|
48
50
|
};
|
|
49
51
|
"zh-CN": {
|
|
50
52
|
"pisell2.ticket-booking.info": string;
|
|
@@ -92,6 +94,8 @@ declare const _default: {
|
|
|
92
94
|
"pisell2.ticket-booking.scan": string;
|
|
93
95
|
"pisell2.ticket-booking.create-new": string;
|
|
94
96
|
"pisell2.ticket-booking.add-to-cart": string;
|
|
97
|
+
"pisell2.ticket-booking.not-available-title": string;
|
|
98
|
+
"pisell2.ticket-booking.not-available-ok": string;
|
|
95
99
|
};
|
|
96
100
|
"zh-HK": {
|
|
97
101
|
"pisell2.ticket-booking.info": string;
|
|
@@ -139,6 +143,8 @@ declare const _default: {
|
|
|
139
143
|
"pisell2.ticket-booking.scan": string;
|
|
140
144
|
"pisell2.ticket-booking.create-new": string;
|
|
141
145
|
"pisell2.ticket-booking.add-to-cart": string;
|
|
146
|
+
"pisell2.ticket-booking.not-available-title": string;
|
|
147
|
+
"pisell2.ticket-booking.not-available-ok": string;
|
|
142
148
|
};
|
|
143
149
|
};
|
|
144
150
|
export default _default;
|
|
@@ -44,7 +44,9 @@ export default {
|
|
|
44
44
|
"pisell2.ticket-booking.appointment-not-found": "Appointment not found",
|
|
45
45
|
"pisell2.ticket-booking.scan": "Scan",
|
|
46
46
|
"pisell2.ticket-booking.create-new": "Create new",
|
|
47
|
-
"pisell2.ticket-booking.add-to-cart": "Added to Cart"
|
|
47
|
+
"pisell2.ticket-booking.add-to-cart": "Added to Cart",
|
|
48
|
+
"pisell2.ticket-booking.not-available-title": "Sorry, Not available at current time.",
|
|
49
|
+
"pisell2.ticket-booking.not-available-ok": "OK"
|
|
48
50
|
},
|
|
49
51
|
"zh-CN": {
|
|
50
52
|
"pisell2.ticket-booking.info": "信息",
|
|
@@ -91,7 +93,9 @@ export default {
|
|
|
91
93
|
"pisell2.ticket-booking.appointment-not-found": "没有发现此预约",
|
|
92
94
|
"pisell2.ticket-booking.scan": "",
|
|
93
95
|
"pisell2.ticket-booking.create-new": "新建",
|
|
94
|
-
"pisell2.ticket-booking.add-to-cart": "已加入购物车"
|
|
96
|
+
"pisell2.ticket-booking.add-to-cart": "已加入购物车",
|
|
97
|
+
"pisell2.ticket-booking.not-available-title": "抱歉,目前不在可售时间。",
|
|
98
|
+
"pisell2.ticket-booking.not-available-ok": "好的"
|
|
95
99
|
},
|
|
96
100
|
"zh-HK": {
|
|
97
101
|
"pisell2.ticket-booking.info": "資訊",
|
|
@@ -138,6 +142,8 @@ export default {
|
|
|
138
142
|
"pisell2.ticket-booking.appointment-not-found": "没有發現此預約",
|
|
139
143
|
"pisell2.ticket-booking.scan": "扫码",
|
|
140
144
|
"pisell2.ticket-booking.create-new": "新建",
|
|
141
|
-
"pisell2.ticket-booking.add-to-cart": "已加入购物车"
|
|
145
|
+
"pisell2.ticket-booking.add-to-cart": "已加入购物车",
|
|
146
|
+
"pisell2.ticket-booking.not-available-title": "抱歉,目前不在可售時間。",
|
|
147
|
+
"pisell2.ticket-booking.not-available-ok": "好的"
|
|
142
148
|
}
|
|
143
149
|
};
|