@pisell/private-materials 3.3.34 → 3.3.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +3 -3
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +5 -5
- package/es/components/Sales/Cart/index.js +26 -13
- package/es/components/Sales/Cart/types.d.ts +12 -0
- package/es/components/Sales/Cart/utils.d.ts +23 -0
- package/es/components/Sales/Cart/utils.js +161 -0
- package/es/components/Sales/Checkout/utils.d.ts +9 -1
- package/es/components/Sales/Checkout/utils.js +25 -3
- package/es/components/Sales/Event/Detail.d.ts +2 -0
- package/es/components/Sales/Event/Detail.js +56 -13
- package/es/components/Sales/Event/serve.d.ts +10 -0
- package/es/components/Sales/Event/serve.js +26 -1
- package/es/components/Sales/Summary/utils.js +1 -0
- package/es/components/appointmentBooking/components/Cart/ContinueButton/index.js +18 -17
- package/es/components/appointmentBooking/components/Cart/Item/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Cart/Item/index.js +21 -20
- package/es/components/appointmentBooking/components/ConfirmInformation/index.js +156 -53
- package/es/components/appointmentBooking/components/ConfirmInformation/utils.d.ts +12 -0
- package/es/components/appointmentBooking/components/ConfirmInformation/utils.js +17 -0
- package/es/components/appointmentBooking/components/Content/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Content/index.js +26 -25
- package/es/components/appointmentBooking/components/Content/index.less +23 -1
- package/es/components/appointmentBooking/components/Footer/index.js +5 -5
- package/es/components/appointmentBooking/components/Header/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Header/index.js +7 -7
- package/es/components/appointmentBooking/components/Services/index.js +50 -25
- package/es/components/appointmentBooking/hooks.d.ts +2 -1
- package/es/components/appointmentBooking/hooks.js +52 -47
- package/es/components/appointmentBooking/index.d.ts +0 -1
- package/es/components/booking/components/TabProduct/index.d.ts +0 -1
- package/es/components/booking/components/TabProduct/productItem/index.d.ts +0 -1
- package/es/components/booking/components/footer/index.d.ts +0 -1
- package/es/components/booking/deposit/index.d.ts +0 -1
- package/es/components/booking/forms/single/index.d.ts +0 -1
- package/es/components/booking/info/addServiceVariant/index.d.ts +0 -1
- package/es/components/booking/info/clientVariant/hooks/useClientFn.d.ts +0 -1
- package/es/components/booking/info/date/index.d.ts +0 -1
- package/es/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
- package/es/components/booking/info/index.d.ts +0 -1
- package/es/components/booking/info/service/Lists.d.ts +0 -1
- package/es/components/booking/info/service/actions/index.d.ts +0 -1
- package/es/components/booking/info/service/addService/index.d.ts +0 -1
- package/es/components/booking/info/service/addTimeModal/index.d.ts +0 -1
- package/es/components/booking/info/service/serviceList/index.d.ts +0 -1
- package/es/components/booking/info/service2/Lists.d.ts +0 -1
- package/es/components/booking/info2/service/actions/index.d.ts +0 -1
- package/es/components/booking/info2/service/addService/index.d.ts +0 -1
- package/es/components/booking/info2/service/addTimeModal/index.d.ts +0 -1
- package/es/components/booking/info2/service/serviceList/index.d.ts +0 -1
- package/es/components/booking/materiels/duration/index.d.ts +0 -1
- package/es/components/booking/materiels/holder/index.d.ts +0 -1
- package/es/components/booking/materiels/startTime/index.d.ts +0 -1
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/booking/utils.js +19 -11
- package/es/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +218 -73
- package/es/components/eventBooking/components/Provider/Cart/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/SelectHolderModal.d.ts +0 -1
- package/es/components/eventBooking/components/bookingDetailModal/components/BookingOptions.d.ts +3 -1
- package/es/components/eventBooking/components/bookingDetailModal/components/BookingOptions.js +7 -4
- package/es/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +0 -1
- package/es/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +0 -1
- package/es/components/eventBooking/components/bookingDetailModal/index.js +70 -13
- package/es/components/eventBooking/index.d.ts +0 -1
- package/es/components/productExtension/fields/Actor/index.d.ts +0 -1
- package/es/components/productExtension/fields/Forms/index.d.ts +0 -1
- package/es/components/productExtension/fields/SelectProducts/index.d.ts +0 -1
- package/es/components/productExtension/index.d.ts +0 -1
- package/es/components/productSelect/components/TabProduct/index.js +4 -2
- package/es/components/ticketBooking/components/ticketBooking/index.d.ts +0 -1
- package/es/components/ticketBooking/index.d.ts +0 -1
- package/lib/components/Sales/Cart/index.js +30 -18
- package/lib/components/Sales/Cart/types.d.ts +12 -0
- package/lib/components/Sales/Cart/utils.d.ts +23 -0
- package/lib/components/Sales/Cart/utils.js +149 -0
- package/lib/components/Sales/Checkout/utils.d.ts +9 -1
- package/lib/components/Sales/Checkout/utils.js +18 -4
- package/lib/components/Sales/Event/Detail.d.ts +2 -0
- package/lib/components/Sales/Event/Detail.js +34 -10
- package/lib/components/Sales/Event/serve.d.ts +10 -0
- package/lib/components/Sales/Event/serve.js +5 -2
- package/lib/components/Sales/Summary/utils.js +1 -0
- package/lib/components/appointmentBooking/components/Cart/ContinueButton/index.js +3 -3
- package/lib/components/appointmentBooking/components/Cart/Item/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Cart/Item/index.js +1 -1
- package/lib/components/appointmentBooking/components/ConfirmInformation/index.js +43 -6
- package/lib/components/appointmentBooking/components/ConfirmInformation/utils.d.ts +12 -0
- package/lib/components/appointmentBooking/components/ConfirmInformation/utils.js +37 -0
- package/lib/components/appointmentBooking/components/Content/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Content/index.js +7 -7
- package/lib/components/appointmentBooking/components/Content/index.less +23 -1
- package/lib/components/appointmentBooking/components/Header/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Header/index.js +5 -3
- package/lib/components/appointmentBooking/components/Services/index.js +18 -10
- package/lib/components/appointmentBooking/hooks.d.ts +2 -1
- package/lib/components/appointmentBooking/hooks.js +9 -3
- package/lib/components/appointmentBooking/index.d.ts +0 -1
- package/lib/components/booking/components/TabProduct/index.d.ts +0 -1
- package/lib/components/booking/components/TabProduct/productItem/index.d.ts +0 -1
- package/lib/components/booking/components/footer/index.d.ts +0 -1
- package/lib/components/booking/deposit/index.d.ts +0 -1
- package/lib/components/booking/forms/single/index.d.ts +0 -1
- package/lib/components/booking/info/addServiceVariant/index.d.ts +0 -1
- package/lib/components/booking/info/clientVariant/hooks/useClientFn.d.ts +0 -1
- package/lib/components/booking/info/date/index.d.ts +0 -1
- package/lib/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
- package/lib/components/booking/info/index.d.ts +0 -1
- package/lib/components/booking/info/service/Lists.d.ts +0 -1
- package/lib/components/booking/info/service/actions/index.d.ts +0 -1
- package/lib/components/booking/info/service/addService/index.d.ts +0 -1
- package/lib/components/booking/info/service/addTimeModal/index.d.ts +0 -1
- package/lib/components/booking/info/service/serviceList/index.d.ts +0 -1
- package/lib/components/booking/info/service2/Lists.d.ts +0 -1
- package/lib/components/booking/info2/service/actions/index.d.ts +0 -1
- package/lib/components/booking/info2/service/addService/index.d.ts +0 -1
- package/lib/components/booking/info2/service/addTimeModal/index.d.ts +0 -1
- package/lib/components/booking/info2/service/serviceList/index.d.ts +0 -1
- package/lib/components/booking/materiels/duration/index.d.ts +0 -1
- package/lib/components/booking/materiels/holder/index.d.ts +0 -1
- package/lib/components/booking/materiels/startTime/index.d.ts +0 -1
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/booking/utils.js +5 -1
- package/lib/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +128 -42
- package/lib/components/eventBooking/components/Provider/Cart/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/SelectHolderModal.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingDetailModal/components/BookingOptions.d.ts +3 -1
- package/lib/components/eventBooking/components/bookingDetailModal/components/BookingOptions.js +7 -2
- package/lib/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingDetailModal/index.js +79 -24
- package/lib/components/eventBooking/index.d.ts +0 -1
- package/lib/components/productExtension/fields/Actor/index.d.ts +0 -1
- package/lib/components/productExtension/fields/Forms/index.d.ts +0 -1
- package/lib/components/productExtension/fields/SelectProducts/index.d.ts +0 -1
- package/lib/components/productExtension/index.d.ts +0 -1
- package/lib/components/productSelect/components/TabProduct/index.js +6 -2
- package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +0 -1
- package/lib/components/ticketBooking/index.d.ts +0 -1
- package/package.json +4 -4
|
@@ -17,11 +17,11 @@ var Footer = function Footer(_ref) {
|
|
|
17
17
|
var _currentStep$step;
|
|
18
18
|
var onNext = _ref.onNext,
|
|
19
19
|
isOpen = _ref.isOpen;
|
|
20
|
-
var
|
|
21
|
-
carts =
|
|
22
|
-
currentStep =
|
|
23
|
-
isErrorHolder =
|
|
24
|
-
setIsErrorHolder =
|
|
20
|
+
var _ref2 = useAppointmentBookingContext(),
|
|
21
|
+
carts = _ref2.carts,
|
|
22
|
+
currentStep = _ref2.currentStep,
|
|
23
|
+
isErrorHolder = _ref2.isErrorHolder,
|
|
24
|
+
setIsErrorHolder = _ref2.setIsErrorHolder;
|
|
25
25
|
var _useState = useState(false),
|
|
26
26
|
_useState2 = _slicedToArray(_useState, 2),
|
|
27
27
|
open = _useState2[0],
|
|
@@ -62,7 +62,7 @@ var Header = function Header() {
|
|
|
62
62
|
var handleBack = /*#__PURE__*/function () {
|
|
63
63
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
64
64
|
var _currentStep$step4;
|
|
65
|
-
var key, types, _carts$, type, resourceStep;
|
|
65
|
+
var key, types, _carts$, type, resourceStep, prevStepData, currentStepData, _key;
|
|
66
66
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
67
67
|
while (1) switch (_context.prev = _context.next) {
|
|
68
68
|
case 0:
|
|
@@ -125,15 +125,15 @@ var Header = function Header() {
|
|
|
125
125
|
|
|
126
126
|
// 6. 默认回退一步
|
|
127
127
|
appointmentBooking.back();
|
|
128
|
-
|
|
129
|
-
//
|
|
130
|
-
if (
|
|
131
|
-
|
|
132
|
-
|
|
128
|
+
prevStepData = stepList[(currentStep === null || currentStep === void 0 ? void 0 : currentStep.index) - 1];
|
|
129
|
+
currentStepData = stepList[currentStep === null || currentStep === void 0 ? void 0 : currentStep.index]; // 如果当前步骤或者前一步骤被跳过,则将步骤更新为false
|
|
130
|
+
if (currentStepData !== null && currentStepData !== void 0 && currentStepData.isSkip || prevStepData !== null && prevStepData !== void 0 && prevStepData.isSkip) {
|
|
131
|
+
_key = currentStepData !== null && currentStepData !== void 0 && currentStepData.isSkip ? currentStepData === null || currentStepData === void 0 ? void 0 : currentStepData.key : prevStepData === null || prevStepData === void 0 ? void 0 : prevStepData.key;
|
|
132
|
+
updateStep(_key, {
|
|
133
133
|
isSkip: false
|
|
134
134
|
});
|
|
135
135
|
}
|
|
136
|
-
case
|
|
136
|
+
case 18:
|
|
137
137
|
case "end":
|
|
138
138
|
return _context.stop();
|
|
139
139
|
}
|
|
@@ -28,15 +28,16 @@ var Services = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
28
28
|
utils = _ref.utils;
|
|
29
29
|
var appointmentBooking = useAppointmentBooking();
|
|
30
30
|
var _useAppointmentBookin = useAppointmentBookingSetting(),
|
|
31
|
-
isDateSelectedFirst = _useAppointmentBookin.isDateSelectedFirst
|
|
31
|
+
isDateSelectedFirst = _useAppointmentBookin.isDateSelectedFirst,
|
|
32
|
+
isRetailTemplate = _useAppointmentBookin.isRetailTemplate;
|
|
32
33
|
var _useAppointmentBookin2 = useAppointmentBookingProduct(),
|
|
33
34
|
getProducts = _useAppointmentBookin2.getProducts,
|
|
34
35
|
checkProductType = _useAppointmentBookin2.checkProductType;
|
|
35
36
|
var _useAppointmentBookin3 = useAppointmentBookingStep(),
|
|
36
37
|
removeStep = _useAppointmentBookin3.removeStep,
|
|
37
38
|
nextStep = _useAppointmentBookin3.nextStep;
|
|
38
|
-
var
|
|
39
|
-
currentStep =
|
|
39
|
+
var _ref2 = useAppointmentBookingContext(),
|
|
40
|
+
currentStep = _ref2.currentStep;
|
|
40
41
|
var _useState = useState(null),
|
|
41
42
|
_useState2 = _slicedToArray(_useState, 2),
|
|
42
43
|
products = _useState2[0],
|
|
@@ -63,18 +64,25 @@ var Services = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
63
64
|
});
|
|
64
65
|
}, [isDateSelectedFirst]);
|
|
65
66
|
var handleSelectProduct = /*#__PURE__*/function () {
|
|
66
|
-
var
|
|
67
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(item) {
|
|
67
68
|
var type;
|
|
68
69
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
69
70
|
while (1) switch (_context2.prev = _context2.next) {
|
|
70
71
|
case 0:
|
|
71
|
-
|
|
72
|
+
// 不是零售模版才触发检测商品
|
|
73
|
+
type = '';
|
|
74
|
+
if (isRetailTemplate) {
|
|
75
|
+
_context2.next = 6;
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
78
|
+
_context2.next = 4;
|
|
72
79
|
return checkProductType(item === null || item === void 0 ? void 0 : item.id);
|
|
73
|
-
case
|
|
80
|
+
case 4:
|
|
74
81
|
type = _context2.sent;
|
|
75
82
|
if (type === 'session') {
|
|
76
83
|
appointmentBooking.openProductDetail(item.id);
|
|
77
84
|
}
|
|
85
|
+
case 6:
|
|
78
86
|
utils === null || utils === void 0 || utils.action({
|
|
79
87
|
type: 'pisell1.productDetail',
|
|
80
88
|
data: {
|
|
@@ -84,12 +92,31 @@ var Services = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
84
92
|
},
|
|
85
93
|
callback: function () {
|
|
86
94
|
var _callback = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data) {
|
|
87
|
-
var
|
|
95
|
+
var product, session, startDate, endDate, _data$origin, resources, activeStatus, index, description;
|
|
88
96
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
89
97
|
while (1) switch (_context.prev = _context.next) {
|
|
90
98
|
case 0:
|
|
99
|
+
product = _objectSpread(_objectSpread({}, data), {}, {
|
|
100
|
+
options: (data === null || data === void 0 ? void 0 : data.option) || []
|
|
101
|
+
});
|
|
102
|
+
delete product.option;
|
|
103
|
+
|
|
104
|
+
// 零售模版,直接加入购物车
|
|
105
|
+
if (!isRetailTemplate) {
|
|
106
|
+
_context.next = 7;
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
91
109
|
if (!(data !== null && data !== void 0 && data.isCancel)) {
|
|
92
|
-
_context.next =
|
|
110
|
+
_context.next = 5;
|
|
111
|
+
break;
|
|
112
|
+
}
|
|
113
|
+
return _context.abrupt("return");
|
|
114
|
+
case 5:
|
|
115
|
+
appointmentBooking.storeProduct(product);
|
|
116
|
+
return _context.abrupt("return");
|
|
117
|
+
case 7:
|
|
118
|
+
if (!(data !== null && data !== void 0 && data.isCancel)) {
|
|
119
|
+
_context.next = 10;
|
|
93
120
|
break;
|
|
94
121
|
}
|
|
95
122
|
if (type === 'session') {
|
|
@@ -97,14 +124,10 @@ var Services = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
97
124
|
appointmentBooking.getAvailableDate();
|
|
98
125
|
}
|
|
99
126
|
return _context.abrupt("return");
|
|
100
|
-
case
|
|
127
|
+
case 10:
|
|
101
128
|
session = data === null || data === void 0 ? void 0 : data.session;
|
|
102
|
-
product = _objectSpread(_objectSpread({}, data), {}, {
|
|
103
|
-
options: (data === null || data === void 0 ? void 0 : data.option) || []
|
|
104
|
-
});
|
|
105
|
-
delete product.option;
|
|
106
129
|
if (!session) {
|
|
107
|
-
_context.next =
|
|
130
|
+
_context.next = 20;
|
|
108
131
|
break;
|
|
109
132
|
}
|
|
110
133
|
startDate = dayjs(session === null || session === void 0 ? void 0 : session.start_at).format('YYYY-MM-DD');
|
|
@@ -117,32 +140,34 @@ var Services = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
117
140
|
}
|
|
118
141
|
});
|
|
119
142
|
appointmentBooking.closeProductDetail();
|
|
120
|
-
|
|
143
|
+
_context.next = 18;
|
|
144
|
+
return appointmentBooking.getAvailableDate({
|
|
121
145
|
startDate: startDate,
|
|
122
146
|
endDate: endDate
|
|
123
147
|
});
|
|
124
|
-
|
|
148
|
+
case 18:
|
|
149
|
+
_context.next = 28;
|
|
125
150
|
break;
|
|
126
|
-
case
|
|
151
|
+
case 20:
|
|
127
152
|
resources = (data === null || data === void 0 || (_data$origin = data.origin) === null || _data$origin === void 0 || (_data$origin = _data$origin.product_resource) === null || _data$origin === void 0 ? void 0 : _data$origin.resources) || [];
|
|
128
153
|
activeStatus = resources.find(function (item) {
|
|
129
154
|
return item.status === 1;
|
|
130
155
|
});
|
|
131
156
|
if (activeStatus) {
|
|
132
|
-
_context.next =
|
|
157
|
+
_context.next = 24;
|
|
133
158
|
break;
|
|
134
159
|
}
|
|
135
160
|
return _context.abrupt("return", Toast(locales.getText('pisell2.appointment.no.available.service')));
|
|
136
|
-
case
|
|
161
|
+
case 24:
|
|
137
162
|
appointmentBooking.storeProduct(product);
|
|
138
163
|
// duration 类型的商品,要获取一下资源
|
|
139
164
|
if (!(type === 'duration')) {
|
|
140
|
-
_context.next =
|
|
165
|
+
_context.next = 28;
|
|
141
166
|
break;
|
|
142
167
|
}
|
|
143
|
-
_context.next =
|
|
168
|
+
_context.next = 28;
|
|
144
169
|
return appointmentBooking.getAvailableDate();
|
|
145
|
-
case
|
|
170
|
+
case 28:
|
|
146
171
|
// 先选择日期流程
|
|
147
172
|
if (isDateSelectedFirst) {
|
|
148
173
|
index = (currentStep === null || currentStep === void 0 ? void 0 : currentStep.index) + 2; //先选择日期流程:如果商品类型是duration的商品,则需要增加选择时间步骤
|
|
@@ -163,7 +188,7 @@ var Services = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
163
188
|
removeStep('select-time');
|
|
164
189
|
}
|
|
165
190
|
}
|
|
166
|
-
case
|
|
191
|
+
case 29:
|
|
167
192
|
case "end":
|
|
168
193
|
return _context.stop();
|
|
169
194
|
}
|
|
@@ -175,14 +200,14 @@ var Services = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
175
200
|
return callback;
|
|
176
201
|
}()
|
|
177
202
|
});
|
|
178
|
-
case
|
|
203
|
+
case 7:
|
|
179
204
|
case "end":
|
|
180
205
|
return _context2.stop();
|
|
181
206
|
}
|
|
182
207
|
}, _callee2);
|
|
183
208
|
}));
|
|
184
209
|
return function handleSelectProduct(_x) {
|
|
185
|
-
return
|
|
210
|
+
return _ref3.apply(this, arguments);
|
|
186
211
|
};
|
|
187
212
|
}();
|
|
188
213
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -14,7 +14,7 @@ export declare const useAppointmentBookingStep: () => {
|
|
|
14
14
|
removeStep: (key: string) => any;
|
|
15
15
|
addStep: (props: any, stepKey?: string) => any;
|
|
16
16
|
updateStep: (key: string, step: any) => void;
|
|
17
|
-
nextStep: () =>
|
|
17
|
+
nextStep: () => any;
|
|
18
18
|
};
|
|
19
19
|
/**
|
|
20
20
|
* @title: 获取商品数据
|
|
@@ -97,6 +97,7 @@ export declare const useIsSkipResourceStep: () => {
|
|
|
97
97
|
export declare const useAppointmentBookingSetting: () => {
|
|
98
98
|
isDateSelectedFirst: boolean;
|
|
99
99
|
isFormSubject: boolean;
|
|
100
|
+
isRetailTemplate: any;
|
|
100
101
|
customPageId: any;
|
|
101
102
|
channel: any;
|
|
102
103
|
bookingSubject: any;
|
|
@@ -50,6 +50,8 @@ export var useAppointmentBookingStep = function useAppointmentBookingStep() {
|
|
|
50
50
|
setCurrentStep = _useAppointmentBookin.setCurrentStep,
|
|
51
51
|
policyIdsRef = _useAppointmentBookin.policyIdsRef,
|
|
52
52
|
openPolicy = _useAppointmentBookin.openPolicy;
|
|
53
|
+
var _useAppointmentBookin2 = useAppointmentBookingSetting(),
|
|
54
|
+
isRetailTemplate = _useAppointmentBookin2.isRetailTemplate;
|
|
53
55
|
var stepList = (appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$s = appointmentBooking.store) === null || _appointmentBooking$s === void 0 || (_appointmentBooking$s = _appointmentBooking$s.step) === null || _appointmentBooking$s === void 0 || (_appointmentBooking$s = _appointmentBooking$s.store) === null || _appointmentBooking$s === void 0 ? void 0 : _appointmentBooking$s.stepList) || [];
|
|
54
56
|
|
|
55
57
|
// 判断是否是最后一步
|
|
@@ -123,6 +125,9 @@ export var useAppointmentBookingStep = function useAppointmentBookingStep() {
|
|
|
123
125
|
// 下一步
|
|
124
126
|
var nextStep = function nextStep() {
|
|
125
127
|
var _appointmentBooking$s2;
|
|
128
|
+
if (isRetailTemplate) {
|
|
129
|
+
return appointmentBooking.next();
|
|
130
|
+
}
|
|
126
131
|
var currentStep = appointmentBooking === null || appointmentBooking === void 0 ? void 0 : appointmentBooking.getCurrentStep();
|
|
127
132
|
var stepList = (appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$s2 = appointmentBooking.store) === null || _appointmentBooking$s2 === void 0 || (_appointmentBooking$s2 = _appointmentBooking$s2.step) === null || _appointmentBooking$s2 === void 0 || (_appointmentBooking$s2 = _appointmentBooking$s2.store) === null || _appointmentBooking$s2 === void 0 ? void 0 : _appointmentBooking$s2.stepList) || [];
|
|
128
133
|
|
|
@@ -170,19 +175,17 @@ export var useAppointmentBookingStep = function useAppointmentBookingStep() {
|
|
|
170
175
|
* @Date: 2025-04-15 11:12
|
|
171
176
|
*/
|
|
172
177
|
export var useAppointmentBookingProduct = function useAppointmentBookingProduct() {
|
|
173
|
-
var
|
|
174
|
-
appointmentBooking =
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
bookingProcess = _ref3.bookingProcess,
|
|
180
|
-
bookingSubject = _ref3.bookingSubject;
|
|
178
|
+
var _ref2 = useAppointmentBookingContext(),
|
|
179
|
+
appointmentBooking = _ref2.appointmentBooking;
|
|
180
|
+
var _ref3 = (appointmentBooking === null || appointmentBooking === void 0 ? void 0 : appointmentBooking.otherParams) || {},
|
|
181
|
+
productModuleParams = _ref3.productModuleParams;
|
|
182
|
+
var _ref4 = productModuleParams || {},
|
|
183
|
+
bookingProcess = _ref4.bookingProcess;
|
|
181
184
|
|
|
182
185
|
// 获取商品列表
|
|
183
186
|
var getProducts = /*#__PURE__*/function () {
|
|
184
|
-
var
|
|
185
|
-
var _dates$, dates,
|
|
187
|
+
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
188
|
+
var _dates$, dates, _ref6, _productModuleParams, _productList, _ref7, productModuleParams, productList;
|
|
186
189
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
187
190
|
while (1) switch (_context2.prev = _context2.next) {
|
|
188
191
|
case 0:
|
|
@@ -200,7 +203,7 @@ export var useAppointmentBookingProduct = function useAppointmentBookingProduct(
|
|
|
200
203
|
}
|
|
201
204
|
return _context2.abrupt("return");
|
|
202
205
|
case 6:
|
|
203
|
-
|
|
206
|
+
_ref6 = (appointmentBooking === null || appointmentBooking === void 0 ? void 0 : appointmentBooking.otherParams) || {}, _productModuleParams = _ref6.productModuleParams;
|
|
204
207
|
_context2.next = 9;
|
|
205
208
|
return appointmentBooking.loadProductByScheduleDate(_objectSpread({
|
|
206
209
|
date: (_dates$ = dates[0]) === null || _dates$ === void 0 ? void 0 : _dates$.date
|
|
@@ -210,7 +213,7 @@ export var useAppointmentBookingProduct = function useAppointmentBookingProduct(
|
|
|
210
213
|
return _context2.abrupt("return", _productList);
|
|
211
214
|
case 11:
|
|
212
215
|
// 先选商品
|
|
213
|
-
|
|
216
|
+
_ref7 = (appointmentBooking === null || appointmentBooking === void 0 ? void 0 : appointmentBooking.otherParams) || {}, productModuleParams = _ref7.productModuleParams;
|
|
214
217
|
_context2.next = 14;
|
|
215
218
|
return appointmentBooking.loadProducts(productModuleParams);
|
|
216
219
|
case 14:
|
|
@@ -223,13 +226,13 @@ export var useAppointmentBookingProduct = function useAppointmentBookingProduct(
|
|
|
223
226
|
}, _callee2);
|
|
224
227
|
}));
|
|
225
228
|
return function getProducts() {
|
|
226
|
-
return
|
|
229
|
+
return _ref5.apply(this, arguments);
|
|
227
230
|
};
|
|
228
231
|
}();
|
|
229
232
|
|
|
230
233
|
// 检测商品类型
|
|
231
234
|
var checkProductType = /*#__PURE__*/function () {
|
|
232
|
-
var
|
|
235
|
+
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(productId) {
|
|
233
236
|
var result;
|
|
234
237
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
235
238
|
while (1) switch (_context3.prev = _context3.next) {
|
|
@@ -246,7 +249,7 @@ export var useAppointmentBookingProduct = function useAppointmentBookingProduct(
|
|
|
246
249
|
}, _callee3);
|
|
247
250
|
}));
|
|
248
251
|
return function checkProductType(_x2) {
|
|
249
|
-
return
|
|
252
|
+
return _ref8.apply(this, arguments);
|
|
250
253
|
};
|
|
251
254
|
}();
|
|
252
255
|
return {
|
|
@@ -271,10 +274,10 @@ export var useAppointmentBookingCart = function useAppointmentBookingCart() {
|
|
|
271
274
|
setCarts = _useAppointmentBookin3.setCarts,
|
|
272
275
|
setSummary = _useAppointmentBookin3.setSummary,
|
|
273
276
|
setIsAgreeDepositPolicy = _useAppointmentBookin3.setIsAgreeDepositPolicy;
|
|
274
|
-
var
|
|
275
|
-
bookingSubject =
|
|
277
|
+
var _ref9 = (appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$o = appointmentBooking.otherParams) === null || _appointmentBooking$o === void 0 ? void 0 : _appointmentBooking$o.productModuleParams) || {},
|
|
278
|
+
bookingSubject = _ref9.bookingSubject;
|
|
276
279
|
var getCartAndSummary = /*#__PURE__*/function () {
|
|
277
|
-
var
|
|
280
|
+
var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
278
281
|
var carts, newCarts, summary;
|
|
279
282
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
280
283
|
while (1) switch (_context4.prev = _context4.next) {
|
|
@@ -306,7 +309,7 @@ export var useAppointmentBookingCart = function useAppointmentBookingCart() {
|
|
|
306
309
|
}, _callee4);
|
|
307
310
|
}));
|
|
308
311
|
return function getCartAndSummary() {
|
|
309
|
-
return
|
|
312
|
+
return _ref10.apply(this, arguments);
|
|
310
313
|
};
|
|
311
314
|
}();
|
|
312
315
|
useEffect(function () {
|
|
@@ -337,8 +340,8 @@ export var useAppointmentBookingLogin = function useAppointmentBookingLogin() {
|
|
|
337
340
|
var utils = contextUtils();
|
|
338
341
|
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));
|
|
339
342
|
var openLoginModal = function openLoginModal(params) {
|
|
340
|
-
var
|
|
341
|
-
callback =
|
|
343
|
+
var _ref12 = params || {},
|
|
344
|
+
callback = _ref12.callback;
|
|
342
345
|
utils.action({
|
|
343
346
|
type: 'pisell1.login',
|
|
344
347
|
data: {
|
|
@@ -369,13 +372,13 @@ export var useAppointmentBookingAccount = function useAppointmentBookingAccount(
|
|
|
369
372
|
_useState2 = _slicedToArray(_useState, 2),
|
|
370
373
|
accountLists = _useState2[0],
|
|
371
374
|
setAccountLists = _useState2[1];
|
|
372
|
-
var
|
|
373
|
-
bookingSubject =
|
|
375
|
+
var _ref13 = (appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$o2 = appointmentBooking.otherParams) === null || _appointmentBooking$o2 === void 0 ? void 0 : _appointmentBooking$o2.productModuleParams) || {},
|
|
376
|
+
bookingSubject = _ref13.bookingSubject;
|
|
374
377
|
var form_id = bookingSubject === null || bookingSubject === void 0 ? void 0 : bookingSubject.form_id;
|
|
375
378
|
|
|
376
379
|
// 获取账户列表数据
|
|
377
380
|
var getAccountLists = /*#__PURE__*/function () {
|
|
378
|
-
var
|
|
381
|
+
var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
|
|
379
382
|
var data;
|
|
380
383
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
381
384
|
while (1) switch (_context6.prev = _context6.next) {
|
|
@@ -392,13 +395,13 @@ export var useAppointmentBookingAccount = function useAppointmentBookingAccount(
|
|
|
392
395
|
}, _callee6);
|
|
393
396
|
}));
|
|
394
397
|
return function getAccountLists() {
|
|
395
|
-
return
|
|
398
|
+
return _ref14.apply(this, arguments);
|
|
396
399
|
};
|
|
397
400
|
}();
|
|
398
401
|
useEffect(function () {
|
|
399
402
|
getAccountLists();
|
|
400
403
|
pisellOS.effects.on('appointmentBooking_accountList:changed', /*#__PURE__*/function () {
|
|
401
|
-
var
|
|
404
|
+
var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(res) {
|
|
402
405
|
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
403
406
|
while (1) switch (_context7.prev = _context7.next) {
|
|
404
407
|
case 0:
|
|
@@ -413,14 +416,14 @@ export var useAppointmentBookingAccount = function useAppointmentBookingAccount(
|
|
|
413
416
|
}, _callee7);
|
|
414
417
|
}));
|
|
415
418
|
return function (_x3) {
|
|
416
|
-
return
|
|
419
|
+
return _ref15.apply(this, arguments);
|
|
417
420
|
};
|
|
418
421
|
}());
|
|
419
422
|
}, []);
|
|
420
423
|
|
|
421
424
|
// 获取表单数据
|
|
422
425
|
var getHolders = /*#__PURE__*/function () {
|
|
423
|
-
var
|
|
426
|
+
var _ref16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
|
|
424
427
|
var _utils$getStore$getSt;
|
|
425
428
|
var shop_id, customer, params, data, newData;
|
|
426
429
|
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
@@ -460,13 +463,13 @@ export var useAppointmentBookingAccount = function useAppointmentBookingAccount(
|
|
|
460
463
|
}, _callee8);
|
|
461
464
|
}));
|
|
462
465
|
return function getHolders() {
|
|
463
|
-
return
|
|
466
|
+
return _ref16.apply(this, arguments);
|
|
464
467
|
};
|
|
465
468
|
}();
|
|
466
469
|
|
|
467
470
|
// 添加账户
|
|
468
471
|
var addAccount = /*#__PURE__*/function () {
|
|
469
|
-
var
|
|
472
|
+
var _ref17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(val, type) {
|
|
470
473
|
var customer, result;
|
|
471
474
|
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
472
475
|
while (1) switch (_context9.prev = _context9.next) {
|
|
@@ -487,7 +490,7 @@ export var useAppointmentBookingAccount = function useAppointmentBookingAccount(
|
|
|
487
490
|
}, _callee9);
|
|
488
491
|
}));
|
|
489
492
|
return function addAccount(_x4, _x5) {
|
|
490
|
-
return
|
|
493
|
+
return _ref17.apply(this, arguments);
|
|
491
494
|
};
|
|
492
495
|
}();
|
|
493
496
|
|
|
@@ -518,8 +521,8 @@ export var useAppointmentBookingResource = function useAppointmentBookingResourc
|
|
|
518
521
|
setTimes = _useAppointmentBookin4.setTimes,
|
|
519
522
|
setResourceOtherParams = _useAppointmentBookin4.setResourceOtherParams,
|
|
520
523
|
resourceOtherParams = _useAppointmentBookin4.resourceOtherParams;
|
|
521
|
-
var
|
|
522
|
-
resourceSort =
|
|
524
|
+
var _ref18 = (appointmentBooking === null || appointmentBooking === void 0 ? void 0 : appointmentBooking.otherParams) || {},
|
|
525
|
+
resourceSort = _ref18.resourceSort;
|
|
523
526
|
|
|
524
527
|
// 设置资源列表
|
|
525
528
|
var getResourceList = function getResourceList() {
|
|
@@ -543,7 +546,7 @@ export var useAppointmentBookingResource = function useAppointmentBookingResourc
|
|
|
543
546
|
|
|
544
547
|
// 设置时间切片
|
|
545
548
|
var getResourceTimeSlot = /*#__PURE__*/function () {
|
|
546
|
-
var
|
|
549
|
+
var _ref19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(index) {
|
|
547
550
|
var _getResourceList, resourceCodes, code, data;
|
|
548
551
|
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
549
552
|
while (1) switch (_context10.prev = _context10.next) {
|
|
@@ -562,13 +565,13 @@ export var useAppointmentBookingResource = function useAppointmentBookingResourc
|
|
|
562
565
|
}, _callee10);
|
|
563
566
|
}));
|
|
564
567
|
return function getResourceTimeSlot(_x6) {
|
|
565
|
-
return
|
|
568
|
+
return _ref19.apply(this, arguments);
|
|
566
569
|
};
|
|
567
570
|
}();
|
|
568
571
|
|
|
569
572
|
// 获取自动分配
|
|
570
573
|
var autoSelectAllProductResources = /*#__PURE__*/function () {
|
|
571
|
-
var
|
|
574
|
+
var _ref20 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(index) {
|
|
572
575
|
var _getResourceList2, resourceCodes, code, data, res;
|
|
573
576
|
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
574
577
|
while (1) switch (_context11.prev = _context11.next) {
|
|
@@ -594,7 +597,7 @@ export var useAppointmentBookingResource = function useAppointmentBookingResourc
|
|
|
594
597
|
}, _callee11);
|
|
595
598
|
}));
|
|
596
599
|
return function autoSelectAllProductResources(_x7) {
|
|
597
|
-
return
|
|
600
|
+
return _ref20.apply(this, arguments);
|
|
598
601
|
};
|
|
599
602
|
}();
|
|
600
603
|
return {
|
|
@@ -634,7 +637,7 @@ export var useIsSkipResourceStep = function useIsSkipResourceStep() {
|
|
|
634
637
|
nextStep = _useAppointmentBookin10.nextStep;
|
|
635
638
|
var utils = contextUtils();
|
|
636
639
|
var checkSkipResourceStep = /*#__PURE__*/function () {
|
|
637
|
-
var
|
|
640
|
+
var _ref21 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(isSkipUpdateFormStep) {
|
|
638
641
|
var accountLists, carts, _res$errorList, _resources$, res, _getResourceList3, resources, resultCarts;
|
|
639
642
|
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
640
643
|
while (1) switch (_context12.prev = _context12.next) {
|
|
@@ -706,7 +709,7 @@ export var useIsSkipResourceStep = function useIsSkipResourceStep() {
|
|
|
706
709
|
}, _callee12, null, [[0, 23]]);
|
|
707
710
|
}));
|
|
708
711
|
return function checkSkipResourceStep(_x8) {
|
|
709
|
-
return
|
|
712
|
+
return _ref21.apply(this, arguments);
|
|
710
713
|
};
|
|
711
714
|
}();
|
|
712
715
|
return {
|
|
@@ -722,15 +725,15 @@ export var useIsSkipResourceStep = function useIsSkipResourceStep() {
|
|
|
722
725
|
* @Date: 2025-04-24 18:15
|
|
723
726
|
*/
|
|
724
727
|
export var useAppointmentBookingSetting = function useAppointmentBookingSetting() {
|
|
725
|
-
var _appointmentBooking$o3;
|
|
728
|
+
var _appointmentBooking$o3, _appointmentBooking$o4;
|
|
726
729
|
var utils = contextUtils();
|
|
727
|
-
var
|
|
728
|
-
appointmentBooking =
|
|
729
|
-
var
|
|
730
|
-
bookingProcess =
|
|
731
|
-
bookingSubject =
|
|
732
|
-
customPageId =
|
|
733
|
-
channel =
|
|
730
|
+
var _ref22 = useAppointmentBookingContext(),
|
|
731
|
+
appointmentBooking = _ref22.appointmentBooking;
|
|
732
|
+
var _ref23 = (appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$o3 = appointmentBooking.otherParams) === null || _appointmentBooking$o3 === void 0 ? void 0 : _appointmentBooking$o3.productModuleParams) || {},
|
|
733
|
+
bookingProcess = _ref23.bookingProcess,
|
|
734
|
+
bookingSubject = _ref23.bookingSubject,
|
|
735
|
+
customPageId = _ref23.customPageId,
|
|
736
|
+
channel = _ref23.channel;
|
|
734
737
|
|
|
735
738
|
// 设置缓存
|
|
736
739
|
var setOtherData = function setOtherData(key, val) {
|
|
@@ -749,6 +752,8 @@ export var useAppointmentBookingSetting = function useAppointmentBookingSetting(
|
|
|
749
752
|
isDateSelectedFirst: bookingProcess === 'date_first',
|
|
750
753
|
// 主体是否是表单
|
|
751
754
|
isFormSubject: (bookingSubject === null || bookingSubject === void 0 ? void 0 : bookingSubject.type) === 'form',
|
|
755
|
+
// 是否是零售模版
|
|
756
|
+
isRetailTemplate: (appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$o4 = appointmentBooking.otherParams) === null || _appointmentBooking$o4 === void 0 ? void 0 : _appointmentBooking$o4.isRetailTemplate) || false,
|
|
752
757
|
customPageId: customPageId,
|
|
753
758
|
channel: channel,
|
|
754
759
|
bookingSubject: bookingSubject,
|