@pisell/pisellos 2.3.51 → 2.3.53

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.
Files changed (161) hide show
  1. package/dist/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +12 -10
  2. package/dist/modules/Discount/index.d.ts +0 -1
  3. package/dist/modules/Discount/index.js +11 -40
  4. package/dist/modules/Discount/types.d.ts +0 -1
  5. package/dist/modules/OpenData/index.js +2 -2
  6. package/dist/modules/Order/index.d.ts +7 -9
  7. package/dist/modules/Order/index.js +165 -140
  8. package/dist/modules/Order/types.d.ts +21 -12
  9. package/dist/modules/Order/types.js +11 -0
  10. package/dist/modules/Order/utils.d.ts +0 -10
  11. package/dist/modules/Order/utils.js +3 -35
  12. package/dist/modules/Product/types.d.ts +0 -1
  13. package/dist/modules/ProductList/index.js +14 -33
  14. package/dist/modules/Quotation/index.d.ts +1 -1
  15. package/dist/modules/Quotation/index.js +2 -2
  16. package/dist/modules/Rules/index.js +32 -56
  17. package/dist/modules/SalesSummary/index.js +13 -12
  18. package/dist/modules/SalesSummary/utils.js +7 -1
  19. package/dist/modules/ScanOrderLogger/index.d.ts +0 -2
  20. package/dist/modules/ScanOrderLogger/index.js +2 -15
  21. package/dist/modules/ScanOrderLogger/providers/feishu.js +27 -45
  22. package/dist/modules/ScanOrderLogger/types.d.ts +0 -1
  23. package/dist/modules/Schedule/index.d.ts +1 -3
  24. package/dist/modules/Schedule/index.js +16 -21
  25. package/dist/modules/Summary/utils.js +13 -38
  26. package/dist/modules/index.d.ts +0 -2
  27. package/dist/modules/index.js +1 -3
  28. package/dist/plugins/window.d.ts +0 -1
  29. package/dist/server/index.d.ts +0 -14
  30. package/dist/server/index.js +793 -907
  31. package/dist/solution/BaseSales/index.d.ts +15 -12
  32. package/dist/solution/BaseSales/index.js +194 -178
  33. package/dist/solution/BaseSales/utils/cartPromotion.js +5 -3
  34. package/dist/solution/BookingByStep/index.d.ts +1 -16
  35. package/dist/solution/BookingByStep/index.js +215 -294
  36. package/dist/solution/BookingByStep/types.d.ts +1 -2
  37. package/dist/solution/BookingByStep/types.js +1 -3
  38. package/dist/solution/BookingByStep/utils/capacity.js +1 -17
  39. package/dist/solution/BookingByStep/utils/timeslots.d.ts +1 -3
  40. package/dist/solution/BookingByStep/utils/timeslots.js +12 -19
  41. package/dist/solution/BookingTicket/index.d.ts +2 -14
  42. package/dist/solution/BookingTicket/index.js +2 -2
  43. package/dist/solution/BookingTicket/types.d.ts +3 -0
  44. package/dist/solution/BookingTicket/utils/cartView.js +44 -32
  45. package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +1 -3
  46. package/dist/solution/BookingTicket/utils/scan/handleScan.js +2 -10
  47. package/dist/solution/Sales/index.d.ts +1 -0
  48. package/dist/solution/Sales/index.js +16 -2
  49. package/dist/solution/ScanOrder/index.d.ts +14 -26
  50. package/dist/solution/ScanOrder/index.js +739 -1142
  51. package/dist/solution/ScanOrder/types.d.ts +1 -21
  52. package/dist/solution/ScanOrder/utils.d.ts +0 -8
  53. package/dist/solution/ScanOrder/utils.js +25 -66
  54. package/dist/solution/ShopDiscount/index.d.ts +0 -1
  55. package/dist/solution/ShopDiscount/index.js +87 -125
  56. package/dist/solution/VenueBooking/index.d.ts +11 -39
  57. package/dist/solution/VenueBooking/index.js +841 -1167
  58. package/dist/solution/VenueBooking/types.d.ts +0 -3
  59. package/dist/solution/VenueBooking/utils/resource.js +0 -1
  60. package/dist/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
  61. package/dist/solution/VenueBooking/utils/slotMerge.js +5 -10
  62. package/dist/solution/index.d.ts +0 -1
  63. package/dist/solution/index.js +1 -2
  64. package/dist/types/index.d.ts +0 -1
  65. package/lib/model/strategy/adapter/promotion/index.js +0 -51
  66. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +3 -1
  67. package/lib/modules/Discount/index.d.ts +0 -1
  68. package/lib/modules/Discount/index.js +0 -9
  69. package/lib/modules/Discount/types.d.ts +0 -1
  70. package/lib/modules/OpenData/index.js +1 -1
  71. package/lib/modules/Order/index.d.ts +7 -9
  72. package/lib/modules/Order/index.js +89 -38
  73. package/lib/modules/Order/types.d.ts +21 -12
  74. package/lib/modules/Order/utils.d.ts +0 -10
  75. package/lib/modules/Order/utils.js +5 -36
  76. package/lib/modules/Product/types.d.ts +0 -1
  77. package/lib/modules/ProductList/index.js +31 -40
  78. package/lib/modules/Quotation/index.d.ts +1 -1
  79. package/lib/modules/Quotation/index.js +2 -2
  80. package/lib/modules/Rules/index.js +32 -44
  81. package/lib/modules/SalesSummary/index.js +7 -6
  82. package/lib/modules/SalesSummary/utils.js +5 -1
  83. package/lib/modules/ScanOrderLogger/index.d.ts +0 -2
  84. package/lib/modules/ScanOrderLogger/index.js +1 -13
  85. package/lib/modules/ScanOrderLogger/providers/feishu.js +6 -15
  86. package/lib/modules/ScanOrderLogger/types.d.ts +0 -1
  87. package/lib/modules/Schedule/index.d.ts +1 -3
  88. package/lib/modules/Schedule/index.js +8 -10
  89. package/lib/modules/Summary/utils.js +1 -21
  90. package/lib/modules/index.d.ts +0 -2
  91. package/lib/modules/index.js +1 -5
  92. package/lib/plugins/window.d.ts +0 -1
  93. package/lib/server/index.d.ts +0 -14
  94. package/lib/server/index.js +15 -72
  95. package/lib/solution/BaseSales/index.d.ts +15 -12
  96. package/lib/solution/BaseSales/index.js +52 -35
  97. package/lib/solution/BaseSales/utils/cartPromotion.js +5 -2
  98. package/lib/solution/BookingByStep/index.d.ts +1 -16
  99. package/lib/solution/BookingByStep/index.js +18 -60
  100. package/lib/solution/BookingByStep/types.d.ts +1 -2
  101. package/lib/solution/BookingByStep/types.js +0 -5
  102. package/lib/solution/BookingByStep/utils/capacity.js +1 -20
  103. package/lib/solution/BookingByStep/utils/timeslots.d.ts +1 -3
  104. package/lib/solution/BookingByStep/utils/timeslots.js +11 -19
  105. package/lib/solution/BookingTicket/index.d.ts +2 -14
  106. package/lib/solution/BookingTicket/index.js +2 -10
  107. package/lib/solution/BookingTicket/types.d.ts +3 -0
  108. package/lib/solution/BookingTicket/utils/cartView.js +43 -30
  109. package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +1 -3
  110. package/lib/solution/BookingTicket/utils/scan/handleScan.js +2 -2
  111. package/lib/solution/Sales/index.d.ts +1 -0
  112. package/lib/solution/Sales/index.js +15 -3
  113. package/lib/solution/ScanOrder/index.d.ts +14 -26
  114. package/lib/solution/ScanOrder/index.js +182 -449
  115. package/lib/solution/ScanOrder/types.d.ts +1 -21
  116. package/lib/solution/ScanOrder/utils.d.ts +0 -8
  117. package/lib/solution/ScanOrder/utils.js +0 -31
  118. package/lib/solution/ShopDiscount/index.d.ts +0 -1
  119. package/lib/solution/ShopDiscount/index.js +0 -14
  120. package/lib/solution/VenueBooking/index.d.ts +11 -39
  121. package/lib/solution/VenueBooking/index.js +110 -322
  122. package/lib/solution/VenueBooking/types.d.ts +0 -3
  123. package/lib/solution/VenueBooking/utils/resource.js +0 -1
  124. package/lib/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
  125. package/lib/solution/VenueBooking/utils/slotMerge.js +4 -6
  126. package/lib/solution/index.d.ts +0 -1
  127. package/lib/solution/index.js +1 -3
  128. package/lib/types/index.d.ts +0 -1
  129. package/package.json +1 -1
  130. package/dist/modules/Holder/index.d.ts +0 -48
  131. package/dist/modules/Holder/index.js +0 -640
  132. package/dist/modules/Holder/types.d.ts +0 -123
  133. package/dist/modules/Holder/types.js +0 -1
  134. package/dist/modules/Holder/utils.d.ts +0 -13
  135. package/dist/modules/Holder/utils.js +0 -34
  136. package/dist/modules/ResourcePlanner/index.d.ts +0 -24
  137. package/dist/modules/ResourcePlanner/index.js +0 -181
  138. package/dist/modules/ResourcePlanner/planner.d.ts +0 -14
  139. package/dist/modules/ResourcePlanner/planner.js +0 -1069
  140. package/dist/modules/ResourcePlanner/types.d.ts +0 -227
  141. package/dist/modules/ResourcePlanner/types.js +0 -1
  142. package/dist/solution/UnifiedBookingSales/index.d.ts +0 -183
  143. package/dist/solution/UnifiedBookingSales/index.js +0 -1891
  144. package/dist/solution/UnifiedBookingSales/types.d.ts +0 -143
  145. package/dist/solution/UnifiedBookingSales/types.js +0 -11
  146. package/lib/modules/Holder/index.d.ts +0 -48
  147. package/lib/modules/Holder/index.js +0 -402
  148. package/lib/modules/Holder/types.d.ts +0 -123
  149. package/lib/modules/Holder/types.js +0 -17
  150. package/lib/modules/Holder/utils.d.ts +0 -13
  151. package/lib/modules/Holder/utils.js +0 -71
  152. package/lib/modules/ResourcePlanner/index.d.ts +0 -24
  153. package/lib/modules/ResourcePlanner/index.js +0 -148
  154. package/lib/modules/ResourcePlanner/planner.d.ts +0 -14
  155. package/lib/modules/ResourcePlanner/planner.js +0 -933
  156. package/lib/modules/ResourcePlanner/types.d.ts +0 -227
  157. package/lib/modules/ResourcePlanner/types.js +0 -17
  158. package/lib/solution/UnifiedBookingSales/index.d.ts +0 -183
  159. package/lib/solution/UnifiedBookingSales/index.js +0 -1084
  160. package/lib/solution/UnifiedBookingSales/types.d.ts +0 -143
  161. package/lib/solution/UnifiedBookingSales/types.js +0 -33
