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