@pisell/pisellos 2.3.51 → 2.3.54
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/utils/buildCacheItemFromOrderLine.js +12 -10
- package/dist/modules/Order/index.d.ts +6 -6
- package/dist/modules/Order/index.js +140 -86
- package/dist/modules/Order/types.d.ts +21 -3
- package/dist/modules/Order/types.js +11 -0
- package/dist/modules/ProductList/index.js +1 -1
- package/dist/modules/Rules/index.js +19 -9
- package/dist/modules/SalesSummary/utils.js +7 -1
- package/dist/solution/BaseSales/index.d.ts +15 -5
- package/dist/solution/BaseSales/index.js +173 -135
- package/dist/solution/BaseSales/utils/cartPromotion.js +5 -3
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingTicket/types.d.ts +3 -0
- package/dist/solution/BookingTicket/utils/cartView.js +44 -32
- package/dist/solution/Sales/index.d.ts +1 -0
- package/dist/solution/Sales/index.js +16 -2
- package/dist/solution/UnifiedBookingSales/index.d.ts +0 -4
- package/dist/solution/UnifiedBookingSales/index.js +27 -26
- package/lib/model/strategy/adapter/promotion/index.js +0 -51
- package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +3 -1
- package/lib/modules/Order/index.d.ts +6 -6
- package/lib/modules/Order/index.js +79 -12
- package/lib/modules/Order/types.d.ts +21 -3
- package/lib/modules/ProductList/index.js +9 -1
- package/lib/modules/Rules/index.js +16 -11
- package/lib/modules/SalesSummary/utils.js +5 -1
- package/lib/solution/BaseSales/index.d.ts +15 -5
- package/lib/solution/BaseSales/index.js +44 -11
- package/lib/solution/BaseSales/utils/cartPromotion.js +5 -2
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingTicket/types.d.ts +3 -0
- package/lib/solution/BookingTicket/utils/cartView.js +43 -30
- package/lib/solution/Sales/index.d.ts +1 -0
- package/lib/solution/Sales/index.js +15 -3
- package/lib/solution/UnifiedBookingSales/index.d.ts +0 -4
- package/lib/solution/UnifiedBookingSales/index.js +27 -26
- package/package.json +1 -1
|
@@ -862,6 +862,40 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
862
862
|
if (!Number.isFinite(productId)) return null;
|
|
863
863
|
return productId;
|
|
864
864
|
}
|
|
865
|
+
|
|
866
|
+
/**
|
|
867
|
+
* Change Time / customer reprice 必须沿用商品列表的渠道口径。
|
|
868
|
+
* SalesSdk Provider 通常将渠道存为 platform,因此不能只读取 otherParams.channel。
|
|
869
|
+
*/
|
|
870
|
+
}, {
|
|
871
|
+
key: "getPriceQueryChannel",
|
|
872
|
+
value: function getPriceQueryChannel(channel) {
|
|
873
|
+
var _this$otherParams2, _ref12, _ref13, _this$otherParams3, _this$otherParams4;
|
|
874
|
+
var strategyContext = (_this$otherParams2 = this.otherParams) !== null && _this$otherParams2 !== void 0 && _this$otherParams2.strategy_context && _typeof(this.otherParams.strategy_context) === 'object' ? this.otherParams.strategy_context : {};
|
|
875
|
+
var value = (_ref12 = (_ref13 = channel !== null && channel !== void 0 ? channel : strategyContext.channel) !== null && _ref13 !== void 0 ? _ref13 : (_this$otherParams3 = this.otherParams) === null || _this$otherParams3 === void 0 ? void 0 : _this$otherParams3.channel) !== null && _ref12 !== void 0 ? _ref12 : (_this$otherParams4 = this.otherParams) === null || _this$otherParams4 === void 0 ? void 0 : _this$otherParams4.platform;
|
|
876
|
+
if (value === undefined || value === null || String(value).trim() === '') {
|
|
877
|
+
return undefined;
|
|
878
|
+
}
|
|
879
|
+
return String(value).trim();
|
|
880
|
+
}
|
|
881
|
+
/**
|
|
882
|
+
* /product/query 的智能定价评估只读取 strategy_context;
|
|
883
|
+
* application_code 仅作为接口兼容字段,不能替代 channel / business_code。
|
|
884
|
+
*/
|
|
885
|
+
}, {
|
|
886
|
+
key: "getPriceQueryStrategyContext",
|
|
887
|
+
value: function getPriceQueryStrategyContext(channel) {
|
|
888
|
+
var _this$otherParams5, _ref14, _strategyContext$busi, _this$otherParams6, _this$otherParams7;
|
|
889
|
+
var inherited = (_this$otherParams5 = this.otherParams) !== null && _this$otherParams5 !== void 0 && _this$otherParams5.strategy_context && _typeof(this.otherParams.strategy_context) === 'object' ? this.otherParams.strategy_context : {};
|
|
890
|
+
var strategyContext = _objectSpread({}, inherited);
|
|
891
|
+
var resolvedChannel = this.getPriceQueryChannel(channel);
|
|
892
|
+
var businessCode = (_ref14 = (_strategyContext$busi = strategyContext.business_code) !== null && _strategyContext$busi !== void 0 ? _strategyContext$busi : (_this$otherParams6 = this.otherParams) === null || _this$otherParams6 === void 0 ? void 0 : _this$otherParams6.businessCode) !== null && _ref14 !== void 0 ? _ref14 : (_this$otherParams7 = this.otherParams) === null || _this$otherParams7 === void 0 ? void 0 : _this$otherParams7.business_code;
|
|
893
|
+
if (resolvedChannel) strategyContext.channel = resolvedChannel;
|
|
894
|
+
if (businessCode !== undefined && businessCode !== null && String(businessCode).trim() !== '') {
|
|
895
|
+
strategyContext.business_code = String(businessCode).trim();
|
|
896
|
+
}
|
|
897
|
+
return strategyContext;
|
|
898
|
+
}
|
|
865
899
|
}, {
|
|
866
900
|
key: "getPriceQuerySchedule",
|
|
867
901
|
value: function getPriceQuerySchedule(params) {
|
|
@@ -894,7 +928,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
894
928
|
key: "loadProductsForPriceQuery",
|
|
895
929
|
value: function () {
|
|
896
930
|
var _loadProductsForPriceQuery = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(params) {
|
|
897
|
-
var ids, productsById,
|
|
931
|
+
var ids, productsById, channel, strategyContext, _response$data, response, list;
|
|
898
932
|
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
899
933
|
while (1) switch (_context7.prev = _context7.next) {
|
|
900
934
|
case 0:
|
|
@@ -908,9 +942,11 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
908
942
|
}
|
|
909
943
|
return _context7.abrupt("return", productsById);
|
|
910
944
|
case 4:
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
945
|
+
channel = this.getPriceQueryChannel(params.channel);
|
|
946
|
+
strategyContext = this.getPriceQueryStrategyContext(channel);
|
|
947
|
+
_context7.prev = 6;
|
|
948
|
+
_context7.next = 9;
|
|
949
|
+
return this.request.post('/product/query', _objectSpread({
|
|
914
950
|
ids: ids,
|
|
915
951
|
open_quotation: 1,
|
|
916
952
|
open_bundle: 1,
|
|
@@ -920,39 +956,41 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
920
956
|
customer_id: params.customerId,
|
|
921
957
|
schedule_date: params.schedule.schedule_date,
|
|
922
958
|
schedule_datetime: params.schedule.schedule_datetime,
|
|
923
|
-
application_code:
|
|
924
|
-
}, {
|
|
959
|
+
application_code: channel
|
|
960
|
+
}, Object.keys(strategyContext).length ? {
|
|
961
|
+
strategy_context: strategyContext
|
|
962
|
+
} : {}), {
|
|
925
963
|
osServer: true,
|
|
926
964
|
customToast: function customToast() {}
|
|
927
965
|
});
|
|
928
|
-
case
|
|
966
|
+
case 9:
|
|
929
967
|
response = _context7.sent;
|
|
930
968
|
list = (response === null || response === void 0 || (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.list) || (response === null || response === void 0 ? void 0 : response.list) || [];
|
|
931
969
|
if (Array.isArray(list)) {
|
|
932
|
-
_context7.next =
|
|
970
|
+
_context7.next = 13;
|
|
933
971
|
break;
|
|
934
972
|
}
|
|
935
973
|
return _context7.abrupt("return", productsById);
|
|
936
|
-
case
|
|
974
|
+
case 13:
|
|
937
975
|
list.forEach(function (item) {
|
|
938
976
|
var _item$id;
|
|
939
977
|
var productId = Number((_item$id = item === null || item === void 0 ? void 0 : item.id) !== null && _item$id !== void 0 ? _item$id : item === null || item === void 0 ? void 0 : item.product_id);
|
|
940
978
|
if (Number.isFinite(productId)) productsById.set(productId, item);
|
|
941
979
|
});
|
|
942
980
|
return _context7.abrupt("return", productsById);
|
|
943
|
-
case
|
|
944
|
-
_context7.prev =
|
|
945
|
-
_context7.t0 = _context7["catch"](
|
|
981
|
+
case 17:
|
|
982
|
+
_context7.prev = 17;
|
|
983
|
+
_context7.t0 = _context7["catch"](6);
|
|
946
984
|
this.logWarning('loadProductsForPriceQuery: 商品批量重查失败,使用入参 fallback', {
|
|
947
985
|
ids: ids,
|
|
948
986
|
error: _context7.t0 instanceof Error ? _context7.t0.message : String(_context7.t0)
|
|
949
987
|
});
|
|
950
988
|
return _context7.abrupt("return", productsById);
|
|
951
|
-
case
|
|
989
|
+
case 21:
|
|
952
990
|
case "end":
|
|
953
991
|
return _context7.stop();
|
|
954
992
|
}
|
|
955
|
-
}, _callee7, this, [[
|
|
993
|
+
}, _callee7, this, [[6, 17]]);
|
|
956
994
|
}));
|
|
957
995
|
function loadProductsForPriceQuery(_x5) {
|
|
958
996
|
return _loadProductsForPriceQuery.apply(this, arguments);
|
|
@@ -1005,10 +1043,10 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1005
1043
|
return groups.flatMap(function (group) {
|
|
1006
1044
|
var items = Array.isArray(group === null || group === void 0 ? void 0 : group.bundle_item) ? group.bundle_item : Array.isArray(group === null || group === void 0 ? void 0 : group.bundleItem) ? group.bundleItem : [];
|
|
1007
1045
|
return items.map(function (item) {
|
|
1008
|
-
var _item$group_id,
|
|
1046
|
+
var _item$group_id, _ref15, _item$bundle_group_id;
|
|
1009
1047
|
return _objectSpread(_objectSpread({}, item), {}, {
|
|
1010
1048
|
group_id: (_item$group_id = item === null || item === void 0 ? void 0 : item.group_id) !== null && _item$group_id !== void 0 ? _item$group_id : group === null || group === void 0 ? void 0 : group.id,
|
|
1011
|
-
bundle_group_id: (
|
|
1049
|
+
bundle_group_id: (_ref15 = (_item$bundle_group_id = item === null || item === void 0 ? void 0 : item.bundle_group_id) !== null && _item$bundle_group_id !== void 0 ? _item$bundle_group_id : item === null || item === void 0 ? void 0 : item.group_id) !== null && _ref15 !== void 0 ? _ref15 : group === null || group === void 0 ? void 0 : group.id
|
|
1012
1050
|
});
|
|
1013
1051
|
});
|
|
1014
1052
|
});
|
|
@@ -1039,21 +1077,21 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1039
1077
|
}, {
|
|
1040
1078
|
key: "getAuthoritativeBundleUnitPrice",
|
|
1041
1079
|
value: function getAuthoritativeBundleUnitPrice(bundle) {
|
|
1042
|
-
var
|
|
1043
|
-
return (
|
|
1080
|
+
var _ref16, _ref17, _ref18, _bundle$price;
|
|
1081
|
+
return (_ref16 = (_ref17 = (_ref18 = (_bundle$price = bundle.price) !== null && _bundle$price !== void 0 ? _bundle$price : bundle.bundle_selling_price) !== null && _ref18 !== void 0 ? _ref18 : bundle.custom_price) !== null && _ref17 !== void 0 ? _ref17 : bundle.product_price) !== null && _ref16 !== void 0 ? _ref16 : bundle.base_price;
|
|
1044
1082
|
}
|
|
1045
1083
|
}, {
|
|
1046
1084
|
key: "mergeProductForPriceQuery",
|
|
1047
1085
|
value: function mergeProductForPriceQuery(product, authoritativeProduct) {
|
|
1048
1086
|
var _this5 = this,
|
|
1049
1087
|
_product$id,
|
|
1050
|
-
|
|
1088
|
+
_ref19,
|
|
1051
1089
|
_product$product_id2,
|
|
1052
|
-
|
|
1090
|
+
_ref20,
|
|
1053
1091
|
_product$product_vari,
|
|
1054
|
-
|
|
1092
|
+
_ref21,
|
|
1055
1093
|
_product$num,
|
|
1056
|
-
|
|
1094
|
+
_ref22,
|
|
1057
1095
|
_product$quantity,
|
|
1058
1096
|
_product$metadata4;
|
|
1059
1097
|
if (!authoritativeProduct) return product;
|
|
@@ -1073,10 +1111,10 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1073
1111
|
});
|
|
1074
1112
|
return _objectSpread(_objectSpread(_objectSpread({}, product), authoritativeProduct), {}, {
|
|
1075
1113
|
id: (_product$id = product.id) !== null && _product$id !== void 0 ? _product$id : authoritativeProduct.id,
|
|
1076
|
-
product_id: (
|
|
1077
|
-
product_variant_id: (
|
|
1078
|
-
num: (
|
|
1079
|
-
quantity: (
|
|
1114
|
+
product_id: (_ref19 = (_product$product_id2 = product.product_id) !== null && _product$product_id2 !== void 0 ? _product$product_id2 : authoritativeProduct.product_id) !== null && _ref19 !== void 0 ? _ref19 : authoritativeProduct.id,
|
|
1115
|
+
product_variant_id: (_ref20 = (_product$product_vari = product.product_variant_id) !== null && _product$product_vari !== void 0 ? _product$product_vari : authoritativeProduct.product_variant_id) !== null && _ref20 !== void 0 ? _ref20 : 0,
|
|
1116
|
+
num: (_ref21 = (_product$num = product.num) !== null && _product$num !== void 0 ? _product$num : product.quantity) !== null && _ref21 !== void 0 ? _ref21 : authoritativeProduct.num,
|
|
1117
|
+
quantity: (_ref22 = (_product$quantity = product.quantity) !== null && _product$quantity !== void 0 ? _product$quantity : product.num) !== null && _ref22 !== void 0 ? _ref22 : authoritativeProduct.quantity,
|
|
1080
1118
|
product_sku: function () {
|
|
1081
1119
|
var authoritativeSku = ensureProductSku(authoritativeProduct);
|
|
1082
1120
|
var productSku = ensureProductSku(product);
|
|
@@ -1092,8 +1130,8 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1092
1130
|
}, {
|
|
1093
1131
|
key: "getSubmitOrderSalesChannel",
|
|
1094
1132
|
value: function getSubmitOrderSalesChannel() {
|
|
1095
|
-
var _this$
|
|
1096
|
-
return (_this$
|
|
1133
|
+
var _this$otherParams8;
|
|
1134
|
+
return (_this$otherParams8 = this.otherParams) === null || _this$otherParams8 === void 0 ? void 0 : _this$otherParams8.channel;
|
|
1097
1135
|
}
|
|
1098
1136
|
|
|
1099
1137
|
/**
|
|
@@ -1152,24 +1190,24 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1152
1190
|
value: (function () {
|
|
1153
1191
|
var _syncOtherParamsToSubModules = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(changedParams) {
|
|
1154
1192
|
var _this6 = this;
|
|
1155
|
-
var
|
|
1156
|
-
|
|
1193
|
+
var _ref23,
|
|
1194
|
+
_ref23$cover,
|
|
1157
1195
|
cover,
|
|
1158
1196
|
nextSubModuleOtherParams,
|
|
1159
1197
|
_args10 = arguments;
|
|
1160
1198
|
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
|
1161
1199
|
while (1) switch (_context10.prev = _context10.next) {
|
|
1162
1200
|
case 0:
|
|
1163
|
-
|
|
1201
|
+
_ref23 = _args10.length > 1 && _args10[1] !== undefined ? _args10[1] : {}, _ref23$cover = _ref23.cover, cover = _ref23$cover === void 0 ? false : _ref23$cover;
|
|
1164
1202
|
nextSubModuleOtherParams = this.buildSubModuleOtherParams();
|
|
1165
1203
|
_context10.next = 4;
|
|
1166
1204
|
return Promise.all(Object.entries(this.store).map( /*#__PURE__*/function () {
|
|
1167
|
-
var
|
|
1168
|
-
var
|
|
1205
|
+
var _ref25 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(_ref24) {
|
|
1206
|
+
var _ref26, moduleName, subModule, targetModule;
|
|
1169
1207
|
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
1170
1208
|
while (1) switch (_context9.prev = _context9.next) {
|
|
1171
1209
|
case 0:
|
|
1172
|
-
|
|
1210
|
+
_ref26 = _slicedToArray(_ref24, 2), moduleName = _ref26[0], subModule = _ref26[1];
|
|
1173
1211
|
if (!_this6.reusedSharedSubModuleNames.has(moduleName)) {
|
|
1174
1212
|
_context9.next = 3;
|
|
1175
1213
|
break;
|
|
@@ -1195,7 +1233,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1195
1233
|
}, _callee9);
|
|
1196
1234
|
}));
|
|
1197
1235
|
return function (_x9) {
|
|
1198
|
-
return
|
|
1236
|
+
return _ref25.apply(this, arguments);
|
|
1199
1237
|
};
|
|
1200
1238
|
}()));
|
|
1201
1239
|
case 4:
|
|
@@ -1311,11 +1349,11 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1311
1349
|
key: "initialize",
|
|
1312
1350
|
value: function () {
|
|
1313
1351
|
var _initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(core) {
|
|
1314
|
-
var _this$
|
|
1352
|
+
var _this$otherParams9,
|
|
1315
1353
|
_this$appPlugin2,
|
|
1316
1354
|
_this$appPlugin2$getA,
|
|
1317
1355
|
_this9 = this,
|
|
1318
|
-
_this$
|
|
1356
|
+
_this$otherParams10;
|
|
1319
1357
|
var options,
|
|
1320
1358
|
app,
|
|
1321
1359
|
targetCacheData,
|
|
@@ -1330,7 +1368,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1330
1368
|
this.paymentNumberDevicePrefix = null;
|
|
1331
1369
|
// this.store = { ...this.store, ...(options.store as Partial<BaseSalesState>) };
|
|
1332
1370
|
this.otherParams = options.otherParams || {};
|
|
1333
|
-
this.cacheId = (_this$
|
|
1371
|
+
this.cacheId = (_this$otherParams9 = this.otherParams) === null || _this$otherParams9 === void 0 ? void 0 : _this$otherParams9.cacheId;
|
|
1334
1372
|
this.reusedSharedSubModuleNames.clear();
|
|
1335
1373
|
this.window = core.getPlugin('window');
|
|
1336
1374
|
this.request = core.getPlugin('request');
|
|
@@ -1372,7 +1410,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1372
1410
|
_context11.next = 19;
|
|
1373
1411
|
return this.store.schedule.loadAllSchedule();
|
|
1374
1412
|
case 19:
|
|
1375
|
-
if (this.store.order && typeof ((_this$
|
|
1413
|
+
if (this.store.order && typeof ((_this$otherParams10 = this.otherParams) === null || _this$otherParams10 === void 0 ? void 0 : _this$otherParams10.enableTempOrderPersist) === 'boolean') {
|
|
1376
1414
|
this.store.order.setEnableTempOrderPersist(this.otherParams.enableTempOrderPersist);
|
|
1377
1415
|
}
|
|
1378
1416
|
_context11.next = 22;
|
|
@@ -1444,7 +1482,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1444
1482
|
key: "loadSalesDetail",
|
|
1445
1483
|
value: (function () {
|
|
1446
1484
|
var _loadSalesDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(orderIdOrParams) {
|
|
1447
|
-
var loadSequence,
|
|
1485
|
+
var loadSequence, _ref27, _ref28, _ref29, _ref30, _params$orderId, params, externalSaleNumber, preloadedSalesDetail, lookup, loadedRecord, message, remoteRecord, currentTempOrder, mergedRecord, record;
|
|
1448
1486
|
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
|
1449
1487
|
while (1) switch (_context13.prev = _context13.next) {
|
|
1450
1488
|
case 0:
|
|
@@ -1462,7 +1500,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1462
1500
|
};
|
|
1463
1501
|
externalSaleNumber = params.externalSaleNumber || params.external_sale_number;
|
|
1464
1502
|
preloadedSalesDetail = params.preloadedSalesDetail;
|
|
1465
|
-
lookup = (
|
|
1503
|
+
lookup = (_ref27 = (_ref28 = (_ref29 = (_ref30 = (_params$orderId = params.orderId) !== null && _params$orderId !== void 0 ? _params$orderId : externalSaleNumber) !== null && _ref30 !== void 0 ? _ref30 : params.orderNumber) !== null && _ref29 !== void 0 ? _ref29 : preloadedSalesDetail === null || preloadedSalesDetail === void 0 ? void 0 : preloadedSalesDetail.order_id) !== null && _ref28 !== void 0 ? _ref28 : preloadedSalesDetail === null || preloadedSalesDetail === void 0 ? void 0 : preloadedSalesDetail.external_sale_number) !== null && _ref27 !== void 0 ? _ref27 : preloadedSalesDetail === null || preloadedSalesDetail === void 0 ? void 0 : preloadedSalesDetail.order_number;
|
|
1466
1504
|
if (!(!preloadedSalesDetail && (lookup === undefined || lookup === null || lookup === ''))) {
|
|
1467
1505
|
_context13.next = 11;
|
|
1468
1506
|
break;
|
|
@@ -1608,7 +1646,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1608
1646
|
}, {
|
|
1609
1647
|
key: "replaceTempOrder",
|
|
1610
1648
|
value: function () {
|
|
1611
|
-
var _replaceTempOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(tempOrder) {
|
|
1649
|
+
var _replaceTempOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(tempOrder, options) {
|
|
1612
1650
|
var nextTempOrder;
|
|
1613
1651
|
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
|
1614
1652
|
while (1) switch (_context14.prev = _context14.next) {
|
|
@@ -1620,7 +1658,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1620
1658
|
throw new Error('order 模块未初始化');
|
|
1621
1659
|
case 2:
|
|
1622
1660
|
_context14.next = 4;
|
|
1623
|
-
return this.store.order.replaceTempOrder(tempOrder);
|
|
1661
|
+
return this.store.order.replaceTempOrder(tempOrder, options);
|
|
1624
1662
|
case 4:
|
|
1625
1663
|
nextTempOrder = _context14.sent;
|
|
1626
1664
|
_context14.next = 7;
|
|
@@ -1635,7 +1673,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
1635
1673
|
}
|
|
1636
1674
|
}, _callee14, this);
|
|
1637
1675
|
}));
|
|
1638
|
-
function replaceTempOrder(_x12) {
|
|
1676
|
+
function replaceTempOrder(_x12, _x13) {
|
|
1639
1677
|
return _replaceTempOrder.apply(this, arguments);
|
|
1640
1678
|
}
|
|
1641
1679
|
return replaceTempOrder;
|
|
@@ -2275,7 +2313,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2275
2313
|
}
|
|
2276
2314
|
}, _callee20, this, [[46, 65, 68, 71]]);
|
|
2277
2315
|
}));
|
|
2278
|
-
function loadDiscountConfig(
|
|
2316
|
+
function loadDiscountConfig(_x14) {
|
|
2279
2317
|
return _loadDiscountConfig.apply(this, arguments);
|
|
2280
2318
|
}
|
|
2281
2319
|
return loadDiscountConfig;
|
|
@@ -2373,7 +2411,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2373
2411
|
}
|
|
2374
2412
|
}, _callee21, this);
|
|
2375
2413
|
}));
|
|
2376
|
-
function bestDiscount(
|
|
2414
|
+
function bestDiscount(_x15) {
|
|
2377
2415
|
return _bestDiscount.apply(this, arguments);
|
|
2378
2416
|
}
|
|
2379
2417
|
return bestDiscount;
|
|
@@ -2436,7 +2474,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2436
2474
|
}
|
|
2437
2475
|
}, _callee22, this);
|
|
2438
2476
|
}));
|
|
2439
|
-
function replaceDiscountStoreLists(
|
|
2477
|
+
function replaceDiscountStoreLists(_x16) {
|
|
2440
2478
|
return _replaceDiscountStoreLists.apply(this, arguments);
|
|
2441
2479
|
}
|
|
2442
2480
|
return replaceDiscountStoreLists;
|
|
@@ -2498,7 +2536,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2498
2536
|
}
|
|
2499
2537
|
}, _callee23, this, [[0, 16]]);
|
|
2500
2538
|
}));
|
|
2501
|
-
function scanPromotionCode(
|
|
2539
|
+
function scanPromotionCode(_x17, _x18) {
|
|
2502
2540
|
return _scanPromotionCode.apply(this, arguments);
|
|
2503
2541
|
}
|
|
2504
2542
|
return scanPromotionCode;
|
|
@@ -2613,10 +2651,10 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2613
2651
|
product.discount_list = filterSelectedDiscountDetails(product.discount_list);
|
|
2614
2652
|
if (Array.isArray(product.product_bundle)) {
|
|
2615
2653
|
product.product_bundle = product.product_bundle.map(function (bundle) {
|
|
2616
|
-
var
|
|
2654
|
+
var _ref31, _bundle$original_pric;
|
|
2617
2655
|
var nextBundleDiscountList = filterSelectedDiscountDetails(bundle === null || bundle === void 0 ? void 0 : bundle.discount_list);
|
|
2618
2656
|
var shouldRestoreBundlePrice = nextBundleDiscountList.length === 0;
|
|
2619
|
-
var restoredBundlePrice = (
|
|
2657
|
+
var restoredBundlePrice = (_ref31 = (_bundle$original_pric = bundle === null || bundle === void 0 ? void 0 : bundle.original_price) !== null && _bundle$original_pric !== void 0 ? _bundle$original_pric : bundle === null || bundle === void 0 ? void 0 : bundle.product_price) !== null && _ref31 !== void 0 ? _ref31 : bundle === null || bundle === void 0 ? void 0 : bundle.price;
|
|
2620
2658
|
return _objectSpread(_objectSpread(_objectSpread({}, bundle), shouldRestoreBundlePrice ? {
|
|
2621
2659
|
price: restoredBundlePrice,
|
|
2622
2660
|
bundle_selling_price: restoredBundlePrice
|
|
@@ -2689,7 +2727,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2689
2727
|
}
|
|
2690
2728
|
}, _callee24, this, [[0, 54], [17, 38, 41, 44]]);
|
|
2691
2729
|
}));
|
|
2692
|
-
function setDiscountSelected(
|
|
2730
|
+
function setDiscountSelected(_x19) {
|
|
2693
2731
|
return _setDiscountSelected.apply(this, arguments);
|
|
2694
2732
|
}
|
|
2695
2733
|
return setDiscountSelected;
|
|
@@ -2759,7 +2797,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2759
2797
|
}
|
|
2760
2798
|
}, _callee25, this, [[0, 21]]);
|
|
2761
2799
|
}));
|
|
2762
|
-
function applyDiscountCalculationResult(
|
|
2800
|
+
function applyDiscountCalculationResult(_x20) {
|
|
2763
2801
|
return _applyDiscountCalculationResult.apply(this, arguments);
|
|
2764
2802
|
}
|
|
2765
2803
|
return applyDiscountCalculationResult;
|
|
@@ -2778,7 +2816,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2778
2816
|
}
|
|
2779
2817
|
}, _callee26, this);
|
|
2780
2818
|
}));
|
|
2781
|
-
function submitScanOrder(
|
|
2819
|
+
function submitScanOrder(_x21) {
|
|
2782
2820
|
return _submitScanOrder.apply(this, arguments);
|
|
2783
2821
|
}
|
|
2784
2822
|
return submitScanOrder;
|
|
@@ -2793,7 +2831,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2793
2831
|
key: "submitSalesOrder",
|
|
2794
2832
|
value: (function () {
|
|
2795
2833
|
var _submitSalesOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(params) {
|
|
2796
|
-
var _params$smallTicketDa, _this$
|
|
2834
|
+
var _params$smallTicketDa, _this$otherParams11, _this$otherParams12, _this$otherParams13, _this$otherParams14;
|
|
2797
2835
|
var inferredPaymentStatus, smallTicketDataFlag, submitParams;
|
|
2798
2836
|
return _regeneratorRuntime().wrap(function _callee27$(_context27) {
|
|
2799
2837
|
while (1) switch (_context27.prev = _context27.next) {
|
|
@@ -2809,10 +2847,10 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2809
2847
|
smallTicketDataFlag = (_params$smallTicketDa = params === null || params === void 0 ? void 0 : params.smallTicketDataFlag) !== null && _params$smallTicketDa !== void 0 ? _params$smallTicketDa : this.getDefaultCheckoutSmallTicketDataFlag();
|
|
2810
2848
|
submitParams = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
2811
2849
|
cacheId: this.cacheId,
|
|
2812
|
-
platform: (_this$
|
|
2813
|
-
businessCode: ((_this$
|
|
2850
|
+
platform: (_this$otherParams11 = this.otherParams) === null || _this$otherParams11 === void 0 ? void 0 : _this$otherParams11.platform,
|
|
2851
|
+
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),
|
|
2814
2852
|
channel: this.getSubmitOrderSalesChannel(),
|
|
2815
|
-
type: (_this$
|
|
2853
|
+
type: (_this$otherParams14 = this.otherParams) === null || _this$otherParams14 === void 0 ? void 0 : _this$otherParams14.type,
|
|
2816
2854
|
request_unique_idempotency_token: this.store.order.generateIdempotencyToken()
|
|
2817
2855
|
}, (params === null || params === void 0 ? void 0 : params.payments) !== undefined ? {
|
|
2818
2856
|
payments: params.payments
|
|
@@ -2832,7 +2870,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2832
2870
|
}
|
|
2833
2871
|
}, _callee27, this);
|
|
2834
2872
|
}));
|
|
2835
|
-
function submitSalesOrder(
|
|
2873
|
+
function submitSalesOrder(_x22) {
|
|
2836
2874
|
return _submitSalesOrder.apply(this, arguments);
|
|
2837
2875
|
}
|
|
2838
2876
|
return submitSalesOrder;
|
|
@@ -2841,7 +2879,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2841
2879
|
key: "saveSalesOrderDraft",
|
|
2842
2880
|
value: function () {
|
|
2843
2881
|
var _saveSalesOrderDraft = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee28(params) {
|
|
2844
|
-
var _params$platform, _this$
|
|
2882
|
+
var _params$platform, _this$otherParams15, _this$otherParams16, _this$otherParams17, _params$channel, _params$type, _this$otherParams18;
|
|
2845
2883
|
return _regeneratorRuntime().wrap(function _callee28$(_context28) {
|
|
2846
2884
|
while (1) switch (_context28.prev = _context28.next) {
|
|
2847
2885
|
case 0:
|
|
@@ -2853,10 +2891,10 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2853
2891
|
case 2:
|
|
2854
2892
|
return _context28.abrupt("return", this.store.order.saveTempOrderAsDraft(_objectSpread({
|
|
2855
2893
|
cacheId: this.cacheId,
|
|
2856
|
-
platform: (_params$platform = params === null || params === void 0 ? void 0 : params.platform) !== null && _params$platform !== void 0 ? _params$platform : (_this$
|
|
2857
|
-
businessCode: (params === null || params === void 0 ? void 0 : params.businessCode) || ((_this$
|
|
2894
|
+
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,
|
|
2895
|
+
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),
|
|
2858
2896
|
channel: (_params$channel = params === null || params === void 0 ? void 0 : params.channel) !== null && _params$channel !== void 0 ? _params$channel : this.getSubmitOrderSalesChannel(),
|
|
2859
|
-
type: (_params$type = params === null || params === void 0 ? void 0 : params.type) !== null && _params$type !== void 0 ? _params$type : (_this$
|
|
2897
|
+
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
|
|
2860
2898
|
}, (params === null || params === void 0 ? void 0 : params.enhancePayload) !== undefined ? {
|
|
2861
2899
|
enhancePayload: params.enhancePayload
|
|
2862
2900
|
} : {})));
|
|
@@ -2866,7 +2904,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2866
2904
|
}
|
|
2867
2905
|
}, _callee28, this);
|
|
2868
2906
|
}));
|
|
2869
|
-
function saveSalesOrderDraft(
|
|
2907
|
+
function saveSalesOrderDraft(_x23) {
|
|
2870
2908
|
return _saveSalesOrderDraft.apply(this, arguments);
|
|
2871
2909
|
}
|
|
2872
2910
|
return saveSalesOrderDraft;
|
|
@@ -2875,7 +2913,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2875
2913
|
key: "submitTempOrderAsync",
|
|
2876
2914
|
value: function () {
|
|
2877
2915
|
var _submitTempOrderAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee29(params) {
|
|
2878
|
-
var _params$smallTicketDa2, _this$
|
|
2916
|
+
var _params$smallTicketDa2, _this$otherParams19, _this$otherParams20, _this$otherParams21, _this$otherParams22;
|
|
2879
2917
|
var inferredPaymentStatus, smallTicketDataFlag, submitParams;
|
|
2880
2918
|
return _regeneratorRuntime().wrap(function _callee29$(_context29) {
|
|
2881
2919
|
while (1) switch (_context29.prev = _context29.next) {
|
|
@@ -2890,10 +2928,10 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2890
2928
|
smallTicketDataFlag = (_params$smallTicketDa2 = params === null || params === void 0 ? void 0 : params.smallTicketDataFlag) !== null && _params$smallTicketDa2 !== void 0 ? _params$smallTicketDa2 : this.getDefaultCheckoutSmallTicketDataFlag();
|
|
2891
2929
|
submitParams = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
|
|
2892
2930
|
cacheId: this.cacheId,
|
|
2893
|
-
platform: (_this$
|
|
2894
|
-
businessCode: ((_this$
|
|
2931
|
+
platform: (_this$otherParams19 = this.otherParams) === null || _this$otherParams19 === void 0 ? void 0 : _this$otherParams19.platform,
|
|
2932
|
+
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),
|
|
2895
2933
|
channel: this.getSubmitOrderSalesChannel(),
|
|
2896
|
-
type: (_this$
|
|
2934
|
+
type: (_this$otherParams22 = this.otherParams) === null || _this$otherParams22 === void 0 ? void 0 : _this$otherParams22.type,
|
|
2897
2935
|
request_unique_idempotency_token: this.store.order.generateIdempotencyToken()
|
|
2898
2936
|
}, (params === null || params === void 0 ? void 0 : params.payments) !== undefined ? {
|
|
2899
2937
|
payments: params.payments
|
|
@@ -2913,7 +2951,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2913
2951
|
}
|
|
2914
2952
|
}, _callee29, this);
|
|
2915
2953
|
}));
|
|
2916
|
-
function submitTempOrderAsync(
|
|
2954
|
+
function submitTempOrderAsync(_x24) {
|
|
2917
2955
|
return _submitTempOrderAsync.apply(this, arguments);
|
|
2918
2956
|
}
|
|
2919
2957
|
return submitTempOrderAsync;
|
|
@@ -2925,8 +2963,8 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2925
2963
|
}, {
|
|
2926
2964
|
key: "shouldUseCheckoutSyncTask",
|
|
2927
2965
|
value: function shouldUseCheckoutSyncTask() {
|
|
2928
|
-
var _this$
|
|
2929
|
-
var configured = (_this$
|
|
2966
|
+
var _this$otherParams23;
|
|
2967
|
+
var configured = (_this$otherParams23 = this.otherParams) === null || _this$otherParams23 === void 0 ? void 0 : _this$otherParams23.checkoutSyncTaskEnabled;
|
|
2930
2968
|
return typeof configured === 'boolean' ? configured : true;
|
|
2931
2969
|
}
|
|
2932
2970
|
|
|
@@ -2940,7 +2978,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2940
2978
|
key: "printLocalOrderReceipt",
|
|
2941
2979
|
value: function () {
|
|
2942
2980
|
var _printLocalOrderReceipt = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30(lookup) {
|
|
2943
|
-
var _this$
|
|
2981
|
+
var _this$otherParams24, _this$otherParams25, _this$otherParams26, _this$otherParams27;
|
|
2944
2982
|
var hasLookup, lookupPayload, context, payload, response, _this$store$order$app, _this$store$order5, _data;
|
|
2945
2983
|
return _regeneratorRuntime().wrap(function _callee30$(_context30) {
|
|
2946
2984
|
while (1) switch (_context30.prev = _context30.next) {
|
|
@@ -2958,10 +2996,10 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2958
2996
|
external_sale_number: lookup
|
|
2959
2997
|
};
|
|
2960
2998
|
context = {
|
|
2961
|
-
platform: (_this$
|
|
2962
|
-
businessCode: ((_this$
|
|
2999
|
+
platform: (_this$otherParams24 = this.otherParams) === null || _this$otherParams24 === void 0 ? void 0 : _this$otherParams24.platform,
|
|
3000
|
+
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),
|
|
2963
3001
|
channel: this.getSubmitOrderSalesChannel(),
|
|
2964
|
-
type: (_this$
|
|
3002
|
+
type: (_this$otherParams27 = this.otherParams) === null || _this$otherParams27 === void 0 ? void 0 : _this$otherParams27.type
|
|
2965
3003
|
};
|
|
2966
3004
|
payload = hasLookup ? _objectSpread(_objectSpread({}, lookupPayload), {}, {
|
|
2967
3005
|
lookup_order_from_db: 1,
|
|
@@ -2998,7 +3036,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
2998
3036
|
}
|
|
2999
3037
|
}, _callee30, this);
|
|
3000
3038
|
}));
|
|
3001
|
-
function printLocalOrderReceipt(
|
|
3039
|
+
function printLocalOrderReceipt(_x25) {
|
|
3002
3040
|
return _printLocalOrderReceipt.apply(this, arguments);
|
|
3003
3041
|
}
|
|
3004
3042
|
return printLocalOrderReceipt;
|
|
@@ -3020,7 +3058,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3020
3058
|
key: "syncPaymentsToOrder",
|
|
3021
3059
|
value: function () {
|
|
3022
3060
|
var _syncPaymentsToOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31(params) {
|
|
3023
|
-
var
|
|
3061
|
+
var _ref32, _params$businessCode, _this$otherParams28, _this$otherParams29, _params$channel2;
|
|
3024
3062
|
var businessCode, channel, syncParams, syncState, payments, syncResult, latestPayments, amountSnapshot, orderSnapshot, syncPayload;
|
|
3025
3063
|
return _regeneratorRuntime().wrap(function _callee31$(_context31) {
|
|
3026
3064
|
while (1) switch (_context31.prev = _context31.next) {
|
|
@@ -3031,7 +3069,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3031
3069
|
}
|
|
3032
3070
|
throw new Error('order 模块未初始化');
|
|
3033
3071
|
case 2:
|
|
3034
|
-
businessCode = (
|
|
3072
|
+
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;
|
|
3035
3073
|
channel = (_params$channel2 = params.channel) !== null && _params$channel2 !== void 0 ? _params$channel2 : this.getSubmitOrderSalesChannel();
|
|
3036
3074
|
syncParams = _objectSpread(_objectSpread(_objectSpread({}, params), {}, {
|
|
3037
3075
|
checkoutSyncTaskEnabled: this.shouldUseCheckoutSyncTask()
|
|
@@ -3112,7 +3150,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3112
3150
|
}
|
|
3113
3151
|
}, _callee31, this, [[12, 29]]);
|
|
3114
3152
|
}));
|
|
3115
|
-
function syncPaymentsToOrder(
|
|
3153
|
+
function syncPaymentsToOrder(_x26) {
|
|
3116
3154
|
return _syncPaymentsToOrder.apply(this, arguments);
|
|
3117
3155
|
}
|
|
3118
3156
|
return syncPaymentsToOrder;
|
|
@@ -3282,7 +3320,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3282
3320
|
}
|
|
3283
3321
|
}, _callee33, this);
|
|
3284
3322
|
}));
|
|
3285
|
-
function addOrderPaymentAsync(
|
|
3323
|
+
function addOrderPaymentAsync(_x27) {
|
|
3286
3324
|
return _addOrderPaymentAsync.apply(this, arguments);
|
|
3287
3325
|
}
|
|
3288
3326
|
return addOrderPaymentAsync;
|
|
@@ -3290,10 +3328,10 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3290
3328
|
}, {
|
|
3291
3329
|
key: "addOrderPaymentWithDevicePrefix",
|
|
3292
3330
|
value: function addOrderPaymentWithDevicePrefix(payment, devicePrefix) {
|
|
3293
|
-
var _this$
|
|
3331
|
+
var _this$otherParams30,
|
|
3294
3332
|
_paymentRecord$paymen,
|
|
3295
3333
|
_paymentRecord$create,
|
|
3296
|
-
|
|
3334
|
+
_ref33,
|
|
3297
3335
|
_paymentRecord$origin,
|
|
3298
3336
|
_this14 = this;
|
|
3299
3337
|
if (!this.store.order) throw new Error('order 模块未初始化');
|
|
@@ -3306,7 +3344,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3306
3344
|
return this.store.order.getOrderPayments();
|
|
3307
3345
|
}
|
|
3308
3346
|
var metadata = paymentRecord.metadata && _typeof(paymentRecord.metadata) === 'object' ? _objectSpread({}, paymentRecord.metadata) : {};
|
|
3309
|
-
var shopWalletPassId = (_this$
|
|
3347
|
+
var shopWalletPassId = (_this$otherParams30 = this.otherParams) === null || _this$otherParams30 === void 0 ? void 0 : _this$otherParams30.shop_wallet_pass_id;
|
|
3310
3348
|
if (shopWalletPassId !== undefined && shopWalletPassId !== null) {
|
|
3311
3349
|
metadata.shop_wallet_pass_id = shopWalletPassId;
|
|
3312
3350
|
}
|
|
@@ -3315,7 +3353,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3315
3353
|
var paymentTime = (_paymentRecord$paymen = paymentRecord.payment_time) !== null && _paymentRecord$paymen !== void 0 ? _paymentRecord$paymen : paymentTimestamp;
|
|
3316
3354
|
var createdAt = (_paymentRecord$create = paymentRecord.created_at) !== null && _paymentRecord$create !== void 0 ? _paymentRecord$create : paymentTimestamp;
|
|
3317
3355
|
var serviceCharge = paymentRecord.service_charge && _typeof(paymentRecord.service_charge) === 'object' ? paymentRecord.service_charge : null;
|
|
3318
|
-
var calculatedServiceFee = serviceCharge ? new Decimal((
|
|
3356
|
+
var calculatedServiceFee = serviceCharge ? new Decimal((_ref33 = (_paymentRecord$origin = paymentRecord.origin_amount) !== null && _paymentRecord$origin !== void 0 ? _paymentRecord$origin : paymentRecord.amount) !== null && _ref33 !== void 0 ? _ref33 : 0).times(serviceCharge.percentage || 0).plus(serviceCharge.amount || 0).toDecimalPlaces(2).toFixed(2) : undefined;
|
|
3319
3357
|
var payments = this.store.order.addOrderPayment(_objectSpread(_objectSpread(_objectSpread({}, normalizedPaymentRecord), calculatedServiceFee !== undefined ? {
|
|
3320
3358
|
service_fee: calculatedServiceFee
|
|
3321
3359
|
} : {}), {}, {
|
|
@@ -3470,7 +3508,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3470
3508
|
}
|
|
3471
3509
|
}, _callee34, this, [[17, 23]]);
|
|
3472
3510
|
}));
|
|
3473
|
-
function updateOrderPayment(
|
|
3511
|
+
function updateOrderPayment(_x28, _x29) {
|
|
3474
3512
|
return _updateOrderPayment.apply(this, arguments);
|
|
3475
3513
|
}
|
|
3476
3514
|
return updateOrderPayment;
|
|
@@ -3509,7 +3547,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3509
3547
|
}
|
|
3510
3548
|
}, _callee35, this);
|
|
3511
3549
|
}));
|
|
3512
|
-
function updateVoucherOrderPaymentsAsync(
|
|
3550
|
+
function updateVoucherOrderPaymentsAsync(_x30, _x31) {
|
|
3513
3551
|
return _updateVoucherOrderPaymentsAsync.apply(this, arguments);
|
|
3514
3552
|
}
|
|
3515
3553
|
return updateVoucherOrderPaymentsAsync;
|
|
@@ -3596,7 +3634,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3596
3634
|
}, {
|
|
3597
3635
|
key: "buildWalletInitBusinessData",
|
|
3598
3636
|
value: function buildWalletInitBusinessData(params) {
|
|
3599
|
-
var _this$store$order8, _params$order_wait_pa,
|
|
3637
|
+
var _this$store$order8, _params$order_wait_pa, _ref34, _tempOrder$is_price_i;
|
|
3600
3638
|
var snapshot = (_this$store$order8 = this.store.order) === null || _this$store$order8 === void 0 ? void 0 : _this$store$order8.getOrderSnapshot();
|
|
3601
3639
|
var tempOrder = snapshot === null || snapshot === void 0 ? void 0 : snapshot.tempOrder;
|
|
3602
3640
|
var amount = snapshot === null || snapshot === void 0 ? void 0 : snapshot.amount;
|
|
@@ -3612,7 +3650,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3612
3650
|
},
|
|
3613
3651
|
products: this.getWalletProductList(),
|
|
3614
3652
|
order_wait_pay_amount: (_params$order_wait_pa = params === null || params === void 0 ? void 0 : params.order_wait_pay_amount) !== null && _params$order_wait_pa !== void 0 ? _params$order_wait_pa : Number(amount.amountGap || 0),
|
|
3615
|
-
is_price_include_tax: (
|
|
3653
|
+
is_price_include_tax: (_ref34 = (_tempOrder$is_price_i = tempOrder.is_price_include_tax) !== null && _tempOrder$is_price_i !== void 0 ? _tempOrder$is_price_i : this.otherParams.is_price_include_tax) !== null && _ref34 !== void 0 ? _ref34 : 1
|
|
3616
3654
|
}, snapshot.identity.orderId ? {
|
|
3617
3655
|
payment_order_id: String(snapshot.identity.orderId)
|
|
3618
3656
|
} : {});
|
|
@@ -3675,7 +3713,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3675
3713
|
}
|
|
3676
3714
|
}, _callee36, this);
|
|
3677
3715
|
}));
|
|
3678
|
-
function initWalletData(
|
|
3716
|
+
function initWalletData(_x32) {
|
|
3679
3717
|
return _initWalletData.apply(this, arguments);
|
|
3680
3718
|
}
|
|
3681
3719
|
return initWalletData;
|
|
@@ -3702,9 +3740,9 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3702
3740
|
var walletPassName = fundRecord.wallet_pass_name;
|
|
3703
3741
|
var title = walletPassName && _typeof(walletPassName) === 'object' ? walletPassName.default || Object.values(walletPassName)[0] : walletPassName;
|
|
3704
3742
|
var code = String((payment === null || payment === void 0 ? void 0 : payment.code) || '').toUpperCase();
|
|
3705
|
-
var tag = ((_Object$entries$find = Object.entries(WALLET_PAYMENT_CODE_BY_TAG).find(function (
|
|
3706
|
-
var
|
|
3707
|
-
paymentCode =
|
|
3743
|
+
var tag = ((_Object$entries$find = Object.entries(WALLET_PAYMENT_CODE_BY_TAG).find(function (_ref35) {
|
|
3744
|
+
var _ref36 = _slicedToArray(_ref35, 2),
|
|
3745
|
+
paymentCode = _ref36[1];
|
|
3708
3746
|
return paymentCode === code;
|
|
3709
3747
|
})) === null || _Object$entries$find === void 0 ? void 0 : _Object$entries$find[0]) || fundRecord.tag;
|
|
3710
3748
|
return {
|
|
@@ -3742,7 +3780,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3742
3780
|
}
|
|
3743
3781
|
}, _callee37, this);
|
|
3744
3782
|
}));
|
|
3745
|
-
function publishWalletAssetsState(
|
|
3783
|
+
function publishWalletAssetsState(_x33) {
|
|
3746
3784
|
return _publishWalletAssetsState.apply(this, arguments);
|
|
3747
3785
|
}
|
|
3748
3786
|
return publishWalletAssetsState;
|
|
@@ -3823,7 +3861,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3823
3861
|
}
|
|
3824
3862
|
}, _callee38, this);
|
|
3825
3863
|
}));
|
|
3826
|
-
function syncSelectedWalletAssets(
|
|
3864
|
+
function syncSelectedWalletAssets(_x34) {
|
|
3827
3865
|
return _syncSelectedWalletAssets.apply(this, arguments);
|
|
3828
3866
|
}
|
|
3829
3867
|
return syncSelectedWalletAssets;
|
|
@@ -3879,7 +3917,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3879
3917
|
}
|
|
3880
3918
|
}, _callee39, this);
|
|
3881
3919
|
}));
|
|
3882
|
-
function importWalletAssetsSnapshot(
|
|
3920
|
+
function importWalletAssetsSnapshot(_x35) {
|
|
3883
3921
|
return _importWalletAssetsSnapshot.apply(this, arguments);
|
|
3884
3922
|
}
|
|
3885
3923
|
return importWalletAssetsSnapshot;
|
|
@@ -3967,7 +4005,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
3967
4005
|
}
|
|
3968
4006
|
}, _callee40, this);
|
|
3969
4007
|
}));
|
|
3970
|
-
function refreshWalletAssets(
|
|
4008
|
+
function refreshWalletAssets(_x36) {
|
|
3971
4009
|
return _refreshWalletAssets.apply(this, arguments);
|
|
3972
4010
|
}
|
|
3973
4011
|
return refreshWalletAssets;
|
|
@@ -4000,7 +4038,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4000
4038
|
}
|
|
4001
4039
|
}, _callee41, this);
|
|
4002
4040
|
}));
|
|
4003
|
-
function selectWalletAsset(
|
|
4041
|
+
function selectWalletAsset(_x37) {
|
|
4004
4042
|
return _selectWalletAsset.apply(this, arguments);
|
|
4005
4043
|
}
|
|
4006
4044
|
return selectWalletAsset;
|
|
@@ -4040,7 +4078,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4040
4078
|
}
|
|
4041
4079
|
}, _callee42, this);
|
|
4042
4080
|
}));
|
|
4043
|
-
function scanWalletAsset(
|
|
4081
|
+
function scanWalletAsset(_x38) {
|
|
4044
4082
|
return _scanWalletAsset.apply(this, arguments);
|
|
4045
4083
|
}
|
|
4046
4084
|
return scanWalletAsset;
|
|
@@ -4170,7 +4208,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4170
4208
|
key: "getCashPaymentConfig",
|
|
4171
4209
|
value: (function () {
|
|
4172
4210
|
var _getCashPaymentConfig = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee45() {
|
|
4173
|
-
var _this$store$order11, _this$store$order11$g, _this$store$order12, _this$store$order12$g, _this$
|
|
4211
|
+
var _this$store$order11, _this$store$order11$g, _this$store$order12, _this$store$order12$g, _this$otherParams31;
|
|
4174
4212
|
var paymentMethods, paymentMethod, amountSnapshot, pendingWalletAmount, amountDue, currency, recommendedAmounts;
|
|
4175
4213
|
return _regeneratorRuntime().wrap(function _callee45$(_context45) {
|
|
4176
4214
|
while (1) switch (_context45.prev = _context45.next) {
|
|
@@ -4196,7 +4234,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4196
4234
|
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);
|
|
4197
4235
|
pendingWalletAmount = this.getPendingWalletPaymentAmount();
|
|
4198
4236
|
amountDue = Decimal.max(new Decimal((amountSnapshot === null || amountSnapshot === void 0 ? void 0 : amountSnapshot.amountGap) || 0).minus(pendingWalletAmount), 0).toDecimalPlaces(2).toNumber();
|
|
4199
|
-
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$
|
|
4237
|
+
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';
|
|
4200
4238
|
recommendedAmounts = amountDue > 0 ? this.store.payment.cash.getRecommendedAmount(amountDue, currency) : [];
|
|
4201
4239
|
return _context45.abrupt("return", {
|
|
4202
4240
|
available: Boolean(paymentMethod && amountDue > 0),
|
|
@@ -4331,7 +4369,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4331
4369
|
key: "payCash",
|
|
4332
4370
|
value: (function () {
|
|
4333
4371
|
var _payCash = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee47(params) {
|
|
4334
|
-
var _this$store$order$get6, _params$actualPaidAmo, _this$
|
|
4372
|
+
var _this$store$order$get6, _params$actualPaidAmo, _this$otherParams32, _this$window, _this$window$postMess;
|
|
4335
4373
|
var amount, config, paymentMethod, roundingAmount, effectivePaymentAmount, beforePayments, beforePaymentStatus, uniquePaymentNumber, paymentTimestamp, actualPaidAmount, changeAmount, shopWalletPassId, payments, payment, syncResult, committed, walletState, restoredTempOrder;
|
|
4336
4374
|
return _regeneratorRuntime().wrap(function _callee47$(_context47) {
|
|
4337
4375
|
while (1) switch (_context47.prev = _context47.next) {
|
|
@@ -4380,7 +4418,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4380
4418
|
paymentTimestamp = dayjs().format('YYYY-MM-DD HH:mm:ss');
|
|
4381
4419
|
actualPaidAmount = Number((_params$actualPaidAmo = params.actualPaidAmount) !== null && _params$actualPaidAmo !== void 0 ? _params$actualPaidAmo : amount);
|
|
4382
4420
|
changeAmount = Number(params.changeAmount || 0);
|
|
4383
|
-
shopWalletPassId = (_this$
|
|
4421
|
+
shopWalletPassId = (_this$otherParams32 = this.otherParams) === null || _this$otherParams32 === void 0 ? void 0 : _this$otherParams32.shop_wallet_pass_id;
|
|
4384
4422
|
if (!(!Number.isFinite(actualPaidAmount) || actualPaidAmount + 0.01 < amount)) {
|
|
4385
4423
|
_context47.next = 26;
|
|
4386
4424
|
break;
|
|
@@ -4463,7 +4501,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4463
4501
|
}
|
|
4464
4502
|
}, _callee47, this, [[29, 41]]);
|
|
4465
4503
|
}));
|
|
4466
|
-
function payCash(
|
|
4504
|
+
function payCash(_x39) {
|
|
4467
4505
|
return _payCash.apply(this, arguments);
|
|
4468
4506
|
}
|
|
4469
4507
|
return payCash;
|
|
@@ -4619,7 +4657,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4619
4657
|
}
|
|
4620
4658
|
}, _callee48, this, [[30, 42]]);
|
|
4621
4659
|
}));
|
|
4622
|
-
function commitPaymentMethodPayment(
|
|
4660
|
+
function commitPaymentMethodPayment(_x40) {
|
|
4623
4661
|
return _commitPaymentMethodPayment.apply(this, arguments);
|
|
4624
4662
|
}
|
|
4625
4663
|
return commitPaymentMethodPayment;
|
|
@@ -4667,7 +4705,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4667
4705
|
}
|
|
4668
4706
|
}, _callee49, this);
|
|
4669
4707
|
}));
|
|
4670
|
-
function roundAmount(
|
|
4708
|
+
function roundAmount(_x41) {
|
|
4671
4709
|
return _roundAmount.apply(this, arguments);
|
|
4672
4710
|
}
|
|
4673
4711
|
return roundAmount;
|
|
@@ -4683,7 +4721,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4683
4721
|
key: "sendCustomerPayLink",
|
|
4684
4722
|
value: (function () {
|
|
4685
4723
|
var _sendCustomerPayLink = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee50(params) {
|
|
4686
|
-
var orderIds,
|
|
4724
|
+
var orderIds, _ref37, _ref38, _submitResult$data$or, _submitResult$data, _submitResult$data2, submitResult, orderId;
|
|
4687
4725
|
return _regeneratorRuntime().wrap(function _callee50$(_context50) {
|
|
4688
4726
|
while (1) switch (_context50.prev = _context50.next) {
|
|
4689
4727
|
case 0:
|
|
@@ -4704,7 +4742,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4704
4742
|
});
|
|
4705
4743
|
case 6:
|
|
4706
4744
|
submitResult = _context50.sent;
|
|
4707
|
-
orderId = (
|
|
4745
|
+
orderId = (_ref37 = (_ref38 = (_submitResult$data$or = submitResult === null || submitResult === void 0 || (_submitResult$data = submitResult.data) === null || _submitResult$data === void 0 ? void 0 : _submitResult$data.order_id) !== null && _submitResult$data$or !== void 0 ? _submitResult$data$or : submitResult === null || submitResult === void 0 ? void 0 : submitResult.order_id) !== null && _ref38 !== void 0 ? _ref38 : submitResult === null || submitResult === void 0 || (_submitResult$data2 = submitResult.data) === null || _submitResult$data2 === void 0 ? void 0 : _submitResult$data2.id) !== null && _ref37 !== void 0 ? _ref37 : submitResult === null || submitResult === void 0 ? void 0 : submitResult.id;
|
|
4708
4746
|
if (orderId) {
|
|
4709
4747
|
_context50.next = 10;
|
|
4710
4748
|
break;
|
|
@@ -4724,7 +4762,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4724
4762
|
}
|
|
4725
4763
|
}, _callee50, this);
|
|
4726
4764
|
}));
|
|
4727
|
-
function sendCustomerPayLink(
|
|
4765
|
+
function sendCustomerPayLink(_x42) {
|
|
4728
4766
|
return _sendCustomerPayLink.apply(this, arguments);
|
|
4729
4767
|
}
|
|
4730
4768
|
return sendCustomerPayLink;
|
|
@@ -4769,7 +4807,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4769
4807
|
}
|
|
4770
4808
|
}, _callee51, this);
|
|
4771
4809
|
}));
|
|
4772
|
-
function calculateProductBookingPrice(
|
|
4810
|
+
function calculateProductBookingPrice(_x43) {
|
|
4773
4811
|
return _calculateProductBookingPrice.apply(this, arguments);
|
|
4774
4812
|
}
|
|
4775
4813
|
return calculateProductBookingPrice;
|
|
@@ -4876,12 +4914,12 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4876
4914
|
});
|
|
4877
4915
|
_context53.next = 9;
|
|
4878
4916
|
return Promise.all(Array.from(groups.entries()).map( /*#__PURE__*/function () {
|
|
4879
|
-
var
|
|
4880
|
-
var
|
|
4917
|
+
var _ref40 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee52(_ref39) {
|
|
4918
|
+
var _ref41, groupKey, group, productsById;
|
|
4881
4919
|
return _regeneratorRuntime().wrap(function _callee52$(_context52) {
|
|
4882
4920
|
while (1) switch (_context52.prev = _context52.next) {
|
|
4883
4921
|
case 0:
|
|
4884
|
-
|
|
4922
|
+
_ref41 = _slicedToArray(_ref39, 2), groupKey = _ref41[0], group = _ref41[1];
|
|
4885
4923
|
_context52.next = 3;
|
|
4886
4924
|
return _this16.loadProductsForPriceQuery({
|
|
4887
4925
|
ids: Array.from(group.ids),
|
|
@@ -4898,8 +4936,8 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4898
4936
|
}
|
|
4899
4937
|
}, _callee52);
|
|
4900
4938
|
}));
|
|
4901
|
-
return function (
|
|
4902
|
-
return
|
|
4939
|
+
return function (_x45) {
|
|
4940
|
+
return _ref40.apply(this, arguments);
|
|
4903
4941
|
};
|
|
4904
4942
|
}()));
|
|
4905
4943
|
case 9:
|
|
@@ -4932,7 +4970,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4932
4970
|
}
|
|
4933
4971
|
}, _callee53, this);
|
|
4934
4972
|
}));
|
|
4935
|
-
function calculateProductBookingPrices(
|
|
4973
|
+
function calculateProductBookingPrices(_x44) {
|
|
4936
4974
|
return _calculateProductBookingPrices.apply(this, arguments);
|
|
4937
4975
|
}
|
|
4938
4976
|
return calculateProductBookingPrices;
|
|
@@ -4940,7 +4978,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4940
4978
|
}, {
|
|
4941
4979
|
key: "addProductToOrder",
|
|
4942
4980
|
value: function () {
|
|
4943
|
-
var _addProductToOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee54(product, booking) {
|
|
4981
|
+
var _addProductToOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee54(product, booking, options) {
|
|
4944
4982
|
var products;
|
|
4945
4983
|
return _regeneratorRuntime().wrap(function _callee54$(_context54) {
|
|
4946
4984
|
while (1) switch (_context54.prev = _context54.next) {
|
|
@@ -4953,7 +4991,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4953
4991
|
throw new Error('order 模块未初始化');
|
|
4954
4992
|
case 3:
|
|
4955
4993
|
_context54.next = 5;
|
|
4956
|
-
return this.store.order.addProductToOrder(product, booking);
|
|
4994
|
+
return this.store.order.addProductToOrder(product, booking, options);
|
|
4957
4995
|
case 5:
|
|
4958
4996
|
products = _context54.sent;
|
|
4959
4997
|
return _context54.abrupt("return", products);
|
|
@@ -4967,7 +5005,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
4967
5005
|
}
|
|
4968
5006
|
}, _callee54, this, [[0, 9]]);
|
|
4969
5007
|
}));
|
|
4970
|
-
function addProductToOrder(
|
|
5008
|
+
function addProductToOrder(_x46, _x47, _x48) {
|
|
4971
5009
|
return _addProductToOrder.apply(this, arguments);
|
|
4972
5010
|
}
|
|
4973
5011
|
return addProductToOrder;
|
|
@@ -5002,7 +5040,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5002
5040
|
}
|
|
5003
5041
|
}, _callee55, this, [[0, 9]]);
|
|
5004
5042
|
}));
|
|
5005
|
-
function updateOrderProduct(
|
|
5043
|
+
function updateOrderProduct(_x49) {
|
|
5006
5044
|
return _updateOrderProduct.apply(this, arguments);
|
|
5007
5045
|
}
|
|
5008
5046
|
return updateOrderProduct;
|
|
@@ -5037,7 +5075,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5037
5075
|
}
|
|
5038
5076
|
}, _callee56, this, [[0, 9]]);
|
|
5039
5077
|
}));
|
|
5040
|
-
function updateOrderProducts(
|
|
5078
|
+
function updateOrderProducts(_x50) {
|
|
5041
5079
|
return _updateOrderProducts.apply(this, arguments);
|
|
5042
5080
|
}
|
|
5043
5081
|
return updateOrderProducts;
|
|
@@ -5072,7 +5110,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5072
5110
|
}
|
|
5073
5111
|
}, _callee57, this, [[0, 9]]);
|
|
5074
5112
|
}));
|
|
5075
|
-
function updateOrderProductQuantity(
|
|
5113
|
+
function updateOrderProductQuantity(_x51) {
|
|
5076
5114
|
return _updateOrderProductQuantity.apply(this, arguments);
|
|
5077
5115
|
}
|
|
5078
5116
|
return updateOrderProductQuantity;
|
|
@@ -5130,7 +5168,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5130
5168
|
}
|
|
5131
5169
|
}, _callee58, this, [[0, 11]]);
|
|
5132
5170
|
}));
|
|
5133
|
-
function setOrderProductLineNote(
|
|
5171
|
+
function setOrderProductLineNote(_x52, _x53) {
|
|
5134
5172
|
return _setOrderProductLineNote.apply(this, arguments);
|
|
5135
5173
|
}
|
|
5136
5174
|
return setOrderProductLineNote;
|
|
@@ -5145,7 +5183,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5145
5183
|
}, {
|
|
5146
5184
|
key: "removeProductsFromOrder",
|
|
5147
5185
|
value: (function () {
|
|
5148
|
-
var _removeProductsFromOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee59(identities) {
|
|
5186
|
+
var _removeProductsFromOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee59(identities, options) {
|
|
5149
5187
|
return _regeneratorRuntime().wrap(function _callee59$(_context59) {
|
|
5150
5188
|
while (1) switch (_context59.prev = _context59.next) {
|
|
5151
5189
|
case 0:
|
|
@@ -5157,7 +5195,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5157
5195
|
throw new Error('order 模块未初始化');
|
|
5158
5196
|
case 3:
|
|
5159
5197
|
_context59.next = 5;
|
|
5160
|
-
return this.store.order.removeProductsFromOrder(identities);
|
|
5198
|
+
return this.store.order.removeProductsFromOrder(identities, options);
|
|
5161
5199
|
case 5:
|
|
5162
5200
|
return _context59.abrupt("return", _context59.sent);
|
|
5163
5201
|
case 8:
|
|
@@ -5170,7 +5208,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5170
5208
|
}
|
|
5171
5209
|
}, _callee59, this, [[0, 8]]);
|
|
5172
5210
|
}));
|
|
5173
|
-
function removeProductsFromOrder(
|
|
5211
|
+
function removeProductsFromOrder(_x54, _x55) {
|
|
5174
5212
|
return _removeProductsFromOrder.apply(this, arguments);
|
|
5175
5213
|
}
|
|
5176
5214
|
return removeProductsFromOrder;
|
|
@@ -5178,18 +5216,18 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5178
5216
|
}, {
|
|
5179
5217
|
key: "removeProductFromOrder",
|
|
5180
5218
|
value: function () {
|
|
5181
|
-
var _removeProductFromOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee60(identity) {
|
|
5219
|
+
var _removeProductFromOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee60(identity, options) {
|
|
5182
5220
|
return _regeneratorRuntime().wrap(function _callee60$(_context60) {
|
|
5183
5221
|
while (1) switch (_context60.prev = _context60.next) {
|
|
5184
5222
|
case 0:
|
|
5185
|
-
return _context60.abrupt("return", this.removeProductsFromOrder([identity]));
|
|
5223
|
+
return _context60.abrupt("return", this.removeProductsFromOrder([identity], options));
|
|
5186
5224
|
case 1:
|
|
5187
5225
|
case "end":
|
|
5188
5226
|
return _context60.stop();
|
|
5189
5227
|
}
|
|
5190
5228
|
}, _callee60, this);
|
|
5191
5229
|
}));
|
|
5192
|
-
function removeProductFromOrder(
|
|
5230
|
+
function removeProductFromOrder(_x56, _x57) {
|
|
5193
5231
|
return _removeProductFromOrder.apply(this, arguments);
|
|
5194
5232
|
}
|
|
5195
5233
|
return removeProductFromOrder;
|
|
@@ -5283,13 +5321,13 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5283
5321
|
key: "getProductList",
|
|
5284
5322
|
value: function () {
|
|
5285
5323
|
var _getProductList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee62() {
|
|
5286
|
-
var _this$
|
|
5324
|
+
var _this$otherParams33;
|
|
5287
5325
|
var menu_list_ids, _this$store$products, res;
|
|
5288
5326
|
return _regeneratorRuntime().wrap(function _callee62$(_context62) {
|
|
5289
5327
|
while (1) switch (_context62.prev = _context62.next) {
|
|
5290
5328
|
case 0:
|
|
5291
5329
|
// 可以直接通过配置里的 menu 读取
|
|
5292
|
-
menu_list_ids = ((_this$
|
|
5330
|
+
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) {
|
|
5293
5331
|
return Number(n.value);
|
|
5294
5332
|
})) || [];
|
|
5295
5333
|
_context62.prev = 1;
|
|
@@ -5327,21 +5365,21 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5327
5365
|
key: "setOtherParams",
|
|
5328
5366
|
value: function () {
|
|
5329
5367
|
var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee63(params) {
|
|
5330
|
-
var _this$
|
|
5331
|
-
var
|
|
5332
|
-
|
|
5368
|
+
var _this$otherParams34;
|
|
5369
|
+
var _ref42,
|
|
5370
|
+
_ref42$cover,
|
|
5333
5371
|
cover,
|
|
5334
5372
|
_args63 = arguments;
|
|
5335
5373
|
return _regeneratorRuntime().wrap(function _callee63$(_context63) {
|
|
5336
5374
|
while (1) switch (_context63.prev = _context63.next) {
|
|
5337
5375
|
case 0:
|
|
5338
|
-
|
|
5376
|
+
_ref42 = _args63.length > 1 && _args63[1] !== undefined ? _args63[1] : {}, _ref42$cover = _ref42.cover, cover = _ref42$cover === void 0 ? false : _ref42$cover;
|
|
5339
5377
|
if (cover) {
|
|
5340
5378
|
this.otherParams = _objectSpread({}, params);
|
|
5341
5379
|
} else {
|
|
5342
5380
|
this.otherParams = _objectSpread(_objectSpread({}, this.otherParams), params);
|
|
5343
5381
|
}
|
|
5344
|
-
this.cacheId = (_this$
|
|
5382
|
+
this.cacheId = (_this$otherParams34 = this.otherParams) === null || _this$otherParams34 === void 0 ? void 0 : _this$otherParams34.cacheId;
|
|
5345
5383
|
_context63.next = 5;
|
|
5346
5384
|
return this.syncOtherParamsToSubModules(params, {
|
|
5347
5385
|
cover: cover
|
|
@@ -5352,7 +5390,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
|
|
|
5352
5390
|
}
|
|
5353
5391
|
}, _callee63, this);
|
|
5354
5392
|
}));
|
|
5355
|
-
function setOtherParams(
|
|
5393
|
+
function setOtherParams(_x58) {
|
|
5356
5394
|
return _setOtherParams.apply(this, arguments);
|
|
5357
5395
|
}
|
|
5358
5396
|
return setOtherParams;
|