@@ -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, _this$otherParams2, _response$data, response, list;
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
- _context7.prev = 4;
912
- _context7.next = 7;
913
- return this.request.post('/product/query', {
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: params.channel || ((_this$otherParams2 = this.otherParams) === null || _this$otherParams2 === void 0 ? void 0 : _this$otherParams2.channel)
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 7:
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 = 11;
970
+ _context7.next = 13;
933
971
  break;
934
972
  }
935
973
  return _context7.abrupt("return", productsById);
936
- case 11:
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 15:
944
- _context7.prev = 15;
945
- _context7.t0 = _context7["catch"](4);
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 19:
989
+ case 21:
952
990
  case "end":
953
991
  return _context7.stop();
954
992
  }
955
- }, _callee7, this, [[4, 15]]);
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, _ref12, _item$bundle_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: (_ref12 = (_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 && _ref12 !== void 0 ? _ref12 : group === null || group === void 0 ? void 0 : 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 _ref13, _ref14, _ref15, _bundle$price;
1043
- return (_ref13 = (_ref14 = (_ref15 = (_bundle$price = bundle.price) !== null && _bundle$price !== void 0 ? _bundle$price : bundle.bundle_selling_price) !== null && _ref15 !== void 0 ? _ref15 : bundle.custom_price) !== null && _ref14 !== void 0 ? _ref14 : bundle.product_price) !== null && _ref13 !== void 0 ? _ref13 : bundle.base_price;
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
- _ref16,
1088
+ _ref19,
1051
1089
  _product$product_id2,
1052
- _ref17,
1090
+ _ref20,
1053
1091
  _product$product_vari,
1054
- _ref18,
1092
+ _ref21,
1055
1093
  _product$num,
1056
- _ref19,
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: (_ref16 = (_product$product_id2 = product.product_id) !== null && _product$product_id2 !== void 0 ? _product$product_id2 : authoritativeProduct.product_id) !== null && _ref16 !== void 0 ? _ref16 : authoritativeProduct.id,
1077
- product_variant_id: (_ref17 = (_product$product_vari = product.product_variant_id) !== null && _product$product_vari !== void 0 ? _product$product_vari : authoritativeProduct.product_variant_id) !== null && _ref17 !== void 0 ? _ref17 : 0,
1078
- num: (_ref18 = (_product$num = product.num) !== null && _product$num !== void 0 ? _product$num : product.quantity) !== null && _ref18 !== void 0 ? _ref18 : authoritativeProduct.num,
1079
- quantity: (_ref19 = (_product$quantity = product.quantity) !== null && _product$quantity !== void 0 ? _product$quantity : product.num) !== null && _ref19 !== void 0 ? _ref19 : authoritativeProduct.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$otherParams3;
1096
- return (_this$otherParams3 = this.otherParams) === null || _this$otherParams3 === void 0 ? void 0 : _this$otherParams3.channel;
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 _ref20,
1156
- _ref20$cover,
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
- _ref20 = _args10.length > 1 && _args10[1] !== undefined ? _args10[1] : {}, _ref20$cover = _ref20.cover, cover = _ref20$cover === void 0 ? false : _ref20$cover;
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 _ref22 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(_ref21) {
1168
- var _ref23, moduleName, subModule, targetModule;
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
- _ref23 = _slicedToArray(_ref21, 2), moduleName = _ref23[0], subModule = _ref23[1];
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 _ref22.apply(this, arguments);
1236
+ return _ref25.apply(this, arguments);
1199
1237
  };
1200
1238
  }()));
1201
1239
  case 4:
@@ -1311,11 +1349,9 @@ 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$otherParams4,
1315
- _this$appPlugin2,
1316
- _this$appPlugin2$getA,
1352
+ var _this$otherParams9,
1317
1353
  _this9 = this,
1318
- _this$otherParams5;
1354
+ _this$otherParams10;
1319
1355
  var options,
1320
1356
  app,
1321
1357
  targetCacheData,
@@ -1330,18 +1366,21 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
1330
1366
  this.paymentNumberDevicePrefix = null;
1331
1367
  // this.store = { ...this.store, ...(options.store as Partial<BaseSalesState>) };
1332
1368
  this.otherParams = options.otherParams || {};
1333
- this.cacheId = (_this$otherParams4 = this.otherParams) === null || _this$otherParams4 === void 0 ? void 0 : _this$otherParams4.cacheId;
1369
+ this.cacheId = (_this$otherParams9 = this.otherParams) === null || _this$otherParams9 === void 0 ? void 0 : _this$otherParams9.cacheId;
1334
1370
  this.reusedSharedSubModuleNames.clear();
1335
1371
  this.window = core.getPlugin('window');
1336
1372
  this.request = core.getPlugin('request');
1337
1373
 
1338
1374
  // 获取 logger 实例
1339
1375
  this.appPlugin = core.getPlugin('app');
1340
- if (!this.appPlugin) {
1341
- // throw new Error('Checkout 解决方案需要 app 插件支持');
1376
+ if (this.appPlugin) {
1377
+ _context11.next = 12;
1378
+ break;
1342
1379
  }
1343
- 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);
1344
- this.logger = app === null || app === void 0 ? void 0 : app.logger;
1380
+ throw new Error('Checkout 解决方案需要 app 插件支持');
1381
+ case 12:
1382
+ app = this.appPlugin.getApp();
1383
+ this.logger = app.logger;
1345
1384
  targetCacheData = this.readSessionCacheData();
