@pisell/pisellos 3.0.43 → 3.0.44

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.
@@ -441,7 +441,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
441
441
  productOriginTotal = product.total;
442
442
  }
443
443
  // 如果当前 product 有 discount_list,则必须从 origin_total 拿
444
- if ((_product$discount_lis10 = product.discount_list) !== null && _product$discount_lis10 !== void 0 && _product$discount_lis10.length) {
444
+ if ((_product$discount_lis10 = product.discount_list) !== null && _product$discount_lis10 !== void 0 && _product$discount_lis10.length && product.origin_total) {
445
445
  productOriginTotal = product.origin_total;
446
446
  }
447
447
 
@@ -2167,12 +2167,12 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
2167
2167
  value: 10
2168
2168
  };
2169
2169
  resource.startTime = timeSlots.start_at.format('YYYY-MM-DD HH:mm');
2170
- // 找到resource.times里最早的end_at
2170
+ // 找到resource.times里最晚的end_at
2171
2171
  var targetResourceTimes = allResources === null || allResources === void 0 || (_allResources$find = allResources.find(function (n) {
2172
2172
  return n.id === resource.id;
2173
2173
  })) === null || _allResources$find === void 0 ? void 0 : _allResources$find.times;
2174
2174
  var resourcesEndTime = targetResourceTimes.reduce(function (acc, curr) {
2175
- return dayjs(curr.end_at).isBefore(dayjs(acc.end_at)) ? curr : acc;
2175
+ return dayjs(curr.end_at).isAfter(dayjs(acc.end_at)) ? curr : acc;
2176
2176
  }, targetResourceTimes[0]);
2177
2177
 
2178
2178
  // 将 operating_day_boundary 转换为与 resourcesEndTime.end_at 相同日期的完整日期时间
@@ -301,7 +301,7 @@ var RulesModule = class extends import_BaseModule.BaseModule {
301
301
  if (Number(((_g = originProduct == null ? void 0 : originProduct._productInit) == null ? void 0 : _g.original_price) || 0) > 0 && product.origin_total && product.total && product.origin_total !== product.total) {
302
302
  productOriginTotal = product.total;
303
303
  }
304
- if ((_h = product.discount_list) == null ? void 0 : _h.length) {
304
+ if (((_h = product.discount_list) == null ? void 0 : _h.length) && product.origin_total) {
305
305
  productOriginTotal = product.origin_total;
306
306
  }
307
307
  const targetProductTotal = selectedDiscount2.tag === "good_pass" ? new import_decimal.default(productOriginTotal).minus(new import_decimal.default(product.price || 0)).toNumber() : new import_decimal.default(100).minus(selectedDiscount2.par_value || 0).div(100).mul(new import_decimal.default(productOriginTotal)).toNumber();
@@ -1503,7 +1503,7 @@ var BookingByStepImpl = class extends import_BaseModule.BaseModule {
1503
1503
  )) == null ? void 0 : _c.times;
1504
1504
  const resourcesEndTime = targetResourceTimes.reduce(
1505
1505
  (acc, curr) => {
1506
- return (0, import_dayjs.default)(curr.end_at).isBefore((0, import_dayjs.default)(acc.end_at)) ? curr : acc;
1506
+ return (0, import_dayjs.default)(curr.end_at).isAfter((0, import_dayjs.default)(acc.end_at)) ? curr : acc;
1507
1507
  },
1508
1508
  targetResourceTimes[0]
1509
1509
  );
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "3.0.43",
4
+ "version": "3.0.44",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",