@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.
Files changed (143) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/meta.js +1 -1
  5. package/build/lowcode/render/default/view.js +3 -3
  6. package/build/lowcode/view.js +3 -3
  7. package/es/businessModel/SalesModel/index.d.ts +1 -0
  8. package/es/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -0
  9. package/es/components/appointmentBooking/components/Cart/Item/index.js +3 -0
  10. package/es/components/appointmentBooking/components/Content/index.d.ts +1 -0
  11. package/es/components/appointmentBooking/components/Content/index.js +7 -1
  12. package/es/components/appointmentBooking/components/Header/index.d.ts +1 -0
  13. package/es/components/appointmentBooking/components/Header/index.js +2 -2
  14. package/es/components/appointmentBooking/components/Resource/index.js +30 -12
  15. package/es/components/appointmentBooking/components/Services/index.js +5 -2
  16. package/es/components/appointmentBooking/components/TimeSlicing/index.js +7 -4
  17. package/es/components/appointmentBooking/components/Voucher/index.js +1 -0
  18. package/es/components/appointmentBooking/context.js +7 -3
  19. package/es/components/appointmentBooking/hooks.js +129 -68
  20. package/es/components/appointmentBooking/index.d.ts +1 -0
  21. package/es/components/appointmentBooking/utils.js +6 -1
  22. package/es/components/booking/addons/index.js +31 -26
  23. package/es/components/booking/components/footer/amount.js +2 -2
  24. package/es/components/booking/components/footer/index.d.ts +1 -0
  25. package/es/components/booking/components/footer/utils.d.ts +9 -0
  26. package/es/components/booking/components/footer/utils.js +32 -10
  27. package/es/components/booking/info/service/Lists.d.ts +1 -0
  28. package/es/components/booking/info/service/addService/index.d.ts +1 -0
  29. package/es/components/booking/info/service/addService/index.js +2 -2
  30. package/es/components/booking/info/service/serviceList/index.d.ts +1 -0
  31. package/es/components/booking/info/service2/Lists.d.ts +1 -0
  32. package/es/components/booking/info/service2/utils.d.ts +4 -1
  33. package/es/components/booking/info/service2/utils.js +21 -2
  34. package/es/components/booking/info/utils.js +1 -1
  35. package/es/components/booking/info2/service/addService/index.js +9 -6
  36. package/es/components/booking/info2/service/addTimeModal/index.d.ts +1 -0
  37. package/es/components/booking/info2/service/editService/index.js +56 -18
  38. package/es/components/booking/info2/service/serviceList/index.d.ts +1 -0
  39. package/es/components/booking/utils.d.ts +3 -2
  40. package/es/components/booking/utils.js +5 -0
  41. package/es/components/eftposPay/amount.d.ts +1 -1
  42. package/es/components/eftposPay/device.d.ts +1 -1
  43. package/es/components/eftposPay/hooks.d.ts +1 -1
  44. package/es/components/eftposPay/store/index.d.ts +2 -2
  45. package/es/components/eventBooking/components/Provider/Content/index.d.ts +1 -0
  46. package/es/components/eventBooking/components/Provider/Header/index.d.ts +1 -0
  47. package/es/components/eventBooking/components/Provider/SelectHolderModal.d.ts +1 -0
  48. package/es/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +1 -0
  49. package/es/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +1 -0
  50. package/es/components/eventBooking/index.d.ts +1 -0
  51. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
  52. package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
  53. package/es/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +1 -0
  54. package/es/components/pisellSelectCustomerModal/RightPanel/index.d.ts +1 -0
  55. package/es/components/productExtension/fields/Actor/index.d.ts +1 -0
  56. package/es/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
  57. package/es/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
  58. package/es/components/productExtension/index.d.ts +1 -0
  59. package/es/components/ruleSetting/index.d.ts +1 -0
  60. package/es/components/shoppingCart/components/Empty/index.d.ts +1 -0
  61. package/es/components/shoppingCart/components/Render/index.d.ts +1 -0
  62. package/es/components/shoppingCart/index.d.ts +1 -0
  63. package/es/components/ticketBooking/components/addServiceVariant/addService.js +75 -26
  64. package/es/components/ticketBooking/components/notAvailable/index.d.ts +3 -0
  65. package/es/components/ticketBooking/components/notAvailable/index.js +39 -0
  66. package/es/components/ticketBooking/components/ticketBooking/index.d.ts +1 -0
  67. package/es/components/ticketBooking/index.d.ts +1 -0
  68. package/es/components/ticketBooking/index.js +1 -1
  69. package/es/components/ticketBooking/locales.d.ts +6 -0
  70. package/es/components/ticketBooking/locales.js +9 -3
  71. package/es/components/ticketBooking/serve.js +98 -92
  72. package/es/components/ticketBooking/utils/index.d.ts +1 -0
  73. package/es/components/ticketBooking/utils/index.js +33 -0
  74. package/es/components/wallet/hooks/useWalletCard.d.ts +1 -0
  75. package/lib/businessModel/SalesModel/index.d.ts +1 -0
  76. package/lib/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -0
  77. package/lib/components/appointmentBooking/components/Cart/Item/index.js +3 -0
  78. package/lib/components/appointmentBooking/components/Content/index.d.ts +1 -0
  79. package/lib/components/appointmentBooking/components/Content/index.js +3 -1
  80. package/lib/components/appointmentBooking/components/Header/index.d.ts +1 -0
  81. package/lib/components/appointmentBooking/components/Header/index.js +1 -1
  82. package/lib/components/appointmentBooking/components/Resource/index.js +15 -9
  83. package/lib/components/appointmentBooking/components/Services/index.js +3 -2
  84. package/lib/components/appointmentBooking/components/TimeSlicing/index.js +4 -3
  85. package/lib/components/appointmentBooking/components/Voucher/index.js +1 -0
  86. package/lib/components/appointmentBooking/context.js +7 -3
  87. package/lib/components/appointmentBooking/hooks.js +73 -12
  88. package/lib/components/appointmentBooking/index.d.ts +1 -0
  89. package/lib/components/appointmentBooking/utils.js +2 -0
  90. package/lib/components/booking/addons/index.js +27 -21
  91. package/lib/components/booking/components/footer/amount.js +1 -1
  92. package/lib/components/booking/components/footer/index.d.ts +1 -0
  93. package/lib/components/booking/components/footer/utils.d.ts +9 -0
  94. package/lib/components/booking/components/footer/utils.js +24 -7
  95. package/lib/components/booking/info/service/Lists.d.ts +1 -0
  96. package/lib/components/booking/info/service/addService/index.d.ts +1 -0
  97. package/lib/components/booking/info/service/addService/index.js +1 -1
  98. package/lib/components/booking/info/service/serviceList/index.d.ts +1 -0
  99. package/lib/components/booking/info/service2/Lists.d.ts +1 -0
  100. package/lib/components/booking/info/service2/utils.d.ts +4 -1
  101. package/lib/components/booking/info/service2/utils.js +21 -2
  102. package/lib/components/booking/info/utils.js +1 -1
  103. package/lib/components/booking/info2/service/addService/index.js +8 -5
  104. package/lib/components/booking/info2/service/addTimeModal/index.d.ts +1 -0
  105. package/lib/components/booking/info2/service/editService/index.js +59 -23
  106. package/lib/components/booking/info2/service/serviceList/index.d.ts +1 -0
  107. package/lib/components/booking/utils.d.ts +3 -2
  108. package/lib/components/booking/utils.js +6 -0
  109. package/lib/components/eftposPay/amount.d.ts +1 -1
  110. package/lib/components/eftposPay/device.d.ts +1 -1
  111. package/lib/components/eftposPay/hooks.d.ts +1 -1
  112. package/lib/components/eftposPay/store/index.d.ts +2 -2
  113. package/lib/components/eventBooking/components/Provider/Content/index.d.ts +1 -0
  114. package/lib/components/eventBooking/components/Provider/Header/index.d.ts +1 -0
  115. package/lib/components/eventBooking/components/Provider/SelectHolderModal.d.ts +1 -0
  116. package/lib/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +1 -0
  117. package/lib/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +1 -0
  118. package/lib/components/eventBooking/index.d.ts +1 -0
  119. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
  120. package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
  121. package/lib/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +1 -0
  122. package/lib/components/pisellSelectCustomerModal/RightPanel/index.d.ts +1 -0
  123. package/lib/components/productExtension/fields/Actor/index.d.ts +1 -0
  124. package/lib/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
  125. package/lib/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
  126. package/lib/components/productExtension/index.d.ts +1 -0
  127. package/lib/components/ruleSetting/index.d.ts +1 -0
  128. package/lib/components/shoppingCart/components/Empty/index.d.ts +1 -0
  129. package/lib/components/shoppingCart/components/Render/index.d.ts +1 -0
  130. package/lib/components/shoppingCart/index.d.ts +1 -0
  131. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +74 -20
  132. package/lib/components/ticketBooking/components/notAvailable/index.d.ts +3 -0
  133. package/lib/components/ticketBooking/components/notAvailable/index.js +61 -0
  134. package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +1 -0
  135. package/lib/components/ticketBooking/index.d.ts +1 -0
  136. package/lib/components/ticketBooking/index.js +1 -1
  137. package/lib/components/ticketBooking/locales.d.ts +6 -0
  138. package/lib/components/ticketBooking/locales.js +9 -3
  139. package/lib/components/ticketBooking/serve.js +6 -2
  140. package/lib/components/ticketBooking/utils/index.d.ts +1 -0
  141. package/lib/components/ticketBooking/utils/index.js +33 -0
  142. package/lib/components/wallet/hooks/useWalletCard.d.ts +1 -0
  143. 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 _stepList;
