@pisell/pisellos 0.0.302 → 0.0.304

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.
@@ -128,7 +128,7 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
128
128
  case 0:
129
129
  startTime = Date.now();
130
130
  walletParams = this.generateWalletParams(businessData);
131
- if (!(Number((businessData === null || businessData === void 0 || (_businessData$amountI = businessData.amountInfo) === null || _businessData$amountI === void 0 ? void 0 : _businessData$amountI.totalAmount) || 0) < 0 || Number((businessData === null || businessData === void 0 || (_businessData$amountI2 = businessData.amountInfo) === null || _businessData$amountI2 === void 0 ? void 0 : _businessData$amountI2.subTotal) || 0) < 0)) {
131
+ if (!(Number((businessData === null || businessData === void 0 || (_businessData$amountI = businessData.amountInfo) === null || _businessData$amountI === void 0 ? void 0 : _businessData$amountI.totalAmount) || 0) < 0 || Number((businessData === null || businessData === void 0 || (_businessData$amountI2 = businessData.amountInfo) === null || _businessData$amountI2 === void 0 ? void 0 : _businessData$amountI2.subTotal) || 0) < 0 || [1, 0].includes(walletParams === null || walletParams === void 0 ? void 0 : walletParams.customer_id))) {
132
132
  _context.next = 4;
133
133
  break;
134
134
  }
@@ -49,5 +49,5 @@ export declare class Product extends BaseModule implements Module {
49
49
  getCategories(): ProductCategory[];
50
50
  setOtherParams(key: string, value: any): void;
51
51
  getOtherParams(): any;
52
- getProductType(): "duration" | "session" | "normal";
52
+ getProductType(): "normal" | "duration" | "session";
53
53
  }
@@ -326,7 +326,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
326
326
  };
327
327
  setOtherData(key: string, value: any): void;
328
328
  getOtherData(key: string): any;
329
- getProductTypeById(id: number): Promise<"duration" | "session" | "normal">;
329
+ getProductTypeById(id: number): Promise<"normal" | "duration" | "session">;
330
330
  /**
331
331
  * 提供给 UI 的方法,减轻 UI 层的计算压力,UI 层只需要传递 cartItemId 和 resourceCode 即返回对应的 renderList
332
332
  *
@@ -111,7 +111,7 @@ export declare class BookingTicketImpl extends BaseModule implements Module {
111
111
  * 获取当前的客户搜索条件
112
112
  * @returns 当前搜索条件
113
113
  */
114
- getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
114
+ getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "num" | "skip">;
115
115
  /**
116
116
  * 获取客户列表状态(包含滚动加载相关状态)
117
117
  * @returns 客户状态
@@ -521,6 +521,9 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
521
521
  summaryDeposit.hasDeposit = true;
522
522
  }
523
523
  });
524
+
525
+ // 将总金额四舍五入到两位小数
526
+ summaryDeposit.total = new Decimal(summaryDeposit.total).toDecimalPlaces(2, Decimal.ROUND_HALF_UP).toNumber();
524
527
  return summaryDeposit;
525
528
  }
526
529
 
@@ -1068,7 +1071,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
1068
1071
 
1069
1072
  // 订单ID替换后更新 stateAmount
1070
1073
  _context13.next = 15;
1071
- return this.updateStateAmountToRemaining();
1074
+ return this.updateStateAmountToRemaining(false);
1072
1075
  case 15:
1073
1076
  return _context13.abrupt("return", updatedOrder);
1074
1077
  case 18:
@@ -99,7 +99,7 @@ var WalletPassPaymentImpl = class {
99
99
  var _a, _b, _c, _d, _e, _f, _g, _h;
100
100
  const startTime = Date.now();
101
101
  const walletParams = this.generateWalletParams(businessData);
102
- if (Number(((_a = businessData == null ? void 0 : businessData.amountInfo) == null ? void 0 : _a.totalAmount) || 0) < 0 || Number(((_b = businessData == null ? void 0 : businessData.amountInfo) == null ? void 0 : _b.subTotal) || 0) < 0) {
102
+ if (Number(((_a = businessData == null ? void 0 : businessData.amountInfo) == null ? void 0 : _a.totalAmount) || 0) < 0 || Number(((_b = businessData == null ? void 0 : businessData.amountInfo) == null ? void 0 : _b.subTotal) || 0) < 0 || [1, 0].includes(walletParams == null ? void 0 : walletParams.customer_id)) {
103
103
  return {
104
104
  walletRecommendList: [],
105
105
  userIdentificationCodes: []
@@ -49,5 +49,5 @@ export declare class Product extends BaseModule implements Module {
49
49
  getCategories(): ProductCategory[];
50
50
  setOtherParams(key: string, value: any): void;
51
51
  getOtherParams(): any;
52
- getProductType(): "duration" | "session" | "normal";
52
+ getProductType(): "normal" | "duration" | "session";
53
53
  }
@@ -326,7 +326,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
326
326
  };
327
327
  setOtherData(key: string, value: any): void;
328
328
  getOtherData(key: string): any;
329
- getProductTypeById(id: number): Promise<"duration" | "session" | "normal">;
329
+ getProductTypeById(id: number): Promise<"normal" | "duration" | "session">;
330
330
  /**
331
331
  * 提供给 UI 的方法,减轻 UI 层的计算压力,UI 层只需要传递 cartItemId 和 resourceCode 即返回对应的 renderList
332
332
  *
@@ -111,7 +111,7 @@ export declare class BookingTicketImpl extends BaseModule implements Module {
111
111
  * 获取当前的客户搜索条件
112
112
  * @returns 当前搜索条件
113
113
  */
114
- getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
114
+ getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "num" | "skip">;
115
115
  /**
116
116
  * 获取客户列表状态(包含滚动加载相关状态)
117
117
  * @returns 客户状态
@@ -321,6 +321,7 @@ var CheckoutImpl = class extends import_BaseModule.BaseModule {
321
321
  summaryDeposit.hasDeposit = true;
322
322
  }
323
323
  });
324
+ summaryDeposit.total = new import_decimal.default(summaryDeposit.total).toDecimalPlaces(2, import_decimal.default.ROUND_HALF_UP).toNumber();
324
325
  return summaryDeposit;
325
326
  }
326
327
  /**
@@ -692,7 +693,7 @@ var CheckoutImpl = class extends import_BaseModule.BaseModule {
692
693
  newOrderId: updatedOrder.id
693
694
  });
694
695
  this.store.isOrderSynced = true;
695
- await this.updateStateAmountToRemaining();
696
+ await this.updateStateAmountToRemaining(false);
696
697
  }
697
698
  return updatedOrder;
698
699
  } catch (error) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "0.0.302",
4
+ "version": "0.0.304",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",