@pisell/pisellos 2.1.87 → 2.1.89

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.
@@ -1533,8 +1533,8 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
1533
1533
  quantity: 1,
1534
1534
  discount_list: updatedMainDiscountList,
1535
1535
  bundle: newBundleWithDiscount,
1536
- total: newTotalWithDiscount,
1537
- origin_total: newOriginTotalWithDiscount
1536
+ total: new Decimal(newTotalWithDiscount).toDecimalPlaces(2, Decimal.ROUND_DOWN).toNumber(),
1537
+ origin_total: new Decimal(newOriginTotalWithDiscount).toDecimalPlaces(2, Decimal.ROUND_DOWN).toNumber()
1538
1538
  })));
1539
1539
 
1540
1540
  // 第二个:包含原始bundle (qty=原quantity-1)
@@ -1596,6 +1596,8 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
1596
1596
  return accumulator.add(currentPrice.mul(currentNum));
1597
1597
  }, new Decimal(newTotalOriginal)).toNumber();
1598
1598
  }
1599
+ newTotalOriginal = new Decimal(newTotalOriginal).toDecimalPlaces(2, Decimal.ROUND_DOWN).toNumber();
1600
+ newOriginTotalOriginal = new Decimal(newOriginTotalOriginal).toDecimalPlaces(2, Decimal.ROUND_DOWN).toNumber();
1599
1601
 
1600
1602
  // 添加第二个主商品:qty=原quantity-1,包含原始bundle