1346
1385
  moduleNames = this.getRegisteredModuleNames();
1347
1386
  moduleNames.forEach(function (step) {
@@ -1366,21 +1405,21 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
1366
1405
  }));
1367
1406
  });
1368
1407
  if (!(this.store.schedule && !this.isScheduleListLoaded(this.store.schedule))) {
1369
- _context11.next = 19;
1408
+ _context11.next = 20;
1370
1409
  break;
1371
1410
  }
1372
- _context11.next = 19;
1411
+ _context11.next = 20;
1373
1412
  return this.store.schedule.loadAllSchedule();
1374
- case 19:
1375
- if (this.store.order && typeof ((_this$otherParams5 = this.otherParams) === null || _this$otherParams5 === void 0 ? void 0 : _this$otherParams5.enableTempOrderPersist) === 'boolean') {
1413
+ case 20:
1414
+ if (this.store.order && typeof ((_this$otherParams10 = this.otherParams) === null || _this$otherParams10 === void 0 ? void 0 : _this$otherParams10.enableTempOrderPersist) === 'boolean') {
1376
1415
  this.store.order.setEnableTempOrderPersist(this.otherParams.enableTempOrderPersist);
1377
1416
  }
1378
- _context11.next = 22;
1417
+ _context11.next = 23;
1379
1418
  return this.getPaymentMethodsAsync();
1380
- case 22:
1419
+ case 23:
1381
1420
  this.registerServerOrderChangeSync();
1382
1421
  this.core.effects.emit("".concat(this.name, ":onInited"), {});
1383
- case 24:
1422
+ case 25:
1384
1423
  case "end":
1385
1424
  return _context11.stop();
1386
1425
  }
@@ -1444,7 +1483,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
1444
1483
  key: "loadSalesDetail",
1445
1484
  value: (function () {
1446
1485
  var _loadSalesDetail = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(orderIdOrParams) {
1447
- var loadSequence, _ref24, _ref25, _ref26, _ref27, _params$orderId, params, externalSaleNumber, preloadedSalesDetail, lookup, loadedRecord, message, remoteRecord, currentTempOrder, mergedRecord, record;
1486
+ var loadSequence, _ref27, _ref28, _ref29, _ref30, _params$orderId, params, externalSaleNumber, preloadedSalesDetail, lookup, loadedRecord, message, remoteRecord, currentTempOrder, mergedRecord, record;
1448
1487
  return _regeneratorRuntime().wrap(function _callee13$(_context13) {
1449
1488
  while (1) switch (_context13.prev = _context13.next) {
1450
1489
  case 0:
@@ -1462,7 +1501,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
1462
1501
  };
1463
1502
  externalSaleNumber = params.externalSaleNumber || params.external_sale_number;
1464
1503
  preloadedSalesDetail = params.preloadedSalesDetail;
1465
- lookup = (_ref24 = (_ref25 = (_ref26 = (_ref27 = (_params$orderId = params.orderId) !== null && _params$orderId !== void 0 ? _params$orderId : externalSaleNumber) !== null && _ref27 !== void 0 ? _ref27 : params.orderNumber) !== null && _ref26 !== void 0 ? _ref26 : preloadedSalesDetail === null || preloadedSalesDetail === void 0 ? void 0 : preloadedSalesDetail.order_id) !== null && _ref25 !== void 0 ? _ref25 : preloadedSalesDetail === null || preloadedSalesDetail === void 0 ? void 0 : preloadedSalesDetail.external_sale_number) !== null && _ref24 !== void 0 ? _ref24 : preloadedSalesDetail === null || preloadedSalesDetail === void 0 ? void 0 : preloadedSalesDetail.order_number;
1504
+ 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
1505
  if (!(!preloadedSalesDetail && (lookup === undefined || lookup === null || lookup === ''))) {
1467
1506
  _context13.next = 11;
1468
1507
  break;
@@ -1608,7 +1647,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
1608
1647
  }, {
1609
1648
  key: "replaceTempOrder",
1610
1649
  value: function () {
1611
- var _replaceTempOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(tempOrder) {
1650
+ var _replaceTempOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(tempOrder, options) {
1612
1651
  var nextTempOrder;
1613
1652
  return _regeneratorRuntime().wrap(function _callee14$(_context14) {
1614
1653
  while (1) switch (_context14.prev = _context14.next) {
@@ -1620,7 +1659,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
1620
1659
  throw new Error('order 模块未初始化');
1621
1660
  case 2:
1622
1661
  _context14.next = 4;
1623
- return this.store.order.replaceTempOrder(tempOrder);
1662
+ return this.store.order.replaceTempOrder(tempOrder, options);
1624
1663
  case 4:
1625
1664
  nextTempOrder = _context14.sent;
1626
1665
  _context14.next = 7;
@@ -1635,7 +1674,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
1635
1674
  }
1636
1675
  }, _callee14, this);
1637
1676
  }));
1638
- function replaceTempOrder(_x12) {
1677
+ function replaceTempOrder(_x12, _x13) {
1639
1678
  return _replaceTempOrder.apply(this, arguments);
1640
1679
  }
1641
1680
  return replaceTempOrder;
@@ -2275,7 +2314,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
2275
2314
  }
2276
2315
  }, _callee20, this, [[46, 65, 68, 71]]);
2277
2316
  }));
2278
- function loadDiscountConfig(_x13) {
2317
+ function loadDiscountConfig(_x14) {
2279
2318
  return _loadDiscountConfig.apply(this, arguments);
2280
2319
  }
2281
2320
  return loadDiscountConfig;
@@ -2373,7 +2412,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
2373
2412
  }
2374
2413
  }, _callee21, this);
2375
2414
  }));
2376
- function bestDiscount(_x14) {
2415
+ function bestDiscount(_x15) {
2377
2416
  return _bestDiscount.apply(this, arguments);
2378
2417
  }
2379
2418
  return bestDiscount;
@@ -2436,7 +2475,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
2436
2475
  }
2437
2476
  }, _callee22, this);
2438
2477
  }));
2439
- function replaceDiscountStoreLists(_x15) {
2478
+ function replaceDiscountStoreLists(_x16) {
2440
2479
  return _replaceDiscountStoreLists.apply(this, arguments);
2441
2480
  }
2442
2481
  return replaceDiscountStoreLists;
@@ -2498,7 +2537,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
2498
2537
  }
2499
2538
  }, _callee23, this, [[0, 16]]);
2500
2539
  }));
2501
- function scanPromotionCode(_x16, _x17) {
2540
+ function scanPromotionCode(_x17, _x18) {
2502
2541
  return _scanPromotionCode.apply(this, arguments);
2503
2542
  }
2504
2543
  return scanPromotionCode;
@@ -2613,10 +2652,10 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
2613
2652
  product.discount_list = filterSelectedDiscountDetails(product.discount_list);
2614
2653
  if (Array.isArray(product.product_bundle)) {
2615
2654
  product.product_bundle = product.product_bundle.map(function (bundle) {
2616
- var _ref28, _bundle$original_pric;
2655
+ var _ref31, _bundle$original_pric;
2617
2656
  var nextBundleDiscountList = filterSelectedDiscountDetails(bundle === null || bundle === void 0 ? void 0 : bundle.discount_list);
2618
2657
  var shouldRestoreBundlePrice = nextBundleDiscountList.length === 0;
2619
- var restoredBundlePrice = (_ref28 = (_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 && _ref28 !== void 0 ? _ref28 : bundle === null || bundle === void 0 ? void 0 : bundle.price;
2658
+ 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
2659
  return _objectSpread(_objectSpread(_objectSpread({}, bundle), shouldRestoreBundlePrice ? {
2621
2660
  price: restoredBundlePrice,
2622
2661
  bundle_selling_price: restoredBundlePrice
@@ -2689,7 +2728,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
2689
2728
  }
2690
2729
  }, _callee24, this, [[0, 54], [17, 38, 41, 44]]);
2691
2730
  }));
2692
- function setDiscountSelected(_x18) {
2731
+ function setDiscountSelected(_x19) {
2693
2732
  return _setDiscountSelected.apply(this, arguments);
2694
2733
  }
2695
2734
  return setDiscountSelected;
@@ -2759,7 +2798,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
2759
2798
  }
2760
2799
  }, _callee25, this, [[0, 21]]);
2761
2800
  }));