203
- var beforeKey = (_stepList = stepList[stepList.length - 2]) === null || _stepList === void 0 ? void 0 : _stepList.key;
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 _checkAndGoNext = checkAndGoNext(isFormSubject, checkAccount, carts),
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 _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
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
- getHolders();
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 _ref3.apply(this, arguments);
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 _ref4 = useAppointmentBookingContext(),
336
- appointmentBooking = _ref4.appointmentBooking;
337
- var _ref5 = (appointmentBooking === null || appointmentBooking === void 0 ? void 0 : appointmentBooking.otherParams) || {},
338
- productModuleParams = _ref5.productModuleParams;
339
- var _ref6 = productModuleParams || {},
340
- bookingProcess = _ref6.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 _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
345
- var _dates$, dates, _ref8, _productModuleParams, _productList, _ref9, productModuleParams, productList;
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
- _ref8 = (appointmentBooking === null || appointmentBooking === void 0 ? void 0 : appointmentBooking.otherParams) || {}, _productModuleParams = _ref8.productModuleParams;
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
- _ref9 = (appointmentBooking === null || appointmentBooking === void 0 ? void 0 : appointmentBooking.otherParams) || {}, productModuleParams = _ref9.productModuleParams;
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 _ref7.apply(this, arguments);
447
+ return _ref8.apply(this, arguments);
387
448
  };
