@pisell/private-materials 3.3.53 → 3.3.55
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 +7 -7
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +6 -6
- package/es/components/appointmentBooking/components/Resource/index.js +5 -44
- package/es/components/appointmentBooking/hooks.js +177 -218
- package/es/components/appointmentBooking/locales.d.ts +0 -3
- package/es/components/appointmentBooking/locales.js +0 -9
- package/es/components/booking/components/TabProduct/productItem/index.js +2 -14
- package/es/components/booking/components/drawer/index.js +2 -4
- package/es/components/booking/components/voucher/index.js +17 -25
- package/es/components/booking/info/client/index.js +1 -2
- package/es/components/booking/info/pet/index.js +0 -3
- package/es/components/booking/info/service2/utils.js +27 -27
- package/es/components/booking/info2/index.js +3 -3
- package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info2/service/addService/utils.js +2 -5
- package/es/components/booking/info2/service/editService/index.js +0 -1
- package/es/components/eventBooking/components/bookingDetailModal/components/BookingOptions.js +4 -23
- package/es/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +1 -1
- package/es/components/productExtension/fields/SelectProducts/ProductItem/index.js +6 -18
- package/es/components/productSelect/components/TabProduct/index.js +10 -28
- package/es/components/productSelect/components/productGroup/index.js +7 -20
- package/es/components/productSelect/components/productGroup/index.less +1 -14
- package/es/components/productSelect/index.less +2 -1
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +10 -16
- package/es/components/ticketBooking/components/addServiceVariant/index.less +0 -10
- package/es/components/ticketBooking/components/ticketBooking/index.js +1 -3
- package/es/components/ticketBooking/index.js +1 -2
- package/es/components/ticketBooking/locales.d.ts +0 -3
- package/es/components/ticketBooking/locales.js +3 -12
- package/es/components/ticketBooking/utils/index.d.ts +1 -5
- package/es/components/ticketBooking/utils/index.js +3 -35
- package/lib/components/appointmentBooking/components/Resource/index.js +5 -44
- package/lib/components/appointmentBooking/hooks.js +3 -12
- package/lib/components/appointmentBooking/locales.d.ts +0 -3
- package/lib/components/appointmentBooking/locales.js +0 -3
- package/lib/components/booking/components/TabProduct/productItem/index.js +1 -8
- package/lib/components/booking/components/drawer/index.js +2 -2
- package/lib/components/booking/components/voucher/index.js +27 -31
- package/lib/components/booking/info/client/index.js +1 -2
- package/lib/components/booking/info/pet/index.js +0 -3
- package/lib/components/booking/info/service2/utils.js +2 -2
- package/lib/components/booking/info2/index.js +4 -7
- package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info2/service/addService/utils.js +2 -4
- package/lib/components/booking/info2/service/editService/index.js +0 -1
- package/lib/components/eventBooking/components/bookingDetailModal/components/BookingOptions.js +8 -18
- package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +1 -1
- package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.js +1 -8
- package/lib/components/productSelect/components/TabProduct/index.js +6 -19
- package/lib/components/productSelect/components/productGroup/index.js +4 -24
- package/lib/components/productSelect/components/productGroup/index.less +1 -14
- package/lib/components/productSelect/index.less +2 -1
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +14 -25
- package/lib/components/ticketBooking/components/addServiceVariant/index.less +0 -10
- package/lib/components/ticketBooking/components/ticketBooking/index.js +1 -3
- package/lib/components/ticketBooking/index.js +1 -2
- package/lib/components/ticketBooking/locales.d.ts +0 -3
- package/lib/components/ticketBooking/locales.js +3 -6
- package/lib/components/ticketBooking/utils/index.d.ts +1 -5
- package/lib/components/ticketBooking/utils/index.js +3 -35
- package/package.json +4 -4
- package/es/components/appointmentBooking/assets/resource.svg +0 -1
- package/es/components/productSelect/components/TabProduct/tabs/index.d.ts +0 -21
- package/es/components/productSelect/components/TabProduct/tabs/index.js +0 -243
- package/es/components/productSelect/components/TabProduct/tabs/index.less +0 -126
- package/es/components/productSelect/components/pisellPriceText/index.d.ts +0 -11
- package/es/components/productSelect/components/pisellPriceText/index.js +0 -43
- package/lib/components/appointmentBooking/assets/resource.svg +0 -1
- package/lib/components/productSelect/components/TabProduct/tabs/index.d.ts +0 -21
- package/lib/components/productSelect/components/TabProduct/tabs/index.js +0 -202
- package/lib/components/productSelect/components/TabProduct/tabs/index.less +0 -126
- package/lib/components/productSelect/components/pisellPriceText/index.d.ts +0 -11
- package/lib/components/productSelect/components/pisellPriceText/index.js +0 -72
|
@@ -219,7 +219,6 @@ export var useAppointmentBookingStep = function useAppointmentBookingStep() {
|
|
|
219
219
|
return;
|
|
220
220
|
}
|
|
221
221
|
// 2. 插入表单步骤
|
|
222
|
-
var preKey = '';
|
|
223
222
|
currentSelectedResources === null || currentSelectedResources === void 0 || currentSelectedResources.forEach(function (cart) {
|
|
224
223
|
var _selectedResource$ren, _selectedResource$ren2;
|
|
225
224
|
var selectedResource = cart === null || cart === void 0 ? void 0 : cart.currentSelectedResource;
|
|
@@ -235,9 +234,7 @@ export var useAppointmentBookingStep = function useAppointmentBookingStep() {
|
|
|
235
234
|
appointmentBooking.addStep({
|
|
236
235
|
key: formKey,
|
|
237
236
|
description: description
|
|
238
|
-
},
|
|
239
|
-
// 如果有同时有多个预约表单,则需要记录下当前的表单key,用于后续插入表单步骤
|
|
240
|
-
preKey = formKey;
|
|
237
|
+
}, beforeKey);
|
|
241
238
|
} else {
|
|
242
239
|
appointmentBooking.removeStep(formKey);
|
|
243
240
|
}
|
|
@@ -279,87 +276,49 @@ export var useAppointmentBookingStep = function useAppointmentBookingStep() {
|
|
|
279
276
|
var renderItem = (_selectedResource === null || _selectedResource === void 0 ? void 0 : _selectedResource.renderItem) || {};
|
|
280
277
|
|
|
281
278
|
// 监测holder数据
|
|
282
|
-
var checkHolder =
|
|
283
|
-
|
|
284
|
-
var cartLists, newCarts, appoimentCarts, _checkAndGoNext, hasError;
|
|
285
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
286
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
287
|
-
case 0:
|
|
288
|
-
setLoading(false);
|
|
279
|
+
var checkHolder = function checkHolder() {
|
|
280
|
+
setLoading(false);
|
|
289
281
|
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
return !(appointmentBooking !== null && appointmentBooking !== void 0 && appointmentBooking.isTargetCartIdNormalProduct(n._id));
|
|
314
|
-
});
|
|
315
|
-
_checkAndGoNext = checkAndGoNext(isFormSubject, checkAccount, appoimentCarts), hasError = _checkAndGoNext.hasError;
|
|
316
|
-
setIsErrorHolder(hasError);
|
|
317
|
-
if (!hasError) {
|
|
318
|
-
_context2.next = 17;
|
|
319
|
-
break;
|
|
320
|
-
}
|
|
321
|
-
return _context2.abrupt("return");
|
|
322
|
-
case 17:
|
|
323
|
-
if (!(renderItem !== null && renderItem !== void 0 && renderItem.policy_id)) {
|
|
324
|
-
_context2.next = 21;
|
|
325
|
-
break;
|
|
326
|
-
}
|
|
327
|
-
openPolicy({
|
|
328
|
-
id: renderItem === null || renderItem === void 0 ? void 0 : renderItem.policy_id
|
|
329
|
-
}, function () {
|
|
330
|
-
return appointmentBooking.next();
|
|
331
|
-
});
|
|
332
|
-
_context2.next = 22;
|
|
333
|
-
break;
|
|
334
|
-
case 21:
|
|
335
|
-
return _context2.abrupt("return", appointmentBooking.next());
|
|
336
|
-
case 22:
|
|
337
|
-
case "end":
|
|
338
|
-
return _context2.stop();
|
|
339
|
-
}
|
|
340
|
-
}, _callee2);
|
|
341
|
-
}));
|
|
342
|
-
return function checkHolder() {
|
|
343
|
-
return _ref4.apply(this, arguments);
|
|
344
|
-
};
|
|
345
|
-
}();
|
|
282
|
+
// 零售订单不需要验证holder
|
|
283
|
+
if (isRetailTemplate || appointmentBooking !== null && appointmentBooking !== void 0 && appointmentBooking.isCartAllNormalProducts()) {
|
|
284
|
+
return appointmentBooking.next();
|
|
285
|
+
}
|
|
286
|
+
var appoimentCarts = carts.filter(function (n) {
|
|
287
|
+
return !(appointmentBooking !== null && appointmentBooking !== void 0 && appointmentBooking.isTargetCartIdNormalProduct(n._id));
|
|
288
|
+
});
|
|
289
|
+
var _checkAndGoNext = checkAndGoNext(isFormSubject, checkAccount, appoimentCarts),
|
|
290
|
+
hasError = _checkAndGoNext.hasError;
|
|
291
|
+
setIsErrorHolder(hasError);
|
|
292
|
+
if (hasError) {
|
|
293
|
+
return;
|
|
294
|
+
}
|
|
295
|
+
if (!!(renderItem !== null && renderItem !== void 0 && renderItem.policy_id)) {
|
|
296
|
+
openPolicy({
|
|
297
|
+
id: renderItem === null || renderItem === void 0 ? void 0 : renderItem.policy_id
|
|
298
|
+
}, function () {
|
|
299
|
+
return appointmentBooking.next();
|
|
300
|
+
});
|
|
301
|
+
} else {
|
|
302
|
+
return appointmentBooking.next();
|
|
303
|
+
}
|
|
304
|
+
};
|
|
346
305
|
|
|
347
306
|
// 检测是否登录
|
|
348
307
|
var checkLogin = /*#__PURE__*/function () {
|
|
349
|
-
var
|
|
308
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
350
309
|
var accountLists;
|
|
351
|
-
return _regeneratorRuntime().wrap(function
|
|
352
|
-
while (1) switch (
|
|
310
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
311
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
353
312
|
case 0:
|
|
354
313
|
if (isLogin) {
|
|
355
|
-
|
|
314
|
+
_context2.next = 7;
|
|
356
315
|
break;
|
|
357
316
|
}
|
|
358
|
-
|
|
317
|
+
_context2.next = 3;
|
|
359
318
|
return appointmentBooking.getAccounts();
|
|
360
319
|
case 3:
|
|
361
|
-
accountLists =
|
|
362
|
-
return
|
|
320
|
+
accountLists = _context2.sent;
|
|
321
|
+
return _context2.abrupt("return", openLoginModal({
|
|
363
322
|
callback: function callback(status) {
|
|
364
323
|
if (status === 'success') {
|
|
365
324
|
if (!isFormSubject) {
|
|
@@ -382,15 +341,15 @@ export var useAppointmentBookingStep = function useAppointmentBookingStep() {
|
|
|
382
341
|
}
|
|
383
342
|
}));
|
|
384
343
|
case 7:
|
|
385
|
-
return
|
|
344
|
+
return _context2.abrupt("return", checkHolder());
|
|
386
345
|
case 8:
|
|
387
346
|
case "end":
|
|
388
|
-
return
|
|
347
|
+
return _context2.stop();
|
|
389
348
|
}
|
|
390
|
-
},
|
|
349
|
+
}, _callee2);
|
|
391
350
|
}));
|
|
392
351
|
return function checkLogin() {
|
|
393
|
-
return
|
|
352
|
+
return _ref4.apply(this, arguments);
|
|
394
353
|
};
|
|
395
354
|
}();
|
|
396
355
|
|
|
@@ -434,81 +393,81 @@ export var useAppointmentBookingStep = function useAppointmentBookingStep() {
|
|
|
434
393
|
* @Date: 2025-04-15 11:12
|
|
435
394
|
*/
|
|
436
395
|
export var useAppointmentBookingProduct = function useAppointmentBookingProduct() {
|
|
437
|
-
var
|
|
438
|
-
appointmentBooking =
|
|
439
|
-
var
|
|
440
|
-
productModuleParams =
|
|
441
|
-
var
|
|
442
|
-
bookingProcess =
|
|
396
|
+
var _ref5 = useAppointmentBookingContext(),
|
|
397
|
+
appointmentBooking = _ref5.appointmentBooking;
|
|
398
|
+
var _ref6 = (appointmentBooking === null || appointmentBooking === void 0 ? void 0 : appointmentBooking.otherParams) || {},
|
|
399
|
+
productModuleParams = _ref6.productModuleParams;
|
|
400
|
+
var _ref7 = productModuleParams || {},
|
|
401
|
+
bookingProcess = _ref7.bookingProcess;
|
|
443
402
|
|
|
444
403
|
// 获取商品列表
|
|
445
404
|
var getProducts = /*#__PURE__*/function () {
|
|
446
|
-
var
|
|
447
|
-
var _dates$, dates,
|
|
448
|
-
return _regeneratorRuntime().wrap(function
|
|
449
|
-
while (1) switch (
|
|
405
|
+
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
406
|
+
var _dates$, dates, _ref9, _productModuleParams, _productList, _ref10, productModuleParams, productList;
|
|
407
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
408
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
450
409
|
case 0:
|
|
451
410
|
if (!(bookingProcess === 'date_first')) {
|
|
452
|
-
|
|
411
|
+
_context3.next = 11;
|
|
453
412
|
break;
|
|
454
413
|
}
|
|
455
|
-
|
|
414
|
+
_context3.next = 3;
|
|
456
415
|
return appointmentBooking.getDateRange();
|
|
457
416
|
case 3:
|
|
458
|
-
dates =
|
|
417
|
+
dates = _context3.sent;
|
|
459
418
|
if (!(!dates || !dates.length)) {
|
|
460
|
-
|
|
419
|
+
_context3.next = 6;
|
|
461
420
|
break;
|
|
462
421
|
}
|
|
463
|
-
return
|
|
422
|
+
return _context3.abrupt("return");
|
|
464
423
|
case 6:
|
|
465
|
-
|
|
466
|
-
|
|
424
|
+
_ref9 = (appointmentBooking === null || appointmentBooking === void 0 ? void 0 : appointmentBooking.otherParams) || {}, _productModuleParams = _ref9.productModuleParams;
|
|
425
|
+
_context3.next = 9;
|
|
467
426
|
return appointmentBooking.loadProductByScheduleDate(_objectSpread({
|
|
468
427
|
date: (_dates$ = dates[0]) === null || _dates$ === void 0 ? void 0 : _dates$.date
|
|
469
428
|
}, _productModuleParams));
|
|
470
429
|
case 9:
|
|
471
|
-
_productList =
|
|
472
|
-
return
|
|
430
|
+
_productList = _context3.sent;
|
|
431
|
+
return _context3.abrupt("return", _productList);
|
|
473
432
|
case 11:
|
|
474
433
|
// 先选商品
|
|
475
|
-
|
|
476
|
-
|
|
434
|
+
_ref10 = (appointmentBooking === null || appointmentBooking === void 0 ? void 0 : appointmentBooking.otherParams) || {}, productModuleParams = _ref10.productModuleParams;
|
|
435
|
+
_context3.next = 14;
|
|
477
436
|
return appointmentBooking.loadProducts(productModuleParams);
|
|
478
437
|
case 14:
|
|
479
|
-
productList =
|
|
480
|
-
return
|
|
438
|
+
productList = _context3.sent;
|
|
439
|
+
return _context3.abrupt("return", productList);
|
|
481
440
|
case 16:
|
|
482
441
|
case "end":
|
|
483
|
-
return
|
|
442
|
+
return _context3.stop();
|
|
484
443
|
}
|
|
485
|
-
},
|
|
444
|
+
}, _callee3);
|
|
486
445
|
}));
|
|
487
446
|
return function getProducts() {
|
|
488
|
-
return
|
|
447
|
+
return _ref8.apply(this, arguments);
|
|
489
448
|
};
|
|
490
449
|
}();
|
|
491
450
|
|
|
492
451
|
// 检测商品类型
|
|
493
452
|
var checkProductType = /*#__PURE__*/function () {
|
|
494
|
-
var
|
|
453
|
+
var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(productId) {
|
|
495
454
|
var result;
|
|
496
|
-
return _regeneratorRuntime().wrap(function
|
|
497
|
-
while (1) switch (
|
|
455
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
456
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
498
457
|
case 0:
|
|
499
|
-
|
|
458
|
+
_context4.next = 2;
|
|
500
459
|
return appointmentBooking.getProductTypeById(productId);
|
|
501
460
|
case 2:
|
|
502
|
-
result =
|
|
503
|
-
return
|
|
461
|
+
result = _context4.sent;
|
|
462
|
+
return _context4.abrupt("return", result);
|
|
504
463
|
case 4:
|
|
505
464
|
case "end":
|
|
506
|
-
return
|
|
465
|
+
return _context4.stop();
|
|
507
466
|
}
|
|
508
|
-
},
|
|
467
|
+
}, _callee4);
|
|
509
468
|
}));
|
|
510
469
|
return function checkProductType(_x2) {
|
|
511
|
-
return
|
|
470
|
+
return _ref11.apply(this, arguments);
|
|
512
471
|
};
|
|
513
472
|
}();
|
|
514
473
|
return {
|
|
@@ -528,30 +487,30 @@ export var useAppointmentBookingCart = function useAppointmentBookingCart() {
|
|
|
528
487
|
var _appointmentBooking$o2;
|
|
529
488
|
var pisellOS = usePisellOS();
|
|
530
489
|
var utils = contextUtils();
|
|
531
|
-
var
|
|
532
|
-
appointmentBooking =
|
|
533
|
-
setCarts =
|
|
534
|
-
setSummary =
|
|
535
|
-
setIsAgreeDepositPolicy =
|
|
536
|
-
var
|
|
537
|
-
bookingSubject =
|
|
490
|
+
var _ref12 = useAppointmentBookingContext(),
|
|
491
|
+
appointmentBooking = _ref12.appointmentBooking,
|
|
492
|
+
setCarts = _ref12.setCarts,
|
|
493
|
+
setSummary = _ref12.setSummary,
|
|
494
|
+
setIsAgreeDepositPolicy = _ref12.setIsAgreeDepositPolicy;
|
|
495
|
+
var _ref13 = (appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$o2 = appointmentBooking.otherParams) === null || _appointmentBooking$o2 === void 0 ? void 0 : _appointmentBooking$o2.productModuleParams) || {},
|
|
496
|
+
bookingSubject = _ref13.bookingSubject;
|
|
538
497
|
var getCartAndSummary = /*#__PURE__*/function () {
|
|
539
|
-
var
|
|
498
|
+
var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
540
499
|
var _utils$storage2;
|
|
541
500
|
var locale, symbol, carts, accountLists, newCarts, summary;
|
|
542
|
-
return _regeneratorRuntime().wrap(function
|
|
543
|
-
while (1) switch (
|
|
501
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
502
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
544
503
|
case 0:
|
|
545
504
|
locale = (utils === null || utils === void 0 || (_utils$storage2 = utils.storage) === null || _utils$storage2 === void 0 ? void 0 : _utils$storage2.get('umi_locale')) || 'en-US';
|
|
546
505
|
symbol = (utils === null || utils === void 0 ? void 0 : utils.getSymbolic()) || '$';
|
|
547
|
-
|
|
506
|
+
_context5.next = 4;
|
|
548
507
|
return appointmentBooking.getCart();
|
|
549
508
|
case 4:
|
|
550
|
-
carts =
|
|
551
|
-
|
|
509
|
+
carts = _context5.sent;
|
|
510
|
+
_context5.next = 7;
|
|
552
511
|
return appointmentBooking.getAccounts();
|
|
553
512
|
case 7:
|
|
554
|
-
accountLists =
|
|
513
|
+
accountLists = _context5.sent;
|
|
555
514
|
newCarts = carts === null || carts === void 0 ? void 0 : carts.map(function (item) {
|
|
556
515
|
var _item$duration;
|
|
557
516
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
@@ -568,10 +527,10 @@ export var useAppointmentBookingCart = function useAppointmentBookingCart() {
|
|
|
568
527
|
});
|
|
569
528
|
});
|
|
570
529
|
setCarts(newCarts || []);
|
|
571
|
-
|
|
530
|
+
_context5.next = 12;
|
|
572
531
|
return appointmentBooking.getSummary();
|
|
573
532
|
case 12:
|
|
574
|
-
summary =
|
|
533
|
+
summary = _context5.sent;
|
|
575
534
|
setSummary(summary || {});
|
|
576
535
|
|
|
577
536
|
// 清空勾选定金协议
|
|
@@ -580,26 +539,26 @@ export var useAppointmentBookingCart = function useAppointmentBookingCart() {
|
|
|
580
539
|
}
|
|
581
540
|
case 15:
|
|
582
541
|
case "end":
|
|
583
|
-
return
|
|
542
|
+
return _context5.stop();
|
|
584
543
|
}
|
|
585
|
-
},
|
|
544
|
+
}, _callee5);
|
|
586
545
|
}));
|
|
587
546
|
return function getCartAndSummary() {
|
|
588
|
-
return
|
|
547
|
+
return _ref14.apply(this, arguments);
|
|
589
548
|
};
|
|
590
549
|
}();
|
|
591
550
|
useEffect(function () {
|
|
592
551
|
getCartAndSummary();
|
|
593
|
-
pisellOS.effects.on('appointmentBooking_cart:changed', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
594
|
-
return _regeneratorRuntime().wrap(function
|
|
595
|
-
while (1) switch (
|
|
552
|
+
pisellOS.effects.on('appointmentBooking_cart:changed', /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
553
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
554
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
596
555
|
case 0:
|
|
597
556
|
getCartAndSummary();
|
|
598
557
|
case 1:
|
|
599
558
|
case "end":
|
|
600
|
-
return
|
|
559
|
+
return _context6.stop();
|
|
601
560
|
}
|
|
602
|
-
},
|
|
561
|
+
}, _callee6);
|
|
603
562
|
})));
|
|
604
563
|
}, []);
|
|
605
564
|
};
|
|
@@ -616,8 +575,8 @@ export var useAppointmentBookingLogin = function useAppointmentBookingLogin() {
|
|
|
616
575
|
var utils = contextUtils();
|
|
617
576
|
var isLogin = !!(utils !== null && utils !== void 0 && (_utils$token = utils.token) !== null && _utils$token !== void 0 && (_utils$token$get = _utils$token.get) !== null && _utils$token$get !== void 0 && _utils$token$get.call(_utils$token));
|
|
618
577
|
var openLoginModal = function openLoginModal(params) {
|
|
619
|
-
var
|
|
620
|
-
callback =
|
|
578
|
+
var _ref16 = params || {},
|
|
579
|
+
callback = _ref16.callback;
|
|
621
580
|
utils.action({
|
|
622
581
|
type: 'pisell1.login',
|
|
623
582
|
data: {
|
|
@@ -648,69 +607,69 @@ export var useAppointmentBookingAccount = function useAppointmentBookingAccount(
|
|
|
648
607
|
_useState2 = _slicedToArray(_useState, 2),
|
|
649
608
|
accountLists = _useState2[0],
|
|
650
609
|
setAccountLists = _useState2[1];
|
|
651
|
-
var
|
|
652
|
-
bookingSubject =
|
|
610
|
+
var _ref17 = (appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$o3 = appointmentBooking.otherParams) === null || _appointmentBooking$o3 === void 0 ? void 0 : _appointmentBooking$o3.productModuleParams) || {},
|
|
611
|
+
bookingSubject = _ref17.bookingSubject;
|
|
653
612
|
var form_id = bookingSubject === null || bookingSubject === void 0 ? void 0 : bookingSubject.form_id;
|
|
654
613
|
|
|
655
614
|
// 获取账户列表数据
|
|
656
615
|
var getAccountLists = /*#__PURE__*/function () {
|
|
657
|
-
var
|
|
616
|
+
var _ref18 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
|
|
658
617
|
var data;
|
|
659
|
-
return _regeneratorRuntime().wrap(function
|
|
660
|
-
while (1) switch (
|
|
618
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
619
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
661
620
|
case 0:
|
|
662
|
-
|
|
621
|
+
_context7.next = 2;
|
|
663
622
|
return appointmentBooking.getAccounts();
|
|
664
623
|
case 2:
|
|
665
|
-
data =
|
|
624
|
+
data = _context7.sent;
|
|
666
625
|
setAccountLists(data || []);
|
|
667
626
|
case 4:
|
|
668
627
|
case "end":
|
|
669
|
-
return
|
|
628
|
+
return _context7.stop();
|
|
670
629
|
}
|
|
671
|
-
},
|
|
630
|
+
}, _callee7);
|
|
672
631
|
}));
|
|
673
632
|
return function getAccountLists() {
|
|
674
|
-
return
|
|
633
|
+
return _ref18.apply(this, arguments);
|
|
675
634
|
};
|
|
676
635
|
}();
|
|
677
636
|
useEffect(function () {
|
|
678
637
|
getAccountLists();
|
|
679
638
|
pisellOS.effects.on('appointmentBooking_accountList:changed', /*#__PURE__*/function () {
|
|
680
|
-
var
|
|
681
|
-
return _regeneratorRuntime().wrap(function
|
|
682
|
-
while (1) switch (
|
|
639
|
+
var _ref19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(res) {
|
|
640
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
641
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
683
642
|
case 0:
|
|
684
643
|
if (res.path === 'accounts') {
|
|
685
644
|
getAccountLists();
|
|
686
645
|
}
|
|
687
646
|
case 1:
|
|
688
647
|
case "end":
|
|
689
|
-
return
|
|
648
|
+
return _context8.stop();
|
|
690
649
|
}
|
|
691
|
-
},
|
|
650
|
+
}, _callee8);
|
|
692
651
|
}));
|
|
693
652
|
return function (_x3) {
|
|
694
|
-
return
|
|
653
|
+
return _ref19.apply(this, arguments);
|
|
695
654
|
};
|
|
696
655
|
}());
|
|
697
656
|
}, []);
|
|
698
657
|
|
|
699
658
|
// 获取表单数据
|
|
700
659
|
var getHolders = /*#__PURE__*/function () {
|
|
701
|
-
var
|
|
660
|
+
var _ref20 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
|
|
702
661
|
var _utils$getStore$getSt;
|
|
703
662
|
var shop_id, customer, params, data, newData;
|
|
704
|
-
return _regeneratorRuntime().wrap(function
|
|
705
|
-
while (1) switch (
|
|
663
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
664
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
706
665
|
case 0:
|
|
707
666
|
shop_id = (_utils$getStore$getSt = utils.getStore().getState()) === null || _utils$getStore$getSt === void 0 || (_utils$getStore$getSt = _utils$getStore$getSt.global) === null || _utils$getStore$getSt === void 0 || (_utils$getStore$getSt = _utils$getStore$getSt.shop) === null || _utils$getStore$getSt === void 0 ? void 0 : _utils$getStore$getSt.id;
|
|
708
667
|
customer = getCustomer(utils);
|
|
709
668
|
if (!(!shop_id || !form_id || !(customer !== null && customer !== void 0 && customer.id))) {
|
|
710
|
-
|
|
669
|
+
_context9.next = 4;
|
|
711
670
|
break;
|
|
712
671
|
}
|
|
713
|
-
return
|
|
672
|
+
return _context9.abrupt("return", []);
|
|
714
673
|
case 4:
|
|
715
674
|
params = {
|
|
716
675
|
url: '/form/data/v1',
|
|
@@ -720,52 +679,52 @@ export var useAppointmentBookingAccount = function useAppointmentBookingAccount(
|
|
|
720
679
|
shop_id: shop_id
|
|
721
680
|
}
|
|
722
681
|
};
|
|
723
|
-
|
|
682
|
+
_context9.next = 7;
|
|
724
683
|
return appointmentBooking.fetchHolderAccountsAsync(params);
|
|
725
684
|
case 7:
|
|
726
|
-
data =
|
|
685
|
+
data = _context9.sent;
|
|
727
686
|
newData = data === null || data === void 0 ? void 0 : data.map(function (item) {
|
|
728
687
|
return {
|
|
729
688
|
id: item === null || item === void 0 ? void 0 : item.form_record_id,
|
|
730
689
|
label: item === null || item === void 0 ? void 0 : item.main_field
|
|
731
690
|
};
|
|
732
691
|
});
|
|
733
|
-
return
|
|
692
|
+
return _context9.abrupt("return", newData || []);
|
|
734
693
|
case 10:
|
|
735
694
|
case "end":
|
|
736
|
-
return
|
|
695
|
+
return _context9.stop();
|
|
737
696
|
}
|
|
738
|
-
},
|
|
697
|
+
}, _callee9);
|
|
739
698
|
}));
|
|
740
699
|
return function getHolders() {
|
|
741
|
-
return
|
|
700
|
+
return _ref20.apply(this, arguments);
|
|
742
701
|
};
|
|
743
702
|
}();
|
|
744
703
|
|
|
745
704
|
// 添加账户
|
|
746
705
|
var addAccount = /*#__PURE__*/function () {
|
|
747
|
-
var
|
|
706
|
+
var _ref21 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(val, type) {
|
|
748
707
|
var customer, result;
|
|
749
|
-
return _regeneratorRuntime().wrap(function
|
|
750
|
-
while (1) switch (
|
|
708
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
709
|
+
while (1) switch (_context10.prev = _context10.next) {
|
|
751
710
|
case 0:
|
|
752
711
|
customer = getCustomer(utils);
|
|
753
|
-
|
|
712
|
+
_context10.next = 3;
|
|
754
713
|
return appointmentBooking.addAccount(val, {
|
|
755
714
|
type: type,
|
|
756
715
|
customerId: customer === null || customer === void 0 ? void 0 : customer.id
|
|
757
716
|
});
|
|
758
717
|
case 3:
|
|
759
|
-
result =
|
|
760
|
-
return
|
|
718
|
+
result = _context10.sent;
|
|
719
|
+
return _context10.abrupt("return", result);
|
|
761
720
|
case 5:
|
|
762
721
|
case "end":
|
|
763
|
-
return
|
|
722
|
+
return _context10.stop();
|
|
764
723
|
}
|
|
765
|
-
},
|
|
724
|
+
}, _callee10);
|
|
766
725
|
}));
|
|
767
726
|
return function addAccount(_x4, _x5) {
|
|
768
|
-
return
|
|
727
|
+
return _ref21.apply(this, arguments);
|
|
769
728
|
};
|
|
770
729
|
}();
|
|
771
730
|
|
|
@@ -790,12 +749,12 @@ export var useAppointmentBookingAccount = function useAppointmentBookingAccount(
|
|
|
790
749
|
* @Date: 2025-04-15 11:29
|
|
791
750
|
*/
|
|
792
751
|
export var useAppointmentBookingResource = function useAppointmentBookingResource() {
|
|
793
|
-
var
|
|
794
|
-
appointmentBooking =
|
|
795
|
-
setResources =
|
|
796
|
-
setTimes =
|
|
797
|
-
var
|
|
798
|
-
resourceSort =
|
|
752
|
+
var _ref22 = useAppointmentBookingContext(),
|
|
753
|
+
appointmentBooking = _ref22.appointmentBooking,
|
|
754
|
+
setResources = _ref22.setResources,
|
|
755
|
+
setTimes = _ref22.setTimes;
|
|
756
|
+
var _ref23 = (appointmentBooking === null || appointmentBooking === void 0 ? void 0 : appointmentBooking.otherParams) || {},
|
|
757
|
+
resourceSort = _ref23.resourceSort;
|
|
799
758
|
|
|
800
759
|
// 设置资源列表
|
|
801
760
|
var getResourceList = function getResourceList() {
|
|
@@ -819,26 +778,26 @@ export var useAppointmentBookingResource = function useAppointmentBookingResourc
|
|
|
819
778
|
|
|
820
779
|
// 设置时间切片
|
|
821
780
|
var getResourceTimeSlot = /*#__PURE__*/function () {
|
|
822
|
-
var
|
|
781
|
+
var _ref24 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(index) {
|
|
823
782
|
var _getResourceList, resourceCodes, code, data;
|
|
824
|
-
return _regeneratorRuntime().wrap(function
|
|
825
|
-
while (1) switch (
|
|
783
|
+
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
784
|
+
while (1) switch (_context11.prev = _context11.next) {
|
|
826
785
|
case 0:
|
|
827
786
|
_getResourceList = getResourceList(), resourceCodes = _getResourceList.resourceCodes;
|
|
828
787
|
code = resourceCodes === null || resourceCodes === void 0 ? void 0 : resourceCodes[index || 0];
|
|
829
|
-
|
|
788
|
+
_context11.next = 4;
|
|
830
789
|
return appointmentBooking.getTimeSlotByAllResources(code);
|
|
831
790
|
case 4:
|
|
832
|
-
data =
|
|
791
|
+
data = _context11.sent;
|
|
833
792
|
setTimes(data || []);
|
|
834
793
|
case 6:
|
|
835
794
|
case "end":
|
|
836
|
-
return
|
|
795
|
+
return _context11.stop();
|
|
837
796
|
}
|
|
838
|
-
},
|
|
797
|
+
}, _callee11);
|
|
839
798
|
}));
|
|
840
799
|
return function getResourceTimeSlot(_x6) {
|
|
841
|
-
return
|
|
800
|
+
return _ref24.apply(this, arguments);
|
|
842
801
|
};
|
|
843
802
|
}();
|
|
844
803
|
return {
|
|
@@ -855,8 +814,8 @@ export var useAppointmentBookingResource = function useAppointmentBookingResourc
|
|
|
855
814
|
* @Date: 2025-04-21 11:47
|
|
856
815
|
*/
|
|
857
816
|
export var useIsSkipResourceStep = function useIsSkipResourceStep() {
|
|
858
|
-
var
|
|
859
|
-
currentStepParams =
|
|
817
|
+
var _ref25 = useAppointmentBookingContext(),
|
|
818
|
+
currentStepParams = _ref25.currentStepParams;
|
|
860
819
|
var _useAppointmentBookin5 = useAppointmentBookingResource(),
|
|
861
820
|
getResourceList = _useAppointmentBookin5.getResourceList;
|
|
862
821
|
var _useAppointmentBookin6 = useAppointmentBookingSetting(),
|
|
@@ -865,27 +824,27 @@ export var useIsSkipResourceStep = function useIsSkipResourceStep() {
|
|
|
865
824
|
var _useAppointmentBookin7 = useAppointmentBookingStep(),
|
|
866
825
|
nextStep = _useAppointmentBookin7.nextStep;
|
|
867
826
|
var checkSkipResourceStep = /*#__PURE__*/function () {
|
|
868
|
-
var
|
|
827
|
+
var _ref26 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
|
|
869
828
|
var _getResourceList2, resources, accountLists, _currentAppointmentBo, isSystem, isSkip, form_code, renderLists, _isSkip;
|
|
870
|
-
return _regeneratorRuntime().wrap(function
|
|
871
|
-
while (1) switch (
|
|
829
|
+
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
830
|
+
while (1) switch (_context12.prev = _context12.next) {
|
|
872
831
|
case 0:
|
|
873
|
-
|
|
832
|
+
_context12.prev = 0;
|
|
874
833
|
_getResourceList2 = getResourceList(), resources = _getResourceList2.resources;
|
|
875
|
-
|
|
834
|
+
_context12.next = 4;
|
|
876
835
|
return appointmentBooking.getAccounts();
|
|
877
836
|
case 4:
|
|
878
|
-
accountLists =
|
|
837
|
+
accountLists = _context12.sent;
|
|
879
838
|
_currentAppointmentBo = currentAppointmentBoard(currentStepParams.key, resources, appointmentBooking), isSystem = _currentAppointmentBo.isSystem, isSkip = _currentAppointmentBo.isSkip, form_code = _currentAppointmentBo.form_code; // 客户不可选择资源,系统自动分派
|
|
880
839
|
if (!isSystem) {
|
|
881
|
-
|
|
840
|
+
_context12.next = 9;
|
|
882
841
|
break;
|
|
883
842
|
}
|
|
884
843
|
nextStep();
|
|
885
|
-
return
|
|
844
|
+
return _context12.abrupt("return", true);
|
|
886
845
|
case 9:
|
|
887
846
|
if (!((accountLists === null || accountLists === void 0 ? void 0 : accountLists.length) === 1 || isFormSubject)) {
|
|
888
|
-
|
|
847
|
+
_context12.next = 19;
|
|
889
848
|
break;
|
|
890
849
|
}
|
|
891
850
|
renderLists = currentRenderLists(resources, form_code);
|
|
@@ -898,30 +857,30 @@ export var useIsSkipResourceStep = function useIsSkipResourceStep() {
|
|
|
898
857
|
|
|
899
858
|
// 如果跳过资源选择步骤,则执行跳过的逻辑
|
|
900
859
|
if (!_isSkip) {
|
|
901
|
-
|
|
860
|
+
_context12.next = 16;
|
|
902
861
|
break;
|
|
903
862
|
}
|
|
904
863
|
nextStep();
|
|
905
|
-
return
|
|
864
|
+
return _context12.abrupt("return", true);
|
|
906
865
|
case 16:
|
|
907
|
-
return
|
|
866
|
+
return _context12.abrupt("return", _isSkip);
|
|
908
867
|
case 19:
|
|
909
|
-
return
|
|
868
|
+
return _context12.abrupt("return", false);
|
|
910
869
|
case 20:
|
|
911
|
-
|
|
870
|
+
_context12.next = 25;
|
|
912
871
|
break;
|
|
913
872
|
case 22:
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
return
|
|
873
|
+
_context12.prev = 22;
|
|
874
|
+
_context12.t0 = _context12["catch"](0);
|
|
875
|
+
return _context12.abrupt("return", false);
|
|
917
876
|
case 25:
|
|
918
877
|
case "end":
|
|
919
|
-
return
|
|
878
|
+
return _context12.stop();
|
|
920
879
|
}
|
|
921
|
-
},
|
|
880
|
+
}, _callee12, null, [[0, 22]]);
|
|
922
881
|
}));
|
|
923
882
|
return function checkSkipResourceStep() {
|
|
924
|
-
return
|
|
883
|
+
return _ref26.apply(this, arguments);
|
|
925
884
|
};
|
|
926
885
|
}();
|
|
927
886
|
return {
|
|
@@ -939,13 +898,13 @@ export var useIsSkipResourceStep = function useIsSkipResourceStep() {
|
|
|
939
898
|
export var useAppointmentBookingSetting = function useAppointmentBookingSetting() {
|
|
940
899
|
var _appointmentBooking$o4, _appointmentBooking$o5;
|
|
941
900
|
var utils = contextUtils();
|
|
942
|
-
var
|
|
943
|
-
appointmentBooking =
|
|
944
|
-
var
|
|
945
|
-
bookingProcess =
|
|
946
|
-
bookingSubject =
|
|
947
|
-
customPageId =
|
|
948
|
-
channel =
|
|
901
|
+
var _ref27 = useAppointmentBookingContext(),
|
|
902
|
+
appointmentBooking = _ref27.appointmentBooking;
|
|
903
|
+
var _ref28 = (appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$o4 = appointmentBooking.otherParams) === null || _appointmentBooking$o4 === void 0 ? void 0 : _appointmentBooking$o4.productModuleParams) || {},
|
|
904
|
+
bookingProcess = _ref28.bookingProcess,
|
|
905
|
+
bookingSubject = _ref28.bookingSubject,
|
|
906
|
+
customPageId = _ref28.customPageId,
|
|
907
|
+
channel = _ref28.channel;
|
|
949
908
|
|
|
950
909
|
// 设置缓存
|
|
951
910
|
var setOtherData = function setOtherData(key, val) {
|