@pisell/pisellos 2.1.150 → 2.1.151
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 -0
- package/dist/index.js +1 -0
- package/dist/model/strategy/adapter/promotion/evaluator.js +99 -26
- 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/Discount/index.d.ts +2 -6
- package/dist/modules/Discount/index.js +8 -14
- package/dist/modules/Discount/types.d.ts +19 -1
- package/dist/modules/Order/index.d.ts +1 -65
- package/dist/modules/Order/index.js +30 -901
- package/dist/modules/Order/types.d.ts +12 -174
- 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 +1 -1
- package/dist/modules/ProductList/index.js +3 -4
- package/dist/modules/Rules/index.d.ts +9 -5
- package/dist/modules/Rules/index.js +677 -168
- package/dist/modules/Rules/types.d.ts +2 -0
- package/dist/modules/Schedule/getDateIsInSchedule.js +18 -11
- 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 +52 -41
- 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 -2
- package/dist/solution/ShopDiscount/index.js +41 -37
- 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 -0
- package/lib/index.js +3 -1
- package/lib/model/strategy/adapter/promotion/evaluator.js +57 -8
- package/lib/model/strategy/adapter/promotion/index.js +49 -0
- 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/Discount/index.d.ts +2 -6
- package/lib/modules/Discount/index.js +1 -3
- package/lib/modules/Discount/types.d.ts +19 -1
- package/lib/modules/Order/index.d.ts +1 -65
- package/lib/modules/Order/index.js +1 -513
- package/lib/modules/Order/types.d.ts +12 -174
- 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 +1 -1
- package/lib/modules/ProductList/index.js +3 -5
- package/lib/modules/Rules/index.d.ts +9 -5
- package/lib/modules/Rules/index.js +780 -288
- package/lib/modules/Rules/types.d.ts +2 -0
- package/lib/modules/Schedule/getDateIsInSchedule.js +11 -9
- 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 +31 -22
- 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 -2
- package/lib/solution/ShopDiscount/index.js +24 -16
- 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 +1 -1
- package/dist/apis/picoding.d.ts +0 -0
- package/dist/apis/picoding.js +0 -1
- 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 -152
- package/dist/solution/ScanOrder/index.js +0 -3132
- package/dist/solution/ScanOrder/types.d.ts +0 -287
- package/dist/solution/ScanOrder/types.js +0 -35
- package/dist/solution/ScanOrder/utils.d.ts +0 -167
- package/dist/solution/ScanOrder/utils.js +0 -764
- package/dist/solution/VenueBooking/index.d.ts +0 -199
- package/dist/solution/VenueBooking/index.js +0 -3459
- package/dist/solution/VenueBooking/sales-section-4-annotated.json +0 -343
- package/dist/solution/VenueBooking/types.d.ts +0 -154
- package/dist/solution/VenueBooking/types.js +0 -21
- package/dist/solution/VenueBooking/utils/dateSummary.d.ts +0 -11
- package/dist/solution/VenueBooking/utils/dateSummary.js +0 -104
- 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 -38
- package/dist/solution/VenueBooking/utils/slotMerge.js +0 -239
- package/dist/solution/VenueBooking/utils/timeSlot.d.ts +0 -32
- package/dist/solution/VenueBooking/utils/timeSlot.js +0 -453
- 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/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 -152
- package/lib/solution/ScanOrder/index.js +0 -1901
- package/lib/solution/ScanOrder/types.d.ts +0 -287
- package/lib/solution/ScanOrder/types.js +0 -36
- package/lib/solution/ScanOrder/utils.d.ts +0 -167
- package/lib/solution/ScanOrder/utils.js +0 -635
- package/lib/solution/VenueBooking/index.d.ts +0 -199
- package/lib/solution/VenueBooking/index.js +0 -1926
- package/lib/solution/VenueBooking/sales-section-4-annotated.json +0 -343
- package/lib/solution/VenueBooking/types.d.ts +0 -154
- package/lib/solution/VenueBooking/types.js +0 -44
- package/lib/solution/VenueBooking/utils/dateSummary.d.ts +0 -11
- package/lib/solution/VenueBooking/utils/dateSummary.js +0 -110
- 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 -38
- package/lib/solution/VenueBooking/utils/slotMerge.js +0 -237
- package/lib/solution/VenueBooking/utils/timeSlot.d.ts +0 -32
- package/lib/solution/VenueBooking/utils/timeSlot.js +0 -339
- 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;
|
|
@@ -16,10 +16,10 @@ export declare class ProductList extends BaseModule implements Module {
|
|
|
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
25
|
}): Promise<any>;
|
|
@@ -61,7 +61,7 @@ var ProductList = class extends import_BaseModule.BaseModule {
|
|
|
61
61
|
cacheId,
|
|
62
62
|
with_schedule
|
|
63
63
|
}) {
|
|
64
|
-
var _a;
|
|
64
|
+
var _a, _b;
|
|
65
65
|
let userPlugin = this.core.getPlugin("user");
|
|
66
66
|
let customer_id = void 0;
|
|
67
67
|
try {
|
|
@@ -95,14 +95,12 @@ var ProductList = class extends import_BaseModule.BaseModule {
|
|
|
95
95
|
with_count,
|
|
96
96
|
// client_schedule_ids: schedule_ids,
|
|
97
97
|
schedule_date,
|
|
98
|
-
|
|
99
|
-
application_code: "online-store",
|
|
98
|
+
application_code: (_b = this.otherParams) == null ? void 0 : _b.channel,
|
|
100
99
|
with_schedule,
|
|
101
100
|
schedule_datetime,
|
|
102
101
|
is_eject: 1
|
|
103
102
|
},
|
|
104
|
-
{ useCache: true
|
|
105
|
-
} }
|
|
103
|
+
{ useCache: true }
|
|
106
104
|
);
|
|
107
105
|
const sortedList = (productsData.data.list || []).slice().sort((a, b) => Number(b.sort) - Number(a.sort));
|
|
108
106
|
this.addProduct(sortedList);
|
|
@@ -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
|
/**
|