@pisell/pisellos 0.0.423 → 0.0.425

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.
@@ -33,6 +33,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
33
33
  is_deposit: number;
34
34
  relation_products: any[];
35
35
  relation_forms: any[];
36
+ business_code: string | undefined;
36
37
  };
37
38
  checkBeforeSubmitOrder(params: {
38
39
  cartItems: CartItem[];
@@ -130,7 +130,8 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
130
130
  schedule_date: '',
131
131
  is_deposit: 0,
132
132
  relation_products: [],
133
- relation_forms: []
133
+ relation_forms: [],
134
+ business_code: params === null || params === void 0 ? void 0 : params.business_code
134
135
  }, (params === null || params === void 0 ? void 0 : params.extraData) || {});
135
136
  var is_deposit = 0; // 是否存在定金,0 不存在,1 存在
136
137
  if (params.cartItems.length > 0) {
@@ -17,6 +17,7 @@ export interface CommitOrderParams {
17
17
  type: 'virtual' | 'appointment_booking';
18
18
  platform?: 'pc' | 'h5';
19
19
  extraData?: Record<string, any>;
20
+ business_code?: string;
20
21
  };
21
22
  }
22
23
  /**
@@ -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
  }
@@ -358,7 +358,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
358
358
  };
359
359
  setOtherData(key: string, value: any): void;
360
360
  getOtherData(key: string): any;
361
- getProductTypeById(id: number): Promise<"duration" | "session" | "normal">;
361
+ getProductTypeById(id: number): Promise<"normal" | "duration" | "session">;
362
362
  /**
363
363
  * 提供给 UI 的方法,减轻 UI 层的计算压力,UI 层只需要传递 cartItemId 和 resourceCode 即返回对应的 renderList
364
364
  *
@@ -978,6 +978,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
978
978
  key: "submitOrder",
979
979
  value: function () {
980
980
  var _submitOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(extraData) {
981
+ var _this$otherParams4;
981
982
  var cartItems, newCartItems, type;
982
983
  return _regeneratorRuntime().wrap(function _callee19$(_context19) {
983
984
  while (1) switch (_context19.prev = _context19.next) {
@@ -1015,6 +1016,7 @@ export var BookingByStepImpl = /*#__PURE__*/function (_BaseModule) {
1015
1016
  cartItems: newCartItems,
1016
1017
  type: type,
1017
1018
  platform: this.platform,
1019
+ business_code: (_this$otherParams4 = this.otherParams) === null || _this$otherParams4 === void 0 ? void 0 : _this$otherParams4.business_code,
1018
1020
  extraData: extraData
1019
1021
  }
1020
1022
  }));
