@pisell/pisellos 2.2.243 → 2.2.244
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/evaluator.js +2 -3
- package/dist/model/strategy/adapter/promotion/index.js +9 -0
- package/dist/model/strategy/adapter/walletPass/utils.js +4 -7
- package/dist/modules/Cart/utils/cartProduct.js +3 -24
- package/dist/modules/Cart/utils/changePrice.js +11 -11
- package/dist/modules/Customer/index.d.ts +0 -20
- package/dist/modules/Customer/index.js +83 -172
- package/dist/modules/Customer/types.d.ts +0 -2
- package/dist/modules/Discount/index.js +3 -4
- package/dist/modules/Discount/types.d.ts +0 -1
- package/dist/modules/OpenData/index.d.ts +0 -8
- package/dist/modules/OpenData/index.js +17 -37
- package/dist/modules/Order/index.d.ts +18 -268
- package/dist/modules/Order/index.js +757 -3306
- package/dist/modules/Order/types.d.ts +31 -279
- package/dist/modules/Order/types.js +0 -38
- package/dist/modules/Order/utils.d.ts +5 -147
- package/dist/modules/Order/utils.js +103 -746
- package/dist/modules/Payment/index.d.ts +13 -10
- package/dist/modules/Payment/index.js +837 -467
- package/dist/modules/Payment/types.d.ts +0 -2
- package/dist/modules/Payment/utils.js +1 -2
- package/dist/modules/Payment/walletpass.js +7 -14
- package/dist/modules/ProductList/index.d.ts +12 -16
- package/dist/modules/ProductList/index.js +59 -133
- package/dist/modules/ProductList/types.d.ts +0 -14
- package/dist/modules/Quotation/index.d.ts +1 -0
- package/dist/modules/Quotation/index.js +22 -25
- package/dist/modules/Rules/index.d.ts +0 -4
- package/dist/modules/Rules/index.js +69 -93
- package/dist/modules/Rules/types.d.ts +0 -1
- package/dist/modules/SalesSummary/index.d.ts +25 -8
- package/dist/modules/SalesSummary/index.js +35 -86
- package/dist/modules/SalesSummary/types.d.ts +1 -4
- package/dist/modules/SalesSummary/utils.d.ts +25 -2
- package/dist/modules/SalesSummary/utils.js +162 -794
- package/dist/modules/Schedule/index.d.ts +0 -7
- package/dist/modules/Schedule/index.js +2 -24
- package/dist/modules/Summary/index.js +3 -4
- package/dist/modules/index.d.ts +0 -2
- package/dist/modules/index.js +1 -3
- package/dist/plugins/request.d.ts +0 -1
- package/dist/server/index.d.ts +1 -204
- package/dist/server/index.js +928 -3658
- package/dist/server/modules/index.d.ts +0 -2
- package/dist/server/modules/index.js +0 -2
- package/dist/server/modules/order/index.d.ts +4 -120
- package/dist/server/modules/order/index.js +483 -1779
- package/dist/server/modules/order/types.d.ts +3 -32
- package/dist/server/modules/order/types.js +0 -8
- package/dist/server/modules/order/utils/filterBookings.js +3 -26
- package/dist/server/modules/order/utils/filterOrders.js +8 -23
- package/dist/server/modules/products/index.d.ts +7 -34
- package/dist/server/modules/products/index.js +317 -631
- package/dist/server/modules/resource/index.d.ts +0 -2
- package/dist/server/modules/resource/index.js +3 -29
- package/dist/server/modules/schedule/index.d.ts +4 -4
- package/dist/server/modules/schedule/index.js +88 -111
- package/dist/solution/BaseSales/index.d.ts +9 -131
- package/dist/solution/BaseSales/index.js +447 -1944
- package/dist/solution/BaseSales/types.d.ts +6 -76
- package/dist/solution/BaseSales/types.js +4 -5
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +0 -1
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +24 -105
- package/dist/solution/BaseSales/utils.d.ts +1 -1
- package/dist/solution/BaseSales/utils.js +21 -62
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.d.ts +10 -270
- package/dist/solution/BookingTicket/index.js +237 -1772
- package/dist/solution/BookingTicket/types.d.ts +1 -118
- package/dist/solution/BookingTicket/types.js +2 -41
- package/dist/solution/BookingTicket/utils/bookingStatus.d.ts +0 -40
- package/dist/solution/BookingTicket/utils/bookingStatus.js +0 -70
- package/dist/solution/BookingTicket/utils/cartView.d.ts +1 -9
- package/dist/solution/BookingTicket/utils/cartView.js +7 -94
- package/dist/solution/BookingTicket/utils/scan/index.d.ts +0 -5
- package/dist/solution/BookingTicket/utils/scan/index.js +8 -20
- package/dist/solution/Checkout/appointmentDemo.json +1 -0
- package/dist/solution/Checkout/index.d.ts +0 -1
- package/dist/solution/Checkout/index.js +9 -10
- package/dist/solution/RegisterAndLogin/config.js +10 -2
- package/dist/solution/ScanOrder/index.d.ts +3 -9
- package/dist/solution/ScanOrder/index.js +134 -241
- package/dist/solution/ScanOrder/types.d.ts +5 -9
- package/dist/solution/ScanOrder/types.js +3 -2
- package/dist/solution/ScanOrder/utils.d.ts +1 -1
- package/dist/solution/ScanOrder/utils.js +22 -84
- package/dist/solution/VenueBooking/index.d.ts +2 -5
- package/dist/solution/VenueBooking/index.js +59 -110
- package/dist/solution/VenueBooking/sales-section-4-annotated.json +2 -0
- package/dist/solution/VenueBooking/utils/slotMerge.d.ts +0 -4
- package/dist/solution/VenueBooking/utils/slotMerge.js +0 -10
- package/dist/types/index.d.ts +0 -10
- package/lib/model/strategy/adapter/promotion/evaluator.js +1 -2
- package/lib/model/strategy/adapter/promotion/index.js +0 -49
- package/lib/model/strategy/adapter/walletPass/utils.js +2 -3
- package/lib/modules/Cart/utils/cartProduct.js +3 -20
- package/lib/modules/Cart/utils/changePrice.js +20 -12
- package/lib/modules/Customer/index.d.ts +0 -20
- package/lib/modules/Customer/index.js +11 -64
- package/lib/modules/Customer/types.d.ts +0 -2
- package/lib/modules/Discount/index.js +1 -5
- package/lib/modules/Discount/types.d.ts +0 -1
- package/lib/modules/OpenData/index.d.ts +0 -8
- package/lib/modules/OpenData/index.js +5 -19
- package/lib/modules/Order/index.d.ts +18 -268
- package/lib/modules/Order/index.js +344 -2149
- package/lib/modules/Order/types.d.ts +31 -279
- package/lib/modules/Order/types.js +0 -1
- package/lib/modules/Order/utils.d.ts +5 -147
- package/lib/modules/Order/utils.js +46 -614
- package/lib/modules/Payment/index.d.ts +13 -10
- package/lib/modules/Payment/index.js +150 -18
- package/lib/modules/Payment/types.d.ts +0 -2
- package/lib/modules/Payment/utils.js +1 -2
- package/lib/modules/Payment/walletpass.js +3 -7
- package/lib/modules/ProductList/index.d.ts +12 -16
- package/lib/modules/ProductList/index.js +4 -41
- package/lib/modules/ProductList/types.d.ts +0 -14
- package/lib/modules/Quotation/index.d.ts +1 -0
- package/lib/modules/Quotation/index.js +16 -19
- package/lib/modules/Rules/index.d.ts +0 -4
- package/lib/modules/Rules/index.js +120 -136
- package/lib/modules/Rules/types.d.ts +0 -1
- package/lib/modules/SalesSummary/index.d.ts +25 -8
- package/lib/modules/SalesSummary/index.js +4 -30
- package/lib/modules/SalesSummary/types.d.ts +1 -4
- package/lib/modules/SalesSummary/utils.d.ts +25 -2
- package/lib/modules/SalesSummary/utils.js +91 -645
- package/lib/modules/Schedule/index.d.ts +0 -7
- package/lib/modules/Schedule/index.js +1 -17
- package/lib/modules/Summary/index.js +4 -5
- package/lib/modules/index.d.ts +0 -2
- package/lib/modules/index.js +1 -5
- package/lib/plugins/request.d.ts +0 -1
- package/lib/server/index.d.ts +1 -204
- package/lib/server/index.js +57 -1888
- package/lib/server/modules/index.d.ts +0 -2
- package/lib/server/modules/index.js +0 -3
- package/lib/server/modules/order/index.d.ts +4 -120
- package/lib/server/modules/order/index.js +142 -919
- package/lib/server/modules/order/types.d.ts +3 -32
- package/lib/server/modules/order/utils/filterBookings.js +5 -24
- package/lib/server/modules/order/utils/filterOrders.js +6 -15
- package/lib/server/modules/products/index.d.ts +7 -34
- package/lib/server/modules/products/index.js +54 -189
- package/lib/server/modules/resource/index.d.ts +0 -2
- package/lib/server/modules/resource/index.js +3 -27
- package/lib/server/modules/schedule/index.d.ts +4 -4
- package/lib/server/modules/schedule/index.js +40 -47
- package/lib/solution/BaseSales/index.d.ts +9 -131
- package/lib/solution/BaseSales/index.js +63 -1106
- package/lib/solution/BaseSales/types.d.ts +6 -76
- package/lib/solution/BaseSales/types.js +1 -3
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +0 -1
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +18 -106
- package/lib/solution/BaseSales/utils.d.ts +1 -1
- package/lib/solution/BaseSales/utils.js +10 -54
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.d.ts +10 -270
- package/lib/solution/BookingTicket/index.js +29 -922
- package/lib/solution/BookingTicket/types.d.ts +1 -118
- package/lib/solution/BookingTicket/types.js +0 -11
- package/lib/solution/BookingTicket/utils/bookingStatus.d.ts +0 -40
- package/lib/solution/BookingTicket/utils/bookingStatus.js +2 -44
- package/lib/solution/BookingTicket/utils/cartView.d.ts +1 -9
- package/lib/solution/BookingTicket/utils/cartView.js +6 -61
- package/lib/solution/BookingTicket/utils/scan/index.d.ts +0 -5
- package/lib/solution/BookingTicket/utils/scan/index.js +3 -17
- package/lib/solution/Checkout/appointmentDemo.json +1 -0
- package/lib/solution/Checkout/index.d.ts +0 -1
- package/lib/solution/Checkout/index.js +2 -1
- package/lib/solution/RegisterAndLogin/config.js +10 -2
- package/lib/solution/ScanOrder/index.d.ts +3 -9
- package/lib/solution/ScanOrder/index.js +70 -153
- package/lib/solution/ScanOrder/types.d.ts +5 -9
- package/lib/solution/ScanOrder/utils.d.ts +1 -1
- package/lib/solution/ScanOrder/utils.js +17 -83
- package/lib/solution/VenueBooking/index.d.ts +2 -5
- package/lib/solution/VenueBooking/index.js +17 -54
- package/lib/solution/VenueBooking/sales-section-4-annotated.json +2 -0
- package/lib/solution/VenueBooking/utils/slotMerge.d.ts +0 -4
- package/lib/solution/VenueBooking/utils/slotMerge.js +0 -10
- package/lib/types/index.d.ts +0 -10
- package/package.json +1 -1
- package/dist/modules/BookingContext/index.d.ts +0 -48
- package/dist/modules/BookingContext/index.js +0 -566
- package/dist/modules/BookingContext/types.d.ts +0 -102
- package/dist/modules/BookingContext/types.js +0 -51
- package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +0 -16
- package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +0 -284
- package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +0 -8
- package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +0 -145
- package/dist/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +0 -76
- package/dist/modules/BookingContext/utils/cacheItemToBookingInput.js +0 -218
- package/dist/modules/BookingContext/utils/flexible.d.ts +0 -28
- package/dist/modules/BookingContext/utils/flexible.js +0 -56
- package/dist/modules/BookingContext/utils/formatResourceList.d.ts +0 -8
- package/dist/modules/BookingContext/utils/formatResourceList.js +0 -38
- package/dist/modules/BookingContext/utils/index.d.ts +0 -11
- package/dist/modules/BookingContext/utils/index.js +0 -11
- package/dist/modules/BookingContext/utils/noResource.d.ts +0 -13
- package/dist/modules/BookingContext/utils/noResource.js +0 -77
- package/dist/modules/BookingContext/utils/orderLineDisplay.d.ts +0 -1
- package/dist/modules/BookingContext/utils/orderLineDisplay.js +0 -36
- package/dist/modules/BookingContext/utils/productExtend.d.ts +0 -72
- package/dist/modules/BookingContext/utils/productExtend.js +0 -339
- package/dist/modules/BookingContext/utils/resourceErrors.d.ts +0 -41
- package/dist/modules/BookingContext/utils/resourceErrors.js +0 -74
- package/dist/modules/BookingContext/utils/resourceSelection.d.ts +0 -7
- package/dist/modules/BookingContext/utils/resourceSelection.js +0 -24
- package/dist/modules/BookingContext/utils/resources.d.ts +0 -80
- package/dist/modules/BookingContext/utils/resources.js +0 -486
- package/dist/modules/BookingContext/utils/serviceTimes.d.ts +0 -55
- package/dist/modules/BookingContext/utils/serviceTimes.js +0 -151
- package/dist/modules/BookingContext/utils/timeSlices.d.ts +0 -42
- package/dist/modules/BookingContext/utils/timeSlices.js +0 -100
- package/dist/modules/Order/utils/manualProductDiscount.d.ts +0 -106
- package/dist/modules/Order/utils/manualProductDiscount.js +0 -210
- package/dist/modules/SurchargeList/index.d.ts +0 -16
- package/dist/modules/SurchargeList/index.js +0 -162
- package/dist/modules/SurchargeList/types.d.ts +0 -11
- package/dist/modules/SurchargeList/types.js +0 -1
- package/dist/server/modules/payment/index.d.ts +0 -28
- package/dist/server/modules/payment/index.js +0 -305
- package/dist/server/modules/payment/types.d.ts +0 -9
- package/dist/server/modules/payment/types.js +0 -1
- package/dist/server/test.json +0 -713
- package/dist/server/utils/small-ticket.d.ts +0 -71
- package/dist/server/utils/small-ticket.js +0 -830
- package/dist/solution/BaseSales/utils/cartPromotion.d.ts +0 -287
- package/dist/solution/BaseSales/utils/cartPromotion.js +0 -1438
- package/dist/solution/BaseSales/utils/quotationPrice.d.ts +0 -7
- package/dist/solution/BaseSales/utils/quotationPrice.js +0 -237
- package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +0 -117
- package/dist/solution/BookingTicket/utils/addProductDecision.js +0 -346
- package/dist/solution/BookingTicket/utils/addTimeAvailability.d.ts +0 -35
- package/dist/solution/BookingTicket/utils/addTimeAvailability.js +0 -95
- package/dist/solution/BookingTicket/utils/exampleData.d.ts +0 -123
- package/dist/solution/BookingTicket/utils/exampleData.js +0 -183
- package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +0 -185
- package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.js +0 -438
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +0 -36
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +0 -399
- package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +0 -32
- package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.js +0 -56
- package/dist/solution/BookingTicket/utils/scan/scanProductValues.d.ts +0 -21
- package/dist/solution/BookingTicket/utils/scan/scanProductValues.js +0 -150
- package/dist/solution/BookingTicket/utils/sessionCatalogStale.d.ts +0 -23
- package/dist/solution/BookingTicket/utils/sessionCatalogStale.js +0 -78
- package/lib/modules/BookingContext/index.d.ts +0 -48
- package/lib/modules/BookingContext/index.js +0 -368
- package/lib/modules/BookingContext/types.d.ts +0 -102
- package/lib/modules/BookingContext/types.js +0 -34
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +0 -16
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +0 -276
- package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +0 -8
- package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +0 -151
- package/lib/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +0 -76
- package/lib/modules/BookingContext/utils/cacheItemToBookingInput.js +0 -201
- package/lib/modules/BookingContext/utils/flexible.d.ts +0 -28
- package/lib/modules/BookingContext/utils/flexible.js +0 -80
- package/lib/modules/BookingContext/utils/formatResourceList.d.ts +0 -8
- package/lib/modules/BookingContext/utils/formatResourceList.js +0 -50
- package/lib/modules/BookingContext/utils/index.d.ts +0 -11
- package/lib/modules/BookingContext/utils/index.js +0 -43
- package/lib/modules/BookingContext/utils/noResource.d.ts +0 -13
- package/lib/modules/BookingContext/utils/noResource.js +0 -90
- package/lib/modules/BookingContext/utils/orderLineDisplay.d.ts +0 -1
- package/lib/modules/BookingContext/utils/orderLineDisplay.js +0 -56
- package/lib/modules/BookingContext/utils/productExtend.d.ts +0 -72
- package/lib/modules/BookingContext/utils/productExtend.js +0 -283
- package/lib/modules/BookingContext/utils/resourceErrors.d.ts +0 -41
- package/lib/modules/BookingContext/utils/resourceErrors.js +0 -80
- package/lib/modules/BookingContext/utils/resourceSelection.d.ts +0 -7
- package/lib/modules/BookingContext/utils/resourceSelection.js +0 -46
- package/lib/modules/BookingContext/utils/resources.d.ts +0 -80
- package/lib/modules/BookingContext/utils/resources.js +0 -377
- package/lib/modules/BookingContext/utils/serviceTimes.d.ts +0 -55
- package/lib/modules/BookingContext/utils/serviceTimes.js +0 -162
- package/lib/modules/BookingContext/utils/timeSlices.d.ts +0 -42
- package/lib/modules/BookingContext/utils/timeSlices.js +0 -124
- package/lib/modules/Order/utils/manualProductDiscount.d.ts +0 -106
- package/lib/modules/Order/utils/manualProductDiscount.js +0 -206
- package/lib/modules/SurchargeList/index.d.ts +0 -16
- package/lib/modules/SurchargeList/index.js +0 -89
- package/lib/modules/SurchargeList/types.d.ts +0 -11
- package/lib/modules/SurchargeList/types.js +0 -17
- package/lib/server/modules/payment/index.d.ts +0 -28
- package/lib/server/modules/payment/index.js +0 -192
- package/lib/server/modules/payment/types.d.ts +0 -9
- package/lib/server/modules/payment/types.js +0 -17
- package/lib/server/test.json +0 -713
- package/lib/server/utils/small-ticket.d.ts +0 -71
- package/lib/server/utils/small-ticket.js +0 -781
- package/lib/solution/BaseSales/utils/cartPromotion.d.ts +0 -287
- package/lib/solution/BaseSales/utils/cartPromotion.js +0 -992
- package/lib/solution/BaseSales/utils/quotationPrice.d.ts +0 -7
- package/lib/solution/BaseSales/utils/quotationPrice.js +0 -277
- package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +0 -117
- package/lib/solution/BookingTicket/utils/addProductDecision.js +0 -318
- package/lib/solution/BookingTicket/utils/addTimeAvailability.d.ts +0 -35
- package/lib/solution/BookingTicket/utils/addTimeAvailability.js +0 -125
- package/lib/solution/BookingTicket/utils/exampleData.d.ts +0 -123
- package/lib/solution/BookingTicket/utils/exampleData.js +0 -0
- package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +0 -185
- package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.js +0 -254
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +0 -36
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +0 -168
- package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +0 -32
- package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.js +0 -51
- package/lib/solution/BookingTicket/utils/scan/scanProductValues.d.ts +0 -21
- package/lib/solution/BookingTicket/utils/scan/scanProductValues.js +0 -127
- package/lib/solution/BookingTicket/utils/sessionCatalogStale.d.ts +0 -23
- package/lib/solution/BookingTicket/utils/sessionCatalogStale.js +0 -85
|
@@ -135,8 +135,6 @@ export interface PaymentItem {
|
|
|
135
135
|
origin_amount?: string;
|
|
136
136
|
/** 订单支付类型 */
|
|
137
137
|
order_payment_type?: 'normal' | 'deposit';
|
|
138
|
-
/** 支付时间 (格式: YYYY-MM-DD HH:mm:ss) */
|
|
139
|
-
payment_time?: string;
|
|
140
138
|
/** 本支付项是否已成功同步到后端 */
|
|
141
139
|
isSynced?: boolean;
|
|
142
140
|
/** 最近一次同步失败信息(存在则代表同步失败过) */
|
|
@@ -11,7 +11,7 @@ export var getAvailableMaxAmount = function getAvailableMaxAmount(data) {
|
|
|
11
11
|
* @param list
|
|
12
12
|
*/
|
|
13
13
|
export var formatWalletPassList2PreparePayments = function formatWalletPassList2PreparePayments(list) {
|
|
14
|
-
|
|
14
|
+
return (list || []).map(function (item) {
|
|
15
15
|
return {
|
|
16
16
|
voucher_id: item.id || 0,
|
|
17
17
|
amount: Number(item.edit_current_amount || getAvailableMaxAmount(item)) || 0,
|
|
@@ -20,7 +20,6 @@ export var formatWalletPassList2PreparePayments = function formatWalletPassList2
|
|
|
20
20
|
wallet_pass_use_value: item.wallet_pass_use_value || undefined
|
|
21
21
|
};
|
|
22
22
|
});
|
|
23
|
-
return formatted;
|
|
24
23
|
};
|
|
25
24
|
|
|
26
25
|
/**
|
|
@@ -416,19 +416,12 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
|
|
|
416
416
|
key: "getUserIdentificationCodeListAsync",
|
|
417
417
|
value: function () {
|
|
418
418
|
var _getUserIdentificationCodeListAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(params) {
|
|
419
|
-
var _newParams$
|
|
419
|
+
var _newParams$prepare_pa, _this$walletParams2, newParams, response, sortedData;
|
|
420
420
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
421
421
|
while (1) switch (_context5.prev = _context5.next) {
|
|
422
422
|
case 0:
|
|
423
423
|
_context5.prev = 0;
|
|
424
424
|
newParams = _objectSpread(_objectSpread({}, this.walletParams), params);
|
|
425
|
-
if ((_newParams$products = newParams.products) !== null && _newParams$products !== void 0 && _newParams$products.length) {
|
|
426
|
-
_context5.next = 5;
|
|
427
|
-
break;
|
|
428
|
-
}
|
|
429
|
-
this.paymentModule.logInfo('[WalletPass] 商品列表为空,跳过获取用户识别码列表');
|
|
430
|
-
return _context5.abrupt("return", []);
|
|
431
|
-
case 5:
|
|
432
425
|
this.paymentModule.logInfo('[WalletPass] 开始获取用户识别码列表', {
|
|
433
426
|
customer_id: newParams.customer_id,
|
|
434
427
|
available: newParams.available,
|
|
@@ -436,9 +429,9 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
|
|
|
436
429
|
filter_prepare_wallet_pass: newParams.filter_prepare_wallet_pass,
|
|
437
430
|
payment_order_id: (_this$walletParams2 = this.walletParams) === null || _this$walletParams2 === void 0 ? void 0 : _this$walletParams2.payment_order_id
|
|
438
431
|
});
|
|
439
|
-
_context5.next =
|
|
432
|
+
_context5.next = 5;
|
|
440
433
|
return this.paymentModule.request.post('/machinecode/prepare/deduction', newParams);
|
|
441
|
-
case
|
|
434
|
+
case 5:
|
|
442
435
|
response = _context5.sent;
|
|
443
436
|
// 对获取到的数据进行排序,将错误码为 500100、500200、500300 的项目排到最后
|
|
444
437
|
sortedData = sortUserIdentificationCodeList((response === null || response === void 0 ? void 0 : response.data) || []);
|
|
@@ -459,19 +452,19 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
|
|
|
459
452
|
})
|
|
460
453
|
});
|
|
461
454
|
return _context5.abrupt("return", this.userIdentificationCodes);
|
|
462
|
-
case
|
|
463
|
-
_context5.prev =
|
|
455
|
+
case 13:
|
|
456
|
+
_context5.prev = 13;
|
|
464
457
|
_context5.t0 = _context5["catch"](0);
|
|
465
458
|
this.paymentModule.logError('[WalletPass] 获取用户识别码列表失败', _context5.t0, {
|
|
466
459
|
customer_id: params.customer_id,
|
|
467
460
|
available: params.available
|
|
468
461
|
});
|
|
469
462
|
return _context5.abrupt("return", []);
|
|
470
|
-
case
|
|
463
|
+
case 17:
|
|
471
464
|
case "end":
|
|
472
465
|
return _context5.stop();
|
|
473
466
|
}
|
|
474
|
-
}, _callee5, this, [[0,
|
|
467
|
+
}, _callee5, this, [[0, 13]]);
|
|
475
468
|
}));
|
|
476
469
|
function getUserIdentificationCodeListAsync(_x5) {
|
|
477
470
|
return _getUserIdentificationCodeListAsync.apply(this, arguments);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Module, PisellCore } from '../../types';
|
|
2
2
|
import { BaseModule } from '../BaseModule';
|
|
3
|
-
import { ProductListLoadProductsParams } from './types';
|
|
4
3
|
import { ProductData } from '../Product/types';
|
|
5
4
|
export * from './types';
|
|
6
5
|
export declare class ProductList extends BaseModule implements Module {
|
|
@@ -11,22 +10,19 @@ export declare class ProductList extends BaseModule implements Module {
|
|
|
11
10
|
private otherParams;
|
|
12
11
|
constructor(name?: string, version?: string);
|
|
13
12
|
initialize(core: PisellCore, options: any): Promise<void>;
|
|
14
|
-
/**
|
|
15
|
-
* 更新运行态参数,供父级解决方案 setOtherParams 后同步查询上下文。
|
|
16
|
-
*
|
|
17
|
-
* @example
|
|
18
|
-
* productList.updateOtherParams({ channel: 'pos' });
|
|
19
|
-
*/
|
|
20
|
-
updateOtherParams(params: Record<string, any>): void;
|
|
21
13
|
storeChange(path?: string, value?: any): Promise<void>;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
14
|
+
loadProducts({ category_ids, product_ids, collection, menu_list_ids, customer_id: paramsCustomerId, with_count, schedule_datetime, schedule_date, cacheId, with_schedule, }: {
|
|
15
|
+
category_ids?: number[];
|
|
16
|
+
product_ids?: number[];
|
|
17
|
+
collection?: number | string[];
|
|
18
|
+
schedule_date?: string;
|
|
19
|
+
cacheId?: string;
|
|
20
|
+
customer_id?: number;
|
|
21
|
+
menu_list_ids?: number[];
|
|
22
|
+
schedule_datetime?: string;
|
|
23
|
+
with_count?: string[];
|
|
24
|
+
with_schedule?: number;
|
|
25
|
+
}, options?: {
|
|
30
26
|
callback?: (result: any) => void;
|
|
31
27
|
subscriberId?: string;
|
|
32
28
|
}): Promise<any>;
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
2
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
5
3
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
6
4
|
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
@@ -19,7 +17,6 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
|
|
|
19
17
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
20
18
|
import { BaseModule } from "../BaseModule";
|
|
21
19
|
import { cloneDeep } from 'lodash-es';
|
|
22
|
-
import dayjs from 'dayjs';
|
|
23
20
|
export * from "./types";
|
|
24
21
|
export var ProductList = /*#__PURE__*/function (_BaseModule) {
|
|
25
22
|
_inherits(ProductList, _BaseModule);
|
|
@@ -67,17 +64,6 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
|
|
|
67
64
|
}
|
|
68
65
|
return initialize;
|
|
69
66
|
}()
|
|
70
|
-
/**
|
|
71
|
-
* 更新运行态参数,供父级解决方案 setOtherParams 后同步查询上下文。
|
|
72
|
-
*
|
|
73
|
-
* @example
|
|
74
|
-
* productList.updateOtherParams({ channel: 'pos' });
|
|
75
|
-
*/
|
|
76
|
-
}, {
|
|
77
|
-
key: "updateOtherParams",
|
|
78
|
-
value: function updateOtherParams(params) {
|
|
79
|
-
this.otherParams = params || {};
|
|
80
|
-
}
|
|
81
67
|
}, {
|
|
82
68
|
key: "storeChange",
|
|
83
69
|
value: function () {
|
|
@@ -95,75 +81,16 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
|
|
|
95
81
|
}
|
|
96
82
|
return storeChange;
|
|
97
83
|
}()
|
|
98
|
-
/**
|
|
99
|
-
* 获取加时商品列表。
|
|
100
|
-
*
|
|
101
|
-
* @example
|
|
102
|
-
* const products = await productList.getAddTimeProducts({ schedule_date: '2026-06-16' });
|
|
103
|
-
*/
|
|
104
|
-
}, {
|
|
105
|
-
key: "getAddTimeProducts",
|
|
106
|
-
value: (function () {
|
|
107
|
-
var _getAddTimeProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
108
|
-
var params,
|
|
109
|
-
_args3 = arguments;
|
|
110
|
-
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
111
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
112
|
-
case 0:
|
|
113
|
-
params = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : {};
|
|
114
|
-
return _context3.abrupt("return", this.loadProducts(_objectSpread(_objectSpread({
|
|
115
|
-
schedule_date: dayjs().format('YYYY-MM-DD'),
|
|
116
|
-
status: 'published'
|
|
117
|
-
}, params), {}, {
|
|
118
|
-
extension_type: ['product_add_time']
|
|
119
|
-
})));
|
|
120
|
-
case 2:
|
|
121
|
-
case "end":
|
|
122
|
-
return _context3.stop();
|
|
123
|
-
}
|
|
124
|
-
}, _callee3, this);
|
|
125
|
-
}));
|
|
126
|
-
function getAddTimeProducts() {
|
|
127
|
-
return _getAddTimeProducts.apply(this, arguments);
|
|
128
|
-
}
|
|
129
|
-
return getAddTimeProducts;
|
|
130
|
-
}())
|
|
131
84
|
}, {
|
|
132
85
|
key: "loadProducts",
|
|
133
86
|
value: function () {
|
|
134
|
-
var _loadProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
87
|
+
var _loadProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(_ref, options) {
|
|
135
88
|
var _this$otherParams;
|
|
136
|
-
var _ref,
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
_ref$product_ids,
|
|
140
|
-
product_ids,
|
|
141
|
-
_ref$collection,
|
|
142
|
-
collection,
|
|
143
|
-
_ref$menu_list_ids,
|
|
144
|
-
menu_list_ids,
|
|
145
|
-
paramsCustomerId,
|
|
146
|
-
_ref$with_count,
|
|
147
|
-
with_count,
|
|
148
|
-
schedule_datetime,
|
|
149
|
-
schedule_date,
|
|
150
|
-
cacheId,
|
|
151
|
-
with_schedule,
|
|
152
|
-
extension_type,
|
|
153
|
-
_ref$status,
|
|
154
|
-
status,
|
|
155
|
-
options,
|
|
156
|
-
userPlugin,
|
|
157
|
-
customer_id,
|
|
158
|
-
_userPlugin$get,
|
|
159
|
-
productsData,
|
|
160
|
-
sortedList,
|
|
161
|
-
_args4 = arguments;
|
|
162
|
-
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
163
|
-
while (1) switch (_context4.prev = _context4.next) {
|
|
89
|
+
var _ref$category_ids, category_ids, _ref$product_ids, product_ids, _ref$collection, collection, _ref$menu_list_ids, menu_list_ids, paramsCustomerId, _ref$with_count, with_count, schedule_datetime, schedule_date, cacheId, with_schedule, userPlugin, customer_id, _userPlugin$get, productsData, sortedList;
|
|
90
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
91
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
164
92
|
case 0:
|
|
165
|
-
_ref
|
|
166
|
-
options = _args4.length > 1 ? _args4[1] : undefined;
|
|
93
|
+
_ref$category_ids = _ref.category_ids, category_ids = _ref$category_ids === void 0 ? [] : _ref$category_ids, _ref$product_ids = _ref.product_ids, product_ids = _ref$product_ids === void 0 ? [] : _ref$product_ids, _ref$collection = _ref.collection, collection = _ref$collection === void 0 ? [] : _ref$collection, _ref$menu_list_ids = _ref.menu_list_ids, menu_list_ids = _ref$menu_list_ids === void 0 ? [] : _ref$menu_list_ids, paramsCustomerId = _ref.customer_id, _ref$with_count = _ref.with_count, with_count = _ref$with_count === void 0 ? [] : _ref$with_count, schedule_datetime = _ref.schedule_datetime, schedule_date = _ref.schedule_date, cacheId = _ref.cacheId, with_schedule = _ref.with_schedule;
|
|
167
94
|
// // 如果 schedule_ids 为空,则需要尝试从 schedule 模块里获取
|
|
168
95
|
// if (!schedule_ids?.length) {
|
|
169
96
|
// const schedule_ids_data = this.store.schedule
|
|
@@ -184,13 +111,13 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
|
|
|
184
111
|
console.error(error);
|
|
185
112
|
}
|
|
186
113
|
// 如果没传schedule_date,则从
|
|
187
|
-
|
|
114
|
+
_context3.next = 6;
|
|
188
115
|
return this.request.post("/product/query", {
|
|
189
116
|
open_quotation: 1,
|
|
190
117
|
open_bundle: 0,
|
|
191
118
|
exclude_extension_type: ['product_party', 'product_event', 'product_series_event', 'product_package_ticket', 'ticket', 'event_item'],
|
|
192
119
|
with: ['category', 'collection', 'resourceRelation'],
|
|
193
|
-
status:
|
|
120
|
+
status: 'published',
|
|
194
121
|
num: 500,
|
|
195
122
|
skip: 1,
|
|
196
123
|
customer_id: customer_id,
|
|
@@ -205,16 +132,15 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
|
|
|
205
132
|
application_code: (_this$otherParams = this.otherParams) === null || _this$otherParams === void 0 ? void 0 : _this$otherParams.channel,
|
|
206
133
|
is_eject: 1,
|
|
207
134
|
with_schedule: with_schedule,
|
|
208
|
-
schedule_datetime: schedule_datetime
|
|
209
|
-
extension_type: extension_type
|
|
135
|
+
schedule_datetime: schedule_datetime
|
|
210
136
|
}, {
|
|
211
137
|
osServer: true,
|
|
212
138
|
callback: options === null || options === void 0 ? void 0 : options.callback,
|
|
213
139
|
subscriberId: options === null || options === void 0 ? void 0 : options.subscriberId,
|
|
214
140
|
customToast: function customToast() {}
|
|
215
141
|
});
|
|
216
|
-
case
|
|
217
|
-
productsData =
|
|
142
|
+
case 6:
|
|
143
|
+
productsData = _context3.sent;
|
|
218
144
|
sortedList = (productsData.data.list || []).slice().sort(function (a, b) {
|
|
219
145
|
return Number(b.sort) - Number(a.sort);
|
|
220
146
|
}); // if (sortedList.length) {
|
|
@@ -225,14 +151,14 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
|
|
|
225
151
|
// })
|
|
226
152
|
// }
|
|
227
153
|
this.addProduct(sortedList);
|
|
228
|
-
return
|
|
229
|
-
case
|
|
154
|
+
return _context3.abrupt("return", sortedList);
|
|
155
|
+
case 10:
|
|
230
156
|
case "end":
|
|
231
|
-
return
|
|
157
|
+
return _context3.stop();
|
|
232
158
|
}
|
|
233
|
-
},
|
|
159
|
+
}, _callee3, this);
|
|
234
160
|
}));
|
|
235
|
-
function loadProducts() {
|
|
161
|
+
function loadProducts(_x5, _x6) {
|
|
236
162
|
return _loadProducts.apply(this, arguments);
|
|
237
163
|
}
|
|
238
164
|
return loadProducts;
|
|
@@ -240,13 +166,13 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
|
|
|
240
166
|
}, {
|
|
241
167
|
key: "loadProductsPrice",
|
|
242
168
|
value: function () {
|
|
243
|
-
var _loadProductsPrice = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
169
|
+
var _loadProductsPrice = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(_ref2) {
|
|
244
170
|
var _ref2$ids, ids, customer_id, schedule_date, channel, productsData;
|
|
245
|
-
return _regeneratorRuntime().wrap(function
|
|
246
|
-
while (1) switch (
|
|
171
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
172
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
247
173
|
case 0:
|
|
248
174
|
_ref2$ids = _ref2.ids, ids = _ref2$ids === void 0 ? [] : _ref2$ids, customer_id = _ref2.customer_id, schedule_date = _ref2.schedule_date, channel = _ref2.channel;
|
|
249
|
-
|
|
175
|
+
_context4.next = 3;
|
|
250
176
|
return this.request.post("/product/query/price", {
|
|
251
177
|
ids: ids,
|
|
252
178
|
customer_id: customer_id,
|
|
@@ -256,15 +182,15 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
|
|
|
256
182
|
useCache: true
|
|
257
183
|
});
|
|
258
184
|
case 3:
|
|
259
|
-
productsData =
|
|
260
|
-
return
|
|
185
|
+
productsData = _context4.sent;
|
|
186
|
+
return _context4.abrupt("return", productsData.data);
|
|
261
187
|
case 5:
|
|
262
188
|
case "end":
|
|
263
|
-
return
|
|
189
|
+
return _context4.stop();
|
|
264
190
|
}
|
|
265
|
-
},
|
|
191
|
+
}, _callee4, this);
|
|
266
192
|
}));
|
|
267
|
-
function loadProductsPrice(
|
|
193
|
+
function loadProductsPrice(_x7) {
|
|
268
194
|
return _loadProductsPrice.apply(this, arguments);
|
|
269
195
|
}
|
|
270
196
|
return loadProductsPrice;
|
|
@@ -272,19 +198,19 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
|
|
|
272
198
|
}, {
|
|
273
199
|
key: "getProducts",
|
|
274
200
|
value: function () {
|
|
275
|
-
var _getProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
276
|
-
return _regeneratorRuntime().wrap(function
|
|
277
|
-
while (1) switch (
|
|
201
|
+
var _getProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
202
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
203
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
278
204
|
case 0:
|
|
279
|
-
|
|
205
|
+
_context5.next = 2;
|
|
280
206
|
return this.core.effects.emit("".concat(this.name, ":onGetProducts"), this.store.list);
|
|
281
207
|
case 2:
|
|
282
|
-
return
|
|
208
|
+
return _context5.abrupt("return", cloneDeep(this.store.list));
|
|
283
209
|
case 3:
|
|
284
210
|
case "end":
|
|
285
|
-
return
|
|
211
|
+
return _context5.stop();
|
|
286
212
|
}
|
|
287
|
-
},
|
|
213
|
+
}, _callee5, this);
|
|
288
214
|
}));
|
|
289
215
|
function getProducts() {
|
|
290
216
|
return _getProducts.apply(this, arguments);
|
|
@@ -294,25 +220,25 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
|
|
|
294
220
|
}, {
|
|
295
221
|
key: "getProduct",
|
|
296
222
|
value: function () {
|
|
297
|
-
var _getProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
223
|
+
var _getProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(id) {
|
|
298
224
|
var product;
|
|
299
|
-
return _regeneratorRuntime().wrap(function
|
|
300
|
-
while (1) switch (
|
|
225
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
226
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
301
227
|
case 0:
|
|
302
|
-
|
|
228
|
+
_context6.next = 2;
|
|
303
229
|
return this.core.effects.emit("".concat(this.name, ":onGetProduct"), this.store.list);
|
|
304
230
|
case 2:
|
|
305
231
|
product = this.store.list.find(function (product) {
|
|
306
232
|
return product.id === id;
|
|
307
233
|
});
|
|
308
|
-
return
|
|
234
|
+
return _context6.abrupt("return", product ? cloneDeep(product) : undefined);
|
|
309
235
|
case 4:
|
|
310
236
|
case "end":
|
|
311
|
-
return
|
|
237
|
+
return _context6.stop();
|
|
312
238
|
}
|
|
313
|
-
},
|
|
239
|
+
}, _callee6, this);
|
|
314
240
|
}));
|
|
315
|
-
function getProduct(
|
|
241
|
+
function getProduct(_x8) {
|
|
316
242
|
return _getProduct.apply(this, arguments);
|
|
317
243
|
}
|
|
318
244
|
return getProduct;
|
|
@@ -320,25 +246,25 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
|
|
|
320
246
|
}, {
|
|
321
247
|
key: "getProductByIds",
|
|
322
248
|
value: function () {
|
|
323
|
-
var _getProductByIds = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
249
|
+
var _getProductByIds = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(ids) {
|
|
324
250
|
var products;
|
|
325
|
-
return _regeneratorRuntime().wrap(function
|
|
326
|
-
while (1) switch (
|
|
251
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
252
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
327
253
|
case 0:
|
|
328
|
-
|
|
254
|
+
_context7.next = 2;
|
|
329
255
|
return this.core.effects.emit("".concat(this.name, ":onGetProductByIds"), this.store.list);
|
|
330
256
|
case 2:
|
|
331
257
|
products = this.store.list.filter(function (product) {
|
|
332
258
|
return ids.includes(product.id);
|
|
333
259
|
});
|
|
334
|
-
return
|
|
260
|
+
return _context7.abrupt("return", products);
|
|
335
261
|
case 4:
|
|
336
262
|
case "end":
|
|
337
|
-
return
|
|
263
|
+
return _context7.stop();
|
|
338
264
|
}
|
|
339
|
-
},
|
|
265
|
+
}, _callee7, this);
|
|
340
266
|
}));
|
|
341
|
-
function getProductByIds(
|
|
267
|
+
function getProductByIds(_x9) {
|
|
342
268
|
return _getProductByIds.apply(this, arguments);
|
|
343
269
|
}
|
|
344
270
|
return getProductByIds;
|
|
@@ -346,10 +272,10 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
|
|
|
346
272
|
}, {
|
|
347
273
|
key: "addProduct",
|
|
348
274
|
value: function () {
|
|
349
|
-
var _addProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
275
|
+
var _addProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(products) {
|
|
350
276
|
var _this2 = this;
|
|
351
|
-
return _regeneratorRuntime().wrap(function
|
|
352
|
-
while (1) switch (
|
|
277
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
278
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
353
279
|
case 0:
|
|
354
280
|
// list 需要根据 id 去重
|
|
355
281
|
if (!this.store.list) {
|
|
@@ -372,11 +298,11 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
|
|
|
372
298
|
this.core.effects.emit("".concat(this.name, ":changed"), this.store.list);
|
|
373
299
|
case 4:
|
|
374
300
|
case "end":
|
|
375
|
-
return
|
|
301
|
+
return _context8.stop();
|
|
376
302
|
}
|
|
377
|
-
},
|
|
303
|
+
}, _callee8, this);
|
|
378
304
|
}));
|
|
379
|
-
function addProduct(
|
|
305
|
+
function addProduct(_x10) {
|
|
380
306
|
return _addProduct.apply(this, arguments);
|
|
381
307
|
}
|
|
382
308
|
return addProduct;
|
|
@@ -384,18 +310,18 @@ export var ProductList = /*#__PURE__*/function (_BaseModule) {
|
|
|
384
310
|
}, {
|
|
385
311
|
key: "selectProducts",
|
|
386
312
|
value: function () {
|
|
387
|
-
var _selectProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function
|
|
388
|
-
return _regeneratorRuntime().wrap(function
|
|
389
|
-
while (1) switch (
|
|
313
|
+
var _selectProducts = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(products) {
|
|
314
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
315
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
390
316
|
case 0:
|
|
391
317
|
this.store.selectProducts = products;
|
|
392
318
|
case 1:
|
|
393
319
|
case "end":
|
|
394
|
-
return
|
|
320
|
+
return _context9.stop();
|
|
395
321
|
}
|
|
396
|
-
},
|
|
322
|
+
}, _callee9, this);
|
|
397
323
|
}));
|
|
398
|
-
function selectProducts(
|
|
324
|
+
function selectProducts(_x11) {
|
|
399
325
|
return _selectProducts.apply(this, arguments);
|
|
400
326
|
}
|
|
401
327
|
return selectProducts;
|
|
@@ -1,18 +1,4 @@
|
|
|
1
1
|
import { ProductData } from '../Product/types';
|
|
2
|
-
export interface ProductListLoadProductsParams {
|
|
3
|
-
category_ids?: number[];
|
|
4
|
-
product_ids?: number[];
|
|
5
|
-
collection?: number | string[];
|
|
6
|
-
schedule_date?: string;
|
|
7
|
-
cacheId?: string;
|
|
8
|
-
customer_id?: number;
|
|
9
|
-
menu_list_ids?: number[];
|
|
10
|
-
schedule_datetime?: string;
|
|
11
|
-
with_count?: string[];
|
|
12
|
-
with_schedule?: number;
|
|
13
|
-
extension_type?: string[];
|
|
14
|
-
status?: string;
|
|
15
|
-
}
|
|
16
2
|
export interface ProductListData {
|
|
17
3
|
list: ProductData[];
|
|
18
4
|
selectProducts: ProductData[];
|
|
@@ -47,6 +47,7 @@ export declare class QuotationModule extends BaseModule implements Module {
|
|
|
47
47
|
customer_id?: number | string;
|
|
48
48
|
}): Map<string, string | null>;
|
|
49
49
|
setScheduleResolver(resolver: (id: number) => ScheduleItem | undefined): void;
|
|
50
|
+
private filterQuotationsByCustomer;
|
|
50
51
|
private isQuotationVisibleForCustomer;
|
|
51
52
|
private hasValidCustomerId;
|
|
52
53
|
private isQuotationActiveAt;
|
|
@@ -78,22 +78,22 @@ export var QuotationModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
78
78
|
case 0:
|
|
79
79
|
query = {};
|
|
80
80
|
if (params !== null && params !== void 0 && params.channel) query.channel = params.channel;
|
|
81
|
+
if (params !== null && params !== void 0 && params.customer_id) query.customer_id = String(params.customer_id);
|
|
81
82
|
if ((params === null || params === void 0 ? void 0 : params.channel) === 'online_store') {
|
|
82
83
|
query.channel = 'online-store';
|
|
83
84
|
}
|
|
84
|
-
_context2.next =
|
|
85
|
+
_context2.next = 6;
|
|
85
86
|
return this.request.get('/quotation/available', query, {
|
|
86
|
-
useCache: false
|
|
87
|
-
osServer: true
|
|
87
|
+
useCache: false
|
|
88
88
|
});
|
|
89
|
-
case
|
|
89
|
+
case 6:
|
|
90
90
|
res = _context2.sent;
|
|
91
|
-
list = (res === null || res === void 0 || (_data = res.data) === null || _data === void 0 ? void 0 : _data.list) || (res === null || res === void 0 ? void 0 : res.list) || [];
|
|
91
|
+
list = this.filterQuotationsByCustomer((res === null || res === void 0 || (_data = res.data) === null || _data === void 0 ? void 0 : _data.list) || (res === null || res === void 0 ? void 0 : res.list) || [], params === null || params === void 0 ? void 0 : params.customer_id);
|
|
92
92
|
list.sort(function (a, b) {
|
|
93
93
|
return a.sort - b.sort;
|
|
94
94
|
});
|
|
95
95
|
this.store.list = list;
|
|
96
|
-
case
|
|
96
|
+
case 10:
|
|
97
97
|
case "end":
|
|
98
98
|
return _context2.stop();
|
|
99
99
|
}
|
|
@@ -130,10 +130,8 @@ export var QuotationModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
130
130
|
try {
|
|
131
131
|
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
132
132
|
var quotation = _step.value;
|
|
133
|
-
|
|
134
|
-
if (!
|
|
135
|
-
var active = this.isQuotationActiveAt(quotation, datetime);
|
|
136
|
-
if (!active) continue;
|
|
133
|
+
if (!this.isQuotationVisibleForCustomer(quotation, customer_id)) continue;
|
|
134
|
+
if (!this.isQuotationActiveAt(quotation, datetime)) continue;
|
|
137
135
|
var match = this.findProductData(quotation.product_data, productId, variantId);
|
|
138
136
|
if (!match) continue;
|
|
139
137
|
if (match.value === 0) continue;
|
|
@@ -220,6 +218,14 @@ export var QuotationModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
220
218
|
value: function setScheduleResolver(resolver) {
|
|
221
219
|
this.scheduleResolver = resolver;
|
|
222
220
|
}
|
|
221
|
+
}, {
|
|
222
|
+
key: "filterQuotationsByCustomer",
|
|
223
|
+
value: function filterQuotationsByCustomer(list, customerId) {
|
|
224
|
+
var _this2 = this;
|
|
225
|
+
return list.filter(function (quotation) {
|
|
226
|
+
return _this2.isQuotationVisibleForCustomer(quotation, customerId);
|
|
227
|
+
});
|
|
228
|
+
}
|
|
223
229
|
}, {
|
|
224
230
|
key: "isQuotationVisibleForCustomer",
|
|
225
231
|
value: function isQuotationVisibleForCustomer(quotation, customerId) {
|
|
@@ -240,27 +246,18 @@ export var QuotationModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
240
246
|
key: "isQuotationActiveAt",
|
|
241
247
|
value: function isQuotationActiveAt(quotation, datetime) {
|
|
242
248
|
var _quotation$schedule,
|
|
243
|
-
|
|
249
|
+
_this3 = this;
|
|
244
250
|
if (!((_quotation$schedule = quotation.schedule) !== null && _quotation$schedule !== void 0 && _quotation$schedule.length)) return false;
|
|
245
|
-
var scheduleItems =
|
|
246
|
-
|
|
247
|
-
var
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
scheduleItems.push(full);
|
|
251
|
-
return;
|
|
252
|
-
}
|
|
253
|
-
if (_this2.scheduleResolver) {
|
|
254
|
-
return;
|
|
255
|
-
}
|
|
256
|
-
var fallbackSchedule = _objectSpread(_objectSpread({}, s), {}, {
|
|
251
|
+
var scheduleItems = quotation.schedule.map(function (s) {
|
|
252
|
+
var _this3$scheduleResolv;
|
|
253
|
+
var full = (_this3$scheduleResolv = _this3.scheduleResolver) === null || _this3$scheduleResolv === void 0 ? void 0 : _this3$scheduleResolv.call(_this3, s.id);
|
|
254
|
+
if (full) return full;
|
|
255
|
+
return _objectSpread(_objectSpread({}, s), {}, {
|
|
257
256
|
repeat_type: s.repeat_type || 'none',
|
|
258
257
|
repeat_rule: s.repeat_rule || null,
|
|
259
258
|
time_slot: s.time_slot || []
|
|
260
259
|
});
|
|
261
|
-
scheduleItems.push(fallbackSchedule);
|
|
262
260
|
});
|
|
263
|
-
if (!scheduleItems.length) return false;
|
|
264
261
|
return getDateIsInSchedule(datetime, scheduleItems);
|
|
265
262
|
}
|
|
266
263
|
}, {
|
|
@@ -32,10 +32,6 @@ export declare class RulesModule extends BaseModule implements Module, RulesModu
|
|
|
32
32
|
unavailableReason?: UnavailableReason;
|
|
33
33
|
};
|
|
34
34
|
filterDiscountListByType(discountList: Discount[], type: string): Discount[];
|
|
35
|
-
/** 剔除指定 type/tag 的折扣项,保留手动改价(type=product) / 券等 */
|
|
36
|
-
excludeDiscountListByType(discountList: Discount[], type: string): Discount[];
|
|
37
|
-
/** 手动改价场景:去掉 promotion,保留 type=product 等行内折扣 */
|
|
38
|
-
resolveDiscountListForManualOverride(discountList: Discount[]): Discount[];
|
|
39
35
|
private getUnavailableReason;
|
|
40
36
|
calcDiscount({ discountList, productList, holders, isFormSubject, orderTotalAmount }: {
|
|
41
37
|
discountList: Discount[];
|