2762
- function applyDiscountCalculationResult(_x19) {
2801
+ function applyDiscountCalculationResult(_x20) {
2763
2802
  return _applyDiscountCalculationResult.apply(this, arguments);
2764
2803
  }
2765
2804
  return applyDiscountCalculationResult;
@@ -2778,7 +2817,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
2778
2817
  }
2779
2818
  }, _callee26, this);
2780
2819
  }));
2781
- function submitScanOrder(_x20) {
2820
+ function submitScanOrder(_x21) {
2782
2821
  return _submitScanOrder.apply(this, arguments);
2783
2822
  }
2784
2823
  return submitScanOrder;
@@ -2793,8 +2832,8 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
2793
2832
  key: "submitSalesOrder",
2794
2833
  value: (function () {
2795
2834
  var _submitSalesOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee27(params) {
2796
- var _params$smallTicketDa, _this$otherParams6, _this$otherParams7, _this$otherParams8, _this$otherParams9;
2797
- var inferredPaymentStatus, smallTicketDataFlag, submitParams;
2835
+ var _this$otherParams11, _this$otherParams12, _this$otherParams13, _this$otherParams14;
2836
+ var inferredPaymentStatus, submitParams;
2798
2837
  return _regeneratorRuntime().wrap(function _callee27$(_context27) {
2799
2838
  while (1) switch (_context27.prev = _context27.next) {
2800
2839
  case 0:
@@ -2806,33 +2845,32 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
2806
2845
  case 2:
2807
2846
  // this.store.order.persistTempOrder();
2808
2847
  inferredPaymentStatus = this.getSubmitPaymentStatus(params === null || params === void 0 ? void 0 : params.paymentStatus);
2809
- 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$otherParams6 = this.otherParams) === null || _this$otherParams6 === void 0 ? void 0 : _this$otherParams6.platform,
2813
- businessCode: ((_this$otherParams7 = this.otherParams) === null || _this$otherParams7 === void 0 ? void 0 : _this$otherParams7.businessCode) || ((_this$otherParams8 = this.otherParams) === null || _this$otherParams8 === void 0 ? void 0 : _this$otherParams8.business_code),
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$otherParams9 = this.otherParams) === null || _this$otherParams9 === void 0 ? void 0 : _this$otherParams9.type,
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
2819
2857
  } : {}), inferredPaymentStatus !== undefined ? {
2820
2858
  paymentStatus: inferredPaymentStatus
2821
- } : {}), smallTicketDataFlag !== undefined ? {
2822
- smallTicketDataFlag: smallTicketDataFlag
2859
+ } : {}), (params === null || params === void 0 ? void 0 : params.smallTicketDataFlag) !== undefined ? {
2860
+ smallTicketDataFlag: params.smallTicketDataFlag
2823
2861
  } : {}), (params === null || params === void 0 ? void 0 : params.confirmPendingVoucherPayments) !== undefined ? {
2824
2862
  confirmPendingVoucherPayments: params.confirmPendingVoucherPayments
2825
2863
  } : {}), (params === null || params === void 0 ? void 0 : params.enhancePayload) !== undefined ? {
2826
2864
  enhancePayload: params.enhancePayload
2827
2865
  } : {});
2828
- return _context27.abrupt("return", this.shouldUseCheckoutSyncTask() ? this.store.order.submitTempOrder(submitParams) : this.store.order.submitTempOrderAsync(submitParams));
2829
- case 6:
2866
+ return _context27.abrupt("return", this.store.order.submitTempOrder(submitParams));
2867
+ case 5:
2830
2868
  case "end":
2831
2869
  return _context27.stop();
2832
2870
  }
2833
2871
  }, _callee27, this);
2834
2872
  }));
2835
- function submitSalesOrder(_x21) {
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$otherParams10, _this$otherParams11, _this$otherParams12, _params$channel, _params$type, _this$otherParams13;
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$otherParams10 = this.otherParams) === null || _this$otherParams10 === void 0 ? void 0 : _this$otherParams10.platform,
2857
- businessCode: (params === null || params === void 0 ? void 0 : params.businessCode) || ((_this$otherParams11 = this.otherParams) === null || _this$otherParams11 === void 0 ? void 0 : _this$otherParams11.businessCode) || ((_this$otherParams12 = this.otherParams) === null || _this$otherParams12 === void 0 ? void 0 : _this$otherParams12.business_code),
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$otherParams13 = this.otherParams) === null || _this$otherParams13 === void 0 ? void 0 : _this$otherParams13.type
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(_x22) {
2907
+ function saveSalesOrderDraft(_x23) {
2870
2908
  return _saveSalesOrderDraft.apply(this, arguments);
2871
2909
  }
2872
2910
  return saveSalesOrderDraft;
@@ -2875,8 +2913,8 @@ 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$otherParams14, _this$otherParams15, _this$otherParams16, _this$otherParams17;
2879
- var inferredPaymentStatus, smallTicketDataFlag, submitParams;
2916
+ var _this$otherParams19, _this$otherParams20, _this$otherParams21, _this$otherParams22;
2917
+ var inferredPaymentStatus, submitParams;
2880
2918
  return _regeneratorRuntime().wrap(function _callee29$(_context29) {
2881
2919
  while (1) switch (_context29.prev = _context29.next) {
2882
2920
  case 0:
@@ -2887,60 +2925,40 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
2887
2925
  throw new Error('BaseSales 解决方案需要 order 模块支持');
2888
2926
  case 2:
2889
2927
  inferredPaymentStatus = this.getSubmitPaymentStatus(params === null || params === void 0 ? void 0 : params.paymentStatus);
2890
- smallTicketDataFlag = (_params$smallTicketDa2 = params === null || params === void 0 ? void 0 : params.smallTicketDataFlag) !== null && _params$smallTicketDa2 !== void 0 ? _params$smallTicketDa2 : this.getDefaultCheckoutSmallTicketDataFlag();
2891
2928
  submitParams = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
2892
2929
  cacheId: this.cacheId,
2893
- platform: (_this$otherParams14 = this.otherParams) === null || _this$otherParams14 === void 0 ? void 0 : _this$otherParams14.platform,
2894
- businessCode: ((_this$otherParams15 = this.otherParams) === null || _this$otherParams15 === void 0 ? void 0 : _this$otherParams15.businessCode) || ((_this$otherParams16 = this.otherParams) === null || _this$otherParams16 === void 0 ? void 0 : _this$otherParams16.business_code),
2930
+ platform: (_this$otherParams19 = this.otherParams) === null || _this$otherParams19 === void 0 ? void 0 : _this$otherParams19.platform,
2931
+ 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
2932
  channel: this.getSubmitOrderSalesChannel(),
2896
- type: (_this$otherParams17 = this.otherParams) === null || _this$otherParams17 === void 0 ? void 0 : _this$otherParams17.type,
2897
- request_unique_idempotency_token: this.store.order.generateIdempotencyToken()
2933
+ type: (_this$otherParams22 = this.otherParams) === null || _this$otherParams22 === void 0 ? void 0 : _this$otherParams22.type
2898
2934
  }, (params === null || params === void 0 ? void 0 : params.payments) !== undefined ? {
2899
2935
  payments: params.payments
2900
2936
  } : {}), inferredPaymentStatus !== undefined ? {
2901
2937
  paymentStatus: inferredPaymentStatus
2902
- } : {}), smallTicketDataFlag !== undefined ? {
2903
- smallTicketDataFlag: smallTicketDataFlag
2938
+ } : {}), (params === null || params === void 0 ? void 0 : params.smallTicketDataFlag) !== undefined ? {
2939
+ smallTicketDataFlag: params.smallTicketDataFlag
2904
2940
  } : {}), (params === null || params === void 0 ? void 0 : params.confirmPendingVoucherPayments) !== undefined ? {
2905
2941
  confirmPendingVoucherPayments: params.confirmPendingVoucherPayments
2906
2942
  } : {}), (params === null || params === void 0 ? void 0 : params.enhancePayload) !== undefined ? {
2907
2943
  enhancePayload: params.enhancePayload
2908
2944
  } : {});
2909
2945
  return _context29.abrupt("return", this.store.order.submitTempOrderAsync(submitParams));
