@pisell/pisellos 2.2.277 → 2.2.279
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/index.js +0 -9
- package/dist/modules/BaseModule.d.ts +1 -0
- package/dist/modules/BaseModule.js +24 -28
- package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +7 -3
- package/dist/modules/BookingContext/utils/productExtend.js +5 -9
- package/dist/modules/BookingContext/utils/timeSlices.js +24 -3
- package/dist/modules/Customer/index.d.ts +4 -0
- package/dist/modules/Customer/index.js +91 -59
- package/dist/modules/Customer/types.d.ts +2 -0
- package/dist/modules/Discount/index.d.ts +1 -0
- package/dist/modules/Discount/index.js +40 -11
- package/dist/modules/Discount/types.d.ts +1 -0
- package/dist/modules/Holder/index.d.ts +48 -0
- package/dist/modules/Holder/index.js +640 -0
- package/dist/modules/Holder/types.d.ts +123 -0
- package/dist/modules/Holder/types.js +1 -0
- package/dist/modules/Holder/utils.d.ts +13 -0
- package/dist/modules/Holder/utils.js +34 -0
- package/dist/modules/OpenData/index.js +2 -2
- package/dist/modules/Order/index.d.ts +32 -4
- package/dist/modules/Order/index.js +868 -675
- package/dist/modules/Order/types.d.ts +22 -1
- package/dist/modules/Order/utils/discountProductLineIdentity.d.ts +45 -0
- package/dist/modules/Order/utils/discountProductLineIdentity.js +227 -0
- package/dist/modules/Order/utils/orderCollectionIdentity.d.ts +15 -0
- package/dist/modules/Order/utils/orderCollectionIdentity.js +75 -0
- package/dist/modules/Order/utils.d.ts +10 -0
- package/dist/modules/Order/utils.js +71 -34
- package/dist/modules/Payment/index.d.ts +4 -0
- package/dist/modules/Payment/index.js +14 -4
- package/dist/modules/Payment/walletpass.js +48 -13
- package/dist/modules/Product/types.d.ts +1 -0
- package/dist/modules/ProductList/index.js +33 -13
- package/dist/modules/Quotation/index.d.ts +1 -1
- package/dist/modules/Quotation/index.js +2 -2
- package/dist/modules/ResourcePlanner/index.d.ts +24 -0
- package/dist/modules/ResourcePlanner/index.js +181 -0
- package/dist/modules/ResourcePlanner/planner.d.ts +14 -0
- package/dist/modules/ResourcePlanner/planner.js +1069 -0
- package/dist/modules/ResourcePlanner/types.d.ts +227 -0
- package/dist/modules/ResourcePlanner/types.js +1 -0
- package/dist/modules/Rules/index.js +153 -56
- package/dist/modules/SalesSummary/index.js +12 -13
- package/dist/modules/ScanOrderLogger/index.d.ts +2 -0
- package/dist/modules/ScanOrderLogger/index.js +15 -2
- package/dist/modules/ScanOrderLogger/providers/feishu.js +45 -27
- package/dist/modules/ScanOrderLogger/types.d.ts +1 -0
- package/dist/modules/Schedule/index.d.ts +3 -1
- package/dist/modules/Schedule/index.js +21 -16
- package/dist/modules/Summary/utils.js +38 -13
- package/dist/modules/index.d.ts +2 -0
- package/dist/modules/index.js +3 -1
- package/dist/plugins/window.d.ts +1 -0
- package/dist/server/index.d.ts +20 -0
- package/dist/server/index.js +1101 -909
- package/dist/server/modules/order/index.d.ts +2 -0
- package/dist/server/modules/order/index.js +261 -96
- package/dist/server/modules/order/types.d.ts +1 -1
- package/dist/server/utils/small-ticket.js +2 -1
- package/dist/solution/BaseSales/index.d.ts +10 -1
- package/dist/solution/BaseSales/index.js +201 -148
- package/dist/solution/BaseSales/utils/cartPromotion.js +19 -1
- package/dist/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +6 -3
- package/dist/solution/BaseSales/utils.js +31 -20
- package/dist/solution/BookingByStep/index.d.ts +16 -1
- package/dist/solution/BookingByStep/index.js +294 -215
- package/dist/solution/BookingByStep/types.d.ts +2 -1
- package/dist/solution/BookingByStep/types.js +3 -1
- package/dist/solution/BookingByStep/utils/capacity.js +17 -1
- package/dist/solution/BookingByStep/utils/timeslots.d.ts +3 -1
- package/dist/solution/BookingByStep/utils/timeslots.js +19 -12
- package/dist/solution/BookingTicket/index.d.ts +6 -2
- package/dist/solution/BookingTicket/index.js +125 -77
- package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +3 -1
- package/dist/solution/BookingTicket/utils/scan/handleScan.js +10 -2
- package/dist/solution/ScanOrder/index.d.ts +26 -14
- package/dist/solution/ScanOrder/index.js +1142 -739
- package/dist/solution/ScanOrder/types.d.ts +21 -1
- package/dist/solution/ScanOrder/utils.d.ts +8 -0
- package/dist/solution/ScanOrder/utils.js +97 -45
- package/dist/solution/ShopDiscount/index.d.ts +1 -0
- package/dist/solution/ShopDiscount/index.js +125 -87
- package/dist/solution/UnifiedBookingSales/index.d.ts +204 -0
- package/dist/solution/UnifiedBookingSales/index.js +2211 -0
- package/dist/solution/UnifiedBookingSales/types.d.ts +150 -0
- package/dist/solution/UnifiedBookingSales/types.js +11 -0
- package/dist/solution/VenueBooking/index.d.ts +39 -11
- package/dist/solution/VenueBooking/index.js +1167 -841
- package/dist/solution/VenueBooking/types.d.ts +3 -0
- package/dist/solution/VenueBooking/utils/resource.js +1 -0
- package/dist/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
- package/dist/solution/VenueBooking/utils/slotMerge.js +10 -5
- package/dist/solution/index.d.ts +1 -0
- package/dist/solution/index.js +2 -1
- package/dist/types/index.d.ts +1 -0
- package/lib/model/strategy/adapter/promotion/index.js +51 -0
- package/lib/modules/BaseModule.d.ts +1 -0
- package/lib/modules/BaseModule.js +24 -37
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +3 -0
- package/lib/modules/BookingContext/utils/productExtend.js +4 -3
- package/lib/modules/BookingContext/utils/timeSlices.js +18 -3
- package/lib/modules/Customer/index.d.ts +4 -0
- package/lib/modules/Customer/index.js +11 -0
- package/lib/modules/Customer/types.d.ts +2 -0
- package/lib/modules/Discount/index.d.ts +1 -0
- package/lib/modules/Discount/index.js +9 -0
- package/lib/modules/Discount/types.d.ts +1 -0
- package/lib/modules/Holder/index.d.ts +48 -0
- package/lib/modules/Holder/index.js +402 -0
- package/lib/modules/Holder/types.d.ts +123 -0
- package/lib/modules/Holder/types.js +17 -0
- package/lib/modules/Holder/utils.d.ts +13 -0
- package/lib/modules/Holder/utils.js +71 -0
- package/lib/modules/OpenData/index.js +1 -1
- package/lib/modules/Order/index.d.ts +32 -4
- package/lib/modules/Order/index.js +372 -156
- package/lib/modules/Order/types.d.ts +22 -1
- package/lib/modules/Order/utils/discountProductLineIdentity.d.ts +45 -0
- package/lib/modules/Order/utils/discountProductLineIdentity.js +170 -0
- package/lib/modules/Order/utils/orderCollectionIdentity.d.ts +15 -0
- package/lib/modules/Order/utils/orderCollectionIdentity.js +70 -0
- package/lib/modules/Order/utils.d.ts +10 -0
- package/lib/modules/Order/utils.js +39 -6
- package/lib/modules/Payment/index.d.ts +4 -0
- package/lib/modules/Payment/index.js +7 -0
- package/lib/modules/Payment/walletpass.js +27 -1
- package/lib/modules/Product/types.d.ts +1 -0
- package/lib/modules/ProductList/index.js +49 -31
- package/lib/modules/Quotation/index.d.ts +1 -1
- package/lib/modules/Quotation/index.js +2 -2
- package/lib/modules/ResourcePlanner/index.d.ts +24 -0
- package/lib/modules/ResourcePlanner/index.js +148 -0
- package/lib/modules/ResourcePlanner/planner.d.ts +14 -0
- package/lib/modules/ResourcePlanner/planner.js +933 -0
- package/lib/modules/ResourcePlanner/types.d.ts +227 -0
- package/lib/modules/ResourcePlanner/types.js +17 -0
- package/lib/modules/Rules/index.js +117 -25
- package/lib/modules/SalesSummary/index.js +6 -7
- package/lib/modules/ScanOrderLogger/index.d.ts +2 -0
- package/lib/modules/ScanOrderLogger/index.js +13 -1
- package/lib/modules/ScanOrderLogger/providers/feishu.js +15 -6
- package/lib/modules/ScanOrderLogger/types.d.ts +1 -0
- package/lib/modules/Schedule/index.d.ts +3 -1
- package/lib/modules/Schedule/index.js +10 -8
- package/lib/modules/Summary/utils.js +21 -1
- package/lib/modules/index.d.ts +2 -0
- package/lib/modules/index.js +5 -1
- package/lib/plugins/window.d.ts +1 -0
- package/lib/server/index.d.ts +20 -0
- package/lib/server/index.js +124 -19
- package/lib/server/modules/order/index.d.ts +2 -0
- package/lib/server/modules/order/index.js +75 -5
- package/lib/server/modules/order/types.d.ts +1 -1
- package/lib/server/utils/small-ticket.js +1 -1
- package/lib/solution/BaseSales/index.d.ts +10 -1
- package/lib/solution/BaseSales/index.js +73 -29
- package/lib/solution/BaseSales/utils/cartPromotion.js +18 -0
- package/lib/solution/BaseSales/utils/transformBaseProductToOrderProduct.js +1 -0
- package/lib/solution/BaseSales/utils.js +29 -18
- package/lib/solution/BookingByStep/index.d.ts +16 -1
- package/lib/solution/BookingByStep/index.js +60 -18
- package/lib/solution/BookingByStep/types.d.ts +2 -1
- package/lib/solution/BookingByStep/types.js +5 -0
- package/lib/solution/BookingByStep/utils/capacity.js +20 -1
- package/lib/solution/BookingByStep/utils/timeslots.d.ts +3 -1
- package/lib/solution/BookingByStep/utils/timeslots.js +19 -11
- package/lib/solution/BookingTicket/index.d.ts +6 -2
- package/lib/solution/BookingTicket/index.js +63 -16
- package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +3 -1
- package/lib/solution/BookingTicket/utils/scan/handleScan.js +2 -2
- package/lib/solution/ScanOrder/index.d.ts +26 -14
- package/lib/solution/ScanOrder/index.js +449 -182
- package/lib/solution/ScanOrder/types.d.ts +21 -1
- package/lib/solution/ScanOrder/utils.d.ts +8 -0
- package/lib/solution/ScanOrder/utils.js +60 -18
- package/lib/solution/ShopDiscount/index.d.ts +1 -0
- package/lib/solution/ShopDiscount/index.js +14 -0
- package/lib/solution/UnifiedBookingSales/index.d.ts +204 -0
- package/lib/solution/UnifiedBookingSales/index.js +1273 -0
- package/lib/solution/UnifiedBookingSales/types.d.ts +150 -0
- package/lib/solution/UnifiedBookingSales/types.js +33 -0
- package/lib/solution/VenueBooking/index.d.ts +39 -11
- package/lib/solution/VenueBooking/index.js +322 -110
- package/lib/solution/VenueBooking/types.d.ts +3 -0
- package/lib/solution/VenueBooking/utils/resource.js +1 -0
- package/lib/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
- package/lib/solution/VenueBooking/utils/slotMerge.js +6 -4
- package/lib/solution/index.d.ts +1 -0
- package/lib/solution/index.js +3 -1
- package/lib/types/index.d.ts +1 -0
- package/package.json +1 -1
|
@@ -65,19 +65,21 @@ function isRejectedSalesSubmitResult(result) {
|
|
|
65
65
|
var _result$response, _result$response2;
|
|
66
66
|
var candidates = [result, result === null || result === void 0 ? void 0 : result.data, result === null || result === void 0 || (_result$response = result.response) === null || _result$response === void 0 ? void 0 : _result$response.data, result === null || result === void 0 || (_result$response2 = result.response) === null || _result$response2 === void 0 ? void 0 : _result$response2.body];
|
|
67
67
|
return candidates.some(function (candidate) {
|
|
68
|
-
var _candidate$code;
|
|
69
68
|
if (!candidate || _typeof(candidate) !== 'object') return false;
|
|
70
|
-
|
|
71
|
-
|
|
69
|
+
if (candidate.code !== undefined && candidate.code !== 200 && candidate.code !== '200') {
|
|
70
|
+
return true;
|
|
71
|
+
}
|
|
72
|
+
var statusCode = Number(candidate.statusCode);
|
|
73
|
+
if (Number.isFinite(statusCode) && statusCode >= 400) return true;
|
|
72
74
|
if (candidate.status === false || candidate.success === false || candidate.result === false) {
|
|
73
75
|
return true;
|
|
74
76
|
}
|
|
75
77
|
return ['failed', 'error'].includes(String(candidate.status || '').toLowerCase());
|
|
76
78
|
});
|
|
77
79
|
}
|
|
78
|
-
function getSalesSubmitErrorMessage(result) {
|
|
80
|
+
function getSalesSubmitErrorMessage(result, fallbackMessage) {
|
|
79
81
|
var _result$data, _result$data2;
|
|
80
|
-
return (result === null || result === void 0 ? void 0 : result.message) || (result === null || result === void 0 ? void 0 : result.msg) || (result === null || result === void 0 || (_result$data = result.data) === null || _result$data === void 0 ? void 0 : _result$data.message) || (result === null || result === void 0 || (_result$data2 = result.data) === null || _result$data2 === void 0 ? void 0 : _result$data2.msg) ||
|
|
82
|
+
return (result === null || result === void 0 ? void 0 : result.message) || (result === null || result === void 0 ? void 0 : result.msg) || (result === null || result === void 0 || (_result$data = result.data) === null || _result$data === void 0 ? void 0 : _result$data.message) || (result === null || result === void 0 || (_result$data2 = result.data) === null || _result$data2 === void 0 ? void 0 : _result$data2.msg) || fallbackMessage;
|
|
81
83
|
}
|
|
82
84
|
function toWalletFundValue(value) {
|
|
83
85
|
try {
|
|
@@ -667,7 +669,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
667
669
|
}, {
|
|
668
670
|
key: "hydrateLatestLoadedSalesDetail",
|
|
669
671
|
value: function () {
|
|
670
|
-
var _hydrateLatestLoadedSalesDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(record, loadSequence) {
|
|
672
|
+
var _hydrateLatestLoadedSalesDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(record, loadSequence, hydrateSource) {
|
|
671
673
|
var _this4 = this;
|
|
672
674
|
var hydratedSales, skippedBeforeHydrate, hydrateTask, queuedTask;
|
|
673
675
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
@@ -695,7 +697,10 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
695
697
|
throw new Error('order 模块未初始化');
|
|
696
698
|
case 5:
|
|
697
699
|
_context4.next = 7;
|
|
698
|
-
return _this4.store.order.hydrateTempOrderFromRecord(record, {
|
|
700
|
+
return _this4.store.order.hydrateTempOrderFromRecord(record, hydrateSource === 'sessionStorage' ? {
|
|
701
|
+
recalcOnHydrate: true,
|
|
702
|
+
source: 'sessionStorage'
|
|
703
|
+
} : {
|
|
699
704
|
recalcOnHydrate: false
|
|
700
705
|
});
|
|
701
706
|
case 7:
|
|
@@ -746,7 +751,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
746
751
|
}
|
|
747
752
|
}, _callee5, this);
|
|
748
753
|
}));
|
|
749
|
-
function hydrateLatestLoadedSalesDetail(_x2, _x3) {
|
|
754
|
+
function hydrateLatestLoadedSalesDetail(_x2, _x3, _x4) {
|
|
750
755
|
return _hydrateLatestLoadedSalesDetail.apply(this, arguments);
|
|
751
756
|
}
|
|
752
757
|
return hydrateLatestLoadedSalesDetail;
|
|
@@ -849,7 +854,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
849
854
|
}
|
|
850
855
|
}, _callee6, this);
|
|
851
856
|
}));
|
|
852
|
-
function loadQuotationForPriceQuery(
|
|
857
|
+
function loadQuotationForPriceQuery(_x5) {
|
|
853
858
|
return _loadQuotationForPriceQuery.apply(this, arguments);
|
|
854
859
|
}
|
|
855
860
|
return loadQuotationForPriceQuery;
|
|
@@ -992,7 +997,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
992
997
|
}
|
|
993
998
|
}, _callee7, this, [[6, 17]]);
|
|
994
999
|
}));
|
|
995
|
-
function loadProductsForPriceQuery(
|
|
1000
|
+
function loadProductsForPriceQuery(_x6) {
|
|
996
1001
|
return _loadProductsForPriceQuery.apply(this, arguments);
|
|
997
1002
|
}
|
|
998
1003
|
return loadProductsForPriceQuery;
|
|
@@ -1030,7 +1035,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1030
1035
|
}
|
|
1031
1036
|
}, _callee8, this);
|
|
1032
1037
|
}));
|
|
1033
|
-
function loadProductForPriceQuery(
|
|
1038
|
+
function loadProductForPriceQuery(_x7, _x8) {
|
|
1034
1039
|
return _loadProductForPriceQuery.apply(this, arguments);
|
|
1035
1040
|
}
|
|
1036
1041
|
return loadProductForPriceQuery;
|
|
@@ -1168,13 +1173,23 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1168
1173
|
* const params = this.buildSubModuleOtherParams();
|
|
1169
1174
|
* this.core.registerModule(orderModule, { otherParams: params });
|
|
1170
1175
|
*/
|
|
1176
|
+
}, {
|
|
1177
|
+
key: "isSessionStoragePersistEnabled",
|
|
1178
|
+
value: function isSessionStoragePersistEnabled() {
|
|
1179
|
+
return Boolean(this.cacheId);
|
|
1180
|
+
}
|
|
1181
|
+
}, {
|
|
1182
|
+
key: "shouldUseSessionStorageForSubModule",
|
|
1183
|
+
value: function shouldUseSessionStorageForSubModule(_moduleName) {
|
|
1184
|
+
return this.isSessionStoragePersistEnabled();
|
|
1185
|
+
}
|
|
1171
1186
|
}, {
|
|
1172
1187
|
key: "buildSubModuleOtherParams",
|
|
1173
|
-
value: function buildSubModuleOtherParams() {
|
|
1188
|
+
value: function buildSubModuleOtherParams(moduleName) {
|
|
1174
1189
|
return _objectSpread(_objectSpread({}, this.otherParams), {}, {
|
|
1175
1190
|
salesSummaryModuleName: "".concat(this.name, "_salesSummary"),
|
|
1176
1191
|
fatherModule: this.name,
|
|
1177
|
-
openCache: this.
|
|
1192
|
+
openCache: this.shouldUseSessionStorageForSubModule(moduleName),
|
|
1178
1193
|
cacheId: this.cacheId
|
|
1179
1194
|
});
|
|
1180
1195
|
}
|
|
@@ -1193,17 +1208,15 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1193
1208
|
var _ref23,
|
|
1194
1209
|
_ref23$cover,
|
|
1195
1210
|
cover,
|
|
1196
|
-
nextSubModuleOtherParams,
|
|
1197
1211
|
_args10 = arguments;
|
|
1198
1212
|
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
1199
1213
|
while (1) switch (_context10.prev = _context10.next) {
|
|
1200
1214
|
case 0:
|
|
1201
1215
|
_ref23 = _args10.length > 1 && _args10[1] !== undefined ? _args10[1] : {}, _ref23$cover = _ref23.cover, cover = _ref23$cover === void 0 ? false : _ref23$cover;
|
|
1202
|
-
|
|
1203
|
-
_context10.next = 4;
|
|
1216
|
+
_context10.next = 3;
|
|
1204
1217
|
return Promise.all(Object.entries(this.store).map( /*#__PURE__*/function () {
|
|
1205
1218
|
var _ref25 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(_ref24) {
|
|
1206
|
-
var _ref26, moduleName, subModule, targetModule;
|
|
1219
|
+
var _ref26, moduleName, subModule, targetModule, nextSubModuleOtherParams;
|
|
1207
1220
|
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
1208
1221
|
while (1) switch (_context9.prev = _context9.next) {
|
|
1209
1222
|
case 0:
|
|
@@ -1221,28 +1234,29 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1221
1234
|
}
|
|
1222
1235
|
return _context9.abrupt("return");
|
|
1223
1236
|
case 6:
|
|
1224
|
-
|
|
1237
|
+
nextSubModuleOtherParams = _this6.buildSubModuleOtherParams(moduleName);
|
|
1238
|
+
_context9.next = 9;
|
|
1225
1239
|
return targetModule.updateOtherParams(nextSubModuleOtherParams, {
|
|
1226
1240
|
changedParams: changedParams,
|
|
1227
1241
|
cover: cover
|
|
1228
1242
|
});
|
|
1229
|
-
case
|
|
1243
|
+
case 9:
|
|
1230
1244
|
case "end":
|
|
1231
1245
|
return _context9.stop();
|
|
1232
1246
|
}
|
|
1233
1247
|
}, _callee9);
|
|
1234
1248
|
}));
|
|
1235
|
-
return function (
|
|
1249
|
+
return function (_x10) {
|
|
1236
1250
|
return _ref25.apply(this, arguments);
|
|
1237
1251
|
};
|
|
1238
1252
|
}()));
|
|
1239
|
-
case
|
|
1253
|
+
case 3:
|
|
1240
1254
|
case "end":
|
|
1241
1255
|
return _context10.stop();
|
|
1242
1256
|
}
|
|
1243
1257
|
}, _callee10, this);
|
|
1244
1258
|
}));
|
|
1245
|
-
function syncOtherParamsToSubModules(
|
|
1259
|
+
function syncOtherParamsToSubModules(_x9) {
|
|
1246
1260
|
return _syncOtherParamsToSubModules.apply(this, arguments);
|
|
1247
1261
|
}
|
|
1248
1262
|
return syncOtherParamsToSubModules;
|
|
@@ -1255,12 +1269,15 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1255
1269
|
}, {
|
|
1256
1270
|
key: "readSessionCacheData",
|
|
1257
1271
|
value: function readSessionCacheData() {
|
|
1258
|
-
|
|
1272
|
+
var cacheId = this.cacheId;
|
|
1273
|
+
if (!cacheId || !this.isSessionStoragePersistEnabled() || !this.window) {
|
|
1274
|
+
return {};
|
|
1275
|
+
}
|
|
1259
1276
|
try {
|
|
1260
1277
|
var sessionData = this.window.sessionStorage.getItem(this.name);
|
|
1261
1278
|
if (!sessionData) return {};
|
|
1262
1279
|
var data = JSON.parse(sessionData);
|
|
1263
|
-
return data && data[
|
|
1280
|
+
return data && data[cacheId] || {};
|
|
1264
1281
|
} catch (_unused3) {
|
|
1265
1282
|
return {};
|
|
1266
1283
|
}
|
|
@@ -1350,6 +1367,8 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1350
1367
|
value: function () {
|
|
1351
1368
|
var _initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(core) {
|
|
1352
1369
|
var _this$otherParams9,
|
|
1370
|
+
_this$appPlugin2,
|
|
1371
|
+
_this$appPlugin2$getA,
|
|
1353
1372
|
_this9 = this,
|
|
1354
1373
|
_this$otherParams10;
|
|
1355
1374
|
var options,
|
|
@@ -1373,14 +1392,11 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1373
1392
|
|
|
1374
1393
|
// 获取 logger 实例
|
|
1375
1394
|
this.appPlugin = core.getPlugin('app');
|
|
1376
|
-
if (this.appPlugin) {
|
|
1377
|
-
|
|
1378
|
-
break;
|
|
1395
|
+
if (!this.appPlugin) {
|
|
1396
|
+
// throw new Error('Checkout 解决方案需要 app 插件支持');
|
|
1379
1397
|
}
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
app = this.appPlugin.getApp();
|
|
1383
|
-
this.logger = app.logger;
|
|
1398
|
+
app = (_this$appPlugin2 = this.appPlugin) === null || _this$appPlugin2 === void 0 || (_this$appPlugin2$getA = _this$appPlugin2.getApp) === null || _this$appPlugin2$getA === void 0 ? void 0 : _this$appPlugin2$getA.call(_this$appPlugin2);
|
|
1399
|
+
this.logger = app === null || app === void 0 ? void 0 : app.logger;
|
|
1384
1400
|
targetCacheData = this.readSessionCacheData();
|
|
1385
1401
|
moduleNames = this.getRegisteredModuleNames();
|
|
1386
1402
|
moduleNames.forEach(function (step) {
|
|
@@ -1397,35 +1413,35 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1397
1413
|
var hooks = _this9.getSubModuleHooks(step);
|
|
1398
1414
|
_this9.store[step] = targetModule;
|
|
1399
1415
|
_this9.core.registerModule(targetModule, _objectSpread(_objectSpread({
|
|
1400
|
-
initialState: (targetCacheData === null || targetCacheData === void 0 ? void 0 : targetCacheData[targetModule.name]) || {}
|
|
1416
|
+
initialState: _this9.shouldUseSessionStorageForSubModule(step) ? (targetCacheData === null || targetCacheData === void 0 ? void 0 : targetCacheData[targetModule.name]) || {} : {}
|
|
1401
1417
|
}, hooks ? {
|
|
1402
1418
|
hooks: hooks
|
|
1403
1419
|
} : {}), {}, {
|
|
1404
|
-
otherParams: _this9.buildSubModuleOtherParams()
|
|
1420
|
+
otherParams: _this9.buildSubModuleOtherParams(step)
|
|
1405
1421
|
}));
|
|
1406
1422
|
});
|
|
1407
1423
|
if (!(this.store.schedule && !this.isScheduleListLoaded(this.store.schedule))) {
|
|
1408
|
-
_context11.next =
|
|
1424
|
+
_context11.next = 19;
|
|
1409
1425
|
break;
|
|
1410
1426
|
}
|
|
1411
|
-
_context11.next =
|
|
1427
|
+
_context11.next = 19;
|
|
1412
1428
|
return this.store.schedule.loadAllSchedule();
|
|
1413
|
-
case
|
|
1429
|
+
case 19:
|
|
1414
1430
|
if (this.store.order && typeof ((_this$otherParams10 = this.otherParams) === null || _this$otherParams10 === void 0 ? void 0 : _this$otherParams10.enableTempOrderPersist) === 'boolean') {
|
|
1415
1431
|
this.store.order.setEnableTempOrderPersist(this.otherParams.enableTempOrderPersist);
|
|
1416
1432
|
}
|
|
1417
|
-
_context11.next =
|
|
1433
|
+
_context11.next = 22;
|
|
1418
1434
|
return this.getPaymentMethodsAsync();
|
|
1419
|
-
case
|
|
1435
|
+
case 22:
|
|
1420
1436
|
this.registerServerOrderChangeSync();
|
|
1421
1437
|
this.core.effects.emit("".concat(this.name, ":onInited"), {});
|
|
1422
|
-
case
|
|
1438
|
+
case 24:
|
|
1423
1439
|
case "end":
|
|
1424
1440
|
return _context11.stop();
|
|
1425
1441
|
}
|
|
1426
1442
|
}, _callee11, this);
|
|
1427
1443
|
}));
|
|
1428
|
-
function initialize(
|
|
1444
|
+
function initialize(_x11) {
|
|
1429
1445
|
return _initialize.apply(this, arguments);
|
|
1430
1446
|
}
|
|
1431
1447
|
return initialize;
|
|
@@ -1483,7 +1499,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1483
1499
|
key: "loadSalesDetail",
|
|
1484
1500
|
value: (function () {
|
|
1485
1501
|
var _loadSalesDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(orderIdOrParams) {
|
|
1486
|
-
var loadSequence, _ref27, _ref28, _ref29, _ref30, _params$orderId, params, externalSaleNumber, preloadedSalesDetail, lookup, loadedRecord, message, remoteRecord, currentTempOrder, mergedRecord, record;
|
|
1502
|
+
var loadSequence, _ref27, _ref28, _ref29, _ref30, _params$orderId, params, externalSaleNumber, preloadedSalesDetail, lookup, loadedRecord, message, loadedSalesDetail, shouldFilterPendingPayments, remoteRecord, currentTempOrder, mergedRecord, record;
|
|
1487
1503
|
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
1488
1504
|
while (1) switch (_context13.prev = _context13.next) {
|
|
1489
1505
|
case 0:
|
|
@@ -1532,42 +1548,44 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1532
1548
|
message = loadedRecord && (loadedRecord.message || loadedRecord.msg) || "\u52A0\u8F7D\u9500\u552E\u8BE6\u60C5\u5931\u8D25: ".concat(lookup);
|
|
1533
1549
|
throw new Error(message);
|
|
1534
1550
|
case 22:
|
|
1535
|
-
|
|
1551
|
+
loadedSalesDetail = preloadedSalesDetail !== null && preloadedSalesDetail !== void 0 ? preloadedSalesDetail : loadedRecord.data; // payment_pending 只存在于本地;远端详情需过滤,但会话快照必须完整恢复。
|
|
1552
|
+
shouldFilterPendingPayments = params.hydrateSource !== 'sessionStorage';
|
|
1553
|
+
remoteRecord = shouldFilterPendingPayments ? filterPendingPaymentsFromLoadedSalesDetail(loadedSalesDetail) : loadedSalesDetail;
|
|
1536
1554
|
currentTempOrder = params.merge ? this.store.order.getTempOrder() : null;
|
|
1537
1555
|
mergedRecord = params.merge ? mergeSalesDetailRecordWithTempOrder(currentTempOrder, remoteRecord, 'preserve-local') : remoteRecord;
|
|
1538
|
-
record = filterPendingPaymentsFromLoadedSalesDetail(mergedRecord);
|
|
1539
|
-
_context13.next =
|
|
1540
|
-
return this.hydrateLatestLoadedSalesDetail(record, loadSequence);
|
|
1541
|
-
case
|
|
1556
|
+
record = shouldFilterPendingPayments ? filterPendingPaymentsFromLoadedSalesDetail(mergedRecord) : mergedRecord;
|
|
1557
|
+
_context13.next = 30;
|
|
1558
|
+
return this.hydrateLatestLoadedSalesDetail(record, loadSequence, params.hydrateSource);
|
|
1559
|
+
case 30:
|
|
1542
1560
|
return _context13.abrupt("return", _context13.sent);
|
|
1543
|
-
case
|
|
1544
|
-
_context13.prev =
|
|
1561
|
+
case 31:
|
|
1562
|
+
_context13.prev = 31;
|
|
1545
1563
|
this.salesDetailLoadInFlightCount = Math.max(0, this.salesDetailLoadInFlightCount - 1);
|
|
1546
1564
|
if (!(this.salesDetailLoadInFlightCount === 0)) {
|
|
1547
|
-
_context13.next =
|
|
1565
|
+
_context13.next = 42;
|
|
1548
1566
|
break;
|
|
1549
1567
|
}
|
|
1550
|
-
_context13.prev =
|
|
1551
|
-
_context13.next =
|
|
1568
|
+
_context13.prev = 34;
|
|
1569
|
+
_context13.next = 37;
|
|
1552
1570
|
return this.drainQueuedServerOrderChanges();
|
|
1553
|
-
case 35:
|
|
1554
|
-
_context13.next = 40;
|
|
1555
|
-
break;
|
|
1556
1571
|
case 37:
|
|
1557
|
-
_context13.
|
|
1558
|
-
|
|
1572
|
+
_context13.next = 42;
|
|
1573
|
+
break;
|
|
1574
|
+
case 39:
|
|
1575
|
+
_context13.prev = 39;
|
|
1576
|
+
_context13.t1 = _context13["catch"](34);
|
|
1559
1577
|
this.logError('drain queued server order changes failed', {
|
|
1560
1578
|
error: _context13.t1 instanceof Error ? _context13.t1.message : String(_context13.t1)
|
|
1561
1579
|
});
|
|
1562
|
-
case
|
|
1563
|
-
return _context13.finish(
|
|
1564
|
-
case
|
|
1580
|
+
case 42:
|
|
1581
|
+
return _context13.finish(31);
|
|
1582
|
+
case 43:
|
|
1565
1583
|
case "end":
|
|
1566
1584
|
return _context13.stop();
|
|
1567
1585
|
}
|
|
1568
|
-
}, _callee13, this, [[4,,
|
|
1586
|
+
}, _callee13, this, [[4,, 31, 43], [34, 39]]);
|
|
1569
1587
|
}));
|
|
1570
|
-
function loadSalesDetail(
|
|
1588
|
+
function loadSalesDetail(_x12) {
|
|
1571
1589
|
return _loadSalesDetail.apply(this, arguments);
|
|
1572
1590
|
}
|
|
1573
1591
|
return loadSalesDetail;
|
|
@@ -1674,7 +1692,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1674
1692
|
}
|
|
1675
1693
|
}, _callee14, this);
|
|
1676
1694
|
}));
|
|
1677
|
-
function replaceTempOrder(
|
|
1695
|
+
function replaceTempOrder(_x13, _x14) {
|
|
1678
1696
|
return _replaceTempOrder.apply(this, arguments);
|
|
1679
1697
|
}
|
|
1680
1698
|
return replaceTempOrder;
|
|
@@ -2314,7 +2332,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2314
2332
|
}
|
|
2315
2333
|
}, _callee20, this, [[46, 65, 68, 71]]);
|
|
2316
2334
|
}));
|
|
2317
|
-
function loadDiscountConfig(
|
|
2335
|
+
function loadDiscountConfig(_x15) {
|
|
2318
2336
|
return _loadDiscountConfig.apply(this, arguments);
|
|
2319
2337
|
}
|
|
2320
2338
|
return loadDiscountConfig;
|
|
@@ -2412,7 +2430,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2412
2430
|
}
|
|
2413
2431
|
}, _callee21, this);
|
|
2414
2432
|
}));
|
|
2415
|
-
function bestDiscount(
|
|
2433
|
+
function bestDiscount(_x16) {
|
|
2416
2434
|
return _bestDiscount.apply(this, arguments);
|
|
2417
2435
|
}
|
|
2418
2436
|
return bestDiscount;
|
|
@@ -2475,7 +2493,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2475
2493
|
}
|
|
2476
2494
|
}, _callee22, this);
|
|
2477
2495
|
}));
|
|
2478
|
-
function replaceDiscountStoreLists(
|
|
2496
|
+
function replaceDiscountStoreLists(_x17) {
|
|
2479
2497
|
return _replaceDiscountStoreLists.apply(this, arguments);
|
|
2480
2498
|
}
|
|
2481
2499
|
return replaceDiscountStoreLists;
|
|
@@ -2537,7 +2555,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2537
2555
|
}
|
|
2538
2556
|
}, _callee23, this, [[0, 16]]);
|
|
2539
2557
|
}));
|
|
2540
|
-
function scanPromotionCode(
|
|
2558
|
+
function scanPromotionCode(_x18, _x19) {
|
|
2541
2559
|
return _scanPromotionCode.apply(this, arguments);
|
|
2542
2560
|
}
|
|
2543
2561
|
return scanPromotionCode;
|
|
@@ -2728,7 +2746,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2728
2746
|
}
|
|
2729
2747
|
}, _callee24, this, [[0, 54], [17, 38, 41, 44]]);
|
|
2730
2748
|
}));
|
|
2731
|
-
function setDiscountSelected(
|
|
2749
|
+
function setDiscountSelected(_x20) {
|
|
2732
2750
|
return _setDiscountSelected.apply(this, arguments);
|
|
2733
2751
|
}
|
|
2734
2752
|
return setDiscountSelected;
|
|
@@ -2798,7 +2816,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2798
2816
|
}
|
|
2799
2817
|
}, _callee25, this, [[0, 21]]);
|
|
2800
2818
|
}));
|
|
2801
|
-
function applyDiscountCalculationResult(
|
|
2819
|
+
function applyDiscountCalculationResult(_x21) {
|
|
2802
2820
|
return _applyDiscountCalculationResult.apply(this, arguments);
|
|
2803
2821
|
}
|
|
2804
2822
|
return applyDiscountCalculationResult;
|
|
@@ -2817,7 +2835,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2817
2835
|
}
|
|
2818
2836
|
}, _callee26, this);
|
|
2819
2837
|
}));
|
|
2820
|
-
function submitScanOrder(
|
|
2838
|
+
function submitScanOrder(_x22) {
|
|
2821
2839
|
return _submitScanOrder.apply(this, arguments);
|
|
2822
2840
|
}
|
|
2823
2841
|
return submitScanOrder;
|
|
@@ -2832,8 +2850,8 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2832
2850
|
key: "submitSalesOrder",
|
|
2833
2851
|
value: (function () {
|
|
2834
2852
|
var _submitSalesOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(params) {
|
|
2835
|
-
var _this$otherParams11, _this$otherParams12, _this$otherParams13, _this$otherParams14;
|
|
2836
|
-
var inferredPaymentStatus, submitParams;
|
|
2853
|
+
var _params$smallTicketDa, _this$otherParams11, _this$otherParams12, _this$otherParams13, _this$otherParams14;
|
|
2854
|
+
var inferredPaymentStatus, smallTicketDataFlag, submitParams;
|
|
2837
2855
|
return _regeneratorRuntime().wrap(function _callee27$(_context27) {
|
|
2838
2856
|
while (1) switch (_context27.prev = _context27.next) {
|
|
2839
2857
|
case 0:
|
|
@@ -2845,6 +2863,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2845
2863
|
case 2:
|
|
2846
2864
|
// this.store.order.persistTempOrder();
|
|
2847
2865
|
inferredPaymentStatus = this.getSubmitPaymentStatus(params === null || params === void 0 ? void 0 : params.paymentStatus);
|
|
2866
|
+
smallTicketDataFlag = (_params$smallTicketDa = params === null || params === void 0 ? void 0 : params.smallTicketDataFlag) !== null && _params$smallTicketDa !== void 0 ? _params$smallTicketDa : this.getDefaultCheckoutSmallTicketDataFlag();
|
|
2848
2867
|
submitParams = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
2849
2868
|
cacheId: this.cacheId,
|
|
2850
2869
|
platform: (_this$otherParams11 = this.otherParams) === null || _this$otherParams11 === void 0 ? void 0 : _this$otherParams11.platform,
|
|
@@ -2856,21 +2875,21 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2856
2875
|
payments: params.payments
|
|
2857
2876
|
} : {}), inferredPaymentStatus !== undefined ? {
|
|
2858
2877
|
paymentStatus: inferredPaymentStatus
|
|
2859
|
-
} : {}),
|
|
2860
|
-
smallTicketDataFlag:
|
|
2878
|
+
} : {}), smallTicketDataFlag !== undefined ? {
|
|
2879
|
+
smallTicketDataFlag: smallTicketDataFlag
|
|
2861
2880
|
} : {}), (params === null || params === void 0 ? void 0 : params.confirmPendingVoucherPayments) !== undefined ? {
|
|
2862
2881
|
confirmPendingVoucherPayments: params.confirmPendingVoucherPayments
|
|
2863
2882
|
} : {}), (params === null || params === void 0 ? void 0 : params.enhancePayload) !== undefined ? {
|
|
2864
2883
|
enhancePayload: params.enhancePayload
|
|
2865
2884
|
} : {});
|
|
2866
|
-
return _context27.abrupt("return", this.store.order.submitTempOrder(submitParams));
|
|
2867
|
-
case
|
|
2885
|
+
return _context27.abrupt("return", this.shouldUseCheckoutSyncTask() ? this.store.order.submitTempOrder(submitParams) : this.store.order.submitTempOrderAsync(submitParams));
|
|
2886
|
+
case 6:
|
|
2868
2887
|
case "end":
|
|
2869
2888
|
return _context27.stop();
|
|
2870
2889
|
}
|
|
2871
2890
|
}, _callee27, this);
|
|
2872
2891
|
}));
|
|
2873
|
-
function submitSalesOrder(
|
|
2892
|
+
function submitSalesOrder(_x23) {
|
|
2874
2893
|
return _submitSalesOrder.apply(this, arguments);
|
|
2875
2894
|
}
|
|
2876
2895
|
return submitSalesOrder;
|
|
@@ -2904,7 +2923,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2904
2923
|
}
|
|
2905
2924
|
}, _callee28, this);
|
|
2906
2925
|
}));
|
|
2907
|
-
function saveSalesOrderDraft(
|
|
2926
|
+
function saveSalesOrderDraft(_x24) {
|
|
2908
2927
|
return _saveSalesOrderDraft.apply(this, arguments);
|
|
2909
2928
|
}
|
|
2910
2929
|
return saveSalesOrderDraft;
|
|
@@ -2913,8 +2932,8 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2913
2932
|
key: "submitTempOrderAsync",
|
|
2914
2933
|
value: function () {
|
|
2915
2934
|
var _submitTempOrderAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29(params) {
|
|
2916
|
-
var _this$otherParams19, _this$otherParams20, _this$otherParams21, _this$otherParams22;
|
|
2917
|
-
var inferredPaymentStatus, submitParams;
|
|
2935
|
+
var _params$smallTicketDa2, _this$otherParams19, _this$otherParams20, _this$otherParams21, _this$otherParams22;
|
|
2936
|
+
var inferredPaymentStatus, smallTicketDataFlag, submitParams;
|
|
2918
2937
|
return _regeneratorRuntime().wrap(function _callee29$(_context29) {
|
|
2919
2938
|
while (1) switch (_context29.prev = _context29.next) {
|
|
2920
2939
|
case 0:
|
|
@@ -2925,40 +2944,60 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2925
2944
|
throw new Error('BaseSales 解决方案需要 order 模块支持');
|
|
2926
2945
|
case 2:
|
|
2927
2946
|
inferredPaymentStatus = this.getSubmitPaymentStatus(params === null || params === void 0 ? void 0 : params.paymentStatus);
|
|
2947
|
+
smallTicketDataFlag = (_params$smallTicketDa2 = params === null || params === void 0 ? void 0 : params.smallTicketDataFlag) !== null && _params$smallTicketDa2 !== void 0 ? _params$smallTicketDa2 : this.getDefaultCheckoutSmallTicketDataFlag();
|
|
2928
2948
|
submitParams = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
2929
2949
|
cacheId: this.cacheId,
|
|
2930
2950
|
platform: (_this$otherParams19 = this.otherParams) === null || _this$otherParams19 === void 0 ? void 0 : _this$otherParams19.platform,
|
|
2931
2951
|
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),
|
|
2932
2952
|
channel: this.getSubmitOrderSalesChannel(),
|
|
2933
|
-
type: (_this$otherParams22 = this.otherParams) === null || _this$otherParams22 === void 0 ? void 0 : _this$otherParams22.type
|
|
2953
|
+
type: (_this$otherParams22 = this.otherParams) === null || _this$otherParams22 === void 0 ? void 0 : _this$otherParams22.type,
|
|
2954
|
+
request_unique_idempotency_token: this.store.order.generateIdempotencyToken()
|
|
2934
2955
|
}, (params === null || params === void 0 ? void 0 : params.payments) !== undefined ? {
|
|
2935
2956
|
payments: params.payments
|
|
2936
2957
|
} : {}), inferredPaymentStatus !== undefined ? {
|
|
2937
2958
|
paymentStatus: inferredPaymentStatus
|
|
2938
|
-
} : {}),
|
|
2939
|
-
smallTicketDataFlag:
|
|
2959
|
+
} : {}), smallTicketDataFlag !== undefined ? {
|
|
2960
|
+
smallTicketDataFlag: smallTicketDataFlag
|
|
2940
2961
|
} : {}), (params === null || params === void 0 ? void 0 : params.confirmPendingVoucherPayments) !== undefined ? {
|
|
2941
2962
|
confirmPendingVoucherPayments: params.confirmPendingVoucherPayments
|
|
2942
2963
|
} : {}), (params === null || params === void 0 ? void 0 : params.enhancePayload) !== undefined ? {
|
|
2943
2964
|
enhancePayload: params.enhancePayload
|
|
2944
2965
|
} : {});
|
|
2945
2966
|
return _context29.abrupt("return", this.store.order.submitTempOrderAsync(submitParams));
|
|
2946
|
-
case
|
|
2967
|
+
case 6:
|
|
2947
2968
|
case "end":
|
|
2948
2969
|
return _context29.stop();
|
|
2949
2970
|
}
|
|
2950
2971
|
}, _callee29, this);
|
|
2951
2972
|
}));
|
|
2952
|
-
function submitTempOrderAsync(
|
|
2973
|
+
function submitTempOrderAsync(_x25) {
|
|
2953
2974
|
return _submitTempOrderAsync.apply(this, arguments);
|
|
2954
2975
|
}
|
|
2955
2976
|
return submitTempOrderAsync;
|
|
2956
2977
|
}()
|
|
2978
|
+
/**
|
|
2979
|
+
* 默认保持 WebPOS 的本地待同步订单模式;需要云端确认后才算成功的渠道可覆盖此策略。
|
|
2980
|
+
* otherParams.checkoutSyncTaskEnabled 优先,便于同一 solution 按入口恢复旧行为。
|
|
2981
|
+
*/
|
|
2982
|
+
}, {
|
|
2983
|
+
key: "shouldUseCheckoutSyncTask",
|
|
2984
|
+
value: function shouldUseCheckoutSyncTask() {
|
|
2985
|
+
var _this$otherParams23;
|
|
2986
|
+
var configured = (_this$otherParams23 = this.otherParams) === null || _this$otherParams23 === void 0 ? void 0 : _this$otherParams23.checkoutSyncTaskEnabled;
|
|
2987
|
+
return typeof configured === 'boolean' ? configured : true;
|
|
2988
|
+
}
|
|
2989
|
+
|
|
2990
|
+
/** 可由特定 solution 为真实 checkout 补充默认收据数据请求。 */
|
|
2991
|
+
}, {
|
|
2992
|
+
key: "getDefaultCheckoutSmallTicketDataFlag",
|
|
2993
|
+
value: function getDefaultCheckoutSmallTicketDataFlag() {
|
|
2994
|
+
return undefined;
|
|
2995
|
+
}
|
|
2957
2996
|
}, {
|
|
2958
2997
|
key: "printLocalOrderReceipt",
|
|
2959
2998
|
value: function () {
|
|
2960
2999
|
var _printLocalOrderReceipt = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30(lookup) {
|
|
2961
|
-
var _this$
|
|
3000
|
+
var _this$otherParams24, _this$otherParams25, _this$otherParams26, _this$otherParams27;
|
|
2962
3001
|
var hasLookup, lookupPayload, context, payload, response, _this$store$order$app, _this$store$order5, _data;
|
|
2963
3002
|
return _regeneratorRuntime().wrap(function _callee30$(_context30) {
|
|
2964
3003
|
while (1) switch (_context30.prev = _context30.next) {
|
|
@@ -2976,10 +3015,10 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2976
3015
|
external_sale_number: lookup
|
|
2977
3016
|
};
|
|
2978
3017
|
context = {
|
|
2979
|
-
platform: (_this$
|
|
2980
|
-
businessCode: ((_this$
|
|
3018
|
+
platform: (_this$otherParams24 = this.otherParams) === null || _this$otherParams24 === void 0 ? void 0 : _this$otherParams24.platform,
|
|
3019
|
+
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),
|
|
2981
3020
|
channel: this.getSubmitOrderSalesChannel(),
|
|
2982
|
-
type: (_this$
|
|
3021
|
+
type: (_this$otherParams27 = this.otherParams) === null || _this$otherParams27 === void 0 ? void 0 : _this$otherParams27.type
|
|
2983
3022
|
};
|
|
2984
3023
|
payload = hasLookup ? _objectSpread(_objectSpread({}, lookupPayload), {}, {
|
|
2985
3024
|
lookup_order_from_db: 1,
|
|
@@ -3016,7 +3055,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3016
3055
|
}
|
|
3017
3056
|
}, _callee30, this);
|
|
3018
3057
|
}));
|
|
3019
|
-
function printLocalOrderReceipt(
|
|
3058
|
+
function printLocalOrderReceipt(_x26) {
|
|
3020
3059
|
return _printLocalOrderReceipt.apply(this, arguments);
|
|
3021
3060
|
}
|
|
3022
3061
|
return printLocalOrderReceipt;
|
|
@@ -3038,7 +3077,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3038
3077
|
key: "syncPaymentsToOrder",
|
|
3039
3078
|
value: function () {
|
|
3040
3079
|
var _syncPaymentsToOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31(params) {
|
|
3041
|
-
var _ref32, _params$businessCode, _this$
|
|
3080
|
+
var _ref32, _params$businessCode, _this$otherParams28, _this$otherParams29, _params$channel2;
|
|
3042
3081
|
var businessCode, channel, syncParams, syncState, payments, syncResult, latestPayments, amountSnapshot, orderSnapshot, syncPayload;
|
|
3043
3082
|
return _regeneratorRuntime().wrap(function _callee31$(_context31) {
|
|
3044
3083
|
while (1) switch (_context31.prev = _context31.next) {
|
|
@@ -3049,9 +3088,11 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3049
3088
|
}
|
|
3050
3089
|
throw new Error('order 模块未初始化');
|
|
3051
3090
|
case 2:
|
|
3052
|
-
businessCode = (_ref32 = (_params$businessCode = params.businessCode) !== null && _params$businessCode !== void 0 ? _params$businessCode : (_this$
|
|
3091
|
+
businessCode = (_ref32 = (_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 && _ref32 !== void 0 ? _ref32 : (_this$otherParams29 = this.otherParams) === null || _this$otherParams29 === void 0 ? void 0 : _this$otherParams29.business_code;
|
|
3053
3092
|
channel = (_params$channel2 = params.channel) !== null && _params$channel2 !== void 0 ? _params$channel2 : this.getSubmitOrderSalesChannel();
|
|
3054
|
-
syncParams = _objectSpread(_objectSpread(_objectSpread({}, params),
|
|
3093
|
+
syncParams = _objectSpread(_objectSpread(_objectSpread({}, params), {}, {
|
|
3094
|
+
checkoutSyncTaskEnabled: this.shouldUseCheckoutSyncTask()
|
|
3095
|
+
}, businessCode !== undefined ? {
|
|
3055
3096
|
businessCode: businessCode
|
|
3056
3097
|
} : {}), channel !== undefined ? {
|
|
3057
3098
|
channel: channel
|
|
@@ -3128,7 +3169,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3128
3169
|
}
|
|
3129
3170
|
}, _callee31, this, [[12, 29]]);
|
|
3130
3171
|
}));
|
|
3131
|
-
function syncPaymentsToOrder(
|
|
3172
|
+
function syncPaymentsToOrder(_x27) {
|
|
3132
3173
|
return _syncPaymentsToOrder.apply(this, arguments);
|
|
3133
3174
|
}
|
|
3134
3175
|
return syncPaymentsToOrder;
|
|
@@ -3298,7 +3339,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3298
3339
|
}
|
|
3299
3340
|
}, _callee33, this);
|
|
3300
3341
|
}));
|
|
3301
|
-
function addOrderPaymentAsync(
|
|
3342
|
+
function addOrderPaymentAsync(_x28) {
|
|
3302
3343
|
return _addOrderPaymentAsync.apply(this, arguments);
|
|
3303
3344
|
}
|
|
3304
3345
|
return addOrderPaymentAsync;
|
|
@@ -3306,7 +3347,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3306
3347
|
}, {
|
|
3307
3348
|
key: "addOrderPaymentWithDevicePrefix",
|
|
3308
3349
|
value: function addOrderPaymentWithDevicePrefix(payment, devicePrefix) {
|
|
3309
|
-
var _this$
|
|
3350
|
+
var _this$otherParams30,
|
|
3310
3351
|
_paymentRecord$paymen,
|
|
3311
3352
|
_paymentRecord$create,
|
|
3312
3353
|
_ref33,
|
|
@@ -3322,7 +3363,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3322
3363
|
return this.store.order.getOrderPayments();
|
|
3323
3364
|
}
|
|
3324
3365
|
var metadata = paymentRecord.metadata && _typeof(paymentRecord.metadata) === 'object' ? _objectSpread({}, paymentRecord.metadata) : {};
|
|
3325
|
-
var shopWalletPassId = (_this$
|
|
3366
|
+
var shopWalletPassId = (_this$otherParams30 = this.otherParams) === null || _this$otherParams30 === void 0 ? void 0 : _this$otherParams30.shop_wallet_pass_id;
|
|
3326
3367
|
if (shopWalletPassId !== undefined && shopWalletPassId !== null) {
|
|
3327
3368
|
metadata.shop_wallet_pass_id = shopWalletPassId;
|
|
3328
3369
|
}
|
|
@@ -3486,7 +3527,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3486
3527
|
}
|
|
3487
3528
|
}, _callee34, this, [[17, 23]]);
|
|
3488
3529
|
}));
|
|
3489
|
-
function updateOrderPayment(
|
|
3530
|
+
function updateOrderPayment(_x29, _x30) {
|
|
3490
3531
|
return _updateOrderPayment.apply(this, arguments);
|
|
3491
3532
|
}
|
|
3492
3533
|
return updateOrderPayment;
|
|
@@ -3525,7 +3566,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3525
3566
|
}
|
|
3526
3567
|
}, _callee35, this);
|
|
3527
3568
|
}));
|
|
3528
|
-
function updateVoucherOrderPaymentsAsync(
|
|
3569
|
+
function updateVoucherOrderPaymentsAsync(_x31, _x32) {
|
|
3529
3570
|
return _updateVoucherOrderPaymentsAsync.apply(this, arguments);
|
|
3530
3571
|
}
|
|
3531
3572
|
return updateVoucherOrderPaymentsAsync;
|
|
@@ -3691,7 +3732,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3691
3732
|
}
|
|
3692
3733
|
}, _callee36, this);
|
|
3693
3734
|
}));
|
|
3694
|
-
function initWalletData(
|
|
3735
|
+
function initWalletData(_x33) {
|
|
3695
3736
|
return _initWalletData.apply(this, arguments);
|
|
3696
3737
|
}
|
|
3697
3738
|
return initWalletData;
|
|
@@ -3758,7 +3799,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3758
3799
|
}
|
|
3759
3800
|
}, _callee37, this);
|
|
3760
3801
|
}));
|
|
3761
|
-
function publishWalletAssetsState(
|
|
3802
|
+
function publishWalletAssetsState(_x34) {
|
|
3762
3803
|
return _publishWalletAssetsState.apply(this, arguments);
|
|
3763
3804
|
}
|
|
3764
3805
|
return publishWalletAssetsState;
|
|
@@ -3839,7 +3880,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3839
3880
|
}
|
|
3840
3881
|
}, _callee38, this);
|
|
3841
3882
|
}));
|
|
3842
|
-
function syncSelectedWalletAssets(
|
|
3883
|
+
function syncSelectedWalletAssets(_x35) {
|
|
3843
3884
|
return _syncSelectedWalletAssets.apply(this, arguments);
|
|
3844
3885
|
}
|
|
3845
3886
|
return syncSelectedWalletAssets;
|
|
@@ -3895,7 +3936,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3895
3936
|
}
|
|
3896
3937
|
}, _callee39, this);
|
|
3897
3938
|
}));
|
|
3898
|
-
function importWalletAssetsSnapshot(
|
|
3939
|
+
function importWalletAssetsSnapshot(_x36) {
|
|
3899
3940
|
return _importWalletAssetsSnapshot.apply(this, arguments);
|
|
3900
3941
|
}
|
|
3901
3942
|
return importWalletAssetsSnapshot;
|
|
@@ -3983,7 +4024,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3983
4024
|
}
|
|
3984
4025
|
}, _callee40, this);
|
|
3985
4026
|
}));
|
|
3986
|
-
function refreshWalletAssets(
|
|
4027
|
+
function refreshWalletAssets(_x37) {
|
|
3987
4028
|
return _refreshWalletAssets.apply(this, arguments);
|
|
3988
4029
|
}
|
|
3989
4030
|
return refreshWalletAssets;
|
|
@@ -4016,7 +4057,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4016
4057
|
}
|
|
4017
4058
|
}, _callee41, this);
|
|
4018
4059
|
}));
|
|
4019
|
-
function selectWalletAsset(
|
|
4060
|
+
function selectWalletAsset(_x38) {
|
|
4020
4061
|
return _selectWalletAsset.apply(this, arguments);
|
|
4021
4062
|
}
|
|
4022
4063
|
return selectWalletAsset;
|
|
@@ -4046,7 +4087,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4046
4087
|
}
|
|
4047
4088
|
}, _callee42, this);
|
|
4048
4089
|
}));
|
|
4049
|
-
function updateWalletAssetAmount(
|
|
4090
|
+
function updateWalletAssetAmount(_x39) {
|
|
4050
4091
|
return _updateWalletAssetAmount.apply(this, arguments);
|
|
4051
4092
|
}
|
|
4052
4093
|
return updateWalletAssetAmount;
|
|
@@ -4091,7 +4132,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4091
4132
|
}
|
|
4092
4133
|
}, _callee43, this);
|
|
4093
4134
|
}));
|
|
4094
|
-
function scanWalletAsset(
|
|
4135
|
+
function scanWalletAsset(_x40) {
|
|
4095
4136
|
return _scanWalletAsset.apply(this, arguments);
|
|
4096
4137
|
}
|
|
4097
4138
|
return scanWalletAsset;
|
|
@@ -4221,7 +4262,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4221
4262
|
key: "getCashPaymentConfig",
|
|
4222
4263
|
value: (function () {
|
|
4223
4264
|
var _getCashPaymentConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee46() {
|
|
4224
|
-
var _this$store$order11, _this$store$order11$g, _this$store$order12, _this$store$order12$g, _this$
|
|
4265
|
+
var _this$store$order11, _this$store$order11$g, _this$store$order12, _this$store$order12$g, _this$otherParams31;
|
|
4225
4266
|
var paymentMethods, paymentMethod, amountSnapshot, pendingWalletAmount, amountDue, currency, recommendedAmounts;
|
|
4226
4267
|
return _regeneratorRuntime().wrap(function _callee46$(_context46) {
|
|
4227
4268
|
while (1) switch (_context46.prev = _context46.next) {
|
|
@@ -4247,7 +4288,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4247
4288
|
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);
|
|
4248
4289
|
pendingWalletAmount = this.getPendingWalletPaymentAmount();
|
|
4249
4290
|
amountDue = Decimal.max(new Decimal((amountSnapshot === null || amountSnapshot === void 0 ? void 0 : amountSnapshot.amountGap) || 0).minus(pendingWalletAmount), 0).toDecimalPlaces(2).toNumber();
|
|
4250
|
-
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$
|
|
4291
|
+
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';
|
|
4251
4292
|
recommendedAmounts = amountDue > 0 ? this.store.payment.cash.getRecommendedAmount(amountDue, currency) : [];
|
|
4252
4293
|
return _context46.abrupt("return", {
|
|
4253
4294
|
available: Boolean(paymentMethod && amountDue > 0),
|
|
@@ -4317,7 +4358,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4317
4358
|
_context47.next = 17;
|
|
4318
4359
|
break;
|
|
4319
4360
|
}
|
|
4320
|
-
throw new Error(getSalesSubmitErrorMessage(submitResult));
|
|
4361
|
+
throw new Error(getSalesSubmitErrorMessage(submitResult, 'Wallet 支付确认失败'));
|
|
4321
4362
|
case 17:
|
|
4322
4363
|
_context47.next = 27;
|
|
4323
4364
|
break;
|
|
@@ -4382,7 +4423,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4382
4423
|
key: "payCash",
|
|
4383
4424
|
value: (function () {
|
|
4384
4425
|
var _payCash = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee48(params) {
|
|
4385
|
-
var _this$store$order$get6, _params$actualPaidAmo, _this$
|
|
4426
|
+
var _this$store$order$get6, _params$actualPaidAmo, _this$otherParams32, _this$window, _this$window$postMess;
|
|
4386
4427
|
var amount, config, paymentMethod, roundingAmount, effectivePaymentAmount, beforePayments, beforePaymentStatus, uniquePaymentNumber, paymentTimestamp, actualPaidAmount, changeAmount, shopWalletPassId, payments, payment, syncResult, committed, walletState, restoredTempOrder;
|
|
4387
4428
|
return _regeneratorRuntime().wrap(function _callee48$(_context48) {
|
|
4388
4429
|
while (1) switch (_context48.prev = _context48.next) {
|
|
@@ -4431,7 +4472,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4431
4472
|
paymentTimestamp = dayjs().format('YYYY-MM-DD HH:mm:ss');
|
|
4432
4473
|
actualPaidAmount = Number((_params$actualPaidAmo = params.actualPaidAmount) !== null && _params$actualPaidAmo !== void 0 ? _params$actualPaidAmo : amount);
|
|
4433
4474
|
changeAmount = Number(params.changeAmount || 0);
|
|
4434
|
-
shopWalletPassId = (_this$
|
|
4475
|
+
shopWalletPassId = (_this$otherParams32 = this.otherParams) === null || _this$otherParams32 === void 0 ? void 0 : _this$otherParams32.shop_wallet_pass_id;
|
|
4435
4476
|
if (!(!Number.isFinite(actualPaidAmount) || actualPaidAmount + 0.01 < amount)) {
|
|
4436
4477
|
_context48.next = 26;
|
|
4437
4478
|
break;
|
|
@@ -4478,23 +4519,29 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4478
4519
|
});
|
|
4479
4520
|
case 32:
|
|
4480
4521
|
syncResult = _context48.sent;
|
|
4522
|
+
if (!isRejectedSalesSubmitResult(syncResult.submitResult)) {
|
|
4523
|
+
_context48.next = 35;
|
|
4524
|
+
break;
|
|
4525
|
+
}
|
|
4526
|
+
throw new Error(getSalesSubmitErrorMessage(syncResult.submitResult, '订单提交失败'));
|
|
4527
|
+
case 35:
|
|
4481
4528
|
if (!this.store.payment) {
|
|
4482
|
-
_context48.next =
|
|
4529
|
+
_context48.next = 40;
|
|
4483
4530
|
break;
|
|
4484
4531
|
}
|
|
4485
4532
|
committed = this.getCommittedWalletAssets();
|
|
4486
4533
|
walletState = this.store.payment.wallet.setCommittedWalletAssets(committed.ids, committed.assets);
|
|
4487
|
-
_context48.next =
|
|
4534
|
+
_context48.next = 40;
|
|
4488
4535
|
return this.publishWalletAssetsState(walletState);
|
|
4489
|
-
case
|
|
4536
|
+
case 40:
|
|
4490
4537
|
return _context48.abrupt("return", {
|
|
4491
4538
|
payment: payment || {},
|
|
4492
4539
|
payments: this.store.order.getOrderPayments(),
|
|
4493
4540
|
syncResult: syncResult,
|
|
4494
4541
|
isOrderFullyPaid: syncResult.isOrderFullyPaid
|
|
4495
4542
|
});
|
|
4496
|
-
case
|
|
4497
|
-
_context48.prev =
|
|
4543
|
+
case 43:
|
|
4544
|
+
_context48.prev = 43;
|
|
4498
4545
|
_context48.t0 = _context48["catch"](29);
|
|
4499
4546
|
this.store.order.setOrderPayments(beforePayments);
|
|
4500
4547
|
restoredTempOrder = this.store.order.getTempOrder();
|
|
@@ -4502,19 +4549,19 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4502
4549
|
restoredTempOrder.payment_status = beforePaymentStatus;
|
|
4503
4550
|
this.store.order.persistTempOrder();
|
|
4504
4551
|
}
|
|
4505
|
-
_context48.next =
|
|
4552
|
+
_context48.next = 50;
|
|
4506
4553
|
return this.store.order.recalculateSummary({
|
|
4507
4554
|
createIfMissing: true
|
|
4508
4555
|
});
|
|
4509
|
-
case
|
|
4556
|
+
case 50:
|
|
4510
4557
|
throw _context48.t0;
|
|
4511
|
-
case
|
|
4558
|
+
case 51:
|
|
4512
4559
|
case "end":
|
|
4513
4560
|
return _context48.stop();
|
|
4514
4561
|
}
|
|
4515
|
-
}, _callee48, this, [[29,
|
|
4562
|
+
}, _callee48, this, [[29, 43]]);
|
|
4516
4563
|
}));
|
|
4517
|
-
function payCash(
|
|
4564
|
+
function payCash(_x41) {
|
|
4518
4565
|
return _payCash.apply(this, arguments);
|
|
4519
4566
|
}
|
|
4520
4567
|
return payCash;
|
|
@@ -4634,23 +4681,29 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4634
4681
|
});
|
|
4635
4682
|
case 33:
|
|
4636
4683
|
syncResult = _context49.sent;
|
|
4684
|
+
if (!isRejectedSalesSubmitResult(syncResult.submitResult)) {
|
|
4685
|
+
_context49.next = 36;
|
|
4686
|
+
break;
|
|
4687
|
+
}
|
|
4688
|
+
throw new Error(getSalesSubmitErrorMessage(syncResult.submitResult, '订单提交失败'));
|
|
4689
|
+
case 36:
|
|
4637
4690
|
if (!this.store.payment) {
|
|
4638
|
-
_context49.next =
|
|
4691
|
+
_context49.next = 41;
|
|
4639
4692
|
break;
|
|
4640
4693
|
}
|
|
4641
4694
|
committed = this.getCommittedWalletAssets();
|
|
4642
4695
|
walletState = this.store.payment.wallet.setCommittedWalletAssets(committed.ids, committed.assets);
|
|
4643
|
-
_context49.next =
|
|
4696
|
+
_context49.next = 41;
|
|
4644
4697
|
return this.publishWalletAssetsState(walletState);
|
|
4645
|
-
case
|
|
4698
|
+
case 41:
|
|
4646
4699
|
return _context49.abrupt("return", {
|
|
4647
4700
|
payment: payment || {},
|
|
4648
4701
|
payments: this.store.order.getOrderPayments(),
|
|
4649
4702
|
syncResult: syncResult,
|
|
4650
4703
|
isOrderFullyPaid: syncResult.isOrderFullyPaid
|
|
4651
4704
|
});
|
|
4652
|
-
case
|
|
4653
|
-
_context49.prev =
|
|
4705
|
+
case 44:
|
|
4706
|
+
_context49.prev = 44;
|
|
4654
4707
|
_context49.t0 = _context49["catch"](30);
|
|
4655
4708
|
this.store.order.setOrderPayments(beforePayments);
|
|
4656
4709
|
restoredTempOrder = this.store.order.getTempOrder();
|
|
@@ -4658,19 +4711,19 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4658
4711
|
restoredTempOrder.payment_status = beforePaymentStatus;
|
|
4659
4712
|
this.store.order.persistTempOrder();
|
|
4660
4713
|
}
|
|
4661
|
-
_context49.next =
|
|
4714
|
+
_context49.next = 51;
|
|
4662
4715
|
return this.store.order.recalculateSummary({
|
|
4663
4716
|
createIfMissing: true
|
|
4664
4717
|
});
|
|
4665
|
-
case
|
|
4718
|
+
case 51:
|
|
4666
4719
|
throw _context49.t0;
|
|
4667
|
-
case
|
|
4720
|
+
case 52:
|
|
4668
4721
|
case "end":
|
|
4669
4722
|
return _context49.stop();
|
|
4670
4723
|
}
|
|
4671
|
-
}, _callee49, this, [[30,
|
|
4724
|
+
}, _callee49, this, [[30, 44]]);
|
|
4672
4725
|
}));
|
|
4673
|
-
function commitPaymentMethodPayment(
|
|
4726
|
+
function commitPaymentMethodPayment(_x42) {
|
|
4674
4727
|
return _commitPaymentMethodPayment.apply(this, arguments);
|
|
4675
4728
|
}
|
|
4676
4729
|
return commitPaymentMethodPayment;
|
|
@@ -4718,7 +4771,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4718
4771
|
}
|
|
4719
4772
|
}, _callee50, this);
|
|
4720
4773
|
}));
|
|
4721
|
-
function roundAmount(
|
|
4774
|
+
function roundAmount(_x43) {
|
|
4722
4775
|
return _roundAmount.apply(this, arguments);
|
|
4723
4776
|
}
|
|
4724
4777
|
return roundAmount;
|
|
@@ -4775,7 +4828,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4775
4828
|
}
|
|
4776
4829
|
}, _callee51, this);
|
|
4777
4830
|
}));
|
|
4778
|
-
function sendCustomerPayLink(
|
|
4831
|
+
function sendCustomerPayLink(_x44) {
|
|
4779
4832
|
return _sendCustomerPayLink.apply(this, arguments);
|
|
4780
4833
|
}
|
|
4781
4834
|
return sendCustomerPayLink;
|
|
@@ -4820,7 +4873,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4820
4873
|
}
|
|
4821
4874
|
}, _callee52, this);
|
|
4822
4875
|
}));
|
|
4823
|
-
function calculateProductBookingPrice(
|
|
4876
|
+
function calculateProductBookingPrice(_x45) {
|
|
4824
4877
|
return _calculateProductBookingPrice.apply(this, arguments);
|
|
4825
4878
|
}
|
|
4826
4879
|
return calculateProductBookingPrice;
|
|
@@ -4949,7 +5002,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4949
5002
|
}
|
|
4950
5003
|
}, _callee53);
|
|
4951
5004
|
}));
|
|
4952
|
-
return function (
|
|
5005
|
+
return function (_x47) {
|
|
4953
5006
|
return _ref40.apply(this, arguments);
|
|
4954
5007
|
};
|
|
4955
5008
|
}()));
|
|
@@ -4983,7 +5036,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4983
5036
|
}
|
|
4984
5037
|
}, _callee54, this);
|
|
4985
5038
|
}));
|
|
4986
|
-
function calculateProductBookingPrices(
|
|
5039
|
+
function calculateProductBookingPrices(_x46) {
|
|
4987
5040
|
return _calculateProductBookingPrices.apply(this, arguments);
|
|
4988
5041
|
}
|
|
4989
5042
|
return calculateProductBookingPrices;
|
|
@@ -5018,7 +5071,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5018
5071
|
}
|
|
5019
5072
|
}, _callee55, this, [[0, 9]]);
|
|
5020
5073
|
}));
|
|
5021
|
-
function addProductToOrder(
|
|
5074
|
+
function addProductToOrder(_x48, _x49, _x50) {
|
|
5022
5075
|
return _addProductToOrder.apply(this, arguments);
|
|
5023
5076
|
}
|
|
5024
5077
|
return addProductToOrder;
|
|
@@ -5053,7 +5106,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5053
5106
|
}
|
|
5054
5107
|
}, _callee56, this, [[0, 9]]);
|
|
5055
5108
|
}));
|
|
5056
|
-
function updateOrderProduct(
|
|
5109
|
+
function updateOrderProduct(_x51) {
|
|
5057
5110
|
return _updateOrderProduct.apply(this, arguments);
|
|
5058
5111
|
}
|
|
5059
5112
|
return updateOrderProduct;
|
|
@@ -5088,7 +5141,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5088
5141
|
}
|
|
5089
5142
|
}, _callee57, this, [[0, 9]]);
|
|
5090
5143
|
}));
|
|
5091
|
-
function updateOrderProducts(
|
|
5144
|
+
function updateOrderProducts(_x52) {
|
|
5092
5145
|
return _updateOrderProducts.apply(this, arguments);
|
|
5093
5146
|
}
|
|
5094
5147
|
return updateOrderProducts;
|
|
@@ -5123,7 +5176,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5123
5176
|
}
|
|
5124
5177
|
}, _callee58, this, [[0, 9]]);
|
|
5125
5178
|
}));
|
|
5126
|
-
function updateOrderProductQuantity(
|
|
5179
|
+
function updateOrderProductQuantity(_x53) {
|
|
5127
5180
|
return _updateOrderProductQuantity.apply(this, arguments);
|
|
5128
5181
|
}
|
|
5129
5182
|
return updateOrderProductQuantity;
|
|
@@ -5181,7 +5234,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5181
5234
|
}
|
|
5182
5235
|
}, _callee59, this, [[0, 11]]);
|
|
5183
5236
|
}));
|
|
5184
|
-
function setOrderProductLineNote(
|
|
5237
|
+
function setOrderProductLineNote(_x54, _x55) {
|
|
5185
5238
|
return _setOrderProductLineNote.apply(this, arguments);
|
|
5186
5239
|
}
|
|
5187
5240
|
return setOrderProductLineNote;
|
|
@@ -5221,7 +5274,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5221
5274
|
}
|
|
5222
5275
|
}, _callee60, this, [[0, 8]]);
|
|
5223
5276
|
}));
|
|
5224
|
-
function removeProductsFromOrder(
|
|
5277
|
+
function removeProductsFromOrder(_x56, _x57) {
|
|
5225
5278
|
return _removeProductsFromOrder.apply(this, arguments);
|
|
5226
5279
|
}
|
|
5227
5280
|
return removeProductsFromOrder;
|
|
@@ -5240,7 +5293,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5240
5293
|
}
|
|
5241
5294
|
}, _callee61, this);
|
|
5242
5295
|
}));
|
|
5243
|
-
function removeProductFromOrder(
|
|
5296
|
+
function removeProductFromOrder(_x58, _x59) {
|
|
5244
5297
|
return _removeProductFromOrder.apply(this, arguments);
|
|
5245
5298
|
}
|
|
5246
5299
|
return removeProductFromOrder;
|
|
@@ -5334,13 +5387,13 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5334
5387
|
key: "getProductList",
|
|
5335
5388
|
value: function () {
|
|
5336
5389
|
var _getProductList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee63() {
|
|
5337
|
-
var _this$
|
|
5390
|
+
var _this$otherParams33;
|
|
5338
5391
|
var menu_list_ids, _this$store$products, res;
|
|
5339
5392
|
return _regeneratorRuntime().wrap(function _callee63$(_context63) {
|
|
5340
5393
|
while (1) switch (_context63.prev = _context63.next) {
|
|
5341
5394
|
case 0:
|
|
5342
5395
|
// 可以直接通过配置里的 menu 读取
|
|
5343
|
-
menu_list_ids = ((_this$
|
|
5396
|
+
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) {
|
|
5344
5397
|
return Number(n.value);
|
|
5345
5398
|
})) || [];
|
|
5346
5399
|
_context63.prev = 1;
|
|
@@ -5378,7 +5431,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5378
5431
|
key: "setOtherParams",
|
|
5379
5432
|
value: function () {
|
|
5380
5433
|
var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee64(params) {
|
|
5381
|
-
var _this$
|
|
5434
|
+
var _this$otherParams34;
|
|
5382
5435
|
var _ref42,
|
|
5383
5436
|
_ref42$cover,
|
|
5384
5437
|
cover,
|
|
@@ -5392,7 +5445,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5392
5445
|
} else {
|
|
5393
5446
|
this.otherParams = _objectSpread(_objectSpread({}, this.otherParams), params);
|
|
5394
5447
|
}
|
|
5395
|
-
this.cacheId = (_this$
|
|
5448
|
+
this.cacheId = (_this$otherParams34 = this.otherParams) === null || _this$otherParams34 === void 0 ? void 0 : _this$otherParams34.cacheId;
|
|
5396
5449
|
_context64.next = 5;
|
|
5397
5450
|
return this.syncOtherParamsToSubModules(params, {
|
|
5398
5451
|
cover: cover
|
|
@@ -5403,7 +5456,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5403
5456
|
}
|
|
5404
5457
|
}, _callee64, this);
|
|
5405
5458
|
}));
|
|
5406
|
-
function setOtherParams(
|
|
5459
|
+
function setOtherParams(_x60) {
|
|
5407
5460
|
return _setOtherParams.apply(this, arguments);
|
|
5408
5461
|
}
|
|
5409
5462
|
return setOtherParams;
|