1601
1603
  result.push(_this3.hooks.setProduct(mainProduct, _objectSpread(_objectSpread({}, mainProductData), {}, {
@@ -1700,6 +1702,8 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
1700
1702
  return accumulator.add(currentPrice.mul(currentNum));
1701
1703
  }, new Decimal(newTotal)).toNumber();
1702
1704
  }
1705
+ newTotal = new Decimal(newTotal).toDecimalPlaces(2, Decimal.ROUND_DOWN).toNumber();
1706
+ newOriginTotal = new Decimal(newOriginTotal).toDecimalPlaces(2, Decimal.ROUND_DOWN).toNumber();
1703
1707
 
1704
1708
  // 生成最终的主商品
1705
1709
  result.push(_this3.hooks.setProduct(mainProduct, _objectSpread(_objectSpread({}, mainProductData), {}, {
@@ -310,7 +310,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
310
310
  date: string;
311
311
  status: string;
312
312
  week: string;
313
- weekNum: 0 | 1 | 2 | 3 | 4 | 5 | 6;
313
+ weekNum: 0 | 2 | 1 | 3 | 4 | 5 | 6;
314
314
  }[]>;
315
315
  submitTimeSlot(timeSlots: TimeSliceItem): void;
316
316
  private getScheduleDataByIds;
@@ -2881,12 +2881,14 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
2881
2881
  currentStats.left += 1;
2882
2882
  if (currentResourceTypeConfig.type === 'multiple') {
2883
2883
  currentStats.summaryCount += currentResourceMaxRemainingCapacity;
2884
- if (currentResourceMaxRemainingCapacity > currentStats.count) currentStats.count = currentResourceMaxRemainingCapacity;
2885
- } else {
2886
- // 单个预约:一个资源只计 1,不关心剩余容量
2887
- currentStats.summaryCount += 1;
2888
- if (currentStats.count < 1) currentStats.count = 1;
2889
2884
  }
2885
+ if (currentResourceMaxRemainingCapacity > currentStats.count) currentStats.count = currentResourceMaxRemainingCapacity;
2886
+ // else {
2887
+ // 单个预约:一个资源只计 1,不关心剩余容量
2888
+ // currentStats.summaryCount += 1;
2889
+ // if (currentStats.count < 1) currentStats.count = 1;
2890
+ //}
2891
+
2890
2892
  statsByResourceType[m.form_id] = currentStats;
2891
2893
  });
2892
2894
  // 容量检测
@@ -115,7 +115,7 @@ export declare class BookingTicketImpl extends BaseModule implements Module {
115
115
  * 获取当前的客户搜索条件
116
116
  * @returns 当前搜索条件
117
117
  */
118
- getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "num" | "skip">;
118
+ getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
119
119
  /**
120
120
  * 获取客户列表状态(包含滚动加载相关状态)
121
121
  * @returns 客户状态
@@ -1153,8 +1153,8 @@ var RulesModule = class extends import_BaseModule.BaseModule {
1153
1153
  quantity: 1,
1154
1154
  discount_list: updatedMainDiscountList,
1155
1155
  bundle: newBundleWithDiscount,
1156
- total: newTotalWithDiscount,
1157
- origin_total: newOriginTotalWithDiscount
1156
+ total: new import_decimal.default(newTotalWithDiscount).toDecimalPlaces(2, import_decimal.default.ROUND_DOWN).toNumber(),
1157
+ origin_total: new import_decimal.default(newOriginTotalWithDiscount).toDecimalPlaces(2, import_decimal.default.ROUND_DOWN).toNumber()
1158
1158
  })
1159
1159
  );
1160
1160
  if (mainProductQuantity > 1) {
@@ -1204,6 +1204,8 @@ var RulesModule = class extends import_BaseModule.BaseModule {
1204
1204
  return accumulator.add(currentPrice.mul(currentNum));
1205
1205
  }, new import_decimal.default(newTotalOriginal)).toNumber();
1206
1206
  }
1207
+ newTotalOriginal = new import_decimal.default(newTotalOriginal).toDecimalPlaces(2, import_decimal.default.ROUND_DOWN).toNumber();
1208
+ newOriginTotalOriginal = new import_decimal.default(newOriginTotalOriginal).toDecimalPlaces(2, import_decimal.default.ROUND_DOWN).toNumber();
1207
1209
  result.push(
1208
1210
  this.hooks.setProduct(mainProduct, {
1209
1211
  ...mainProductData,
@@ -1287,6 +1289,8 @@ var RulesModule = class extends import_BaseModule.BaseModule {
1287
1289
  return accumulator.add(currentPrice.mul(currentNum));
1288
1290
  }, new import_decimal.default(newTotal)).toNumber();
1289
1291
  }
1292
+ newTotal = new import_decimal.default(newTotal).toDecimalPlaces(2, import_decimal.default.ROUND_DOWN).toNumber();
1293
+ newOriginTotal = new import_decimal.default(newOriginTotal).toDecimalPlaces(2, import_decimal.default.ROUND_DOWN).toNumber();
1290
1294
  result.push(
1291
1295
  this.hooks.setProduct(mainProduct, {
1292
1296
  ...mainProductData,
@@ -310,7 +310,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
310
310
  date: string;
311
311
  status: string;
312
312
  week: string;
313
- weekNum: 0 | 1 | 2 | 3 | 4 | 5 | 6;
313
+ weekNum: 0 | 2 | 1 | 3 | 4 | 5 | 6;
314
314
  }[]>;
315
315
  submitTimeSlot(timeSlots: TimeSliceItem): void;
316
316
  private getScheduleDataByIds;
@@ -2034,13 +2034,9 @@ var BookingByStepImpl = class extends import_BaseModule.BaseModule {
2034
2034
  currentStats.left += 1;
2035
2035
  if (currentResourceTypeConfig.type === "multiple") {
2036
2036
  currentStats.summaryCount += currentResourceMaxRemainingCapacity;
2037
- if (currentResourceMaxRemainingCapacity > currentStats.count)
2038
- currentStats.count = currentResourceMaxRemainingCapacity;
2039
- } else {
2040
- currentStats.summaryCount += 1;
2041
- if (currentStats.count < 1)
2042
- currentStats.count = 1;
2043
2037
  }
2038
+ if (currentResourceMaxRemainingCapacity > currentStats.count)
2039
+ currentStats.count = currentResourceMaxRemainingCapacity;
2044
2040
  statsByResourceType[m.form_id] = currentStats;
2045
2041
  });
2046
2042
  const cartItems2 = this.store.cart.getItems();
@@ -115,7 +115,7 @@ export declare class BookingTicketImpl extends BaseModule implements Module {
115
115
  * 获取当前的客户搜索条件
116
116
  * @returns 当前搜索条件
117
117
  */
118
- getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "num" | "skip">;
118
+ getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
119
119
  /**
120
120
  * 获取客户列表状态(包含滚动加载相关状态)
121
121
  * @returns 客户状态
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "2.1.87",
4
+ "version": "2.1.89",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",