2910
- case 6:
2946
+ case 5:
2911
2947
  case "end":
2912
2948
  return _context29.stop();
2913
2949
  }
2914
2950
  }, _callee29, this);
2915
2951
  }));
2916
- function submitTempOrderAsync(_x23) {
2952
+ function submitTempOrderAsync(_x24) {
2917
2953
  return _submitTempOrderAsync.apply(this, arguments);
2918
2954
  }
2919
2955
  return submitTempOrderAsync;
2920
2956
  }()
2921
- /**
2922
- * 默认保持 WebPOS 的本地待同步订单模式;需要云端确认后才算成功的渠道可覆盖此策略。
2923
- * otherParams.checkoutSyncTaskEnabled 优先,便于同一 solution 按入口恢复旧行为。
2924
- */
2925
- }, {
2926
- key: "shouldUseCheckoutSyncTask",
2927
- value: function shouldUseCheckoutSyncTask() {
2928
- var _this$otherParams18;
2929
- var configured = (_this$otherParams18 = this.otherParams) === null || _this$otherParams18 === void 0 ? void 0 : _this$otherParams18.checkoutSyncTaskEnabled;
2930
- return typeof configured === 'boolean' ? configured : true;
2931
- }
2932
-
2933
- /** 可由特定 solution 为真实 checkout 补充默认收据数据请求。 */
2934
- }, {
2935
- key: "getDefaultCheckoutSmallTicketDataFlag",
2936
- value: function getDefaultCheckoutSmallTicketDataFlag() {
2937
- return undefined;
2938
- }
2939
2957
  }, {
2940
2958
  key: "printLocalOrderReceipt",
2941
2959
  value: function () {
2942
2960
  var _printLocalOrderReceipt = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee30(lookup) {
2943
- var _this$otherParams19, _this$otherParams20, _this$otherParams21, _this$otherParams22;
2961
+ var _this$otherParams23, _this$otherParams24, _this$otherParams25, _this$otherParams26;
2944
2962
  var hasLookup, lookupPayload, context, payload, response, _this$store$order$app, _this$store$order5, _data;
2945
2963
  return _regeneratorRuntime().wrap(function _callee30$(_context30) {
2946
2964
  while (1) switch (_context30.prev = _context30.next) {
@@ -2958,10 +2976,10 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
2958
2976
  external_sale_number: lookup
2959
2977
  };
2960
2978
  context = {
2961
- platform: (_this$otherParams19 = this.otherParams) === null || _this$otherParams19 === void 0 ? void 0 : _this$otherParams19.platform,
2962
- 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),
2979
+ platform: (_this$otherParams23 = this.otherParams) === null || _this$otherParams23 === void 0 ? void 0 : _this$otherParams23.platform,
2980
+ businessCode: ((_this$otherParams24 = this.otherParams) === null || _this$otherParams24 === void 0 ? void 0 : _this$otherParams24.businessCode) || ((_this$otherParams25 = this.otherParams) === null || _this$otherParams25 === void 0 ? void 0 : _this$otherParams25.business_code),
2963
2981
  channel: this.getSubmitOrderSalesChannel(),
2964
- type: (_this$otherParams22 = this.otherParams) === null || _this$otherParams22 === void 0 ? void 0 : _this$otherParams22.type
2982
+ type: (_this$otherParams26 = this.otherParams) === null || _this$otherParams26 === void 0 ? void 0 : _this$otherParams26.type
2965
2983
  };
2966
2984
  payload = hasLookup ? _objectSpread(_objectSpread({}, lookupPayload), {}, {
2967
2985
  lookup_order_from_db: 1,
@@ -2998,7 +3016,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
2998
3016
  }
2999
3017
  }, _callee30, this);
3000
3018
  }));
3001
- function printLocalOrderReceipt(_x24) {
3019
+ function printLocalOrderReceipt(_x25) {
3002
3020
  return _printLocalOrderReceipt.apply(this, arguments);
3003
3021
  }
3004
3022
  return printLocalOrderReceipt;
@@ -3020,7 +3038,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
3020
3038
  key: "syncPaymentsToOrder",
3021
3039
  value: function () {
3022
3040
  var _syncPaymentsToOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee31(params) {
3023
- var _ref29, _params$businessCode, _this$otherParams23, _this$otherParams24, _params$channel2;
3041
+ var _ref32, _params$businessCode, _this$otherParams27, _this$otherParams28, _params$channel2;
3024
3042
  var businessCode, channel, syncParams, syncState, payments, syncResult, latestPayments, amountSnapshot, orderSnapshot, syncPayload;
3025
3043
  return _regeneratorRuntime().wrap(function _callee31$(_context31) {
3026
3044
  while (1) switch (_context31.prev = _context31.next) {
@@ -3031,11 +3049,9 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
3031
3049
  }
3032
3050
  throw new Error('order 模块未初始化');
3033
3051
  case 2:
3034
- businessCode = (_ref29 = (_params$businessCode = params.businessCode) !== null && _params$businessCode !== void 0 ? _params$businessCode : (_this$otherParams23 = this.otherParams) === null || _this$otherParams23 === void 0 ? void 0 : _this$otherParams23.businessCode) !== null && _ref29 !== void 0 ? _ref29 : (_this$otherParams24 = this.otherParams) === null || _this$otherParams24 === void 0 ? void 0 : _this$otherParams24.business_code;
3052
+ businessCode = (_ref32 = (_params$businessCode = params.businessCode) !== null && _params$businessCode !== void 0 ? _params$businessCode : (_this$otherParams27 = this.otherParams) === null || _this$otherParams27 === void 0 ? void 0 : _this$otherParams27.businessCode) !== null && _ref32 !== void 0 ? _ref32 : (_this$otherParams28 = this.otherParams) === null || _this$otherParams28 === void 0 ? void 0 : _this$otherParams28.business_code;
3035
3053
  channel = (_params$channel2 = params.channel) !== null && _params$channel2 !== void 0 ? _params$channel2 : this.getSubmitOrderSalesChannel();
3036
- syncParams = _objectSpread(_objectSpread(_objectSpread({}, params), {}, {
3037
- checkoutSyncTaskEnabled: this.shouldUseCheckoutSyncTask()
3038
- }, businessCode !== undefined ? {
3054
+ syncParams = _objectSpread(_objectSpread(_objectSpread({}, params), businessCode !== undefined ? {
3039
3055
  businessCode: businessCode
3040
3056
  } : {}), channel !== undefined ? {
3041
3057
  channel: channel
@@ -3112,7 +3128,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
3112
3128
  }
3113
3129
  }, _callee31, this, [[12, 29]]);
3114
3130
  }));
3115
- function syncPaymentsToOrder(_x25) {
3131
+ function syncPaymentsToOrder(_x26) {
3116
3132
  return _syncPaymentsToOrder.apply(this, arguments);
3117
3133
  }
3118
3134
  return syncPaymentsToOrder;
@@ -3282,7 +3298,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
3282
3298
  }
3283
3299
  }, _callee33, this);
3284
3300
  }));
