@pisell/pisellos 3.0.35 → 3.0.37

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.
Files changed (53) hide show
  1. package/dist/modules/Cart/index.js +20 -34
  2. package/dist/modules/Cart/utils/cartAccount.d.ts +21 -0
  3. package/dist/modules/Cart/utils/cartAccount.js +52 -0
  4. package/dist/modules/Cart/utils/cartDate.d.ts +31 -0
  5. package/dist/modules/Cart/utils/cartDate.js +55 -0
  6. package/dist/modules/Cart/utils/cartDiscount.d.ts +19 -0
  7. package/dist/modules/Cart/utils/cartDiscount.js +35 -0
  8. package/dist/modules/Cart/utils/cartNote.d.ts +19 -0
  9. package/dist/modules/Cart/utils/cartNote.js +29 -0
  10. package/dist/modules/Cart/utils/cartProduct.d.ts +107 -0
  11. package/dist/modules/Cart/{utils.js → utils/cartProduct.js} +77 -416
  12. package/dist/modules/Cart/utils/cartRelationForms.d.ts +26 -0
  13. package/dist/modules/Cart/utils/cartRelationForms.js +29 -0
  14. package/dist/modules/Cart/utils/cartResource.d.ts +21 -0
  15. package/dist/modules/Cart/utils/cartResource.js +102 -0
  16. package/dist/modules/Cart/utils/index.d.ts +34 -0
  17. package/dist/modules/Cart/utils/index.js +63 -0
  18. package/dist/modules/Discount/index.js +2 -2
  19. package/dist/modules/Order/index.js +10 -4
  20. package/dist/modules/Product/types.d.ts +4 -0
  21. package/dist/modules/Product/utils.d.ts +17 -0
  22. package/dist/modules/Product/utils.js +41 -0
  23. package/dist/solution/BookingByStep/index.d.ts +8 -1
  24. package/dist/solution/BookingByStep/index.js +212 -78
  25. package/dist/solution/ShopDiscount/index.js +5 -4
  26. package/lib/modules/Cart/index.js +16 -24
  27. package/lib/modules/Cart/utils/cartAccount.d.ts +21 -0
  28. package/lib/modules/Cart/utils/cartAccount.js +65 -0
  29. package/lib/modules/Cart/utils/cartDate.d.ts +31 -0
  30. package/lib/modules/Cart/utils/cartDate.js +75 -0
  31. package/lib/modules/Cart/utils/cartDiscount.d.ts +19 -0
  32. package/lib/modules/Cart/utils/cartDiscount.js +52 -0
  33. package/lib/modules/Cart/utils/cartNote.d.ts +19 -0
  34. package/lib/modules/Cart/utils/cartNote.js +46 -0
  35. package/lib/modules/Cart/utils/cartProduct.d.ts +107 -0
  36. package/lib/modules/Cart/{utils.js → utils/cartProduct.js} +78 -328
  37. package/lib/modules/Cart/utils/cartRelationForms.d.ts +26 -0
  38. package/lib/modules/Cart/utils/cartRelationForms.js +48 -0
  39. package/lib/modules/Cart/utils/cartResource.d.ts +21 -0
  40. package/lib/modules/Cart/utils/cartResource.js +124 -0
  41. package/lib/modules/Cart/utils/index.d.ts +34 -0
  42. package/lib/modules/Cart/utils/index.js +91 -0
  43. package/lib/modules/Discount/index.js +3 -7
  44. package/lib/modules/Order/index.js +7 -3
  45. package/lib/modules/Product/types.d.ts +4 -0
  46. package/lib/modules/Product/utils.d.ts +17 -0
  47. package/lib/modules/Product/utils.js +46 -0
  48. package/lib/solution/BookingByStep/index.d.ts +8 -1
  49. package/lib/solution/BookingByStep/index.js +117 -47
  50. package/lib/solution/ShopDiscount/index.js +5 -9
  51. package/package.json +3 -3
  52. package/dist/modules/Cart/utils.d.ts +0 -257
  53. package/lib/modules/Cart/utils.d.ts +0 -257
