@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
|
@@ -40,7 +40,7 @@ var import_isSameOrAfter = __toESM(require("dayjs/plugin/isSameOrAfter"));
|
|
|
40
40
|
var import_utils = require("../../../solution/ShopDiscount/utils");
|
|
41
41
|
import_dayjs.default.extend(import_isSameOrBefore.default);
|
|
42
42
|
import_dayjs.default.extend(import_isSameOrAfter.default);
|
|
43
|
-
var
|
|
43
|
+
var INDEXDB_STORE_NAME = "schedule";
|
|
44
44
|
var ScheduleModuleEx = class extends import_BaseModule.BaseModule {
|
|
45
45
|
// LoggerManager 实例
|
|
46
46
|
constructor(name, version) {
|
|
@@ -117,12 +117,12 @@ var ScheduleModuleEx = class extends import_BaseModule.BaseModule {
|
|
|
117
117
|
const appPlugin = core.getPlugin("app");
|
|
118
118
|
if (appPlugin) {
|
|
119
119
|
const app = appPlugin.getApp();
|
|
120
|
-
this.dbManager = app.
|
|
120
|
+
this.dbManager = app.dbManager;
|
|
121
121
|
this.logger = app.logger;
|
|
122
122
|
if (this.dbManager) {
|
|
123
|
-
console.log("[Schedule]
|
|
123
|
+
console.log("[Schedule] IndexDB Manager 已初始化");
|
|
124
124
|
} else {
|
|
125
|
-
console.warn("[Schedule]
|
|
125
|
+
console.warn("[Schedule] IndexDB Manager 未找到");
|
|
126
126
|
}
|
|
127
127
|
}
|
|
128
128
|
this.logInfo("模块初始化完成", {
|
|
@@ -150,7 +150,7 @@ var ScheduleModuleEx = class extends import_BaseModule.BaseModule {
|
|
|
150
150
|
scheduleCount: list.length,
|
|
151
151
|
duration: `${duration}ms`
|
|
152
152
|
});
|
|
153
|
-
await this.
|
|
153
|
+
await this.saveScheduleToIndexDB(list);
|
|
154
154
|
this.setScheduleList(list);
|
|
155
155
|
return list;
|
|
156
156
|
} catch (error) {
|
|
@@ -183,9 +183,8 @@ var ScheduleModuleEx = class extends import_BaseModule.BaseModule {
|
|
|
183
183
|
return [];
|
|
184
184
|
}
|
|
185
185
|
const result = [];
|
|
186
|
-
const scheduleList = this.store.scheduleList || [];
|
|
187
186
|
for (const id of ids) {
|
|
188
|
-
const schedule = this.store.map.get(id)
|
|
187
|
+
const schedule = this.store.map.get(id);
|
|
189
188
|
if (schedule) {
|
|
190
189
|
result.push(schedule);
|
|
191
190
|
}
|
|
@@ -220,13 +219,13 @@ var ScheduleModuleEx = class extends import_BaseModule.BaseModule {
|
|
|
220
219
|
this.store.map.clear();
|
|
221
220
|
if (this.dbManager) {
|
|
222
221
|
try {
|
|
223
|
-
await this.dbManager.clear(
|
|
224
|
-
console.log("[Schedule]
|
|
225
|
-
this.logInfo("
|
|
222
|
+
await this.dbManager.clear(INDEXDB_STORE_NAME);
|
|
223
|
+
console.log("[Schedule] IndexDB 缓存已清空");
|
|
224
|
+
this.logInfo("IndexDB 缓存已清空");
|
|
226
225
|
} catch (error) {
|
|
227
226
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
228
|
-
console.error("[Schedule] 清空
|
|
229
|
-
this.logError("清空
|
|
227
|
+
console.error("[Schedule] 清空 IndexDB 缓存失败:", error);
|
|
228
|
+
this.logError("清空 IndexDB 缓存失败", { error: errorMessage });
|
|
230
229
|
}
|
|
231
230
|
}
|
|
232
231
|
this.logInfo("缓存清空完成");
|
|
@@ -255,58 +254,51 @@ var ScheduleModuleEx = class extends import_BaseModule.BaseModule {
|
|
|
255
254
|
return result;
|
|
256
255
|
}
|
|
257
256
|
/**
|
|
258
|
-
* 从
|
|
257
|
+
* 从 IndexDB 加载日程数据
|
|
259
258
|
* @private
|
|
260
259
|
*/
|
|
261
|
-
async
|
|
260
|
+
async loadScheduleFromIndexDB() {
|
|
262
261
|
if (!this.dbManager) {
|
|
263
|
-
this.logWarning("
|
|
262
|
+
this.logWarning("loadScheduleFromIndexDB: dbManager 不可用");
|
|
264
263
|
return [];
|
|
265
264
|
}
|
|
266
265
|
try {
|
|
267
|
-
const scheduleList = await this.dbManager.getAll(
|
|
268
|
-
this.logInfo("从
|
|
266
|
+
const scheduleList = await this.dbManager.getAll(INDEXDB_STORE_NAME);
|
|
267
|
+
this.logInfo("从 IndexDB 加载日程数据", {
|
|
269
268
|
scheduleCount: (scheduleList == null ? void 0 : scheduleList.length) ?? 0
|
|
270
269
|
});
|
|
271
270
|
return scheduleList || [];
|
|
272
271
|
} catch (error) {
|
|
273
272
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
274
|
-
console.error("[Schedule] 从
|
|
275
|
-
this.logError("从
|
|
273
|
+
console.error("[Schedule] 从 IndexDB 读取数据失败:", error);
|
|
274
|
+
this.logError("从 IndexDB 读取数据失败", { error: errorMessage });
|
|
276
275
|
return [];
|
|
277
276
|
}
|
|
278
277
|
}
|
|
279
278
|
/**
|
|
280
|
-
* 保存日程数据到
|
|
279
|
+
* 保存日程数据到 IndexDB
|
|
281
280
|
* @private
|
|
282
281
|
*/
|
|
283
|
-
async
|
|
282
|
+
async saveScheduleToIndexDB(scheduleList) {
|
|
284
283
|
if (!this.dbManager) {
|
|
285
|
-
this.logWarning("
|
|
284
|
+
this.logWarning("saveScheduleToIndexDB: dbManager 不可用");
|
|
286
285
|
return;
|
|
287
286
|
}
|
|
288
|
-
this.logInfo("开始保存日程数据到
|
|
287
|
+
this.logInfo("开始保存日程数据到 IndexDB", { scheduleCount: scheduleList.length });
|
|
289
288
|
try {
|
|
290
|
-
await this.dbManager.clear(
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
await this.dbManager.bulkUpdate(SCHEDULE_STORE_NAME, scheduleList);
|
|
296
|
-
} else {
|
|
297
|
-
await Promise.all(scheduleList.map(
|
|
298
|
-
(schedule) => this.dbManager.add(SCHEDULE_STORE_NAME, schedule)
|
|
299
|
-
));
|
|
300
|
-
}
|
|
301
|
-
}
|
|
289
|
+
await this.dbManager.clear(INDEXDB_STORE_NAME);
|
|
290
|
+
const savePromises = scheduleList.map(
|
|
291
|
+
(schedule) => this.dbManager.add(INDEXDB_STORE_NAME, schedule)
|
|
292
|
+
);
|
|
293
|
+
await Promise.all(savePromises);
|
|
302
294
|
console.log(
|
|
303
|
-
`[Schedule] 已将 ${scheduleList.length} 条日程数据保存到
|
|
295
|
+
`[Schedule] 已将 ${scheduleList.length} 条日程数据保存到 IndexDB`
|
|
304
296
|
);
|
|
305
|
-
this.logInfo("日程数据已保存到
|
|
297
|
+
this.logInfo("日程数据已保存到 IndexDB", { scheduleCount: scheduleList.length });
|
|
306
298
|
} catch (error) {
|
|
307
299
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
308
|
-
console.error("[Schedule] 保存数据到
|
|
309
|
-
this.logError("保存数据到
|
|
300
|
+
console.error("[Schedule] 保存数据到 IndexDB 失败:", error);
|
|
301
|
+
this.logError("保存数据到 IndexDB 失败", {
|
|
310
302
|
scheduleCount: scheduleList.length,
|
|
311
303
|
error: errorMessage
|
|
312
304
|
});
|
|
@@ -321,30 +313,31 @@ var ScheduleModuleEx = class extends import_BaseModule.BaseModule {
|
|
|
321
313
|
const startTime = Date.now();
|
|
322
314
|
this.logInfo("开始预加载数据");
|
|
323
315
|
try {
|
|
324
|
-
const cachedData = await this.
|
|
316
|
+
const cachedData = await this.loadScheduleFromIndexDB();
|
|
325
317
|
if (cachedData && cachedData.length > 0) {
|
|
326
318
|
console.log(
|
|
327
|
-
`[Schedule] 从
|
|
319
|
+
`[Schedule] 从 IndexDB 加载了 ${cachedData.length} 条日程数据`
|
|
328
320
|
);
|
|
329
321
|
this.store.scheduleList = (0, import_lodash_es.cloneDeep)(cachedData);
|
|
330
322
|
this.syncScheduleMap();
|
|
331
323
|
const duration = Date.now() - startTime;
|
|
332
|
-
this.logInfo("预加载完成(从
|
|
324
|
+
this.logInfo("预加载完成(从 IndexDB)", {
|
|
333
325
|
scheduleCount: cachedData.length,
|
|
334
326
|
duration: `${duration}ms`,
|
|
335
|
-
source: "
|
|
327
|
+
source: "IndexDB"
|
|
336
328
|
});
|
|
337
329
|
return;
|
|
338
330
|
}
|
|
339
|
-
console.log("[Schedule]
|
|
340
|
-
this.logInfo("
|
|
331
|
+
console.log("[Schedule] IndexDB 中没有缓存数据,从服务器加载...");
|
|
332
|
+
this.logInfo("IndexDB 中没有缓存数据,准备从服务器加载");
|
|
341
333
|
} catch (error) {
|
|
342
334
|
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
343
|
-
console.warn("[Schedule] 从
|
|
344
|
-
this.logWarning("从
|
|
335
|
+
console.warn("[Schedule] 从 IndexDB 加载数据失败:", error);
|
|
336
|
+
this.logWarning("从 IndexDB 加载数据失败,准备从服务器加载", { error: errorMessage });
|
|
345
337
|
}
|
|
346
338
|
const scheduleList = await this.loadAllSchedule();
|
|
347
339
|
if (scheduleList && scheduleList.length > 0) {
|
|
340
|
+
await this.saveScheduleToIndexDB(scheduleList);
|
|
348
341
|
this.store.scheduleList = (0, import_lodash_es.cloneDeep)(scheduleList);
|
|
349
342
|
this.syncScheduleMap();
|
|
350
343
|
const duration = Date.now() - startTime;
|
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
import { Module, ModuleOptions, PisellCore } from '../../types';
|
|
2
2
|
import { BaseModule } from '../../modules/BaseModule';
|
|
3
|
-
import { BaseSalesOrderProduct, BaseSalesOrderProductIdentity, BaseSalesPaymentStatus,
|
|
3
|
+
import { BaseSalesOrderProduct, BaseSalesOrderProductIdentity, BaseSalesPaymentStatus, BaseSalesScanCodeResult } from './types';
|
|
4
4
|
import { OrderModule } from '../../modules/Order';
|
|
5
|
-
import type { AddProductBookingInput, LoadSalesDetailParams, OrderPaymentData, OrderPaymentSource, SendCustomerPayLinkParams, SyncPaymentsToOrderParams, SyncPaymentsToOrderResult, UpdateTempOrderCustomerInput,
|
|
5
|
+
import type { AddProductBookingInput, LoadSalesDetailParams, OrderPaymentData, OrderPaymentSource, SendCustomerPayLinkParams, SyncPaymentsToOrderParams, SyncPaymentsToOrderResult, UpdateTempOrderCustomerInput, UpdateProductInOrderParams } from '../../modules/Order/types';
|
|
6
6
|
import type { SubmitPayloadEnhancer } from '../../modules/Order/utils';
|
|
7
7
|
import type { Discount } from '../../modules/Discount/types';
|
|
8
8
|
import { RequestPlugin, WindowPlugin } from '../../plugins';
|
|
9
9
|
export * from './types';
|
|
10
10
|
import { ProductList } from '../../modules/ProductList';
|
|
11
11
|
import { PaymentModule } from '../../modules/Payment';
|
|
12
|
-
import type { PaymentMethod } from '../../modules/Payment/types';
|
|
13
12
|
import type { SalesSummaryModule } from '../../modules/SalesSummary';
|
|
14
13
|
import type { ScheduleModule } from '../../modules/Schedule';
|
|
15
|
-
import { QuotationModule } from '../../modules/Quotation';
|
|
16
14
|
import type { ISalesDetail, ISalesDetailHeader, ISalesBooking, ISalesPayment, ISalesSurcharge } from './utils/parseSalesResponse';
|
|
17
|
-
import { AppPlugin } from '../../plugins/app';
|
|
18
15
|
import { type TransformBaseProductToOrderProductParams } from './utils/transformBaseProductToOrderProduct';
|
|
19
16
|
export interface BaseSalesState {
|
|
20
17
|
order?: OrderModule;
|
|
@@ -22,16 +19,13 @@ export interface BaseSalesState {
|
|
|
22
19
|
payment?: PaymentModule;
|
|
23
20
|
salesSummary?: SalesSummaryModule;
|
|
24
21
|
schedule?: ScheduleModule;
|
|
25
|
-
quotation?: QuotationModule;
|
|
26
22
|
}
|
|
27
|
-
export type BaseSalesPrintLocalOrderReceiptParams = string | number;
|
|
28
23
|
export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
29
24
|
protected defaultName: string;
|
|
30
25
|
protected defaultVersion: string;
|
|
31
26
|
isSolution: boolean;
|
|
32
27
|
protected initializeOptions: ModuleOptions;
|
|
33
28
|
private logger;
|
|
34
|
-
protected appPlugin: AppPlugin;
|
|
35
29
|
protected store: BaseSalesState;
|
|
36
30
|
protected otherParams: Record<string, any>;
|
|
37
31
|
protected cacheId: string | undefined;
|
|
@@ -42,13 +36,10 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
42
36
|
window: WindowPlugin;
|
|
43
37
|
request: RequestPlugin;
|
|
44
38
|
protected currentSalesDetail: ISalesDetail | null;
|
|
45
|
-
protected discountConfigCacheKey: string | null;
|
|
46
|
-
protected hasManualDiscountSelection: boolean;
|
|
47
|
-
private paymentMethodsCache;
|
|
48
39
|
constructor(name?: string, version?: string);
|
|
49
40
|
/**
|
|
50
41
|
* 子类可覆盖此方法以追加/收敛要注册的子模块。
|
|
51
|
-
* 默认包含通用销售模块:products / order / salesSummary / schedule / payment
|
|
42
|
+
* 默认包含通用销售模块:products / order / salesSummary / schedule / payment。
|
|
52
43
|
*/
|
|
53
44
|
protected getRegisteredModuleNames(): readonly string[];
|
|
54
45
|
/**
|
|
@@ -63,19 +54,7 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
63
54
|
* 记录错误日志
|
|
64
55
|
*/
|
|
65
56
|
private logError;
|
|
66
|
-
private hydrateOrderPaymentNames;
|
|
67
57
|
get payment(): PaymentModule | undefined;
|
|
68
|
-
private getCurrentOrderCustomerId;
|
|
69
|
-
private applyQuotationScheduleResolver;
|
|
70
|
-
private loadQuotationForPriceQuery;
|
|
71
|
-
private getPriceQueryProductId;
|
|
72
|
-
private getPriceQuerySchedule;
|
|
73
|
-
private loadProductForPriceQuery;
|
|
74
|
-
private getAuthoritativeBundleItems;
|
|
75
|
-
private findAuthoritativeBundleItem;
|
|
76
|
-
private getAuthoritativeBundleUnitPrice;
|
|
77
|
-
private mergeProductForPriceQuery;
|
|
78
|
-
protected getSubmitOrderSalesChannel(): string | undefined;
|
|
79
58
|
/**
|
|
80
59
|
* 工厂入口:根据子模块名实例化对应模块。
|
|
81
60
|
* 默认使用 BookingByStep 公共 `createModule`。子类若需引入额外类型(如 customer),
|
|
@@ -83,35 +62,16 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
83
62
|
*/
|
|
84
63
|
protected createSubModule(moduleName: string): Module | null;
|
|
85
64
|
protected getSubModuleHooks(moduleName: string): any;
|
|
86
|
-
/**
|
|
87
|
-
* 构造传给 BaseSales 子模块的完整运行态参数,保证初始化和后续同步语义一致。
|
|
88
|
-
*
|
|
89
|
-
* @example
|
|
90
|
-
* const params = this.buildSubModuleOtherParams();
|
|
91
|
-
* this.core.registerModule(orderModule, { otherParams: params });
|
|
92
|
-
*/
|
|
93
|
-
protected buildSubModuleOtherParams(): Record<string, any>;
|
|
94
|
-
/**
|
|
95
|
-
* 将父级 otherParams 的变更显式同步给已注册的子模块。
|
|
96
|
-
*
|
|
97
|
-
* @example
|
|
98
|
-
* await this.syncOtherParamsToSubModules({ channel: 'pos' });
|
|
99
|
-
*/
|
|
100
|
-
protected syncOtherParamsToSubModules(changedParams: Record<string, any>, { cover }?: {
|
|
101
|
-
cover?: boolean;
|
|
102
|
-
}): Promise<void>;
|
|
103
65
|
/**
|
|
104
66
|
* 读取 sessionStorage[this.name][cacheId],作为子模块 initialState 的来源。
|
|
105
67
|
* sessionStorage 损坏时静默忽略,按空状态注册。
|
|
106
68
|
*/
|
|
107
69
|
protected readSessionCacheData(): Record<string, any>;
|
|
108
|
-
protected getAppData<T>(key: string): T | undefined;
|
|
109
|
-
private syncAppDataToTempOrder;
|
|
110
70
|
initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
|
|
111
71
|
destroy(): Promise<void>;
|
|
112
72
|
/**
|
|
113
73
|
* 加载销售订单到统一 tempOrder 工作区。
|
|
114
|
-
*
|
|
74
|
+
* 有 app.sqlite 时优先读取本地记录;本地未命中或 forceRemote=true 时再拉云端。
|
|
115
75
|
*
|
|
116
76
|
* 子类可在 `super.loadSalesDetail` 之后基于返回的 `sales` 做业务侧装配
|
|
117
77
|
* (比如把 `sales.customer` 写入 CustomerModule、emit 业务 hook 等)。
|
|
@@ -131,60 +91,27 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
131
91
|
getPayments(): ISalesPayment[];
|
|
132
92
|
/** 获取附加费用(运费/服务费/税费等)。 */
|
|
133
93
|
getSurcharges(): ISalesSurcharge[];
|
|
134
|
-
getTempOrder(): OrderTempOrder | null;
|
|
135
|
-
replaceTempOrder(tempOrder: OrderTempOrder): Promise<OrderTempOrder>;
|
|
94
|
+
getTempOrder(): import("../../modules/Order/types").OrderTempOrder | null;
|
|
136
95
|
getOrderIdentity(): import("../../modules/Order/types").OrderIdentitySnapshot | null;
|
|
137
96
|
getOrderSnapshot(): import("../../modules/Order/types").OrderSnapshot | null;
|
|
138
97
|
getOrderSyncState(): import("../../modules/Order/types").OrderSyncState;
|
|
139
98
|
getOrderAmountSnapshot(): import("../../modules/Order/types").OrderAmountSnapshot | null;
|
|
140
99
|
getTempOrderNote(): string;
|
|
141
100
|
updateTempOrderNote(note: string): string;
|
|
142
|
-
updateTempOrderNote(note: string, sync: true): Promise<string>;
|
|
143
|
-
updateTempOrderNote(note: string, sync: boolean): string | Promise<string>;
|
|
144
|
-
updateRemoteOrderNote(orderId: number | string, note: string): void;
|
|
145
101
|
updateTempOrderShopDiscount(amount: string | number): string;
|
|
146
102
|
updateTempOrderContactsInfo(contactsInfo: Record<string, any> | null): Record<string, any> | null;
|
|
147
|
-
/** @deprecated OrderModule 不再负责 tempOrder localStorage 持久化。 */
|
|
148
|
-
setEnableTempOrderPersist(enabled: boolean): void;
|
|
149
|
-
/** 是否允许 saveDraft 写入 IndexedDB 草稿。 */
|
|
150
|
-
isTempOrderPersistEnabled(): boolean;
|
|
151
103
|
private ensureTempOrder;
|
|
152
|
-
addNewOrder(): Promise<OrderTempOrder>;
|
|
104
|
+
addNewOrder(): Promise<import("../../modules/Order/types").OrderTempOrder>;
|
|
153
105
|
saveDraft(): Promise<void>;
|
|
154
|
-
restoreOrder(): Promise<OrderTempOrder>;
|
|
155
|
-
/**
|
|
156
|
-
* 仅清空 tempOrder 购物车行(products / bookings / discount_list)。
|
|
157
|
-
* 同步清空内存中的 salesDetail 商品/预约视图,避免编辑态仍读到旧 bookings。
|
|
158
|
-
*/
|
|
159
|
-
clearOrderCartLines(): Promise<OrderTempOrder>;
|
|
106
|
+
restoreOrder(): Promise<import("../../modules/Order/types").OrderTempOrder>;
|
|
160
107
|
getOrderProducts(): import("../../modules/Order/types").OrderProduct[];
|
|
161
108
|
getSummary(): Promise<import("../../modules/Order/types").OrderSummary>;
|
|
162
|
-
private getHistoricalProductDiscountList;
|
|
163
|
-
private isPersistedOrderProduct;
|
|
164
|
-
private mergeHistoricalDiscountList;
|
|
165
|
-
private shouldSkipAutoApplyFetchedDiscountsInEditMode;
|
|
166
|
-
private mergeCurrentDiscountSelectionState;
|
|
167
|
-
loadDiscountConfig(params?: {
|
|
168
|
-
customerId?: number;
|
|
169
|
-
action?: 'create' | 'edit';
|
|
170
|
-
}): Promise<{
|
|
171
|
-
productList: Record<string, any>[];
|
|
172
|
-
discountList: Discount[];
|
|
173
|
-
}>;
|
|
174
|
-
bestDiscount(cb?: (result: any) => void): Promise<{
|
|
175
|
-
productList: Record<string, any>[];
|
|
176
|
-
discountList: Discount[];
|
|
177
|
-
}>;
|
|
178
109
|
getDiscountList(): Discount[];
|
|
179
110
|
scanPromotionCode(code: string, customerId?: number): Promise<BaseSalesScanCodeResult>;
|
|
180
111
|
setDiscountSelected(params: {
|
|
181
112
|
discountId: number;
|
|
182
113
|
isSelected: boolean;
|
|
183
114
|
}): Promise<void>;
|
|
184
|
-
applyDiscountCalculationResult(result?: {
|
|
185
|
-
productList?: Record<string, any>[];
|
|
186
|
-
discountList?: Discount[];
|
|
187
|
-
}): Promise<void>;
|
|
188
115
|
submitScanOrder<T = any>(params?: {
|
|
189
116
|
payments?: OrderPaymentSource[];
|
|
190
117
|
paymentStatus?: BaseSalesPaymentStatus;
|
|
@@ -203,14 +130,6 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
203
130
|
smallTicketDataFlag?: number;
|
|
204
131
|
enhancePayload?: SubmitPayloadEnhancer;
|
|
205
132
|
}): Promise<T>;
|
|
206
|
-
submitTempOrderAsync<T = any>(params?: {
|
|
207
|
-
payments?: OrderPaymentSource[];
|
|
208
|
-
paymentStatus?: BaseSalesPaymentStatus;
|
|
209
|
-
smallTicketDataFlag?: number;
|
|
210
|
-
enhancePayload?: SubmitPayloadEnhancer;
|
|
211
|
-
}): Promise<T>;
|
|
212
|
-
printLocalOrderReceipt<T = any>(lookup?: BaseSalesPrintLocalOrderReceiptParams): Promise<T>;
|
|
213
|
-
private getSubmitPaymentStatus;
|
|
214
133
|
syncPaymentsToOrder<T = any>(params: SyncPaymentsToOrderParams): Promise<SyncPaymentsToOrderResult<T>>;
|
|
215
134
|
/** 读取当前 BaseSales 订单上下文中的 Sales 协议支付项。 */
|
|
216
135
|
getOrderPayments(): OrderPaymentData[];
|
|
@@ -241,9 +160,7 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
241
160
|
email: string;
|
|
242
161
|
};
|
|
243
162
|
/** 获取可用支付方式列表,供 PaymentModal 渲染支付选项。 */
|
|
244
|
-
getPaymentMethodsAsync(): Promise<
|
|
245
|
-
/** 同步读取初始化时缓存的支付方式列表。 */
|
|
246
|
-
getPaymentMethods(): PaymentMethod[];
|
|
163
|
+
getPaymentMethodsAsync(): Promise<any[]>;
|
|
247
164
|
/** 轻量舍入能力,供现金支付 UI 计算 rounding_amount。 */
|
|
248
165
|
roundAmount(params: {
|
|
249
166
|
amount: string | number;
|
|
@@ -266,53 +183,14 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
|
|
|
266
183
|
submitBeforeSend?: boolean;
|
|
267
184
|
}): Promise<T>;
|
|
268
185
|
transformBaseProductToOrderProduct(params: TransformBaseProductToOrderProductParams): import("./utils/transformBaseProductToOrderProduct").BaseProductOrderProductInput | null;
|
|
269
|
-
calculateProductBookingPrice(params: BaseSalesCalculateProductBookingPriceParams): Promise<BaseSalesProductBookingPriceResult>;
|
|
270
186
|
addProductToOrder(product: Partial<BaseSalesOrderProduct> & BaseSalesOrderProductIdentity, booking?: AddProductBookingInput): Promise<import("../../modules/Order/types").OrderProduct[]>;
|
|
271
|
-
|
|
272
|
-
updateOrderProductQuantity(params: BaseSalesUpdateOrderProductQuantityParams): Promise<import("../../modules/Order/types").OrderProduct[]>;
|
|
273
|
-
updateOrderBooking(params: UpdateOrderBookingParams): any[];
|
|
187
|
+
updateProductInOrder(params: UpdateProductInOrderParams): Promise<import("../../modules/Order/types").OrderProduct[]>;
|
|
274
188
|
/**
|
|
275
189
|
* 设置单行商品备注(与整单 `updateTempOrderNote` 区分)。
|
|
276
190
|
* 多行同 SKU 时必须传入与删除/更新一致的 unique_identification_number。
|
|
277
191
|
*/
|
|
278
192
|
setOrderProductLineNote(identity: BaseSalesOrderProductIdentity, note: string): Promise<import("../../modules/Order/types").OrderProduct[]>;
|
|
279
|
-
/**
|
|
280
|
-
* 批量删除购物车行,末尾仅一次促销重算。
|
|
281
|
-
*
|
|
282
|
-
* @example
|
|
283
|
-
* await baseSales.removeProductsFromOrder([identityA, identityB]);
|
|
284
|
-
*/
|
|
285
|
-
removeProductsFromOrder(identities: BaseSalesOrderProductIdentity[]): Promise<import("../../modules/Order/types").OrderProduct[]>;
|
|
286
193
|
removeProductFromOrder(identity: BaseSalesOrderProductIdentity): Promise<import("../../modules/Order/types").OrderProduct[]>;
|
|
287
|
-
/**
|
|
288
|
-
* 注入促销评估器到底层 OrderModule。
|
|
289
|
-
*
|
|
290
|
-
* @example
|
|
291
|
-
* solution.setPromotionEvaluator(appHelper.utils.promotionEvaluator);
|
|
292
|
-
*/
|
|
293
|
-
setPromotionEvaluator(evaluator: OrderPromotionEvaluator | null): void;
|
|
294
|
-
/**
|
|
295
|
-
* 注入赠品选择 resolver。UI 层(SalesSdk)通过 bridge 提供。
|
|
296
|
-
*
|
|
297
|
-
* @example
|
|
298
|
-
* solution.setGiftSelectResolver(async (ctx) => bridge.request(ctx));
|
|
299
|
-
*/
|
|
300
|
-
setGiftSelectResolver(resolver: OrderGiftSelectResolver | null): void;
|
|
301
|
-
/**
|
|
302
|
-
* 为商品目录追加促销标签,供 SalesSdkProductProvider 等商品列表入口复用。
|
|
303
|
-
*
|
|
304
|
-
* @example
|
|
305
|
-
* const products = solution.appendPromotionTags(catalogProducts);
|
|
306
|
-
*/
|
|
307
|
-
appendPromotionTags<T extends Record<string, any>>(products: T[]): T[];
|
|
308
|
-
/**
|
|
309
|
-
* 主动触发一次促销应用(一般写路径会自动触发,少数场景如客户切换后可手动调)。
|
|
310
|
-
*/
|
|
311
|
-
applyPromotion(): Promise<void>;
|
|
312
|
-
/** 最近一次促销计算输出的未满足提示。 */
|
|
313
|
-
getUnfulfilledPromotions(): OrderUnfulfilledPromotion[];
|
|
314
|
-
/** 最近一次促销计算输出的赠品操作 diff。 */
|
|
315
|
-
getLastGiftActions(): OrderLastGiftActions | null;
|
|
316
194
|
getProductList(): Promise<any>;
|
|
317
195
|
getOtherParams(): Record<string, any>;
|
|
318
196
|
setOtherParams(params: Record<string, any>, { cover }?: {
|