@pisell/private-materials 6.5.9 → 6.5.10
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 +1 -1
- package/build/lowcode/view.js +1 -1
- package/es/components/booking/components/voucher/index.d.ts +3 -0
- package/es/components/booking/components/voucher/index.js +1 -1
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +16 -13
- package/lib/components/booking/components/voucher/index.d.ts +3 -0
- package/lib/components/booking/components/voucher/index.js +1 -1
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +8 -12
- package/package.json +1 -1
@@ -47,7 +47,7 @@ var productListSetting = {
|
|
47
47
|
isStock: 0
|
48
48
|
};
|
49
49
|
var AddSerivce = function AddSerivce(props) {
|
50
|
-
var _context$appHelper, _context$appHelper$ge, _context$appHelper$ut, _context$appHelper$ut2, _context$appHelper$ut3, _state$service, _state$
|
50
|
+
var _context$appHelper, _context$appHelper$ge, _context$appHelper$ut, _context$appHelper$ut2, _context$appHelper$ut3, _state$service, _state$bookingConfig2, _state$client2;
|
51
51
|
var onEdit = props.onEdit,
|
52
52
|
state = props.state,
|
53
53
|
dispatch = props.dispatch,
|
@@ -79,7 +79,7 @@ var AddSerivce = function AddSerivce(props) {
|
|
79
79
|
var lastOperationTimeRef = useRef(0);
|
80
80
|
var isInFastClickMode = function isInFastClickMode() {
|
81
81
|
var now = Date.now();
|
82
|
-
return now - lastOperationTimeRef.current <
|
82
|
+
return now - lastOperationTimeRef.current < 2000;
|
83
83
|
};
|
84
84
|
var getCurrentServiceValue = function getCurrentServiceValue() {
|
85
85
|
if (isInFastClickMode()) {
|
@@ -92,11 +92,13 @@ var AddSerivce = function AddSerivce(props) {
|
|
92
92
|
return stateValue;
|
93
93
|
}
|
94
94
|
};
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
}
|
95
|
+
|
96
|
+
// useEffect(() => {
|
97
|
+
// if (!isInFastClickMode()) {
|
98
|
+
// latestServiceValueRef.current = null;
|
99
|
+
// }
|
100
|
+
// }, [state?.service?.value]);
|
101
|
+
|
100
102
|
var _useProducts = useProducts(),
|
101
103
|
getProducts = _useProducts.getProducts,
|
102
104
|
products = _useProducts.products,
|
@@ -300,8 +302,8 @@ var AddSerivce = function AddSerivce(props) {
|
|
300
302
|
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'select';
|
301
303
|
console.log('handleSelectProduct');
|
302
304
|
if (!isNormalProductByDurationSchedule(item)) {
|
303
|
-
var _state$
|
304
|
-
if (!Array.isArray((_state$
|
305
|
+
var _state$service3;
|
306
|
+
if (!Array.isArray((_state$service3 = state.service) === null || _state$service3 === void 0 ? void 0 : _state$service3.resourcesOrigin) || !state.service.resourcesOrigin.length) {
|
305
307
|
dispatch({
|
306
308
|
type: 'setService',
|
307
309
|
payload: _objectSpread(_objectSpread({}, stateRef.current.service), {}, {
|
@@ -339,7 +341,7 @@ var AddSerivce = function AddSerivce(props) {
|
|
339
341
|
}
|
340
342
|
var callback = /*#__PURE__*/function () {
|
341
343
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(e, extension_type, detail, notShowToast) {
|
342
|
-
var data, _currentItem, _detail, other, cacheItem, _total, _isEdit, _state$service$cacheI, _addService2, _list, quantity, _context$appHelper$ut4, _context$appHelper$ut5,
|
344
|
+
var data, _currentItem, _detail, other, cacheItem, _total, _isEdit, _state$service$cacheI, val, _addService2, _list, quantity, _context$appHelper$ut4, _context$appHelper$ut5, _val, sendData, _window$openBookingEd, _window;
|
343
345
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
344
346
|
while (1) switch (_context.prev = _context.next) {
|
345
347
|
case 0:
|
@@ -415,7 +417,8 @@ var AddSerivce = function AddSerivce(props) {
|
|
415
417
|
if (cacheItem.autoClose) {
|
416
418
|
cacheItem.autoClose = false;
|
417
419
|
cacheItem._serviceKey = genServiceKey(cacheItem);
|
418
|
-
|
420
|
+
val = getCurrentServiceValue();
|
421
|
+
_addService2 = addService(_toConsumableArray(val), cacheItem, state), _list = _addService2.list, quantity = _addService2.quantity; // 更新ref以确保后续快速操作时使用最新值
|
419
422
|
latestServiceValueRef.current = _list;
|
420
423
|
lastOperationTimeRef.current = Date.now();
|
421
424
|
if (!notShowToast) {
|
@@ -428,7 +431,7 @@ var AddSerivce = function AddSerivce(props) {
|
|
428
431
|
}));
|
429
432
|
try {
|
430
433
|
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) {
|
431
|
-
|
434
|
+
_val = _list === null || _list === void 0 ? void 0 : _list.map(function (s) {
|
432
435
|
return {
|
433
436
|
product_id: s === null || s === void 0 ? void 0 : s.product_id,
|
434
437
|
detailId: s === null || s === void 0 ? void 0 : s.id,
|
@@ -446,7 +449,7 @@ var AddSerivce = function AddSerivce(props) {
|
|
446
449
|
detailProductId: _detail === null || _detail === void 0 ? void 0 : _detail.product_id,
|
447
450
|
product_name: _currentItem === null || _currentItem === void 0 ? void 0 : _currentItem.title,
|
448
451
|
price: _detail === null || _detail === void 0 ? void 0 : _detail.price,
|
449
|
-
serviceVal:
|
452
|
+
serviceVal: _val
|
450
453
|
};
|
451
454
|
sendWarningLog({
|
452
455
|
title: 'addService',
|
@@ -62,7 +62,7 @@ var productListSetting = {
|
|
62
62
|
isStock: 0
|
63
63
|
};
|
64
64
|
var AddSerivce = (props) => {
|
65
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m
|
65
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
|
66
66
|
const { onEdit, state, dispatch, renderMode = "current", onPrerenderComplete } = props;
|
67
67
|
const context = (0, import_useEngineContext.default)();
|
68
68
|
const notAvailableRef = (0, import_react.useRef)(null);
|
@@ -88,7 +88,7 @@ var AddSerivce = (props) => {
|
|
88
88
|
const lastOperationTimeRef = (0, import_react.useRef)(0);
|
89
89
|
const isInFastClickMode = () => {
|
90
90
|
const now = Date.now();
|
91
|
-
return now - lastOperationTimeRef.current <
|
91
|
+
return now - lastOperationTimeRef.current < 2e3;
|
92
92
|
};
|
93
93
|
const getCurrentServiceValue = () => {
|
94
94
|
var _a2, _b2, _c2;
|
@@ -100,11 +100,6 @@ var AddSerivce = (props) => {
|
|
100
100
|
return stateValue;
|
101
101
|
}
|
102
102
|
};
|
103
|
-
(0, import_react.useEffect)(() => {
|
104
|
-
if (!isInFastClickMode()) {
|
105
|
-
latestServiceValueRef.current = null;
|
106
|
-
}
|
107
|
-
}, [(_k = state == null ? void 0 : state.service) == null ? void 0 : _k.value]);
|
108
103
|
const { getProducts, products, loading } = (0, import_pisellos.useProducts)();
|
109
104
|
(0, import_react.useEffect)(() => {
|
110
105
|
return () => {
|
@@ -139,11 +134,11 @@ var AddSerivce = (props) => {
|
|
139
134
|
const menuList = (0, import_react.useMemo)(() => {
|
140
135
|
var _a2, _b2, _c2;
|
141
136
|
return ((_c2 = (_b2 = (_a2 = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _a2.config) == null ? void 0 : _b2.menu_list_tab) == null ? void 0 : _c2.menu_list) || [];
|
142
|
-
}, [(
|
137
|
+
}, [(_k = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _k.config]);
|
143
138
|
const customerId = (0, import_react.useMemo)(() => {
|
144
139
|
var _a2, _b2;
|
145
140
|
return ((_b2 = (_a2 = state.client) == null ? void 0 : _a2.value) == null ? void 0 : _b2.id) || void 0;
|
146
|
-
}, [(
|
141
|
+
}, [(_m = (_l = state.client) == null ? void 0 : _l.value) == null ? void 0 : _m.id]);
|
147
142
|
const scanAddService = (0, import_ahooks.useMemoizedFn)((list, code) => {
|
148
143
|
let newService = [...state.service.value];
|
149
144
|
list.forEach((item) => {
|
@@ -300,8 +295,9 @@ var AddSerivce = (props) => {
|
|
300
295
|
if (cacheItem.autoClose) {
|
301
296
|
cacheItem.autoClose = false;
|
302
297
|
cacheItem._serviceKey = (0, import_utils6.genServiceKey)(cacheItem);
|
298
|
+
const val = getCurrentServiceValue();
|
303
299
|
let { list: _list, quantity } = (0, import_utils6.addService)(
|
304
|
-
[...
|
300
|
+
[...val],
|
305
301
|
cacheItem,
|
306
302
|
state
|
307
303
|
);
|
@@ -319,7 +315,7 @@ var AddSerivce = (props) => {
|
|
319
315
|
);
|
320
316
|
try {
|
321
317
|
if (((_f2 = (_e2 = (_d3 = (_c3 = (_b3 = context.appHelper.utils.store) == null ? void 0 : _b3.getState) == null ? void 0 : _c3.call(_b3)) == null ? void 0 : _d3.global) == null ? void 0 : _e2.globalConfig) == null ? void 0 : _f2.id) === 2155) {
|
322
|
-
const
|
318
|
+
const val2 = _list == null ? void 0 : _list.map((s) => {
|
323
319
|
return {
|
324
320
|
product_id: s == null ? void 0 : s.product_id,
|
325
321
|
detailId: s == null ? void 0 : s.id,
|
@@ -337,7 +333,7 @@ var AddSerivce = (props) => {
|
|
337
333
|
detailProductId: _detail == null ? void 0 : _detail.product_id,
|
338
334
|
product_name: _currentItem == null ? void 0 : _currentItem.title,
|
339
335
|
price: _detail == null ? void 0 : _detail.price,
|
340
|
-
serviceVal:
|
336
|
+
serviceVal: val2
|
341
337
|
};
|
342
338
|
(0, import_utils.sendWarningLog)({
|
343
339
|
title: "addService",
|