@pisell/pisellos 0.0.259 → 0.0.260

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.
@@ -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(): "normal" | "duration" | "session";
52
+ getProductType(): "duration" | "session" | "normal";
53
53
  }
@@ -314,7 +314,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
314
314
  }[];
315
315
  setOtherData(key: string, value: any): void;
316
316
  getOtherData(key: string): any;
317
- getProductTypeById(id: number): Promise<"normal" | "duration" | "session">;
317
+ getProductTypeById(id: number): Promise<"duration" | "session" | "normal">;
318
318
  /**
319
319
  * 提供给 UI 的方法,减轻 UI 层的计算压力,UI 层只需要传递 cartItemId 和 resourceCode 即返回对应的 renderList
320
320
  *
@@ -1099,9 +1099,10 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
1099
1099
  return this.updateStateAmountToRemaining();
1100
1100
  case 31:
1101
1101
  _context15.next = 33;
1102
- return this.core.effects.emit(CheckoutHooks.OnPaymentStarted, {
1102
+ return this.core.effects.emit(CheckoutHooks.OnPaymentItemAdded, {
1103
1103
  orderUuid: this.store.currentOrder.uuid,
1104
1104
  paymentMethodCode: paymentItem.code,
1105
+ paymentMethodName: paymentItem.name,
1105
1106
  amount: String(paymentItem.amount),
1106
1107
  timestamp: Date.now()
1107
1108
  });
@@ -1743,7 +1744,7 @@ export var CheckoutImpl = /*#__PURE__*/function (_BaseModule) {
1743
1744
  case 8:
1744
1745
  allPaymentItems = _context21.sent;
1745
1746
  _context21.next = 11;
1746
- return this.syncOrderToBackendWithReturn(false, allPaymentItems);
1747
+ return this.syncOrderToBackendWithReturn(true, allPaymentItems);
1747
1748
  case 11:
1748
1749
  syncResult = _context21.sent;
1749
1750
  this.logInfo('保存订单完成:', {
@@ -300,7 +300,9 @@ export declare enum CheckoutHooks {
300
300
  /** 下单接口请求完成 */
301
301
  OnOrderSubmitEnd = "checkout:onOrderSubmitEnd",
302
302
  /** 钱包数据初始化完成 */
303
- OnWalletDataInitialized = "checkout:onWalletDataInitialized"
303
+ OnWalletDataInitialized = "checkout:onWalletDataInitialized",
304
+ /** 支付项添加成功 */
305
+ OnPaymentItemAdded = "checkout:onPaymentItemAdded"
304
306
  }
305
307
  /**
306
308
  * 结账状态数据
@@ -75,6 +75,7 @@ export var CheckoutHooks = /*#__PURE__*/function (CheckoutHooks) {
75
75
  CheckoutHooks["OnOrderSubmitStart"] = "checkout:onOrderSubmitStart";
76
76
  CheckoutHooks["OnOrderSubmitEnd"] = "checkout:onOrderSubmitEnd";
77
77
  CheckoutHooks["OnWalletDataInitialized"] = "checkout:onWalletDataInitialized";
78
+ CheckoutHooks["OnPaymentItemAdded"] = "checkout:onPaymentItemAdded";
78
79
  return CheckoutHooks;
79
80
  }({});
80
81
 
@@ -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(): "normal" | "duration" | "session";
52
+ getProductType(): "duration" | "session" | "normal";
53
53
  }
@@ -314,7 +314,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
314
314
  }[];
315
315
  setOtherData(key: string, value: any): void;
316
316
  getOtherData(key: string): any;
317
- getProductTypeById(id: number): Promise<"normal" | "duration" | "session">;
317
+ getProductTypeById(id: number): Promise<"duration" | "session" | "normal">;
318
318
  /**
319
319
  * 提供给 UI 的方法,减轻 UI 层的计算压力,UI 层只需要传递 cartItemId 和 resourceCode 即返回对应的 renderList
320
320
  *
@@ -665,9 +665,10 @@ var CheckoutImpl = class extends import_BaseModule.BaseModule {
665
665
  }
666
666
  }
667
667
  await this.updateStateAmountToRemaining();
668
- await this.core.effects.emit(import_types.CheckoutHooks.OnPaymentStarted, {
668
+ await this.core.effects.emit(import_types.CheckoutHooks.OnPaymentItemAdded, {
669
669
  orderUuid: this.store.currentOrder.uuid,
670
670
  paymentMethodCode: paymentItem.code,
671
+ paymentMethodName: paymentItem.name,
671
672
  amount: String(paymentItem.amount),
672
673
  timestamp: Date.now()
673
674
  });
@@ -1103,7 +1104,7 @@ var CheckoutImpl = class extends import_BaseModule.BaseModule {
1103
1104
  this.store.currentOrder.uuid
1104
1105
  );
1105
1106
  const syncResult = await this.syncOrderToBackendWithReturn(
1106
- false,
1107
+ true,
1107
1108
  allPaymentItems
1108
1109
  );
1109
1110
  this.logInfo("保存订单完成:", {
@@ -300,7 +300,9 @@ export declare enum CheckoutHooks {
300
300
  /** 下单接口请求完成 */
301
301
  OnOrderSubmitEnd = "checkout:onOrderSubmitEnd",
302
302
  /** 钱包数据初始化完成 */
303
- OnWalletDataInitialized = "checkout:onWalletDataInitialized"
303
+ OnWalletDataInitialized = "checkout:onWalletDataInitialized",
304
+ /** 支付项添加成功 */
305
+ OnPaymentItemAdded = "checkout:onPaymentItemAdded"
304
306
  }
305
307
  /**
306
308
  * 结账状态数据
@@ -53,6 +53,7 @@ var CheckoutHooks = /* @__PURE__ */ ((CheckoutHooks2) => {
53
53
  CheckoutHooks2["OnOrderSubmitStart"] = "checkout:onOrderSubmitStart";
54
54
  CheckoutHooks2["OnOrderSubmitEnd"] = "checkout:onOrderSubmitEnd";
55
55
  CheckoutHooks2["OnWalletDataInitialized"] = "checkout:onWalletDataInitialized";
56
+ CheckoutHooks2["OnPaymentItemAdded"] = "checkout:onPaymentItemAdded";
56
57
  return CheckoutHooks2;
57
58
  })(CheckoutHooks || {});
58
59
  // Annotate the CommonJS export names for ESM import in node:
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "0.0.259",
4
+ "version": "0.0.260",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",