3285
- function addOrderPaymentAsync(_x26) {
3301
+ function addOrderPaymentAsync(_x27) {
3286
3302
  return _addOrderPaymentAsync.apply(this, arguments);
3287
3303
  }
3288
3304
  return addOrderPaymentAsync;
@@ -3290,10 +3306,10 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
3290
3306
  }, {
3291
3307
  key: "addOrderPaymentWithDevicePrefix",
3292
3308
  value: function addOrderPaymentWithDevicePrefix(payment, devicePrefix) {
3293
- var _this$otherParams25,
3309
+ var _this$otherParams29,
3294
3310
  _paymentRecord$paymen,
3295
3311
  _paymentRecord$create,
3296
- _ref30,
3312
+ _ref33,
3297
3313
  _paymentRecord$origin,
3298
3314
  _this14 = this;
3299
3315
  if (!this.store.order) throw new Error('order 模块未初始化');
@@ -3306,7 +3322,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
3306
3322
  return this.store.order.getOrderPayments();
3307
3323
  }
3308
3324
  var metadata = paymentRecord.metadata && _typeof(paymentRecord.metadata) === 'object' ? _objectSpread({}, paymentRecord.metadata) : {};
3309
- var shopWalletPassId = (_this$otherParams25 = this.otherParams) === null || _this$otherParams25 === void 0 ? void 0 : _this$otherParams25.shop_wallet_pass_id;
3325
+ var shopWalletPassId = (_this$otherParams29 = this.otherParams) === null || _this$otherParams29 === void 0 ? void 0 : _this$otherParams29.shop_wallet_pass_id;
3310
3326
  if (shopWalletPassId !== undefined && shopWalletPassId !== null) {
3311
3327
  metadata.shop_wallet_pass_id = shopWalletPassId;
3312
3328
  }
@@ -3315,7 +3331,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
3315
3331
  var paymentTime = (_paymentRecord$paymen = paymentRecord.payment_time) !== null && _paymentRecord$paymen !== void 0 ? _paymentRecord$paymen : paymentTimestamp;
3316
3332
  var createdAt = (_paymentRecord$create = paymentRecord.created_at) !== null && _paymentRecord$create !== void 0 ? _paymentRecord$create : paymentTimestamp;
3317
3333
  var serviceCharge = paymentRecord.service_charge && _typeof(paymentRecord.service_charge) === 'object' ? paymentRecord.service_charge : null;
3318
- var calculatedServiceFee = serviceCharge ? new Decimal((_ref30 = (_paymentRecord$origin = paymentRecord.origin_amount) !== null && _paymentRecord$origin !== void 0 ? _paymentRecord$origin : paymentRecord.amount) !== null && _ref30 !== void 0 ? _ref30 : 0).times(serviceCharge.percentage || 0).plus(serviceCharge.amount || 0).toDecimalPlaces(2).toFixed(2) : undefined;
3334
+ 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
3335
  var payments = this.store.order.addOrderPayment(_objectSpread(_objectSpread(_objectSpread({}, normalizedPaymentRecord), calculatedServiceFee !== undefined ? {
3320
3336
  service_fee: calculatedServiceFee
3321
3337
  } : {}), {}, {
@@ -3470,7 +3486,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
3470
3486
  }
3471
3487
  }, _callee34, this, [[17, 23]]);
3472
3488
  }));
3473
- function updateOrderPayment(_x27, _x28) {
3489
+ function updateOrderPayment(_x28, _x29) {
3474
3490
  return _updateOrderPayment.apply(this, arguments);
3475
3491
  }
3476
3492
  return updateOrderPayment;
@@ -3509,7 +3525,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
3509
3525
  }
3510
3526
  }, _callee35, this);
3511
3527
  }));
3512
- function updateVoucherOrderPaymentsAsync(_x29, _x30) {
3528
+ function updateVoucherOrderPaymentsAsync(_x30, _x31) {
3513
3529
  return _updateVoucherOrderPaymentsAsync.apply(this, arguments);
3514
3530
  }
3515
3531
  return updateVoucherOrderPaymentsAsync;
@@ -3596,7 +3612,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
3596
3612
  }, {
3597
3613
  key: "buildWalletInitBusinessData",
3598
3614
  value: function buildWalletInitBusinessData(params) {
3599
- var _this$store$order8, _params$order_wait_pa, _ref31, _tempOrder$is_price_i;
3615
+ var _this$store$order8, _params$order_wait_pa, _ref34, _tempOrder$is_price_i;
3600
3616
  var snapshot = (_this$store$order8 = this.store.order) === null || _this$store$order8 === void 0 ? void 0 : _this$store$order8.getOrderSnapshot();
3601
3617
  var tempOrder = snapshot === null || snapshot === void 0 ? void 0 : snapshot.tempOrder;
3602
3618
  var amount = snapshot === null || snapshot === void 0 ? void 0 : snapshot.amount;
@@ -3612,7 +3628,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
3612
3628
  },
3613
3629
  products: this.getWalletProductList(),
3614
3630
  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: (_ref31 = (_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 && _ref31 !== void 0 ? _ref31 : 1
3631
+ 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
3632
  }, snapshot.identity.orderId ? {
3617
3633
  payment_order_id: String(snapshot.identity.orderId)
3618
3634
  } : {});
@@ -3675,7 +3691,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
3675
3691
  }
3676
3692
  }, _callee36, this);
3677
3693
  }));
3678
- function initWalletData(_x31) {
3694
+ function initWalletData(_x32) {
3679
3695
  return _initWalletData.apply(this, arguments);
3680
3696
  }
3681
3697
  return initWalletData;
@@ -3702,9 +3718,9 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
3702
3718
  var walletPassName = fundRecord.wallet_pass_name;
3703
3719
  var title = walletPassName && _typeof(walletPassName) === 'object' ? walletPassName.default || Object.values(walletPassName)[0] : walletPassName;
3704
3720
  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 (_ref32) {
3706
- var _ref33 = _slicedToArray(_ref32, 2),
3707
- paymentCode = _ref33[1];
3721
+ var tag = ((_Object$entries$find = Object.entries(WALLET_PAYMENT_CODE_BY_TAG).find(function (_ref35) {
3722
+ var _ref36 = _slicedToArray(_ref35, 2),
3723
+ paymentCode = _ref36[1];
3708
3724
  return paymentCode === code;
3709
3725
  })) === null || _Object$entries$find === void 0 ? void 0 : _Object$entries$find[0]) || fundRecord.tag;
3710
3726
  return {
@@ -3742,7 +3758,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
3742
3758
  }
3743
3759
  }, _callee37, this);
3744
3760
  }));
3745
- function publishWalletAssetsState(_x32) {
3761
+ function publishWalletAssetsState(_x33) {
3746
3762
  return _publishWalletAssetsState.apply(this, arguments);
3747
3763
  }
3748
3764
  return publishWalletAssetsState;
@@ -3823,7 +3839,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
3823
3839
  }
3824
3840
  }, _callee38, this);
3825
3841
  }));
3826
- function syncSelectedWalletAssets(_x33) {
3842
+ function syncSelectedWalletAssets(_x34) {
3827
3843
  return _syncSelectedWalletAssets.apply(this, arguments);
3828
3844
  }
3829
3845
  return syncSelectedWalletAssets;
@@ -3879,7 +3895,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
3879
3895
  }
3880
3896
  }, _callee39, this);
3881
3897
  }));
3882
- function importWalletAssetsSnapshot(_x34) {
3898
+ function importWalletAssetsSnapshot(_x35) {
3883
3899
  return _importWalletAssetsSnapshot.apply(this, arguments);
3884
3900
  }
3885
3901
  return importWalletAssetsSnapshot;
@@ -3967,7 +3983,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
3967
3983
  }
3968
3984
  }, _callee40, this);
3969
3985
  }));
3970
- function refreshWalletAssets(_x35) {
3986
+ function refreshWalletAssets(_x36) {
3971
3987
  return _refreshWalletAssets.apply(this, arguments);
3972
3988
  }
3973
3989
  return refreshWalletAssets;
@@ -4000,7 +4016,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
4000
4016
  }
4001
4017
  }, _callee41, this);
4002
4018
  }));
4003
- function selectWalletAsset(_x36) {
4019
+ function selectWalletAsset(_x37) {
4004
4020
  return _selectWalletAsset.apply(this, arguments);
4005
4021
  }
4006
4022
  return selectWalletAsset;
@@ -4040,7 +4056,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
4040
4056
  }
4041
4057
  }, _callee42, this);
4042
4058
  }));
