@pisell/pisellos 2.2.244 → 2.2.246
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 +3 -2
- package/dist/model/strategy/adapter/walletPass/utils.js +7 -4
- package/dist/modules/BookingContext/index.d.ts +48 -0
- package/dist/modules/BookingContext/index.js +566 -0
- package/dist/modules/BookingContext/types.d.ts +102 -0
- package/dist/modules/BookingContext/types.js +51 -0
- package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +16 -0
- package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +284 -0
- package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +8 -0
- package/dist/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +148 -0
- package/dist/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +76 -0
- package/dist/modules/BookingContext/utils/cacheItemToBookingInput.js +218 -0
- package/dist/modules/BookingContext/utils/flexible.d.ts +28 -0
- package/dist/modules/BookingContext/utils/flexible.js +56 -0
- package/dist/modules/BookingContext/utils/formatResourceList.d.ts +8 -0
- package/dist/modules/BookingContext/utils/formatResourceList.js +38 -0
- package/dist/modules/BookingContext/utils/index.d.ts +11 -0
- package/dist/modules/BookingContext/utils/index.js +11 -0
- package/dist/modules/BookingContext/utils/noResource.d.ts +13 -0
- package/dist/modules/BookingContext/utils/noResource.js +77 -0
- package/dist/modules/BookingContext/utils/orderLineDisplay.d.ts +1 -0
- package/dist/modules/BookingContext/utils/orderLineDisplay.js +36 -0
- package/dist/modules/BookingContext/utils/productExtend.d.ts +72 -0
- package/dist/modules/BookingContext/utils/productExtend.js +339 -0
- package/dist/modules/BookingContext/utils/resourceErrors.d.ts +41 -0
- package/dist/modules/BookingContext/utils/resourceErrors.js +74 -0
- package/dist/modules/BookingContext/utils/resourceSelection.d.ts +7 -0
- package/dist/modules/BookingContext/utils/resourceSelection.js +24 -0
- package/dist/modules/BookingContext/utils/resources.d.ts +80 -0
- package/dist/modules/BookingContext/utils/resources.js +486 -0
- package/dist/modules/BookingContext/utils/serviceTimes.d.ts +55 -0
- package/dist/modules/BookingContext/utils/serviceTimes.js +151 -0
- package/dist/modules/BookingContext/utils/timeSlices.d.ts +42 -0
- package/dist/modules/BookingContext/utils/timeSlices.js +100 -0
- package/dist/modules/Cart/utils/cartProduct.js +24 -3
- package/dist/modules/Cart/utils/changePrice.js +11 -11
- package/dist/modules/Customer/index.d.ts +20 -0
- package/dist/modules/Customer/index.js +172 -83
- package/dist/modules/Customer/types.d.ts +2 -0
- package/dist/modules/Discount/index.d.ts +1 -1
- package/dist/modules/Discount/index.js +13 -6
- package/dist/modules/Discount/types.d.ts +1 -0
- package/dist/modules/OpenData/index.d.ts +8 -0
- package/dist/modules/OpenData/index.js +37 -17
- package/dist/modules/Order/index.d.ts +277 -18
- package/dist/modules/Order/index.js +3581 -779
- package/dist/modules/Order/types.d.ts +286 -31
- package/dist/modules/Order/types.js +38 -0
- package/dist/modules/Order/utils/manualProductDiscount.d.ts +106 -0
- package/dist/modules/Order/utils/manualProductDiscount.js +210 -0
- package/dist/modules/Order/utils.d.ts +147 -5
- package/dist/modules/Order/utils.js +750 -104
- package/dist/modules/Payment/index.d.ts +10 -13
- package/dist/modules/Payment/index.js +467 -837
- package/dist/modules/Payment/types.d.ts +2 -0
- package/dist/modules/Payment/utils.js +2 -1
- package/dist/modules/Payment/walletpass.js +41 -25
- package/dist/modules/ProductList/index.d.ts +16 -12
- package/dist/modules/ProductList/index.js +133 -59
- package/dist/modules/ProductList/types.d.ts +14 -0
- package/dist/modules/Quotation/index.d.ts +0 -1
- package/dist/modules/Quotation/index.js +25 -22
- package/dist/modules/Rules/index.d.ts +4 -0
- package/dist/modules/Rules/index.js +97 -70
- package/dist/modules/Rules/types.d.ts +1 -0
- package/dist/modules/SalesSummary/index.d.ts +8 -25
- package/dist/modules/SalesSummary/index.js +86 -35
- package/dist/modules/SalesSummary/types.d.ts +4 -1
- package/dist/modules/SalesSummary/utils.d.ts +2 -25
- package/dist/modules/SalesSummary/utils.js +794 -162
- package/dist/modules/Schedule/index.d.ts +7 -0
- package/dist/modules/Schedule/index.js +24 -2
- package/dist/modules/Summary/index.js +4 -3
- package/dist/modules/SurchargeList/index.d.ts +16 -0
- package/dist/modules/SurchargeList/index.js +162 -0
- package/dist/modules/SurchargeList/types.d.ts +11 -0
- package/dist/modules/SurchargeList/types.js +1 -0
- package/dist/modules/index.d.ts +2 -0
- package/dist/modules/index.js +3 -1
- package/dist/plugins/request.d.ts +1 -0
- package/dist/server/index.d.ts +204 -1
- package/dist/server/index.js +3654 -922
- package/dist/server/modules/index.d.ts +2 -0
- package/dist/server/modules/index.js +2 -0
- package/dist/server/modules/order/index.d.ts +120 -3
- package/dist/server/modules/order/index.js +1762 -448
- package/dist/server/modules/order/types.d.ts +32 -3
- package/dist/server/modules/order/types.js +8 -0
- package/dist/server/modules/order/utils/filterBookings.js +26 -3
- package/dist/server/modules/order/utils/filterOrders.js +23 -8
- package/dist/server/modules/payment/index.d.ts +28 -0
- package/dist/server/modules/payment/index.js +305 -0
- package/dist/server/modules/payment/types.d.ts +9 -0
- package/dist/server/modules/payment/types.js +1 -0
- package/dist/server/modules/products/index.d.ts +34 -7
- package/dist/server/modules/products/index.js +631 -317
- package/dist/server/modules/resource/index.d.ts +2 -0
- package/dist/server/modules/resource/index.js +29 -3
- package/dist/server/modules/schedule/index.d.ts +4 -4
- package/dist/server/modules/schedule/index.js +111 -88
- package/dist/server/test.json +713 -0
- package/dist/server/utils/small-ticket.d.ts +71 -0
- package/dist/server/utils/small-ticket.js +840 -0
- package/dist/solution/BaseSales/index.d.ts +133 -10
- package/dist/solution/BaseSales/index.js +1950 -447
- package/dist/solution/BaseSales/types.d.ts +82 -6
- package/dist/solution/BaseSales/types.js +5 -4
- package/dist/solution/BaseSales/utils/cartPromotion.d.ts +287 -0
- package/dist/solution/BaseSales/utils/cartPromotion.js +1438 -0
- package/dist/solution/BaseSales/utils/quotationPrice.d.ts +7 -0
- package/dist/solution/BaseSales/utils/quotationPrice.js +237 -0
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +1 -0
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +105 -24
- package/dist/solution/BaseSales/utils.d.ts +1 -1
- package/dist/solution/BaseSales/utils.js +62 -21
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingTicket/index.d.ts +271 -11
- package/dist/solution/BookingTicket/index.js +1777 -242
- package/dist/solution/BookingTicket/types.d.ts +118 -1
- package/dist/solution/BookingTicket/types.js +41 -2
- package/dist/solution/BookingTicket/utils/addProductDecision.d.ts +117 -0
- package/dist/solution/BookingTicket/utils/addProductDecision.js +346 -0
- package/dist/solution/BookingTicket/utils/addTimeAvailability.d.ts +35 -0
- package/dist/solution/BookingTicket/utils/addTimeAvailability.js +95 -0
- package/dist/solution/BookingTicket/utils/bookingStatus.d.ts +40 -0
- package/dist/solution/BookingTicket/utils/bookingStatus.js +70 -0
- package/dist/solution/BookingTicket/utils/cartView.d.ts +9 -1
- package/dist/solution/BookingTicket/utils/cartView.js +94 -7
- package/dist/solution/BookingTicket/utils/exampleData.d.ts +123 -0
- package/dist/solution/BookingTicket/utils/exampleData.js +183 -0
- package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +185 -0
- package/dist/solution/BookingTicket/utils/resolveBestAddTimePlan.js +438 -0
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +36 -0
- package/dist/solution/BookingTicket/utils/scan/applyGlobalScan.js +400 -0
- package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +32 -0
- package/dist/solution/BookingTicket/utils/scan/formatGlobalScan.js +56 -0
- package/dist/solution/BookingTicket/utils/scan/index.d.ts +5 -0
- package/dist/solution/BookingTicket/utils/scan/index.js +20 -8
- package/dist/solution/BookingTicket/utils/scan/scanProductValues.d.ts +21 -0
- package/dist/solution/BookingTicket/utils/scan/scanProductValues.js +150 -0
- package/dist/solution/BookingTicket/utils/sessionCatalogStale.d.ts +23 -0
- package/dist/solution/BookingTicket/utils/sessionCatalogStale.js +78 -0
- package/dist/solution/Checkout/index.d.ts +1 -0
- package/dist/solution/Checkout/index.js +10 -9
- package/dist/solution/RegisterAndLogin/config.js +2 -10
- package/dist/solution/ScanOrder/index.d.ts +9 -3
- package/dist/solution/ScanOrder/index.js +241 -134
- package/dist/solution/ScanOrder/types.d.ts +9 -5
- package/dist/solution/ScanOrder/types.js +2 -3
- package/dist/solution/ScanOrder/utils.d.ts +1 -1
- package/dist/solution/ScanOrder/utils.js +84 -22
- package/dist/solution/VenueBooking/index.d.ts +5 -2
- package/dist/solution/VenueBooking/index.js +110 -59
- package/dist/solution/VenueBooking/sales-section-4-annotated.json +0 -2
- package/dist/solution/VenueBooking/utils/slotMerge.d.ts +4 -0
- package/dist/solution/VenueBooking/utils/slotMerge.js +10 -0
- package/dist/types/index.d.ts +10 -0
- package/lib/model/strategy/adapter/promotion/evaluator.js +2 -1
- package/lib/model/strategy/adapter/promotion/index.js +49 -0
- package/lib/model/strategy/adapter/walletPass/utils.js +3 -2
- package/lib/modules/BookingContext/index.d.ts +48 -0
- package/lib/modules/BookingContext/index.js +368 -0
- package/lib/modules/BookingContext/types.d.ts +102 -0
- package/lib/modules/BookingContext/types.js +34 -0
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.d.ts +16 -0
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +276 -0
- package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.d.ts +8 -0
- package/lib/modules/BookingContext/utils/buildNormalProductCacheItemFromOrderLine.js +154 -0
- package/lib/modules/BookingContext/utils/cacheItemToBookingInput.d.ts +76 -0
- package/lib/modules/BookingContext/utils/cacheItemToBookingInput.js +201 -0
- package/lib/modules/BookingContext/utils/flexible.d.ts +28 -0
- package/lib/modules/BookingContext/utils/flexible.js +80 -0
- package/lib/modules/BookingContext/utils/formatResourceList.d.ts +8 -0
- package/lib/modules/BookingContext/utils/formatResourceList.js +50 -0
- package/lib/modules/BookingContext/utils/index.d.ts +11 -0
- package/lib/modules/BookingContext/utils/index.js +43 -0
- package/lib/modules/BookingContext/utils/noResource.d.ts +13 -0
- package/lib/modules/BookingContext/utils/noResource.js +90 -0
- package/lib/modules/BookingContext/utils/orderLineDisplay.d.ts +1 -0
- package/lib/modules/BookingContext/utils/orderLineDisplay.js +56 -0
- package/lib/modules/BookingContext/utils/productExtend.d.ts +72 -0
- package/lib/modules/BookingContext/utils/productExtend.js +283 -0
- package/lib/modules/BookingContext/utils/resourceErrors.d.ts +41 -0
- package/lib/modules/BookingContext/utils/resourceErrors.js +80 -0
- package/lib/modules/BookingContext/utils/resourceSelection.d.ts +7 -0
- package/lib/modules/BookingContext/utils/resourceSelection.js +46 -0
- package/lib/modules/BookingContext/utils/resources.d.ts +80 -0
- package/lib/modules/BookingContext/utils/resources.js +377 -0
- package/lib/modules/BookingContext/utils/serviceTimes.d.ts +55 -0
- package/lib/modules/BookingContext/utils/serviceTimes.js +162 -0
- package/lib/modules/BookingContext/utils/timeSlices.d.ts +42 -0
- package/lib/modules/BookingContext/utils/timeSlices.js +124 -0
- package/lib/modules/Cart/utils/cartProduct.js +20 -3
- package/lib/modules/Cart/utils/changePrice.js +12 -20
- package/lib/modules/Customer/index.d.ts +20 -0
- package/lib/modules/Customer/index.js +64 -11
- package/lib/modules/Customer/types.d.ts +2 -0
- package/lib/modules/Discount/index.d.ts +1 -1
- package/lib/modules/Discount/index.js +9 -1
- package/lib/modules/Discount/types.d.ts +1 -0
- package/lib/modules/OpenData/index.d.ts +8 -0
- package/lib/modules/OpenData/index.js +19 -5
- package/lib/modules/Order/index.d.ts +277 -18
- package/lib/modules/Order/index.js +2317 -337
- package/lib/modules/Order/types.d.ts +286 -31
- package/lib/modules/Order/types.js +1 -0
- package/lib/modules/Order/utils/manualProductDiscount.d.ts +106 -0
- package/lib/modules/Order/utils/manualProductDiscount.js +206 -0
- package/lib/modules/Order/utils.d.ts +147 -5
- package/lib/modules/Order/utils.js +615 -46
- package/lib/modules/Payment/index.d.ts +10 -13
- package/lib/modules/Payment/index.js +18 -150
- package/lib/modules/Payment/types.d.ts +2 -0
- package/lib/modules/Payment/utils.js +2 -1
- package/lib/modules/Payment/walletpass.js +16 -3
- package/lib/modules/ProductList/index.d.ts +16 -12
- package/lib/modules/ProductList/index.js +41 -4
- package/lib/modules/ProductList/types.d.ts +14 -0
- package/lib/modules/Quotation/index.d.ts +0 -1
- package/lib/modules/Quotation/index.js +19 -16
- package/lib/modules/Rules/index.d.ts +4 -0
- package/lib/modules/Rules/index.js +137 -120
- package/lib/modules/Rules/types.d.ts +1 -0
- package/lib/modules/SalesSummary/index.d.ts +8 -25
- package/lib/modules/SalesSummary/index.js +30 -4
- package/lib/modules/SalesSummary/types.d.ts +4 -1
- package/lib/modules/SalesSummary/utils.d.ts +2 -25
- package/lib/modules/SalesSummary/utils.js +645 -91
- package/lib/modules/Schedule/index.d.ts +7 -0
- package/lib/modules/Schedule/index.js +17 -1
- package/lib/modules/Summary/index.js +5 -4
- package/lib/modules/SurchargeList/index.d.ts +16 -0
- package/lib/modules/SurchargeList/index.js +89 -0
- package/lib/modules/SurchargeList/types.d.ts +11 -0
- package/lib/modules/SurchargeList/types.js +17 -0
- package/lib/modules/index.d.ts +2 -0
- package/lib/modules/index.js +5 -1
- package/lib/plugins/request.d.ts +1 -0
- package/lib/server/index.d.ts +204 -1
- package/lib/server/index.js +1891 -59
- package/lib/server/modules/index.d.ts +2 -0
- package/lib/server/modules/index.js +3 -0
- package/lib/server/modules/order/index.d.ts +120 -3
- package/lib/server/modules/order/index.js +887 -94
- package/lib/server/modules/order/types.d.ts +32 -3
- package/lib/server/modules/order/utils/filterBookings.js +24 -5
- package/lib/server/modules/order/utils/filterOrders.js +15 -6
- package/lib/server/modules/payment/index.d.ts +28 -0
- package/lib/server/modules/payment/index.js +192 -0
- package/lib/server/modules/payment/types.d.ts +9 -0
- package/lib/server/modules/payment/types.js +17 -0
- package/lib/server/modules/products/index.d.ts +34 -7
- package/lib/server/modules/products/index.js +189 -54
- package/lib/server/modules/resource/index.d.ts +2 -0
- package/lib/server/modules/resource/index.js +27 -3
- package/lib/server/modules/schedule/index.d.ts +4 -4
- package/lib/server/modules/schedule/index.js +47 -40
- package/lib/server/test.json +713 -0
- package/lib/server/utils/small-ticket.d.ts +71 -0
- package/lib/server/utils/small-ticket.js +800 -0
- package/lib/solution/BaseSales/index.d.ts +133 -10
- package/lib/solution/BaseSales/index.js +1111 -63
- package/lib/solution/BaseSales/types.d.ts +82 -6
- package/lib/solution/BaseSales/types.js +3 -1
- package/lib/solution/BaseSales/utils/cartPromotion.d.ts +287 -0
- package/lib/solution/BaseSales/utils/cartPromotion.js +992 -0
- package/lib/solution/BaseSales/utils/quotationPrice.d.ts +7 -0
- package/lib/solution/BaseSales/utils/quotationPrice.js +277 -0
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.d.ts +1 -0
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +106 -18
- package/lib/solution/BaseSales/utils.d.ts +1 -1
- package/lib/solution/BaseSales/utils.js +54 -10
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingTicket/index.d.ts +271 -11
- package/lib/solution/BookingTicket/index.js +922 -29
- package/lib/solution/BookingTicket/types.d.ts +118 -1
- package/lib/solution/BookingTicket/types.js +11 -0
- package/lib/solution/BookingTicket/utils/addProductDecision.d.ts +117 -0
- package/lib/solution/BookingTicket/utils/addProductDecision.js +318 -0
- package/lib/solution/BookingTicket/utils/addTimeAvailability.d.ts +35 -0
- package/lib/solution/BookingTicket/utils/addTimeAvailability.js +125 -0
- package/lib/solution/BookingTicket/utils/bookingStatus.d.ts +40 -0
- package/lib/solution/BookingTicket/utils/bookingStatus.js +44 -2
- package/lib/solution/BookingTicket/utils/cartView.d.ts +9 -1
- package/lib/solution/BookingTicket/utils/cartView.js +61 -6
- package/lib/solution/BookingTicket/utils/exampleData.d.ts +123 -0
- package/lib/solution/BookingTicket/utils/exampleData.js +0 -0
- package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.d.ts +185 -0
- package/lib/solution/BookingTicket/utils/resolveBestAddTimePlan.js +254 -0
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.d.ts +36 -0
- package/lib/solution/BookingTicket/utils/scan/applyGlobalScan.js +169 -0
- package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.d.ts +32 -0
- package/lib/solution/BookingTicket/utils/scan/formatGlobalScan.js +51 -0
- package/lib/solution/BookingTicket/utils/scan/index.d.ts +5 -0
- package/lib/solution/BookingTicket/utils/scan/index.js +17 -3
- package/lib/solution/BookingTicket/utils/scan/scanProductValues.d.ts +21 -0
- package/lib/solution/BookingTicket/utils/scan/scanProductValues.js +127 -0
- package/lib/solution/BookingTicket/utils/sessionCatalogStale.d.ts +23 -0
- package/lib/solution/BookingTicket/utils/sessionCatalogStale.js +85 -0
- package/lib/solution/Checkout/index.d.ts +1 -0
- package/lib/solution/Checkout/index.js +1 -2
- package/lib/solution/RegisterAndLogin/config.js +2 -10
- package/lib/solution/ScanOrder/index.d.ts +9 -3
- package/lib/solution/ScanOrder/index.js +153 -70
- package/lib/solution/ScanOrder/types.d.ts +9 -5
- package/lib/solution/ScanOrder/utils.d.ts +1 -1
- package/lib/solution/ScanOrder/utils.js +83 -17
- package/lib/solution/VenueBooking/index.d.ts +5 -2
- package/lib/solution/VenueBooking/index.js +54 -17
- package/lib/solution/VenueBooking/sales-section-4-annotated.json +0 -2
- package/lib/solution/VenueBooking/utils/slotMerge.d.ts +4 -0
- package/lib/solution/VenueBooking/utils/slotMerge.js +10 -0
- package/lib/types/index.d.ts +10 -0
- package/package.json +1 -1
- package/dist/solution/Checkout/appointmentDemo.json +0 -1
- package/lib/solution/Checkout/appointmentDemo.json +0 -1
|
@@ -11,6 +11,13 @@ export declare class ScheduleModule extends BaseModule implements Module, Schedu
|
|
|
11
11
|
private fatherModule;
|
|
12
12
|
constructor(name?: string, version?: string);
|
|
13
13
|
initialize(core: PisellCore, options: ModuleOptions): Promise<void>;
|
|
14
|
+
/**
|
|
15
|
+
* 更新父级解决方案透传的运行态参数,并刷新 schedule 缓存写入配置。
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* scheduleModule.updateOtherParams({ openCache: true, cacheId: 'cache-2' });
|
|
19
|
+
*/
|
|
20
|
+
updateOtherParams(params: Record<string, any>): void;
|
|
14
21
|
/**
|
|
15
22
|
* 加载当前店铺下所有 schedule
|
|
16
23
|
*
|
|
@@ -93,6 +93,22 @@ export var ScheduleModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
93
93
|
}
|
|
94
94
|
return initialize;
|
|
95
95
|
}()
|
|
96
|
+
/**
|
|
97
|
+
* 更新父级解决方案透传的运行态参数,并刷新 schedule 缓存写入配置。
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* scheduleModule.updateOtherParams({ openCache: true, cacheId: 'cache-2' });
|
|
101
|
+
*/
|
|
102
|
+
}, {
|
|
103
|
+
key: "updateOtherParams",
|
|
104
|
+
value: function updateOtherParams(params) {
|
|
105
|
+
var _otherParams$openCach;
|
|
106
|
+
var otherParams = params || {};
|
|
107
|
+
this.openCache = (_otherParams$openCach = otherParams.openCache) !== null && _otherParams$openCach !== void 0 ? _otherParams$openCach : false;
|
|
108
|
+
this.cacheId = otherParams.cacheId;
|
|
109
|
+
this.fatherModule = otherParams.fatherModule;
|
|
110
|
+
}
|
|
111
|
+
|
|
96
112
|
/**
|
|
97
113
|
* 加载当前店铺下所有 schedule
|
|
98
114
|
*
|
|
@@ -205,9 +221,15 @@ export var ScheduleModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
205
221
|
}, {
|
|
206
222
|
key: "getScheduleListByIds",
|
|
207
223
|
value: function getScheduleListByIds(ids) {
|
|
208
|
-
|
|
209
|
-
|
|
224
|
+
var _this$store$scheduleL;
|
|
225
|
+
var idSet = new Set(ids.map(function (id) {
|
|
226
|
+
return String(id);
|
|
227
|
+
}));
|
|
228
|
+
console.log('getScheduleListByIds', this.store.scheduleList);
|
|
229
|
+
var list = (_this$store$scheduleL = this.store.scheduleList) === null || _this$store$scheduleL === void 0 ? void 0 : _this$store$scheduleL.filter(function (n) {
|
|
230
|
+
return idSet.has(String(n.id));
|
|
210
231
|
});
|
|
232
|
+
return list;
|
|
211
233
|
}
|
|
212
234
|
}, {
|
|
213
235
|
key: "setAvailabilityScheduleDateList",
|
|
@@ -113,14 +113,14 @@ export var SummaryModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
113
113
|
key: "getSummary",
|
|
114
114
|
value: function () {
|
|
115
115
|
var _getSummary = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(cartItems) {
|
|
116
|
-
var _this$shopStore$get;
|
|
116
|
+
var _this$shopStore$get, _this$store$surcharge;
|
|
117
117
|
var shopInfo, scheduleModule, needScheduleIds, scheduleList, scheduleById, _iterator, _step, item, summary;
|
|
118
118
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
119
119
|
while (1) switch (_context3.prev = _context3.next) {
|
|
120
120
|
case 0:
|
|
121
121
|
shopInfo = ((_this$shopStore$get = this.shopStore.get('core')) === null || _this$shopStore$get === void 0 || (_this$shopStore$get = _this$shopStore$get.core) === null || _this$shopStore$get === void 0 ? void 0 : _this$shopStore$get.shop) || {};
|
|
122
122
|
scheduleModule = this.core.getModule('appointmentBooking_schedule');
|
|
123
|
-
needScheduleIds = this.store.surchargeList.map(function (item) {
|
|
123
|
+
needScheduleIds = (_this$store$surcharge = this.store.surchargeList) === null || _this$store$surcharge === void 0 ? void 0 : _this$store$surcharge.map(function (item) {
|
|
124
124
|
return item.available_schedule_ids;
|
|
125
125
|
}).flat();
|
|
126
126
|
scheduleList = scheduleModule === null || scheduleModule === void 0 ? void 0 : scheduleModule.getScheduleListByIds(needScheduleIds);
|
|
@@ -208,9 +208,10 @@ export var SummaryModule = /*#__PURE__*/function (_BaseModule) {
|
|
|
208
208
|
}, {
|
|
209
209
|
key: "getSurchargeforUtils",
|
|
210
210
|
value: function getSurchargeforUtils(items) {
|
|
211
|
+
var _this$store$surcharge2;
|
|
211
212
|
// const surchargeList = this.store.surchargeList;
|
|
212
213
|
var scheduleModule = this.core.getModule('appointmentBooking_schedule');
|
|
213
|
-
var needScheduleIds = this.store.surchargeList.map(function (item) {
|
|
214
|
+
var needScheduleIds = (_this$store$surcharge2 = this.store.surchargeList) === null || _this$store$surcharge2 === void 0 ? void 0 : _this$store$surcharge2.map(function (item) {
|
|
214
215
|
return item.available_schedule_ids;
|
|
215
216
|
}).flat();
|
|
216
217
|
var scheduleList = scheduleModule === null || scheduleModule === void 0 ? void 0 : scheduleModule.getScheduleListByIds(needScheduleIds);
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Module, ModuleOptions, PisellCore } from '../../types';
|
|
2
|
+
import { BaseModule } from '../BaseModule';
|
|
3
|
+
import { SurchargeListItem, SurchargeListModuleAPI } from './types';
|
|
4
|
+
export * from './types';
|
|
5
|
+
export declare class SurchargeListModule extends BaseModule implements Module, SurchargeListModuleAPI {
|
|
6
|
+
protected defaultName: string;
|
|
7
|
+
protected defaultVersion: string;
|
|
8
|
+
private request;
|
|
9
|
+
private store;
|
|
10
|
+
private loadingPromise;
|
|
11
|
+
constructor(name?: string, version?: string);
|
|
12
|
+
initialize(core: PisellCore, options: ModuleOptions): Promise<void>;
|
|
13
|
+
getSurchargeList(): Promise<SurchargeListItem[]>;
|
|
14
|
+
refreshSurchargeList(): Promise<SurchargeListItem[]>;
|
|
15
|
+
private loadSurchargeList;
|
|
16
|
+
}
|
|
@@ -0,0 +1,162 @@
|
|
|
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 _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; }
|
|
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); } }
|
|
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); }); }; }
|
|
5
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
6
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
7
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
8
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
9
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
10
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
11
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
12
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
13
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
14
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
15
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
16
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
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); }
|
|
18
|
+
import { BaseModule } from "../BaseModule";
|
|
19
|
+
export * from "./types";
|
|
20
|
+
export var SurchargeListModule = /*#__PURE__*/function (_BaseModule) {
|
|
21
|
+
_inherits(SurchargeListModule, _BaseModule);
|
|
22
|
+
var _super = _createSuper(SurchargeListModule);
|
|
23
|
+
function SurchargeListModule(name, version) {
|
|
24
|
+
var _this;
|
|
25
|
+
_classCallCheck(this, SurchargeListModule);
|
|
26
|
+
_this = _super.call(this, name, version);
|
|
27
|
+
_defineProperty(_assertThisInitialized(_this), "defaultName", 'surchargeList');
|
|
28
|
+
_defineProperty(_assertThisInitialized(_this), "defaultVersion", '1.0.0');
|
|
29
|
+
_defineProperty(_assertThisInitialized(_this), "request", void 0);
|
|
30
|
+
_defineProperty(_assertThisInitialized(_this), "store", void 0);
|
|
31
|
+
_defineProperty(_assertThisInitialized(_this), "loadingPromise", null);
|
|
32
|
+
return _this;
|
|
33
|
+
}
|
|
34
|
+
_createClass(SurchargeListModule, [{
|
|
35
|
+
key: "initialize",
|
|
36
|
+
value: function () {
|
|
37
|
+
var _initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(core, options) {
|
|
38
|
+
var _options$initialState, _options$initialState2, _options$initialState3;
|
|
39
|
+
var hasInitialSurchargeList;
|
|
40
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
41
|
+
while (1) switch (_context.prev = _context.next) {
|
|
42
|
+
case 0:
|
|
43
|
+
this.core = core;
|
|
44
|
+
this.store = options.store;
|
|
45
|
+
this.request = this.core.getPlugin('request');
|
|
46
|
+
hasInitialSurchargeList = Array.isArray((_options$initialState = options.initialState) === null || _options$initialState === void 0 ? void 0 : _options$initialState.surchargeList);
|
|
47
|
+
this.store.surchargeList = hasInitialSurchargeList ? (_options$initialState2 = options.initialState) === null || _options$initialState2 === void 0 ? void 0 : _options$initialState2.surchargeList : [];
|
|
48
|
+
this.store.isLoaded = Boolean((_options$initialState3 = options.initialState) === null || _options$initialState3 === void 0 ? void 0 : _options$initialState3.isLoaded) || hasInitialSurchargeList;
|
|
49
|
+
if (this.request) {
|
|
50
|
+
_context.next = 8;
|
|
51
|
+
break;
|
|
52
|
+
}
|
|
53
|
+
throw new Error('SurchargeListModule 需要 request 插件支持');
|
|
54
|
+
case 8:
|
|
55
|
+
case "end":
|
|
56
|
+
return _context.stop();
|
|
57
|
+
}
|
|
58
|
+
}, _callee, this);
|
|
59
|
+
}));
|
|
60
|
+
function initialize(_x, _x2) {
|
|
61
|
+
return _initialize.apply(this, arguments);
|
|
62
|
+
}
|
|
63
|
+
return initialize;
|
|
64
|
+
}()
|
|
65
|
+
}, {
|
|
66
|
+
key: "getSurchargeList",
|
|
67
|
+
value: function () {
|
|
68
|
+
var _getSurchargeList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
69
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
70
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
71
|
+
case 0:
|
|
72
|
+
if (!this.store.isLoaded) {
|
|
73
|
+
_context2.next = 2;
|
|
74
|
+
break;
|
|
75
|
+
}
|
|
76
|
+
return _context2.abrupt("return", this.store.surchargeList);
|
|
77
|
+
case 2:
|
|
78
|
+
if (!this.loadingPromise) {
|
|
79
|
+
_context2.next = 4;
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
return _context2.abrupt("return", this.loadingPromise);
|
|
83
|
+
case 4:
|
|
84
|
+
this.loadingPromise = this.loadSurchargeList();
|
|
85
|
+
return _context2.abrupt("return", this.loadingPromise);
|
|
86
|
+
case 6:
|
|
87
|
+
case "end":
|
|
88
|
+
return _context2.stop();
|
|
89
|
+
}
|
|
90
|
+
}, _callee2, this);
|
|
91
|
+
}));
|
|
92
|
+
function getSurchargeList() {
|
|
93
|
+
return _getSurchargeList.apply(this, arguments);
|
|
94
|
+
}
|
|
95
|
+
return getSurchargeList;
|
|
96
|
+
}()
|
|
97
|
+
}, {
|
|
98
|
+
key: "refreshSurchargeList",
|
|
99
|
+
value: function () {
|
|
100
|
+
var _refreshSurchargeList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
101
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
102
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
103
|
+
case 0:
|
|
104
|
+
this.loadingPromise = this.loadSurchargeList();
|
|
105
|
+
return _context3.abrupt("return", this.loadingPromise);
|
|
106
|
+
case 2:
|
|
107
|
+
case "end":
|
|
108
|
+
return _context3.stop();
|
|
109
|
+
}
|
|
110
|
+
}, _callee3, this);
|
|
111
|
+
}));
|
|
112
|
+
function refreshSurchargeList() {
|
|
113
|
+
return _refreshSurchargeList.apply(this, arguments);
|
|
114
|
+
}
|
|
115
|
+
return refreshSurchargeList;
|
|
116
|
+
}()
|
|
117
|
+
}, {
|
|
118
|
+
key: "loadSurchargeList",
|
|
119
|
+
value: function () {
|
|
120
|
+
var _loadSurchargeList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
121
|
+
var surchargeList;
|
|
122
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
123
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
124
|
+
case 0:
|
|
125
|
+
_context4.prev = 0;
|
|
126
|
+
_context4.next = 3;
|
|
127
|
+
return this.request.get('/order/custom-surcharge/available/v2', {
|
|
128
|
+
channel: 'online-store',
|
|
129
|
+
is_assemble_product_data: 1,
|
|
130
|
+
is_assemble_schedule_data: 1,
|
|
131
|
+
with: ['relationSchedule']
|
|
132
|
+
});
|
|
133
|
+
case 3:
|
|
134
|
+
surchargeList = _context4.sent;
|
|
135
|
+
this.store.surchargeList = (surchargeList === null || surchargeList === void 0 ? void 0 : surchargeList.data) || [];
|
|
136
|
+
this.store.isLoaded = true;
|
|
137
|
+
return _context4.abrupt("return", this.store.surchargeList);
|
|
138
|
+
case 9:
|
|
139
|
+
_context4.prev = 9;
|
|
140
|
+
_context4.t0 = _context4["catch"](0);
|
|
141
|
+
console.warn('[SurchargeListModule] 加载附加费配置失败', _context4.t0);
|
|
142
|
+
this.store.surchargeList = [];
|
|
143
|
+
this.store.isLoaded = true;
|
|
144
|
+
return _context4.abrupt("return", this.store.surchargeList);
|
|
145
|
+
case 15:
|
|
146
|
+
_context4.prev = 15;
|
|
147
|
+
this.loadingPromise = null;
|
|
148
|
+
return _context4.finish(15);
|
|
149
|
+
case 18:
|
|
150
|
+
case "end":
|
|
151
|
+
return _context4.stop();
|
|
152
|
+
}
|
|
153
|
+
}, _callee4, this, [[0, 9, 15, 18]]);
|
|
154
|
+
}));
|
|
155
|
+
function loadSurchargeList() {
|
|
156
|
+
return _loadSurchargeList.apply(this, arguments);
|
|
157
|
+
}
|
|
158
|
+
return loadSurchargeList;
|
|
159
|
+
}()
|
|
160
|
+
}]);
|
|
161
|
+
return SurchargeListModule;
|
|
162
|
+
}(BaseModule);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface SurchargeListItem {
|
|
2
|
+
[key: string]: any;
|
|
3
|
+
}
|
|
4
|
+
export interface SurchargeListState {
|
|
5
|
+
surchargeList: SurchargeListItem[];
|
|
6
|
+
isLoaded: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface SurchargeListModuleAPI {
|
|
9
|
+
getSurchargeList(): Promise<SurchargeListItem[]>;
|
|
10
|
+
refreshSurchargeList(): Promise<SurchargeListItem[]>;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/modules/index.d.ts
CHANGED
|
@@ -12,7 +12,9 @@ export * from './Resource';
|
|
|
12
12
|
export * from './Step';
|
|
13
13
|
export * from './Summary';
|
|
14
14
|
export * from './SalesSummary';
|
|
15
|
+
export * from './SurchargeList';
|
|
15
16
|
export * from './Schedule';
|
|
16
17
|
export * from './Quotation';
|
|
17
18
|
export * from './ScanOrderLogger';
|
|
18
19
|
export * from './OpenData';
|
|
20
|
+
export * from './BookingContext';
|
package/dist/modules/index.js
CHANGED
|
@@ -12,7 +12,9 @@ export * from "./Resource";
|
|
|
12
12
|
export * from "./Step";
|
|
13
13
|
export * from "./Summary";
|
|
14
14
|
export * from "./SalesSummary";
|
|
15
|
+
export * from "./SurchargeList";
|
|
15
16
|
export * from "./Schedule";
|
|
16
17
|
export * from "./Quotation";
|
|
17
18
|
export * from "./ScanOrderLogger";
|
|
18
|
-
export * from "./OpenData";
|
|
19
|
+
export * from "./OpenData";
|
|
20
|
+
export * from "./BookingContext";
|
package/dist/server/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { QuotationModule } from './modules/quotation';
|
|
|
4
4
|
import { ScheduleModuleEx } from './modules/schedule';
|
|
5
5
|
import { ResourceModule } from './modules/resource';
|
|
6
6
|
import { FloorPlanModule } from './modules/floor-plan';
|
|
7
|
+
import { PaymentServerModule } from './modules/payment';
|
|
7
8
|
import { PisellCore, ServerModuleConfig, InitializeServerOptions } from '../types';
|
|
8
9
|
import type { RouteHandler, HttpMethod, RouteDefinition, Router, ModuleRegistryConfig, RequestSetting } from './types';
|
|
9
10
|
import { OrderModule } from './modules/order';
|
|
@@ -23,6 +24,11 @@ declare class Server {
|
|
|
23
24
|
resource?: ResourceModule;
|
|
24
25
|
order?: OrderModule;
|
|
25
26
|
floor_plan?: FloorPlanModule;
|
|
27
|
+
payment?: PaymentServerModule;
|
|
28
|
+
private paymentRouteModule?;
|
|
29
|
+
private paymentRouteModuleInFlight?;
|
|
30
|
+
private quotationAvailableCache;
|
|
31
|
+
private quotationAvailableInFlight;
|
|
26
32
|
/** GET 前缀路由(最长前缀优先匹配) */
|
|
27
33
|
private prefixRouterGet;
|
|
28
34
|
router: Router;
|
|
@@ -33,6 +39,8 @@ declare class Server {
|
|
|
33
39
|
private bookingRemoteCache;
|
|
34
40
|
private readonly BOOKING_REMOTE_CACHE_TTL_MS;
|
|
35
41
|
private readonly BOOKING_REMOTE_CACHE_MAX_ENTRIES;
|
|
42
|
+
private salesSearchSubscribers;
|
|
43
|
+
private deviceTaskActionsRegistered;
|
|
36
44
|
private floorPlanQuerySubscribers;
|
|
37
45
|
private moduleRegistry;
|
|
38
46
|
constructor(core: PisellCore);
|
|
@@ -85,6 +93,11 @@ declare class Server {
|
|
|
85
93
|
config: ModuleRegistryConfig;
|
|
86
94
|
shouldPreload: boolean;
|
|
87
95
|
}[]>;
|
|
96
|
+
private registerDeviceTaskActions;
|
|
97
|
+
private handleSyncSalesTask;
|
|
98
|
+
private runCheckoutSync;
|
|
99
|
+
private omitCheckoutSyncMode;
|
|
100
|
+
private persistSyncedCheckoutOrder;
|
|
88
101
|
/**
|
|
89
102
|
* 将普通层 QuotationModule 的报价单计算能力桥接到 Server Products 模块。
|
|
90
103
|
*/
|
|
@@ -167,6 +180,11 @@ declare class Server {
|
|
|
167
180
|
* @private
|
|
168
181
|
*/
|
|
169
182
|
private registerServerRoutes;
|
|
183
|
+
private getPaymentRouteModule;
|
|
184
|
+
private handlePaymentMethods;
|
|
185
|
+
private handleQuotationAvailable;
|
|
186
|
+
private fetchQuotationAvailableFromAPI;
|
|
187
|
+
private isSuccessfulRemoteResponse;
|
|
170
188
|
/**
|
|
171
189
|
* 根据 subscriberId 移除商品查询订阅者
|
|
172
190
|
*/
|
|
@@ -194,6 +212,84 @@ declare class Server {
|
|
|
194
212
|
* 取消订单列表查询订阅(HTTP 路由入口)
|
|
195
213
|
*/
|
|
196
214
|
private handleUnsubscribeOrderQuery;
|
|
215
|
+
/**
|
|
216
|
+
* 处理 sales 单模块搜索:请求透传后端,仅在 OS 层维护已返回订单号集合。
|
|
217
|
+
*
|
|
218
|
+
* @example
|
|
219
|
+
* await this.handleSalesSearchModule({ url: '/shop/es/search/sales', method: 'post', data: { keyword: 'A' } })
|
|
220
|
+
*/
|
|
221
|
+
private handleSalesSearchModule;
|
|
222
|
+
/**
|
|
223
|
+
* 处理 sales 聚合搜索:请求透传后端,仅订阅 sales 分组的已返回订单号。
|
|
224
|
+
*
|
|
225
|
+
* @example
|
|
226
|
+
* await this.handleSalesSearchAggregate({ url: '/shop/es/search', method: 'post', data: { modules: [] } })
|
|
227
|
+
*/
|
|
228
|
+
private handleSalesSearchAggregate;
|
|
229
|
+
/**
|
|
230
|
+
* 取消 sales 搜索订阅。
|
|
231
|
+
*
|
|
232
|
+
* @example
|
|
233
|
+
* await this.handleUnsubscribeSalesSearch({ data: { subscriberId: 'global-search-order' } } as any)
|
|
234
|
+
*/
|
|
235
|
+
private handleUnsubscribeSalesSearch;
|
|
236
|
+
/**
|
|
237
|
+
* 执行 sales 搜索并登记可见订单号。
|
|
238
|
+
* 搜索参数完全透传后端,OS 不做过滤、筛选、排序。
|
|
239
|
+
*
|
|
240
|
+
* @example
|
|
241
|
+
* const result = await this.handleSalesSearchRequest('single', '/shop/es/search/sales', { keyword: '1001' }, {})
|
|
242
|
+
*/
|
|
243
|
+
private handleSalesSearchRequest;
|
|
244
|
+
/**
|
|
245
|
+
* 透传调用后端 sales 搜索接口。
|
|
246
|
+
*
|
|
247
|
+
* @example
|
|
248
|
+
* const res = await this.fetchSalesSearchFromAPI('/shop/es/search/sales', { keyword: '1001' })
|
|
249
|
+
*/
|
|
250
|
+
private fetchSalesSearchFromAPI;
|
|
251
|
+
/**
|
|
252
|
+
* 构建搜索订阅签名;页码变化不重置,可继续累计 visibleOrderIds。
|
|
253
|
+
*
|
|
254
|
+
* @example
|
|
255
|
+
* const signature = this.buildSalesSearchSignature('single', { keyword: 'A', page: 2 })
|
|
256
|
+
*/
|
|
257
|
+
private buildSalesSearchSignature;
|
|
258
|
+
/**
|
|
259
|
+
* 移除页码参数,保留 page size、keyword、filters、sort 等查询语义参数。
|
|
260
|
+
*
|
|
261
|
+
* @example
|
|
262
|
+
* this.stripSalesSearchPageParams({ page: 2, per_page: 20, keyword: 'A' })
|
|
263
|
+
*/
|
|
264
|
+
private stripSalesSearchPageParams;
|
|
265
|
+
/**
|
|
266
|
+
* 提取响应 data,兼容 OS 包装结构与后端直接响应结构。
|
|
267
|
+
*
|
|
268
|
+
* @example
|
|
269
|
+
* const data = this.extractSalesSearchResponseData(result)
|
|
270
|
+
*/
|
|
271
|
+
private extractSalesSearchResponseData;
|
|
272
|
+
/**
|
|
273
|
+
* 从搜索响应中提取 sales 命中的订单号。
|
|
274
|
+
*
|
|
275
|
+
* @example
|
|
276
|
+
* const ids = this.extractSalesSearchOrderIds('single', result)
|
|
277
|
+
*/
|
|
278
|
+
private extractSalesSearchOrderIds;
|
|
279
|
+
/**
|
|
280
|
+
* 查找聚合搜索响应中的 sales 分组。
|
|
281
|
+
*
|
|
282
|
+
* @example
|
|
283
|
+
* const group = this.findSalesSearchAggregateGroup({ results: [{ module: 'sales' }] })
|
|
284
|
+
*/
|
|
285
|
+
private findSalesSearchAggregateGroup;
|
|
286
|
+
/**
|
|
287
|
+
* 从订单或搜索命中项中取订单号。
|
|
288
|
+
*
|
|
289
|
+
* @example
|
|
290
|
+
* const id = this.getSalesSearchOrderId({ order_id: 1001 })
|
|
291
|
+
*/
|
|
292
|
+
private getSalesSearchOrderId;
|
|
197
293
|
/**
|
|
198
294
|
* 从查询值中提取 YYYY-MM-DD 日期串。
|
|
199
295
|
*
|
|
@@ -284,6 +380,49 @@ declare class Server {
|
|
|
284
380
|
* @example 批量:GET /update/localOrder?order_ids=96971,96972,96973
|
|
285
381
|
*/
|
|
286
382
|
private handleUpdateLocalOrder;
|
|
383
|
+
private handleOrderSalesCheckout;
|
|
384
|
+
private handleOrderCheckout;
|
|
385
|
+
private getDeviceTaskPlugin;
|
|
386
|
+
private getIdGeneratorPlugin;
|
|
387
|
+
private getAppData;
|
|
388
|
+
private getSmallTicketShopInfo;
|
|
389
|
+
private taskOk;
|
|
390
|
+
private taskFail;
|
|
391
|
+
private taskTimeout;
|
|
392
|
+
private getShortNumberOrDeviceId;
|
|
393
|
+
private buildCheckoutTaskIdempotencyKey;
|
|
394
|
+
private isBlankCheckoutValue;
|
|
395
|
+
private isLocalCheckoutOrderId;
|
|
396
|
+
private normalizeCheckoutSubmitData;
|
|
397
|
+
private ensureCheckoutOrderNumbers;
|
|
398
|
+
private dispatchCheckoutSyncTask;
|
|
399
|
+
private dispatchPrintOtherReceiptTask;
|
|
400
|
+
private buildPrintOtherReceiptIdempotencyKey;
|
|
401
|
+
private getPrintOrderIdentity;
|
|
402
|
+
private dispatchLocalReceiptPrint;
|
|
403
|
+
private shouldLookupLocalPrintOrder;
|
|
404
|
+
private getLocalPrintOrderLookup;
|
|
405
|
+
private handleLocalPrintOrder;
|
|
406
|
+
private handleOrderCheckoutSubmit;
|
|
407
|
+
private handleSyncCheckoutSubmit;
|
|
408
|
+
private handlePendingSyncCheckoutOrder;
|
|
409
|
+
private buildPendingSyncCheckoutOrder;
|
|
410
|
+
private shouldBuildSmallTicketData;
|
|
411
|
+
private shouldPrintSyncedOrder;
|
|
412
|
+
private hasPaymentStatus;
|
|
413
|
+
private isSalesOrderFullyPaid;
|
|
414
|
+
private sumPaidOrderPayments;
|
|
415
|
+
private toAmountNumber;
|
|
416
|
+
private buildSmallTicketProductMap;
|
|
417
|
+
private withPendingSyncProductTitles;
|
|
418
|
+
private buildProductTitleSnapshot;
|
|
419
|
+
private getProductTitleSnapshotCurrentLocale;
|
|
420
|
+
private normalizeProductTitleSnapshotLocale;
|
|
421
|
+
private resolveProductTitleValue;
|
|
422
|
+
private canAssignStringProductTitleToLocale;
|
|
423
|
+
private hasCjkText;
|
|
424
|
+
private resolveFirstProductTitleValue;
|
|
425
|
+
private withLocalSmallTicketData;
|
|
287
426
|
private handleOrderSalesDetail;
|
|
288
427
|
/**
|
|
289
428
|
* 解析 order_ids 入参,兼容 url query / data 字段、字符串(csv) / 数组两种形态。
|
|
@@ -311,8 +450,22 @@ declare class Server {
|
|
|
311
450
|
* 从 url 中解析指定 query 参数,兼容相对路径与绝对路径
|
|
312
451
|
*/
|
|
313
452
|
private extractQueryParam;
|
|
314
|
-
private
|
|
453
|
+
private extractOrderSalesDetailLookup;
|
|
454
|
+
private shouldForceRemoteSalesDetail;
|
|
315
455
|
private buildOrderSalesDetailBackendPath;
|
|
456
|
+
private extractOrderDataFromCheckoutResponse;
|
|
457
|
+
private getCheckoutExternalSaleNumber;
|
|
458
|
+
private buildCheckoutSyncSuccessPatch;
|
|
459
|
+
private buildSyncedOrderForPrint;
|
|
460
|
+
private isMergeableCheckoutOrder;
|
|
461
|
+
private normalizeCheckoutResponse;
|
|
462
|
+
private withSyncedOrderIdInCheckoutResponse;
|
|
463
|
+
private isCheckoutResponseRejected;
|
|
464
|
+
private getUnknownErrorMessage;
|
|
465
|
+
private normalizeUnknownError;
|
|
466
|
+
private safeJsonClone;
|
|
467
|
+
private extractBackendErrorResponse;
|
|
468
|
+
private isExplicitBackendErrorResponse;
|
|
316
469
|
/**
|
|
317
470
|
* 从 url 或路由 path 解析 pathname(不含 query,去掉末尾 /)
|
|
318
471
|
*/
|
|
@@ -348,6 +501,27 @@ declare class Server {
|
|
|
348
501
|
* 从订单中展开 bookings,再按条件筛选 + 分页
|
|
349
502
|
*/
|
|
350
503
|
private computeBookingQueryResult;
|
|
504
|
+
/**
|
|
505
|
+
* 规范商品扩展类型过滤参数。
|
|
506
|
+
*
|
|
507
|
+
* @example
|
|
508
|
+
* const types = this.normalizeProductExtensionTypes(['product_add_time']);
|
|
509
|
+
*/
|
|
510
|
+
private normalizeProductExtensionTypes;
|
|
511
|
+
/**
|
|
512
|
+
* 请求包含 product_add_time 时,按传入 extension_type 数组配置过滤商品。
|
|
513
|
+
*
|
|
514
|
+
* @example
|
|
515
|
+
* const list = this.filterProductsByExtensionTypes(products, ['product_add_time']);
|
|
516
|
+
*/
|
|
517
|
+
private filterProductsByExtensionTypes;
|
|
518
|
+
/**
|
|
519
|
+
* 判断本次查询是否需要跳过餐牌过滤,直接按扩展类型拉商品。
|
|
520
|
+
*
|
|
521
|
+
* @example
|
|
522
|
+
* const skipMenu = this.shouldQueryProductsByExtensionTypes(['product_add_time']);
|
|
523
|
+
*/
|
|
524
|
+
private shouldQueryProductsByExtensionTypes;
|
|
351
525
|
/**
|
|
352
526
|
* 商品查询的核心计算逻辑(编排 Products、Menu、Schedule 模块)
|
|
353
527
|
* 供 handleProductQuery 首次返回及 pubsub 变更推送复用
|
|
@@ -367,6 +541,35 @@ declare class Server {
|
|
|
367
541
|
* 订单数据变更后,遍历订阅者重新计算并通过 callback 推送
|
|
368
542
|
*/
|
|
369
543
|
private recomputeAndNotifyOrderQuery;
|
|
544
|
+
/**
|
|
545
|
+
* 订单变更后通知 sales 搜索订阅者。
|
|
546
|
+
* 仅回传当前查询已返回订单号集合中的变更订单。
|
|
547
|
+
*
|
|
548
|
+
* @example
|
|
549
|
+
* this.notifySalesSearchSubscribers({ list: [], changedOrders: [order], source: 'pubsub.bodyUpsert' })
|
|
550
|
+
*/
|
|
551
|
+
private notifySalesSearchSubscribers;
|
|
552
|
+
/**
|
|
553
|
+
* 从订单变更事件中提取明确 delta。
|
|
554
|
+
*
|
|
555
|
+
* @example
|
|
556
|
+
* const list = this.extractChangedOrdersFromPayload(payload)
|
|
557
|
+
*/
|
|
558
|
+
private extractChangedOrdersFromPayload;
|
|
559
|
+
/**
|
|
560
|
+
* 构建与当前搜索接口一致的 delta 响应。
|
|
561
|
+
*
|
|
562
|
+
* @example
|
|
563
|
+
* const response = this.buildSalesSearchDeltaResponse(subscriber, [order])
|
|
564
|
+
*/
|
|
565
|
+
private buildSalesSearchDeltaResponse;
|
|
566
|
+
/**
|
|
567
|
+
* 构建聚合搜索接口的 sales 分组 delta 响应。
|
|
568
|
+
*
|
|
569
|
+
* @example
|
|
570
|
+
* const response = this.buildAggregateSalesSearchDeltaResponse(subscriber, [order])
|
|
571
|
+
*/
|
|
572
|
+
private buildAggregateSalesSearchDeltaResponse;
|
|
370
573
|
/**
|
|
371
574
|
* 预约数据变更后,遍历订阅者重新计算并通过 callback 推送
|
|
372
575
|
*/
|