388
449
  }();
389
450
 
390
451
  // 检测商品类型
391
452
  var checkProductType = /*#__PURE__*/function () {
392
- var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(productId) {
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 _ref10.apply(this, arguments);
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$o;
487
+ var _appointmentBooking$o2;
427
488
  var pisellOS = usePisellOS();
428
489
  var utils = contextUtils();
429
- var _ref11 = useAppointmentBookingContext(),
430
- appointmentBooking = _ref11.appointmentBooking,
431
- setCarts = _ref11.setCarts,
432
- setSummary = _ref11.setSummary,
433
- setIsAgreeDepositPolicy = _ref11.setIsAgreeDepositPolicy;
434
- var _ref12 = (appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$o = appointmentBooking.otherParams) === null || _appointmentBooking$o === void 0 ? void 0 : _appointmentBooking$o.productModuleParams) || {},
435
- bookingSubject = _ref12.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 _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
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 _ref13.apply(this, arguments);
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 _ref15 = params || {},
518
- callback = _ref15.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$o2;
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 _ref16 = (appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$o2 = appointmentBooking.otherParams) === null || _appointmentBooking$o2 === void 0 ? void 0 : _appointmentBooking$o2.productModuleParams) || {},
550
- bookingSubject = _ref16.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 _ref17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7() {
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 _ref17.apply(this, arguments);
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 _ref18 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(res) {
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 _ref18.apply(this, arguments);
653
+ return _ref19.apply(this, arguments);
593
654
  };
594
655
  }());
