@pisell/pisellos 2.2.316 → 2.2.317

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.
@@ -71,8 +71,8 @@ export interface OrderGiftSelectResult {
71
71
  /**
72
72
  * 赠品解析回调签名(SDK → OS 的返回值)。
73
73
  *
74
- * - 单选项:SDK 内部自动构造商品,不弹窗
75
- * - 多选项:SDK 弹窗等用户确认后构造
74
+ * - 唯一且无规格/套餐的候选:SDK 自动构造商品
75
+ * - 有规格/套餐或多个候选:SDK 弹窗等用户确认后构造
76
76
  * - 用户取消:抛错或返回空数组(OS 视为放弃本次添加)
77
77
  *
78
78
  * 返回数组时沿用旧协议,只写 tempOrder.products;返回对象时可同时写入预约 bookings。
@@ -30,8 +30,8 @@ export var OrderHooks = /*#__PURE__*/function (OrderHooks) {
30
30
  /**
31
31
  * 赠品解析回调签名(SDK → OS 的返回值)。
32
32
  *
33
- * - 单选项:SDK 内部自动构造商品,不弹窗
34
- * - 多选项:SDK 弹窗等用户确认后构造
33
+ * - 唯一且无规格/套餐的候选:SDK 自动构造商品
34
+ * - 有规格/套餐或多个候选:SDK 弹窗等用户确认后构造
35
35
  * - 用户取消:抛错或返回空数组(OS 视为放弃本次添加)
36
36
  *
37
37
  * 返回数组时沿用旧协议,只写 tempOrder.products;返回对象时可同时写入预约 bookings。
@@ -328,7 +328,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
328
328
  date: string;
329
329
  status: string;
330
330
  week: string;
331
- weekNum: 0 | 5 | 1 | 2 | 4 | 3 | 6;
331
+ weekNum: 0 | 2 | 1 | 6 | 4 | 5 | 3;
332
332
  }[]>;
333
333
  submitTimeSlot(timeSlots: TimeSliceItem): void;
334
334
  private getScheduleDataByIds;
@@ -347,7 +347,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
347
347
  count: number;
348
348
  left: number;
349
349
  summaryCount: number;
350
- status: "sold_out" | "lots_of_space" | "filling_up_fast";
350
+ status: "lots_of_space" | "filling_up_fast" | "sold_out";
351
351
  }[];
352
352
  /**
353
353
  * 找到多个资源的公共可用时间段
@@ -595,7 +595,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
595
595
  generateIdempotencyToken(): string;
596
596
  syncPaymentsToOrder<T = any>(params: SyncPaymentsToOrderParams): Promise<SyncPaymentsToOrderResult<T>>;
597
597
  createOrder(params: CommitOrderParams['query']): {
598
- type: "virtual" | "appointment_booking";
598
+ type: "appointment_booking" | "virtual";
599
599
  platform: string;
600
600
  sales_channel: string;
601
601
  order_sales_channel: string;
@@ -969,14 +969,8 @@ class OrderModule extends _BaseModule.BaseModule {
969
969
  }
970
970
  } else {
971
971
  for (const addAction of result.giftActions.toAdd) {
972
- // 单选普通赠品可累加;预约赠品必须新增独立 booking,不能只改 num。
973
- if (addAction.giftOptions.length === 1) {
974
- const sameStrategy = result.products.find(p => p.metadata?._giftInfo?.strategyId === addAction.strategyId);
975
- if (sameStrategy && !sameStrategy.booking_uid && !sameStrategy.metadata?.booking_uid) {
976
- sameStrategy.num = (Number(sameStrategy.num) || 0) + (addAction.giftCount || 1);
977
- continue;
978
- }
979
- }
972
+ // 唯一候选也可能有规格/套餐。每次补赠都交给 SDK 判断,不能复用旧赠品的选择。
973
+
980
974
  const giftMutationBaseline = options?.isCurrentOrder ? (0, _lodashEs.cloneDeep)({
981
975
  products: tempOrder.products,
982
976
  bookings: tempOrder.bookings
@@ -71,8 +71,8 @@ export interface OrderGiftSelectResult {
71
71
  /**
72
72
  * 赠品解析回调签名(SDK → OS 的返回值)。
73
73
  *
74
- * - 单选项:SDK 内部自动构造商品,不弹窗
75
- * - 多选项:SDK 弹窗等用户确认后构造
74
+ * - 唯一且无规格/套餐的候选:SDK 自动构造商品
75
+ * - 有规格/套餐或多个候选:SDK 弹窗等用户确认后构造
76
76
  * - 用户取消:抛错或返回空数组(OS 视为放弃本次添加)
77
77
  *
78
78
  * 返回数组时沿用旧协议,只写 tempOrder.products;返回对象时可同时写入预约 bookings。
@@ -32,8 +32,8 @@ let OrderHooks = exports.OrderHooks = /*#__PURE__*/function (OrderHooks) {
32
32
  /**
33
33
  * 赠品解析回调签名(SDK → OS 的返回值)。
34
34
  *
35
- * - 单选项:SDK 内部自动构造商品,不弹窗
36
- * - 多选项:SDK 弹窗等用户确认后构造
35
+ * - 唯一且无规格/套餐的候选:SDK 自动构造商品
36
+ * - 有规格/套餐或多个候选:SDK 弹窗等用户确认后构造
37
37
  * - 用户取消:抛错或返回空数组(OS 视为放弃本次添加)
38
38
  *
39
39
  * 返回数组时沿用旧协议,只写 tempOrder.products;返回对象时可同时写入预约 bookings。
@@ -328,7 +328,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
328
328
  date: string;
329
329
  status: string;
330
330
  week: string;
331
- weekNum: 0 | 5 | 1 | 2 | 4 | 3 | 6;
331
+ weekNum: 0 | 2 | 1 | 6 | 4 | 5 | 3;
332
332
  }[]>;
333
333
  submitTimeSlot(timeSlots: TimeSliceItem): void;
334
334
  private getScheduleDataByIds;
@@ -347,7 +347,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
347
347
  count: number;
348
348
  left: number;
349
349
  summaryCount: number;
350
- status: "sold_out" | "lots_of_space" | "filling_up_fast";
350
+ status: "lots_of_space" | "filling_up_fast" | "sold_out";
351
351
  }[];
352
352
  /**
353
353
  * 找到多个资源的公共可用时间段
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "2.2.316",
4
+ "version": "2.2.317",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",