@@ -70,30 +70,24 @@ var CartModule = class extends import_BaseModule.BaseModule {
70
70
  * 添加商品到购物车
71
71
  */
72
72
  async addItem(params) {
73
- const { account, product, bundle, options, date } = params;
73
+ const { account, product, bundle, options, date, quantity = 1 } = params;
74
74
  let cartItem = {
75
75
  _id: (0, import_utils.getUniqueId)(),
76
76
  _origin: (0, import_utils.createCartItemOrigin)()
77
77
  };
78
78
  if (product) {
79
- if (product.product_variant_id) {
80
- const targetVariant = product.variant.find((n) => n.id === product.product_variant_id);
81
- if (targetVariant) {
82
- product.price = targetVariant.price;
83
- product.original_price = targetVariant.original_price;
84
- product.is_charge_tax = targetVariant.is_charge_tax;
85
- }
86
- }
87
- cartItem._productOrigin = (0, import_lodash_es.cloneDeep)(product);
88
- cartItem._productInit = (0, import_lodash_es.cloneDeep)(product);
79
+ const newProduct = (0, import_utils.handleVariantProduct)(product);
80
+ cartItem._productOrigin = (0, import_lodash_es.cloneDeep)(newProduct);
81
+ cartItem._productInit = (0, import_lodash_es.cloneDeep)(newProduct);
89
82
  cartItem._bundleOrigin = (0, import_lodash_es.cloneDeep)(bundle);
90
83
  cartItem._optionsOrigin = (0, import_lodash_es.cloneDeep)(options);
91
84
  cartItem = (0, import_utils.formatProductToCartItem)({
92
85
  cartItem,
93
- product,
86
+ product: newProduct,
94
87
  bundle,
95
88
  options,
96
- product_variant_id: product.product_variant_id
89
+ product_variant_id: newProduct.product_variant_id,
90
+ quantity
97
91
  });
98
92
  }
99
93
  if (account) {
@@ -141,7 +135,11 @@ var CartModule = class extends import_BaseModule.BaseModule {
141
135
  date,
142
136
  relationForms
143
137
  } = params;
138
+ let quantity = params.quantity;
144
139
  let tempCartItem = this.store.list.find((i) => i._id === _id);
140
+ if (!quantity && (tempCartItem == null ? void 0 : tempCartItem.num)) {
141
+ quantity = (tempCartItem == null ? void 0 : tempCartItem.num) || 1;
142
+ }
145
143
  if (!tempCartItem) {
146
144
  throw new Error("[CartModule] 格式化数据到购物车失败,商品不存在");
147
145
  }
@@ -149,23 +147,17 @@ var CartModule = class extends import_BaseModule.BaseModule {
149
147
  tempCartItem = cartItem;
150
148
  }
151
149
  if (product) {
152
- if (product.product_variant_id) {
153
- const targetVariant = product.variant.find((n) => n.id === product.product_variant_id);
154
- if (targetVariant) {
155
- product.price = targetVariant.price;
156
- product.original_price = targetVariant.original_price;
157
- product.is_charge_tax = targetVariant.is_charge_tax;
158
- }
159
- }
160
- tempCartItem._productOrigin = (0, import_lodash_es.cloneDeep)(product);
150
+ const newProduct = (0, import_utils.handleVariantProduct)(product);
151
+ tempCartItem._productOrigin = (0, import_lodash_es.cloneDeep)(newProduct);
161
152
  tempCartItem._bundleOrigin = (0, import_lodash_es.cloneDeep)(bundle);
162
153
  tempCartItem._optionsOrigin = (0, import_lodash_es.cloneDeep)(options);
163
154
  tempCartItem = (0, import_utils.formatProductToCartItem)({
164
155
  cartItem: tempCartItem,
165
- product,
156
+ product: newProduct,
166
157
  bundle,
167
158
  options,
168
- product_variant_id: product.product_variant_id
159
+ product_variant_id: newProduct.product_variant_id,
160
+ quantity
169
161
  });
170
162
  }
171
163
  if (discounts) {
@@ -0,0 +1,21 @@
1
+ import { Account } from '../../Account/types';
2
+ import { CartItem } from '../types';
3
+ /**
4
+ * 格式化账户到购物车
5
+ * @param account 账户
6
+ * @returns 格式化后的账户
7
+ */
8
+ export declare const formatAccountToCartItem: (params: {
9
+ cartItem: CartItem;
10
+ account: Account;
11
+ }) => CartItem;
12
+ export declare const formatAccountToCartItemOrigin: (params: {
13
+ cartItem: CartItem;
14
+ account: Account;
15
+ }) => any;
16
+ /**
17
+ * 从购物车中删除账户信息
18
+ * @param cartItem 购物车
19
+ * @returns 删除后的购物车
20
+ */
21
+ export declare const deleteHolderFromCartItem: (cartItem: CartItem) => CartItem;
@@ -0,0 +1,65 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/modules/Cart/utils/cartAccount.ts
20
+ var cartAccount_exports = {};
21
+ __export(cartAccount_exports, {
22
+ deleteHolderFromCartItem: () => deleteHolderFromCartItem,
23
+ formatAccountToCartItem: () => formatAccountToCartItem,
24
+ formatAccountToCartItemOrigin: () => formatAccountToCartItemOrigin
25
+ });
26
+ module.exports = __toCommonJS(cartAccount_exports);
27
+ var formatAccountToCartItem = (params) => {
28
+ const { cartItem, account } = params;
29
+ if (account) {
30
+ cartItem.holder_id = account.id;
31
+ cartItem.holder_title = account.username;
32
+ }
33
+ const oringin = formatAccountToCartItemOrigin(params);
34
+ cartItem._origin = oringin;
35
+ return cartItem;
36
+ };
37
+ var formatAccountToCartItemOrigin = (params) => {
38
+ const { cartItem, account } = params;
39
+ let origin = cartItem._origin;
40
+ if (account) {
41
+ if ((account == null ? void 0 : account.type) === "holder") {
42
+ const { customer_id, form_id, form_record_id } = (account == null ? void 0 : account._origin) || {};
43
+ origin.holder = {
44
+ customer_id,
45
+ form_id,
46
+ form_record: form_record_id ? [form_record_id] : null
47
+ };
48
+ } else {
49
+ origin.metadata.account = account;
50
+ }
51
+ }
52
+ return origin;
53
+ };
54
+ var deleteHolderFromCartItem = (cartItem) => {
55
+ cartItem.holder_id = void 0;
56
+ cartItem.holder_title = void 0;
57
+ cartItem._origin.holder = null;
58
+ return cartItem;
59
+ };
60
+ // Annotate the CommonJS export names for ESM import in node:
61
+ 0 && (module.exports = {
62
+ deleteHolderFromCartItem,
63
+ formatAccountToCartItem,
64
+ formatAccountToCartItemOrigin
65
+ });
@@ -0,0 +1,31 @@
1
+ import { CartItem } from '../types';
2
+ /**
3
+ * 格式化日期到购物车
4
+ * @param date 开始时间和结束时间
5
+ * @returns 格式化后的日期
6
+ */
7
+ export declare const formatDateToCartItem: (params: {
8
+ cartItem: CartItem;
9
+ date: {
10
+ startTime: string;
11
+ endTime: string;
12
+ };
13
+ }) => CartItem;
14
+ /**
15
+ * 格式化日期到购物车原始数据
16
+ * @param date 开始时间和结束时间
17
+ * @returns 格式化后的日期原始数据
18
+ */
19
+ export declare const formatDateToCartItemOrigin: (params: {
20
+ cartItem: CartItem;
21
+ date: {
22
+ startTime: string;
23
+ endTime: string;
24
+ };
25
+ }) => any;
26
+ /**
27
+ * 从购物车中删除时间
28
+ * @param cartItem 购物车
29
+ * @returns 删除后的购物车
30
+ */
31
+ export declare const deleteTimeFromCartItem: (cartItem: CartItem) => CartItem;
@@ -0,0 +1,75 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/modules/Cart/utils/cartDate.ts
30
+ var cartDate_exports = {};
31
+ __export(cartDate_exports, {
32
+ deleteTimeFromCartItem: () => deleteTimeFromCartItem,
33
+ formatDateToCartItem: () => formatDateToCartItem,
34
+ formatDateToCartItemOrigin: () => formatDateToCartItemOrigin
35
+ });
36
+ module.exports = __toCommonJS(cartDate_exports);
37
+ var import_dayjs = __toESM(require("dayjs"));
38
+ var formatDateToCartItem = (params) => {
39
+ const { cartItem, date } = params;
40
+ cartItem.start_date = (0, import_dayjs.default)(date.startTime).format("YYYY-MM-DD");
41
+ cartItem.start_time = (0, import_dayjs.default)(date.startTime).format("HH:mm");
42
+ cartItem.end_date = (0, import_dayjs.default)(date.endTime).format("YYYY-MM-DD");
43
+ cartItem.end_time = (0, import_dayjs.default)(date.endTime).format("HH:mm");
44
+ const oringin = formatDateToCartItemOrigin(params);
45
+ cartItem._origin = oringin;
46
+ return cartItem;
47
+ };
48
+ var formatDateToCartItemOrigin = (params) => {
49
+ const { cartItem, date } = params;
50
+ const origin = cartItem._origin;
51
+ origin.select_date = (0, import_dayjs.default)(date.startTime).format("YYYY-MM-DD");
52
+ origin.start_date = (0, import_dayjs.default)(date.startTime).format("YYYY-MM-DD");
53
+ origin.start_time = (0, import_dayjs.default)(date.startTime).format("HH:mm");
54
+ origin.end_date = (0, import_dayjs.default)(date.endTime).format("YYYY-MM-DD");
55
+ origin.end_time = (0, import_dayjs.default)(date.endTime).format("HH:mm");
56
+ return origin;
57
+ };
58
+ var deleteTimeFromCartItem = (cartItem) => {
59
+ cartItem.start_date = void 0;
60
+ cartItem.start_time = void 0;
61
+ cartItem.end_date = void 0;
62
+ cartItem.end_time = void 0;
63
+ cartItem._origin.select_date = null;
64
+ cartItem._origin.start_date = null;
65
+ cartItem._origin.start_time = null;
66
+ cartItem._origin.end_date = null;
67
+ cartItem._origin.end_time = null;
68
+ return cartItem;
69
+ };
70
+ // Annotate the CommonJS export names for ESM import in node:
71
+ 0 && (module.exports = {
72
+ deleteTimeFromCartItem,
73
+ formatDateToCartItem,
74
+ formatDateToCartItemOrigin
75
+ });
@@ -0,0 +1,19 @@
1
+ import { CartItem, IDiscount } from '../types';
2
+ /**
3
+ * 格式化折扣到购物车
4
+ * @param params 参数
5
+ * @returns 格式化后的购物车
6
+ */
7
+ export declare const formatDiscountToCartItem: (params: {
8
+ cartItem: CartItem;
9
+ discounts: IDiscount[];
10
+ }) => CartItem;
11
+ /**
12
+ * 格式化折扣到购物车原始数据
13
+ * @param params 参数
14
+ * @returns 格式化后的购物车原始数据
15
+ */
16
+ export declare const formatDiscountToCartItemOrigin: (params: {
17
+ cartItem: CartItem;
18
+ discounts: IDiscount[];
19
+ }) => any;
@@ -0,0 +1,52 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/modules/Cart/utils/cartDiscount.ts
20
+ var cartDiscount_exports = {};
21
+ __export(cartDiscount_exports, {
22
+ formatDiscountToCartItem: () => formatDiscountToCartItem,
23
+ formatDiscountToCartItemOrigin: () => formatDiscountToCartItemOrigin
24
+ });
25
+ module.exports = __toCommonJS(cartDiscount_exports);
26
+ var formatDiscountToCartItem = (params) => {
27
+ const { cartItem } = params;
28
+ const oringin = formatDiscountToCartItemOrigin(params);
29
+ cartItem._origin = oringin;
30
+ return cartItem;
31
+ };
32
+ var formatDiscountToCartItemOrigin = (params) => {
33
+ const { cartItem, discounts } = params;
34
+ const origin = cartItem._origin;
35
+ if (discounts && (discounts == null ? void 0 : discounts.length)) {
36
+ if (!origin.product) {
37
+ origin.product = {};
38
+ }
39
+ origin.product.discount_list = discounts;
40
+ } else {
41
+ if (!origin.product) {
42
+ origin.product = {};
43
+ }
44
+ origin.product.discount_list = [];
45
+ }
46
+ return origin;
47
+ };
48
+ // Annotate the CommonJS export names for ESM import in node:
49
+ 0 && (module.exports = {
50
+ formatDiscountToCartItem,
51
+ formatDiscountToCartItemOrigin
52
+ });
@@ -0,0 +1,19 @@
1
+ import { CartItem } from '../types';
2
+ /**
3
+ * 格式化备注到购物车
4
+ * @param params 参数
5
+ * @returns 格式化后的购物车
6
+ */
7
+ export declare const formatNoteToCartItem: (params: {
8
+ cartItem: CartItem;
9
+ note: string;
10
+ }) => CartItem;
11
+ /**
12
+ * 格式化备注到购物车原始数据
13
+ * @param params 参数
14
+ * @returns 格式化后的购物车原始数据
15
+ */
16
+ export declare const formatNoteToCartItemOrigin: (params: {
17
+ cartItem: CartItem;
18
+ note: string;
19
+ }) => any;
@@ -0,0 +1,46 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/modules/Cart/utils/cartNote.ts
20
+ var cartNote_exports = {};
21
+ __export(cartNote_exports, {
22
+ formatNoteToCartItem: () => formatNoteToCartItem,
23
+ formatNoteToCartItemOrigin: () => formatNoteToCartItemOrigin
24
+ });
25
+ module.exports = __toCommonJS(cartNote_exports);
26
+ var formatNoteToCartItem = (params) => {
27
+ const { cartItem, note } = params;
28
+ cartItem.note = note;
29
+ const oringin = formatNoteToCartItemOrigin(params);
30
+ cartItem._origin = oringin;
31
+ return cartItem;
32
+ };
33
+ var formatNoteToCartItemOrigin = (params) => {
34
+ const { cartItem, note } = params;
35
+ const origin = cartItem._origin;
36
+ if (!origin.product) {
37
+ origin.product = {};
38
+ }
39
+ origin.product.note = note;
40
+ return origin;
41
+ };
42
+ // Annotate the CommonJS export names for ESM import in node:
43
+ 0 && (module.exports = {
44
+ formatNoteToCartItem,
45
+ formatNoteToCartItemOrigin
46
+ });
@@ -0,0 +1,107 @@
1
+ import Decimal from 'decimal.js';
2
+ import { ProductData } from '../../Product/types';
3
+ import { CartItem } from '../types';
4
+ /**
5
+ * @title 处理组合商品
6
+ * @description 组合商品需要直接修改 product 里的价格和 is_charge_tax
7
+ * @param product 商品
8
+ * @returns 处理后的商品
9
+ */
10
+ export declare const handleVariantProduct: (product: ProductData) => ProductData;
11
+ /**
12
+ * 格式化商品到购物车
13
+ * @param product 商品
14
+ * @returns 格式化后的商品
15
+ */
16
+ export declare const formatProductToCartItem: (params: {
17
+ cartItem: CartItem;
18
+ product: ProductData;
19
+ bundle?: any;
20
+ options?: any;
21
+ product_variant_id?: number;
22
+ quantity?: number;
23
+ }) => CartItem;
24
+ export declare const formatProductToCartItemOrigin: (params: {
25
+ cartItem: CartItem;
26
+ product: ProductData;
27
+ bundle?: any;
28
+ options?: any;
29
+ product_variant_id?: number;
30
+ quantity?: number;
31
+ }) => any;
32
+ /**
33
+ * 获取商品总价
34
+ * @description 当前总价计算基于商品数量为1
35
+ * @param item 商品
36
+ * @returns 商品总价
37
+ */
38
+ export declare const getProductTotalPrice: (params: {
39
+ product: ProductData;
40
+ bundle?: any;
41
+ options?: any;
42
+ num?: number;
43
+ }) => number;
44
+ /**
45
+ * 获取商品原始总价
46
+ * @description 当前总价计算基于商品数量为1
47
+ * @param item 商品
48
+ * @returns 商品原始总价
49
+ */
50
+ export declare const getProductOriginTotalPrice: (params: {
51
+ product: ProductData;
52
+ bundle?: any;
53
+ options?: any;
54
+ num?: number;
55
+ }) => number | undefined;
56
+ /**
57
+ * 格式化套餐规格信息
58
+ * @param options 套餐规格信息
59
+ * @returns 格式化后的套餐规格信息
60
+ */
61
+ export declare const formatOptions: (options: any) => any;
62
+ export declare const formatOptionsToOrigin: (options: any) => any;
63
+ /**
64
+ * 格式化商品套餐信息
65
+ * @param bundle 商品套餐信息
66
+ * @returns 格式化后的商品套餐信息
67
+ */
68
+ export declare const formatBundle: (bundle: any) => any;
69
+ export declare const formatBundleToOrigin: (bundle: any) => any;
70
+ /**
71
+ * 获取商品定金
72
+ * @description 定金基于商品售价来算,最终乘商品数量
73
+ * 1、如果套餐主商品有定金规则,则定金为:(套餐商品总售价 * 定金百分比 + 定金固定金额)* 商品数量
74
+ * 2、如果套餐主商品没有定金规则,子商品有定金规则,则定金为:(套餐子商品售价 * 套餐子商品定金百分比 + 套餐子商品定金固定金额)* 商品数量,最终将所有子商品定金相加
75
+ * 3、普通商品/单规格商品/组合规则商品,定金规则:(商品总售价 * 定金百分比 + 定金固定金额)* 商品数量
76
+ * @param params 参数
77
+ * @returns 商品定金
78
+ */
79
+ export declare const getProductDeposit: (params: {
80
+ cartItem: CartItem;
81
+ product: ProductData;
82
+ bundle?: any;
83
+ options?: any;
84
+ num?: number;
85
+ }) => {
86
+ total: number;
87
+ protocols: {
88
+ id: number;
89
+ title: string;
90
+ }[];
91
+ } | null;
92
+ /**
93
+ * 计算商品定金
94
+ * @param params 参数
95
+ * @returns 商品定金
96
+ */
97
+ export declare const handleProductDeposit: (params: {
98
+ depositData: {
99
+ deposit_fixed?: string;
100
+ deposit_percentage?: string;
101
+ };
102
+ total: string | number;
103
+ num: number;
104
+ }) => {
105
+ result: boolean;
106
+ depositTotal: Decimal;
107
+ };