4043
- function scanWalletAsset(_x37) {
4059
+ function scanWalletAsset(_x38) {
4044
4060
  return _scanWalletAsset.apply(this, arguments);
4045
4061
  }
4046
4062
  return scanWalletAsset;
@@ -4170,7 +4186,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
4170
4186
  key: "getCashPaymentConfig",
4171
4187
  value: (function () {
4172
4188
  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$otherParams26;
4189
+ var _this$store$order11, _this$store$order11$g, _this$store$order12, _this$store$order12$g, _this$otherParams30;
4174
4190
  var paymentMethods, paymentMethod, amountSnapshot, pendingWalletAmount, amountDue, currency, recommendedAmounts;
4175
4191
  return _regeneratorRuntime().wrap(function _callee45$(_context45) {
4176
4192
  while (1) switch (_context45.prev = _context45.next) {
@@ -4196,7 +4212,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
4196
4212
  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
4213
  pendingWalletAmount = this.getPendingWalletPaymentAmount();
4198
4214
  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$otherParams26 = this.otherParams) === null || _this$otherParams26 === void 0 ? void 0 : _this$otherParams26.currency) || 'USD';
4215
+ 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$otherParams30 = this.otherParams) === null || _this$otherParams30 === void 0 ? void 0 : _this$otherParams30.currency) || 'USD';
4200
4216
  recommendedAmounts = amountDue > 0 ? this.store.payment.cash.getRecommendedAmount(amountDue, currency) : [];
4201
4217
  return _context45.abrupt("return", {
4202
4218
  available: Boolean(paymentMethod && amountDue > 0),
@@ -4331,7 +4347,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
4331
4347
  key: "payCash",
4332
4348
  value: (function () {
4333
4349
  var _payCash = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee47(params) {
4334
- var _this$store$order$get6, _params$actualPaidAmo, _this$otherParams27, _this$window, _this$window$postMess;
4350
+ var _this$store$order$get6, _params$actualPaidAmo, _this$otherParams31, _this$window, _this$window$postMess;
4335
4351
  var amount, config, paymentMethod, roundingAmount, effectivePaymentAmount, beforePayments, beforePaymentStatus, uniquePaymentNumber, paymentTimestamp, actualPaidAmount, changeAmount, shopWalletPassId, payments, payment, syncResult, committed, walletState, restoredTempOrder;
4336
4352
  return _regeneratorRuntime().wrap(function _callee47$(_context47) {
4337
4353
  while (1) switch (_context47.prev = _context47.next) {
@@ -4380,7 +4396,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
4380
4396
  paymentTimestamp = dayjs().format('YYYY-MM-DD HH:mm:ss');
4381
4397
  actualPaidAmount = Number((_params$actualPaidAmo = params.actualPaidAmount) !== null && _params$actualPaidAmo !== void 0 ? _params$actualPaidAmo : amount);
4382
4398
  changeAmount = Number(params.changeAmount || 0);
4383
- shopWalletPassId = (_this$otherParams27 = this.otherParams) === null || _this$otherParams27 === void 0 ? void 0 : _this$otherParams27.shop_wallet_pass_id;
4399
+ shopWalletPassId = (_this$otherParams31 = this.otherParams) === null || _this$otherParams31 === void 0 ? void 0 : _this$otherParams31.shop_wallet_pass_id;
4384
4400
  if (!(!Number.isFinite(actualPaidAmount) || actualPaidAmount + 0.01 < amount)) {
4385
4401
  _context47.next = 26;
4386
4402
  break;
@@ -4463,7 +4479,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
4463
4479
  }
4464
4480
  }, _callee47, this, [[29, 41]]);
4465
4481
  }));
4466
- function payCash(_x38) {
4482
+ function payCash(_x39) {
4467
4483
  return _payCash.apply(this, arguments);
4468
4484
  }
4469
4485
  return payCash;
@@ -4619,7 +4635,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
4619
4635
  }
4620
4636
  }, _callee48, this, [[30, 42]]);
4621
4637
  }));
4622
- function commitPaymentMethodPayment(_x39) {
4638
+ function commitPaymentMethodPayment(_x40) {
4623
4639
  return _commitPaymentMethodPayment.apply(this, arguments);
4624
4640
  }
4625
4641
  return commitPaymentMethodPayment;
@@ -4667,7 +4683,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
4667
4683
  }
4668
4684
  }, _callee49, this);
4669
4685
  }));
4670
- function roundAmount(_x40) {
4686
+ function roundAmount(_x41) {
4671
4687
  return _roundAmount.apply(this, arguments);
4672
4688
  }
4673
4689
  return roundAmount;
@@ -4683,7 +4699,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
4683
4699
  key: "sendCustomerPayLink",
4684
4700
  value: (function () {
4685
4701
  var _sendCustomerPayLink = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee50(params) {
4686
- var orderIds, _ref34, _ref35, _submitResult$data$or, _submitResult$data, _submitResult$data2, submitResult, orderId;
4702
+ var orderIds, _ref37, _ref38, _submitResult$data$or, _submitResult$data, _submitResult$data2, submitResult, orderId;
4687
4703
  return _regeneratorRuntime().wrap(function _callee50$(_context50) {
4688
4704
  while (1) switch (_context50.prev = _context50.next) {
4689
4705
  case 0:
@@ -4704,7 +4720,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
4704
4720
  });
4705
4721
  case 6:
4706
4722
  submitResult = _context50.sent;
4707
- orderId = (_ref34 = (_ref35 = (_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 && _ref35 !== void 0 ? _ref35 : submitResult === null || submitResult === void 0 || (_submitResult$data2 = submitResult.data) === null || _submitResult$data2 === void 0 ? void 0 : _submitResult$data2.id) !== null && _ref34 !== void 0 ? _ref34 : submitResult === null || submitResult === void 0 ? void 0 : submitResult.id;
4723
+ 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
4724
  if (orderId) {
4709
4725
  _context50.next = 10;
4710
4726
  break;
@@ -4724,7 +4740,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
4724
4740
  }
4725
4741
  }, _callee50, this);
4726
4742
  }));
4727
- function sendCustomerPayLink(_x41) {
4743
+ function sendCustomerPayLink(_x42) {
4728
4744
  return _sendCustomerPayLink.apply(this, arguments);
4729
4745
  }
4730
4746
  return sendCustomerPayLink;
@@ -4769,7 +4785,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
4769
4785
  }
4770
4786
  }, _callee51, this);
4771
4787
  }));
4772
- function calculateProductBookingPrice(_x42) {
4788
+ function calculateProductBookingPrice(_x43) {
4773
4789
  return _calculateProductBookingPrice.apply(this, arguments);
4774
4790
  }
4775
4791
  return calculateProductBookingPrice;
@@ -4876,12 +4892,12 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
4876
4892
  });
4877
4893
  _context53.next = 9;
4878
4894
  return Promise.all(Array.from(groups.entries()).map( /*#__PURE__*/function () {
4879
- var _ref37 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee52(_ref36) {
4880
- var _ref38, groupKey, group, productsById;
4895
+ var _ref40 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee52(_ref39) {
4896
+ var _ref41, groupKey, group, productsById;
4881
4897
  return _regeneratorRuntime().wrap(function _callee52$(_context52) {
4882
4898
  while (1) switch (_context52.prev = _context52.next) {
4883
4899
  case 0:
4884
- _ref38 = _slicedToArray(_ref36, 2), groupKey = _ref38[0], group = _ref38[1];
4900
+ _ref41 = _slicedToArray(_ref39, 2), groupKey = _ref41[0], group = _ref41[1];
4885
4901
  _context52.next = 3;
4886
4902
  return _this16.loadProductsForPriceQuery({
4887
4903
  ids: Array.from(group.ids),
@@ -4898,8 +4914,8 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
4898
4914
  }
4899
4915
  }, _callee52);
4900
4916
  }));
4901
- return function (_x44) {
4902
- return _ref37.apply(this, arguments);
4917
+ return function (_x45) {
4918
+ return _ref40.apply(this, arguments);
4903
4919
  };
4904
4920
  }()));
4905
4921
  case 9:
@@ -4932,7 +4948,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
4932
4948
  }
4933
4949
  }, _callee53, this);
4934
4950
  }));
4935
- function calculateProductBookingPrices(_x43) {
4951
+ function calculateProductBookingPrices(_x44) {
4936
4952
  return _calculateProductBookingPrices.apply(this, arguments);
4937
4953
  }
4938
4954
  return calculateProductBookingPrices;
@@ -4940,7 +4956,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
4940
4956
  }, {
4941
4957
  key: "addProductToOrder",
4942
4958
  value: function () {
4943
- var _addProductToOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee54(product, booking) {
4959
+ var _addProductToOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee54(product, booking, options) {
4944
4960
  var products;
4945
4961
  return _regeneratorRuntime().wrap(function _callee54$(_context54) {
4946
4962
  while (1) switch (_context54.prev = _context54.next) {
@@ -4953,7 +4969,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
4953
4969
  throw new Error('order 模块未初始化');
4954
4970
  case 3:
4955
4971
  _context54.next = 5;
4956
- return this.store.order.addProductToOrder(product, booking);
4972
+ return this.store.order.addProductToOrder(product, booking, options);
4957
4973
  case 5:
4958
4974
  products = _context54.sent;
4959
4975
  return _context54.abrupt("return", products);
@@ -4967,7 +4983,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
4967
4983
  }
4968
4984
  }, _callee54, this, [[0, 9]]);
4969
4985
  }));
4970
- function addProductToOrder(_x45, _x46) {
4986
+ function addProductToOrder(_x46, _x47, _x48) {
4971
4987
  return _addProductToOrder.apply(this, arguments);
4972
4988
  }
4973
4989
  return addProductToOrder;
@@ -5002,7 +5018,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
5002
5018
  }
5003
5019
  }, _callee55, this, [[0, 9]]);