@@ -23,11 +23,22 @@ export var formatDefaultCapacitys = function formatDefaultCapacitys(_ref) {
23
23
  product_bundle = _ref.product_bundle;
24
24
  if ((capacity === null || capacity === void 0 ? void 0 : capacity.type) === 'package') {
25
25
  return (product_bundle || []).map(function (d) {
26
+ var _window;
26
27
  var id = d.bundle_product_id;
27
28
  var variantId = d.bundle_variant_id;
28
29
  var item = ((capacity === null || capacity === void 0 ? void 0 : capacity.package) || []).find(function (item) {
29
- return item.product_id === id || item.product_id === variantId;
30
+ return item.product_id == id || item.product_id == variantId;
30
31
  });
32
+ if (!item && (_window = window) !== null && _window !== void 0 && _window.sendWarningLog) {
33
+ window.sendWarningLog({
34
+ title: '未找到套餐 capacity 配置',
35
+ content: [{
36
+ product_id: id,
37
+ variant_id: variantId,
38
+ package: JSON.stringify((capacity === null || capacity === void 0 ? void 0 : capacity.package) || [])
39
+ }]
40
+ });
41
+ }
31
42
  return {
32
43
  id: id,
33
44
  value: item ? d.num || 0 : 0,
@@ -123,7 +123,7 @@ export declare class BookingTicketImpl extends BaseModule implements Module {
123
123
  * 获取当前的客户搜索条件
124
124
  * @returns 当前搜索条件
125
125
  */
126
- getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
126
+ getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "num" | "skip">;
127
127
  /**
128
128
  * 获取客户列表状态(包含滚动加载相关状态)
129
129
  * @returns 客户状态
@@ -33,6 +33,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
33
33
  is_deposit: number;
34
34
  relation_products: any[];
35
35
  relation_forms: any[];
36
+ business_code: string | undefined;
36
37
  };
37
38
  checkBeforeSubmitOrder(params: {
38
39
  cartItems: CartItem[];
@@ -106,6 +106,7 @@ var OrderModule = class extends import_BaseModule.BaseModule {
106
106
  is_deposit: 0,
107
107
  relation_products: [],
108
108
  relation_forms: [],
109
+ business_code: params == null ? void 0 : params.business_code,
109
110
  ...(params == null ? void 0 : params.extraData) || {}
110
111
  };
111
112
  let is_deposit = 0;
@@ -17,6 +17,7 @@ export interface CommitOrderParams {
17
17
  type: 'virtual' | 'appointment_booking';
18
18
  platform?: 'pc' | 'h5';
19
19
  extraData?: Record<string, any>;
20
+ business_code?: string;
20
21
  };
21
22
  }
22
23
  /**
@@ -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
  }
@@ -358,7 +358,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
358
358
  };
359
359
  setOtherData(key: string, value: any): void;
360
360
  getOtherData(key: string): any;
361
- getProductTypeById(id: number): Promise<"duration" | "session" | "normal">;
361
+ getProductTypeById(id: number): Promise<"normal" | "duration" | "session">;
362
362
  /**
363
363
  * 提供给 UI 的方法,减轻 UI 层的计算压力,UI 层只需要传递 cartItemId 和 resourceCode 即返回对应的 renderList
364
364
  *
@@ -512,10 +512,11 @@ var BookingByStepImpl = class extends import_BaseModule.BaseModule {
512
512
  }
513
513
  // 购物车提交订单
514
514
  async submitOrder(extraData) {
515
+ var _a;
515
516
  const cartItems = this.store.cart.getItems();
516
517
  const newCartItems = (0, import_lodash_es.cloneDeep)(cartItems);
517
518
  newCartItems.forEach((item) => {
518
- var _a;
519
+ var _a2;
519
520
  if (item._origin.resources && item._origin.resources.length) {
520
521
  item._origin.resources = item._origin.resources.map((n) => {
521
522
  const newResourcesItem = (0, import_lodash_es.cloneDeep)(n);
@@ -525,7 +526,7 @@ var BookingByStepImpl = class extends import_BaseModule.BaseModule {
525
526
  return { ...newResourcesItem };
526
527
  });
527
528
  const { currentCapacity, formatCapacity } = (0, import_capacity.getCapacityInfoByCartItem)(item);
528
- if (!((_a = item._origin) == null ? void 0 : _a.metadata)) {
529
+ if (!((_a2 = item._origin) == null ? void 0 : _a2.metadata)) {
529
530
  item._origin.metadata = {};
530
531
  }
531
532
  item._origin.metadata.capacity = formatCapacity;
@@ -543,6 +544,7 @@ var BookingByStepImpl = class extends import_BaseModule.BaseModule {
543
544
  cartItems: newCartItems,
544
545
  type,
545
546
  platform: this.platform,
547
+ business_code: (_a = this.otherParams) == null ? void 0 : _a.business_code,
546
548
  extraData
547
549
  }
548
550
  });
@@ -49,8 +49,14 @@ var formatDefaultCapacitys = ({
49
49
  const id = d.bundle_product_id;
50
50
  const variantId = d.bundle_variant_id;
51
51
  const item = ((capacity == null ? void 0 : capacity.package) || []).find(
52
- (item2) => item2.product_id === id || item2.product_id === variantId
52
+ (item2) => item2.product_id == id || item2.product_id == variantId
53
53
  );
54
+ if (!item && (window == null ? void 0 : window.sendWarningLog)) {
55
+ window.sendWarningLog({
56
+ title: "未找到套餐 capacity 配置",
57
+ content: [{ product_id: id, variant_id: variantId, package: JSON.stringify((capacity == null ? void 0 : capacity.package) || []) }]
58
+ });
59
+ }
54
60
  return {
55
61
  id,
56
62
  value: item ? d.num || 0 : 0,
@@ -123,7 +123,7 @@ export declare class BookingTicketImpl extends BaseModule implements Module {
123
123
  * 获取当前的客户搜索条件
124
124
  * @returns 当前搜索条件
125
125
  */
126
- getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
126
+ getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "num" | "skip">;
127
127
  /**
128
128
  * 获取客户列表状态(包含滚动加载相关状态)
129
129
  * @returns 客户状态
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "0.0.423",
4
+ "version": "0.0.425",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",