595
656
  }, []);
596
657
 
597
658
  // 获取表单数据
598
659
  var getHolders = /*#__PURE__*/function () {
599
- var _ref19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9() {
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 _ref19.apply(this, arguments);
700
+ return _ref20.apply(this, arguments);
640
701
  };
641
702
  }();
642
703
 
643
704
  // 添加账户
644
705
  var addAccount = /*#__PURE__*/function () {
645
- var _ref20 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(val, type) {
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 _ref20.apply(this, arguments);
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 _ref21 = useAppointmentBookingContext(),
692
- appointmentBooking = _ref21.appointmentBooking,
693
- setResources = _ref21.setResources,
694
- setTimes = _ref21.setTimes;
695
- var _ref22 = (appointmentBooking === null || appointmentBooking === void 0 ? void 0 : appointmentBooking.otherParams) || {},
696
- resourceSort = _ref22.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 _ref23 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(index) {
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 _ref23.apply(this, arguments);
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 _ref24 = useAppointmentBookingContext(),
757
- currentStepParams = _ref24.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 _ref25 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12() {
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 _ref25.apply(this, arguments);
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$o3, _appointmentBooking$o4;
899
+ var _appointmentBooking$o4, _appointmentBooking$o5;
839
900
  var utils = contextUtils();
840
- var _ref26 = useAppointmentBookingContext(),
841
- appointmentBooking = _ref26.appointmentBooking;
842
- var _ref27 = (appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$o3 = appointmentBooking.otherParams) === null || _appointmentBooking$o3 === void 0 ? void 0 : _appointmentBooking$o3.productModuleParams) || {},
843
- bookingProcess = _ref27.bookingProcess,
844
- bookingSubject = _ref27.bookingSubject,
845
- customPageId = _ref27.customPageId,
846
- channel = _ref27.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$o4 = appointmentBooking.otherParams) === null || _appointmentBooking$o4 === void 0 ? void 0 : _appointmentBooking$o4.isRetailTemplate) || false,
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,
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const AppointmentBooking: () => JSX.Element;
3
4
  export default AppointmentBooking;
@@ -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
- var updatedCartList = carts === null || carts === void 0 ? void 0 : carts.map(function (cart) {
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._extend.price,
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 = type === 'detail' || item.bundle_group_count > 0 || isSession;
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: false,
297
+ option: true,
295
298
  session: isSession,
296
- variant: false,
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.key === e.key;
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 + 1;
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.id !== item.id;
359
+ return d._id !== item._id;
357
360
  });
358
361
  } else {
359
- var _item$_extend3;
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
- var _total = getProductTotalPrice(_item);
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.id === item.id ? _item : 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: false,
501
+ option: true,
501
502
  session: isSession,
502
- variant: false,
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
 
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  /**
3
4
  * @title: 底部