@pisell/pisellos 2.1.73 → 2.1.74

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[];
@@ -133,7 +133,8 @@ export var OrderModule = /*#__PURE__*/function (_BaseModule) {
133
133
  schedule_date: '',
134
134
  is_deposit: 0,
135
135
  relation_products: [],
136
- relation_forms: []
136
+ relation_forms: [],
137
+ business_code: params === null || params === void 0 ? void 0 : params.business_code
137
138
  }, (params === null || params === void 0 ? void 0 : params.extraData) || {});
138
139
  var is_deposit = 0; // 是否存在定金,0 不存在,1 存在
139
140
  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
  /**
@@ -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,27 @@ 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
+ key: 'product_id',
37
+ value: id
38
+ }, {
39
+ key: 'variant_id',
40
+ value: variantId
41
+ }, {
42
+ key: 'package',
43
+ value: JSON.stringify((capacity === null || capacity === void 0 ? void 0 : capacity.package) || [])
44
+ }]
45
+ });
46
+ }
31
47
  return {
32
48
  id: id,
33
49
  value: item ? d.num || 0 : 0,
@@ -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[];
@@ -105,6 +105,7 @@ var OrderModule = class extends import_BaseModule.BaseModule {
105
105
  is_deposit: 0,
106
106
  relation_products: [],
107
107
  relation_forms: [],
108
+ business_code: params == null ? void 0 : params.business_code,
108
109
  ...(params == null ? void 0 : params.extraData) || {}
109
110
  };
110
111
  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
  /**
@@ -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,27 @@ 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: [
58
+ {
59
+ key: "product_id",
60
+ value: id
61
+ },
62
+ {
63
+ key: "variant_id",
64
+ value: variantId
65
+ },
66
+ {
67
+ key: "package",
68
+ value: JSON.stringify((capacity == null ? void 0 : capacity.package) || [])
69
+ }
70
+ ]
71
+ });
72
+ }
54
73
  return {
55
74
  id,
56
75
  value: item ? d.num || 0 : 0,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "2.1.73",
4
+ "version": "2.1.74",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",