@pisell/pisellos 2.1.170 → 2.1.172
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/index.d.ts +1 -1
- package/dist/index.js +1 -3
- package/dist/model/strategy/adapter/index.d.ts +0 -4
- package/dist/model/strategy/adapter/index.js +1 -5
- package/dist/model/strategy/adapter/promotion/evaluator.js +99 -26
- 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 +61 -8
- package/dist/model/strategy/adapter/walletPass/locales.js +12 -3
- package/dist/model/strategy/engine.d.ts +18 -5
- package/dist/model/strategy/engine.js +145 -45
- package/dist/model/strategy/type.d.ts +17 -0
- package/dist/model/strategy/type.js +4 -0
- package/dist/modules/Cart/types.d.ts +2 -0
- package/dist/modules/Cart/utils/cartProduct.js +56 -25
- package/dist/modules/Cart/utils/changePrice.js +9 -16
- package/dist/modules/Discount/index.d.ts +4 -13
- package/dist/modules/Discount/index.js +12 -124
- package/dist/modules/Discount/types.d.ts +18 -13
- package/dist/modules/Order/index.d.ts +1 -67
- package/dist/modules/Order/index.js +30 -918
- package/dist/modules/Order/types.d.ts +12 -176
- package/dist/modules/Order/types.js +0 -2
- package/dist/modules/Order/utils.d.ts +0 -118
- package/dist/modules/Order/utils.js +2 -586
- package/dist/modules/Payment/index.d.ts +2 -1
- package/dist/modules/Payment/index.js +10 -7
- package/dist/modules/Payment/utils.js +3 -0
- package/dist/modules/Payment/walletpass.d.ts +23 -0
- package/dist/modules/Payment/walletpass.js +191 -95
- package/dist/modules/Product/utils.js +2 -2
- package/dist/modules/ProductList/index.d.ts +2 -4
- package/dist/modules/ProductList/index.js +12 -24
- package/dist/modules/Rules/index.d.ts +9 -5
- package/dist/modules/Rules/index.js +669 -173
- package/dist/modules/Rules/types.d.ts +2 -0
- package/dist/modules/Schedule/getDateIsInSchedule.js +18 -16
- package/dist/modules/Schedule/utils.d.ts +1 -1
- package/dist/modules/Summary/types.d.ts +2 -0
- package/dist/modules/Summary/utils.d.ts +9 -3
- package/dist/modules/Summary/utils.js +57 -67
- package/dist/modules/index.d.ts +0 -4
- package/dist/modules/index.js +1 -5
- package/dist/plugins/window.d.ts +2 -0
- package/dist/solution/BookingByStep/index.d.ts +3 -2
- package/dist/solution/BookingByStep/index.js +43 -46
- package/dist/solution/BookingByStep/types.d.ts +1 -3
- package/dist/solution/BookingByStep/types.js +1 -5
- package/dist/solution/BookingByStep/utils/timeslots.d.ts +1 -3
- package/dist/solution/BookingByStep/utils/timeslots.js +12 -19
- package/dist/solution/Checkout/index.js +2 -0
- package/dist/solution/ShopDiscount/index.d.ts +2 -3
- package/dist/solution/ShopDiscount/index.js +60 -62
- package/dist/solution/ShopDiscount/types.d.ts +1 -1
- package/dist/solution/ShopDiscount/types.js +2 -1
- package/dist/solution/ShopDiscount/utils.js +26 -12
- package/dist/solution/index.d.ts +0 -2
- package/dist/solution/index.js +1 -3
- package/lib/index.d.ts +1 -1
- package/lib/index.js +3 -4
- package/lib/model/strategy/adapter/index.d.ts +0 -4
- package/lib/model/strategy/adapter/index.js +2 -13
- package/lib/model/strategy/adapter/promotion/evaluator.js +57 -8
- package/lib/model/strategy/adapter/walletPass/evaluator.d.ts +2 -0
- package/lib/model/strategy/adapter/walletPass/evaluator.js +34 -3
- package/lib/model/strategy/adapter/walletPass/locales.js +12 -3
- package/lib/model/strategy/engine.d.ts +18 -5
- package/lib/model/strategy/engine.js +85 -21
- package/lib/model/strategy/type.d.ts +17 -0
- package/lib/modules/Cart/types.d.ts +2 -0
- package/lib/modules/Cart/utils/cartProduct.js +39 -12
- package/lib/modules/Cart/utils/changePrice.js +9 -13
- package/lib/modules/Discount/index.d.ts +4 -13
- package/lib/modules/Discount/index.js +5 -76
- package/lib/modules/Discount/types.d.ts +18 -13
- package/lib/modules/Order/index.d.ts +1 -67
- package/lib/modules/Order/index.js +1 -525
- package/lib/modules/Order/types.d.ts +12 -176
- package/lib/modules/Order/utils.d.ts +0 -118
- package/lib/modules/Order/utils.js +2 -483
- package/lib/modules/Payment/index.d.ts +2 -1
- package/lib/modules/Payment/index.js +1 -0
- package/lib/modules/Payment/utils.js +3 -0
- package/lib/modules/Payment/walletpass.d.ts +23 -0
- package/lib/modules/Payment/walletpass.js +94 -17
- package/lib/modules/Product/utils.js +2 -2
- package/lib/modules/ProductList/index.d.ts +2 -4
- package/lib/modules/ProductList/index.js +39 -46
- package/lib/modules/Rules/index.d.ts +9 -5
- package/lib/modules/Rules/index.js +776 -292
- package/lib/modules/Rules/types.d.ts +2 -0
- package/lib/modules/Schedule/getDateIsInSchedule.js +11 -13
- package/lib/modules/Schedule/utils.d.ts +1 -1
- package/lib/modules/Summary/types.d.ts +2 -0
- package/lib/modules/Summary/utils.d.ts +9 -3
- package/lib/modules/Summary/utils.js +34 -45
- package/lib/modules/index.d.ts +0 -4
- package/lib/modules/index.js +1 -9
- package/lib/plugins/window.d.ts +2 -0
- package/lib/solution/BookingByStep/index.d.ts +3 -2
- package/lib/solution/BookingByStep/index.js +4 -6
- package/lib/solution/BookingByStep/types.d.ts +1 -3
- package/lib/solution/BookingByStep/types.js +0 -10
- package/lib/solution/BookingByStep/utils/timeslots.d.ts +1 -3
- package/lib/solution/BookingByStep/utils/timeslots.js +11 -19
- package/lib/solution/Checkout/index.js +2 -0
- package/lib/solution/ShopDiscount/index.d.ts +2 -3
- package/lib/solution/ShopDiscount/index.js +27 -22
- package/lib/solution/ShopDiscount/types.d.ts +1 -1
- package/lib/solution/ShopDiscount/utils.js +10 -6
- package/lib/solution/index.d.ts +0 -2
- package/lib/solution/index.js +1 -5
- package/package.json +2 -2
- package/dist/apis/picoding.d.ts +0 -0
- package/dist/apis/picoding.js +0 -1
- package/dist/model/strategy/adapter/dataVariant/adapter.d.ts +0 -50
- package/dist/model/strategy/adapter/dataVariant/adapter.js +0 -167
- package/dist/model/strategy/adapter/dataVariant/evaluator.d.ts +0 -89
- package/dist/model/strategy/adapter/dataVariant/evaluator.js +0 -867
- package/dist/model/strategy/adapter/dataVariant/examples.d.ts +0 -39
- package/dist/model/strategy/adapter/dataVariant/examples.js +0 -277
- package/dist/model/strategy/adapter/dataVariant/index.d.ts +0 -4
- package/dist/model/strategy/adapter/dataVariant/index.js +0 -4
- package/dist/model/strategy/adapter/dataVariant/type.d.ts +0 -149
- package/dist/model/strategy/adapter/dataVariant/type.js +0 -54
- package/dist/modules/OpenData/index.d.ts +0 -24
- package/dist/modules/OpenData/index.js +0 -173
- package/dist/modules/OpenData/types.d.ts +0 -73
- package/dist/modules/OpenData/types.js +0 -1
- package/dist/modules/OpenData/utils.d.ts +0 -2
- package/dist/modules/OpenData/utils.js +0 -75
- package/dist/modules/Quotation/index.d.ts +0 -48
- package/dist/modules/Quotation/index.js +0 -248
- package/dist/modules/Quotation/types.d.ts +0 -42
- package/dist/modules/Quotation/types.js +0 -1
- package/dist/modules/SalesSummary/index.d.ts +0 -63
- package/dist/modules/SalesSummary/index.js +0 -174
- package/dist/modules/SalesSummary/types.d.ts +0 -60
- package/dist/modules/SalesSummary/types.js +0 -1
- package/dist/modules/SalesSummary/utils.d.ts +0 -30
- package/dist/modules/SalesSummary/utils.js +0 -480
- package/dist/modules/ScanOrderLogger/index.d.ts +0 -23
- package/dist/modules/ScanOrderLogger/index.js +0 -174
- package/dist/modules/ScanOrderLogger/providers/feishu.d.ts +0 -2
- package/dist/modules/ScanOrderLogger/providers/feishu.js +0 -221
- package/dist/modules/ScanOrderLogger/providers/grafana.d.ts +0 -2
- package/dist/modules/ScanOrderLogger/providers/grafana.js +0 -50
- package/dist/modules/ScanOrderLogger/types.d.ts +0 -53
- package/dist/modules/ScanOrderLogger/types.js +0 -1
- package/dist/solution/ScanOrder/index.d.ts +0 -158
- package/dist/solution/ScanOrder/index.js +0 -3474
- package/dist/solution/ScanOrder/types.d.ts +0 -306
- package/dist/solution/ScanOrder/types.js +0 -35
- package/dist/solution/ScanOrder/utils.d.ts +0 -172
- package/dist/solution/ScanOrder/utils.js +0 -796
- package/dist/solution/VenueBooking/index.d.ts +0 -252
- package/dist/solution/VenueBooking/index.js +0 -3769
- package/dist/solution/VenueBooking/sales-section-4-annotated.json +0 -343
- package/dist/solution/VenueBooking/types.d.ts +0 -156
- package/dist/solution/VenueBooking/types.js +0 -22
- package/dist/solution/VenueBooking/utils/dateSummary.d.ts +0 -11
- package/dist/solution/VenueBooking/utils/dateSummary.js +0 -91
- package/dist/solution/VenueBooking/utils/resource.d.ts +0 -14
- package/dist/solution/VenueBooking/utils/resource.js +0 -131
- package/dist/solution/VenueBooking/utils/slotMerge.d.ts +0 -32
- package/dist/solution/VenueBooking/utils/slotMerge.js +0 -233
- package/dist/solution/VenueBooking/utils/smartPricing.d.ts +0 -71
- package/dist/solution/VenueBooking/utils/smartPricing.js +0 -302
- package/dist/solution/VenueBooking/utils/timeSlot.d.ts +0 -34
- package/dist/solution/VenueBooking/utils/timeSlot.js +0 -458
- package/dist/solution/VenueBooking/utils.d.ts +0 -1
- package/dist/solution/VenueBooking/utils.js +0 -1
- package/lib/apis/picoding.d.ts +0 -0
- package/lib/apis/picoding.js +0 -0
- package/lib/model/strategy/adapter/dataVariant/adapter.d.ts +0 -50
- package/lib/model/strategy/adapter/dataVariant/adapter.js +0 -149
- package/lib/model/strategy/adapter/dataVariant/evaluator.d.ts +0 -89
- package/lib/model/strategy/adapter/dataVariant/evaluator.js +0 -666
- package/lib/model/strategy/adapter/dataVariant/examples.d.ts +0 -39
- package/lib/model/strategy/adapter/dataVariant/examples.js +0 -293
- package/lib/model/strategy/adapter/dataVariant/index.d.ts +0 -4
- package/lib/model/strategy/adapter/dataVariant/index.js +0 -38
- package/lib/model/strategy/adapter/dataVariant/type.d.ts +0 -149
- package/lib/model/strategy/adapter/dataVariant/type.js +0 -31
- package/lib/modules/OpenData/index.d.ts +0 -24
- package/lib/modules/OpenData/index.js +0 -119
- package/lib/modules/OpenData/types.d.ts +0 -73
- package/lib/modules/OpenData/types.js +0 -17
- package/lib/modules/OpenData/utils.d.ts +0 -2
- package/lib/modules/OpenData/utils.js +0 -111
- package/lib/modules/Quotation/index.d.ts +0 -48
- package/lib/modules/Quotation/index.js +0 -152
- package/lib/modules/Quotation/types.d.ts +0 -42
- package/lib/modules/Quotation/types.js +0 -17
- package/lib/modules/SalesSummary/index.d.ts +0 -63
- package/lib/modules/SalesSummary/index.js +0 -105
- package/lib/modules/SalesSummary/types.d.ts +0 -60
- package/lib/modules/SalesSummary/types.js +0 -17
- package/lib/modules/SalesSummary/utils.d.ts +0 -30
- package/lib/modules/SalesSummary/utils.js +0 -420
- package/lib/modules/ScanOrderLogger/index.d.ts +0 -23
- package/lib/modules/ScanOrderLogger/index.js +0 -147
- package/lib/modules/ScanOrderLogger/providers/feishu.d.ts +0 -2
- package/lib/modules/ScanOrderLogger/providers/feishu.js +0 -157
- package/lib/modules/ScanOrderLogger/providers/grafana.d.ts +0 -2
- package/lib/modules/ScanOrderLogger/providers/grafana.js +0 -52
- package/lib/modules/ScanOrderLogger/types.d.ts +0 -53
- package/lib/modules/ScanOrderLogger/types.js +0 -17
- package/lib/solution/ScanOrder/index.d.ts +0 -158
- package/lib/solution/ScanOrder/index.js +0 -2135
- package/lib/solution/ScanOrder/types.d.ts +0 -306
- package/lib/solution/ScanOrder/types.js +0 -36
- package/lib/solution/ScanOrder/utils.d.ts +0 -172
- package/lib/solution/ScanOrder/utils.js +0 -658
- package/lib/solution/VenueBooking/index.d.ts +0 -252
- package/lib/solution/VenueBooking/index.js +0 -2204
- package/lib/solution/VenueBooking/sales-section-4-annotated.json +0 -343
- package/lib/solution/VenueBooking/types.d.ts +0 -156
- package/lib/solution/VenueBooking/types.js +0 -45
- package/lib/solution/VenueBooking/utils/dateSummary.d.ts +0 -11
- package/lib/solution/VenueBooking/utils/dateSummary.js +0 -105
- package/lib/solution/VenueBooking/utils/resource.d.ts +0 -14
- package/lib/solution/VenueBooking/utils/resource.js +0 -92
- package/lib/solution/VenueBooking/utils/slotMerge.d.ts +0 -32
- package/lib/solution/VenueBooking/utils/slotMerge.js +0 -236
- package/lib/solution/VenueBooking/utils/smartPricing.d.ts +0 -71
- package/lib/solution/VenueBooking/utils/smartPricing.js +0 -225
- package/lib/solution/VenueBooking/utils/timeSlot.d.ts +0 -34
- package/lib/solution/VenueBooking/utils/timeSlot.js +0 -343
- package/lib/solution/VenueBooking/utils.d.ts +0 -1
- package/lib/solution/VenueBooking/utils.js +0 -69
|
@@ -31,6 +31,7 @@ var WalletPassPaymentImpl = class {
|
|
|
31
31
|
this.userIdentificationCodes = [];
|
|
32
32
|
this.searchResults = [];
|
|
33
33
|
this.walletParams = null;
|
|
34
|
+
this.walletInitData = null;
|
|
34
35
|
}
|
|
35
36
|
/**
|
|
36
37
|
* 发送事件的辅助方法
|
|
@@ -42,7 +43,9 @@ var WalletPassPaymentImpl = class {
|
|
|
42
43
|
const fullEventName = `${this.paymentModule.name}:${eventName}`;
|
|
43
44
|
this.paymentModule.core.effects.emit(fullEventName, data);
|
|
44
45
|
} catch (error) {
|
|
45
|
-
this.paymentModule.logError("[WalletPass] 发送事件失败", error, {
|
|
46
|
+
this.paymentModule.logError("[WalletPass] 发送事件失败", error, {
|
|
47
|
+
hook
|
|
48
|
+
});
|
|
46
49
|
}
|
|
47
50
|
}
|
|
48
51
|
/**
|
|
@@ -112,7 +115,10 @@ var WalletPassPaymentImpl = class {
|
|
|
112
115
|
if (Number(((_a = businessData == null ? void 0 : businessData.amountInfo) == null ? void 0 : _a.totalAmount) || 0) < 0 || Number(((_b = businessData == null ? void 0 : businessData.amountInfo) == null ? void 0 : _b.subTotal) || 0) < 0) {
|
|
113
116
|
return {
|
|
114
117
|
walletRecommendList: [],
|
|
115
|
-
userIdentificationCodes: []
|
|
118
|
+
userIdentificationCodes: [],
|
|
119
|
+
transformList: [],
|
|
120
|
+
noApplicableVoucher: [],
|
|
121
|
+
products: []
|
|
116
122
|
};
|
|
117
123
|
}
|
|
118
124
|
this.emitEvent(import_types.WalletPassHooks.OnWalletInitializationStarted, {
|
|
@@ -153,11 +159,28 @@ var WalletPassPaymentImpl = class {
|
|
|
153
159
|
endTime,
|
|
154
160
|
duration
|
|
155
161
|
});
|
|
156
|
-
this.paymentModule.logError(
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
162
|
+
this.paymentModule.logError(
|
|
163
|
+
`[WalletPass] 从业务数据初始化钱包数据失败`,
|
|
164
|
+
error,
|
|
165
|
+
{
|
|
166
|
+
duration: `${duration}ms`,
|
|
167
|
+
customer_id: businessData.customer_id,
|
|
168
|
+
totalAmount: (_h = businessData.amountInfo) == null ? void 0 : _h.totalAmount
|
|
169
|
+
}
|
|
170
|
+
);
|
|
171
|
+
throw error;
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* 获取订单基础详情
|
|
176
|
+
*/
|
|
177
|
+
async getOrderBasicDetailAsync(orderId) {
|
|
178
|
+
try {
|
|
179
|
+
const response = await this.paymentModule.request.get(
|
|
180
|
+
`/order/order/${orderId}/basic-detail`
|
|
181
|
+
);
|
|
182
|
+
return (response == null ? void 0 : response.data) || {};
|
|
183
|
+
} catch (error) {
|
|
161
184
|
throw error;
|
|
162
185
|
}
|
|
163
186
|
}
|
|
@@ -166,19 +189,49 @@ var WalletPassPaymentImpl = class {
|
|
|
166
189
|
* 先获取推荐列表,再获取用户识别码列表(顺序执行)
|
|
167
190
|
*/
|
|
168
191
|
async initializeWalletDataAsync(baseParams) {
|
|
192
|
+
var _a, _b;
|
|
169
193
|
try {
|
|
170
|
-
const walletRecommendList = await this.getWalletPassRecommendListAsync(baseParams);
|
|
171
194
|
const identificationParams = {
|
|
172
195
|
...baseParams,
|
|
173
196
|
available: 2,
|
|
174
|
-
prepare_payments:
|
|
197
|
+
prepare_payments: [],
|
|
175
198
|
other_exact_codes: [],
|
|
176
199
|
filter_prepare_wallet_pass: 1
|
|
177
200
|
};
|
|
178
|
-
const
|
|
201
|
+
const [allList, orderBasicDetail] = await Promise.all([
|
|
202
|
+
this.getUserIdentificationCodeListAsync(identificationParams),
|
|
203
|
+
baseParams.payment_order_id ? this.getOrderBasicDetailAsync(baseParams.payment_order_id) : Promise.resolve(null)
|
|
204
|
+
]);
|
|
205
|
+
const walletPassEvaluator = (_b = (_a = this.paymentModule.window) == null ? void 0 : _a.getWalletPassEvaluator) == null ? void 0 : _b.call(_a);
|
|
206
|
+
if (!walletPassEvaluator) {
|
|
207
|
+
return {
|
|
208
|
+
walletRecommendList: [],
|
|
209
|
+
userIdentificationCodes: [],
|
|
210
|
+
transformList: [],
|
|
211
|
+
noApplicableVoucher: [],
|
|
212
|
+
products: []
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
const products = (orderBasicDetail == null ? void 0 : orderBasicDetail.detail) || baseParams.products;
|
|
216
|
+
const res = walletPassEvaluator == null ? void 0 : walletPassEvaluator.getRecommendedVouchers({
|
|
217
|
+
orderTotalAmount: baseParams.order_wait_pay_amount,
|
|
218
|
+
products,
|
|
219
|
+
vouchers: allList
|
|
220
|
+
});
|
|
221
|
+
const { recommended, transformList, noApplicableVoucher, recommendedAmount } = res;
|
|
222
|
+
console.log(res, "resres12");
|
|
223
|
+
this.walletRecommendList = recommended;
|
|
224
|
+
this.walletInitData = {
|
|
225
|
+
transformList,
|
|
226
|
+
noApplicableVoucher,
|
|
227
|
+
products: products || []
|
|
228
|
+
};
|
|
179
229
|
return {
|
|
180
|
-
walletRecommendList,
|
|
181
|
-
userIdentificationCodes
|
|
230
|
+
walletRecommendList: recommended,
|
|
231
|
+
userIdentificationCodes: allList,
|
|
232
|
+
transformList,
|
|
233
|
+
noApplicableVoucher,
|
|
234
|
+
products: products || []
|
|
182
235
|
};
|
|
183
236
|
} catch (error) {
|
|
184
237
|
this.paymentModule.logError("[WalletPass] 初始化钱包数据失败", error, {
|
|
@@ -261,10 +314,14 @@ var WalletPassPaymentImpl = class {
|
|
|
261
314
|
});
|
|
262
315
|
return this.userIdentificationCodes;
|
|
263
316
|
} catch (error) {
|
|
264
|
-
this.paymentModule.logError(
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
317
|
+
this.paymentModule.logError(
|
|
318
|
+
"[WalletPass] 获取用户识别码列表失败",
|
|
319
|
+
error,
|
|
320
|
+
{
|
|
321
|
+
customer_id: params.customer_id,
|
|
322
|
+
available: params.available
|
|
323
|
+
}
|
|
324
|
+
);
|
|
268
325
|
return [];
|
|
269
326
|
}
|
|
270
327
|
}
|
|
@@ -462,6 +519,19 @@ var WalletPassPaymentImpl = class {
|
|
|
462
519
|
this.searchResults = [];
|
|
463
520
|
this.paymentModule.logInfo("[WalletPass] 搜索结果缓存已清除");
|
|
464
521
|
}
|
|
522
|
+
/**
|
|
523
|
+
* 获取存储的钱包初始化数据
|
|
524
|
+
*/
|
|
525
|
+
getStoredWalletInitData() {
|
|
526
|
+
return this.walletInitData;
|
|
527
|
+
}
|
|
528
|
+
/**
|
|
529
|
+
* 清除存储的钱包初始化数据
|
|
530
|
+
*/
|
|
531
|
+
clearStoredWalletInitData() {
|
|
532
|
+
this.walletInitData = null;
|
|
533
|
+
this.paymentModule.logInfo("[WalletPass] 钱包初始化数据已清除");
|
|
534
|
+
}
|
|
465
535
|
/**
|
|
466
536
|
* 清除所有缓存数据
|
|
467
537
|
*/
|
|
@@ -470,11 +540,18 @@ var WalletPassPaymentImpl = class {
|
|
|
470
540
|
this.userIdentificationCodes = [];
|
|
471
541
|
this.searchResults = [];
|
|
472
542
|
this.walletParams = null;
|
|
543
|
+
this.walletInitData = null;
|
|
473
544
|
this.emitEvent(import_types.WalletPassHooks.OnWalletCacheCleared, {
|
|
474
545
|
clearedTypes: ["all"]
|
|
475
546
|
});
|
|
476
547
|
this.paymentModule.logInfo("[WalletPass] 所有缓存数据已清除", {
|
|
477
|
-
cleared_types: [
|
|
548
|
+
cleared_types: [
|
|
549
|
+
"walletRecommendList",
|
|
550
|
+
"userIdentificationCodes",
|
|
551
|
+
"searchResults",
|
|
552
|
+
"walletParams",
|
|
553
|
+
"walletInitData"
|
|
554
|
+
]
|
|
478
555
|
});
|
|
479
556
|
}
|
|
480
557
|
};
|
|
@@ -25,10 +25,10 @@ __export(utils_exports, {
|
|
|
25
25
|
module.exports = __toCommonJS(utils_exports);
|
|
26
26
|
function isNormalProduct(product) {
|
|
27
27
|
var _a;
|
|
28
|
-
if (product
|
|
28
|
+
if (product.duration) {
|
|
29
29
|
return false;
|
|
30
30
|
}
|
|
31
|
-
if ((_a = product
|
|
31
|
+
if ((_a = product["schedule.ids"]) == null ? void 0 : _a.length) {
|
|
32
32
|
return false;
|
|
33
33
|
}
|
|
34
34
|
return true;
|
|
@@ -11,19 +11,17 @@ export declare class ProductList extends BaseModule implements Module {
|
|
|
11
11
|
constructor(name?: string, version?: string);
|
|
12
12
|
initialize(core: PisellCore, options: any): Promise<void>;
|
|
13
13
|
storeChange(path?: string, value?: any): Promise<void>;
|
|
14
|
-
loadProducts({ category_ids, product_ids, collection, menu_list_ids, customer_id: paramsCustomerId, with_count, schedule_datetime, schedule_date, cacheId, with_schedule,
|
|
14
|
+
loadProducts({ category_ids, product_ids, collection, menu_list_ids, customer_id: paramsCustomerId, with_count, schedule_datetime, schedule_date, cacheId, with_schedule, }: {
|
|
15
15
|
category_ids?: number[];
|
|
16
16
|
product_ids?: number[];
|
|
17
17
|
collection?: number | string[];
|
|
18
18
|
schedule_date?: string;
|
|
19
|
-
schedule_datetime?: string;
|
|
20
19
|
cacheId?: string;
|
|
21
20
|
customer_id?: number;
|
|
22
21
|
menu_list_ids?: number[];
|
|
22
|
+
schedule_datetime?: string;
|
|
23
23
|
with_count?: string[];
|
|
24
24
|
with_schedule?: number;
|
|
25
|
-
/** 追加到默认 with 字段(如 dataVariants) */
|
|
26
|
-
with_extra?: string[];
|
|
27
25
|
}): Promise<any>;
|
|
28
26
|
loadProductsPrice({ ids, customer_id, schedule_date, channel, }: {
|
|
29
27
|
ids?: number[];
|
|
@@ -59,10 +59,9 @@ var ProductList = class extends import_BaseModule.BaseModule {
|
|
|
59
59
|
schedule_datetime,
|
|
60
60
|
schedule_date,
|
|
61
61
|
cacheId,
|
|
62
|
-
with_schedule
|
|
63
|
-
with_extra = []
|
|
62
|
+
with_schedule
|
|
64
63
|
}) {
|
|
65
|
-
var _a;
|
|
64
|
+
var _a, _b, _c;
|
|
66
65
|
let userPlugin = this.core.getPlugin("user");
|
|
67
66
|
let customer_id = void 0;
|
|
68
67
|
try {
|
|
@@ -70,49 +69,43 @@ var ProductList = class extends import_BaseModule.BaseModule {
|
|
|
70
69
|
} catch (error) {
|
|
71
70
|
console.error(error);
|
|
72
71
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
const sortedList = (productsData.data.list || []).slice().sort((a, b) => Number(b.sort) - Number(a.sort));
|
|
111
|
-
this.addProduct(sortedList);
|
|
112
|
-
return sortedList;
|
|
113
|
-
} catch (error) {
|
|
114
|
-
return error;
|
|
115
|
-
}
|
|
72
|
+
const _platform = this.core.context.platform;
|
|
73
|
+
const productsData = await this.request.post(
|
|
74
|
+
`/product/query`,
|
|
75
|
+
{
|
|
76
|
+
open_quotation: 1,
|
|
77
|
+
open_bundle: 0,
|
|
78
|
+
exclude_extension_type: [
|
|
79
|
+
"product_party",
|
|
80
|
+
"product_event",
|
|
81
|
+
"product_series_event",
|
|
82
|
+
"product_package_ticket",
|
|
83
|
+
"ticket",
|
|
84
|
+
"event_item"
|
|
85
|
+
],
|
|
86
|
+
with: ["category", "collection", "resourceRelation"],
|
|
87
|
+
status: "published",
|
|
88
|
+
num: 500,
|
|
89
|
+
skip: 1,
|
|
90
|
+
customer_id,
|
|
91
|
+
category_ids,
|
|
92
|
+
ids: product_ids,
|
|
93
|
+
collection,
|
|
94
|
+
front_end_cache_id: cacheId,
|
|
95
|
+
menu_list_ids,
|
|
96
|
+
with_count,
|
|
97
|
+
// client_schedule_ids: schedule_ids,
|
|
98
|
+
schedule_date,
|
|
99
|
+
application_code: _platform === "shop" ? ((_b = this.otherParams) == null ? void 0 : _b.channel) === "online_store" ? "online-store" : (_c = this.otherParams) == null ? void 0 : _c.channel : "online-store",
|
|
100
|
+
with_schedule,
|
|
101
|
+
schedule_datetime,
|
|
102
|
+
is_eject: 1
|
|
103
|
+
},
|
|
104
|
+
{ useCache: true }
|
|
105
|
+
);
|
|
106
|
+
const sortedList = (productsData.data.list || []).slice().sort((a, b) => Number(b.sort) - Number(a.sort));
|
|
107
|
+
this.addProduct(sortedList);
|
|
108
|
+
return sortedList;
|
|
116
109
|
}
|
|
117
110
|
async loadProductsPrice({
|
|
118
111
|
ids = [],
|
|
@@ -1,25 +1,28 @@
|
|
|
1
1
|
import { Module, PisellCore, ModuleOptions } from '../../types';
|
|
2
2
|
import { BaseModule } from '../BaseModule';
|
|
3
3
|
import { Rules, RulesModuleAPI, DiscountResult, UnavailableReason } from './types';
|
|
4
|
-
import { Discount } from
|
|
5
|
-
import {
|
|
4
|
+
import { Discount } from '../Discount/types';
|
|
5
|
+
import { WindowPlugin } from '../../plugins';
|
|
6
6
|
export declare class RulesModule extends BaseModule implements Module, RulesModuleAPI {
|
|
7
7
|
protected defaultName: string;
|
|
8
8
|
protected defaultVersion: string;
|
|
9
9
|
private store;
|
|
10
|
+
window: WindowPlugin;
|
|
10
11
|
private hooks;
|
|
11
12
|
constructor(name?: string, version?: string);
|
|
12
13
|
initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
|
|
13
14
|
setRulesList(rulesList: Rules[]): Promise<void>;
|
|
14
15
|
getRulesList(): Rules[];
|
|
15
16
|
private checkHolderMatch;
|
|
16
|
-
|
|
17
|
+
getWalletPassEvaluator(): import("../..").WalletPassEvaluator | undefined;
|
|
18
|
+
isDiscountListAvailable({ oldDiscountList, newDiscountList, productList, orderTotalAmount, holders, isFormSubject, }: {
|
|
17
19
|
oldDiscountList: Discount[];
|
|
18
20
|
newDiscountList: Discount[];
|
|
19
21
|
productList: any[];
|
|
20
22
|
holders: {
|
|
21
23
|
form_record_id: number;
|
|
22
24
|
}[];
|
|
25
|
+
orderTotalAmount: number;
|
|
23
26
|
isFormSubject: boolean;
|
|
24
27
|
}): {
|
|
25
28
|
isAvailable: boolean;
|
|
@@ -29,17 +32,18 @@ export declare class RulesModule extends BaseModule implements Module, RulesModu
|
|
|
29
32
|
};
|
|
30
33
|
filterDiscountListByType(discountList: Discount[], type: string): Discount[];
|
|
31
34
|
private getUnavailableReason;
|
|
32
|
-
calcDiscount({ discountList, productList, holders, isFormSubject, }: {
|
|
35
|
+
calcDiscount({ discountList, productList, holders, isFormSubject, orderTotalAmount }: {
|
|
33
36
|
discountList: Discount[];
|
|
34
37
|
productList: any[];
|
|
35
38
|
holders: {
|
|
36
39
|
form_record_id: number;
|
|
37
40
|
}[];
|
|
38
41
|
isFormSubject: boolean;
|
|
42
|
+
orderTotalAmount: number;
|
|
39
43
|
}, options?: {
|
|
40
44
|
isSelected?: boolean;
|
|
41
45
|
discountId?: number;
|
|
42
|
-
selectedList?:
|
|
46
|
+
selectedList?: any[];
|
|
43
47
|
scan?: boolean;
|
|
44
48
|
}): DiscountResult;
|
|
45
49
|
/**
|