@pisell/pisellos 2.3.82 → 2.3.84
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/modules/BookingContext/index.d.ts +3 -0
- package/dist/modules/BookingContext/index.js +42 -13
- package/dist/modules/BookingContext/types.d.ts +4 -4
- package/dist/modules/BookingContext/types.js +3 -3
- package/dist/modules/Quotation/index.d.ts +16 -0
- package/dist/modules/Quotation/index.js +241 -32
- package/dist/solution/BaseSales/index.js +92 -72
- package/dist/solution/BookingByStep/index.d.ts +2 -2
- package/dist/solution/BookingTicket/index.d.ts +1 -1
- package/dist/solution/VenueBooking/index.d.ts +2 -0
- package/dist/solution/VenueBooking/index.js +542 -494
- package/dist/solution/VenueBooking/utils/dateSummary.d.ts +1 -0
- package/dist/solution/VenueBooking/utils/dateSummary.js +3 -1
- package/dist/solution/VenueBooking/utils/slotMerge.d.ts +2 -0
- package/dist/solution/VenueBooking/utils/slotMerge.js +3 -1
- package/lib/model/strategy/adapter/promotion/index.js +46 -1
- package/lib/modules/BookingContext/index.d.ts +3 -0
- package/lib/modules/BookingContext/index.js +35 -8
- package/lib/modules/BookingContext/types.d.ts +4 -4
- package/lib/modules/BookingContext/types.js +3 -3
- package/lib/modules/Quotation/index.d.ts +16 -0
- package/lib/modules/Quotation/index.js +117 -11
- package/lib/solution/BaseSales/index.js +25 -9
- package/lib/solution/BookingByStep/index.d.ts +2 -2
- package/lib/solution/BookingTicket/index.d.ts +1 -1
- package/lib/solution/VenueBooking/index.d.ts +2 -0
- package/lib/solution/VenueBooking/index.js +28 -8
- package/lib/solution/VenueBooking/utils/dateSummary.d.ts +1 -0
- package/lib/solution/VenueBooking/utils/dateSummary.js +3 -1
- package/lib/solution/VenueBooking/utils/slotMerge.d.ts +2 -0
- package/lib/solution/VenueBooking/utils/slotMerge.js +3 -1
- package/package.json +1 -1
|
@@ -861,7 +861,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
861
861
|
key: "loadQuotationForPriceQuery",
|
|
862
862
|
value: function () {
|
|
863
863
|
var _loadQuotationForPriceQuery = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(params) {
|
|
864
|
-
var
|
|
864
|
+
var quotation, load;
|
|
865
865
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
866
866
|
while (1) switch (_context6.prev = _context6.next) {
|
|
867
867
|
case 0:
|
|
@@ -872,12 +872,14 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
872
872
|
return _context6.abrupt("return");
|
|
873
873
|
case 2:
|
|
874
874
|
this.applyQuotationScheduleResolver(params.quotation);
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
875
|
+
quotation = params.quotation;
|
|
876
|
+
load = typeof quotation.ensureQuotations === 'function' ? quotation.ensureQuotations.bind(quotation) : quotation.loadQuotations.bind(quotation);
|
|
877
|
+
_context6.next = 7;
|
|
878
|
+
return load({
|
|
879
|
+
channel: this.getPriceQueryChannel(params.channel),
|
|
878
880
|
customer_id: params.customer_id
|
|
879
881
|
});
|
|
880
|
-
case
|
|
882
|
+
case 7:
|
|
881
883
|
case "end":
|
|
882
884
|
return _context6.stop();
|
|
883
885
|
}
|
|
@@ -904,9 +906,9 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
904
906
|
}, {
|
|
905
907
|
key: "getPriceQueryChannel",
|
|
906
908
|
value: function getPriceQueryChannel(channel) {
|
|
907
|
-
var _this$
|
|
908
|
-
var strategyContext = (_this$
|
|
909
|
-
var value = (_ref12 = (_ref13 = channel !== null && channel !== void 0 ? channel : strategyContext.channel) !== null && _ref13 !== void 0 ? _ref13 : (_this$
|
|
909
|
+
var _this$otherParams, _ref12, _ref13, _this$otherParams2, _this$otherParams3;
|
|
910
|
+
var strategyContext = (_this$otherParams = this.otherParams) !== null && _this$otherParams !== void 0 && _this$otherParams.strategy_context && _typeof(this.otherParams.strategy_context) === 'object' ? this.otherParams.strategy_context : {};
|
|
911
|
+
var value = (_ref12 = (_ref13 = channel !== null && channel !== void 0 ? channel : strategyContext.channel) !== null && _ref13 !== void 0 ? _ref13 : (_this$otherParams2 = this.otherParams) === null || _this$otherParams2 === void 0 ? void 0 : _this$otherParams2.channel) !== null && _ref12 !== void 0 ? _ref12 : (_this$otherParams3 = this.otherParams) === null || _this$otherParams3 === void 0 ? void 0 : _this$otherParams3.platform;
|
|
910
912
|
if (value === undefined || value === null || String(value).trim() === '') {
|
|
911
913
|
return undefined;
|
|
912
914
|
}
|
|
@@ -919,11 +921,11 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
919
921
|
}, {
|
|
920
922
|
key: "getPriceQueryStrategyContext",
|
|
921
923
|
value: function getPriceQueryStrategyContext(channel) {
|
|
922
|
-
var _this$
|
|
923
|
-
var inherited = (_this$
|
|
924
|
+
var _this$otherParams4, _ref14, _strategyContext$busi, _this$otherParams5, _this$otherParams6;
|
|
925
|
+
var inherited = (_this$otherParams4 = this.otherParams) !== null && _this$otherParams4 !== void 0 && _this$otherParams4.strategy_context && _typeof(this.otherParams.strategy_context) === 'object' ? this.otherParams.strategy_context : {};
|
|
924
926
|
var strategyContext = _objectSpread({}, inherited);
|
|
925
927
|
var resolvedChannel = this.getPriceQueryChannel(channel);
|
|
926
|
-
var businessCode = (_ref14 = (_strategyContext$busi = strategyContext.business_code) !== null && _strategyContext$busi !== void 0 ? _strategyContext$busi : (_this$
|
|
928
|
+
var businessCode = (_ref14 = (_strategyContext$busi = strategyContext.business_code) !== null && _strategyContext$busi !== void 0 ? _strategyContext$busi : (_this$otherParams5 = this.otherParams) === null || _this$otherParams5 === void 0 ? void 0 : _this$otherParams5.businessCode) !== null && _ref14 !== void 0 ? _ref14 : (_this$otherParams6 = this.otherParams) === null || _this$otherParams6 === void 0 ? void 0 : _this$otherParams6.business_code;
|
|
927
929
|
if (resolvedChannel) strategyContext.channel = resolvedChannel;
|
|
928
930
|
if (businessCode !== undefined && businessCode !== null && String(businessCode).trim() !== '') {
|
|
929
931
|
strategyContext.business_code = String(businessCode).trim();
|
|
@@ -996,8 +998,8 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
996
998
|
}, {
|
|
997
999
|
key: "isCustomerUserPriceQuery",
|
|
998
1000
|
value: function isCustomerUserPriceQuery() {
|
|
999
|
-
var _this$
|
|
1000
|
-
return isCustomerUserPlatform((_this$
|
|
1001
|
+
var _this$otherParams7;
|
|
1002
|
+
return isCustomerUserPlatform((_this$otherParams7 = this.otherParams) === null || _this$otherParams7 === void 0 ? void 0 : _this$otherParams7.platform);
|
|
1001
1003
|
}
|
|
1002
1004
|
}, {
|
|
1003
1005
|
key: "getPriceQueryScheduleList",
|
|
@@ -1451,8 +1453,8 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1451
1453
|
}, {
|
|
1452
1454
|
key: "getSubmitOrderSalesChannel",
|
|
1453
1455
|
value: function getSubmitOrderSalesChannel() {
|
|
1454
|
-
var _this$
|
|
1455
|
-
return (_this$
|
|
1456
|
+
var _this$otherParams8;
|
|
1457
|
+
return (_this$otherParams8 = this.otherParams) === null || _this$otherParams8 === void 0 ? void 0 : _this$otherParams8.channel;
|
|
1456
1458
|
}
|
|
1457
1459
|
|
|
1458
1460
|
/**
|
|
@@ -1682,11 +1684,11 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1682
1684
|
key: "initialize",
|
|
1683
1685
|
value: function () {
|
|
1684
1686
|
var _initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(core) {
|
|
1685
|
-
var _this$
|
|
1687
|
+
var _this$otherParams9,
|
|
1686
1688
|
_this$appPlugin2,
|
|
1687
1689
|
_this$appPlugin2$getA,
|
|
1688
1690
|
_this11 = this,
|
|
1689
|
-
_this$
|
|
1691
|
+
_this$otherParams10;
|
|
1690
1692
|
var options,
|
|
1691
1693
|
app,
|
|
1692
1694
|
targetCacheData,
|
|
@@ -1701,7 +1703,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1701
1703
|
this.paymentNumberDevicePrefix = null;
|
|
1702
1704
|
// this.store = { ...this.store, ...(options.store as Partial<BaseSalesState>) };
|
|
1703
1705
|
this.otherParams = options.otherParams || {};
|
|
1704
|
-
this.cacheId = (_this$
|
|
1706
|
+
this.cacheId = (_this$otherParams9 = this.otherParams) === null || _this$otherParams9 === void 0 ? void 0 : _this$otherParams9.cacheId;
|
|
1705
1707
|
this.reusedSharedSubModuleNames.clear();
|
|
1706
1708
|
this.window = core.getPlugin('window');
|
|
1707
1709
|
this.request = core.getPlugin('request');
|
|
@@ -1743,7 +1745,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1743
1745
|
_context12.next = 19;
|
|
1744
1746
|
return this.store.schedule.loadAllSchedule();
|
|
1745
1747
|
case 19:
|
|
1746
|
-
if (this.store.order && typeof ((_this$
|
|
1748
|
+
if (this.store.order && typeof ((_this$otherParams10 = this.otherParams) === null || _this$otherParams10 === void 0 ? void 0 : _this$otherParams10.enableTempOrderPersist) === 'boolean') {
|
|
1747
1749
|
this.store.order.setEnableTempOrderPersist(this.otherParams.enableTempOrderPersist);
|
|
1748
1750
|
}
|
|
1749
1751
|
_context12.next = 22;
|
|
@@ -3178,7 +3180,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3178
3180
|
key: "submitSalesOrder",
|
|
3179
3181
|
value: (function () {
|
|
3180
3182
|
var _submitSalesOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28(params) {
|
|
3181
|
-
var _params$smallTicketDa, _this$
|
|
3183
|
+
var _params$smallTicketDa, _this$otherParams11, _this$otherParams12, _this$otherParams13, _this$otherParams14;
|
|
3182
3184
|
var inferredPaymentStatus, smallTicketDataFlag, submitParams;
|
|
3183
3185
|
return _regeneratorRuntime().wrap(function _callee28$(_context28) {
|
|
3184
3186
|
while (1) switch (_context28.prev = _context28.next) {
|
|
@@ -3194,10 +3196,10 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3194
3196
|
smallTicketDataFlag = (_params$smallTicketDa = params === null || params === void 0 ? void 0 : params.smallTicketDataFlag) !== null && _params$smallTicketDa !== void 0 ? _params$smallTicketDa : this.getDefaultCheckoutSmallTicketDataFlag();
|
|
3195
3197
|
submitParams = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
3196
3198
|
cacheId: this.cacheId,
|
|
3197
|
-
platform: (_this$
|
|
3198
|
-
businessCode: ((_this$
|
|
3199
|
+
platform: (_this$otherParams11 = this.otherParams) === null || _this$otherParams11 === void 0 ? void 0 : _this$otherParams11.platform,
|
|
3200
|
+
businessCode: ((_this$otherParams12 = this.otherParams) === null || _this$otherParams12 === void 0 ? void 0 : _this$otherParams12.businessCode) || ((_this$otherParams13 = this.otherParams) === null || _this$otherParams13 === void 0 ? void 0 : _this$otherParams13.business_code),
|
|
3199
3201
|
channel: this.getSubmitOrderSalesChannel(),
|
|
3200
|
-
type: (_this$
|
|
3202
|
+
type: (_this$otherParams14 = this.otherParams) === null || _this$otherParams14 === void 0 ? void 0 : _this$otherParams14.type,
|
|
3201
3203
|
request_unique_idempotency_token: this.store.order.generateIdempotencyToken()
|
|
3202
3204
|
}, (params === null || params === void 0 ? void 0 : params.payments) !== undefined ? {
|
|
3203
3205
|
payments: params.payments
|
|
@@ -3226,7 +3228,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3226
3228
|
key: "saveSalesOrderDraft",
|
|
3227
3229
|
value: function () {
|
|
3228
3230
|
var _saveSalesOrderDraft = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29(params) {
|
|
3229
|
-
var _params$platform, _this$
|
|
3231
|
+
var _params$platform, _this$otherParams15, _this$otherParams16, _this$otherParams17, _params$channel, _params$type, _this$otherParams18;
|
|
3230
3232
|
return _regeneratorRuntime().wrap(function _callee29$(_context29) {
|
|
3231
3233
|
while (1) switch (_context29.prev = _context29.next) {
|
|
3232
3234
|
case 0:
|
|
@@ -3238,10 +3240,10 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3238
3240
|
case 2:
|
|
3239
3241
|
return _context29.abrupt("return", this.store.order.saveTempOrderAsDraft(_objectSpread({
|
|
3240
3242
|
cacheId: this.cacheId,
|
|
3241
|
-
platform: (_params$platform = params === null || params === void 0 ? void 0 : params.platform) !== null && _params$platform !== void 0 ? _params$platform : (_this$
|
|
3242
|
-
businessCode: (params === null || params === void 0 ? void 0 : params.businessCode) || ((_this$
|
|
3243
|
+
platform: (_params$platform = params === null || params === void 0 ? void 0 : params.platform) !== null && _params$platform !== void 0 ? _params$platform : (_this$otherParams15 = this.otherParams) === null || _this$otherParams15 === void 0 ? void 0 : _this$otherParams15.platform,
|
|
3244
|
+
businessCode: (params === null || params === void 0 ? void 0 : params.businessCode) || ((_this$otherParams16 = this.otherParams) === null || _this$otherParams16 === void 0 ? void 0 : _this$otherParams16.businessCode) || ((_this$otherParams17 = this.otherParams) === null || _this$otherParams17 === void 0 ? void 0 : _this$otherParams17.business_code),
|
|
3243
3245
|
channel: (_params$channel = params === null || params === void 0 ? void 0 : params.channel) !== null && _params$channel !== void 0 ? _params$channel : this.getSubmitOrderSalesChannel(),
|
|
3244
|
-
type: (_params$type = params === null || params === void 0 ? void 0 : params.type) !== null && _params$type !== void 0 ? _params$type : (_this$
|
|
3246
|
+
type: (_params$type = params === null || params === void 0 ? void 0 : params.type) !== null && _params$type !== void 0 ? _params$type : (_this$otherParams18 = this.otherParams) === null || _this$otherParams18 === void 0 ? void 0 : _this$otherParams18.type
|
|
3245
3247
|
}, (params === null || params === void 0 ? void 0 : params.enhancePayload) !== undefined ? {
|
|
3246
3248
|
enhancePayload: params.enhancePayload
|
|
3247
3249
|
} : {})));
|
|
@@ -3260,7 +3262,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3260
3262
|
key: "submitTempOrderAsync",
|
|
3261
3263
|
value: function () {
|
|
3262
3264
|
var _submitTempOrderAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30(params) {
|
|
3263
|
-
var _params$smallTicketDa2, _this$
|
|
3265
|
+
var _params$smallTicketDa2, _this$otherParams19, _this$otherParams20, _this$otherParams21, _this$otherParams22;
|
|
3264
3266
|
var inferredPaymentStatus, smallTicketDataFlag, submitParams;
|
|
3265
3267
|
return _regeneratorRuntime().wrap(function _callee30$(_context30) {
|
|
3266
3268
|
while (1) switch (_context30.prev = _context30.next) {
|
|
@@ -3275,10 +3277,10 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3275
3277
|
smallTicketDataFlag = (_params$smallTicketDa2 = params === null || params === void 0 ? void 0 : params.smallTicketDataFlag) !== null && _params$smallTicketDa2 !== void 0 ? _params$smallTicketDa2 : this.getDefaultCheckoutSmallTicketDataFlag();
|
|
3276
3278
|
submitParams = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
3277
3279
|
cacheId: this.cacheId,
|
|
3278
|
-
platform: (_this$
|
|
3279
|
-
businessCode: ((_this$
|
|
3280
|
+
platform: (_this$otherParams19 = this.otherParams) === null || _this$otherParams19 === void 0 ? void 0 : _this$otherParams19.platform,
|
|
3281
|
+
businessCode: ((_this$otherParams20 = this.otherParams) === null || _this$otherParams20 === void 0 ? void 0 : _this$otherParams20.businessCode) || ((_this$otherParams21 = this.otherParams) === null || _this$otherParams21 === void 0 ? void 0 : _this$otherParams21.business_code),
|
|
3280
3282
|
channel: this.getSubmitOrderSalesChannel(),
|
|
3281
|
-
type: (_this$
|
|
3283
|
+
type: (_this$otherParams22 = this.otherParams) === null || _this$otherParams22 === void 0 ? void 0 : _this$otherParams22.type,
|
|
3282
3284
|
request_unique_idempotency_token: this.store.order.generateIdempotencyToken()
|
|
3283
3285
|
}, (params === null || params === void 0 ? void 0 : params.payments) !== undefined ? {
|
|
3284
3286
|
payments: params.payments
|
|
@@ -3310,8 +3312,8 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3310
3312
|
}, {
|
|
3311
3313
|
key: "shouldUseCheckoutSyncTask",
|
|
3312
3314
|
value: function shouldUseCheckoutSyncTask() {
|
|
3313
|
-
var _this$
|
|
3314
|
-
var configured = (_this$
|
|
3315
|
+
var _this$otherParams23;
|
|
3316
|
+
var configured = (_this$otherParams23 = this.otherParams) === null || _this$otherParams23 === void 0 ? void 0 : _this$otherParams23.checkoutSyncTaskEnabled;
|
|
3315
3317
|
return typeof configured === 'boolean' ? configured : true;
|
|
3316
3318
|
}
|
|
3317
3319
|
|
|
@@ -3325,7 +3327,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3325
3327
|
key: "printLocalOrderReceipt",
|
|
3326
3328
|
value: function () {
|
|
3327
3329
|
var _printLocalOrderReceipt = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31(lookup) {
|
|
3328
|
-
var _this$
|
|
3330
|
+
var _this$otherParams24, _this$otherParams25, _this$otherParams26, _this$otherParams27;
|
|
3329
3331
|
var hasLookup, lookupPayload, context, payload, response, _this$store$order$app, _this$store$order5, _data;
|
|
3330
3332
|
return _regeneratorRuntime().wrap(function _callee31$(_context31) {
|
|
3331
3333
|
while (1) switch (_context31.prev = _context31.next) {
|
|
@@ -3343,10 +3345,10 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3343
3345
|
external_sale_number: lookup
|
|
3344
3346
|
};
|
|
3345
3347
|
context = {
|
|
3346
|
-
platform: (_this$
|
|
3347
|
-
businessCode: ((_this$
|
|
3348
|
+
platform: (_this$otherParams24 = this.otherParams) === null || _this$otherParams24 === void 0 ? void 0 : _this$otherParams24.platform,
|
|
3349
|
+
businessCode: ((_this$otherParams25 = this.otherParams) === null || _this$otherParams25 === void 0 ? void 0 : _this$otherParams25.businessCode) || ((_this$otherParams26 = this.otherParams) === null || _this$otherParams26 === void 0 ? void 0 : _this$otherParams26.business_code),
|
|
3348
3350
|
channel: this.getSubmitOrderSalesChannel(),
|
|
3349
|
-
type: (_this$
|
|
3351
|
+
type: (_this$otherParams27 = this.otherParams) === null || _this$otherParams27 === void 0 ? void 0 : _this$otherParams27.type
|
|
3350
3352
|
};
|
|
3351
3353
|
payload = hasLookup ? _objectSpread(_objectSpread({}, lookupPayload), {}, {
|
|
3352
3354
|
lookup_order_from_db: 1,
|
|
@@ -3405,7 +3407,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3405
3407
|
key: "syncPaymentsToOrder",
|
|
3406
3408
|
value: function () {
|
|
3407
3409
|
var _syncPaymentsToOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee32(params) {
|
|
3408
|
-
var _ref36, _params$businessCode, _this$
|
|
3410
|
+
var _ref36, _params$businessCode, _this$otherParams28, _this$otherParams29, _params$channel2;
|
|
3409
3411
|
var businessCode, channel, syncParams, syncState, payments, syncResult, latestPayments, amountSnapshot, orderSnapshot, syncPayload;
|
|
3410
3412
|
return _regeneratorRuntime().wrap(function _callee32$(_context32) {
|
|
3411
3413
|
while (1) switch (_context32.prev = _context32.next) {
|
|
@@ -3416,7 +3418,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3416
3418
|
}
|
|
3417
3419
|
throw new Error('order 模块未初始化');
|
|
3418
3420
|
case 2:
|
|
3419
|
-
businessCode = (_ref36 = (_params$businessCode = params.businessCode) !== null && _params$businessCode !== void 0 ? _params$businessCode : (_this$
|
|
3421
|
+
businessCode = (_ref36 = (_params$businessCode = params.businessCode) !== null && _params$businessCode !== void 0 ? _params$businessCode : (_this$otherParams28 = this.otherParams) === null || _this$otherParams28 === void 0 ? void 0 : _this$otherParams28.businessCode) !== null && _ref36 !== void 0 ? _ref36 : (_this$otherParams29 = this.otherParams) === null || _this$otherParams29 === void 0 ? void 0 : _this$otherParams29.business_code;
|
|
3420
3422
|
channel = (_params$channel2 = params.channel) !== null && _params$channel2 !== void 0 ? _params$channel2 : this.getSubmitOrderSalesChannel();
|
|
3421
3423
|
syncParams = _objectSpread(_objectSpread(_objectSpread({}, params), {}, {
|
|
3422
3424
|
checkoutSyncTaskEnabled: this.shouldUseCheckoutSyncTask()
|
|
@@ -3675,7 +3677,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3675
3677
|
}, {
|
|
3676
3678
|
key: "addOrderPaymentWithDevicePrefix",
|
|
3677
3679
|
value: function addOrderPaymentWithDevicePrefix(payment, devicePrefix) {
|
|
3678
|
-
var _this$
|
|
3680
|
+
var _this$otherParams30,
|
|
3679
3681
|
_paymentRecord$paymen,
|
|
3680
3682
|
_paymentRecord$create,
|
|
3681
3683
|
_ref37,
|
|
@@ -3691,7 +3693,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3691
3693
|
return this.store.order.getOrderPayments();
|
|
3692
3694
|
}
|
|
3693
3695
|
var metadata = paymentRecord.metadata && _typeof(paymentRecord.metadata) === 'object' ? _objectSpread({}, paymentRecord.metadata) : {};
|
|
3694
|
-
var shopWalletPassId = (_this$
|
|
3696
|
+
var shopWalletPassId = (_this$otherParams30 = this.otherParams) === null || _this$otherParams30 === void 0 ? void 0 : _this$otherParams30.shop_wallet_pass_id;
|
|
3695
3697
|
if (shopWalletPassId !== undefined && shopWalletPassId !== null) {
|
|
3696
3698
|
metadata.shop_wallet_pass_id = shopWalletPassId;
|
|
3697
3699
|
}
|
|
@@ -4590,7 +4592,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4590
4592
|
key: "getCashPaymentConfig",
|
|
4591
4593
|
value: (function () {
|
|
4592
4594
|
var _getCashPaymentConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee47() {
|
|
4593
|
-
var _this$store$order11, _this$store$order11$g, _this$store$order12, _this$store$order12$g, _this$
|
|
4595
|
+
var _this$store$order11, _this$store$order11$g, _this$store$order12, _this$store$order12$g, _this$otherParams31;
|
|
4594
4596
|
var paymentMethods, paymentMethod, amountSnapshot, pendingWalletAmount, amountDue, currency, recommendedAmounts;
|
|
4595
4597
|
return _regeneratorRuntime().wrap(function _callee47$(_context47) {
|
|
4596
4598
|
while (1) switch (_context47.prev = _context47.next) {
|
|
@@ -4616,7 +4618,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4616
4618
|
amountSnapshot = (_this$store$order11 = this.store.order) === null || _this$store$order11 === void 0 || (_this$store$order11$g = _this$store$order11.getOrderAmountSnapshot) === null || _this$store$order11$g === void 0 ? void 0 : _this$store$order11$g.call(_this$store$order11);
|
|
4617
4619
|
pendingWalletAmount = this.getPendingWalletPaymentAmount();
|
|
4618
4620
|
amountDue = Decimal.max(new Decimal((amountSnapshot === null || amountSnapshot === void 0 ? void 0 : amountSnapshot.amountGap) || 0).minus(pendingWalletAmount), 0).toDecimalPlaces(2).toNumber();
|
|
4619
|
-
currency = ((_this$store$order12 = this.store.order) === null || _this$store$order12 === void 0 || (_this$store$order12$g = _this$store$order12.getTempOrder) === null || _this$store$order12$g === void 0 || (_this$store$order12$g = _this$store$order12$g.call(_this$store$order12)) === null || _this$store$order12$g === void 0 ? void 0 : _this$store$order12$g.currency_code) || ((_this$
|
|
4621
|
+
currency = ((_this$store$order12 = this.store.order) === null || _this$store$order12 === void 0 || (_this$store$order12$g = _this$store$order12.getTempOrder) === null || _this$store$order12$g === void 0 || (_this$store$order12$g = _this$store$order12$g.call(_this$store$order12)) === null || _this$store$order12$g === void 0 ? void 0 : _this$store$order12$g.currency_code) || ((_this$otherParams31 = this.otherParams) === null || _this$otherParams31 === void 0 ? void 0 : _this$otherParams31.currency) || 'USD';
|
|
4620
4622
|
recommendedAmounts = amountDue > 0 ? this.store.payment.cash.getRecommendedAmount(amountDue, currency) : [];
|
|
4621
4623
|
return _context47.abrupt("return", {
|
|
4622
4624
|
available: Boolean(paymentMethod && amountDue > 0),
|
|
@@ -4751,7 +4753,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4751
4753
|
key: "payCash",
|
|
4752
4754
|
value: (function () {
|
|
4753
4755
|
var _payCash = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee49(params) {
|
|
4754
|
-
var _this$store$order$get6, _params$actualPaidAmo, _this$
|
|
4756
|
+
var _this$store$order$get6, _params$actualPaidAmo, _this$otherParams32, _this$window, _this$window$postMess;
|
|
4755
4757
|
var amount, config, paymentMethod, roundingAmount, effectivePaymentAmount, beforePayments, beforePaymentStatus, uniquePaymentNumber, paymentTimestamp, actualPaidAmount, changeAmount, shopWalletPassId, payments, payment, syncResult, committed, walletState, restoredTempOrder;
|
|
4756
4758
|
return _regeneratorRuntime().wrap(function _callee49$(_context49) {
|
|
4757
4759
|
while (1) switch (_context49.prev = _context49.next) {
|
|
@@ -4800,7 +4802,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4800
4802
|
paymentTimestamp = dayjs().format('YYYY-MM-DD HH:mm:ss');
|
|
4801
4803
|
actualPaidAmount = Number((_params$actualPaidAmo = params.actualPaidAmount) !== null && _params$actualPaidAmo !== void 0 ? _params$actualPaidAmo : amount);
|
|
4802
4804
|
changeAmount = Number(params.changeAmount || 0);
|
|
4803
|
-
shopWalletPassId = (_this$
|
|
4805
|
+
shopWalletPassId = (_this$otherParams32 = this.otherParams) === null || _this$otherParams32 === void 0 ? void 0 : _this$otherParams32.shop_wallet_pass_id;
|
|
4804
4806
|
if (!(!Number.isFinite(actualPaidAmount) || actualPaidAmount + 0.01 < amount)) {
|
|
4805
4807
|
_context49.next = 26;
|
|
4806
4808
|
break;
|
|
@@ -5171,7 +5173,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5171
5173
|
value: function () {
|
|
5172
5174
|
var _calculateProductBookingPrice = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee53(params) {
|
|
5173
5175
|
var _params$customer_id;
|
|
5174
|
-
var useCustomerUserPricing, quotation, customerId, _yield$this$resolvePr, _yield$this$resolvePr2, authoritativeProduct, product;
|
|
5176
|
+
var useCustomerUserPricing, quotation, customerId, channel, _yield$this$resolvePr, _yield$this$resolvePr2, authoritativeProduct, product;
|
|
5175
5177
|
return _regeneratorRuntime().wrap(function _callee53$(_context53) {
|
|
5176
5178
|
while (1) switch (_context53.prev = _context53.next) {
|
|
5177
5179
|
case 0:
|
|
@@ -5181,36 +5183,38 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5181
5183
|
_context53.next = 5;
|
|
5182
5184
|
return this.prepareProductPriceQueryContext(customerId);
|
|
5183
5185
|
case 5:
|
|
5184
|
-
|
|
5186
|
+
channel = this.getPriceQueryChannel(params.channel);
|
|
5187
|
+
_context53.next = 8;
|
|
5185
5188
|
return this.resolveProductsForPriceQuery({
|
|
5186
5189
|
priceQueries: [params],
|
|
5187
5190
|
schedule: this.getPriceQuerySchedule(params),
|
|
5188
5191
|
customerId: customerId,
|
|
5189
|
-
channel:
|
|
5192
|
+
channel: channel
|
|
5190
5193
|
});
|
|
5191
|
-
case
|
|
5194
|
+
case 8:
|
|
5192
5195
|
_yield$this$resolvePr = _context53.sent;
|
|
5193
5196
|
_yield$this$resolvePr2 = _slicedToArray(_yield$this$resolvePr, 1);
|
|
5194
5197
|
authoritativeProduct = _yield$this$resolvePr2[0];
|
|
5195
5198
|
product = this.mergeProductForPriceQuery(params.product, authoritativeProduct);
|
|
5196
5199
|
if (useCustomerUserPricing) {
|
|
5197
|
-
_context53.next =
|
|
5200
|
+
_context53.next = 15;
|
|
5198
5201
|
break;
|
|
5199
5202
|
}
|
|
5200
|
-
_context53.next =
|
|
5203
|
+
_context53.next = 15;
|
|
5201
5204
|
return this.loadQuotationForPriceQuery({
|
|
5202
5205
|
quotation: quotation,
|
|
5203
5206
|
customer_id: customerId,
|
|
5204
|
-
channel:
|
|
5207
|
+
channel: channel
|
|
5205
5208
|
});
|
|
5206
|
-
case
|
|
5209
|
+
case 15:
|
|
5207
5210
|
return _context53.abrupt("return", calculateBaseSalesProductBookingPrice(_objectSpread(_objectSpread({}, params), {}, {
|
|
5211
|
+
channel: channel,
|
|
5208
5212
|
product: product,
|
|
5209
5213
|
fallback_price: authoritativeProduct ? undefined : params.fallback_price,
|
|
5210
5214
|
customer_id: customerId,
|
|
5211
5215
|
quotation: authoritativeProduct && this.preferAuthoritativeProductQueryPrice() ? undefined : quotation
|
|
5212
5216
|
})));
|
|
5213
|
-
case
|
|
5217
|
+
case 16:
|
|
5214
5218
|
case "end":
|
|
5215
5219
|
return _context53.stop();
|
|
5216
5220
|
}
|
|
@@ -5302,7 +5306,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5302
5306
|
value: function () {
|
|
5303
5307
|
var _calculateProductBookingPrices = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee55(paramsList) {
|
|
5304
5308
|
var _this18 = this;
|
|
5305
|
-
var useCustomerUserPricing, quotation, currentOrderCustomerId, authoritativeProducts, groups,
|
|
5309
|
+
var useCustomerUserPricing, quotation, currentOrderCustomerId, resolvedChannels, authoritativeProducts, groups, quotationContexts;
|
|
5306
5310
|
return _regeneratorRuntime().wrap(function _callee55$(_context55) {
|
|
5307
5311
|
while (1) switch (_context55.prev = _context55.next) {
|
|
5308
5312
|
case 0:
|
|
@@ -5315,6 +5319,9 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5315
5319
|
useCustomerUserPricing = this.isCustomerUserPriceQuery();
|
|
5316
5320
|
quotation = useCustomerUserPricing ? undefined : this.store.quotation;
|
|
5317
5321
|
currentOrderCustomerId = this.getCurrentOrderCustomerId();
|
|
5322
|
+
resolvedChannels = paramsList.map(function (params) {
|
|
5323
|
+
return _this18.getPriceQueryChannel(params.channel);
|
|
5324
|
+
});
|
|
5318
5325
|
authoritativeProducts = paramsList.map(function () {
|
|
5319
5326
|
return null;
|
|
5320
5327
|
});
|
|
@@ -5322,7 +5329,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5322
5329
|
paramsList.forEach(function (params, index) {
|
|
5323
5330
|
var _params$customer_id2;
|
|
5324
5331
|
var schedule = _this18.getPriceQuerySchedule(params);
|
|
5325
|
-
var channel =
|
|
5332
|
+
var channel = resolvedChannels[index];
|
|
5326
5333
|
var customerId = (_params$customer_id2 = params.customer_id) !== null && _params$customer_id2 !== void 0 ? _params$customer_id2 : currentOrderCustomerId;
|
|
5327
5334
|
var groupKey = [schedule.schedule_date, schedule.schedule_datetime, channel || '', _this18.normalizePriceContextCustomerId(customerId) || ''].join('|');
|
|
5328
5335
|
var group = groups.get(groupKey) || {
|
|
@@ -5334,7 +5341,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5334
5341
|
group.indices.push(index);
|
|
5335
5342
|
groups.set(groupKey, group);
|
|
5336
5343
|
});
|
|
5337
|
-
_context55.next =
|
|
5344
|
+
_context55.next = 11;
|
|
5338
5345
|
return Promise.all(Array.from(groups.values()).map( /*#__PURE__*/function () {
|
|
5339
5346
|
var _ref43 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee54(group) {
|
|
5340
5347
|
var priceQueries, resolvedProducts;
|
|
@@ -5369,32 +5376,45 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5369
5376
|
return _ref43.apply(this, arguments);
|
|
5370
5377
|
};
|
|
5371
5378
|
}()));
|
|
5372
|
-
case
|
|
5379
|
+
case 11:
|
|
5373
5380
|
if (useCustomerUserPricing) {
|
|
5374
|
-
_context55.next =
|
|
5381
|
+
_context55.next = 16;
|
|
5375
5382
|
break;
|
|
5376
5383
|
}
|
|
5377
|
-
|
|
5378
|
-
|
|
5379
|
-
|
|
5380
|
-
|
|
5381
|
-
|
|
5384
|
+
quotationContexts = new Map();
|
|
5385
|
+
paramsList.forEach(function (params, index) {
|
|
5386
|
+
var _params$customer_id3;
|
|
5387
|
+
var channel = resolvedChannels[index];
|
|
5388
|
+
var key = channel || '';
|
|
5389
|
+
if (quotationContexts.has(key)) return;
|
|
5390
|
+
quotationContexts.set(key, {
|
|
5391
|
+
channel: channel,
|
|
5392
|
+
customer_id: (_params$customer_id3 = params.customer_id) !== null && _params$customer_id3 !== void 0 ? _params$customer_id3 : currentOrderCustomerId
|
|
5393
|
+
});
|
|
5382
5394
|
});
|
|
5383
|
-
|
|
5395
|
+
_context55.next = 16;
|
|
5396
|
+
return Promise.all(Array.from(quotationContexts.values()).map(function (context) {
|
|
5397
|
+
return _this18.loadQuotationForPriceQuery(_objectSpread({
|
|
5398
|
+
quotation: quotation
|
|
5399
|
+
}, context));
|
|
5400
|
+
}));
|
|
5401
|
+
case 16:
|
|
5384
5402
|
return _context55.abrupt("return", paramsList.map(function (params, index) {
|
|
5385
|
-
var _params$
|
|
5403
|
+
var _params$customer_id4;
|
|
5386
5404
|
var productInput = params.product || {};
|
|
5387
5405
|
var authoritativeProduct = authoritativeProducts[index];
|
|
5388
5406
|
var product = _this18.mergeProductForPriceQuery(productInput, authoritativeProduct);
|
|
5389
|
-
var customerId = (_params$
|
|
5407
|
+
var customerId = (_params$customer_id4 = params.customer_id) !== null && _params$customer_id4 !== void 0 ? _params$customer_id4 : currentOrderCustomerId;
|
|
5408
|
+
var channel = resolvedChannels[index];
|
|
5390
5409
|
return calculateBaseSalesProductBookingPrice(_objectSpread(_objectSpread({}, params), {}, {
|
|
5410
|
+
channel: channel,
|
|
5391
5411
|
product: product,
|
|
5392
5412
|
fallback_price: authoritativeProduct ? undefined : params.fallback_price,
|
|
5393
5413
|
customer_id: customerId,
|
|
5394
5414
|
quotation: authoritativeProduct && _this18.preferAuthoritativeProductQueryPrice() ? undefined : quotation
|
|
5395
5415
|
}));
|
|
5396
5416
|
}));
|
|
5397
|
-
case
|
|
5417
|
+
case 17:
|
|
5398
5418
|
case "end":
|
|
5399
5419
|
return _context55.stop();
|
|
5400
5420
|
}
|
|
@@ -5751,13 +5771,13 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5751
5771
|
key: "getProductList",
|
|
5752
5772
|
value: function () {
|
|
5753
5773
|
var _getProductList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee64() {
|
|
5754
|
-
var _this$
|
|
5774
|
+
var _this$otherParams33;
|
|
5755
5775
|
var menu_list_ids, _this$store$products, res;
|
|
5756
5776
|
return _regeneratorRuntime().wrap(function _callee64$(_context64) {
|
|
5757
5777
|
while (1) switch (_context64.prev = _context64.next) {
|
|
5758
5778
|
case 0:
|
|
5759
5779
|
// 可以直接通过配置里的 menu 读取
|
|
5760
|
-
menu_list_ids = ((_this$
|
|
5780
|
+
menu_list_ids = ((_this$otherParams33 = this.otherParams) === null || _this$otherParams33 === void 0 || (_this$otherParams33 = _this$otherParams33.dineInConfig) === null || _this$otherParams33 === void 0 ? void 0 : _this$otherParams33['menu.associated_menus'].map(function (n) {
|
|
5761
5781
|
return Number(n.value);
|
|
5762
5782
|
})) || [];
|
|
5763
5783
|
_context64.prev = 1;
|
|
@@ -5795,7 +5815,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5795
5815
|
key: "setOtherParams",
|
|
5796
5816
|
value: function () {
|
|
5797
5817
|
var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee65(params) {
|
|
5798
|
-
var _this$
|
|
5818
|
+
var _this$otherParams34;
|
|
5799
5819
|
var _ref44,
|
|
5800
5820
|
_ref44$cover,
|
|
5801
5821
|
cover,
|
|
@@ -5809,7 +5829,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5809
5829
|
} else {
|
|
5810
5830
|
this.otherParams = _objectSpread(_objectSpread({}, this.otherParams), params);
|
|
5811
5831
|
}
|
|
5812
|
-
this.cacheId = (_this$
|
|
5832
|
+
this.cacheId = (_this$otherParams34 = this.otherParams) === null || _this$otherParams34 === void 0 ? void 0 : _this$otherParams34.cacheId;
|
|
5813
5833
|
_context65.next = 5;
|
|
5814
5834
|
return this.syncOtherParamsToSubModules(params, {
|
|
5815
5835
|
cover: cover
|
|
@@ -326,7 +326,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
326
326
|
date: string;
|
|
327
327
|
status: string;
|
|
328
328
|
week: string;
|
|
329
|
-
weekNum: 0 | 1 | 2 |
|
|
329
|
+
weekNum: 0 | 1 | 2 | 5 | 3 | 4 | 6;
|
|
330
330
|
}[]>;
|
|
331
331
|
submitTimeSlot(timeSlots: TimeSliceItem): void;
|
|
332
332
|
private getScheduleDataByIds;
|
|
@@ -345,7 +345,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
|
|
|
345
345
|
count: number;
|
|
346
346
|
left: number;
|
|
347
347
|
summaryCount: number;
|
|
348
|
-
status: "
|
|
348
|
+
status: "sold_out" | "lots_of_space" | "filling_up_fast";
|
|
349
349
|
}[];
|
|
350
350
|
/**
|
|
351
351
|
* 找到多个资源的公共可用时间段
|
|
@@ -334,7 +334,7 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
|
|
|
334
334
|
* 获取当前的客户搜索条件
|
|
335
335
|
* @returns 当前搜索条件
|
|
336
336
|
*/
|
|
337
|
-
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "
|
|
337
|
+
getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "num" | "skip">;
|
|
338
338
|
/**
|
|
339
339
|
* 获取客户列表状态(包含滚动加载相关状态)
|
|
340
340
|
* @returns 客户状态
|
|
@@ -90,6 +90,8 @@ export declare class VenueBookingImpl extends BaseSalesImpl implements Module {
|
|
|
90
90
|
loadAddonProducts(): Promise<ProductData[]>;
|
|
91
91
|
getVenueProducts(): ProductData[];
|
|
92
92
|
getAddonProductsList(): ProductData[];
|
|
93
|
+
private ensureQuotationsLoaded;
|
|
94
|
+
private preloadQuotations;
|
|
93
95
|
loadQuotations(params?: {
|
|
94
96
|
channel?: string;
|
|
95
97
|
}): Promise<void>;
|