@pisell/pisellos 2.3.125 → 2.3.127
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.
- package/dist/model/strategy/adapter/promotion/index.js +0 -9
- package/dist/model/strategy/adapter/walletPass/evaluator.d.ts +2 -0
- package/dist/model/strategy/adapter/walletPass/evaluator.js +4 -2
- package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +58 -19
- package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +24 -12
- package/dist/modules/Customer/index.js +6 -3
- package/dist/modules/Customer/types.d.ts +2 -0
- package/dist/modules/Discount/availability.d.ts +7 -0
- package/dist/modules/Discount/availability.js +49 -0
- package/dist/modules/Discount/entitlementPass.d.ts +34 -0
- package/dist/modules/Discount/entitlementPass.js +147 -0
- package/dist/modules/Discount/index.d.ts +2 -2
- package/dist/modules/Discount/index.js +37 -151
- package/dist/modules/Discount/types.d.ts +36 -5
- package/dist/modules/Order/index.d.ts +6 -0
- package/dist/modules/Order/index.js +440 -232
- package/dist/modules/Order/utils/orderCollectionIdentity.js +16 -12
- package/dist/modules/Order/utils.d.ts +1 -1
- package/dist/modules/Order/utils.js +101 -60
- package/dist/modules/Payment/types.d.ts +21 -1
- package/dist/modules/Payment/types.js +2 -0
- package/dist/modules/Payment/walletpass.d.ts +1 -1
- package/dist/modules/Payment/walletpass.js +80 -47
- package/dist/modules/Rules/index.d.ts +2 -2
- package/dist/modules/Rules/index.js +480 -186
- package/dist/modules/Rules/types.d.ts +4 -0
- package/dist/server/modules/order/types.d.ts +2 -0
- package/dist/solution/BaseSales/index.d.ts +1 -0
- package/dist/solution/BaseSales/index.js +5 -2
- package/dist/solution/BaseSales/types.d.ts +2 -2
- package/dist/solution/BaseSales/utils/cartPromotion.js +141 -126
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.d.ts +2 -3
- package/dist/solution/BookingTicket/index.js +60 -63
- package/dist/solution/BookingTicket/types.d.ts +5 -1
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +2 -0
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +338 -147
- package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +8 -4
- package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +6 -0
- package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.js +19 -6
- package/dist/solution/ShopDiscount/index.d.ts +2 -0
- package/dist/solution/ShopDiscount/index.js +99 -42
- package/dist/solution/ShopDiscount/utils.d.ts +4 -2
- package/dist/solution/ShopDiscount/utils.js +43 -23
- package/dist/solution/UnifiedBookingSales/index.js +2 -2
- package/lib/model/strategy/adapter/promotion/index.js +46 -1
- package/lib/model/strategy/adapter/walletPass/evaluator.d.ts +2 -0
- package/lib/model/strategy/adapter/walletPass/evaluator.js +2 -0
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +35 -6
- package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +13 -6
- package/lib/modules/Customer/index.js +5 -1
- package/lib/modules/Customer/types.d.ts +2 -0
- package/lib/modules/Discount/availability.d.ts +7 -0
- package/lib/modules/Discount/availability.js +43 -0
- package/lib/modules/Discount/entitlementPass.d.ts +34 -0
- package/lib/modules/Discount/entitlementPass.js +141 -0
- package/lib/modules/Discount/index.d.ts +2 -2
- package/lib/modules/Discount/index.js +23 -129
- package/lib/modules/Discount/types.d.ts +36 -5
- package/lib/modules/Order/index.d.ts +6 -0
- package/lib/modules/Order/index.js +213 -40
- package/lib/modules/Order/utils/orderCollectionIdentity.js +14 -11
- package/lib/modules/Order/utils.d.ts +1 -1
- package/lib/modules/Order/utils.js +39 -3
- package/lib/modules/Payment/types.d.ts +21 -1
- package/lib/modules/Payment/types.js +1 -0
- package/lib/modules/Payment/walletpass.d.ts +1 -1
- package/lib/modules/Payment/walletpass.js +29 -9
- package/lib/modules/Rules/index.d.ts +2 -2
- package/lib/modules/Rules/index.js +357 -110
- package/lib/modules/Rules/types.d.ts +4 -0
- package/lib/server/modules/order/types.d.ts +2 -0
- package/lib/solution/BaseSales/index.d.ts +1 -0
- package/lib/solution/BaseSales/index.js +5 -2
- package/lib/solution/BaseSales/types.d.ts +2 -2
- package/lib/solution/BaseSales/utils/cartPromotion.js +12 -4
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.d.ts +2 -3
- package/lib/solution/BookingTicket/index.js +36 -33
- package/lib/solution/BookingTicket/types.d.ts +5 -1
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +2 -0
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +174 -42
- package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +8 -4
- package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +6 -0
- package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.js +11 -3
- package/lib/solution/ShopDiscount/index.d.ts +2 -0
- package/lib/solution/ShopDiscount/index.js +55 -9
- package/lib/solution/ShopDiscount/utils.d.ts +4 -2
- package/lib/solution/ShopDiscount/utils.js +42 -25
- package/lib/solution/UnifiedBookingSales/index.js +2 -2
- package/package.json +1 -1
|
@@ -44,7 +44,10 @@ interface ApplicableProductDetails {
|
|
|
44
44
|
original_amount: string;
|
|
45
45
|
num: number;
|
|
46
46
|
metadata?: {
|
|
47
|
+
encoded?: string;
|
|
47
48
|
product_discount_difference?: number;
|
|
49
|
+
/** 月卡扣除本单新增使用后的剩余次数;不限次数时为 null。 */
|
|
50
|
+
balance?: number | null;
|
|
48
51
|
};
|
|
49
52
|
discount?: {
|
|
50
53
|
fixed_amount?: number;
|
|
@@ -63,6 +66,13 @@ interface UsageCreditsValue {
|
|
|
63
66
|
max_per_week: number;
|
|
64
67
|
max_per_month: number;
|
|
65
68
|
}
|
|
69
|
+
export type IncludedUses = {
|
|
70
|
+
type: 'limited';
|
|
71
|
+
value: number;
|
|
72
|
+
} | {
|
|
73
|
+
type: 'unlimited';
|
|
74
|
+
value: null;
|
|
75
|
+
};
|
|
66
76
|
export type DiscountFilterRejectKey = 'total_credits' | 'per_user_limit' | 'max_per_day' | 'max_per_week' | 'max_per_month';
|
|
67
77
|
export interface DiscountWithReason {
|
|
68
78
|
discountList: Discount[];
|
|
@@ -107,30 +117,37 @@ interface ExtensionData {
|
|
|
107
117
|
}
|
|
108
118
|
export interface Discount {
|
|
109
119
|
id: number;
|
|
120
|
+
shop_id?: number;
|
|
110
121
|
product_name: string;
|
|
111
122
|
encoded: string;
|
|
112
123
|
code: string;
|
|
113
124
|
tag: string;
|
|
114
|
-
expire_time?: string;
|
|
125
|
+
expire_time?: string | null;
|
|
126
|
+
expire_date?: string | null;
|
|
127
|
+
end_time?: string | null;
|
|
115
128
|
product_id: number;
|
|
116
129
|
relation_type: string;
|
|
117
130
|
par_value: string;
|
|
118
131
|
used_par_value: string;
|
|
119
132
|
limit_status: string;
|
|
120
133
|
limited_relation_product_data: Limitedrelationproductdata;
|
|
121
|
-
balance
|
|
134
|
+
balance?: string | number | null;
|
|
135
|
+
available_num?: number;
|
|
136
|
+
available_products_info?: any[];
|
|
122
137
|
format_title: Formattitle;
|
|
123
138
|
metadata?: {
|
|
139
|
+
encoded?: string;
|
|
124
140
|
discount_card_type?: 'fixed_amount' | 'percent';
|
|
125
141
|
custom_product_bundle_map_id?: string;
|
|
126
142
|
validity_type?: "custom_schedule_validity" | "fixed_validity";
|
|
127
|
-
|
|
128
|
-
|
|
143
|
+
included_uses?: IncludedUses;
|
|
144
|
+
discount_calculation_mode?: 'item_level' | 'order_level';
|
|
145
|
+
holder?: {
|
|
129
146
|
type: "customer" | "custom";
|
|
130
147
|
};
|
|
131
148
|
};
|
|
132
149
|
product: Product;
|
|
133
|
-
type
|
|
150
|
+
type?: "product" | 'good_pass' | 'entitlement_pass' | 'discount_card' | 'product_discount_card';
|
|
134
151
|
resource_id?: number;
|
|
135
152
|
savedAmount?: number;
|
|
136
153
|
isEditMode?: boolean;
|
|
@@ -163,9 +180,17 @@ export interface Discount {
|
|
|
163
180
|
applicableProductIds?: number[];
|
|
164
181
|
applicableProductDetails: ApplicableProductDetails[];
|
|
165
182
|
appliedProductDetails: ApplicableProductDetails[];
|
|
183
|
+
/** Entitlement Pass 编辑订单时已经提交的使用明细。 */
|
|
184
|
+
committedAppliedProductDetails?: ApplicableProductDetails[];
|
|
166
185
|
isDisabledForProductUsed?: boolean;
|
|
167
186
|
amount?: number;
|
|
168
187
|
customer_id?: number | string | null;
|
|
188
|
+
holder?: {
|
|
189
|
+
holder_type?: 'customer' | 'form' | string;
|
|
190
|
+
holder_id?: number | string | Array<number | string>;
|
|
191
|
+
created_at?: string | null;
|
|
192
|
+
[key: string]: any;
|
|
193
|
+
};
|
|
169
194
|
extension_data?: ExtensionData[];
|
|
170
195
|
total_order_behavior_count?: number;
|
|
171
196
|
today_order_behavior_count?: number;
|
|
@@ -180,6 +205,12 @@ export interface Discount {
|
|
|
180
205
|
start_time?: string;
|
|
181
206
|
discount_rule_uncheck_flag?: boolean;
|
|
182
207
|
usageLimitFailKey?: string | null;
|
|
208
|
+
/** 本次规则计算的不可用原因;可用性恢复后清除。 */
|
|
209
|
+
reason?: string;
|
|
210
|
+
reasonCode?: string;
|
|
211
|
+
unified_messages?: {
|
|
212
|
+
title?: string | Record<string, string>;
|
|
213
|
+
};
|
|
183
214
|
unified_available_status?: number | undefined | null;
|
|
184
215
|
}
|
|
185
216
|
export interface DiscountState {
|
|
@@ -110,6 +110,7 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
110
110
|
}>;
|
|
111
111
|
applyDiscount(options?: {
|
|
112
112
|
reapplyBookingDiscountProductUids?: string[];
|
|
113
|
+
preferredEntitlementPassIds?: number[];
|
|
113
114
|
}): void;
|
|
114
115
|
/**
|
|
115
116
|
* 注入促销评估器。
|
|
@@ -488,7 +489,12 @@ export declare class OrderModule extends BaseModule implements Module, OrderModu
|
|
|
488
489
|
}>, options?: {
|
|
489
490
|
skipEditDiscountConfigRefresh?: boolean;
|
|
490
491
|
}): Promise<OrderProduct[]>;
|
|
492
|
+
private getFullCoveragePassDiscounts;
|
|
493
|
+
private hasEntitlementPassDiscount;
|
|
491
494
|
private hasGoodPassDiscount;
|
|
495
|
+
private isPersistedProductLine;
|
|
496
|
+
private isRuntimeEntitlementAppend;
|
|
497
|
+
private hasSameEntitlementMergePriceConfig;
|
|
492
498
|
private getBundleRuntimeIdentity;
|
|
493
499
|
private preservePersistedBundlePriceFields;
|
|
494
500
|
private applyOrderProductUpdateToTempOrder;
|
|
@@ -9,6 +9,7 @@ var _types = require("./types");
|
|
|
9
9
|
var _utils = require("./utils");
|
|
10
10
|
var _utils2 = require("../Product/utils");
|
|
11
11
|
var _dayjs = _interopRequireDefault(require("dayjs"));
|
|
12
|
+
var _availability = require("../Discount/availability");
|
|
12
13
|
var _osPrivatePayload = require("../../utils/os-private-payload");
|
|
13
14
|
var _salesNotes = require("./salesNotes");
|
|
14
15
|
var _paymentUtils = require("./payment-utils");
|
|
@@ -22,6 +23,7 @@ var _discountProductLineIdentity = require("./utils/discountProductLineIdentity"
|
|
|
22
23
|
var _virtualSettlement = require("./utils/virtualSettlement");
|
|
23
24
|
var _Discount = require("../Discount");
|
|
24
25
|
var _Rules = require("../Rules");
|
|
26
|
+
var _entitlementPass = require("../Discount/entitlementPass");
|
|
25
27
|
var _types2 = require("../Rules/types");
|
|
26
28
|
var _decimal = _interopRequireDefault(require("decimal.js"));
|
|
27
29
|
var _lodashEs = require("lodash-es");
|
|
@@ -41,9 +43,27 @@ function isSameDiscountList(left, right) {
|
|
|
41
43
|
function isManualProductDiscountProduct(product) {
|
|
42
44
|
return (0, _manualProductDiscount.hasManualProductDiscountFlag)(product?.metadata) || (product?.discount_list || []).some(item => item?.type === 'product');
|
|
43
45
|
}
|
|
46
|
+
function syncReducedEntitlementPassUsageCount(discountList, previousQuantity, nextQuantity) {
|
|
47
|
+
if (!Array.isArray(discountList)) return discountList;
|
|
48
|
+
const previousCount = (0, _utils3.getSafeProductNum)(previousQuantity);
|
|
49
|
+
const nextCount = (0, _utils3.getSafeProductNum)(nextQuantity);
|
|
50
|
+
if (nextCount >= previousCount) return discountList;
|
|
51
|
+
return discountList.map(discount => {
|
|
52
|
+
if (!(0, _entitlementPass.isEntitlementPass)(discount)) return discount;
|
|
53
|
+
const rawUsageCount = Number(discount?.metadata?.num ?? previousCount);
|
|
54
|
+
const usageCount = Number.isFinite(rawUsageCount) ? Math.max(Math.floor(rawUsageCount), 0) : previousCount;
|
|
55
|
+
return {
|
|
56
|
+
...discount,
|
|
57
|
+
metadata: {
|
|
58
|
+
...(discount?.metadata || {}),
|
|
59
|
+
num: Math.min(usageCount, nextCount)
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
});
|
|
63
|
+
}
|
|
44
64
|
const ORDER_PAYMENT_STATUS_PAID = 'paid';
|
|
45
65
|
const ORDER_PAYMENT_STATUS_PENDING = 'payment_pending';
|
|
46
|
-
const CUSTOMER_PROMOTION_DISCOUNT_TAGS = new Set(['good_pass', 'product_discount_card', 'discount_card']);
|
|
66
|
+
const CUSTOMER_PROMOTION_DISCOUNT_TAGS = new Set(['entitlement_pass', 'good_pass', 'product_discount_card', 'discount_card']);
|
|
47
67
|
function isCustomerPromotionDiscount(discount) {
|
|
48
68
|
return CUSTOMER_PROMOTION_DISCOUNT_TAGS.has(String(discount?.tag || discount?.type || '').toLowerCase());
|
|
49
69
|
}
|
|
@@ -73,6 +93,28 @@ function getVoucherPaymentLifecycleKey(payment) {
|
|
|
73
93
|
if (!isVoucherPaymentRecord(payment)) return null;
|
|
74
94
|
return `${String(payment.voucher_id)}::${String(payment.status || '')}`;
|
|
75
95
|
}
|
|
96
|
+
function getDiscountIdentityKey(discount) {
|
|
97
|
+
const id = discount?.id;
|
|
98
|
+
if (id === undefined || id === null || id === '') return null;
|
|
99
|
+
return String(id);
|
|
100
|
+
}
|
|
101
|
+
function mergeCommittedEntitlementWithRuntime(committed, runtime) {
|
|
102
|
+
const committedAppliedProductDetails = committed.committedAppliedProductDetails?.length ? committed.committedAppliedProductDetails : committed.appliedProductDetails || [];
|
|
103
|
+
return {
|
|
104
|
+
...committed,
|
|
105
|
+
...runtime,
|
|
106
|
+
id: runtime.id ?? committed.id,
|
|
107
|
+
tag: runtime.tag || committed.tag,
|
|
108
|
+
type: runtime.type || committed.type,
|
|
109
|
+
isEditMode: false,
|
|
110
|
+
isDisabled: runtime.isDisabled ?? false,
|
|
111
|
+
isSelected: runtime.isSelected ?? committed.isSelected,
|
|
112
|
+
isUsed: committed.isUsed || runtime.isUsed,
|
|
113
|
+
committedAppliedProductDetails: [...committedAppliedProductDetails],
|
|
114
|
+
applicableProductDetails: [...(committed.applicableProductDetails || []), ...(runtime.applicableProductDetails || [])],
|
|
115
|
+
appliedProductDetails: [...committedAppliedProductDetails, ...(runtime.appliedProductDetails || [])]
|
|
116
|
+
};
|
|
117
|
+
}
|
|
76
118
|
class OrderModule extends _BaseModule.BaseModule {
|
|
77
119
|
defaultName = 'order';
|
|
78
120
|
defaultVersion = '1.0.0';
|
|
@@ -128,6 +170,7 @@ class OrderModule extends _BaseModule.BaseModule {
|
|
|
128
170
|
const key = Number.isFinite(id) ? id : String(resourceId);
|
|
129
171
|
const title = item?.discount?.title ?? {};
|
|
130
172
|
const amount = Number(item?.amount || 0);
|
|
173
|
+
const encoded = item?.metadata?.encoded || item?.encoded || item?.discount?.encoded || '';
|
|
131
174
|
const discountCardType = item?.discount?.discount_card_type;
|
|
132
175
|
const parValue = isDiscountCard ? discountCardType === 'fixed_amount' ? item?.discount?.fixed_amount ?? item?.amount : item?.discount?.percent : '0';
|
|
133
176
|
const detail = {
|
|
@@ -138,11 +181,21 @@ class OrderModule extends _BaseModule.BaseModule {
|
|
|
138
181
|
original_amount: String(item?.discount?.original_amount ?? item?.amount ?? '0'),
|
|
139
182
|
num: Number(item?.metadata?.num ?? product?.num ?? product?.product_quantity ?? 1) || 1,
|
|
140
183
|
metadata: item?.metadata,
|
|
141
|
-
discount:
|
|
184
|
+
discount: {
|
|
185
|
+
...(item?.discount || {}),
|
|
186
|
+
product_id: item?.discount?.product_id ?? product?.product_id
|
|
187
|
+
},
|
|
142
188
|
_num: Number(item?.metadata?.num ?? product?.num ?? product?.product_quantity ?? 1) || 1
|
|
143
189
|
};
|
|
144
190
|
const existed = discountMap.get(key);
|
|
145
191
|
if (existed) {
|
|
192
|
+
if (!existed.encoded && encoded) {
|
|
193
|
+
existed.encoded = encoded;
|
|
194
|
+
existed.metadata = {
|
|
195
|
+
...existed.metadata,
|
|
196
|
+
encoded
|
|
197
|
+
};
|
|
198
|
+
}
|
|
146
199
|
existed.amount = Number(existed.amount || 0) + amount;
|
|
147
200
|
existed.used_par_value = String(Number(existed.used_par_value || 0) + amount);
|
|
148
201
|
if (!isDiscountCard) {
|
|
@@ -162,8 +215,11 @@ class OrderModule extends _BaseModule.BaseModule {
|
|
|
162
215
|
discountMap.set(key, {
|
|
163
216
|
id: key,
|
|
164
217
|
product_name: '',
|
|
165
|
-
encoded
|
|
166
|
-
code: '',
|
|
218
|
+
encoded,
|
|
219
|
+
code: item?.code || item?.discount?.code || '',
|
|
220
|
+
metadata: {
|
|
221
|
+
encoded
|
|
222
|
+
},
|
|
167
223
|
tag: type,
|
|
168
224
|
product_id: item?.discount?.discount_product_id ?? product?.product_id ?? 0,
|
|
169
225
|
relation_type: '',
|
|
@@ -454,7 +510,7 @@ class OrderModule extends _BaseModule.BaseModule {
|
|
|
454
510
|
this.store.rules = rules;
|
|
455
511
|
}
|
|
456
512
|
createDefaultRulesHooks() {
|
|
457
|
-
return (0, _utils.createDefaultOrderRulesHooks)();
|
|
513
|
+
return (0, _utils.createDefaultOrderRulesHooks)(() => this.store.tempOrder?.bookings || []);
|
|
458
514
|
}
|
|
459
515
|
|
|
460
516
|
/**
|
|
@@ -480,6 +536,8 @@ class OrderModule extends _BaseModule.BaseModule {
|
|
|
480
536
|
with_wallet_pass_holder: 1,
|
|
481
537
|
with_available_wallet_flag: 1,
|
|
482
538
|
with_available_wallet_pass_flag: 1,
|
|
539
|
+
with_entitlement_pass: 1,
|
|
540
|
+
filter_order_wallet_pass_usage: 0,
|
|
483
541
|
with_virtual_currency: 1,
|
|
484
542
|
request_timezone: Intl.DateTimeFormat().resolvedOptions().timeZone,
|
|
485
543
|
...(orderId ? {
|
|
@@ -501,17 +559,61 @@ class OrderModule extends _BaseModule.BaseModule {
|
|
|
501
559
|
}
|
|
502
560
|
if (discountList) {
|
|
503
561
|
const currentDiscountList = this.store.discount?.getDiscountList() || [];
|
|
504
|
-
const
|
|
562
|
+
const currentCommittedDiscounts = currentDiscountList.filter(discount => discount?.isEditMode || discount?.committedAppliedProductDetails?.length);
|
|
505
563
|
const currentScanDiscounts = currentDiscountList.filter(discount => discount?.isScan);
|
|
506
|
-
const
|
|
564
|
+
const currentScanDiscountById = new Map(currentScanDiscounts.flatMap(discount => {
|
|
565
|
+
const id = getDiscountIdentityKey(discount);
|
|
566
|
+
return id === null ? [] : [[id, discount]];
|
|
567
|
+
}));
|
|
568
|
+
const committedDiscountById = new Map(currentCommittedDiscounts.flatMap(discount => {
|
|
569
|
+
const id = getDiscountIdentityKey(discount);
|
|
570
|
+
return id === null ? [] : [[id, discount]];
|
|
571
|
+
}));
|
|
572
|
+
const mergedCommittedDiscountIds = new Set();
|
|
573
|
+
const refreshedScanDiscountIds = new Set();
|
|
507
574
|
const runtimeDiscountIds = new Set();
|
|
508
|
-
const runtimeDiscounts = discountList.
|
|
509
|
-
|
|
510
|
-
if (
|
|
511
|
-
runtimeDiscountIds.
|
|
512
|
-
|
|
575
|
+
const runtimeDiscounts = discountList.flatMap(discount => {
|
|
576
|
+
const id = getDiscountIdentityKey(discount);
|
|
577
|
+
if (id === null) return [discount];
|
|
578
|
+
if (runtimeDiscountIds.has(id)) return [];
|
|
579
|
+
runtimeDiscountIds.add(id);
|
|
580
|
+
const currentScanDiscount = currentScanDiscountById.get(id);
|
|
581
|
+
if (currentScanDiscount && (!(0, _entitlementPass.isEntitlementPass)(currentScanDiscount) || !(0, _entitlementPass.isEntitlementPass)(discount))) {
|
|
582
|
+
return [];
|
|
583
|
+
}
|
|
584
|
+
const committedDiscount = committedDiscountById.get(id);
|
|
585
|
+
let nextDiscount = discount;
|
|
586
|
+
if (committedDiscount && (0, _entitlementPass.isEntitlementPass)(committedDiscount) && (0, _entitlementPass.isEntitlementPass)(discount)) {
|
|
587
|
+
mergedCommittedDiscountIds.add(id);
|
|
588
|
+
nextDiscount = mergeCommittedEntitlementWithRuntime(committedDiscount, discount);
|
|
589
|
+
}
|
|
590
|
+
if (currentScanDiscount) {
|
|
591
|
+
refreshedScanDiscountIds.add(id);
|
|
592
|
+
nextDiscount = {
|
|
593
|
+
...nextDiscount,
|
|
594
|
+
isScan: true,
|
|
595
|
+
isSelected: currentScanDiscount.isSelected ?? nextDiscount.isSelected,
|
|
596
|
+
isManualSelect: currentScanDiscount.isManualSelect ?? nextDiscount.isManualSelect
|
|
597
|
+
};
|
|
598
|
+
}
|
|
599
|
+
return [nextDiscount];
|
|
600
|
+
});
|
|
601
|
+
const retainedCommittedDiscounts = currentCommittedDiscounts.filter(discount => {
|
|
602
|
+
const id = getDiscountIdentityKey(discount);
|
|
603
|
+
return id === null || !mergedCommittedDiscountIds.has(id);
|
|
604
|
+
}).map(discount => discount.committedAppliedProductDetails?.length ? {
|
|
605
|
+
...discount,
|
|
606
|
+
isEditMode: true,
|
|
607
|
+
isDisabled: true,
|
|
608
|
+
isSelected: true,
|
|
609
|
+
isUsed: true,
|
|
610
|
+
appliedProductDetails: [...discount.committedAppliedProductDetails]
|
|
611
|
+
} : discount);
|
|
612
|
+
const retainedScanDiscounts = currentScanDiscounts.filter(discount => {
|
|
613
|
+
const id = getDiscountIdentityKey(discount);
|
|
614
|
+
return id === null || !refreshedScanDiscountIds.has(id);
|
|
513
615
|
});
|
|
514
|
-
const mergedDiscountList = [...
|
|
616
|
+
const mergedDiscountList = [...retainedCommittedDiscounts, ...retainedScanDiscounts, ...runtimeDiscounts];
|
|
515
617
|
if (!isCurrentRequest()) return this.getDiscountList();
|
|
516
618
|
await this.store.discount?.setOriginalDiscountList(mergedDiscountList);
|
|
517
619
|
if (!isCurrentRequest()) return this.getDiscountList();
|
|
@@ -632,19 +734,34 @@ class OrderModule extends _BaseModule.BaseModule {
|
|
|
632
734
|
isAvailable: false,
|
|
633
735
|
discountList: this.getDiscountList()
|
|
634
736
|
};
|
|
635
|
-
const
|
|
737
|
+
const scannedIds = new Set(withScanList.map(discount => String(discount.id)));
|
|
738
|
+
const evaluatedScannedDiscounts = (evaluatedDiscountList || withScanList).filter(discount => scannedIds.has(String(discount.id)) && isCustomerPromotionDiscount(discount) && !(0, _availability.getDiscountLifecycleReason)(discount));
|
|
739
|
+
const shouldRetainForLater = !isAvailable && evaluatedScannedDiscounts.length > 0;
|
|
636
740
|
const normalizedNewDiscountList = newDiscountList ? markScannedDiscounts(newDiscountList, withScanList) : undefined;
|
|
637
|
-
const retainedDiscountList = evaluatedDiscountList ? markScannedDiscounts(evaluatedDiscountList, withScanList) : normalizedNewDiscountList;
|
|
638
741
|
let resolvedDiscountList = normalizedNewDiscountList || this.getDiscountList();
|
|
639
742
|
if (isAvailable && normalizedNewDiscountList) {
|
|
640
743
|
await this.store.discount?.setDiscountList(normalizedNewDiscountList);
|
|
641
|
-
|
|
744
|
+
// 实际写回商品时沿用扫码试算的优先级,避免旧商品行的选卡覆盖本次扫码。
|
|
745
|
+
this.applyDiscount({
|
|
746
|
+
preferredEntitlementPassIds: withScanList.filter(discount => (0, _entitlementPass.isEntitlementPass)(discount)).map(discount => discount.id)
|
|
747
|
+
});
|
|
642
748
|
await this.syncScannedDiscountsToOriginalDiscountList(this.getDiscountList());
|
|
643
749
|
resolvedDiscountList = this.getDiscountList();
|
|
644
|
-
} else if (shouldRetainForLater
|
|
645
|
-
//
|
|
646
|
-
|
|
647
|
-
|
|
750
|
+
} else if (shouldRetainForLater) {
|
|
751
|
+
// 只合并本次识别的卡券;不把试算产生的其他选券状态写回订单。
|
|
752
|
+
const retainedDiscounts = new Map(this.getDiscountList().map(discount => [String(discount.id), discount]));
|
|
753
|
+
evaluatedScannedDiscounts.forEach(discount => {
|
|
754
|
+
retainedDiscounts.set(String(discount.id), {
|
|
755
|
+
...discount,
|
|
756
|
+
isScan: true,
|
|
757
|
+
isAvailable: false,
|
|
758
|
+
isSelected: false,
|
|
759
|
+
reasonCode: discount.reasonCode || 'product_not_applicable',
|
|
760
|
+
appliedProductDetails: [],
|
|
761
|
+
savedAmount: 0
|
|
762
|
+
});
|
|
763
|
+
});
|
|
764
|
+
await this.store.discount?.setDiscountList([...retainedDiscounts.values()]);
|
|
648
765
|
await this.syncScannedDiscountsToOriginalDiscountList(this.getDiscountList());
|
|
649
766
|
resolvedDiscountList = this.getDiscountList();
|
|
650
767
|
}
|
|
@@ -653,7 +770,7 @@ class OrderModule extends _BaseModule.BaseModule {
|
|
|
653
770
|
isAvailable: isAvailable || false,
|
|
654
771
|
isAccepted: Boolean(isAvailable || shouldRetainForLater),
|
|
655
772
|
discountList: resolvedDiscountList,
|
|
656
|
-
scannedDiscountList:
|
|
773
|
+
scannedDiscountList: evaluatedScannedDiscounts,
|
|
657
774
|
unavailableReason
|
|
658
775
|
};
|
|
659
776
|
}
|
|
@@ -685,7 +802,8 @@ class OrderModule extends _BaseModule.BaseModule {
|
|
|
685
802
|
isFormSubject: product => (0, _utils.resolveIsFormSubject)(tempOrder, product),
|
|
686
803
|
orderTotalAmount: Number(this.store.summary?.total_amount || 0)
|
|
687
804
|
}, {
|
|
688
|
-
reapplyBookingDiscountProductUids: options?.reapplyBookingDiscountProductUids
|
|
805
|
+
reapplyBookingDiscountProductUids: options?.reapplyBookingDiscountProductUids,
|
|
806
|
+
preferredEntitlementPassIds: options?.preferredEntitlementPassIds
|
|
689
807
|
});
|
|
690
808
|
if (result?.productList) {
|
|
691
809
|
const previousProductsByUid = (0, _utils.indexOrderProductsByUid)(tempOrder.products);
|
|
@@ -1641,7 +1759,8 @@ class OrderModule extends _BaseModule.BaseModule {
|
|
|
1641
1759
|
const sku = product?.product_sku || {};
|
|
1642
1760
|
const metadata = product?.metadata || {};
|
|
1643
1761
|
const discountTypes = (product?.discount_list || []).map(discount => discount?.type ?? discount?.tag);
|
|
1644
|
-
const
|
|
1762
|
+
const fullCoveragePassType = discountTypes.find(type => ['entitlement_pass', 'good_pass'].includes(type));
|
|
1763
|
+
const extensionType = product?.extension_type || fullCoveragePassType || 'normal';
|
|
1645
1764
|
return {
|
|
1646
1765
|
product_id: product?.product_id ?? null,
|
|
1647
1766
|
product_variant_id: product?.product_variant_id ?? null,
|
|
@@ -1694,7 +1813,8 @@ class OrderModule extends _BaseModule.BaseModule {
|
|
|
1694
1813
|
const sku = product?.product_sku || {};
|
|
1695
1814
|
const metadata = product?.metadata || {};
|
|
1696
1815
|
const discountTypes = (product?.discount_list || []).map(discount => discount?.type ?? discount?.tag);
|
|
1697
|
-
const
|
|
1816
|
+
const fullCoveragePassType = discountTypes.find(type => ['entitlement_pass', 'good_pass'].includes(type));
|
|
1817
|
+
const extensionType = product?.extension_type || fullCoveragePassType || 'normal';
|
|
1698
1818
|
return {
|
|
1699
1819
|
product_id: product?.product_id ?? null,
|
|
1700
1820
|
product_variant_id: product?.product_variant_id ?? null,
|
|
@@ -2709,7 +2829,7 @@ class OrderModule extends _BaseModule.BaseModule {
|
|
|
2709
2829
|
}
|
|
2710
2830
|
isCustomerBoundDiscount(discount) {
|
|
2711
2831
|
const type = discount?.type ?? discount?.tag;
|
|
2712
|
-
return type === 'good_pass' || type === 'discount_card' || type === 'product_discount_card';
|
|
2832
|
+
return type === 'entitlement_pass' || type === 'good_pass' || type === 'discount_card' || type === 'product_discount_card';
|
|
2713
2833
|
}
|
|
2714
2834
|
shouldKeepCustomerBoundDiscountAfterCustomerChange(discount) {
|
|
2715
2835
|
return Boolean(discount?.isScan || discount?.isEditMode);
|
|
@@ -3332,17 +3452,35 @@ class OrderModule extends _BaseModule.BaseModule {
|
|
|
3332
3452
|
}
|
|
3333
3453
|
normalizedIncoming.discount_list = (0, _utils.normalizeOrderProductDiscountList)(normalizedIncoming.discount_list);
|
|
3334
3454
|
const hasIncomingGoodPass = this.hasGoodPassDiscount(normalizedIncoming);
|
|
3455
|
+
const hasIncomingEntitlementPass = this.hasEntitlementPassDiscount(normalizedIncoming);
|
|
3456
|
+
const isIncomingEntitlementAppend = this.isRuntimeEntitlementAppend(productToAdd, tempOrder);
|
|
3457
|
+
const isIncomingPersistedEntitlementPass = hasIncomingEntitlementPass && this.isPersistedProductLine(normalizedIncoming);
|
|
3335
3458
|
const hasIncomingProductNote = this.hasOrderProductLineNote(normalizedIncoming);
|
|
3336
3459
|
const hasIncomingManualProductDiscount = isManualProductDiscountProduct(normalizedIncoming);
|
|
3337
3460
|
const hasIncomingBookingUid = this.hasLinkedBookingUid(productToAdd) || this.hasLinkedBookingUid(normalizedIncoming);
|
|
3338
3461
|
const isIncomingCustomItem = productToAdd.metadata?.origin?.isCustomItem === true || productToAdd._origin?.isCustomItem === true;
|
|
3339
|
-
const shouldForceNewLine = disableMerge || !!booking ||
|
|
3340
|
-
const matchedIndex =
|
|
3462
|
+
const shouldForceNewLine = disableMerge || !!booking || hasIncomingGoodPass || isIncomingPersistedEntitlementPass || hasIncomingBookingUid || isIncomingCustomItem || isWeighingProduct;
|
|
3463
|
+
const matchedIndex = shouldForceNewLine ? -1 : tempOrder.products.findIndex(item => {
|
|
3341
3464
|
if (this.hasGoodPassDiscount(item)) return false;
|
|
3342
|
-
|
|
3343
|
-
if (
|
|
3344
|
-
|
|
3345
|
-
|
|
3465
|
+
const isRuntimeEntitlementPass = this.isRuntimeEntitlementAppend(item, tempOrder);
|
|
3466
|
+
if (isIncomingEntitlementAppend !== isRuntimeEntitlementPass) {
|
|
3467
|
+
return false;
|
|
3468
|
+
}
|
|
3469
|
+
if (isIncomingEntitlementAppend && this.isPersistedProductLine(item)) {
|
|
3470
|
+
return false;
|
|
3471
|
+
}
|
|
3472
|
+
const hasExistingProductNote = this.hasOrderProductLineNote(item);
|
|
3473
|
+
if ((hasIncomingProductNote || hasExistingProductNote) && (!isRuntimeEntitlementPass || String(normalizedIncoming.note || '').trim() !== String(item.note || '').trim())) {
|
|
3474
|
+
return false;
|
|
3475
|
+
}
|
|
3476
|
+
const hasExistingManualProductDiscount = isManualProductDiscountProduct(item);
|
|
3477
|
+
if (isRuntimeEntitlementPass && !this.hasSameEntitlementMergePriceConfig(normalizedIncoming, item)) {
|
|
3478
|
+
return false;
|
|
3479
|
+
}
|
|
3480
|
+
if ((hasIncomingManualProductDiscount || hasExistingManualProductDiscount) && !isRuntimeEntitlementPass) {
|
|
3481
|
+
return false;
|
|
3482
|
+
}
|
|
3483
|
+
if (this.isPersistedProductLine(item)) return false;
|
|
3346
3484
|
if (item.product_id !== productToAdd.product_id) return false;
|
|
3347
3485
|
if (item.product_variant_id !== productToAdd.product_variant_id) return false;
|
|
3348
3486
|
const existedFingerprint = (0, _utils3.buildProductLineFingerprint)((0, _utils.getProductSkuOptions)(item), item.product_bundle);
|
|
@@ -3643,17 +3781,51 @@ class OrderModule extends _BaseModule.BaseModule {
|
|
|
3643
3781
|
});
|
|
3644
3782
|
return tempOrder.products;
|
|
3645
3783
|
}
|
|
3646
|
-
|
|
3647
|
-
const
|
|
3648
|
-
if (hasMainGoodPass) return true;
|
|
3649
|
-
const bundleDiscountList = [];
|
|
3784
|
+
getFullCoveragePassDiscounts(product) {
|
|
3785
|
+
const discountList = [...(product.discount_list || [])];
|
|
3650
3786
|
(product.product_bundle || []).forEach(item => {
|
|
3651
|
-
|
|
3787
|
+
discountList.push(...(item?.discount_list || []));
|
|
3652
3788
|
});
|
|
3653
3789
|
(product?._extend?.other?.bundle || []).forEach(item => {
|
|
3654
|
-
|
|
3790
|
+
discountList.push(...(item?.discount_list || []));
|
|
3655
3791
|
});
|
|
3656
|
-
return
|
|
3792
|
+
return discountList.filter(item => (0, _entitlementPass.isFullCoveragePass)(item));
|
|
3793
|
+
}
|
|
3794
|
+
hasEntitlementPassDiscount(product) {
|
|
3795
|
+
return this.getFullCoveragePassDiscounts(product).some(item => (0, _entitlementPass.isEntitlementPass)(item));
|
|
3796
|
+
}
|
|
3797
|
+
hasGoodPassDiscount(product) {
|
|
3798
|
+
return this.getFullCoveragePassDiscounts(product).some(item => !(0, _entitlementPass.isEntitlementPass)(item));
|
|
3799
|
+
}
|
|
3800
|
+
isPersistedProductLine(product) {
|
|
3801
|
+
return product.order_detail_id !== undefined && product.order_detail_id !== null && product.order_detail_id !== '' || product.metadata?.is_edit_for_runtime === true;
|
|
3802
|
+
}
|
|
3803
|
+
isRuntimeEntitlementAppend(product, tempOrder) {
|
|
3804
|
+
if (this.isPersistedProductLine(product)) return false;
|
|
3805
|
+
const uid = product.metadata?.unique_identification_number ?? product.unique_identification_number;
|
|
3806
|
+
const storedOrigin = uid !== undefined && uid !== null && uid !== '' ? tempOrder._extend?.productsByUid?.[String(uid)]?.origin : undefined;
|
|
3807
|
+
return Boolean(product?._origin?.__entitlementPassRuntimeAppend === true || storedOrigin?.__entitlementPassRuntimeAppend === true);
|
|
3808
|
+
}
|
|
3809
|
+
hasSameEntitlementMergePriceConfig(incoming, existing) {
|
|
3810
|
+
const buildPriceConfig = product => {
|
|
3811
|
+
const metadata = product.metadata || {};
|
|
3812
|
+
const bundle = (product.product_bundle || []).map(item => ({
|
|
3813
|
+
bundle_id: item.bundle_id ?? item.id ?? null,
|
|
3814
|
+
bundle_product_id: item.bundle_product_id ?? item._bundle_product_id ?? item.product_id ?? null,
|
|
3815
|
+
bundle_variant_id: item.bundle_variant_id ?? item.product_variant_id ?? 0,
|
|
3816
|
+
price_type: item.price_type ?? item.custom_price_type ?? '',
|
|
3817
|
+
price_type_ext: item.price_type_ext ?? item.custom_price_type_ext ?? ''
|
|
3818
|
+
})).sort((left, right) => JSON.stringify(left).localeCompare(JSON.stringify(right)));
|
|
3819
|
+
return JSON.stringify({
|
|
3820
|
+
original_price: this.normalizeFingerprintMoney(product.original_price),
|
|
3821
|
+
source_product_price: this.normalizeFingerprintMoney(metadata.source_product_price),
|
|
3822
|
+
main_product_original_price: this.normalizeFingerprintMoney(metadata.main_product_original_price),
|
|
3823
|
+
price_override: this.normalizeFingerprintMoney(metadata.price_override),
|
|
3824
|
+
is_manual_discount: Boolean(metadata.is_manual_discount),
|
|
3825
|
+
bundle
|
|
3826
|
+
});
|
|
3827
|
+
};
|
|
3828
|
+
return buildPriceConfig(incoming) === buildPriceConfig(existing);
|
|
3657
3829
|
}
|
|
3658
3830
|
getBundleRuntimeIdentity(bundle) {
|
|
3659
3831
|
if (!bundle || typeof bundle !== 'object') return '';
|
|
@@ -3842,7 +4014,7 @@ class OrderModule extends _BaseModule.BaseModule {
|
|
|
3842
4014
|
// normalizeOrderProduct 幂等:v2 metadata 存在 → 保留 main_product_* 折扣重算 composite;
|
|
3843
4015
|
// 否则 → 把顶层 selling_price 视作 source,派生 main_product_* 并写 price_schema_version: 2。
|
|
3844
4016
|
let normalizedProduct = this.normalizeVirtualSettlementProductIfEnabled((0, _utils.mergeOrderProductDisplayFields)(nextProduct, (0, _utils3.normalizeOrderProduct)(nextProduct)));
|
|
3845
|
-
normalizedProduct.discount_list = (0, _utils.normalizeOrderProductDiscountList)(normalizedProduct.discount_list);
|
|
4017
|
+
normalizedProduct.discount_list = (0, _utils.normalizeOrderProductDiscountList)(isPersistedOrderLine ? syncReducedEntitlementPassUsageCount(normalizedProduct.discount_list, targetProduct.num, normalizedProduct.num) : normalizedProduct.discount_list);
|
|
3846
4018
|
const preservedBookingUid = nextProduct.booking_uid || nextProduct.metadata?.booking_uid || targetProduct.booking_uid || targetProduct.metadata?.booking_uid;
|
|
3847
4019
|
if (!booking && preservedBookingUid) {
|
|
3848
4020
|
normalizedProduct.booking_uid = preservedBookingUid;
|
|
@@ -3959,6 +4131,7 @@ class OrderModule extends _BaseModule.BaseModule {
|
|
|
3959
4131
|
throw new Error('[Order] 目标商品不存在,无法更新数量');
|
|
3960
4132
|
}
|
|
3961
4133
|
const targetProduct = tempOrder.products[productIndex];
|
|
4134
|
+
const isPersistedOrderLine = targetProduct.order_detail_id !== undefined && targetProduct.order_detail_id !== null;
|
|
3962
4135
|
const normalizedProduct = this.normalizeVirtualSettlementProductIfEnabled((0, _utils3.normalizeOrderProduct)({
|
|
3963
4136
|
...targetProduct,
|
|
3964
4137
|
num: (0, _utils3.getSafeProductNum)(num),
|
|
@@ -3967,7 +4140,7 @@ class OrderModule extends _BaseModule.BaseModule {
|
|
|
3967
4140
|
unique_identification_number: targetProduct.metadata?.unique_identification_number || unique_identification_number
|
|
3968
4141
|
}
|
|
3969
4142
|
}));
|
|
3970
|
-
normalizedProduct.discount_list = (0, _utils.normalizeOrderProductDiscountList)(normalizedProduct.discount_list);
|
|
4143
|
+
normalizedProduct.discount_list = (0, _utils.normalizeOrderProductDiscountList)(isPersistedOrderLine ? syncReducedEntitlementPassUsageCount(normalizedProduct.discount_list, targetProduct.num, normalizedProduct.num) : normalizedProduct.discount_list);
|
|
3971
4144
|
const settlementSnapshot = (0, _virtualSettlement.getSelectedSettlementSnapshot)(normalizedProduct);
|
|
3972
4145
|
if (this.isMultiCurrencySettlementEnabled() && settlementSnapshot?.settlement_type === 'virtual_currency' && tempOrder.customer_id && Number(tempOrder.customer_id) !== 1) {
|
|
3973
4146
|
const currencyProductId = Number(settlementSnapshot.currency_product_id);
|
|
@@ -17,6 +17,7 @@ exports.normalizeOrderCollections = normalizeOrderCollections;
|
|
|
17
17
|
exports.repairDuplicateProductLineIdentities = repairDuplicateProductLineIdentities;
|
|
18
18
|
exports.setOrderCollectionUid = setOrderCollectionUid;
|
|
19
19
|
var _lodashEs = require("lodash-es");
|
|
20
|
+
var _entitlementPass = require("../../Discount/entitlementPass");
|
|
20
21
|
const IDENTITY_CONFIG = {
|
|
21
22
|
product: {
|
|
22
23
|
persistentIdField: 'order_detail_id',
|
|
@@ -81,20 +82,22 @@ function setOrderCollectionUid(kind, item, uid) {
|
|
|
81
82
|
delete record[uidField];
|
|
82
83
|
return record;
|
|
83
84
|
}
|
|
84
|
-
function
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
85
|
+
function getFullCoveragePassIdentity(product) {
|
|
86
|
+
const pass = (product.discount_list || []).find(item => (0, _entitlementPass.isFullCoveragePass)(item));
|
|
87
|
+
if (!pass) return null;
|
|
88
|
+
const resourceId = pass.discount?.resource_id ?? pass.resource_id ?? pass.discount_id ?? pass.id;
|
|
89
|
+
if (isBlankOrderCollectionIdentity(resourceId)) return null;
|
|
90
|
+
return {
|
|
91
|
+
type: String(pass.type || pass.tag),
|
|
92
|
+
resourceId: String(resourceId)
|
|
93
|
+
};
|
|
92
94
|
}
|
|
93
95
|
function buildSplitProductUid(originalUid, product, duplicateOrdinal) {
|
|
94
96
|
const encodedOriginalUid = encodeURIComponent(originalUid);
|
|
95
|
-
const
|
|
96
|
-
if (
|
|
97
|
-
|
|
97
|
+
const passIdentity = getFullCoveragePassIdentity(product);
|
|
98
|
+
if (passIdentity) {
|
|
99
|
+
const passType = passIdentity.type === 'good_pass' ? 'good-pass' : 'entitlement-pass';
|
|
100
|
+
return `os-split:product:${encodedOriginalUid}:${passType}:${encodeURIComponent(passIdentity.resourceId)}:${duplicateOrdinal}`;
|
|
98
101
|
}
|
|
99
102
|
return `os-split:product:${encodedOriginalUid}:duplicate:${duplicateOrdinal}`;
|
|
100
103
|
}
|
|
@@ -171,7 +171,7 @@ export declare function resolveManualOverrideLineOriginalPrice(params: {
|
|
|
171
171
|
* // => -4
|
|
172
172
|
*/
|
|
173
173
|
export declare function resolveEffectivePerUnitDiscount(product: Record<string, any>): number;
|
|
174
|
-
export declare function createDefaultOrderRulesHooks(): RulesParamsHooks;
|
|
174
|
+
export declare function createDefaultOrderRulesHooks(getBookings?: () => OrderTempOrder['bookings']): RulesParamsHooks;
|
|
175
175
|
/**
|
|
176
176
|
* 通过 session 类商品的开始时间结束时间生成商品的时长
|
|
177
177
|
* @param {CartItem} cartItem
|