@pisell/private-materials 3.3.45 → 3.3.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.js +3 -3
- package/build/lowcode/view.js +3 -3
- package/es/businessModel/SalesModel/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Cart/Item/index.js +3 -0
- package/es/components/appointmentBooking/components/Content/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Content/index.js +7 -1
- package/es/components/appointmentBooking/components/Header/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Header/index.js +2 -2
- package/es/components/appointmentBooking/components/Resource/index.js +30 -12
- package/es/components/appointmentBooking/components/Services/index.js +5 -2
- package/es/components/appointmentBooking/components/TimeSlicing/index.js +7 -4
- package/es/components/appointmentBooking/components/Voucher/index.js +1 -0
- package/es/components/appointmentBooking/context.js +7 -3
- package/es/components/appointmentBooking/hooks.js +129 -68
- package/es/components/appointmentBooking/index.d.ts +1 -0
- package/es/components/appointmentBooking/utils.js +6 -1
- package/es/components/booking/addons/index.js +31 -26
- package/es/components/booking/components/footer/amount.js +2 -2
- package/es/components/booking/components/footer/index.d.ts +1 -0
- package/es/components/booking/components/footer/utils.d.ts +9 -0
- package/es/components/booking/components/footer/utils.js +32 -10
- package/es/components/booking/info/service/Lists.d.ts +1 -0
- package/es/components/booking/info/service/addService/index.d.ts +1 -0
- package/es/components/booking/info/service/addService/index.js +2 -2
- package/es/components/booking/info/service/serviceList/index.d.ts +1 -0
- package/es/components/booking/info/service2/Lists.d.ts +1 -0
- package/es/components/booking/info/service2/utils.d.ts +4 -1
- package/es/components/booking/info/service2/utils.js +21 -2
- package/es/components/booking/info/utils.js +1 -1
- package/es/components/booking/info2/service/addService/index.js +9 -6
- package/es/components/booking/info2/service/addTimeModal/index.d.ts +1 -0
- package/es/components/booking/info2/service/editService/index.js +56 -18
- package/es/components/booking/info2/service/serviceList/index.d.ts +1 -0
- package/es/components/booking/utils.d.ts +3 -2
- package/es/components/booking/utils.js +5 -0
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/store/index.d.ts +2 -2
- package/es/components/eventBooking/components/Provider/Content/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Header/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/SelectHolderModal.d.ts +1 -0
- package/es/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +1 -0
- package/es/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +1 -0
- package/es/components/eventBooking/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/index.d.ts +1 -0
- package/es/components/productExtension/fields/Actor/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
- package/es/components/productExtension/index.d.ts +1 -0
- package/es/components/ruleSetting/index.d.ts +1 -0
- package/es/components/shoppingCart/components/Empty/index.d.ts +1 -0
- package/es/components/shoppingCart/components/Render/index.d.ts +1 -0
- package/es/components/shoppingCart/index.d.ts +1 -0
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +75 -26
- package/es/components/ticketBooking/components/notAvailable/index.d.ts +3 -0
- package/es/components/ticketBooking/components/notAvailable/index.js +39 -0
- package/es/components/ticketBooking/components/ticketBooking/index.d.ts +1 -0
- package/es/components/ticketBooking/index.d.ts +1 -0
- package/es/components/ticketBooking/index.js +1 -1
- package/es/components/ticketBooking/locales.d.ts +6 -0
- package/es/components/ticketBooking/locales.js +9 -3
- package/es/components/ticketBooking/serve.js +98 -92
- package/es/components/ticketBooking/utils/index.d.ts +1 -0
- package/es/components/ticketBooking/utils/index.js +33 -0
- package/es/components/wallet/hooks/useWalletCard.d.ts +1 -0
- package/lib/businessModel/SalesModel/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Cart/Item/index.js +3 -0
- package/lib/components/appointmentBooking/components/Content/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Content/index.js +3 -1
- package/lib/components/appointmentBooking/components/Header/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Header/index.js +1 -1
- package/lib/components/appointmentBooking/components/Resource/index.js +15 -9
- package/lib/components/appointmentBooking/components/Services/index.js +3 -2
- package/lib/components/appointmentBooking/components/TimeSlicing/index.js +4 -3
- package/lib/components/appointmentBooking/components/Voucher/index.js +1 -0
- package/lib/components/appointmentBooking/context.js +7 -3
- package/lib/components/appointmentBooking/hooks.js +73 -12
- package/lib/components/appointmentBooking/index.d.ts +1 -0
- package/lib/components/appointmentBooking/utils.js +2 -0
- package/lib/components/booking/addons/index.js +27 -21
- package/lib/components/booking/components/footer/amount.js +1 -1
- package/lib/components/booking/components/footer/index.d.ts +1 -0
- package/lib/components/booking/components/footer/utils.d.ts +9 -0
- package/lib/components/booking/components/footer/utils.js +24 -7
- package/lib/components/booking/info/service/Lists.d.ts +1 -0
- package/lib/components/booking/info/service/addService/index.d.ts +1 -0
- package/lib/components/booking/info/service/addService/index.js +1 -1
- package/lib/components/booking/info/service/serviceList/index.d.ts +1 -0
- package/lib/components/booking/info/service2/Lists.d.ts +1 -0
- package/lib/components/booking/info/service2/utils.d.ts +4 -1
- package/lib/components/booking/info/service2/utils.js +21 -2
- package/lib/components/booking/info/utils.js +1 -1
- package/lib/components/booking/info2/service/addService/index.js +8 -5
- package/lib/components/booking/info2/service/addTimeModal/index.d.ts +1 -0
- package/lib/components/booking/info2/service/editService/index.js +59 -23
- package/lib/components/booking/info2/service/serviceList/index.d.ts +1 -0
- package/lib/components/booking/utils.d.ts +3 -2
- package/lib/components/booking/utils.js +6 -0
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/store/index.d.ts +2 -2
- package/lib/components/eventBooking/components/Provider/Content/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Header/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/SelectHolderModal.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +1 -0
- package/lib/components/eventBooking/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/index.d.ts +1 -0
- package/lib/components/productExtension/fields/Actor/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
- package/lib/components/productExtension/index.d.ts +1 -0
- package/lib/components/ruleSetting/index.d.ts +1 -0
- package/lib/components/shoppingCart/components/Empty/index.d.ts +1 -0
- package/lib/components/shoppingCart/components/Render/index.d.ts +1 -0
- package/lib/components/shoppingCart/index.d.ts +1 -0
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +74 -20
- package/lib/components/ticketBooking/components/notAvailable/index.d.ts +3 -0
- package/lib/components/ticketBooking/components/notAvailable/index.js +61 -0
- package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +1 -0
- package/lib/components/ticketBooking/index.d.ts +1 -0
- package/lib/components/ticketBooking/index.js +1 -1
- package/lib/components/ticketBooking/locales.d.ts +6 -0
- package/lib/components/ticketBooking/locales.js +9 -3
- package/lib/components/ticketBooking/serve.js +6 -2
- package/lib/components/ticketBooking/utils/index.d.ts +1 -0
- package/lib/components/ticketBooking/utils/index.js +33 -0
- package/lib/components/wallet/hooks/useWalletCard.d.ts +1 -0
- package/package.json +4 -4
|
@@ -140,17 +140,74 @@ export var useAppointmentBookingStep = function useAppointmentBookingStep() {
|
|
|
140
140
|
var _nextStep, _nextStep2, _nextStep3;
|
|
141
141
|
var stepList = appointmentBooking.getStepList() || [];
|
|
142
142
|
var currentKey = currentStepParams === null || currentStepParams === void 0 ? void 0 : currentStepParams.key;
|
|
143
|
-
var nextStep = stepList[(currentStepParams === null || currentStepParams === void 0 ? void 0 : currentStepParams.index) + 1];
|
|
144
143
|
var currentSelectedResources = appointmentBooking.getOtherData('current_selected_resources');
|
|
145
144
|
|
|
145
|
+
// 先确定点击时的步骤,如果当前步骤是选择服务
|
|
146
|
+
if (!isRetailTemplate && currentKey === "select-service") {
|
|
147
|
+
var _appointmentBooking$o, _stepList, _stepList2;
|
|
148
|
+
var _ref3 = (appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$o = appointmentBooking.otherParams) === null || _appointmentBooking$o === void 0 ? void 0 : _appointmentBooking$o.productModuleParams) || {},
|
|
149
|
+
bookingProcess = _ref3.bookingProcess;
|
|
150
|
+
var isDateSelectedFirst = bookingProcess === "date_first";
|
|
151
|
+
var hasResourceStep = (_stepList = stepList) === null || _stepList === void 0 ? void 0 : _stepList.find(function (item) {
|
|
152
|
+
return (item === null || item === void 0 ? void 0 : item.key) === "select-resource";
|
|
153
|
+
});
|
|
154
|
+
var hasSelectGuestStep = (_stepList2 = stepList) === null || _stepList2 === void 0 || (_stepList2 = _stepList2.find(function (item) {
|
|
155
|
+
return (item === null || item === void 0 ? void 0 : item.key) === "select-guest";
|
|
156
|
+
})) === null || _stepList2 === void 0 ? void 0 : _stepList2.key;
|
|
157
|
+
// 判断购物车里是否全是是普通商品
|
|
158
|
+
var isAllNormalProduct = appointmentBooking === null || appointmentBooking === void 0 ? void 0 : appointmentBooking.isCartAllNormalProducts();
|
|
159
|
+
if (isAllNormalProduct) {
|
|
160
|
+
removeStep("select-resource");
|
|
161
|
+
removeStep("select-time");
|
|
162
|
+
removeStep('fill-form');
|
|
163
|
+
if (!isDateSelectedFirst) {
|
|
164
|
+
removeStep("select-date");
|
|
165
|
+
}
|
|
166
|
+
} else if (!hasResourceStep) {
|
|
167
|
+
// 如果不全是普通商品,并且还没有选择资源步骤,证明之前被删除过,要给她加回来
|
|
168
|
+
// 判断当前步骤里有没有添加预约人,如果有的话则应该是在添加预约人之后添加步骤
|
|
169
|
+
var targetKey = hasSelectGuestStep ? hasSelectGuestStep : "select-service";
|
|
170
|
+
var isHasDurationProduct = appointmentBooking === null || appointmentBooking === void 0 ? void 0 : appointmentBooking.isCartHasDurationProduct();
|
|
171
|
+
// 如果购物车里有 duration 商品(目前来说,只能是纯 duration 商品)
|
|
172
|
+
if (isHasDurationProduct) {
|
|
173
|
+
// 如果是先选商品,则添加日期、资源、时间步骤
|
|
174
|
+
if (!isDateSelectedFirst) {
|
|
175
|
+
appointmentBooking.addStep({
|
|
176
|
+
key: "select-date",
|
|
177
|
+
description: locales.getText("pisell2.appointment.select.date")
|
|
178
|
+
}, targetKey);
|
|
179
|
+
targetKey = "select-date";
|
|
180
|
+
}
|
|
181
|
+
// 如果是先选日期,则添加资源、时间
|
|
182
|
+
appointmentBooking.addStep({
|
|
183
|
+
key: "select-resource",
|
|
184
|
+
description: locales.getText("pisell2.appointment.select.resource")
|
|
185
|
+
}, targetKey);
|
|
186
|
+
targetKey = "select-resource";
|
|
187
|
+
appointmentBooking.addStep({
|
|
188
|
+
key: "select-time",
|
|
189
|
+
description: locales.getText("pisell2.appointment.select.time")
|
|
190
|
+
}, targetKey);
|
|
191
|
+
} else {
|
|
192
|
+
// 如果购物车里是session 商品,则只添加选择资源步骤
|
|
193
|
+
appointmentBooking.addStep({
|
|
194
|
+
key: "select-resource",
|
|
195
|
+
description: locales.getText("pisell2.appointment.select.resource")
|
|
196
|
+
}, targetKey);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
stepList = (appointmentBooking === null || appointmentBooking === void 0 ? void 0 : appointmentBooking.getStepList()) || [];
|
|
200
|
+
}
|
|
201
|
+
var nextStep = stepList[(currentStepParams === null || currentStepParams === void 0 ? void 0 : currentStepParams.index) + 1];
|
|
202
|
+
|
|
146
203
|
// 判断选定的日期是否存在可用的预约
|
|
147
|
-
if (((_nextStep = nextStep) === null || _nextStep === void 0 ? void 0 : _nextStep.key) === 'select-resource') {
|
|
204
|
+
if (!isRetailTemplate && ((_nextStep = nextStep) === null || _nextStep === void 0 ? void 0 : _nextStep.key) === 'select-resource') {
|
|
148
205
|
var result = appointmentBooking.checkResourceListForDate();
|
|
149
206
|
if (!result) {
|
|
150
207
|
return Toast(locales.getText('pisell2.appointment.unuse.date'));
|
|
151
208
|
}
|
|
152
209
|
}
|
|
153
|
-
if (currentKey !== null && currentKey !== void 0 && currentKey.startsWith('select-resource')) {
|
|
210
|
+
if (!isRetailTemplate && currentKey !== null && currentKey !== void 0 && currentKey.startsWith('select-resource')) {
|
|
154
211
|
var _currentSelectedResou;
|
|
155
212
|
// 1. 检测购物车中是否选择了资源
|
|
156
213
|
var _checkAndMarkCartRend = checkAndMarkCartRenderError(currentSelectedResources, appointmentBooking, utils),
|
|
@@ -161,7 +218,6 @@ export var useAppointmentBookingStep = function useAppointmentBookingStep() {
|
|
|
161
218
|
scrollToFirstErrorCard();
|
|
162
219
|
return;
|
|
163
220
|
}
|
|
164
|
-
|
|
165
221
|
// 2. 插入表单步骤
|
|
166
222
|
currentSelectedResources === null || currentSelectedResources === void 0 || currentSelectedResources.forEach(function (cart) {
|
|
167
223
|
var _selectedResource$ren, _selectedResource$ren2;
|
|
@@ -199,8 +255,8 @@ export var useAppointmentBookingStep = function useAppointmentBookingStep() {
|
|
|
199
255
|
|
|
200
256
|
// 如果有下一个资源数据,则插入下一个资源步骤
|
|
201
257
|
if (nextResource) {
|
|
202
|
-
var
|
|
203
|
-
var beforeKey = (
|
|
258
|
+
var _stepList3;
|
|
259
|
+
var beforeKey = (_stepList3 = stepList[stepList.length - 2]) === null || _stepList3 === void 0 ? void 0 : _stepList3.key;
|
|
204
260
|
appointmentBooking.addStep({
|
|
205
261
|
key: resourceKey,
|
|
206
262
|
description: ''
|
|
@@ -224,10 +280,13 @@ export var useAppointmentBookingStep = function useAppointmentBookingStep() {
|
|
|
224
280
|
setLoading(false);
|
|
225
281
|
|
|
226
282
|
// 零售订单不需要验证holder
|
|
227
|
-
if (isRetailTemplate) {
|
|
283
|
+
if (isRetailTemplate || appointmentBooking !== null && appointmentBooking !== void 0 && appointmentBooking.isCartAllNormalProducts()) {
|
|
228
284
|
return appointmentBooking.next();
|
|
229
285
|
}
|
|
230
|
-
var
|
|
286
|
+
var appoimentCarts = carts.filter(function (n) {
|
|
287
|
+
return !(appointmentBooking !== null && appointmentBooking !== void 0 && appointmentBooking.isTargetCartIdNormalProduct(n._id));
|
|
288
|
+
});
|
|
289
|
+
var _checkAndGoNext = checkAndGoNext(isFormSubject, checkAccount, appoimentCarts),
|
|
231
290
|
hasError = _checkAndGoNext.hasError;
|
|
232
291
|
setIsErrorHolder(hasError);
|
|
233
292
|
if (hasError) {
|
|
@@ -246,7 +305,7 @@ export var useAppointmentBookingStep = function useAppointmentBookingStep() {
|
|
|
246
305
|
|
|
247
306
|
// 检测是否登录
|
|
248
307
|
var checkLogin = /*#__PURE__*/function () {
|
|
249
|
-
var
|
|
308
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
250
309
|
var accountLists;
|
|
251
310
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
252
311
|
while (1) switch (_context2.prev = _context2.next) {
|
|
@@ -271,7 +330,9 @@ export var useAppointmentBookingStep = function useAppointmentBookingStep() {
|
|
|
271
330
|
});
|
|
272
331
|
appointmentBooking.setLoginAccount(meAccount === null || meAccount === void 0 ? void 0 : meAccount.id, currentUser);
|
|
273
332
|
} else {
|
|
274
|
-
|
|
333
|
+
if (!isRetailTemplate) {
|
|
334
|
+
getHolders();
|
|
335
|
+
}
|
|
275
336
|
}
|
|
276
337
|
|
|
277
338
|
// 继续后续流程
|
|
@@ -288,7 +349,7 @@ export var useAppointmentBookingStep = function useAppointmentBookingStep() {
|
|
|
288
349
|
}, _callee2);
|
|
289
350
|
}));
|
|
290
351
|
return function checkLogin() {
|
|
291
|
-
return
|
|
352
|
+
return _ref4.apply(this, arguments);
|
|
292
353
|
};
|
|
293
354
|
}();
|
|
294
355
|
|
|
@@ -332,17 +393,17 @@ export var useAppointmentBookingStep = function useAppointmentBookingStep() {
|
|
|
332
393
|
* @Date: 2025-04-15 11:12
|
|
333
394
|
*/
|
|
334
395
|
export var useAppointmentBookingProduct = function useAppointmentBookingProduct() {
|
|
335
|
-
var
|
|
336
|
-
appointmentBooking =
|
|
337
|
-
var
|
|
338
|
-
productModuleParams =
|
|
339
|
-
var
|
|
340
|
-
bookingProcess =
|
|
396
|
+
var _ref5 = useAppointmentBookingContext(),
|
|
397
|
+
appointmentBooking = _ref5.appointmentBooking;
|
|
398
|
+
var _ref6 = (appointmentBooking === null || appointmentBooking === void 0 ? void 0 : appointmentBooking.otherParams) || {},
|
|
399
|
+
productModuleParams = _ref6.productModuleParams;
|
|
400
|
+
var _ref7 = productModuleParams || {},
|
|
401
|
+
bookingProcess = _ref7.bookingProcess;
|
|
341
402
|
|
|
342
403
|
// 获取商品列表
|
|
343
404
|
var getProducts = /*#__PURE__*/function () {
|
|
344
|
-
var
|
|
345
|
-
var _dates$, dates,
|
|
405
|
+
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
406
|
+
var _dates$, dates, _ref9, _productModuleParams, _productList, _ref10, productModuleParams, productList;
|
|
346
407
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
347
408
|
while (1) switch (_context3.prev = _context3.next) {
|
|
348
409
|
case 0:
|
|
@@ -360,7 +421,7 @@ export var useAppointmentBookingProduct = function useAppointmentBookingProduct(
|
|
|
360
421
|
}
|
|
361
422
|
return _context3.abrupt("return");
|
|
362
423
|
case 6:
|
|
363
|
-
|
|
424
|
+
_ref9 = (appointmentBooking === null || appointmentBooking === void 0 ? void 0 : appointmentBooking.otherParams) || {}, _productModuleParams = _ref9.productModuleParams;
|
|
364
425
|
_context3.next = 9;
|
|
365
426
|
return appointmentBooking.loadProductByScheduleDate(_objectSpread({
|
|
366
427
|
date: (_dates$ = dates[0]) === null || _dates$ === void 0 ? void 0 : _dates$.date
|
|
@@ -370,7 +431,7 @@ export var useAppointmentBookingProduct = function useAppointmentBookingProduct(
|
|
|
370
431
|
return _context3.abrupt("return", _productList);
|
|
371
432
|
case 11:
|
|
372
433
|
// 先选商品
|
|
373
|
-
|
|
434
|
+
_ref10 = (appointmentBooking === null || appointmentBooking === void 0 ? void 0 : appointmentBooking.otherParams) || {}, productModuleParams = _ref10.productModuleParams;
|
|
374
435
|
_context3.next = 14;
|
|
375
436
|
return appointmentBooking.loadProducts(productModuleParams);
|
|
376
437
|
case 14:
|
|
@@ -383,13 +444,13 @@ export var useAppointmentBookingProduct = function useAppointmentBookingProduct(
|
|
|
383
444
|
}, _callee3);
|
|
384
445
|
}));
|
|
385
446
|
return function getProducts() {
|
|
386
|
-
return
|
|
447
|
+
return _ref8.apply(this, arguments);
|
|
387
448
|
};
|
|
388
449
|
}();
|
|
389
450
|
|
|
390
451
|
// 检测商品类型
|
|
391
452
|
var checkProductType = /*#__PURE__*/function () {
|
|
392
|
-
var
|
|
453
|
+
var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(productId) {
|
|
393
454
|
var result;
|
|
394
455
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
395
456
|
while (1) switch (_context4.prev = _context4.next) {
|
|
@@ -406,7 +467,7 @@ export var useAppointmentBookingProduct = function useAppointmentBookingProduct(
|
|
|
406
467
|
}, _callee4);
|
|
407
468
|
}));
|
|
408
469
|
return function checkProductType(_x2) {
|
|
409
|
-
return
|
|
470
|
+
return _ref11.apply(this, arguments);
|
|
410
471
|
};
|
|
411
472
|
}();
|
|
412
473
|
return {
|
|
@@ -423,18 +484,18 @@ export var useAppointmentBookingProduct = function useAppointmentBookingProduct(
|
|
|
423
484
|
* @Date: 2025-04-15 11:12
|
|
424
485
|
*/
|
|
425
486
|
export var useAppointmentBookingCart = function useAppointmentBookingCart() {
|
|
426
|
-
var _appointmentBooking$
|
|
487
|
+
var _appointmentBooking$o2;
|
|
427
488
|
var pisellOS = usePisellOS();
|
|
428
489
|
var utils = contextUtils();
|
|
429
|
-
var
|
|
430
|
-
appointmentBooking =
|
|
431
|
-
setCarts =
|
|
432
|
-
setSummary =
|
|
433
|
-
setIsAgreeDepositPolicy =
|
|
434
|
-
var
|
|
435
|
-
bookingSubject =
|
|
490
|
+
var _ref12 = useAppointmentBookingContext(),
|
|
491
|
+
appointmentBooking = _ref12.appointmentBooking,
|
|
492
|
+
setCarts = _ref12.setCarts,
|
|
493
|
+
setSummary = _ref12.setSummary,
|
|
494
|
+
setIsAgreeDepositPolicy = _ref12.setIsAgreeDepositPolicy;
|
|
495
|
+
var _ref13 = (appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$o2 = appointmentBooking.otherParams) === null || _appointmentBooking$o2 === void 0 ? void 0 : _appointmentBooking$o2.productModuleParams) || {},
|
|
496
|
+
bookingSubject = _ref13.bookingSubject;
|
|
436
497
|
var getCartAndSummary = /*#__PURE__*/function () {
|
|
437
|
-
var
|
|
498
|
+
var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
438
499
|
var _utils$storage2;
|
|
439
500
|
var locale, symbol, carts, accountLists, newCarts, summary;
|
|
440
501
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
@@ -483,7 +544,7 @@ export var useAppointmentBookingCart = function useAppointmentBookingCart() {
|
|
|
483
544
|
}, _callee5);
|
|
484
545
|
}));
|
|
485
546
|
return function getCartAndSummary() {
|
|
486
|
-
return
|
|
547
|
+
return _ref14.apply(this, arguments);
|
|
487
548
|
};
|
|
488
549
|
}();
|
|
489
550
|
useEffect(function () {
|
|
@@ -514,8 +575,8 @@ export var useAppointmentBookingLogin = function useAppointmentBookingLogin() {
|
|
|
514
575
|
var utils = contextUtils();
|
|
515
576
|
var isLogin = !!(utils !== null && utils !== void 0 && (_utils$token = utils.token) !== null && _utils$token !== void 0 && (_utils$token$get = _utils$token.get) !== null && _utils$token$get !== void 0 && _utils$token$get.call(_utils$token));
|
|
516
577
|
var openLoginModal = function openLoginModal(params) {
|
|
517
|
-
var
|
|
518
|
-
callback =
|
|
578
|
+
var _ref16 = params || {},
|
|
579
|
+
callback = _ref16.callback;
|
|
519
580
|
utils.action({
|
|
520
581
|
type: 'pisell1.login',
|
|
521
582
|
data: {
|
|
@@ -538,7 +599,7 @@ export var useAppointmentBookingLogin = function useAppointmentBookingLogin() {
|
|
|
538
599
|
* @Date: 2025-04-15 11:15
|
|
539
600
|
*/
|
|
540
601
|
export var useAppointmentBookingAccount = function useAppointmentBookingAccount() {
|
|
541
|
-
var _appointmentBooking$
|
|
602
|
+
var _appointmentBooking$o3;
|
|
542
603
|
var utils = contextUtils();
|
|
543
604
|
var pisellOS = usePisellOS();
|
|
544
605
|
var appointmentBooking = useAppointmentBooking();
|
|
@@ -546,13 +607,13 @@ export var useAppointmentBookingAccount = function useAppointmentBookingAccount(
|
|
|
546
607
|
_useState2 = _slicedToArray(_useState, 2),
|
|
547
608
|
accountLists = _useState2[0],
|
|
548
609
|
setAccountLists = _useState2[1];
|
|
549
|
-
var
|
|
550
|
-
bookingSubject =
|
|
610
|
+
var _ref17 = (appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$o3 = appointmentBooking.otherParams) === null || _appointmentBooking$o3 === void 0 ? void 0 : _appointmentBooking$o3.productModuleParams) || {},
|
|
611
|
+
bookingSubject = _ref17.bookingSubject;
|
|
551
612
|
var form_id = bookingSubject === null || bookingSubject === void 0 ? void 0 : bookingSubject.form_id;
|
|
552
613
|
|
|
553
614
|
// 获取账户列表数据
|
|
554
615
|
var getAccountLists = /*#__PURE__*/function () {
|
|
555
|
-
var
|
|
616
|
+
var _ref18 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
|
|
556
617
|
var data;
|
|
557
618
|
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
558
619
|
while (1) switch (_context7.prev = _context7.next) {
|
|
@@ -569,13 +630,13 @@ export var useAppointmentBookingAccount = function useAppointmentBookingAccount(
|
|
|
569
630
|
}, _callee7);
|
|
570
631
|
}));
|
|
571
632
|
return function getAccountLists() {
|
|
572
|
-
return
|
|
633
|
+
return _ref18.apply(this, arguments);
|
|
573
634
|
};
|
|
574
635
|
}();
|
|
575
636
|
useEffect(function () {
|
|
576
637
|
getAccountLists();
|
|
577
638
|
pisellOS.effects.on('appointmentBooking_accountList:changed', /*#__PURE__*/function () {
|
|
578
|
-
var
|
|
639
|
+
var _ref19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(res) {
|
|
579
640
|
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
580
641
|
while (1) switch (_context8.prev = _context8.next) {
|
|
581
642
|
case 0:
|
|
@@ -589,14 +650,14 @@ export var useAppointmentBookingAccount = function useAppointmentBookingAccount(
|
|
|
589
650
|
}, _callee8);
|
|
590
651
|
}));
|
|
591
652
|
return function (_x3) {
|
|
592
|
-
return
|
|
653
|
+
return _ref19.apply(this, arguments);
|
|
593
654
|
};
|
|
594
655
|
}());
|
|
595
656
|
}, []);
|
|
596
657
|
|
|
597
658
|
// 获取表单数据
|
|
598
659
|
var getHolders = /*#__PURE__*/function () {
|
|
599
|
-
var
|
|
660
|
+
var _ref20 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
|
|
600
661
|
var _utils$getStore$getSt;
|
|
601
662
|
var shop_id, customer, params, data, newData;
|
|
602
663
|
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
@@ -636,13 +697,13 @@ export var useAppointmentBookingAccount = function useAppointmentBookingAccount(
|
|
|
636
697
|
}, _callee9);
|
|
637
698
|
}));
|
|
638
699
|
return function getHolders() {
|
|
639
|
-
return
|
|
700
|
+
return _ref20.apply(this, arguments);
|
|
640
701
|
};
|
|
641
702
|
}();
|
|
642
703
|
|
|
643
704
|
// 添加账户
|
|
644
705
|
var addAccount = /*#__PURE__*/function () {
|
|
645
|
-
var
|
|
706
|
+
var _ref21 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(val, type) {
|
|
646
707
|
var customer, result;
|
|
647
708
|
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
648
709
|
while (1) switch (_context10.prev = _context10.next) {
|
|
@@ -663,7 +724,7 @@ export var useAppointmentBookingAccount = function useAppointmentBookingAccount(
|
|
|
663
724
|
}, _callee10);
|
|
664
725
|
}));
|
|
665
726
|
return function addAccount(_x4, _x5) {
|
|
666
|
-
return
|
|
727
|
+
return _ref21.apply(this, arguments);
|
|
667
728
|
};
|
|
668
729
|
}();
|
|
669
730
|
|
|
@@ -688,12 +749,12 @@ export var useAppointmentBookingAccount = function useAppointmentBookingAccount(
|
|
|
688
749
|
* @Date: 2025-04-15 11:29
|
|
689
750
|
*/
|
|
690
751
|
export var useAppointmentBookingResource = function useAppointmentBookingResource() {
|
|
691
|
-
var
|
|
692
|
-
appointmentBooking =
|
|
693
|
-
setResources =
|
|
694
|
-
setTimes =
|
|
695
|
-
var
|
|
696
|
-
resourceSort =
|
|
752
|
+
var _ref22 = useAppointmentBookingContext(),
|
|
753
|
+
appointmentBooking = _ref22.appointmentBooking,
|
|
754
|
+
setResources = _ref22.setResources,
|
|
755
|
+
setTimes = _ref22.setTimes;
|
|
756
|
+
var _ref23 = (appointmentBooking === null || appointmentBooking === void 0 ? void 0 : appointmentBooking.otherParams) || {},
|
|
757
|
+
resourceSort = _ref23.resourceSort;
|
|
697
758
|
|
|
698
759
|
// 设置资源列表
|
|
699
760
|
var getResourceList = function getResourceList() {
|
|
@@ -717,7 +778,7 @@ export var useAppointmentBookingResource = function useAppointmentBookingResourc
|
|
|
717
778
|
|
|
718
779
|
// 设置时间切片
|
|
719
780
|
var getResourceTimeSlot = /*#__PURE__*/function () {
|
|
720
|
-
var
|
|
781
|
+
var _ref24 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(index) {
|
|
721
782
|
var _getResourceList, resourceCodes, code, data;
|
|
722
783
|
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
|
723
784
|
while (1) switch (_context11.prev = _context11.next) {
|
|
@@ -736,7 +797,7 @@ export var useAppointmentBookingResource = function useAppointmentBookingResourc
|
|
|
736
797
|
}, _callee11);
|
|
737
798
|
}));
|
|
738
799
|
return function getResourceTimeSlot(_x6) {
|
|
739
|
-
return
|
|
800
|
+
return _ref24.apply(this, arguments);
|
|
740
801
|
};
|
|
741
802
|
}();
|
|
742
803
|
return {
|
|
@@ -753,8 +814,8 @@ export var useAppointmentBookingResource = function useAppointmentBookingResourc
|
|
|
753
814
|
* @Date: 2025-04-21 11:47
|
|
754
815
|
*/
|
|
755
816
|
export var useIsSkipResourceStep = function useIsSkipResourceStep() {
|
|
756
|
-
var
|
|
757
|
-
currentStepParams =
|
|
817
|
+
var _ref25 = useAppointmentBookingContext(),
|
|
818
|
+
currentStepParams = _ref25.currentStepParams;
|
|
758
819
|
var _useAppointmentBookin5 = useAppointmentBookingResource(),
|
|
759
820
|
getResourceList = _useAppointmentBookin5.getResourceList;
|
|
760
821
|
var _useAppointmentBookin6 = useAppointmentBookingSetting(),
|
|
@@ -763,7 +824,7 @@ export var useIsSkipResourceStep = function useIsSkipResourceStep() {
|
|
|
763
824
|
var _useAppointmentBookin7 = useAppointmentBookingStep(),
|
|
764
825
|
nextStep = _useAppointmentBookin7.nextStep;
|
|
765
826
|
var checkSkipResourceStep = /*#__PURE__*/function () {
|
|
766
|
-
var
|
|
827
|
+
var _ref26 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
|
|
767
828
|
var _getResourceList2, resources, accountLists, _currentAppointmentBo, isSystem, isSkip, form_code, renderLists, _isSkip;
|
|
768
829
|
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
|
769
830
|
while (1) switch (_context12.prev = _context12.next) {
|
|
@@ -819,7 +880,7 @@ export var useIsSkipResourceStep = function useIsSkipResourceStep() {
|
|
|
819
880
|
}, _callee12, null, [[0, 22]]);
|
|
820
881
|
}));
|
|
821
882
|
return function checkSkipResourceStep() {
|
|
822
|
-
return
|
|
883
|
+
return _ref26.apply(this, arguments);
|
|
823
884
|
};
|
|
824
885
|
}();
|
|
825
886
|
return {
|
|
@@ -835,15 +896,15 @@ export var useIsSkipResourceStep = function useIsSkipResourceStep() {
|
|
|
835
896
|
* @Date: 2025-04-24 18:15
|
|
836
897
|
*/
|
|
837
898
|
export var useAppointmentBookingSetting = function useAppointmentBookingSetting() {
|
|
838
|
-
var _appointmentBooking$
|
|
899
|
+
var _appointmentBooking$o4, _appointmentBooking$o5;
|
|
839
900
|
var utils = contextUtils();
|
|
840
|
-
var
|
|
841
|
-
appointmentBooking =
|
|
842
|
-
var
|
|
843
|
-
bookingProcess =
|
|
844
|
-
bookingSubject =
|
|
845
|
-
customPageId =
|
|
846
|
-
channel =
|
|
901
|
+
var _ref27 = useAppointmentBookingContext(),
|
|
902
|
+
appointmentBooking = _ref27.appointmentBooking;
|
|
903
|
+
var _ref28 = (appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$o4 = appointmentBooking.otherParams) === null || _appointmentBooking$o4 === void 0 ? void 0 : _appointmentBooking$o4.productModuleParams) || {},
|
|
904
|
+
bookingProcess = _ref28.bookingProcess,
|
|
905
|
+
bookingSubject = _ref28.bookingSubject,
|
|
906
|
+
customPageId = _ref28.customPageId,
|
|
907
|
+
channel = _ref28.channel;
|
|
847
908
|
|
|
848
909
|
// 设置缓存
|
|
849
910
|
var setOtherData = function setOtherData(key, val) {
|
|
@@ -863,7 +924,7 @@ export var useAppointmentBookingSetting = function useAppointmentBookingSetting(
|
|
|
863
924
|
// 主体是否是表单
|
|
864
925
|
isFormSubject: (bookingSubject === null || bookingSubject === void 0 ? void 0 : bookingSubject.type) === 'form',
|
|
865
926
|
// 是否是零售模版
|
|
866
|
-
isRetailTemplate: (appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$
|
|
927
|
+
isRetailTemplate: (appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$o5 = appointmentBooking.otherParams) === null || _appointmentBooking$o5 === void 0 ? void 0 : _appointmentBooking$o5.isRetailTemplate) || false,
|
|
867
928
|
customPageId: customPageId,
|
|
868
929
|
channel: channel,
|
|
869
930
|
bookingSubject: bookingSubject,
|
|
@@ -600,8 +600,12 @@ export var getResourceTitle = function getResourceTitle(appointmentBooking, code
|
|
|
600
600
|
*/
|
|
601
601
|
export var checkAndMarkCartRenderError = function checkAndMarkCartRenderError(carts, appointmentBooking, utils) {
|
|
602
602
|
try {
|
|
603
|
+
var _carts;
|
|
603
604
|
var hasError = false;
|
|
604
|
-
|
|
605
|
+
carts = carts.filter(function (n) {
|
|
606
|
+
return !appointmentBooking.isTargetCartIdNormalProduct(n._id);
|
|
607
|
+
});
|
|
608
|
+
var updatedCartList = (_carts = carts) === null || _carts === void 0 ? void 0 : _carts.map(function (cart) {
|
|
605
609
|
var currentResource = cart === null || cart === void 0 ? void 0 : cart.currentSelectedResource;
|
|
606
610
|
if (!(currentResource !== null && currentResource !== void 0 && currentResource.renderItem)) {
|
|
607
611
|
hasError = true;
|
|
@@ -623,6 +627,7 @@ export var checkAndMarkCartRenderError = function checkAndMarkCartRenderError(ca
|
|
|
623
627
|
updatedCartList: updatedCartList
|
|
624
628
|
};
|
|
625
629
|
} catch (error) {
|
|
630
|
+
console.error(error);
|
|
626
631
|
return {};
|
|
627
632
|
}
|
|
628
633
|
};
|
|
@@ -35,20 +35,21 @@ import ProductItem from "../components/TabProduct/selectProductItem";
|
|
|
35
35
|
import TabProduct from "../components/TabProduct";
|
|
36
36
|
import EmptyBooking from "../components/emptyBooking";
|
|
37
37
|
import Footer from "../components/footer";
|
|
38
|
-
import { formatProductBundle } from "../components/footer/utils";
|
|
39
|
-
import { formatProductListByCategory, getProductTotalPrice, isSessionProduct, request } from "../utils";
|
|
38
|
+
import { formatProductBundle, formatProductOption, formatProductPrice } from "../components/footer/utils";
|
|
39
|
+
import { formatProductListByCategory, getIsEject, getProductTotalPrice, isSessionProduct, request } from "../utils";
|
|
40
40
|
import { locales, getUniqueId } from '@pisell/utils';
|
|
41
41
|
import "./index.less";
|
|
42
42
|
import useEngineContext from "../../../hooks/useEngineContext";
|
|
43
43
|
export var formatProducts = function formatProducts(values) {
|
|
44
44
|
var arr = [];
|
|
45
45
|
arr = values.map(function (item) {
|
|
46
|
-
var _item$_extend, _item$_extend2;
|
|
46
|
+
var _item$_extend, _item$_extend2, _item$_extend3, _item$_extend4;
|
|
47
47
|
return {
|
|
48
48
|
order_detail_id: item.order_detail_id || 0,
|
|
49
49
|
num: item._extend.quantity,
|
|
50
|
-
price: item
|
|
50
|
+
price: formatProductPrice(item),
|
|
51
51
|
product_id: item.id,
|
|
52
|
+
discount_list: (item === null || item === void 0 ? void 0 : item.discount_list) || [],
|
|
52
53
|
discount_amount: 0,
|
|
53
54
|
product_discount_reason: '',
|
|
54
55
|
is_charge_tax: item.is_charge_tax,
|
|
@@ -56,7 +57,9 @@ export var formatProducts = function formatProducts(values) {
|
|
|
56
57
|
discountway: 'num',
|
|
57
58
|
discount_type: 'discount',
|
|
58
59
|
bundle_edit: (_item$_extend = item._extend) === null || _item$_extend === void 0 ? void 0 : _item$_extend.bundle_edit,
|
|
59
|
-
product_bundle: formatProductBundle((_item$_extend2 = item._extend) === null || _item$_extend2 === void 0 || (_item$_extend2 = _item$_extend2.other) === null || _item$_extend2 === void 0 ? void 0 : _item$_extend2.bundle)
|
|
60
|
+
product_bundle: formatProductBundle((_item$_extend2 = item._extend) === null || _item$_extend2 === void 0 || (_item$_extend2 = _item$_extend2.other) === null || _item$_extend2 === void 0 ? void 0 : _item$_extend2.bundle),
|
|
61
|
+
"product_option_item": formatProductOption((_item$_extend3 = item._extend) === null || _item$_extend3 === void 0 || (_item$_extend3 = _item$_extend3.other) === null || _item$_extend3 === void 0 ? void 0 : _item$_extend3.option),
|
|
62
|
+
"product_variant_id": ((_item$_extend4 = item._extend) === null || _item$_extend4 === void 0 || (_item$_extend4 = _item$_extend4.other) === null || _item$_extend4 === void 0 ? void 0 : _item$_extend4.product_variant_id) || 0
|
|
60
63
|
};
|
|
61
64
|
});
|
|
62
65
|
return arr;
|
|
@@ -83,7 +86,7 @@ var restoreProductOtherData = function restoreProductOtherData(data) {
|
|
|
83
86
|
})
|
|
84
87
|
});
|
|
85
88
|
}),
|
|
86
|
-
product_variant_id: 0,
|
|
89
|
+
product_variant_id: detail.product_variant_id || 0,
|
|
87
90
|
quantity: Number(detail.product_quantity)
|
|
88
91
|
};
|
|
89
92
|
};
|
|
@@ -284,23 +287,23 @@ var Addons = Provider(function (props) {
|
|
|
284
287
|
var isSession = isSessionProduct(item);
|
|
285
288
|
|
|
286
289
|
// 是否有单规格 组合规格 套餐, 如果没有不需要打开弹窗
|
|
287
|
-
var isEject =
|
|
290
|
+
var isEject = getIsEject(item, type);
|
|
288
291
|
state.action({
|
|
289
292
|
type: 'pisell1.handleOpenProductModal',
|
|
290
293
|
data: {
|
|
291
294
|
id: item.id,
|
|
292
295
|
date: state.date.value.format('YYYY-MM-DD'),
|
|
293
296
|
showConfig: {
|
|
294
|
-
option:
|
|
297
|
+
option: true,
|
|
295
298
|
session: isSession,
|
|
296
|
-
variant:
|
|
297
|
-
package: true
|
|
299
|
+
variant: true,
|
|
300
|
+
package: true,
|
|
301
|
+
number: true
|
|
298
302
|
},
|
|
299
303
|
is_eject: isEject ? 1 : 0,
|
|
300
304
|
isOS: isSession
|
|
301
305
|
},
|
|
302
306
|
callback: function callback(e, extension_type, detail) {
|
|
303
|
-
console.log('e', e);
|
|
304
307
|
var _detail = detail || item;
|
|
305
308
|
var product = _objectSpread(_objectSpread({}, _detail), {}, {
|
|
306
309
|
_id: getUniqueId(),
|
|
@@ -308,19 +311,19 @@ var Addons = Provider(function (props) {
|
|
|
308
311
|
_extend: {
|
|
309
312
|
price: _detail.price,
|
|
310
313
|
other: e,
|
|
311
|
-
quantity: 1
|
|
314
|
+
quantity: (e === null || e === void 0 ? void 0 : e.quantity) || 1
|
|
312
315
|
},
|
|
313
|
-
quantity: 1
|
|
316
|
+
quantity: (e === null || e === void 0 ? void 0 : e.quantity) || 1
|
|
314
317
|
});
|
|
315
318
|
var _total = getProductTotalPrice(product);
|
|
316
319
|
product._extend.total = _total;
|
|
317
320
|
var _item = _list.find(function (d) {
|
|
318
|
-
return d._extend.other.
|
|
321
|
+
return d._extend.other.rowKey === e.rowKey;
|
|
319
322
|
});
|
|
320
323
|
|
|
321
324
|
// 如果已添加, 则数量+1
|
|
322
325
|
if (_item) {
|
|
323
|
-
_item._extend.quantity = _item.quantity +
|
|
326
|
+
_item._extend.quantity = _item._extend.quantity + product.quantity;
|
|
324
327
|
} else {
|
|
325
328
|
// 否则 push
|
|
326
329
|
_list.push(product);
|
|
@@ -353,22 +356,20 @@ var Addons = Provider(function (props) {
|
|
|
353
356
|
// 0 则移除
|
|
354
357
|
if (quantity == 0) {
|
|
355
358
|
_list = _list.filter(function (d) {
|
|
356
|
-
return d.
|
|
359
|
+
return d._id !== item._id;
|
|
357
360
|
});
|
|
358
361
|
} else {
|
|
359
|
-
var _item$
|
|
362
|
+
var _item$_extend5;
|
|
360
363
|
var _item = _objectSpread(_objectSpread({}, item), {}, {
|
|
361
364
|
_extend: _objectSpread(_objectSpread({}, item._extend), {}, {
|
|
362
365
|
quantity: Number(e.target.value)
|
|
363
366
|
})
|
|
364
367
|
});
|
|
365
|
-
|
|
366
|
-
_item._extend.total = _total;
|
|
367
|
-
if (((_item$_extend3 = _item._extend) === null || _item$_extend3 === void 0 ? void 0 : _item$_extend3.bundle_edit) !== undefined) {
|
|
368
|
+
if (((_item$_extend5 = _item._extend) === null || _item$_extend5 === void 0 ? void 0 : _item$_extend5.bundle_edit) !== undefined) {
|
|
368
369
|
_item._extend.bundle_edit = 1;
|
|
369
370
|
}
|
|
370
371
|
_list = _list.map(function (d) {
|
|
371
|
-
return d.
|
|
372
|
+
return d._id === item._id ? _item : d;
|
|
372
373
|
});
|
|
373
374
|
}
|
|
374
375
|
dispatch({
|
|
@@ -497,10 +498,11 @@ var Addons = Provider(function (props) {
|
|
|
497
498
|
id: item.id,
|
|
498
499
|
date: state.date.value.format('YYYY-MM-DD'),
|
|
499
500
|
showConfig: {
|
|
500
|
-
option:
|
|
501
|
+
option: true,
|
|
501
502
|
session: isSession,
|
|
502
|
-
variant:
|
|
503
|
-
package: true
|
|
503
|
+
variant: true,
|
|
504
|
+
package: true,
|
|
505
|
+
number: true
|
|
504
506
|
},
|
|
505
507
|
value: item._extend.other,
|
|
506
508
|
isOS: isSession
|
|
@@ -508,9 +510,12 @@ var Addons = Provider(function (props) {
|
|
|
508
510
|
callback: function callback(e, extension_type, detail) {
|
|
509
511
|
var _product$_extend;
|
|
510
512
|
var _detail = detail || item;
|
|
511
|
-
var product = _objectSpread(_objectSpread({}, _detail), {}, {
|
|
513
|
+
var product = _objectSpread(_objectSpread(_objectSpread({}, item), _detail), {}, {
|
|
514
|
+
// 编辑商品时清除折扣信息
|
|
515
|
+
discount_list: [],
|
|
512
516
|
_extend: _objectSpread(_objectSpread({}, item._extend), {}, {
|
|
513
|
-
other: e
|
|
517
|
+
other: e,
|
|
518
|
+
quantity: (e === null || e === void 0 ? void 0 : e.quantity) || 1
|
|
514
519
|
})
|
|
515
520
|
});
|
|
516
521
|
if (((_product$_extend = product._extend) === null || _product$_extend === void 0 ? void 0 : _product$_extend.bundle_edit) !== undefined) {
|
|
@@ -9,7 +9,7 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
|
9
9
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
10
10
|
import { getDiscountTime, flexibleObj } from "../../utils";
|
|
11
11
|
import { formatAmount } from '@pisell/utils';
|
|
12
|
-
import { isDayBooking, isDayBookingProduct } from "../../info/service2/utils";
|
|
12
|
+
import { isDayBooking, isDayBookingProduct, isNormalProductByDurationSchedule } from "../../info/service2/utils";
|
|
13
13
|
export var getRelationDetailsTotal = function getRelationDetailsTotal(relation_details) {
|
|
14
14
|
var total = 0;
|
|
15
15
|
var _iterator = _createForOfIteratorHelper(relation_details),
|
|
@@ -47,7 +47,7 @@ var getProductAmount = function getProductAmount(state, isEdit) {
|
|
|
47
47
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
48
48
|
var _item = _step2.value;
|
|
49
49
|
// 跨日预约
|
|
50
|
-
if (isDay) {
|
|
50
|
+
if (isDay || isNormalProductByDurationSchedule(_item)) {
|
|
51
51
|
var quantity = _item._extend.quantity || 1;
|
|
52
52
|
price += Number(_item._extend.total) * Number(quantity);
|
|
53
53
|
|