@pisell/pisellos 0.10.91 → 0.10.93

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" | "normal" | "session";
53
53
  }
@@ -342,7 +342,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
342
342
  date: string;
343
343
  status: string;
344
344
  week: string;
345
- weekNum: 0 | 2 | 1 | 6 | 4 | 5 | 3;
345
+ weekNum: 0 | 2 | 1 | 3 | 4 | 5 | 6;
346
346
  }[]>;
347
347
  submitTimeSlot(timeSlots: TimeSliceItem): void;
348
348
  private getScheduleDataByIds;
@@ -389,7 +389,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
389
389
  };
390
390
  setOtherData(key: string, value: any): void;
391
391
  getOtherData(key: string): any;
392
- getProductTypeById(id: number): Promise<"normal" | "duration" | "session">;
392
+ getProductTypeById(id: number): Promise<"duration" | "normal" | "session">;
393
393
  /**
394
394
  * 提供给 UI 的方法,减轻 UI 层的计算压力,UI 层只需要传递 cartItemId 和 resourceCode 即返回对应的 renderList
395
395
  *
@@ -600,6 +600,10 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
600
600
  private getDeviceTaskPlugin;
601
601
  handlePrintWristband(params: {
602
602
  voucher_ids: number[];
603
+ voucher_times?: Record<string, {
604
+ start_time: string;
605
+ end_time: string;
606
+ }>;
603
607
  }): Promise<void>;
604
608
  private redeemStatusWrite?;
605
609
  private arrivalQueue;
@@ -3572,10 +3572,13 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3572
3572
  device_id: deviceId,
3573
3573
  payload: {
3574
3574
  type: 'WRISTBAND',
3575
- data: {
3576
- order_id: (_this$getOrderIdentit2 = this.getOrderIdentity()) === null || _this$getOrderIdentit2 === void 0 ? void 0 : _this$getOrderIdentit2.orderId,
3575
+ data: _objectSpread(_objectSpread({
3576
+ order_id: (_this$getOrderIdentit2 = this.getOrderIdentity()) === null || _this$getOrderIdentit2 === void 0 ? void 0 : _this$getOrderIdentit2.orderId
3577
+ }, params.voucher_times && {
3578
+ voucher_times: params.voucher_times
3579
+ }), {}, {
3577
3580
  voucher_ids: Array.isArray(params.voucher_ids) ? params.voucher_ids : [params.voucher_ids]
3578
- }
3581
+ })
3579
3582
  },
3580
3583
  idempotency_key: idempotencyKey,
3581
3584
  name: 'PRINT_WRISTBAND',
@@ -3723,7 +3726,7 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3723
3726
  updateArrival = /*#__PURE__*/function () {
3724
3727
  var _ref23 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee47() {
3725
3728
  var _this14$store$order, _this14$store$order$g, _next$summary;
3726
- var current, sameOrder, order, arrival, next, query, checkout, latest, patch;
3729
+ var current, sameOrder, order, arrival, next, query, checkout, latest, patch, voucherTimes;
3727
3730
  return _regeneratorRuntime().wrap(function _callee47$(_context47) {
3728
3731
  while (1) switch (_context47.prev = _context47.next) {
3729
3732
  case 0:
@@ -3841,8 +3844,20 @@ export var BookingTicketImpl = /*#__PURE__*/function (_BaseSalesImpl) {
3841
3844
  reason: 'order_changed'
3842
3845
  });
3843
3846
  case 53:
3844
- return _context47.abrupt("return", checkout);
3845
- case 54:
3847
+ // 从本次 checkout 已接受的快照取票面时间,避免打印接口短暂返回旧值。
3848
+ voucherTimes = {};
3849
+ arrival.vouchers.forEach(function (voucher, index) {
3850
+ if (voucher !== order.vouchers[index] && voucher.voucher_id != null && voucher.start_time && voucher.end_time) {
3851
+ voucherTimes[String(voucher.voucher_id)] = {
3852
+ start_time: voucher.start_time,
3853
+ end_time: voucher.end_time
3854
+ };
3855
+ }
3856
+ });
3857
+ return _context47.abrupt("return", Object.keys(voucherTimes).length ? _objectSpread(_objectSpread({}, checkout), {}, {
3858
+ voucher_times: voucherTimes
3859
+ }) : checkout);
3860
+ case 56:
3846
3861
  case "end":
3847
3862
  return _context47.stop();
3848
3863
  }
@@ -24,28 +24,28 @@ export declare function buildArrivalCheckoutQuery(order: OrderTempOrder, summary
24
24
  products: import("../../../modules/Order/types").OrderSubmitProduct[];
25
25
  notes?: import("../../../modules/Order/types").SalesNote[] | undefined;
26
26
  summary?: import("../../../modules/Order/types").OrderSummary | undefined;
27
+ status: string;
27
28
  metadata: Record<string, any>;
29
+ business_code?: string | undefined;
30
+ customer_id: number | null;
28
31
  type: string;
29
- note: string;
30
32
  holder: Record<string, any> | null;
33
+ email: string;
34
+ phone: string;
35
+ note: string;
31
36
  relation_forms: any[];
32
37
  holder_relations?: import("../../../modules/Order/types").OrderHolderRelation[] | undefined;
33
- phone: string;
34
- email: string;
38
+ country_calling_code: string;
35
39
  contacts_info: Record<string, any> | null;
36
40
  order_id: number | null;
37
41
  external_sale_number: string;
38
42
  order_number: string | null;
39
43
  shop_order_number: string | null;
40
44
  shop_full_order_number: string | null;
41
- business_code?: string | undefined;
42
45
  sales_channel: string;
43
46
  order_sales_channel: string;
44
- status: string;
45
47
  shipping_status: string;
46
- customer_id: number | null;
47
48
  customer_name: string;
48
- country_calling_code: string;
49
49
  is_price_include_tax: number;
50
50
  tax_title: string;
51
51
  tax_country_code: string;
@@ -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" | "normal" | "session";
53
53
  }
@@ -342,7 +342,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
342
342
  date: string;
343
343
  status: string;
344
344
  week: string;
345
- weekNum: 0 | 2 | 1 | 6 | 4 | 5 | 3;
345
+ weekNum: 0 | 2 | 1 | 3 | 4 | 5 | 6;
346
346
  }[]>;
347
347
  submitTimeSlot(timeSlots: TimeSliceItem): void;
348
348
  private getScheduleDataByIds;
@@ -389,7 +389,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
389
389
  };
390
390
  setOtherData(key: string, value: any): void;
391
391
  getOtherData(key: string): any;
392
- getProductTypeById(id: number): Promise<"normal" | "duration" | "session">;
392
+ getProductTypeById(id: number): Promise<"duration" | "normal" | "session">;
393
393
  /**
394
394
  * 提供给 UI 的方法,减轻 UI 层的计算压力,UI 层只需要传递 cartItemId 和 resourceCode 即返回对应的 renderList
395
395
  *
@@ -600,6 +600,10 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
600
600
  private getDeviceTaskPlugin;
601
601
  handlePrintWristband(params: {
602
602
  voucher_ids: number[];
603
+ voucher_times?: Record<string, {
604
+ start_time: string;
605
+ end_time: string;
606
+ }>;
603
607
  }): Promise<void>;
604
608
  private redeemStatusWrite?;
605
609
  private arrivalQueue;
@@ -2116,6 +2116,9 @@ class BookingTicketImpl extends _BaseSales.BaseSalesImpl {
2116
2116
  type: 'WRISTBAND',
2117
2117
  data: {
2118
2118
  order_id: this.getOrderIdentity()?.orderId,
2119
+ ...(params.voucher_times && {
2120
+ voucher_times: params.voucher_times
2121
+ }),
2119
2122
  voucher_ids: Array.isArray(params.voucher_ids) ? params.voucher_ids : [params.voucher_ids]
2120
2123
  }
2121
2124
  },
@@ -2270,7 +2273,20 @@ class BookingTicketImpl extends _BaseSales.BaseSalesImpl {
2270
2273
  reason: 'order_changed'
2271
2274
  });
2272
2275
  }
2273
- return checkout;
2276
+ // 从本次 checkout 已接受的快照取票面时间,避免打印接口短暂返回旧值。
2277
+ const voucherTimes = {};
2278
+ arrival.vouchers.forEach((voucher, index) => {
2279
+ if (voucher !== order.vouchers[index] && voucher.voucher_id != null && voucher.start_time && voucher.end_time) {
2280
+ voucherTimes[String(voucher.voucher_id)] = {
2281
+ start_time: voucher.start_time,
2282
+ end_time: voucher.end_time
2283
+ };
2284
+ }
2285
+ });
2286
+ return Object.keys(voucherTimes).length ? {
2287
+ ...checkout,
2288
+ voucher_times: voucherTimes
2289
+ } : checkout;
2274
2290
  };
2275
2291
  const completion = this.arrivalQueue.then(updateArrival).catch(error => {
2276
2292
  log('failed', {
@@ -24,28 +24,28 @@ export declare function buildArrivalCheckoutQuery(order: OrderTempOrder, summary
24
24
  products: import("../../../modules/Order/types").OrderSubmitProduct[];
25
25
  notes?: import("../../../modules/Order/types").SalesNote[] | undefined;
26
26
  summary?: import("../../../modules/Order/types").OrderSummary | undefined;
27
+ status: string;
27
28
  metadata: Record<string, any>;
29
+ business_code?: string | undefined;
30
+ customer_id: number | null;
28
31
  type: string;
29
- note: string;
30
32
  holder: Record<string, any> | null;
33
+ email: string;
34
+ phone: string;
35
+ note: string;
31
36
  relation_forms: any[];
32
37
  holder_relations?: import("../../../modules/Order/types").OrderHolderRelation[] | undefined;
33
- phone: string;
34
- email: string;
38
+ country_calling_code: string;
35
39
  contacts_info: Record<string, any> | null;
36
40
  order_id: number | null;
37
41
  external_sale_number: string;
38
42
  order_number: string | null;
39
43
  shop_order_number: string | null;
40
44
  shop_full_order_number: string | null;
41
- business_code?: string | undefined;
42
45
  sales_channel: string;
43
46
  order_sales_channel: string;
44
- status: string;
45
47
  shipping_status: string;
46
- customer_id: number | null;
47
48
  customer_name: string;
48
- country_calling_code: string;
49
49
  is_price_include_tax: number;
50
50
  tax_title: string;
51
51
  tax_country_code: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "0.10.91",
4
+ "version": "0.10.93",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",