@pisell/private-materials 3.0.117 → 3.0.119
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 +11 -11
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +10 -10
- package/es/components/booking/addons/index.d.ts +1 -1
- package/es/components/booking/addons/model.d.ts +1 -2
- package/es/components/booking/components/footer/index.js +48 -13
- package/es/components/booking/components/footer/serve.d.ts +1 -0
- package/es/components/booking/components/footer/serve.js +21 -0
- package/es/components/booking/forms/forms.d.ts +1 -1
- package/es/components/booking/forms/index.d.ts +1 -1
- package/es/components/booking/forms/model.d.ts +1 -2
- package/es/components/booking/index.d.ts +1 -1
- package/es/components/booking/info/index.d.ts +1 -1
- package/es/components/booking/info/model.js +9 -7
- package/es/components/booking/info/service/addService/index.d.ts +3 -1
- package/es/components/booking/info/service/addService/index.js +11 -7
- package/es/components/booking/info/service/editService/index.d.ts +5 -2
- package/es/components/booking/info/service/editService/index.js +152 -65
- package/es/components/booking/info/service/editService/index.less +15 -5
- package/es/components/booking/info/service/index.js +15 -2
- package/es/components/booking/info/service/serviceList/index.d.ts +5 -3
- package/es/components/booking/info/service/serviceList/index.js +15 -11
- package/es/components/booking/info/utils.js +1 -1
- package/es/components/booking/locales.d.ts +21 -0
- package/es/components/booking/locales.js +55 -3
- package/es/components/booking/model.d.ts +4 -3
- package/es/components/booking/model.js +9 -9
- package/es/components/booking/notes/index.d.ts +1 -1
- package/es/components/booking/notes/model.d.ts +1 -2
- package/es/components/booking/payments/index.d.ts +1 -1
- package/es/components/booking/payments/model.d.ts +1 -2
- package/es/components/schedules/index.d.ts +1 -1
- package/es/components/schedules/model.d.ts +1 -2
- package/lib/components/booking/addons/index.d.ts +1 -1
- package/lib/components/booking/addons/model.d.ts +1 -2
- package/lib/components/booking/components/footer/index.js +23 -0
- package/lib/components/booking/components/footer/serve.d.ts +1 -0
- package/lib/components/booking/components/footer/serve.js +30 -0
- package/lib/components/booking/forms/forms.d.ts +1 -1
- package/lib/components/booking/forms/index.d.ts +1 -1
- package/lib/components/booking/forms/model.d.ts +1 -2
- package/lib/components/booking/index.d.ts +1 -1
- package/lib/components/booking/info/index.d.ts +1 -1
- package/lib/components/booking/info/model.js +9 -7
- package/lib/components/booking/info/service/addService/index.d.ts +3 -1
- package/lib/components/booking/info/service/addService/index.js +6 -3
- package/lib/components/booking/info/service/editService/index.d.ts +5 -2
- package/lib/components/booking/info/service/editService/index.js +104 -61
- package/lib/components/booking/info/service/editService/index.less +15 -5
- package/lib/components/booking/info/service/index.js +8 -1
- package/lib/components/booking/info/service/serviceList/index.d.ts +5 -3
- package/lib/components/booking/info/service/serviceList/index.js +2 -1
- package/lib/components/booking/info/utils.js +1 -1
- package/lib/components/booking/locales.d.ts +21 -0
- package/lib/components/booking/locales.js +68 -3
- package/lib/components/booking/model.d.ts +4 -3
- package/lib/components/booking/notes/index.d.ts +1 -1
- package/lib/components/booking/notes/model.d.ts +1 -2
- package/lib/components/booking/payments/index.d.ts +1 -1
- package/lib/components/booking/payments/model.d.ts +1 -2
- package/lib/components/schedules/index.d.ts +1 -1
- package/lib/components/schedules/model.d.ts +1 -2
- package/package.json +4 -4
|
@@ -18,7 +18,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
18
18
|
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; }
|
|
19
19
|
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
20
20
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
21
|
-
import React, { useCallback, useContext, useEffect, useMemo, useState } from 'react';
|
|
21
|
+
import React, { useCallback, useContext, useEffect, useMemo, useState, useImperativeHandle, forwardRef } from 'react';
|
|
22
22
|
import Delete_wght300_24px from '@pisell/icon/es/Delete_wght300_24px';
|
|
23
23
|
import Drawer from "../../../components/drawer";
|
|
24
24
|
import { Context } from "../../model";
|
|
@@ -30,13 +30,13 @@ import CollapsibleList from "../../../components/collapsibleList";
|
|
|
30
30
|
import { renderBundles } from "../../../components/collapsibleList/utils";
|
|
31
31
|
import { useUpdateEffect, useMemoizedFn } from 'ahooks';
|
|
32
32
|
// import SelectTime from "../../../../../../../materials/src/components/select-time";
|
|
33
|
-
import { getErrorList, getServiceTimes, deleteCacheParams } from "../../../utils";
|
|
33
|
+
import { getErrorList, getServiceTimes, deleteCacheParams, getProductTotalPrice } from "../../../utils";
|
|
34
34
|
import Like from "../like";
|
|
35
35
|
import { getNoResource } from "../../../mock";
|
|
36
36
|
import { formatResources, getDurationProps, getFlexibleOption, getTimeObj } from "../addService/utils";
|
|
37
37
|
var submitLock = false;
|
|
38
|
-
var Info = function Info() {
|
|
39
|
-
var _state$bookingConfig2, _state$bookingConfig3, _state$bookingConfig4, _state$service$
|
|
38
|
+
var Info = function Info(_, ref) {
|
|
39
|
+
var _state$bookingConfig2, _state$bookingConfig3, _state$bookingConfig4, _state$service$cacheI4, _state$service$cacheI5, _state$service$cacheI7, _state$service$cacheI8, _state$service$cacheI9, _state$service3, _state$service3$cache, _state$service5, _state$service5$cache, _state$service5$cache2, _state$service5$cache3, _window$BaseMaterials, _state$service$cacheI10, _state$service6, _state$service6$cache, _state$service6$cache2, _state$service$cacheI11, _state$service$cacheI12, _state$service$cacheI13, _state$service$cacheI14, _state$bookingConfig5, _state$bookingConfig6, _state$bookingConfig7, _state$bookingConfig8;
|
|
40
40
|
var _Form$useForm = Form.useForm(),
|
|
41
41
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
42
42
|
form = _Form$useForm2[0];
|
|
@@ -59,12 +59,12 @@ var Info = function Info() {
|
|
|
59
59
|
setSelectOpen = _useState4[1];
|
|
60
60
|
|
|
61
61
|
// 当前商品信息+ 表单信息
|
|
62
|
-
var getCurrentCacheItem = function getCurrentCacheItem() {
|
|
62
|
+
var getCurrentCacheItem = function getCurrentCacheItem(_cacheItem) {
|
|
63
63
|
// 获取当前表单数据
|
|
64
64
|
var values = form.getFieldsValue();
|
|
65
|
-
var
|
|
66
|
-
return _objectSpread(_objectSpread({},
|
|
67
|
-
_extend: _objectSpread(_objectSpread({},
|
|
65
|
+
var _item = _cacheItem || state.service.cacheItem;
|
|
66
|
+
return _objectSpread(_objectSpread({}, _item), {}, {
|
|
67
|
+
_extend: _objectSpread(_objectSpread({}, _item === null || _item === void 0 ? void 0 : _item._extend), values)
|
|
68
68
|
});
|
|
69
69
|
};
|
|
70
70
|
|
|
@@ -156,7 +156,7 @@ var Info = function Info() {
|
|
|
156
156
|
*/
|
|
157
157
|
var getResources = /*#__PURE__*/function () {
|
|
158
158
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(cacheItem) {
|
|
159
|
-
var
|
|
159
|
+
var _list, _cacheItem, autoClose;
|
|
160
160
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
161
161
|
while (1) switch (_context.prev = _context.next) {
|
|
162
162
|
case 0:
|
|
@@ -164,8 +164,8 @@ var Info = function Info() {
|
|
|
164
164
|
_context.prev = 1;
|
|
165
165
|
// 合并无资源
|
|
166
166
|
_list = state.service.resourcesOrigin || [];
|
|
167
|
-
autoClose = (_state$service$cacheI = state.service.cacheItem) === null || _state$service$cacheI === void 0 ? void 0 : _state$service$cacheI.autoClose;
|
|
168
167
|
_cacheItem = cacheItem || getCurrentCacheItem();
|
|
168
|
+
autoClose = _cacheItem === null || _cacheItem === void 0 ? void 0 : _cacheItem.autoClose;
|
|
169
169
|
if (_cacheItem._extend) {
|
|
170
170
|
_context.next = 7;
|
|
171
171
|
break;
|
|
@@ -219,12 +219,12 @@ var Info = function Info() {
|
|
|
219
219
|
* @Date: 2024-01-09 13:59
|
|
220
220
|
*/
|
|
221
221
|
var handleDeleteProduct = function handleDeleteProduct() {
|
|
222
|
-
var _state$service$
|
|
222
|
+
var _state$service$cacheI;
|
|
223
223
|
if (state.channelDisabledEdit) {
|
|
224
224
|
return;
|
|
225
225
|
}
|
|
226
226
|
var _list = _toConsumableArray(state.service.value);
|
|
227
|
-
var _id = (_state$service$
|
|
227
|
+
var _id = (_state$service$cacheI = state.service.cacheItem) === null || _state$service$cacheI === void 0 ? void 0 : _state$service$cacheI._id;
|
|
228
228
|
_list = _list.filter(function (d) {
|
|
229
229
|
return d._id !== _id;
|
|
230
230
|
});
|
|
@@ -305,8 +305,9 @@ var Info = function Info() {
|
|
|
305
305
|
* @Date: 2024-01-09 14:03
|
|
306
306
|
*/
|
|
307
307
|
var getDiscount = function getDiscount() {
|
|
308
|
-
var _state$service$
|
|
309
|
-
|
|
308
|
+
var _state$service$cacheI2;
|
|
309
|
+
console.log('折扣内', state.service.cacheItem);
|
|
310
|
+
var oPrice = Number(((_state$service$cacheI2 = state.service.cacheItem) === null || _state$service$cacheI2 === void 0 ? void 0 : _state$service$cacheI2._extend.origin_total) || 0);
|
|
310
311
|
var cPrice = Number(useTotal || 0);
|
|
311
312
|
var discount = '';
|
|
312
313
|
// 原价 = 现价 为无折扣
|
|
@@ -395,22 +396,18 @@ var Info = function Info() {
|
|
|
395
396
|
addModal: false,
|
|
396
397
|
value: _list,
|
|
397
398
|
edit: true,
|
|
398
|
-
cacheItem: null
|
|
399
|
+
cacheItem: null,
|
|
400
|
+
changeService: false
|
|
399
401
|
}
|
|
400
402
|
});
|
|
401
403
|
};
|
|
402
|
-
var setEditData = useMemoizedFn(function () {
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
getResources();
|
|
410
|
-
}
|
|
411
|
-
} else {
|
|
412
|
-
setSelectOpen(undefined);
|
|
413
|
-
form.resetFields();
|
|
404
|
+
var setEditData = useMemoizedFn(function (_cacheItem) {
|
|
405
|
+
var cacheItem = _cacheItem || state.service.cacheItem;
|
|
406
|
+
var values = cacheItem._extend;
|
|
407
|
+
form.setFieldsValue(values);
|
|
408
|
+
if (state.renderType !== 'eventBooking') {
|
|
409
|
+
// 获取资源列表
|
|
410
|
+
getResources(_cacheItem);
|
|
414
411
|
}
|
|
415
412
|
});
|
|
416
413
|
|
|
@@ -423,12 +420,12 @@ var Info = function Info() {
|
|
|
423
420
|
* @Date: 2024-01-09 14:06
|
|
424
421
|
*/
|
|
425
422
|
var isReason = useMemo(function () {
|
|
426
|
-
var _state$service$
|
|
427
|
-
var oPrice = Number(((_state$service$
|
|
423
|
+
var _state$service$cacheI3;
|
|
424
|
+
var oPrice = Number(((_state$service$cacheI3 = state.service.cacheItem) === null || _state$service$cacheI3 === void 0 ? void 0 : _state$service$cacheI3._extend.origin_total) || 0);
|
|
428
425
|
var cPrice = Number(useTotal || 0);
|
|
429
426
|
// 原价 !== 现价
|
|
430
427
|
return cPrice !== oPrice;
|
|
431
|
-
}, [useTotal, state.service.cacheItem]);
|
|
428
|
+
}, [useTotal, (_state$service$cacheI4 = state.service.cacheItem) === null || _state$service$cacheI4 === void 0 ? void 0 : (_state$service$cacheI5 = _state$service$cacheI4._extend) === null || _state$service$cacheI5 === void 0 ? void 0 : _state$service$cacheI5.origin_total]);
|
|
432
429
|
|
|
433
430
|
/**
|
|
434
431
|
* @title: 错误信息列表
|
|
@@ -450,25 +447,22 @@ var Info = function Info() {
|
|
|
450
447
|
* @Date: 2024-01-09 14:07
|
|
451
448
|
*/
|
|
452
449
|
useUpdateEffect(function () {
|
|
453
|
-
var _state$service$
|
|
450
|
+
var _state$service$cacheI6;
|
|
454
451
|
// autoClose 不执行下面逻辑
|
|
455
|
-
if (state.service.cacheItem && !((_state$service$
|
|
452
|
+
if (state.service.cacheItem && !((_state$service$cacheI6 = state.service.cacheItem) !== null && _state$service$cacheI6 !== void 0 && _state$service$cacheI6.autoClose)) {
|
|
456
453
|
if (useStartTime && useDuration && state.renderType !== 'eventBooking') {
|
|
457
454
|
getResources();
|
|
458
455
|
}
|
|
459
456
|
}
|
|
460
|
-
}, [useStartTime, useDuration, state.renderType, state.service.resourcesOrigin, (_state$service$
|
|
461
|
-
|
|
462
|
-
/**
|
|
463
|
-
* @title: 打开弹窗时 设置数据
|
|
464
|
-
* @description:
|
|
465
|
-
* @return {*}
|
|
466
|
-
* @Author: zhiwei.Wang
|
|
467
|
-
* @Date: 2024-01-09 14:07
|
|
468
|
-
*/
|
|
457
|
+
}, [useStartTime, useDuration, state.renderType, state.service.resourcesOrigin, (_state$service$cacheI7 = state.service.cacheItem) === null || _state$service$cacheI7 === void 0 ? void 0 : _state$service$cacheI7.autoClose]);
|
|
469
458
|
useEffect(function () {
|
|
470
|
-
|
|
471
|
-
|
|
459
|
+
// if (!state.service.editModal) {
|
|
460
|
+
// setTimeout(() => {
|
|
461
|
+
// setSelectOpen(undefined);
|
|
462
|
+
// form.resetFields();
|
|
463
|
+
// }, 200);
|
|
464
|
+
// }
|
|
465
|
+
}, [state.service.editModal]);
|
|
472
466
|
|
|
473
467
|
/**
|
|
474
468
|
* @title: 资源 时间 发生变化时, 重新计算错误信息
|
|
@@ -490,7 +484,7 @@ var Info = function Info() {
|
|
|
490
484
|
*/
|
|
491
485
|
useEffect(function () {
|
|
492
486
|
getDiscount();
|
|
493
|
-
}, [useTotal, state.service.cacheItem]);
|
|
487
|
+
}, [useTotal, (_state$service$cacheI8 = state.service.cacheItem) === null || _state$service$cacheI8 === void 0 ? void 0 : (_state$service$cacheI9 = _state$service$cacheI8._extend) === null || _state$service$cacheI9 === void 0 ? void 0 : _state$service$cacheI9.origin_total]);
|
|
494
488
|
|
|
495
489
|
// useEffect(() => {
|
|
496
490
|
// handleLikeResource("common");
|
|
@@ -568,18 +562,117 @@ var Info = function Info() {
|
|
|
568
562
|
useEffect(function () {
|
|
569
563
|
getResourcesData();
|
|
570
564
|
}, [state.date.value]);
|
|
565
|
+
|
|
566
|
+
/**
|
|
567
|
+
* @title: 编辑商品
|
|
568
|
+
* @description:
|
|
569
|
+
* @param {any} e
|
|
570
|
+
* @return {*}
|
|
571
|
+
* @Author: zhiwei.Wang
|
|
572
|
+
* @Date: 2024-08-28 17:08
|
|
573
|
+
*/
|
|
574
|
+
var handleEdit = function handleEdit(e) {
|
|
575
|
+
// 当前商品
|
|
576
|
+
var item = state.service.cacheItem;
|
|
577
|
+
|
|
578
|
+
// 表单数据
|
|
579
|
+
var values = form.getFieldsValue();
|
|
580
|
+
|
|
581
|
+
// 打开商品详情弹窗
|
|
582
|
+
state.action({
|
|
583
|
+
type: 'pisell1.handleOpenProductModal',
|
|
584
|
+
data: {
|
|
585
|
+
id: item.id,
|
|
586
|
+
date: state.date.value.format('YYYY-MM-DD'),
|
|
587
|
+
showConfig: {
|
|
588
|
+
option: false,
|
|
589
|
+
session: false,
|
|
590
|
+
variant: false,
|
|
591
|
+
package: true
|
|
592
|
+
},
|
|
593
|
+
value: item._extend.other
|
|
594
|
+
},
|
|
595
|
+
callback: function callback(e) {
|
|
596
|
+
// 重新生成商品
|
|
597
|
+
var cacheItem = _objectSpread(_objectSpread({}, item), {}, {
|
|
598
|
+
product_id: item.id,
|
|
599
|
+
_id: item === null || item === void 0 ? void 0 : item._id,
|
|
600
|
+
_key: e.key,
|
|
601
|
+
_extend: _objectSpread(_objectSpread(_objectSpread({}, item._extend), values), {}, {
|
|
602
|
+
// 覆盖选择的规格和套餐
|
|
603
|
+
other: JSON.parse(JSON.stringify(e))
|
|
604
|
+
}),
|
|
605
|
+
new: 0
|
|
606
|
+
});
|
|
607
|
+
|
|
608
|
+
// 获取商品总价
|
|
609
|
+
var _total = getProductTotalPrice(cacheItem);
|
|
610
|
+
|
|
611
|
+
// 用于折扣 可修改
|
|
612
|
+
cacheItem._extend.total = _total;
|
|
613
|
+
|
|
614
|
+
// 用于储存原价
|
|
615
|
+
cacheItem._extend.origin_total = _total;
|
|
616
|
+
|
|
617
|
+
// 覆盖商品
|
|
618
|
+
dispatch({
|
|
619
|
+
type: 'setService',
|
|
620
|
+
payload: {
|
|
621
|
+
cacheItem: cacheItem
|
|
622
|
+
}
|
|
623
|
+
});
|
|
624
|
+
|
|
625
|
+
// 更新表单内的商品价格
|
|
626
|
+
form.setFieldsValue({
|
|
627
|
+
total: _total
|
|
628
|
+
});
|
|
629
|
+
}
|
|
630
|
+
});
|
|
631
|
+
};
|
|
632
|
+
|
|
633
|
+
/**
|
|
634
|
+
* @title: 更换商品
|
|
635
|
+
* @description:
|
|
636
|
+
* @param {any} e
|
|
637
|
+
* @return {*}
|
|
638
|
+
* @Author: zhiwei.Wang
|
|
639
|
+
* @Date: 2024-08-28 17:10
|
|
640
|
+
*/
|
|
641
|
+
var handleChange = function handleChange(e) {
|
|
642
|
+
if (state.channelDisabledEdit) {
|
|
643
|
+
return;
|
|
644
|
+
}
|
|
645
|
+
dispatch({
|
|
646
|
+
type: 'setService',
|
|
647
|
+
payload: {
|
|
648
|
+
addModal: true,
|
|
649
|
+
editModal: true,
|
|
650
|
+
//用于控制 添加商品 和 编辑服务弹窗的上下层级
|
|
651
|
+
changeService: true
|
|
652
|
+
}
|
|
653
|
+
});
|
|
654
|
+
};
|
|
655
|
+
useImperativeHandle(ref, function () {
|
|
656
|
+
return {
|
|
657
|
+
init: setEditData
|
|
658
|
+
};
|
|
659
|
+
});
|
|
660
|
+
console.log('state.service.value', state.service.value);
|
|
571
661
|
var SelectTime = (_window$BaseMaterials = window.BaseMaterials) === null || _window$BaseMaterials === void 0 ? void 0 : _window$BaseMaterials.SelectTime;
|
|
572
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Drawer
|
|
573
|
-
|
|
662
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Drawer
|
|
663
|
+
//通过zIndex的方式控制 添加商品 和 编辑服务弹窗的上下层级
|
|
664
|
+
, {
|
|
665
|
+
zIndex: state.service.changeService ? 999 : 1000,
|
|
574
666
|
forceRender: true,
|
|
575
|
-
open: state.service.editModal && !((_state$service$
|
|
667
|
+
open: state.service.editModal && !((_state$service$cacheI10 = state.service.cacheItem) !== null && _state$service$cacheI10 !== void 0 && _state$service$cacheI10.autoClose),
|
|
576
668
|
title: locales.getText('pisell2.text.edit-service'),
|
|
577
669
|
onClose: function onClose() {
|
|
578
670
|
dispatch({
|
|
579
671
|
type: 'setService',
|
|
580
672
|
payload: {
|
|
581
673
|
editModal: false,
|
|
582
|
-
cacheItem: null
|
|
674
|
+
cacheItem: null,
|
|
675
|
+
changeService: false
|
|
583
676
|
}
|
|
584
677
|
});
|
|
585
678
|
}
|
|
@@ -599,22 +692,16 @@ var Info = function Info() {
|
|
|
599
692
|
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
600
693
|
name: "product_name"
|
|
601
694
|
}, /*#__PURE__*/React.createElement("div", {
|
|
602
|
-
className: "current-service-info"
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
return;
|
|
606
|
-
}
|
|
607
|
-
dispatch({
|
|
608
|
-
type: 'setService',
|
|
609
|
-
payload: {
|
|
610
|
-
addModal: true,
|
|
611
|
-
editModal: false
|
|
612
|
-
}
|
|
613
|
-
});
|
|
614
|
-
}
|
|
695
|
+
className: "current-service-info"
|
|
696
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
697
|
+
className: "current-service-info-name-wrap"
|
|
615
698
|
}, /*#__PURE__*/React.createElement("div", {
|
|
616
699
|
className: "current-service-info-name"
|
|
617
|
-
}, ((_state$service6 = state.service) === null || _state$service6 === void 0 ? void 0 : (_state$service6$cache = _state$service6.cacheItem) === null || _state$service6$cache === void 0 ? void 0 : (_state$service6$cache2 = _state$service6$cache._extend) === null || _state$service6$cache2 === void 0 ? void 0 : _state$service6$cache2.product_name) || '-'), /*#__PURE__*/React.createElement(
|
|
700
|
+
}, ((_state$service6 = state.service) === null || _state$service6 === void 0 ? void 0 : (_state$service6$cache = _state$service6.cacheItem) === null || _state$service6$cache === void 0 ? void 0 : (_state$service6$cache2 = _state$service6$cache._extend) === null || _state$service6$cache2 === void 0 ? void 0 : _state$service6$cache2.product_name) || '-'), /*#__PURE__*/React.createElement(Button, {
|
|
701
|
+
onClick: handleEdit
|
|
702
|
+
}, locales.getText('pisell2.text.edit')), /*#__PURE__*/React.createElement(Button, {
|
|
703
|
+
onClick: handleChange
|
|
704
|
+
}, locales.getText('pisell2.text.change'))), /*#__PURE__*/React.createElement(CollapsibleList, {
|
|
618
705
|
style: {
|
|
619
706
|
marginTop: bundles.length ? '8px' : 0
|
|
620
707
|
},
|
|
@@ -639,8 +726,8 @@ var Info = function Info() {
|
|
|
639
726
|
width: '100%'
|
|
640
727
|
},
|
|
641
728
|
min: 0,
|
|
642
|
-
max: ((_state$service$
|
|
643
|
-
placeholder: ((_state$service$
|
|
729
|
+
max: ((_state$service$cacheI11 = state.service.cacheItem) === null || _state$service$cacheI11 === void 0 ? void 0 : (_state$service$cacheI12 = _state$service$cacheI11._extend) === null || _state$service$cacheI12 === void 0 ? void 0 : _state$service$cacheI12.origin_total) || 0,
|
|
730
|
+
placeholder: ((_state$service$cacheI13 = state.service.cacheItem) === null || _state$service$cacheI13 === void 0 ? void 0 : (_state$service$cacheI14 = _state$service$cacheI13._extend) === null || _state$service$cacheI14 === void 0 ? void 0 : _state$service$cacheI14.origin_total) || '0'
|
|
644
731
|
}))), /*#__PURE__*/React.createElement(Col, {
|
|
645
732
|
span: 12
|
|
646
733
|
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
@@ -759,4 +846,4 @@ var Info = function Info() {
|
|
|
759
846
|
}
|
|
760
847
|
}, locales.getText('pisell2.text.apply'))))));
|
|
761
848
|
};
|
|
762
|
-
export default Info;
|
|
849
|
+
export default /*#__PURE__*/forwardRef(Info);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
.pisell-lowcode__booking-service-body-edit {
|
|
2
|
-
padding: 24px 32px;
|
|
2
|
+
padding: 24px 32px 100px !important;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
align-items: center;
|
|
15
15
|
justify-content: center;
|
|
16
16
|
gap: 12px;
|
|
17
|
+
background-color: #fff;
|
|
17
18
|
|
|
18
19
|
.pisell-lowcode__booking-service-delete-wrap {
|
|
19
20
|
height: 48px;
|
|
@@ -96,10 +97,19 @@
|
|
|
96
97
|
overflow: hidden;
|
|
97
98
|
padding: 11px;
|
|
98
99
|
|
|
99
|
-
.current-service-info-name {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
100
|
+
.current-service-info-name-wrap {
|
|
101
|
+
display: flex;
|
|
102
|
+
align-items: center;
|
|
103
|
+
gap: 12px;
|
|
104
|
+
|
|
105
|
+
.current-service-info-name {
|
|
106
|
+
font-size: 16px;
|
|
107
|
+
color: #101828;
|
|
108
|
+
font-weight: 650;
|
|
109
|
+
flex: 1;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.current-service-info-change-btn {}
|
|
103
113
|
}
|
|
104
114
|
|
|
105
115
|
&:hover {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useEffect, useContext, useMemo } from 'react';
|
|
1
|
+
import React, { useEffect, useContext, useMemo, useRef } from 'react';
|
|
2
2
|
import AddService from "./addService";
|
|
3
3
|
import { Context } from "../model";
|
|
4
4
|
import EditService from "./editService";
|
|
@@ -9,6 +9,7 @@ var Service = function Service() {
|
|
|
9
9
|
var _state$bookingConfig2, _state$bookingConfig3;
|
|
10
10
|
var _useContext = useContext(Context),
|
|
11
11
|
state = _useContext.state;
|
|
12
|
+
var detailRef = useRef();
|
|
12
13
|
useEffect(function () {
|
|
13
14
|
document.body.id = 'body';
|
|
14
15
|
}, []);
|
|
@@ -35,8 +36,20 @@ var Service = function Service() {
|
|
|
35
36
|
}
|
|
36
37
|
return true;
|
|
37
38
|
}, [state, appointment_card.quick_time]);
|
|
39
|
+
var handleEdit = function handleEdit(cacheItem) {
|
|
40
|
+
setTimeout(function () {
|
|
41
|
+
var _detailRef$current, _detailRef$current$in;
|
|
42
|
+
(_detailRef$current = detailRef.current) === null || _detailRef$current === void 0 ? void 0 : (_detailRef$current$in = _detailRef$current.init) === null || _detailRef$current$in === void 0 ? void 0 : _detailRef$current$in.call(_detailRef$current, cacheItem);
|
|
43
|
+
}, 100);
|
|
44
|
+
};
|
|
38
45
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
39
46
|
className: "pisell-lowcode__booking-service-wrap"
|
|
40
|
-
}, /*#__PURE__*/React.createElement(ServiceList,
|
|
47
|
+
}, /*#__PURE__*/React.createElement(ServiceList, {
|
|
48
|
+
onEdit: handleEdit
|
|
49
|
+
}), /*#__PURE__*/React.createElement(AddService, {
|
|
50
|
+
onEdit: handleEdit
|
|
51
|
+
})), /*#__PURE__*/React.createElement(EditService, {
|
|
52
|
+
ref: detailRef
|
|
53
|
+
}), showAddTimeModal && /*#__PURE__*/React.createElement(AddTimeModal, null));
|
|
41
54
|
};
|
|
42
55
|
export default Service;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import
|
|
3
|
-
declare const ServiceList: (
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
declare const ServiceList: ({ onEdit }: {
|
|
4
|
+
onEdit: any;
|
|
5
|
+
}) => React.JSX.Element;
|
|
4
6
|
export default ServiceList;
|
|
@@ -10,28 +10,29 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
10
10
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
11
11
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
12
12
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
13
|
-
import React, { useCallback, useContext } from
|
|
14
|
-
import { locales } from
|
|
13
|
+
import React, { useCallback, useContext } from 'react';
|
|
14
|
+
import { locales } from '@pisell/utils';
|
|
15
15
|
import "./index.less";
|
|
16
16
|
import { Context } from "../../model";
|
|
17
17
|
import { getNoResource } from "../../../mock";
|
|
18
18
|
import { getErrorList } from "../../../utils";
|
|
19
19
|
import ServiceItem from "../serviceItem";
|
|
20
|
-
var ServiceList = function ServiceList() {
|
|
20
|
+
var ServiceList = function ServiceList(_ref) {
|
|
21
|
+
var onEdit = _ref.onEdit;
|
|
21
22
|
var _useContext = useContext(Context),
|
|
22
23
|
state = _useContext.state,
|
|
23
24
|
dispatch = _useContext.dispatch;
|
|
24
25
|
var errorTypes = {
|
|
25
|
-
product: locales.getText(
|
|
26
|
-
time: locales.getText(
|
|
27
|
-
maxLimit: locales.getText(
|
|
26
|
+
product: locales.getText('pisell2.text.status.service-error-1'),
|
|
27
|
+
time: locales.getText('pisell2.text.status.service-error-2'),
|
|
28
|
+
maxLimit: locales.getText('pisell2.text.status.service-error-3')
|
|
28
29
|
};
|
|
29
30
|
var handleEditService = function handleEditService(item) {
|
|
30
31
|
if (state.disabledEdit || state.disableEventBookingEdit) {
|
|
31
32
|
return;
|
|
32
33
|
}
|
|
33
34
|
dispatch({
|
|
34
|
-
type:
|
|
35
|
+
type: 'setService',
|
|
35
36
|
payload: {
|
|
36
37
|
editModal: true,
|
|
37
38
|
cacheItem: _objectSpread(_objectSpread({}, item), {}, {
|
|
@@ -39,6 +40,9 @@ var ServiceList = function ServiceList() {
|
|
|
39
40
|
})
|
|
40
41
|
}
|
|
41
42
|
});
|
|
43
|
+
onEdit === null || onEdit === void 0 ? void 0 : onEdit(_objectSpread(_objectSpread({}, item), {}, {
|
|
44
|
+
new: 0
|
|
45
|
+
}));
|
|
42
46
|
};
|
|
43
47
|
var getResourceItem = useCallback(function (id) {
|
|
44
48
|
if (id === 0) {
|
|
@@ -50,15 +54,15 @@ var ServiceList = function ServiceList() {
|
|
|
50
54
|
}, [state.service.resources]);
|
|
51
55
|
var getErrorMessage = useCallback(function (service, resourceItem) {
|
|
52
56
|
var errorList = getErrorList(resourceItem, service);
|
|
53
|
-
var errorMessage =
|
|
57
|
+
var errorMessage = '';
|
|
54
58
|
if (!service.id) {
|
|
55
59
|
return errorList[0].label;
|
|
56
60
|
}
|
|
57
61
|
if (errorList.length) {
|
|
58
62
|
if (errorList.length > 1) {
|
|
59
|
-
errorMessage = "".concat(errorList.length, " ").concat(locales.getText(
|
|
63
|
+
errorMessage = "".concat(errorList.length, " ").concat(locales.getText('pisell2.text.warnings'));
|
|
60
64
|
} else {
|
|
61
|
-
errorMessage = (resourceItem === null || resourceItem === void 0 ? void 0 : resourceItem.labelText) +
|
|
65
|
+
errorMessage = (resourceItem === null || resourceItem === void 0 ? void 0 : resourceItem.labelText) + ' ' + errorTypes[errorList[0].type];
|
|
62
66
|
}
|
|
63
67
|
}
|
|
64
68
|
return errorMessage;
|
|
@@ -77,7 +81,7 @@ var ServiceList = function ServiceList() {
|
|
|
77
81
|
}) : d;
|
|
78
82
|
});
|
|
79
83
|
dispatch({
|
|
80
|
-
type:
|
|
84
|
+
type: 'setService',
|
|
81
85
|
payload: {
|
|
82
86
|
value: _list,
|
|
83
87
|
edit: true
|
|
@@ -48,7 +48,7 @@ export var moveItemToFront = function moveItemToFront(arr, targetId) {
|
|
|
48
48
|
*/
|
|
49
49
|
export var isInterval = function isInterval(time1, time2) {
|
|
50
50
|
var interval = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1000;
|
|
51
|
-
return time2 - time1 < interval;
|
|
51
|
+
return Math.abs(time2 - time1) < interval;
|
|
52
52
|
};
|
|
53
53
|
|
|
54
54
|
/**
|
|
@@ -165,6 +165,13 @@ declare const _default: {
|
|
|
165
165
|
"pisell2.text.add-client": string;
|
|
166
166
|
'pisell2.text.variant-client-change': string;
|
|
167
167
|
'pisell2.text.variant-client-no-data': string;
|
|
168
|
+
'page.event.booking.text.duplicate-enrollment': string;
|
|
169
|
+
'page.event.booking.text.duplicate-enrollment-content': ({ customerName, title, list, }: {
|
|
170
|
+
customerName: string;
|
|
171
|
+
title: string;
|
|
172
|
+
list: any[];
|
|
173
|
+
}) => string;
|
|
174
|
+
'page.event.booking.text.duplicate-enrollment-confirm': string;
|
|
168
175
|
};
|
|
169
176
|
'zh-CN': {
|
|
170
177
|
'pisell2.text.refunded-amount': string;
|
|
@@ -332,6 +339,13 @@ declare const _default: {
|
|
|
332
339
|
"pisell2.text.add-client": string;
|
|
333
340
|
'pisell2.text.variant-client-change': string;
|
|
334
341
|
'pisell2.text.variant-client-no-data': string;
|
|
342
|
+
'page.event.booking.text.duplicate-enrollment': string;
|
|
343
|
+
'page.event.booking.text.duplicate-enrollment-content': ({ customerName, title, list, }: {
|
|
344
|
+
customerName: string;
|
|
345
|
+
title: string;
|
|
346
|
+
list: any[];
|
|
347
|
+
}) => string;
|
|
348
|
+
'page.event.booking.text.duplicate-enrollment-confirm': string;
|
|
335
349
|
};
|
|
336
350
|
'zh-HK': {
|
|
337
351
|
'pisell2.text.refunded-amount': string;
|
|
@@ -499,6 +513,13 @@ declare const _default: {
|
|
|
499
513
|
"pisell2.text.add-client": string;
|
|
500
514
|
'pisell2.text.variant-client-change': string;
|
|
501
515
|
'pisell2.text.variant-client-no-data': string;
|
|
516
|
+
'page.event.booking.text.duplicate-enrollment': string;
|
|
517
|
+
'page.event.booking.text.duplicate-enrollment-content': ({ customerName, title, list, }: {
|
|
518
|
+
customerName: string;
|
|
519
|
+
title: string;
|
|
520
|
+
list: any[];
|
|
521
|
+
}) => string;
|
|
522
|
+
'page.event.booking.text.duplicate-enrollment-confirm': string;
|
|
502
523
|
};
|
|
503
524
|
};
|
|
504
525
|
export default _default;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import dayjs from "dayjs";
|
|
1
2
|
export default {
|
|
2
3
|
"en": {
|
|
3
4
|
'pisell2.text.select-addons': "Select addons",
|
|
@@ -179,7 +180,24 @@ export default {
|
|
|
179
180
|
"pisell2.text.actions": "Actions",
|
|
180
181
|
"pisell2.text.add-client": "Add customer",
|
|
181
182
|
'pisell2.text.variant-client-change': 'Change',
|
|
182
|
-
'pisell2.text.variant-client-no-data': "No record"
|
|
183
|
+
'pisell2.text.variant-client-no-data': "No record",
|
|
184
|
+
'page.event.booking.text.duplicate-enrollment': "Duplicate Enrollment",
|
|
185
|
+
'page.event.booking.text.duplicate-enrollment-content': function pageEventBookingTextDuplicateEnrollmentContent(_ref) {
|
|
186
|
+
var customerName = _ref.customerName,
|
|
187
|
+
title = _ref.title,
|
|
188
|
+
list = _ref.list;
|
|
189
|
+
var listStr = list.map(function (item) {
|
|
190
|
+
if (item.registration_type === 'single') {
|
|
191
|
+
return "(".concat(item.start_time, " ").concat(dayjs(item.start_date).format('DD/MM/YYYY'), ")");
|
|
192
|
+
} else if (item.registration_type === 'extra_include') {
|
|
193
|
+
return "(".concat(item.start_time, " ").concat(dayjs(item.start_date).format('DD/MM/YYYY'), " this and all future events)");
|
|
194
|
+
} else if (item.registration_type === 'all') {
|
|
195
|
+
return "(All events)";
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
return "".concat(customerName || '', " has already enrolled in the ").concat(title, " ").concat(listStr.join(','), ", Are you sure you want to enroll again\uFF1F");
|
|
199
|
+
},
|
|
200
|
+
'page.event.booking.text.duplicate-enrollment-confirm': 'Confirm'
|
|
183
201
|
},
|
|
184
202
|
'zh-CN': {
|
|
185
203
|
'pisell2.text.refunded-amount': '已退金额',
|
|
@@ -366,7 +384,24 @@ export default {
|
|
|
366
384
|
"pisell2.text.actions": "操作选项",
|
|
367
385
|
"pisell2.text.add-client": "添加客户",
|
|
368
386
|
'pisell2.text.variant-client-change': '更改客户',
|
|
369
|
-
'pisell2.text.variant-client-no-data': "暂无数据"
|
|
387
|
+
'pisell2.text.variant-client-no-data': "暂无数据",
|
|
388
|
+
'page.event.booking.text.duplicate-enrollment': "重复报名",
|
|
389
|
+
'page.event.booking.text.duplicate-enrollment-content': function pageEventBookingTextDuplicateEnrollmentContent(_ref2) {
|
|
390
|
+
var customerName = _ref2.customerName,
|
|
391
|
+
title = _ref2.title,
|
|
392
|
+
list = _ref2.list;
|
|
393
|
+
var listStr = list.map(function (item) {
|
|
394
|
+
if (item.registration_type === 'single') {
|
|
395
|
+
return "(".concat(item.start_date, " ").concat(item.start_time, ")");
|
|
396
|
+
} else if (item.registration_type === 'extra_include') {
|
|
397
|
+
return "(".concat(item.start_date, " ").concat(item.start_time, " \u6B64\u6B21\u53CA\u540E\u7EED\u6D3B\u52A8)");
|
|
398
|
+
} else if (item.registration_type === 'all') {
|
|
399
|
+
return "(\u6240\u6709\u6D3B\u52A8)";
|
|
400
|
+
}
|
|
401
|
+
});
|
|
402
|
+
return "".concat(customerName || '', "\u5DF2\u62A5\u540D").concat(title, " ").concat(listStr.join(','), ", \u786E\u5B9A\u8981\u518D\u6B21\u62A5\u540D\u5417\uFF1F");
|
|
403
|
+
},
|
|
404
|
+
'page.event.booking.text.duplicate-enrollment-confirm': '确认'
|
|
370
405
|
},
|
|
371
406
|
'zh-HK': {
|
|
372
407
|
'pisell2.text.refunded-amount': '已退金額',
|
|
@@ -553,6 +588,23 @@ export default {
|
|
|
553
588
|
"pisell2.text.actions": "操作選項",
|
|
554
589
|
"pisell2.text.add-client": "添加客戶",
|
|
555
590
|
'pisell2.text.variant-client-change': '更改客戶',
|
|
556
|
-
'pisell2.text.variant-client-no-data': "暫無數據"
|
|
591
|
+
'pisell2.text.variant-client-no-data': "暫無數據",
|
|
592
|
+
'page.event.booking.text.duplicate-enrollment': "重複報名",
|
|
593
|
+
'page.event.booking.text.duplicate-enrollment-content': function pageEventBookingTextDuplicateEnrollmentContent(_ref3) {
|
|
594
|
+
var customerName = _ref3.customerName,
|
|
595
|
+
title = _ref3.title,
|
|
596
|
+
list = _ref3.list;
|
|
597
|
+
var listStr = list.map(function (item) {
|
|
598
|
+
if (item.registration_type === 'single') {
|
|
599
|
+
return "(".concat(item.start_date, " ").concat(item.start_time, ")");
|
|
600
|
+
} else if (item.registration_type === 'extra_include') {
|
|
601
|
+
return "(".concat(item.start_date, " ").concat(item.start_time, " \u6B64\u6B21\u53CA\u5F8C\u7E8C\u6D3B\u52D5)");
|
|
602
|
+
} else if (item.registration_type === 'all') {
|
|
603
|
+
return "(\u6240\u6709\u6D3B\u52D5)";
|
|
604
|
+
}
|
|
605
|
+
});
|
|
606
|
+
return "".concat(customerName || '', "\u5DF2\u5831\u540D").concat(title, " ").concat(listStr.join(','), ", \u78BA\u5B9A\u8981\u518D\u6B21\u5831\u540D\u55CE\uFF1F");
|
|
607
|
+
},
|
|
608
|
+
'page.event.booking.text.duplicate-enrollment-confirm': '確認'
|
|
557
609
|
}
|
|
558
610
|
};
|