@pisell/private-materials 6.4.71 → 6.4.72
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 +8 -8
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +6 -6
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +7 -7
- package/es/components/booking/addons/model.d.ts +1 -10
- package/es/components/booking/components/footer/amount.js +25 -8
- package/es/components/booking/components/footer/utils.d.ts +7 -0
- package/es/components/booking/components/footer/utils.js +46 -22
- package/es/components/booking/forms/model.d.ts +1 -10
- package/es/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
- package/es/components/booking/hooks/useQuotation.js +69 -21
- package/es/components/booking/info/model.d.ts +1 -10
- package/es/components/booking/info/service/Lists.js +1 -1
- package/es/components/booking/info/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info/service/serve.d.ts +14 -0
- package/es/components/booking/info/service/serve.js +22 -1
- package/es/components/booking/info/service2/Group/utils.js +2 -0
- package/es/components/booking/info/service2/utils.d.ts +1 -33
- package/es/components/booking/info/service2/utils.js +75 -29
- package/es/components/booking/info/utils.js +5 -0
- package/es/components/booking/info2/service/addService/index.js +146 -89
- package/es/components/booking/info2/service/addService/utils.d.ts +9 -1
- package/es/components/booking/info2/service/addService/utils.js +78 -9
- package/es/components/booking/info2/service/editService/index.js +235 -55
- package/es/components/booking/info2/utilsByBooking.js +14 -5
- package/es/components/booking/model.d.ts +1 -9
- package/es/components/booking/notes/model.d.ts +1 -10
- package/es/components/booking/payments/model.d.ts +1 -10
- package/es/components/booking/utils.d.ts +9 -1
- package/es/components/booking/utils.js +23 -0
- package/es/components/checkout/hooks/useWalletPass.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/pay/toC/model.d.ts +1 -9
- package/es/components/schedules/model.d.ts +1 -9
- package/es/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.d.ts +18 -0
- package/es/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.js +119 -0
- package/es/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.less +0 -0
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +283 -138
- package/es/components/ticketBooking/components/ticketBooking/index.js +14 -11
- package/es/components/ticketBooking/utils/index.d.ts +6 -1
- package/es/components/ticketBooking/utils/index.js +21 -3
- package/es/components/wallet/Detail/model.d.ts +1 -13
- package/es/components/wallet/DiscountCard/model.d.ts +1 -14
- package/es/components/wallet/PointCard/model.d.ts +1 -13
- package/es/components/wallet/RechargeableCard/model.d.ts +1 -29
- package/es/components/wallet/Voucher/model.d.ts +1 -13
- package/es/components/wallet/model.d.ts +1 -9
- package/es/pro/multiDayTimeSelect/MultiDayTimeSelect.d.ts +9 -0
- package/es/pro/multiDayTimeSelect/MultiDayTimeSelect.js +355 -0
- package/es/pro/multiDayTimeSelect/MultiDayTimeSelect.less +8 -0
- package/es/pro/multiDayTimeSelect/index.d.ts +3 -0
- package/es/pro/multiDayTimeSelect/index.js +1 -0
- package/es/pro/multiDayTimeSelect/types.d.ts +28 -0
- package/es/pro/multiDayTimeSelect/types.js +1 -0
- package/lib/components/booking/addons/model.d.ts +1 -10
- package/lib/components/booking/components/footer/amount.js +23 -6
- package/lib/components/booking/components/footer/utils.d.ts +7 -0
- package/lib/components/booking/components/footer/utils.js +23 -11
- package/lib/components/booking/forms/model.d.ts +1 -10
- package/lib/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
- package/lib/components/booking/hooks/useQuotation.js +45 -13
- package/lib/components/booking/info/model.d.ts +1 -10
- package/lib/components/booking/info/service/Lists.js +1 -1
- package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info/service/serve.d.ts +14 -0
- package/lib/components/booking/info/service/serve.js +5 -0
- package/lib/components/booking/info/service2/Group/utils.js +2 -0
- package/lib/components/booking/info/service2/utils.d.ts +1 -33
- package/lib/components/booking/info/service2/utils.js +24 -10
- package/lib/components/booking/info/utils.js +4 -0
- package/lib/components/booking/info2/service/addService/index.js +22 -3
- package/lib/components/booking/info2/service/addService/utils.d.ts +9 -1
- package/lib/components/booking/info2/service/addService/utils.js +47 -9
- package/lib/components/booking/info2/service/editService/index.js +191 -31
- package/lib/components/booking/info2/utilsByBooking.js +19 -8
- package/lib/components/booking/model.d.ts +1 -9
- package/lib/components/booking/notes/model.d.ts +1 -10
- package/lib/components/booking/payments/model.d.ts +1 -10
- package/lib/components/booking/utils.d.ts +9 -1
- package/lib/components/booking/utils.js +15 -0
- package/lib/components/checkout/hooks/useWalletPass.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/pay/toC/model.d.ts +1 -9
- package/lib/components/schedules/model.d.ts +1 -9
- package/lib/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.d.ts +18 -0
- package/lib/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.js +118 -0
- package/lib/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.less +0 -0
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +185 -119
- package/lib/components/ticketBooking/components/ticketBooking/index.js +0 -16
- package/lib/components/ticketBooking/utils/index.d.ts +6 -1
- package/lib/components/ticketBooking/utils/index.js +11 -1
- package/lib/components/wallet/Detail/model.d.ts +1 -13
- package/lib/components/wallet/DiscountCard/model.d.ts +1 -14
- package/lib/components/wallet/PointCard/model.d.ts +1 -13
- package/lib/components/wallet/RechargeableCard/model.d.ts +1 -29
- package/lib/components/wallet/Voucher/model.d.ts +1 -13
- package/lib/components/wallet/model.d.ts +1 -9
- package/lib/pro/multiDayTimeSelect/MultiDayTimeSelect.d.ts +9 -0
- package/lib/pro/multiDayTimeSelect/MultiDayTimeSelect.js +304 -0
- package/lib/pro/multiDayTimeSelect/MultiDayTimeSelect.less +8 -0
- package/lib/pro/multiDayTimeSelect/index.d.ts +3 -0
- package/lib/pro/multiDayTimeSelect/index.js +35 -0
- package/lib/pro/multiDayTimeSelect/types.d.ts +28 -0
- package/lib/pro/multiDayTimeSelect/types.js +17 -0
- package/package.json +13 -13
|
@@ -22,8 +22,8 @@ import React, { useEffect, useMemo, useRef, useState } from 'react';
|
|
|
22
22
|
import { useMemoizedFn } from 'ahooks';
|
|
23
23
|
import useEngineContext from "../../../../hooks/useEngineContext";
|
|
24
24
|
import { isSessionProduct, request, getProductTotalPrice, getIsEject, getIsOnlySession } from "../../../booking/utils";
|
|
25
|
-
import { getProductExtend } from "../../../booking/info2/service/addService/utils";
|
|
26
|
-
import { holderId,
|
|
25
|
+
import { getMultiDay, getProductExtend, isMultiDayProduct } from "../../../booking/info2/service/addService/utils";
|
|
26
|
+
import { holderId, isNormalProductByDurationSchedule } from "../../../booking/info/service2/utils";
|
|
27
27
|
import { isBooking4Shop } from "../../../booking/info/utils";
|
|
28
28
|
import { useService } from "../../../booking/info/service/serviceManager";
|
|
29
29
|
import ProductDisplayAdapter, { resolveProductDisplayConfig } from "../ProductDisplayAdapter";
|
|
@@ -35,6 +35,8 @@ import { useProducts } from "../../hooks/pisellos";
|
|
|
35
35
|
import { createCacheItem, genValues, isBundle, isOption, setHandleSetService } from "./utils";
|
|
36
36
|
import { useToast } from '@pisell/materials';
|
|
37
37
|
import { useIsActive } from "../../context/IsActiveContext";
|
|
38
|
+
import { concatBookings, createBookingItemsByGroup } from "../../../booking/info/service2/Group/utils";
|
|
39
|
+
import MultiDayTimeSelectModal from "./MultiDayTimeSelectModal";
|
|
38
40
|
var productListLayout = {
|
|
39
41
|
grid: true,
|
|
40
42
|
config: '12:12'
|
|
@@ -77,6 +79,18 @@ var AddSerivce = function AddSerivce(props) {
|
|
|
77
79
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
78
80
|
firstLoading = _useState4[0],
|
|
79
81
|
setFirstLoading = _useState4[1];
|
|
82
|
+
var _useState5 = useState(false),
|
|
83
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
84
|
+
multiDayModalOpen = _useState6[0],
|
|
85
|
+
setMultiDayModalOpen = _useState6[1];
|
|
86
|
+
var _useState7 = useState(false),
|
|
87
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
88
|
+
multiDayModalLoading = _useState8[0],
|
|
89
|
+
setMultiDayModalLoading = _useState8[1];
|
|
90
|
+
var _useState9 = useState(null),
|
|
91
|
+
_useState10 = _slicedToArray(_useState9, 2),
|
|
92
|
+
pendingMultiDayData = _useState10[0],
|
|
93
|
+
setPendingMultiDayData = _useState10[1];
|
|
80
94
|
var stateRef = useRef(state);
|
|
81
95
|
stateRef.current = state;
|
|
82
96
|
var _useProducts = useProducts(notAvailableRef),
|
|
@@ -198,9 +212,227 @@ var AddSerivce = function AddSerivce(props) {
|
|
|
198
212
|
executeCacheValues(productId, cacheValues, item, callback);
|
|
199
213
|
}, 0);
|
|
200
214
|
});
|
|
215
|
+
|
|
216
|
+
// 处理添加服务的逻辑(提取为独立函数,方便跨日商品确认后调用)
|
|
217
|
+
var processAddService = useMemoizedFn( /*#__PURE__*/function () {
|
|
218
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(item, _detail, e, notShowToast, startDate, endDate) {
|
|
219
|
+
var other, cacheItem, _total, _isEdit, _stateRef$current$ser, isMultiDay, getMultiDayCacheItem, _addService2, _list, quantity, _context$appHelper$ut4, _context$appHelper$ut5, val, sendData, _window$openBookingEd, _window;
|
|
220
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
221
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
222
|
+
case 0:
|
|
223
|
+
other = JSON.parse(JSON.stringify(e));
|
|
224
|
+
other.session = e.session;
|
|
225
|
+
cacheItem = _objectSpread(_objectSpread({}, _detail), {}, {
|
|
226
|
+
product_id: item.id,
|
|
227
|
+
_id: getUniqueId(),
|
|
228
|
+
_key: e.key,
|
|
229
|
+
_extend: {
|
|
230
|
+
start_date: startDate,
|
|
231
|
+
quantity: (e === null || e === void 0 ? void 0 : e.quantity) || 1,
|
|
232
|
+
price: _detail.price,
|
|
233
|
+
product_name: item.title,
|
|
234
|
+
other: other,
|
|
235
|
+
end_date: endDate
|
|
236
|
+
},
|
|
237
|
+
new: 1
|
|
238
|
+
});
|
|
239
|
+
_total = getProductTotalPrice(cacheItem); // 用于折扣 可修改
|
|
240
|
+
cacheItem._extend.total = _total;
|
|
241
|
+
// 用于储存原价
|
|
242
|
+
cacheItem._extend.origin_total = _total;
|
|
243
|
+
_isEdit = !!stateRef.current.service.cacheItem;
|
|
244
|
+
if (_isEdit) {
|
|
245
|
+
cacheItem._id = (_stateRef$current$ser = stateRef.current.service.cacheItem) === null || _stateRef$current$ser === void 0 ? void 0 : _stateRef$current$ser._id;
|
|
246
|
+
cacheItem.new = 0;
|
|
247
|
+
}
|
|
248
|
+
// 渲染到当前位置模式时,默认无资源 时间默认取顶部设置的时间
|
|
249
|
+
if (renderMode === 'current') {
|
|
250
|
+
// cacheItem._extend.resource = 0;
|
|
251
|
+
cacheItem.currentDefaultTime = stateRef.current.date.value.format('HH:mm');
|
|
252
|
+
}
|
|
253
|
+
cacheItem = getProductExtend({
|
|
254
|
+
cacheItem: cacheItem,
|
|
255
|
+
state: stateRef.current,
|
|
256
|
+
isDisabledTime: true
|
|
257
|
+
});
|
|
258
|
+
isMultiDay = isMultiDayProduct(cacheItem);
|
|
259
|
+
getMultiDayCacheItem = /*#__PURE__*/function () {
|
|
260
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(isConcatBookings) {
|
|
261
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
262
|
+
while (1) switch (_context.prev = _context.next) {
|
|
263
|
+
case 0:
|
|
264
|
+
_context.next = 2;
|
|
265
|
+
return getMultiDay({
|
|
266
|
+
start_date: cacheItem._extend.start_date,
|
|
267
|
+
end_date: cacheItem._extend.end_date,
|
|
268
|
+
state: stateRef.current,
|
|
269
|
+
cacheItem: cacheItem
|
|
270
|
+
});
|
|
271
|
+
case 2:
|
|
272
|
+
cacheItem = _context.sent;
|
|
273
|
+
cacheItem = createBookingItemsByGroup(cacheItem);
|
|
274
|
+
if (isConcatBookings) {
|
|
275
|
+
cacheItem = concatBookings(cacheItem);
|
|
276
|
+
}
|
|
277
|
+
case 5:
|
|
278
|
+
case "end":
|
|
279
|
+
return _context.stop();
|
|
280
|
+
}
|
|
281
|
+
}, _callee);
|
|
282
|
+
}));
|
|
283
|
+
return function getMultiDayCacheItem(_x7) {
|
|
284
|
+
return _ref2.apply(this, arguments);
|
|
285
|
+
};
|
|
286
|
+
}();
|
|
287
|
+
if (stateRef.current.renderType === 'eventBooking') {
|
|
288
|
+
cacheItem.autoClose = false;
|
|
289
|
+
}
|
|
290
|
+
if (!cacheItem.autoClose) {
|
|
291
|
+
_context2.next = 26;
|
|
292
|
+
break;
|
|
293
|
+
}
|
|
294
|
+
cacheItem.autoClose = false;
|
|
295
|
+
cacheItem._serviceKey = genServiceKey(cacheItem);
|
|
296
|
+
if (!isMultiDay) {
|
|
297
|
+
_context2.next = 19;
|
|
298
|
+
break;
|
|
299
|
+
}
|
|
300
|
+
_context2.next = 19;
|
|
301
|
+
return getMultiDayCacheItem();
|
|
302
|
+
case 19:
|
|
303
|
+
_addService2 = addService(_toConsumableArray(stateRef.current.service.value), cacheItem, stateRef.current, isMultiDay), _list = _addService2.list, quantity = _addService2.quantity;
|
|
304
|
+
if (!notShowToast) {
|
|
305
|
+
handleAddToast(cacheItem.title, quantity || 1);
|
|
306
|
+
}
|
|
307
|
+
window.dispatchEvent(new CustomEvent('onAddNewService', {
|
|
308
|
+
detail: {
|
|
309
|
+
cacheItem: cacheItem
|
|
310
|
+
}
|
|
311
|
+
}));
|
|
312
|
+
try {
|
|
313
|
+
if (((_context$appHelper$ut4 = context.appHelper.utils.store) === null || _context$appHelper$ut4 === void 0 || (_context$appHelper$ut5 = _context$appHelper$ut4.getState) === null || _context$appHelper$ut5 === void 0 || (_context$appHelper$ut5 = _context$appHelper$ut5.call(_context$appHelper$ut4)) === null || _context$appHelper$ut5 === void 0 || (_context$appHelper$ut5 = _context$appHelper$ut5.global) === null || _context$appHelper$ut5 === void 0 || (_context$appHelper$ut5 = _context$appHelper$ut5.globalConfig) === null || _context$appHelper$ut5 === void 0 ? void 0 : _context$appHelper$ut5.id) === 2155) {
|
|
314
|
+
val = _list === null || _list === void 0 ? void 0 : _list.map(function (s) {
|
|
315
|
+
return {
|
|
316
|
+
product_id: s === null || s === void 0 ? void 0 : s.product_id,
|
|
317
|
+
detailId: s === null || s === void 0 ? void 0 : s.id,
|
|
318
|
+
detailProductId: s === null || s === void 0 ? void 0 : s.product_id,
|
|
319
|
+
product_name: s === null || s === void 0 ? void 0 : s.title,
|
|
320
|
+
price: s === null || s === void 0 ? void 0 : s.price,
|
|
321
|
+
_id: s === null || s === void 0 ? void 0 : s._id,
|
|
322
|
+
_key: s === null || s === void 0 ? void 0 : s._key,
|
|
323
|
+
_serviceKey: s === null || s === void 0 ? void 0 : s._serviceKey
|
|
324
|
+
};
|
|
325
|
+
});
|
|
326
|
+
sendData = {
|
|
327
|
+
product_id: item === null || item === void 0 ? void 0 : item.id,
|
|
328
|
+
detailId: _detail === null || _detail === void 0 ? void 0 : _detail.id,
|
|
329
|
+
detailProductId: _detail === null || _detail === void 0 ? void 0 : _detail.product_id,
|
|
330
|
+
product_name: item === null || item === void 0 ? void 0 : item.title,
|
|
331
|
+
price: _detail === null || _detail === void 0 ? void 0 : _detail.price,
|
|
332
|
+
serviceVal: val
|
|
333
|
+
};
|
|
334
|
+
sendWarningLog({
|
|
335
|
+
title: 'addService',
|
|
336
|
+
content: [{
|
|
337
|
+
key: '添加数据',
|
|
338
|
+
value: JSON.stringify(sendData)
|
|
339
|
+
}, {
|
|
340
|
+
key: '日期',
|
|
341
|
+
value: dayjs().format('YYYY-MM-DD HH:mm:ss')
|
|
342
|
+
}]
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
} catch (error) {}
|
|
346
|
+
dispatch({
|
|
347
|
+
type: 'setService',
|
|
348
|
+
payload: {
|
|
349
|
+
addModal: false,
|
|
350
|
+
value: _list,
|
|
351
|
+
edit: true,
|
|
352
|
+
changeService: false
|
|
353
|
+
}
|
|
354
|
+
});
|
|
355
|
+
_context2.next = 32;
|
|
356
|
+
break;
|
|
357
|
+
case 26:
|
|
358
|
+
(_window$openBookingEd = (_window = window).openBookingEditModal) === null || _window$openBookingEd === void 0 || _window$openBookingEd.call(_window);
|
|
359
|
+
if (!isMultiDay) {
|
|
360
|
+
_context2.next = 30;
|
|
361
|
+
break;
|
|
362
|
+
}
|
|
363
|
+
_context2.next = 30;
|
|
364
|
+
return getMultiDayCacheItem(true);
|
|
365
|
+
case 30:
|
|
366
|
+
dispatch({
|
|
367
|
+
type: 'setService',
|
|
368
|
+
payload: {
|
|
369
|
+
editModal: true,
|
|
370
|
+
cacheItem: cacheItem,
|
|
371
|
+
addModal: !cacheItem.autoClose,
|
|
372
|
+
changeService: false
|
|
373
|
+
}
|
|
374
|
+
});
|
|
375
|
+
onEdit === null || onEdit === void 0 || onEdit(cacheItem);
|
|
376
|
+
case 32:
|
|
377
|
+
case "end":
|
|
378
|
+
return _context2.stop();
|
|
379
|
+
}
|
|
380
|
+
}, _callee2);
|
|
381
|
+
}));
|
|
382
|
+
return function (_x, _x2, _x3, _x4, _x5, _x6) {
|
|
383
|
+
return _ref.apply(this, arguments);
|
|
384
|
+
};
|
|
385
|
+
}());
|
|
386
|
+
|
|
387
|
+
// 处理跨日商品时间选择确认
|
|
388
|
+
var handleMultiDayConfirm = useMemoizedFn( /*#__PURE__*/function () {
|
|
389
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(startDate, endDate, duration) {
|
|
390
|
+
var item, detail, e, notShowToast;
|
|
391
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
392
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
393
|
+
case 0:
|
|
394
|
+
if (pendingMultiDayData) {
|
|
395
|
+
_context3.next = 2;
|
|
396
|
+
break;
|
|
397
|
+
}
|
|
398
|
+
return _context3.abrupt("return");
|
|
399
|
+
case 2:
|
|
400
|
+
setMultiDayModalLoading(true);
|
|
401
|
+
_context3.prev = 3;
|
|
402
|
+
item = pendingMultiDayData.item, detail = pendingMultiDayData.detail, e = pendingMultiDayData.e, notShowToast = pendingMultiDayData.notShowToast; // 使用选择的时间继续处理添加服务逻辑
|
|
403
|
+
_context3.next = 7;
|
|
404
|
+
return processAddService(item, detail, e, notShowToast, startDate, endDate);
|
|
405
|
+
case 7:
|
|
406
|
+
setPendingMultiDayData(null);
|
|
407
|
+
setMultiDayModalOpen(false);
|
|
408
|
+
_context3.next = 14;
|
|
409
|
+
break;
|
|
410
|
+
case 11:
|
|
411
|
+
_context3.prev = 11;
|
|
412
|
+
_context3.t0 = _context3["catch"](3);
|
|
413
|
+
console.error('添加跨日商品失败:', _context3.t0);
|
|
414
|
+
case 14:
|
|
415
|
+
_context3.prev = 14;
|
|
416
|
+
setMultiDayModalLoading(false);
|
|
417
|
+
return _context3.finish(14);
|
|
418
|
+
case 17:
|
|
419
|
+
case "end":
|
|
420
|
+
return _context3.stop();
|
|
421
|
+
}
|
|
422
|
+
}, _callee3, null, [[3, 11, 14, 17]]);
|
|
423
|
+
}));
|
|
424
|
+
return function (_x8, _x9, _x10) {
|
|
425
|
+
return _ref3.apply(this, arguments);
|
|
426
|
+
};
|
|
427
|
+
}());
|
|
428
|
+
|
|
429
|
+
// 处理跨日商品时间选择取消
|
|
430
|
+
var handleMultiDayCancel = useMemoizedFn(function () {
|
|
431
|
+
setMultiDayModalOpen(false);
|
|
432
|
+
setPendingMultiDayData(null);
|
|
433
|
+
});
|
|
201
434
|
var handleSelectProduct = useMemoizedFn(function (item) {
|
|
202
435
|
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'select';
|
|
203
|
-
console.log('handleSelectProduct');
|
|
204
436
|
if (!isNormalProductByDurationSchedule(item)) {
|
|
205
437
|
var _state$service;
|
|
206
438
|
if (!Array.isArray((_state$service = state.service) === null || _state$service === void 0 ? void 0 : _state$service.resourcesOrigin) || !state.service.resourcesOrigin.length) {
|
|
@@ -240,19 +472,20 @@ var AddSerivce = function AddSerivce(props) {
|
|
|
240
472
|
}
|
|
241
473
|
}
|
|
242
474
|
var callback = /*#__PURE__*/function () {
|
|
243
|
-
var
|
|
244
|
-
var data, _detail,
|
|
245
|
-
return _regeneratorRuntime().wrap(function
|
|
246
|
-
while (1) switch (
|
|
475
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(e, extension_type, detail, notShowToast) {
|
|
476
|
+
var data, _detail, isMultiDay;
|
|
477
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
478
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
247
479
|
case 0:
|
|
480
|
+
debugger;
|
|
248
481
|
setCurrentProduct(null);
|
|
249
482
|
// 防止选择商品弹窗多次触发callback
|
|
250
483
|
if (!lock) {
|
|
251
|
-
|
|
484
|
+
_context4.next = 4;
|
|
252
485
|
break;
|
|
253
486
|
}
|
|
254
|
-
return
|
|
255
|
-
case
|
|
487
|
+
return _context4.abrupt("return");
|
|
488
|
+
case 4:
|
|
256
489
|
lock = true;
|
|
257
490
|
|
|
258
491
|
// 2秒后解除
|
|
@@ -260,144 +493,57 @@ var AddSerivce = function AddSerivce(props) {
|
|
|
260
493
|
lock = false;
|
|
261
494
|
}, 2000);
|
|
262
495
|
if (isBooking4) {
|
|
263
|
-
|
|
496
|
+
_context4.next = 12;
|
|
264
497
|
break;
|
|
265
498
|
}
|
|
266
|
-
|
|
499
|
+
_context4.next = 9;
|
|
267
500
|
return createBookingData({
|
|
268
501
|
product: _objectSpread(_objectSpread({}, detail || item), {}, {
|
|
269
502
|
_params: e
|
|
270
503
|
})
|
|
271
504
|
});
|
|
272
|
-
case
|
|
273
|
-
data =
|
|
505
|
+
case 9:
|
|
506
|
+
data = _context4.sent;
|
|
274
507
|
// 创建预约
|
|
275
508
|
createBooking({
|
|
276
509
|
booking: data
|
|
277
510
|
});
|
|
278
|
-
return
|
|
279
|
-
case
|
|
511
|
+
return _context4.abrupt("return");
|
|
512
|
+
case 12:
|
|
280
513
|
// info2 addService 逻辑
|
|
281
|
-
_detail = detail || item;
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
_id: getUniqueId(),
|
|
287
|
-
_key: e.key,
|
|
288
|
-
_extend: {
|
|
289
|
-
start_date: state.date.value,
|
|
290
|
-
quantity: (e === null || e === void 0 ? void 0 : e.quantity) || 1,
|
|
291
|
-
price: _detail.price,
|
|
292
|
-
product_name: item.title,
|
|
293
|
-
other: other
|
|
294
|
-
},
|
|
295
|
-
new: 1
|
|
296
|
-
});
|
|
297
|
-
_total = getProductTotalPrice(cacheItem); // 用于折扣 可修改
|
|
298
|
-
cacheItem._extend.total = _total;
|
|
299
|
-
// 用于储存原价
|
|
300
|
-
cacheItem._extend.origin_total = _total;
|
|
301
|
-
_isEdit = !!state.service.cacheItem;
|
|
302
|
-
if (_isEdit) {
|
|
303
|
-
cacheItem._id = (_state$service$cacheI = state.service.cacheItem) === null || _state$service$cacheI === void 0 ? void 0 : _state$service$cacheI._id;
|
|
304
|
-
cacheItem.new = 0;
|
|
305
|
-
}
|
|
306
|
-
// 渲染到当前位置模式时,默认无资源 时间默认取顶部设置的时间
|
|
307
|
-
if (renderMode === 'current') {
|
|
308
|
-
// cacheItem._extend.resource = 0;
|
|
309
|
-
cacheItem.currentDefaultTime = state.date.value.format('HH:mm');
|
|
514
|
+
_detail = detail || item; // 判断是否是跨日商品,如果是,先打开时间选择弹窗
|
|
515
|
+
isMultiDay = isMultiDayProduct(_detail || item);
|
|
516
|
+
if (!isMultiDay) {
|
|
517
|
+
_context4.next = 18;
|
|
518
|
+
break;
|
|
310
519
|
}
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
520
|
+
// 保存待处理的数据
|
|
521
|
+
setPendingMultiDayData({
|
|
522
|
+
item: item,
|
|
523
|
+
detail: _detail,
|
|
524
|
+
e: e,
|
|
525
|
+
notShowToast: notShowToast
|
|
315
526
|
});
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
if (!notShowToast) {
|
|
324
|
-
handleAddToast(cacheItem.title, quantity || 1);
|
|
325
|
-
}
|
|
326
|
-
window.dispatchEvent(new CustomEvent('onAddNewService', {
|
|
327
|
-
detail: {
|
|
328
|
-
cacheItem: cacheItem
|
|
329
|
-
}
|
|
330
|
-
}));
|
|
331
|
-
try {
|
|
332
|
-
if (((_context$appHelper$ut4 = context.appHelper.utils.store) === null || _context$appHelper$ut4 === void 0 || (_context$appHelper$ut5 = _context$appHelper$ut4.getState) === null || _context$appHelper$ut5 === void 0 || (_context$appHelper$ut5 = _context$appHelper$ut5.call(_context$appHelper$ut4)) === null || _context$appHelper$ut5 === void 0 || (_context$appHelper$ut5 = _context$appHelper$ut5.global) === null || _context$appHelper$ut5 === void 0 || (_context$appHelper$ut5 = _context$appHelper$ut5.globalConfig) === null || _context$appHelper$ut5 === void 0 ? void 0 : _context$appHelper$ut5.id) === 2155) {
|
|
333
|
-
val = _list === null || _list === void 0 ? void 0 : _list.map(function (s) {
|
|
334
|
-
return {
|
|
335
|
-
product_id: s === null || s === void 0 ? void 0 : s.product_id,
|
|
336
|
-
detailId: s === null || s === void 0 ? void 0 : s.id,
|
|
337
|
-
detailProductId: s === null || s === void 0 ? void 0 : s.product_id,
|
|
338
|
-
product_name: s === null || s === void 0 ? void 0 : s.title,
|
|
339
|
-
price: s === null || s === void 0 ? void 0 : s.price,
|
|
340
|
-
_id: s === null || s === void 0 ? void 0 : s._id,
|
|
341
|
-
_key: s === null || s === void 0 ? void 0 : s._key,
|
|
342
|
-
_serviceKey: s === null || s === void 0 ? void 0 : s._serviceKey
|
|
343
|
-
};
|
|
344
|
-
});
|
|
345
|
-
sendData = {
|
|
346
|
-
product_id: item === null || item === void 0 ? void 0 : item.id,
|
|
347
|
-
detailId: _detail === null || _detail === void 0 ? void 0 : _detail.id,
|
|
348
|
-
detailProductId: _detail === null || _detail === void 0 ? void 0 : _detail.product_id,
|
|
349
|
-
product_name: item === null || item === void 0 ? void 0 : item.title,
|
|
350
|
-
price: _detail === null || _detail === void 0 ? void 0 : _detail.price,
|
|
351
|
-
serviceVal: val
|
|
352
|
-
};
|
|
353
|
-
sendWarningLog({
|
|
354
|
-
title: 'addService',
|
|
355
|
-
content: [{
|
|
356
|
-
key: '添加数据',
|
|
357
|
-
value: JSON.stringify(sendData)
|
|
358
|
-
}, {
|
|
359
|
-
key: '日期',
|
|
360
|
-
value: dayjs().format('YYYY-MM-DD HH:mm:ss')
|
|
361
|
-
}]
|
|
362
|
-
});
|
|
363
|
-
}
|
|
364
|
-
} catch (error) {}
|
|
365
|
-
dispatch({
|
|
366
|
-
type: 'setService',
|
|
367
|
-
payload: {
|
|
368
|
-
addModal: false,
|
|
369
|
-
value: _list,
|
|
370
|
-
edit: true,
|
|
371
|
-
changeService: false
|
|
372
|
-
}
|
|
373
|
-
});
|
|
374
|
-
} else {
|
|
375
|
-
(_window$openBookingEd = (_window = window).openBookingEditModal) === null || _window$openBookingEd === void 0 || _window$openBookingEd.call(_window);
|
|
376
|
-
dispatch({
|
|
377
|
-
type: 'setService',
|
|
378
|
-
payload: {
|
|
379
|
-
editModal: true,
|
|
380
|
-
cacheItem: cacheItem,
|
|
381
|
-
addModal: !cacheItem.autoClose,
|
|
382
|
-
changeService: false
|
|
383
|
-
}
|
|
384
|
-
});
|
|
385
|
-
onEdit === null || onEdit === void 0 || onEdit(cacheItem);
|
|
386
|
-
}
|
|
387
|
-
case 24:
|
|
527
|
+
// 打开时间选择弹窗
|
|
528
|
+
setMultiDayModalOpen(true);
|
|
529
|
+
return _context4.abrupt("return");
|
|
530
|
+
case 18:
|
|
531
|
+
_context4.next = 20;
|
|
532
|
+
return processAddService(item, _detail, e, notShowToast, state.date.value);
|
|
533
|
+
case 20:
|
|
388
534
|
case "end":
|
|
389
|
-
return
|
|
535
|
+
return _context4.stop();
|
|
390
536
|
}
|
|
391
|
-
},
|
|
537
|
+
}, _callee4);
|
|
392
538
|
}));
|
|
393
|
-
return function callback(
|
|
394
|
-
return
|
|
539
|
+
return function callback(_x11, _x12, _x13, _x14) {
|
|
540
|
+
return _ref4.apply(this, arguments);
|
|
395
541
|
};
|
|
396
542
|
}();
|
|
397
543
|
|
|
398
544
|
// 如果不需要打开弹窗, 直接添加数据
|
|
399
545
|
if (cacheValues) {
|
|
400
|
-
var _stateRef$current$
|
|
546
|
+
var _stateRef$current$ser2, _detail$_extend, _Toast$success2;
|
|
401
547
|
var productId = item.id.toString();
|
|
402
548
|
|
|
403
549
|
// 如果已经有pending的同商品,增加点击次数
|
|
@@ -409,7 +555,7 @@ var AddSerivce = function AddSerivce(props) {
|
|
|
409
555
|
clickCountRef.current[productId] = 1;
|
|
410
556
|
}
|
|
411
557
|
var cacheItem = createSimpleCacheItem(item, cacheValues, state);
|
|
412
|
-
var detail = (_stateRef$current$
|
|
558
|
+
var detail = (_stateRef$current$ser2 = stateRef.current.service.value) === null || _stateRef$current$ser2 === void 0 ? void 0 : _stateRef$current$ser2.find(function (val) {
|
|
413
559
|
return isSameProduct(val, cacheItem);
|
|
414
560
|
});
|
|
415
561
|
var originalQuantity = (detail === null || detail === void 0 || (_detail$_extend = detail._extend) === null || _detail$_extend === void 0 ? void 0 : _detail$_extend.quantity) || 0;
|
|
@@ -448,16 +594,6 @@ var AddSerivce = function AddSerivce(props) {
|
|
|
448
594
|
});
|
|
449
595
|
var renderList = useMemo(function () {
|
|
450
596
|
var _list = products || [];
|
|
451
|
-
|
|
452
|
-
// 跨日预约
|
|
453
|
-
if (isDaysBooking(state)) {
|
|
454
|
-
// 公共购物车下过滤掉预约商品
|
|
455
|
-
if (!holderId(state)) {
|
|
456
|
-
_list = _list.filter(function (item) {
|
|
457
|
-
return isNormalProductByDurationSchedule(item);
|
|
458
|
-
});
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
597
|
return _list;
|
|
462
598
|
}, [products, state === null || state === void 0 ? void 0 : state.activeCartId]);
|
|
463
599
|
var currentDate = useMemo(function () {
|
|
@@ -496,6 +632,7 @@ var AddSerivce = function AddSerivce(props) {
|
|
|
496
632
|
}, [productDisplayConfig]);
|
|
497
633
|
return useMemo(function () {
|
|
498
634
|
if (renderMode === 'current') {
|
|
635
|
+
var _pendingMultiDayData$;
|
|
499
636
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(ProductDisplayAdapter, {
|
|
500
637
|
config: finalDisplayConfig,
|
|
501
638
|
dataSource: renderList,
|
|
@@ -504,9 +641,17 @@ var AddSerivce = function AddSerivce(props) {
|
|
|
504
641
|
onSelectProduct: handleSelectProduct
|
|
505
642
|
}), /*#__PURE__*/React.createElement(NotAvailable, {
|
|
506
643
|
ref: notAvailableRef
|
|
644
|
+
}), /*#__PURE__*/React.createElement(MultiDayTimeSelectModal, {
|
|
645
|
+
open: multiDayModalOpen,
|
|
646
|
+
productName: pendingMultiDayData === null || pendingMultiDayData === void 0 || (_pendingMultiDayData$ = pendingMultiDayData.item) === null || _pendingMultiDayData$ === void 0 ? void 0 : _pendingMultiDayData$.title,
|
|
647
|
+
locale: state === null || state === void 0 ? void 0 : state.locale,
|
|
648
|
+
defaultStartDate: state.date.value,
|
|
649
|
+
loading: multiDayModalLoading,
|
|
650
|
+
onConfirm: handleMultiDayConfirm,
|
|
651
|
+
onCancel: handleMultiDayCancel
|
|
507
652
|
}));
|
|
508
653
|
}
|
|
509
654
|
return null;
|
|
510
|
-
}, [firstLoading, state.service.addModal, locales, renderList, state.amountSymbol, state.renderType, state === null || state === void 0 ? void 0 : state.activeCartId, holderId(state), loading, currentProduct, isBooking4, finalDisplayConfig]);
|
|
655
|
+
}, [firstLoading, state.service.addModal, locales, renderList, state.amountSymbol, state.renderType, state === null || state === void 0 ? void 0 : state.activeCartId, holderId(state), loading, currentProduct, isBooking4, finalDisplayConfig, multiDayModalOpen, pendingMultiDayData, multiDayModalLoading]);
|
|
511
656
|
};
|
|
512
657
|
export default AddSerivce;
|
|
@@ -679,17 +679,20 @@ var TicketBooking = function TicketBooking(props) {
|
|
|
679
679
|
})
|
|
680
680
|
});
|
|
681
681
|
setTimeout(function () {
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
682
|
+
// if (state.modalState.service?.value?.length) {
|
|
683
|
+
// let _list = state.bookingFunctions?.updateServiceDate?.(
|
|
684
|
+
// state.modalState.service?.value,
|
|
685
|
+
// date,
|
|
686
|
+
// false
|
|
687
|
+
// );
|
|
688
|
+
// _setModalState({
|
|
689
|
+
// service: {
|
|
690
|
+
// ...state.modalState.service,
|
|
691
|
+
// value: _list,
|
|
692
|
+
// edit: true,
|
|
693
|
+
// },
|
|
694
|
+
// });
|
|
695
|
+
// }
|
|
693
696
|
}, 100);
|
|
694
697
|
};
|
|
695
698
|
var _setShopOpeningHours = function _setShopOpeningHours() {
|
|
@@ -15,9 +15,14 @@ export declare const restoreProductOtherData: (data: any) => {
|
|
|
15
15
|
quantity: number;
|
|
16
16
|
} | undefined;
|
|
17
17
|
export declare const isSameProduct: (a: any, b: any) => boolean;
|
|
18
|
-
export declare const addService: (list: any[], addItem: any, state: any) => {
|
|
18
|
+
export declare const addService: (list: any[], addItem: any, state: any, isMultiDay?: boolean) => {
|
|
19
|
+
list: any[];
|
|
20
|
+
count: number;
|
|
21
|
+
quantity?: undefined;
|
|
22
|
+
} | {
|
|
19
23
|
list: any[];
|
|
20
24
|
quantity: any;
|
|
25
|
+
count?: undefined;
|
|
21
26
|
};
|
|
22
27
|
export declare const addServiceScroll: (rowKey: string, cacheItem: any) => void;
|
|
23
28
|
export declare const getCartProductOverlay: (state: any) => any;
|
|
@@ -2,10 +2,14 @@ var _excluded = ["detail"];
|
|
|
2
2
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
3
3
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
4
4
|
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."); }
|
|
5
|
-
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); }
|
|
6
|
-
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; }
|
|
7
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; } }
|
|
8
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
8
|
+
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
+
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); }
|
|
10
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
11
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
12
|
+
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; }
|
|
9
13
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
10
14
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
11
15
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -16,6 +20,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
|
|
|
16
20
|
import dayjs from 'dayjs';
|
|
17
21
|
import { isNormalProductByDurationSchedule } from "../../booking/info/service2/utils";
|
|
18
22
|
import { isArr, getUniqueId } from '@pisell/utils';
|
|
23
|
+
import { isMultiDayProduct } from "../../booking/info2/service/addService/utils";
|
|
19
24
|
|
|
20
25
|
/** dayjs对象格式化为字符串时间 */
|
|
21
26
|
export var formatDateToStr = function formatDateToStr(date) {
|
|
@@ -133,9 +138,18 @@ export var isSameProduct = function isSameProduct(a, b) {
|
|
|
133
138
|
}
|
|
134
139
|
return ((_a$_extend2 = a._extend) === null || _a$_extend2 === void 0 || (_a$_extend2 = _a$_extend2.other) === null || _a$_extend2 === void 0 ? void 0 : _a$_extend2.rowKey) === ((_b$_extend2 = b._extend) === null || _b$_extend2 === void 0 || (_b$_extend2 = _b$_extend2.other) === null || _b$_extend2 === void 0 ? void 0 : _b$_extend2.rowKey) && a._serviceKey === b._serviceKey;
|
|
135
140
|
};
|
|
136
|
-
export var addService = function addService(list, addItem, state) {
|
|
141
|
+
export var addService = function addService(list, addItem, state, isMultiDay) {
|
|
137
142
|
var value = list;
|
|
138
143
|
var count;
|
|
144
|
+
|
|
145
|
+
// 跨日预约 不需要叠加
|
|
146
|
+
if (isMultiDay && isArr(addItem)) {
|
|
147
|
+
return {
|
|
148
|
+
list: [].concat(_toConsumableArray(addItem), _toConsumableArray(value)),
|
|
149
|
+
count: 1
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
|
|
139
153
|
// 预约商品 并且配置商品卡片不叠加 直接添加
|
|
140
154
|
if (!isNormalProductByDurationSchedule(addItem) && !getIsOverlayProduct(addItem, state)) {
|
|
141
155
|
value.unshift(addItem);
|
|
@@ -232,6 +246,10 @@ export var getIsOverlayProduct = function getIsOverlayProduct(item, state) {
|
|
|
232
246
|
// 获取购物车商品是否显示数量
|
|
233
247
|
export var getIsShowNumber = function getIsShowNumber(item, state) {
|
|
234
248
|
var isBookingTicket2 = state.isBookingTicket2;
|
|
249
|
+
// 跨日商品不允许选多个
|
|
250
|
+
if (isMultiDayProduct(item)) {
|
|
251
|
+
return false;
|
|
252
|
+
}
|
|
235
253
|
return isNormalProductByDurationSchedule(item) || isBookingTicket2 && getIsOverlayProduct(item, state);
|
|
236
254
|
};
|
|
237
255
|
|
|
@@ -1,13 +1 @@
|
|
|
1
|
-
|
|
2
|
-
interface RechargeState {
|
|
3
|
-
addWalletCard: any;
|
|
4
|
-
}
|
|
5
|
-
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
6
|
-
walletDetailState: RechargeState;
|
|
7
|
-
} & {
|
|
8
|
-
dispatch: (params: {
|
|
9
|
-
type: string;
|
|
10
|
-
payload: any;
|
|
11
|
-
}) => void;
|
|
12
|
-
}>;
|
|
13
|
-
export {};
|
|
1
|
+
export declare const Provider: any, Context: any;
|
|
@@ -1,14 +1 @@
|
|
|
1
|
-
|
|
2
|
-
interface RechargeState {
|
|
3
|
-
total: number;
|
|
4
|
-
setup?: 'menu' | 'list' | 'detail' | string;
|
|
5
|
-
}
|
|
6
|
-
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
7
|
-
state: RechargeState;
|
|
8
|
-
} & {
|
|
9
|
-
dispatch: (params: {
|
|
10
|
-
type: string;
|
|
11
|
-
payload: any;
|
|
12
|
-
}) => void;
|
|
13
|
-
}>;
|
|
14
|
-
export {};
|
|
1
|
+
export declare const Provider: any, Context: any;
|