@pisell/private-materials 6.3.74 → 6.3.76
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/render/default/view.js +1 -1
- package/build/lowcode/view.js +1 -1
- package/es/components/appointmentBooking/components/Header/index.js +12 -12
- package/es/components/appointmentBooking/components/TimeSlicing/components/SelectDateOS.d.ts +2 -0
- package/es/components/appointmentBooking/components/TimeSlicing/components/SelectDateOS.js +82 -0
- package/es/components/appointmentBooking/components/TimeSlicing/index.js +46 -5
- package/es/components/appointmentBooking/components/Voucher/index.js +12 -2
- package/es/components/appointmentBooking/hooks.d.ts +1 -1
- package/es/components/appointmentBooking/hooks.js +6 -13
- package/es/components/appointmentBooking/utils.d.ts +23 -0
- package/es/components/appointmentBooking/utils.js +159 -0
- package/es/components/booking/addons/model.d.ts +1 -10
- package/es/components/booking/forms/model.d.ts +1 -10
- package/es/components/booking/info/model.d.ts +1 -10
- package/es/components/booking/info/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info/service2/utils.js +38 -36
- package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/es/components/booking/model.d.ts +1 -9
- package/es/components/booking/notes/model.d.ts +1 -10
- package/es/components/booking/payments/model.d.ts +1 -10
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
- package/es/components/pay/toC/model.d.ts +1 -9
- package/es/components/schedules/model.d.ts +1 -9
- package/lib/components/appointmentBooking/components/Header/index.js +3 -8
- package/lib/components/appointmentBooking/components/TimeSlicing/components/SelectDateOS.d.ts +2 -0
- package/lib/components/appointmentBooking/components/TimeSlicing/components/SelectDateOS.js +89 -0
- package/lib/components/appointmentBooking/components/TimeSlicing/index.js +27 -7
- package/lib/components/appointmentBooking/components/Voucher/index.js +12 -2
- package/lib/components/appointmentBooking/hooks.d.ts +1 -1
- package/lib/components/appointmentBooking/hooks.js +6 -11
- package/lib/components/appointmentBooking/utils.d.ts +23 -0
- package/lib/components/appointmentBooking/utils.js +103 -0
- package/lib/components/booking/addons/model.d.ts +1 -10
- package/lib/components/booking/forms/model.d.ts +1 -10
- package/lib/components/booking/info/model.d.ts +1 -10
- package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info/service2/utils.js +3 -1
- package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/model.d.ts +1 -9
- package/lib/components/booking/notes/model.d.ts +1 -10
- package/lib/components/booking/payments/model.d.ts +1 -10
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
- package/lib/components/pay/toC/model.d.ts +1 -9
- package/lib/components/schedules/model.d.ts +1 -9
- package/package.json +3 -3
|
@@ -196,7 +196,9 @@ var currentResource = function currentResource(state, useResource, cacheItem) {
|
|
|
196
196
|
// 更新holder
|
|
197
197
|
export var handleChangeHolder = function handleChangeHolder(products, currentItem, other) {
|
|
198
198
|
return products.map(function (item) {
|
|
199
|
-
|
|
199
|
+
var _item$_extend, _item$_extend2, _currentItem$_origin;
|
|
200
|
+
var isSameGroup = (item === null || item === void 0 || (_item$_extend = item._extend) === null || _item$_extend === void 0 ? void 0 : _item$_extend.groupId) && ((_item$_extend2 = item._extend) === null || _item$_extend2 === void 0 ? void 0 : _item$_extend2.groupId) === (currentItem === null || currentItem === void 0 || (_currentItem$_origin = currentItem._origin) === null || _currentItem$_origin === void 0 || (_currentItem$_origin = _currentItem$_origin._extend) === null || _currentItem$_origin === void 0 ? void 0 : _currentItem$_origin.groupId);
|
|
201
|
+
if (item._id === currentItem._id || isSameGroup) {
|
|
200
202
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
201
203
|
_extend: _objectSpread(_objectSpread({}, item._extend), {}, {
|
|
202
204
|
holder_id: isArr(other) ? other.map(function (item) {
|
|
@@ -215,10 +217,10 @@ var handleLike = function handleLike(products, currentItem, other) {
|
|
|
215
217
|
return products.map(function (item) {
|
|
216
218
|
if (currentItem.isParallelResource) {
|
|
217
219
|
if (item._id === currentItem.serviceId) {
|
|
218
|
-
var _item$
|
|
220
|
+
var _item$_extend3, _item$_extend4;
|
|
219
221
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
220
222
|
_extend: _objectSpread(_objectSpread({}, item._extend), {}, {
|
|
221
|
-
resource: _objectSpread(_objectSpread({}, (_item$
|
|
223
|
+
resource: _objectSpread(_objectSpread({}, (_item$_extend3 = item._extend) === null || _item$_extend3 === void 0 ? void 0 : _item$_extend3.resource), {}, _defineProperty({}, currentItem.resourceId, (_item$_extend4 = item._extend) === null || _item$_extend4 === void 0 ? void 0 : _item$_extend4.resource[currentItem.resourceId].map(function (item) {
|
|
222
224
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
223
225
|
like_status: other.like_status
|
|
224
226
|
});
|
|
@@ -343,8 +345,8 @@ export var updateServices = function updateServices(state, currentItem, type, ot
|
|
|
343
345
|
if (type === 'delete_holders') {
|
|
344
346
|
var _products2;
|
|
345
347
|
products = (_products2 = products) === null || _products2 === void 0 ? void 0 : _products2.filter(function (item) {
|
|
346
|
-
var _item$
|
|
347
|
-
return (item === null || item === void 0 || (_item$
|
|
348
|
+
var _item$_extend5;
|
|
349
|
+
return (item === null || item === void 0 || (_item$_extend5 = item._extend) === null || _item$_extend5 === void 0 ? void 0 : _item$_extend5.holder_id) !== other;
|
|
348
350
|
});
|
|
349
351
|
}
|
|
350
352
|
|
|
@@ -545,7 +547,7 @@ export var isAllNormalProductByState = function isAllNormalProductByState(state)
|
|
|
545
547
|
return isAllNormalProduct(state.service.value);
|
|
546
548
|
};
|
|
547
549
|
var getGeneralParams = function getGeneralParams(item, state, isParallelResource) {
|
|
548
|
-
var _formData$, _item$
|
|
550
|
+
var _formData$, _item$_extend7, _item$_extend8, _item$_extend9, _item$_extend10, _item$_extend11;
|
|
549
551
|
var pet = state.pet,
|
|
550
552
|
service = state.service;
|
|
551
553
|
var _ref8 = pet || {},
|
|
@@ -588,7 +590,7 @@ var getGeneralParams = function getGeneralParams(item, state, isParallelResource
|
|
|
588
590
|
};
|
|
589
591
|
});
|
|
590
592
|
} else {
|
|
591
|
-
var _item$
|
|
593
|
+
var _item$_extend6;
|
|
592
594
|
var _ref10 = service || {},
|
|
593
595
|
resourcesOrigin = _ref10.resourcesOrigin;
|
|
594
596
|
var resource = formatResources({
|
|
@@ -599,7 +601,7 @@ var getGeneralParams = function getGeneralParams(item, state, isParallelResource
|
|
|
599
601
|
multiResources = [{
|
|
600
602
|
_id: item._id,
|
|
601
603
|
id: item._extend.resource,
|
|
602
|
-
status: ((_item$
|
|
604
|
+
status: ((_item$_extend6 = item._extend) === null || _item$_extend6 === void 0 ? void 0 : _item$_extend6.like_status) || 'common',
|
|
603
605
|
lists: mapListItems(resource)
|
|
604
606
|
}];
|
|
605
607
|
}
|
|
@@ -620,10 +622,10 @@ var getGeneralParams = function getGeneralParams(item, state, isParallelResource
|
|
|
620
622
|
holderMode: (item === null || item === void 0 ? void 0 : item._extend.quantity) > 1 ? 'multiple' : undefined,
|
|
621
623
|
isErrorHolder: getIsSubjectRequire(state),
|
|
622
624
|
addHolderButtonText: (formData === null || formData === void 0 || (_formData$ = formData[0]) === null || _formData$ === void 0 || (_formData$ = _formData$.form) === null || _formData$ === void 0 ? void 0 : _formData$.title) || "",
|
|
623
|
-
holder_id: item === null || item === void 0 || (_item$
|
|
624
|
-
start_date: !isNormalProduct ? item === null || item === void 0 || (_item$
|
|
625
|
-
end_date: !isNormalProduct ? (item === null || item === void 0 || (_item$
|
|
626
|
-
rowKey: "rowKey-".concat(item === null || item === void 0 || (_item$
|
|
625
|
+
holder_id: item === null || item === void 0 || (_item$_extend7 = item._extend) === null || _item$_extend7 === void 0 ? void 0 : _item$_extend7.holder_id,
|
|
626
|
+
start_date: !isNormalProduct ? item === null || item === void 0 || (_item$_extend8 = item._extend) === null || _item$_extend8 === void 0 ? void 0 : _item$_extend8.startDate : "",
|
|
627
|
+
end_date: !isNormalProduct ? (item === null || item === void 0 || (_item$_extend9 = item._extend) === null || _item$_extend9 === void 0 ? void 0 : _item$_extend9.endDate) || (item === null || item === void 0 || (_item$_extend10 = item._extend) === null || _item$_extend10 === void 0 ? void 0 : _item$_extend10.end_date) : "",
|
|
628
|
+
rowKey: "rowKey-".concat(item === null || item === void 0 || (_item$_extend11 = item._extend) === null || _item$_extend11 === void 0 || (_item$_extend11 = _item$_extend11.other) === null || _item$_extend11 === void 0 ? void 0 : _item$_extend11.rowKey)
|
|
627
629
|
}, parallelResourceOtherParams);
|
|
628
630
|
};
|
|
629
631
|
var calcAddTimeTotalPrice = function calcAddTimeTotalPrice(total, addTimeProducts, item) {
|
|
@@ -647,18 +649,18 @@ export var formatProducts = function formatProducts(lists, state) {
|
|
|
647
649
|
var normalList = [];
|
|
648
650
|
var groupList = [];
|
|
649
651
|
var formItem = function formItem(item) {
|
|
650
|
-
var _item$
|
|
652
|
+
var _item$_extend12, _item$_extend13, _item$_extend14, _item$_extend16, _item$_extend17, _item$_extend18, _item$_extend19, _item$_extend20, _item$_extend21, _item$_extend22, _item$_extend23, _item$_extend24, _resourceItem, _item$_extend25, _item$_extend26, _item$_extend27, _item$_extend28, _item$_extend29;
|
|
651
653
|
var _isDayBookingProduct = isDayBookingProduct(item, state);
|
|
652
|
-
var clientTitle = getHolderName(state, item === null || item === void 0 || (_item$
|
|
653
|
-
var options = formatOptions(item === null || item === void 0 || (_item$
|
|
654
|
-
var bundle = formatBundle(item === null || item === void 0 || (_item$
|
|
654
|
+
var clientTitle = getHolderName(state, item === null || item === void 0 || (_item$_extend12 = item._extend) === null || _item$_extend12 === void 0 ? void 0 : _item$_extend12.holder_id);
|
|
655
|
+
var options = formatOptions(item === null || item === void 0 || (_item$_extend13 = item._extend) === null || _item$_extend13 === void 0 || (_item$_extend13 = _item$_extend13.other) === null || _item$_extend13 === void 0 ? void 0 : _item$_extend13.option);
|
|
656
|
+
var bundle = formatBundle(item === null || item === void 0 || (_item$_extend14 = item._extend) === null || _item$_extend14 === void 0 || (_item$_extend14 = _item$_extend14.other) === null || _item$_extend14 === void 0 ? void 0 : _item$_extend14.bundle);
|
|
655
657
|
// 是否是普通商品
|
|
656
658
|
var isNormalProduct = !appointmentTypes.includes(item === null || item === void 0 ? void 0 : item.extension_type) || (state === null || state === void 0 ? void 0 : state.renderType) === 'eventBooking';
|
|
657
659
|
var resourceItem = {};
|
|
658
660
|
var errorMessage = '';
|
|
659
661
|
if (_isDayBookingProduct || isGeneral) {
|
|
660
|
-
var _item$
|
|
661
|
-
resourceItem = getResourceItem(item === null || item === void 0 || (_item$
|
|
662
|
+
var _item$_extend15;
|
|
663
|
+
resourceItem = getResourceItem(item === null || item === void 0 || (_item$_extend15 = item._extend) === null || _item$_extend15 === void 0 ? void 0 : _item$_extend15.resource, state);
|
|
662
664
|
errorMessage = getErrorMessage(item, resourceItem, isDayBooking(state));
|
|
663
665
|
}
|
|
664
666
|
var generalParams = isGeneral ? getGeneralParams(item, state, !!isParallelResource) : {};
|
|
@@ -666,30 +668,30 @@ export var formatProducts = function formatProducts(lists, state) {
|
|
|
666
668
|
id: item === null || item === void 0 ? void 0 : item.id,
|
|
667
669
|
_id: item === null || item === void 0 ? void 0 : item._id,
|
|
668
670
|
name: item === null || item === void 0 ? void 0 : item.title,
|
|
669
|
-
price: item === null || item === void 0 || (_item$
|
|
670
|
-
total: calcAddTimeTotalPrice(item === null || item === void 0 || (_item$
|
|
671
|
-
origin_total: calcAddTimeTotalPrice(item === null || item === void 0 || (_item$
|
|
671
|
+
price: item === null || item === void 0 || (_item$_extend16 = item._extend) === null || _item$_extend16 === void 0 ? void 0 : _item$_extend16.price,
|
|
672
|
+
total: calcAddTimeTotalPrice(item === null || item === void 0 || (_item$_extend17 = item._extend) === null || _item$_extend17 === void 0 ? void 0 : _item$_extend17.total, item === null || item === void 0 || (_item$_extend18 = item._extend) === null || _item$_extend18 === void 0 ? void 0 : _item$_extend18.relation_details, item),
|
|
673
|
+
origin_total: calcAddTimeTotalPrice(item === null || item === void 0 || (_item$_extend19 = item._extend) === null || _item$_extend19 === void 0 ? void 0 : _item$_extend19.origin_total, item === null || item === void 0 || (_item$_extend20 = item._extend) === null || _item$_extend20 === void 0 ? void 0 : _item$_extend20.relation_details),
|
|
672
674
|
num: item === null || item === void 0 ? void 0 : item._extend.quantity,
|
|
673
675
|
image: item === null || item === void 0 ? void 0 : item.cover,
|
|
674
676
|
isShowNote: true,
|
|
675
677
|
note: item === null || item === void 0 ? void 0 : item.note,
|
|
676
|
-
like_status: item === null || item === void 0 || (_item$
|
|
678
|
+
like_status: item === null || item === void 0 || (_item$_extend21 = item._extend) === null || _item$_extend21 === void 0 ? void 0 : _item$_extend21.like_status,
|
|
677
679
|
bundle: bundle,
|
|
678
680
|
options: options,
|
|
679
681
|
errorMessage: errorMessage,
|
|
680
|
-
product_option_string: item === null || item === void 0 || (_item$
|
|
681
|
-
discount_reason: item === null || item === void 0 || (_item$
|
|
682
|
-
resource_id: isNormalProduct ? 0 : item === null || item === void 0 || (_item$
|
|
682
|
+
product_option_string: item === null || item === void 0 || (_item$_extend22 = item._extend) === null || _item$_extend22 === void 0 || (_item$_extend22 = _item$_extend22.other) === null || _item$_extend22 === void 0 ? void 0 : _item$_extend22.product_option_string,
|
|
683
|
+
discount_reason: item === null || item === void 0 || (_item$_extend23 = item._extend) === null || _item$_extend23 === void 0 ? void 0 : _item$_extend23.discount_reason,
|
|
684
|
+
resource_id: isNormalProduct ? 0 : item === null || item === void 0 || (_item$_extend24 = item._extend) === null || _item$_extend24 === void 0 ? void 0 : _item$_extend24.resource,
|
|
683
685
|
relation_form_name: isNormalProduct ? '' : ((_resourceItem = resourceItem) === null || _resourceItem === void 0 ? void 0 : _resourceItem.labelText) || item.relation_form_name,
|
|
684
686
|
holder_title: clientTitle,
|
|
685
|
-
start_date: !isNormalProduct ? item === null || item === void 0 || (_item$
|
|
686
|
-
end_date: !isNormalProduct ? item === null || item === void 0 || (_item$
|
|
687
|
-
holder_id: (item === null || item === void 0 || (_item$
|
|
687
|
+
start_date: !isNormalProduct ? item === null || item === void 0 || (_item$_extend25 = item._extend) === null || _item$_extend25 === void 0 ? void 0 : _item$_extend25.start_date : '',
|
|
688
|
+
end_date: !isNormalProduct ? item === null || item === void 0 || (_item$_extend26 = item._extend) === null || _item$_extend26 === void 0 ? void 0 : _item$_extend26.end_date : '',
|
|
689
|
+
holder_id: (item === null || item === void 0 || (_item$_extend27 = item._extend) === null || _item$_extend27 === void 0 ? void 0 : _item$_extend27.holder_id) || 0,
|
|
688
690
|
isNormalProduct: isNormalProduct,
|
|
689
691
|
locale: state.locale,
|
|
690
692
|
symbol: state.amountSymbol,
|
|
691
|
-
relation_products: (item === null || item === void 0 || (_item$
|
|
692
|
-
items: isEventBooking(state) ? [] : formItems((item === null || item === void 0 || (_item$
|
|
693
|
+
relation_products: (item === null || item === void 0 || (_item$_extend28 = item._extend) === null || _item$_extend28 === void 0 ? void 0 : _item$_extend28.relation_details) || [],
|
|
694
|
+
items: isEventBooking(state) ? [] : formItems((item === null || item === void 0 || (_item$_extend29 = item._extend) === null || _item$_extend29 === void 0 ? void 0 : _item$_extend29.items) || [])
|
|
693
695
|
}, generalParams), {}, {
|
|
694
696
|
_origin: item
|
|
695
697
|
});
|
|
@@ -698,8 +700,8 @@ export var formatProducts = function formatProducts(lists, state) {
|
|
|
698
700
|
if (isRenderGroup) {
|
|
699
701
|
// 将商品分为组商品和非组商品
|
|
700
702
|
lists.forEach(function (item) {
|
|
701
|
-
var _item$
|
|
702
|
-
if (!(item !== null && item !== void 0 && (_item$
|
|
703
|
+
var _item$_extend30;
|
|
704
|
+
if (!(item !== null && item !== void 0 && (_item$_extend30 = item._extend) !== null && _item$_extend30 !== void 0 && _item$_extend30.groupId)) {
|
|
703
705
|
normalList.push(formItem(item));
|
|
704
706
|
} else {
|
|
705
707
|
groupList.push(item);
|
|
@@ -708,8 +710,8 @@ export var formatProducts = function formatProducts(lists, state) {
|
|
|
708
710
|
|
|
709
711
|
// 根据item._extend.groupId 进行分组
|
|
710
712
|
var groups = groupList.reduce(function (prev, item) {
|
|
711
|
-
var _item$
|
|
712
|
-
var groupId = item === null || item === void 0 || (_item$
|
|
713
|
+
var _item$_extend31;
|
|
714
|
+
var groupId = item === null || item === void 0 || (_item$_extend31 = item._extend) === null || _item$_extend31 === void 0 ? void 0 : _item$_extend31.groupId;
|
|
713
715
|
if (!prev[groupId]) {
|
|
714
716
|
prev[groupId] = [];
|
|
715
717
|
}
|
|
@@ -877,8 +879,8 @@ export var isHasDayAppointmentProduct = function isHasDayAppointmentProduct(stat
|
|
|
877
879
|
// 如果该购物车中没选择任何商品,则不需要验证,所以直接用1来填充
|
|
878
880
|
// services: !holderProducts?.length ? [1] : holderProducts?.filter((d: any) => appointmentTypes.includes(d.extension_type))
|
|
879
881
|
services: services.filter(function (item) {
|
|
880
|
-
var _item$
|
|
881
|
-
return ((_item$
|
|
882
|
+
var _item$_extend32;
|
|
883
|
+
return ((_item$_extend32 = item._extend) === null || _item$_extend32 === void 0 ? void 0 : _item$_extend32.holder_id) == d.form_record_id && checkType(item.extension_type);
|
|
882
884
|
})
|
|
883
885
|
});
|
|
884
886
|
});
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export interface FormState {
|
|
3
2
|
amountSymbol: string;
|
|
4
3
|
apis: {
|
|
@@ -110,11 +109,4 @@ export declare const walkInData: {
|
|
|
110
109
|
id: number;
|
|
111
110
|
nickname: string;
|
|
112
111
|
};
|
|
113
|
-
export declare const Provider:
|
|
114
|
-
state: FormState;
|
|
115
|
-
} & {
|
|
116
|
-
dispatch: (params: {
|
|
117
|
-
type: string;
|
|
118
|
-
payload: any;
|
|
119
|
-
}) => void;
|
|
120
|
-
}>;
|
|
112
|
+
export declare const Provider: any, Context: any;
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { FormState } from "../model";
|
|
3
|
-
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
4
|
-
state: FormState;
|
|
5
|
-
} & {
|
|
6
|
-
dispatch: (params: {
|
|
7
|
-
type: string;
|
|
8
|
-
payload: any;
|
|
9
|
-
}) => void;
|
|
10
|
-
}>;
|
|
1
|
+
export declare const Provider: any, Context: any;
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { FormState } from "../model";
|
|
3
|
-
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
4
|
-
state: FormState;
|
|
5
|
-
} & {
|
|
6
|
-
dispatch: (params: {
|
|
7
|
-
type: string;
|
|
8
|
-
payload: any;
|
|
9
|
-
}) => void;
|
|
10
|
-
}>;
|
|
1
|
+
export declare const Provider: any, Context: any;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export interface FormState {
|
|
3
2
|
platform: 'pc' | 'h5' | '' | undefined;
|
|
4
3
|
order: any;
|
|
@@ -30,11 +29,4 @@ export interface PayGroup {
|
|
|
30
29
|
_order: any;
|
|
31
30
|
front_order_uuid?: string;
|
|
32
31
|
}
|
|
33
|
-
export declare const Provider:
|
|
34
|
-
state: FormState;
|
|
35
|
-
} & {
|
|
36
|
-
dispatch: (params: {
|
|
37
|
-
type: string;
|
|
38
|
-
payload: any;
|
|
39
|
-
}) => void;
|
|
40
|
-
}>;
|
|
32
|
+
export declare const Provider: any, Context: any;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { CalendarDataItem, ScheduleItem } from "./type";
|
|
3
2
|
import dayjs from "dayjs";
|
|
4
3
|
export interface FormState {
|
|
@@ -69,11 +68,4 @@ export interface FormState {
|
|
|
69
68
|
};
|
|
70
69
|
setGlobalState: Function | null;
|
|
71
70
|
}
|
|
72
|
-
export declare const Provider:
|
|
73
|
-
state: FormState;
|
|
74
|
-
} & {
|
|
75
|
-
dispatch: (params: {
|
|
76
|
-
type: string;
|
|
77
|
-
payload: any;
|
|
78
|
-
}) => void;
|
|
79
|
-
}>;
|
|
71
|
+
export declare const Provider: any, Context: any;
|
|
@@ -114,20 +114,15 @@ var Header = () => {
|
|
|
114
114
|
isSkip: false
|
|
115
115
|
});
|
|
116
116
|
}
|
|
117
|
-
|
|
117
|
+
const isServiceStep = (prevStepData == null ? void 0 : prevStepData.key) === "select-service";
|
|
118
|
+
const isResourceStep = (prevStepData == null ? void 0 : prevStepData.key) === "select-resource";
|
|
119
|
+
if (isServiceStep || isResourceStep) {
|
|
118
120
|
stepList.forEach((item) => {
|
|
119
121
|
if (item.key.startsWith("select-resource_") || item.key.startsWith("fill-form_")) {
|
|
120
122
|
removeStep(item.key);
|
|
121
123
|
}
|
|
122
124
|
});
|
|
123
125
|
}
|
|
124
|
-
if ((prevStepData == null ? void 0 : prevStepData.key) === "select-resource") {
|
|
125
|
-
stepList.forEach((item) => {
|
|
126
|
-
if (item.key.startsWith("fill-form_")) {
|
|
127
|
-
removeStep(item.key);
|
|
128
|
-
}
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
126
|
};
|
|
132
127
|
const handleClose = () => {
|
|
133
128
|
var _a2, _b;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __export = (target, all) => {
|
|
8
|
+
for (var name in all)
|
|
9
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
10
|
+
};
|
|
11
|
+
var __copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
+
for (let key of __getOwnPropNames(from))
|
|
14
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
+
}
|
|
17
|
+
return to;
|
|
18
|
+
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
27
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
|
+
|
|
29
|
+
// src/components/appointmentBooking/components/TimeSlicing/components/SelectDateOS.tsx
|
|
30
|
+
var SelectDateOS_exports = {};
|
|
31
|
+
__export(SelectDateOS_exports, {
|
|
32
|
+
default: () => SelectDateOS_default
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(SelectDateOS_exports);
|
|
35
|
+
var import_react = __toESM(require("react"));
|
|
36
|
+
var import_hooks = require("../../../hooks");
|
|
37
|
+
var import_context = require("../../../context");
|
|
38
|
+
var import_useComponents = __toESM(require("../../../../../hooks/useComponents"));
|
|
39
|
+
var import_utils = require("../../../utils");
|
|
40
|
+
var import_hooks2 = require("../../../hooks");
|
|
41
|
+
var import_utils2 = require("../../../utils");
|
|
42
|
+
var SelectDate = (props) => {
|
|
43
|
+
const { onDateChange, times, currentDate } = props;
|
|
44
|
+
const appointmentBooking = (0, import_hooks.useAppointmentBooking)();
|
|
45
|
+
const { currentSelectedResources, setTimes } = (0, import_context.useAppointmentBookingContext)();
|
|
46
|
+
const utils = (0, import_hooks2.contextUtils)();
|
|
47
|
+
const [SelectDateOS] = (0, import_useComponents.default)({
|
|
48
|
+
components: ["SelectDateOS"]
|
|
49
|
+
});
|
|
50
|
+
const resourceCode = (0, import_react.useMemo)(() => {
|
|
51
|
+
const { resourceSort } = (appointmentBooking == null ? void 0 : appointmentBooking.otherParams) || {};
|
|
52
|
+
const resources = appointmentBooking.getResourcesList();
|
|
53
|
+
const { resourceCodes } = (0, import_utils.processResourceList)(resources, resourceSort);
|
|
54
|
+
return (resourceCodes == null ? void 0 : resourceCodes[0]) || "";
|
|
55
|
+
}, []);
|
|
56
|
+
const currentResourceName = (0, import_react.useMemo)(() => {
|
|
57
|
+
var _a;
|
|
58
|
+
const currentResource = (_a = currentSelectedResources == null ? void 0 : currentSelectedResources[0]) == null ? void 0 : _a.currentSelectedResource;
|
|
59
|
+
const resourceItem = (currentResource == null ? void 0 : currentResource.resourceItem) || {};
|
|
60
|
+
const name = (0, import_utils.getResourceTitle)(
|
|
61
|
+
appointmentBooking,
|
|
62
|
+
resourceItem == null ? void 0 : resourceItem.code,
|
|
63
|
+
utils,
|
|
64
|
+
resourceItem
|
|
65
|
+
);
|
|
66
|
+
return name;
|
|
67
|
+
}, [currentSelectedResources]);
|
|
68
|
+
const onStepChange = () => {
|
|
69
|
+
(0, import_utils2.clearDataByStepKey)("select-service", appointmentBooking, setTimes);
|
|
70
|
+
const stepLists = appointmentBooking.getStepList();
|
|
71
|
+
const serviceIndex = stepLists.findIndex(
|
|
72
|
+
(item) => (item == null ? void 0 : item.key) === "select-service"
|
|
73
|
+
);
|
|
74
|
+
appointmentBooking.gotoStep(serviceIndex);
|
|
75
|
+
};
|
|
76
|
+
return SelectDateOS ? /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(
|
|
77
|
+
SelectDateOS,
|
|
78
|
+
{
|
|
79
|
+
isTimeSlicing: true,
|
|
80
|
+
currentDate,
|
|
81
|
+
resourceCode,
|
|
82
|
+
resourceName: currentResourceName,
|
|
83
|
+
onDateChange,
|
|
84
|
+
onStepChange,
|
|
85
|
+
times
|
|
86
|
+
}
|
|
87
|
+
)) : null;
|
|
88
|
+
};
|
|
89
|
+
var SelectDateOS_default = SelectDate;
|
|
@@ -39,6 +39,7 @@ var import_context = require("../../context");
|
|
|
39
39
|
var import_utils2 = require("../Resource/utils");
|
|
40
40
|
var import_hooks = require("../../hooks");
|
|
41
41
|
var import_utils3 = require("../../utils");
|
|
42
|
+
var import_SelectDateOS = __toESM(require("./components/SelectDateOS"));
|
|
42
43
|
var import_index = require("./index.less");
|
|
43
44
|
var TimeSlicing = (0, import_react.forwardRef)((props, ref) => {
|
|
44
45
|
const [selectedResource, setSelectedResource] = (0, import_react.useState)("");
|
|
@@ -51,6 +52,7 @@ var TimeSlicing = (0, import_react.forwardRef)((props, ref) => {
|
|
|
51
52
|
} = (0, import_context.useAppointmentBookingContext)();
|
|
52
53
|
const { getResourceTimeSlot, getResourceList } = (0, import_hooks.useAppointmentBookingResource)();
|
|
53
54
|
const { nextStep } = (0, import_hooks.useAppointmentBookingStep)();
|
|
55
|
+
const [currentDate, setCurrentDate] = (0, import_react.useState)(void 0);
|
|
54
56
|
(0, import_react.useImperativeHandle)(ref, () => ({
|
|
55
57
|
next: () => {
|
|
56
58
|
const isUnSelectedTimes = appointmentBooking.checkCartItems("date");
|
|
@@ -85,7 +87,30 @@ var TimeSlicing = (0, import_react.forwardRef)((props, ref) => {
|
|
|
85
87
|
setSelectedResource(e == null ? void 0 : e.start_time);
|
|
86
88
|
getAutoSelect(e);
|
|
87
89
|
};
|
|
88
|
-
|
|
90
|
+
(0, import_react.useEffect)(() => {
|
|
91
|
+
const getCurrentDate = async () => {
|
|
92
|
+
var _a;
|
|
93
|
+
const res = await appointmentBooking.getDateRange();
|
|
94
|
+
const date = (_a = res == null ? void 0 : res[0]) == null ? void 0 : _a.date;
|
|
95
|
+
setCurrentDate(date);
|
|
96
|
+
};
|
|
97
|
+
getCurrentDate();
|
|
98
|
+
}, []);
|
|
99
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
|
|
100
|
+
import_SelectDateOS.default,
|
|
101
|
+
{
|
|
102
|
+
onDateChange: (currentData) => {
|
|
103
|
+
if ((times == null ? void 0 : times.length) > 0) {
|
|
104
|
+
appointmentBooking.deleteCartItemInfo("time");
|
|
105
|
+
}
|
|
106
|
+
setCurrentDate(currentData == null ? void 0 : currentData.date);
|
|
107
|
+
appointmentBooking.setDateRange([currentData]);
|
|
108
|
+
getResourceTimeSlot();
|
|
109
|
+
},
|
|
110
|
+
times,
|
|
111
|
+
currentDate
|
|
112
|
+
}
|
|
113
|
+
), (times == null ? void 0 : times.length) > 0 ? /* @__PURE__ */ import_react.default.createElement("div", { className: "appointment-time-slicing-wrap" }, times.map((item, index) => {
|
|
89
114
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
90
115
|
"div",
|
|
91
116
|
{
|
|
@@ -96,11 +121,6 @@ var TimeSlicing = (0, import_react.forwardRef)((props, ref) => {
|
|
|
96
121
|
/* @__PURE__ */ import_react.default.createElement("span", null, item == null ? void 0 : item.start_time),
|
|
97
122
|
/* @__PURE__ */ import_react.default.createElement(import_materials.Iconfont, { type: "pisell2-chevron-right", className: `icon` })
|
|
98
123
|
);
|
|
99
|
-
})) :
|
|
100
|
-
import_materials.PisellEmpty,
|
|
101
|
-
{
|
|
102
|
-
description: import_utils.locales.getText("pisell2.appointment.unselect.time")
|
|
103
|
-
}
|
|
104
|
-
);
|
|
124
|
+
})) : null);
|
|
105
125
|
});
|
|
106
126
|
var TimeSlicing_default = TimeSlicing;
|
|
@@ -43,6 +43,7 @@ var import_materials = require("@pisell/materials");
|
|
|
43
43
|
var import_hooks = require("../../hooks");
|
|
44
44
|
var import_voucher = require("../../../booking/components/voucher/index.less");
|
|
45
45
|
var import_index = require("./index.less");
|
|
46
|
+
var import_ahooks = require("ahooks");
|
|
46
47
|
var ShopDiscountHooks = {
|
|
47
48
|
onInited: "shopDiscount:onInited",
|
|
48
49
|
onDestroy: "shopDiscount:onDestroy",
|
|
@@ -89,6 +90,12 @@ var VoucherCard = (props) => {
|
|
|
89
90
|
(0, import_react.useEffect)(() => {
|
|
90
91
|
shopDiscount.setProductList(products);
|
|
91
92
|
}, [products]);
|
|
93
|
+
const { run: onCartChange } = (0, import_ahooks.useDebounceFn)(
|
|
94
|
+
() => {
|
|
95
|
+
onCartChangeFn();
|
|
96
|
+
},
|
|
97
|
+
{ wait: 300 }
|
|
98
|
+
);
|
|
92
99
|
const batchUpdateCart = (productList) => {
|
|
93
100
|
var _a2;
|
|
94
101
|
const items = productList.map((item) => {
|
|
@@ -106,13 +113,16 @@ var VoucherCard = (props) => {
|
|
|
106
113
|
});
|
|
107
114
|
(_a2 = appointmentBooking == null ? void 0 : appointmentBooking.batchUpdateCart) == null ? void 0 : _a2.call(appointmentBooking, items);
|
|
108
115
|
};
|
|
109
|
-
const
|
|
110
|
-
var _a2, _b2, _c;
|
|
116
|
+
const onCartChangeFn = () => {
|
|
117
|
+
var _a2, _b2, _c, _d;
|
|
111
118
|
const products2 = cart == null ? void 0 : cart.getItems();
|
|
112
119
|
(_c = shopDiscount == null ? void 0 : shopDiscount.setBookingSubject) == null ? void 0 : _c.call(
|
|
113
120
|
shopDiscount,
|
|
114
121
|
(_b2 = (_a2 = appointmentBooking == null ? void 0 : appointmentBooking.otherParams) == null ? void 0 : _a2.bookingSetting) == null ? void 0 : _b2.bookingSubject
|
|
115
122
|
);
|
|
123
|
+
if (Array.isArray((_d = shopDiscount == null ? void 0 : shopDiscount.getDiscountList) == null ? void 0 : _d.call(shopDiscount)) && !(shopDiscount == null ? void 0 : shopDiscount.getDiscountList().length)) {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
116
126
|
const val = shopDiscount.calcDiscount(products2);
|
|
117
127
|
batchUpdateCart(val.productList);
|
|
118
128
|
};
|
|
@@ -72,7 +72,7 @@ export declare const useAppointmentBookingAccount: () => {
|
|
|
72
72
|
export declare const useAppointmentBookingResource: () => {
|
|
73
73
|
getResourceTimeSlot: (index?: number) => Promise<void>;
|
|
74
74
|
getResourceList: () => {
|
|
75
|
-
resources: any;
|
|
75
|
+
resources: any[];
|
|
76
76
|
resourceCodes: any;
|
|
77
77
|
};
|
|
78
78
|
};
|
|
@@ -489,18 +489,13 @@ var useAppointmentBookingResource = () => {
|
|
|
489
489
|
const { appointmentBooking, setResources, setTimes } = (0, import_context.useAppointmentBookingContext)();
|
|
490
490
|
const { resourceSort } = (appointmentBooking == null ? void 0 : appointmentBooking.otherParams) || {};
|
|
491
491
|
const getResourceList = () => {
|
|
492
|
-
var _a;
|
|
493
492
|
let resources = appointmentBooking.getResourcesList();
|
|
494
|
-
resources =
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
}
|
|
500
|
-
const _resources = ((_a = resources == null ? void 0 : resources[0]) == null ? void 0 : _a.resources) || [];
|
|
501
|
-
const resourceCodes = _resources.map((item) => item.code);
|
|
502
|
-
setResources(resources || []);
|
|
503
|
-
return { resources, resourceCodes };
|
|
493
|
+
const { resources: processedResources, resourceCodes } = (0, import_utils2.processResourceList)(
|
|
494
|
+
resources,
|
|
495
|
+
resourceSort
|
|
496
|
+
);
|
|
497
|
+
setResources(processedResources || []);
|
|
498
|
+
return { resources: processedResources, resourceCodes };
|
|
504
499
|
};
|
|
505
500
|
const getResourceTimeSlot = async (index) => {
|
|
506
501
|
const { resourceCodes } = getResourceList();
|
|
@@ -39,6 +39,19 @@ export declare const formatCarts: (data: any[], resources: any[], utils: any, ac
|
|
|
39
39
|
* @Date: 2025-04-14 11:16
|
|
40
40
|
*/
|
|
41
41
|
export declare const sortResources: (resources: any[], resourceSort: any[]) => any[] | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* @title: 处理资源列表并提取资源代码
|
|
44
|
+
* @description: 对资源列表进行排序,并提取 resourceCodes
|
|
45
|
+
* @param {any[]} resources - 原始资源列表
|
|
46
|
+
* @param {any[]} resourceSort - 资源排序配置
|
|
47
|
+
* @return {*} 返回处理后的资源列表和资源代码数组
|
|
48
|
+
* @Author: WangHan
|
|
49
|
+
* @Date: 2025-11-21 15:33
|
|
50
|
+
*/
|
|
51
|
+
export declare const processResourceList: (resources: any[], resourceSort: any[]) => {
|
|
52
|
+
resources: any[];
|
|
53
|
+
resourceCodes: any;
|
|
54
|
+
};
|
|
42
55
|
export declare const getMeAccount: (val: any[]) => any;
|
|
43
56
|
export declare const getCustomer: (utils: any) => any;
|
|
44
57
|
export declare const formatCustomer: (val: any) => {
|
|
@@ -201,3 +214,13 @@ export declare const currentRenderLists: (resources: any[], code: any) => any;
|
|
|
201
214
|
* @Date: 2025-05-25 23:17
|
|
202
215
|
*/
|
|
203
216
|
export declare const updateCartResources: (item: any, value?: any, currentSelectedResources?: any) => any;
|
|
217
|
+
/**
|
|
218
|
+
* @title: 根据步骤key清空数据
|
|
219
|
+
* @param {string} key - 当前步骤的key
|
|
220
|
+
* @param {any} appointmentBooking - 预约预订实例
|
|
221
|
+
* @param {(times: any[]) => void} setTimes - 设置时间列表的回调函数
|
|
222
|
+
* @return {string[]} 返回需要清空的数据类型数组
|
|
223
|
+
* @Author: WangHan
|
|
224
|
+
* @Date: 2025-11-21 15:40
|
|
225
|
+
*/
|
|
226
|
+
export declare const clearDataByStepKey: (key: string, appointmentBooking: any, setTimes?: ((times: any[]) => void) | undefined) => string[] | undefined;
|