5004
5020
  }));
5005
- function updateOrderProduct(_x47) {
5021
+ function updateOrderProduct(_x49) {
5006
5022
  return _updateOrderProduct.apply(this, arguments);
5007
5023
  }
5008
5024
  return updateOrderProduct;
@@ -5037,7 +5053,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
5037
5053
  }
5038
5054
  }, _callee56, this, [[0, 9]]);
5039
5055
  }));
5040
- function updateOrderProducts(_x48) {
5056
+ function updateOrderProducts(_x50) {
5041
5057
  return _updateOrderProducts.apply(this, arguments);
5042
5058
  }
5043
5059
  return updateOrderProducts;
@@ -5072,7 +5088,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
5072
5088
  }
5073
5089
  }, _callee57, this, [[0, 9]]);
5074
5090
  }));
5075
- function updateOrderProductQuantity(_x49) {
5091
+ function updateOrderProductQuantity(_x51) {
5076
5092
  return _updateOrderProductQuantity.apply(this, arguments);
5077
5093
  }
5078
5094
  return updateOrderProductQuantity;
@@ -5130,7 +5146,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
5130
5146
  }
5131
5147
  }, _callee58, this, [[0, 11]]);
5132
5148
  }));
5133
- function setOrderProductLineNote(_x50, _x51) {
5149
+ function setOrderProductLineNote(_x52, _x53) {
5134
5150
  return _setOrderProductLineNote.apply(this, arguments);
5135
5151
  }
5136
5152
  return setOrderProductLineNote;
@@ -5145,7 +5161,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
5145
5161
  }, {
5146
5162
  key: "removeProductsFromOrder",
5147
5163
  value: (function () {
5148
- var _removeProductsFromOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee59(identities) {
5164
+ var _removeProductsFromOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee59(identities, options) {
5149
5165
  return _regeneratorRuntime().wrap(function _callee59$(_context59) {
5150
5166
  while (1) switch (_context59.prev = _context59.next) {
5151
5167
  case 0:
@@ -5157,7 +5173,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
5157
5173
  throw new Error('order 模块未初始化');
5158
5174
  case 3:
5159
5175
  _context59.next = 5;
5160
- return this.store.order.removeProductsFromOrder(identities);
5176
+ return this.store.order.removeProductsFromOrder(identities, options);
5161
5177
  case 5:
5162
5178
  return _context59.abrupt("return", _context59.sent);
5163
5179
  case 8:
@@ -5170,7 +5186,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
5170
5186
  }
5171
5187
  }, _callee59, this, [[0, 8]]);
5172
5188
  }));
5173
- function removeProductsFromOrder(_x52) {
5189
+ function removeProductsFromOrder(_x54, _x55) {
5174
5190
  return _removeProductsFromOrder.apply(this, arguments);
5175
5191
  }
5176
5192
  return removeProductsFromOrder;
@@ -5178,18 +5194,18 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
5178
5194
  }, {
5179
5195
  key: "removeProductFromOrder",
5180
5196
  value: function () {
5181
- var _removeProductFromOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee60(identity) {
5197
+ var _removeProductFromOrder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee60(identity, options) {
5182
5198
  return _regeneratorRuntime().wrap(function _callee60$(_context60) {
5183
5199
  while (1) switch (_context60.prev = _context60.next) {
5184
5200
  case 0:
5185
- return _context60.abrupt("return", this.removeProductsFromOrder([identity]));
5201
+ return _context60.abrupt("return", this.removeProductsFromOrder([identity], options));
5186
5202
  case 1:
5187
5203
  case "end":
5188
5204
  return _context60.stop();
5189
5205
  }
5190
5206
  }, _callee60, this);
5191
5207
  }));
5192
- function removeProductFromOrder(_x53) {
5208
+ function removeProductFromOrder(_x56, _x57) {
5193
5209
  return _removeProductFromOrder.apply(this, arguments);
5194
5210
  }
5195
5211
  return removeProductFromOrder;
@@ -5283,13 +5299,13 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
5283
5299
  key: "getProductList",
5284
5300
  value: function () {
5285
5301
  var _getProductList = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee62() {
5286
- var _this$otherParams28;
5302
+ var _this$otherParams32;
5287
5303
  var menu_list_ids, _this$store$products, res;
5288
5304
  return _regeneratorRuntime().wrap(function _callee62$(_context62) {
5289
5305
  while (1) switch (_context62.prev = _context62.next) {
5290
5306
  case 0:
5291
5307
  // 可以直接通过配置里的 menu 读取
5292
- menu_list_ids = ((_this$otherParams28 = this.otherParams) === null || _this$otherParams28 === void 0 || (_this$otherParams28 = _this$otherParams28.dineInConfig) === null || _this$otherParams28 === void 0 ? void 0 : _this$otherParams28['menu.associated_menus'].map(function (n) {
5308
+ menu_list_ids = ((_this$otherParams32 = this.otherParams) === null || _this$otherParams32 === void 0 || (_this$otherParams32 = _this$otherParams32.dineInConfig) === null || _this$otherParams32 === void 0 ? void 0 : _this$otherParams32['menu.associated_menus'].map(function (n) {
5293
5309
  return Number(n.value);
5294
5310
  })) || [];
5295
5311
  _context62.prev = 1;
@@ -5327,21 +5343,21 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
5327
5343
  key: "setOtherParams",
5328
5344
  value: function () {
5329
5345
  var _setOtherParams = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee63(params) {
5330
- var _this$otherParams29;
5331
- var _ref39,
5332
- _ref39$cover,
5346
+ var _this$otherParams33;
5347
+ var _ref42,
5348
+ _ref42$cover,
5333
5349
  cover,
5334
5350
  _args63 = arguments;
5335
5351
  return _regeneratorRuntime().wrap(function _callee63$(_context63) {
5336
5352
  while (1) switch (_context63.prev = _context63.next) {
5337
5353
  case 0:
5338
- _ref39 = _args63.length > 1 && _args63[1] !== undefined ? _args63[1] : {}, _ref39$cover = _ref39.cover, cover = _ref39$cover === void 0 ? false : _ref39$cover;
5354
+ _ref42 = _args63.length > 1 && _args63[1] !== undefined ? _args63[1] : {}, _ref42$cover = _ref42.cover, cover = _ref42$cover === void 0 ? false : _ref42$cover;
5339
5355
  if (cover) {
5340
5356
  this.otherParams = _objectSpread({}, params);
5341
5357
  } else {
5342
5358
  this.otherParams = _objectSpread(_objectSpread({}, this.otherParams), params);
5343
5359
  }
5344
- this.cacheId = (_this$otherParams29 = this.otherParams) === null || _this$otherParams29 === void 0 ? void 0 : _this$otherParams29.cacheId;
5360
+ this.cacheId = (_this$otherParams33 = this.otherParams) === null || _this$otherParams33 === void 0 ? void 0 : _this$otherParams33.cacheId;
5345
5361
  _context63.next = 5;
5346
5362
  return this.syncOtherParamsToSubModules(params, {
5347
5363
  cover: cover
@@ -5352,7 +5368,7 @@ export var BaseSalesImpl = /*#__PURE__*/function (_BaseModule) {
5352
5368
  }
5353
5369
  }, _callee63, this);
5354
5370
  }));
5355
- function setOtherParams(_x54) {
5371
+ function setOtherParams(_x58) {
5356
5372
  return _setOtherParams.apply(this, arguments);
5357
5373
  }
5358
5374
  return setOtherParams;