@pisell/pisellos 0.0.120 → 0.0.121

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.
@@ -99,8 +99,13 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
99
99
  }
100
100
  });
101
101
  if (order.type === 'appointment_booking') {
102
- var firstCartItem = params.cartItems[0];
103
- order.schedule_date = firstCartItem.start_date + ' ' + firstCartItem.start_time + ':00';
102
+ var _params$cartItems$fil;
103
+ var firstAppointmentCartItem = (_params$cartItems$fil = params.cartItems.filter(function (n) {
104
+ return !isNormalProduct(n._productOrigin);
105
+ })) === null || _params$cartItems$fil === void 0 ? void 0 : _params$cartItems$fil[0];
106
+ if (firstAppointmentCartItem) {
107
+ order.schedule_date = firstAppointmentCartItem.start_date + ' ' + firstAppointmentCartItem.start_time + ':00';
108
+ }
104
109
  }
105
110
  order.is_deposit = is_deposit;
106
111
  }
@@ -37,6 +37,7 @@ var OrderModule = class extends import_BaseModule.BaseModule {
37
37
  this.request = this.core.getPlugin("request");
38
38
  }
39
39
  createOrder(params) {
40
+ var _a;
40
41
  const order = {
41
42
  type: params.type || "appointment_booking",
42
43
  // 要从外面拿,virtual
@@ -71,8 +72,10 @@ var OrderModule = class extends import_BaseModule.BaseModule {
71
72
  }
72
73
  });
73
74
  if (order.type === "appointment_booking") {
74
- const firstCartItem = params.cartItems[0];
75
- order.schedule_date = firstCartItem.start_date + " " + firstCartItem.start_time + ":00";
75
+ const firstAppointmentCartItem = (_a = params.cartItems.filter((n) => !(0, import_utils2.isNormalProduct)(n._productOrigin))) == null ? void 0 : _a[0];
76
+ if (firstAppointmentCartItem) {
77
+ order.schedule_date = firstAppointmentCartItem.start_date + " " + firstAppointmentCartItem.start_time + ":00";
78
+ }
76
79
  }
77
80
  order.is_deposit = is_deposit;
78
81
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "0.0.120",
4
+ "version": "0.0.121",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",