@pisell/private-materials 3.0.175 → 3.0.177

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.
@@ -12,7 +12,7 @@ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symb
12
12
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
13
13
  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; }
14
14
  import React from 'react';
15
- import { getServeStartTime, getDuration, getEndDate, flexibleObj, sliceDayIntoFiveMinutes, getDiscountTime, getCacheParams } from "../../../utils";
15
+ import { getServeStartTime, getDuration, getEndDate, flexibleObj, sliceDayIntoFiveMinutes, getDiscountTime, getServiceTimes, getCacheParams } from "../../../utils";
16
16
  import { getServiceStartTimeAndEndTime, formatResource, getErrorList } from "../../utilsByBooking";
17
17
  import dayjs from 'dayjs';
18
18
  import { locales } from '@pisell/utils';
@@ -474,6 +474,14 @@ export var getProductExtend = function getProductExtend(_ref8) {
474
474
  });
475
475
  if (getDuration(_cacheItem === null || _cacheItem === void 0 ? void 0 : _cacheItem.duration) === 'flexible') {
476
476
  _cacheItem._extend.duration = _cacheItem._data.timeObj.durationSlicesBasedOnTime[0].value;
477
+
478
+ // 计算服务的开始和结束时间
479
+ var _getServiceTimes = getServiceTimes({
480
+ _extend: _cacheItem._extend
481
+ }),
482
+ startDate = _getServiceTimes.startDate,
483
+ endDate = _getServiceTimes.endDate;
484
+ _cacheItem._extend.endDate = endDate;
477
485
  }
478
486
  }
479
487
 
@@ -334,6 +334,10 @@ var getProductExtend = ({ cacheItem, state }) => {
334
334
  });
335
335
  if ((0, import_utils.getDuration)(_cacheItem == null ? void 0 : _cacheItem.duration) === "flexible") {
336
336
  _cacheItem._extend.duration = _cacheItem._data.timeObj.durationSlicesBasedOnTime[0].value;
337
+ const { startDate, endDate } = (0, import_utils.getServiceTimes)({
338
+ _extend: _cacheItem._extend
339
+ });
340
+ _cacheItem._extend.endDate = endDate;
337
341
  }
338
342
  }
339
343
  _cacheItem.autoClose = getIsAutoClose(_cacheItem);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "3.0.175",
3
+ "version": "3.0.177",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -59,10 +59,10 @@
59
59
  "react-infinite-scroll-component": "^6.1.0",
60
60
  "rc-virtual-list": "^3.11.3",
61
61
  "decimal.js": "^10.4.3",
62
- "@pisell/utils": "1.0.42",
63
- "@pisell/icon": "0.0.11",
64
62
  "@pisell/date-picker": "1.0.100",
65
- "@pisell/materials": "3.0.51"
63
+ "@pisell/icon": "0.0.11",
64
+ "@pisell/utils": "1.0.42",
65
+ "@pisell/materials": "3.0.52"
66
66
  },
67
67
  "peerDependencies": {
68
68
  "react": "^18.0.0",