@pisell/pisellos 2.3.67 → 2.3.69

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 (61) hide show
  1. package/dist/model/strategy/adapter/walletPass/evaluator.js +0 -1
  2. package/dist/model/strategy/adapter/walletPass/utils.js +0 -2
  3. package/dist/modules/BaseModule.d.ts +1 -0
  4. package/dist/modules/BaseModule.js +24 -28
  5. package/dist/modules/Customer/index.d.ts +4 -0
  6. package/dist/modules/Customer/index.js +91 -59
  7. package/dist/modules/Customer/types.d.ts +2 -0
  8. package/dist/modules/Order/index.d.ts +22 -2
  9. package/dist/modules/Order/index.js +313 -142
  10. package/dist/modules/Order/types.d.ts +13 -1
  11. package/dist/modules/Order/utils/orderCollectionIdentity.d.ts +15 -0
  12. package/dist/modules/Order/utils/orderCollectionIdentity.js +75 -0
  13. package/dist/modules/Order/utils.js +0 -1
  14. package/dist/modules/Payment/index.d.ts +4 -0
  15. package/dist/modules/Payment/index.js +14 -4
  16. package/dist/modules/Payment/walletpass.js +52 -18
  17. package/dist/modules/Rules/index.js +46 -31
  18. package/dist/server/index.js +3 -6
  19. package/dist/server/modules/order/index.d.ts +1 -0
  20. package/dist/server/modules/order/index.js +252 -93
  21. package/dist/server/utils/small-ticket.js +2 -1
  22. package/dist/solution/BaseSales/index.d.ts +13 -1
  23. package/dist/solution/BaseSales/index.js +903 -831
  24. package/dist/solution/BaseSales/utils.js +31 -20
  25. package/dist/solution/BookingTicket/index.d.ts +7 -1
  26. package/dist/solution/BookingTicket/index.js +310 -224
  27. package/dist/solution/ScanOrder/utils.js +31 -20
  28. package/dist/solution/UnifiedBookingSales/index.d.ts +25 -0
  29. package/dist/solution/UnifiedBookingSales/index.js +640 -321
  30. package/dist/solution/UnifiedBookingSales/types.d.ts +7 -0
  31. package/lib/model/strategy/adapter/walletPass/evaluator.js +0 -1
  32. package/lib/model/strategy/adapter/walletPass/utils.js +0 -1
  33. package/lib/modules/BaseModule.d.ts +1 -0
  34. package/lib/modules/BaseModule.js +24 -37
  35. package/lib/modules/Customer/index.d.ts +4 -0
  36. package/lib/modules/Customer/index.js +11 -0
  37. package/lib/modules/Customer/types.d.ts +2 -0
  38. package/lib/modules/Order/index.d.ts +22 -2
  39. package/lib/modules/Order/index.js +212 -54
  40. package/lib/modules/Order/types.d.ts +13 -1
  41. package/lib/modules/Order/utils/orderCollectionIdentity.d.ts +15 -0
  42. package/lib/modules/Order/utils/orderCollectionIdentity.js +70 -0
  43. package/lib/modules/Order/utils.js +0 -1
  44. package/lib/modules/Payment/index.d.ts +4 -0
  45. package/lib/modules/Payment/index.js +7 -0
  46. package/lib/modules/Payment/walletpass.js +27 -2
  47. package/lib/modules/Rules/index.js +17 -1
  48. package/lib/server/index.js +3 -6
  49. package/lib/server/modules/order/index.d.ts +1 -0
  50. package/lib/server/modules/order/index.js +66 -2
  51. package/lib/server/utils/small-ticket.js +1 -1
  52. package/lib/solution/BaseSales/index.d.ts +13 -1
  53. package/lib/solution/BaseSales/index.js +61 -18
  54. package/lib/solution/BaseSales/utils.js +29 -18
  55. package/lib/solution/BookingTicket/index.d.ts +7 -1
  56. package/lib/solution/BookingTicket/index.js +65 -14
  57. package/lib/solution/ScanOrder/utils.js +29 -18
  58. package/lib/solution/UnifiedBookingSales/index.d.ts +25 -0
  59. package/lib/solution/UnifiedBookingSales/index.js +188 -0
  60. package/lib/solution/UnifiedBookingSales/types.d.ts +7 -0
  61. package/package.json +1 -1
@@ -579,6 +579,10 @@ export interface LoadSalesDetailParams {
579
579
  * 存在时 loadSalesDetail 会跳过远端 lookup,直接复用 hydrate 后半段逻辑。
580
580
  */
581
581
  preloadedSalesDetail?: Record<string, any>;
582
+ /**
583
+ * sessionStorage 快照复用详情 hydrate 时使用;不带该值时保持既有编辑订单语义。
584
+ */
585
+ hydrateSource?: 'sessionStorage';
582
586
  forceRemote?: boolean;
583
587
  merge?: boolean;
584
588
  }
@@ -749,8 +753,15 @@ export interface OrderModuleAPI {
749
753
  removeProductFromOrder: (identity: OrderProductIdentity, options?: RemoveProductsFromOrderOptions) => Promise<OrderProduct[]>;
750
754
  /** 批量删除购物车行,末尾仅触发一次促销重算与 summary 刷新 */
751
755
  removeProductsFromOrder: (identities: OrderProductIdentity[], options?: RemoveProductsFromOrderOptions) => Promise<OrderProduct[]>;
752
- /** @deprecated no-op;OrderModule 不再负责 tempOrder localStorage 持久化。 */
756
+ /** 在显式开启时保存当前 tempOrder sessionStorage 会话快照。 */
753
757
  persistTempOrder: () => void;
758
+ /**
759
+ * 删除当前 cacheId 的 tempOrder 会话快照,并阻止当前模块实例再次写入。
760
+ * 新模块实例初始化时会按 otherParams 重新启用持久化。
761
+ */
762
+ clearSessionStoragePersistedTempOrder: () => void;
763
+ /** 取出一次待恢复的 sessionStorage tempOrder 快照。 */
764
+ consumeSessionStorageRestore: () => Record<string, any> | null;
754
765
  /**
755
766
  * 控制 IndexedDB 草稿(saveDraft)开关;localStorage tempOrder 持久化已废弃。
756
767
  * BigSale 弹窗等场景传 false 可跳过 saveDraft。
@@ -808,6 +819,7 @@ export interface OrderModuleAPI {
808
819
  saveDraft: () => Promise<void>;
809
820
  hydrateTempOrderFromRecord: (record: Record<string, any>, options?: {
810
821
  recalcOnHydrate?: boolean;
822
+ source?: 'salesDetail' | 'sessionStorage';
811
823
  }) => Promise<OrderTempOrder>;
812
824
  syncPaymentsToOrder: <T = any>(params: SyncPaymentsToOrderParams) => Promise<SyncPaymentsToOrderResult<T>>;
813
825
  getSalesOrderByLookup: (params: SalesOrderLookupParams) => Promise<any>;
@@ -24,6 +24,16 @@ export interface NormalizeOrderCollectionsResult<T> {
24
24
  stats: Record<OrderCollectionKind, OrderCollectionIdentityStats>;
25
25
  uidRemaps: OrderCollectionUidRemap[];
26
26
  }
27
+ export interface ProductLineIdentityRepair {
28
+ index: number;
29
+ from: string;
30
+ to: string;
31
+ }
32
+ export interface RepairDuplicateProductLineIdentitiesResult<T> {
33
+ products: T[];
34
+ productsByUid?: Record<string, Record<string, any>>;
35
+ repairs: ProductLineIdentityRepair[];
36
+ }
27
37
  export declare function createUuidV4(): string;
28
38
  export declare function isBlankOrderCollectionIdentity(value: unknown): boolean;
29
39
  export declare function getOrderCollectionPersistentId(kind: OrderCollectionKind, item: unknown): string | null;
@@ -31,6 +41,11 @@ export declare function getOrderCollectionUid(kind: OrderCollectionKind, item: u
31
41
  export declare function buildOrderCollectionFallbackUid(kind: OrderCollectionKind, persistentId: string | number): string;
32
42
  export declare function getOrderCollectionReferenceUid(kind: OrderCollectionKind, item: unknown): string | null;
33
43
  export declare function setOrderCollectionUid<T>(kind: OrderCollectionKind, item: T, uid: string): T;
44
+ /**
45
+ * Rules 会把同一商品按商品券拆成多条真实订单行。拆行结果会继承原商品 UID,
46
+ * 因此必须在通用 collection normalization 之前为后续行派生稳定身份,避免被折叠。
47
+ */
48
+ export declare function repairDuplicateProductLineIdentities<T extends Record<string, any>>(products: T[] | null | undefined, productsByUid?: Record<string, Record<string, any>> | null): RepairDuplicateProductLineIdentitiesResult<T>;
34
49
  /**
35
50
  * 持久化行 ID 是服务端事实主键;只有至少一侧尚未持久化时,才允许用 runtime UID 对齐。
36
51
  */
@@ -74,6 +74,81 @@ export function setOrderCollectionUid(kind, item, uid) {
74
74
  delete record[uidField];
75
75
  return record;
76
76
  }
77
+ function getGoodPassResourceId(product) {
78
+ var _ref, _ref2, _goodPass$discount$re, _goodPass$discount;
79
+ var goodPass = (product.discount_list || []).find(function (item) {
80
+ var _item$discount, _item$discount2;
81
+ var type = (item === null || item === void 0 ? void 0 : item.type) || (item === null || item === void 0 ? void 0 : item.tag) || (item === null || item === void 0 || (_item$discount = item.discount) === null || _item$discount === void 0 ? void 0 : _item$discount.type) || (item === null || item === void 0 || (_item$discount2 = item.discount) === null || _item$discount2 === void 0 ? void 0 : _item$discount2.tag);
82
+ return type === 'good_pass';
83
+ });
84
+ if (!goodPass) return null;
85
+ var resourceId = (_ref = (_ref2 = (_goodPass$discount$re = (_goodPass$discount = goodPass.discount) === null || _goodPass$discount === void 0 ? void 0 : _goodPass$discount.resource_id) !== null && _goodPass$discount$re !== void 0 ? _goodPass$discount$re : goodPass.resource_id) !== null && _ref2 !== void 0 ? _ref2 : goodPass.discount_id) !== null && _ref !== void 0 ? _ref : goodPass.id;
86
+ return isBlankOrderCollectionIdentity(resourceId) ? null : String(resourceId);
87
+ }
88
+ function buildSplitProductUid(originalUid, product, duplicateOrdinal) {
89
+ var encodedOriginalUid = encodeURIComponent(originalUid);
90
+ var resourceId = getGoodPassResourceId(product);
91
+ if (resourceId) {
92
+ return "os-split:product:".concat(encodedOriginalUid, ":good-pass:").concat(encodeURIComponent(resourceId), ":").concat(duplicateOrdinal);
93
+ }
94
+ return "os-split:product:".concat(encodedOriginalUid, ":duplicate:").concat(duplicateOrdinal);
95
+ }
96
+
97
+ /**
98
+ * Rules 会把同一商品按商品券拆成多条真实订单行。拆行结果会继承原商品 UID,
99
+ * 因此必须在通用 collection normalization 之前为后续行派生稳定身份,避免被折叠。
100
+ */
101
+ export function repairDuplicateProductLineIdentities(products, productsByUid) {
102
+ var repairedProducts = cloneDeep(products || []);
103
+ var repairedProductsByUid = productsByUid ? cloneDeep(productsByUid) : undefined;
104
+ var occupiedUids = new Set(repairedProducts.map(function (product) {
105
+ return getOrderCollectionUid('product', product);
106
+ }).filter(function (uid) {
107
+ return Boolean(uid);
108
+ }));
109
+ Object.keys(repairedProductsByUid || {}).forEach(function (uid) {
110
+ return occupiedUids.add(uid);
111
+ });
112
+ var occurrences = new Map();
113
+ var repairs = [];
114
+ repairedProducts.forEach(function (product, index) {
115
+ var originalUid = getOrderCollectionUid('product', product);
116
+ if (!originalUid) return;
117
+ var occurrence = (occurrences.get(originalUid) || 0) + 1;
118
+ occurrences.set(originalUid, occurrence);
119
+ if (occurrence === 1) return;
120
+ var duplicateOrdinal = occurrence - 1;
121
+ var baseCandidate = buildSplitProductUid(originalUid, product, duplicateOrdinal);
122
+ var nextUid = baseCandidate;
123
+ var conflictOrdinal = 1;
124
+ while (occupiedUids.has(nextUid)) {
125
+ nextUid = "".concat(baseCandidate, ":conflict:").concat(conflictOrdinal);
126
+ conflictOrdinal += 1;
127
+ }
128
+ var repairedProduct = setOrderCollectionUid('product', product, nextUid);
129
+ repairedProduct.identity_key = nextUid;
130
+ repairedProducts[index] = repairedProduct;
131
+ occupiedUids.add(nextUid);
132
+ repairs.push({
133
+ index: index,
134
+ from: originalUid,
135
+ to: nextUid
136
+ });
137
+ var runtimeSource = repairedProductsByUid === null || repairedProductsByUid === void 0 ? void 0 : repairedProductsByUid[originalUid];
138
+ if (runtimeSource && repairedProductsByUid) {
139
+ repairedProductsByUid[nextUid] = _objectSpread(_objectSpread({}, cloneDeep(runtimeSource)), runtimeSource.rowKey !== undefined ? {
140
+ rowKey: nextUid
141
+ } : {});
142
+ }
143
+ });
144
+ return _objectSpread(_objectSpread({
145
+ products: repairedProducts
146
+ }, repairedProductsByUid ? {
147
+ productsByUid: repairedProductsByUid
148
+ } : {}), {}, {
149
+ repairs: repairs
150
+ });
151
+ }
77
152
 
78
153
  /**
79
154
  * 持久化行 ID 是服务端事实主键;只有至少一侧尚未持久化时,才允许用 runtime UID 对齐。
@@ -1401,7 +1401,6 @@ export function productRequiresFormSubject(tempOrder, product) {
1401
1401
  }
1402
1402
  export function resolveIsFormSubject(tempOrder, product) {
1403
1403
  var _tempOrder$holder;
1404
- debugger;
1405
1404
  // 旧版预约维度的 holder 类型仍然生效;新版则从当前商品 holder_config 判断。
1406
1405
  if ((tempOrder === null || tempOrder === void 0 || (_tempOrder$holder = tempOrder.holder) === null || _tempOrder$holder === void 0 ? void 0 : _tempOrder$holder.type) === 'form') return true;
1407
1406
  if (product) return productRequiresFormSubject(tempOrder, product);
@@ -41,6 +41,10 @@ export declare class PaymentModule extends BaseModule implements Module, Payment
41
41
  * paymentModule.updateOtherParams({ fatherModule: 'bookingTicket' });
42
42
  */
43
43
  updateOtherParams(params: Record<string, any>): void;
44
+ /**
45
+ * 获取标准化后的宿主平台标识,供支付子能力做平台边界判断。
46
+ */
47
+ getPlatform(): string;
44
48
  private getPaymentNumberAppData;
45
49
  /**
46
50
  * 记录信息日志
@@ -231,6 +231,16 @@ export var PaymentModule = /*#__PURE__*/function (_BaseModule) {
231
231
  value: function updateOtherParams(params) {
232
232
  this.otherParams = params || {};
233
233
  }
234
+
235
+ /**
236
+ * 获取标准化后的宿主平台标识,供支付子能力做平台边界判断。
237
+ */
238
+ }, {
239
+ key: "getPlatform",
240
+ value: function getPlatform() {
241
+ var _this$otherParams;
242
+ return String(((_this$otherParams = this.otherParams) === null || _this$otherParams === void 0 ? void 0 : _this$otherParams.platform) || '').trim().toLowerCase();
243
+ }
234
244
  }, {
235
245
  key: "getPaymentNumberAppData",
236
246
  value: function getPaymentNumberAppData(key) {
@@ -247,10 +257,10 @@ export var PaymentModule = /*#__PURE__*/function (_BaseModule) {
247
257
  }, {
248
258
  key: "logInfo",
249
259
  value: function logInfo(title, metadata) {
250
- var _this$otherParams;
251
- if ((_this$otherParams = this.otherParams) !== null && _this$otherParams !== void 0 && _this$otherParams.fatherModule) {
252
- var _this$otherParams2;
253
- var fatherModule = this.core.getModule((_this$otherParams2 = this.otherParams) === null || _this$otherParams2 === void 0 ? void 0 : _this$otherParams2.fatherModule);
260
+ var _this$otherParams2;
261
+ if ((_this$otherParams2 = this.otherParams) !== null && _this$otherParams2 !== void 0 && _this$otherParams2.fatherModule) {
262
+ var _this$otherParams3;
263
+ var fatherModule = this.core.getModule((_this$otherParams3 = this.otherParams) === null || _this$otherParams3 === void 0 ? void 0 : _this$otherParams3.fatherModule);
254
264
  if (fatherModule) {
255
265
  fatherModule.logInfo("".concat(title), metadata);
256
266
  return;
@@ -5,15 +5,15 @@ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArra
5
5
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
6
6
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
7
7
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
8
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
9
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
10
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
8
11
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
9
12
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
10
13
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
11
14
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
12
15
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
13
16
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
14
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
15
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
16
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
17
17
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
18
18
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
19
19
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
@@ -104,6 +104,26 @@ function mergeWalletAssets() {
104
104
  });
105
105
  return merged;
106
106
  }
107
+
108
+ /**
109
+ * 聚合接口不保证 recalculate_list 顺序;派生抵扣额依赖选择顺序,
110
+ * 因此已选资产必须先恢复为 selectedIds 的顺序再进入策略计算。
111
+ */
112
+ function orderWalletAssetsByIds(assets, orderedIds) {
113
+ var assetByKey = new Map(assets.map(function (asset) {
114
+ return [getWalletAssetKey(asset), asset];
115
+ }));
116
+ var orderedKeys = new Set(orderedIds.map(function (id) {
117
+ return String(id);
118
+ }));
119
+ return [].concat(_toConsumableArray(orderedIds.map(function (id) {
120
+ return assetByKey.get(String(id));
121
+ }).filter(function (asset) {
122
+ return asset !== undefined;
123
+ })), _toConsumableArray(assets.filter(function (asset) {
124
+ return !orderedKeys.has(getWalletAssetKey(asset));
125
+ })));
126
+ }
107
127
  function createInitialWalletAssetsState() {
108
128
  return {
109
129
  status: 'idle',
@@ -620,7 +640,6 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
620
640
  vouchers: allList
621
641
  });
622
642
  recommended = res.recommended, transformList = res.transformList, noApplicableVoucher = res.noApplicableVoucher, recommendedAmount = res.recommendedAmount;
623
- console.log(res, 'resres12');
624
643
  this.walletRecommendList = recommended;
625
644
 
626
645
  // 存储初始化数据到内存中,供 useWalletPass 使用
@@ -640,19 +659,19 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
640
659
  noApplicableVoucher: noApplicableVoucher,
641
660
  products: products || []
642
661
  });
643
- case 20:
644
- _context3.prev = 20;
662
+ case 19:
663
+ _context3.prev = 19;
645
664
  _context3.t0 = _context3["catch"](0);
646
665
  this.paymentModule.logError('[WalletPass] 初始化钱包数据失败', _context3.t0, {
647
666
  customer_id: baseParams.customer_id,
648
667
  order_expect_amount: baseParams.order_expect_amount
649
668
  });
650
669
  throw _context3.t0;
651
- case 24:
670
+ case 23:
652
671
  case "end":
653
672
  return _context3.stop();
654
673
  }
655
- }, _callee3, this, [[0, 20]]);
674
+ }, _callee3, this, [[0, 19]]);
656
675
  }));
657
676
  function initializeWalletDataAsync(_x3) {
658
677
  return _initializeWalletDataAsync.apply(this, arguments);
@@ -669,7 +688,7 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
669
688
  value: (function () {
670
689
  var _aggregateRecalculateWalletAssetsAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(businessData, selectedIds) {
671
690
  var _this$paymentModule$w7, _this$paymentModule$w8;
672
- var walletParams, customerId, requestParams, response, responseData, hasAggregateLists, recalculateList, customerWalletPassList, allList, walletPassEvaluator, evaluated, returnedSelectedKeys, authoritativeSelectedIds;
691
+ var walletParams, customerId, requestParams, response, responseData, hasAggregateLists, recalculateList, customerWalletPassList, orderedRecalculateList, allList, walletPassEvaluator, evaluated, returnedSelectedKeys, authoritativeSelectedIds;
673
692
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
674
693
  while (1) switch (_context4.prev = _context4.next) {
675
694
  case 0:
@@ -705,7 +724,8 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
705
724
  case 11:
706
725
  recalculateList = Array.isArray(responseData === null || responseData === void 0 ? void 0 : responseData.recalculate_list) ? responseData.recalculate_list : [];
707
726
  customerWalletPassList = Array.isArray(responseData === null || responseData === void 0 ? void 0 : responseData.customer_wallet_pass_list) ? responseData.customer_wallet_pass_list : [];
708
- allList = mergeWalletAssets(recalculateList, customerWalletPassList);
727
+ orderedRecalculateList = orderWalletAssetsByIds(recalculateList, selectedIds);
728
+ allList = mergeWalletAssets(orderedRecalculateList, customerWalletPassList);
709
729
  walletPassEvaluator = (_this$paymentModule$w7 = this.paymentModule.window) === null || _this$paymentModule$w7 === void 0 || (_this$paymentModule$w8 = _this$paymentModule$w7.getWalletPassEvaluator) === null || _this$paymentModule$w8 === void 0 ? void 0 : _this$paymentModule$w8.call(_this$paymentModule$w7);
710
730
  evaluated = walletPassEvaluator !== null && walletPassEvaluator !== void 0 && walletPassEvaluator.getRecommendedVouchers ? walletPassEvaluator.getRecommendedVouchers({
711
731
  orderTotalAmount: walletParams.order_wait_pay_amount,
@@ -749,7 +769,7 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
749
769
  products: walletParams.products || [],
750
770
  authoritativeSelectedIds: authoritativeSelectedIds
751
771
  });
752
- case 24:
772
+ case 25:
753
773
  case "end":
754
774
  return _context4.stop();
755
775
  }
@@ -831,7 +851,7 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
831
851
  key: "getUserIdentificationCodeListAsync",
832
852
  value: function () {
833
853
  var _getUserIdentificationCodeListAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(params) {
834
- var _newParams$products, _newParams$prepare_pa, _this$walletParams4, newParams, response, sortedData;
854
+ var _newParams$products, _newParams$prepare_pa, _this$walletParams4, newParams, platform, response, sortedData;
835
855
  return _regeneratorRuntime().wrap(function _callee6$(_context6) {
836
856
  while (1) switch (_context6.prev = _context6.next) {
837
857
  case 0:
@@ -844,6 +864,20 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
844
864
  this.paymentModule.logInfo('[WalletPass] 商品列表为空,跳过获取用户识别码列表');
845
865
  return _context6.abrupt("return", []);
846
866
  case 5:
867
+ platform = this.paymentModule.getPlatform();
868
+ if (!(platform === 'pc' || platform === 'h5')) {
869
+ _context6.next = 11;
870
+ break;
871
+ }
872
+ this.userIdentificationCodes = [];
873
+ this.emitEvent(WalletPassHooks.OnUserIdentificationCodesUpdated, {
874
+ userIdentificationCodes: []
875
+ });
876
+ this.paymentModule.logInfo('[WalletPass] 用户端平台跳过获取用户识别码列表', {
877
+ platform: platform
878
+ });
879
+ return _context6.abrupt("return", []);
880
+ case 11:
847
881
  if (typeof newParams.payment_order_id === 'string' && newParams.payment_order_id.startsWith('LOCAL_')) {
848
882
  newParams.payment_order_id = undefined;
849
883
  }
@@ -854,9 +888,9 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
854
888
  filter_prepare_wallet_pass: newParams.filter_prepare_wallet_pass,
855
889
  payment_order_id: (_this$walletParams4 = this.walletParams) === null || _this$walletParams4 === void 0 ? void 0 : _this$walletParams4.payment_order_id
856
890
  });
857
- _context6.next = 9;
891
+ _context6.next = 15;
858
892
  return this.paymentModule.request.post('/machinecode/prepare/deduction', newParams);
859
- case 9:
893
+ case 15:
860
894
  response = _context6.sent;
861
895
  // 对获取到的数据进行排序,将错误码为 500100、500200、500300 的项目排到最后
862
896
  sortedData = sortUserIdentificationCodeList((response === null || response === void 0 ? void 0 : response.data) || []);
@@ -877,19 +911,19 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
877
911
  })
878
912
  });
879
913
  return _context6.abrupt("return", this.userIdentificationCodes);
880
- case 17:
881
- _context6.prev = 17;
914
+ case 23:
915
+ _context6.prev = 23;
882
916
  _context6.t0 = _context6["catch"](0);
883
917
  this.paymentModule.logError('[WalletPass] 获取用户识别码列表失败', _context6.t0, {
884
918
  customer_id: params.customer_id,
885
919
  available: params.available
886
920
  });
887
921
  return _context6.abrupt("return", []);
888
- case 21:
922
+ case 27:
889
923
  case "end":
890
924
  return _context6.stop();
891
925
  }
892
- }, _callee6, this, [[0, 17]]);
926
+ }, _callee6, this, [[0, 23]]);
893
927
  }));
894
928
  function getUserIdentificationCodeListAsync(_x7) {
895
929
  return _getUserIdentificationCodeListAsync.apply(this, arguments);
@@ -1195,11 +1195,26 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
1195
1195
  // 折扣卡会复用于整条商品行;商品券必须继续按单张拆分,不能复用该分支。
1196
1196
  var explicitlySelectedDiscountCard = explicitlySelectedDiscount && (explicitlySelectedDiscount.tag || explicitlySelectedDiscount.type) !== 'good_pass' ? explicitlySelectedDiscount : undefined;
1197
1197
 
1198
- // 没有显式选择时保持现有行为:扫码且已选中的折扣卡优先,否则使用自动排序第一项。
1198
+ // 商品数量等变化会触发无 discountId 的重算。只要当前行已应用的折扣卡仍在
1199
+ // applicableDiscounts 中,就应保留该行选择,避免被自动排序中力度更大的卡替换。
1200
+ var appliedDiscountCardIds = new Set((product.discount_list || []).filter(function (item) {
1201
+ return ['discount_card', 'product_discount_card'].includes((item === null || item === void 0 ? void 0 : item.tag) || (item === null || item === void 0 ? void 0 : item.type));
1202
+ }).map(function (item) {
1203
+ var _ref12, _item$discount$resour, _item$discount;
1204
+ return (_ref12 = (_item$discount$resour = item === null || item === void 0 || (_item$discount = item.discount) === null || _item$discount === void 0 ? void 0 : _item$discount.resource_id) !== null && _item$discount$resour !== void 0 ? _item$discount$resour : item === null || item === void 0 ? void 0 : item.resource_id) !== null && _ref12 !== void 0 ? _ref12 : item === null || item === void 0 ? void 0 : item.id;
1205
+ }).filter(function (id) {
1206
+ return id !== undefined && id !== null;
1207
+ }).map(String));
1208
+ var appliedDiscountCard = options !== null && options !== void 0 && options.scan ? undefined : applicableDiscounts.find(function (discount) {
1209
+ var discountType = discount.tag || discount.type;
1210
+ return discount.isSelected === true && ['discount_card', 'product_discount_card'].includes(discountType) && appliedDiscountCardIds.has(String(discount.id));
1211
+ });
1212
+
1213
+ // 优先级:本次显式选择 > 当前行既有选择 > 扫码选择 > 自动排序第一项。
1199
1214
  var scannedSelectedDiscountCard = applicableDiscounts.find(function (n) {
1200
1215
  return n.isScan && n.isSelected && (n.tag || n.type) !== 'good_pass';
1201
1216
  });
1202
- var selectedDiscountCard = explicitlySelectedDiscountCard || scannedSelectedDiscountCard;
1217
+ var selectedDiscountCard = explicitlySelectedDiscountCard || appliedDiscountCard || scannedSelectedDiscountCard;
1203
1218
  var selectedDiscount = explicitlySelectedDiscount || selectedDiscountCard || applicableDiscounts[0];
1204
1219
  var prioritizedApplicableDiscounts = explicitlySelectedDiscount && (explicitlySelectedDiscount.tag || explicitlySelectedDiscount.type) === 'good_pass' ? [explicitlySelectedDiscount].concat(_toConsumableArray(applicableDiscounts.filter(function (discount) {
1205
1220
  var discountType = discount.tag || discount.type;
@@ -1217,8 +1232,8 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
1217
1232
  isManualDiscount = typeof product.isManualDiscount === 'boolean' ? product.isManualDiscount : ((_product$discount_lis5 = product.discount_list) === null || _product$discount_lis5 === void 0 ? void 0 : _product$discount_lis5.some(function (item) {
1218
1233
  return item.type === 'product';
1219
1234
  })) || product.total != product.origin_total && (product.bundle || []).every(function (item) {
1220
- var _ref12;
1221
- return !((_ref12 = item.discount_list || []) !== null && _ref12 !== void 0 && _ref12.length);
1235
+ var _ref13;
1236
+ return !((_ref13 = item.discount_list || []) !== null && _ref13 !== void 0 && _ref13.length);
1222
1237
  }) && (!((_product$discount_lis6 = product.discount_list) !== null && _product$discount_lis6 !== void 0 && _product$discount_lis6.length) || ((_product11 = product) === null || _product11 === void 0 || (_product11 = _product11.discount_list) === null || _product11 === void 0 || (_product11$every = _product11.every) === null || _product11$every === void 0 ? void 0 : _product11$every.call(_product11, function (item) {
1223
1238
  return item.type === 'product';
1224
1239
  })));
@@ -1234,8 +1249,8 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
1234
1249
  isManualDiscount = typeof parentProduct.isManualDiscount === 'boolean' ? parentProduct.isManualDiscount : ((_parentProduct$discou = parentProduct.discount_list) === null || _parentProduct$discou === void 0 ? void 0 : _parentProduct$discou.some(function (item) {
1235
1250
  return item.type === 'product';
1236
1251
  })) || parentProduct.total != parentProduct.origin_total && (parentProduct.bundle || []).every(function (item) {
1237
- var _ref13;
1238
- return !((_ref13 = item.discount_list || []) !== null && _ref13 !== void 0 && _ref13.length);
1252
+ var _ref14;
1253
+ return !((_ref14 = item.discount_list || []) !== null && _ref14 !== void 0 && _ref14.length);
1239
1254
  }) && (!((_parentProduct$discou2 = parentProduct.discount_list) !== null && _parentProduct$discou2 !== void 0 && _parentProduct$discou2.length) || (parentProduct === null || parentProduct === void 0 || (_parentProduct$discou3 = parentProduct.discount_list) === null || _parentProduct$discou3 === void 0 || (_parentProduct$discou4 = _parentProduct$discou3.every) === null || _parentProduct$discou4 === void 0 ? void 0 : _parentProduct$discou4.call(_parentProduct$discou3, function (item) {
1240
1255
  return item.type === 'product';
1241
1256
  })));
@@ -1247,8 +1262,8 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
1247
1262
  var _product$discount_lis7;
1248
1263
  // 主商品:检查自己的 discount_list
1249
1264
  if (flatItem.type === 'main' && (_product$discount_lis7 = product.discount_list) !== null && _product$discount_lis7 !== void 0 && _product$discount_lis7.some(function (item) {
1250
- var _item$discount;
1251
- return ((_item$discount = item.discount) === null || _item$discount === void 0 ? void 0 : _item$discount.resource_id) === options.discountId;
1265
+ var _item$discount2;
1266
+ return ((_item$discount2 = item.discount) === null || _item$discount2 === void 0 ? void 0 : _item$discount2.resource_id) === options.discountId;
1252
1267
  })) {
1253
1268
  isManualDiscount = false;
1254
1269
  }
@@ -1256,11 +1271,11 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
1256
1271
  if (flatItem.type === 'bundle') {
1257
1272
  var _product$discount_lis8, _flatItem$parentProdu7;
1258
1273
  if ((_product$discount_lis8 = product.discount_list) !== null && _product$discount_lis8 !== void 0 && _product$discount_lis8.some(function (item) {
1259
- var _item$discount2;
1260
- return ((_item$discount2 = item.discount) === null || _item$discount2 === void 0 ? void 0 : _item$discount2.resource_id) === options.discountId;
1261
- }) || (_flatItem$parentProdu7 = flatItem.parentProduct) !== null && _flatItem$parentProdu7 !== void 0 && (_flatItem$parentProdu7 = _flatItem$parentProdu7.discount_list) !== null && _flatItem$parentProdu7 !== void 0 && _flatItem$parentProdu7.some(function (item) {
1262
1274
  var _item$discount3;
1263
1275
  return ((_item$discount3 = item.discount) === null || _item$discount3 === void 0 ? void 0 : _item$discount3.resource_id) === options.discountId;
1276
+ }) || (_flatItem$parentProdu7 = flatItem.parentProduct) !== null && _flatItem$parentProdu7 !== void 0 && (_flatItem$parentProdu7 = _flatItem$parentProdu7.discount_list) !== null && _flatItem$parentProdu7 !== void 0 && _flatItem$parentProdu7.some(function (item) {
1277
+ var _item$discount4;
1278
+ return ((_item$discount4 = item.discount) === null || _item$discount4 === void 0 ? void 0 : _item$discount4.resource_id) === options.discountId;
1264
1279
  })) {
1265
1280
  isManualDiscount = false;
1266
1281
  }
@@ -1272,8 +1287,8 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
1272
1287
  if (flatItem.type === 'main' && (_product$discount_lis9 = product.discount_list) !== null && _product$discount_lis9 !== void 0 && _product$discount_lis9.some(function (item) {
1273
1288
  var _options$selectedList2;
1274
1289
  return options === null || options === void 0 || (_options$selectedList2 = options.selectedList) === null || _options$selectedList2 === void 0 ? void 0 : _options$selectedList2.some(function (n) {
1275
- var _item$discount4;
1276
- return n.discountId === ((_item$discount4 = item.discount) === null || _item$discount4 === void 0 ? void 0 : _item$discount4.resource_id);
1290
+ var _item$discount5;
1291
+ return n.discountId === ((_item$discount5 = item.discount) === null || _item$discount5 === void 0 ? void 0 : _item$discount5.resource_id);
1277
1292
  });
1278
1293
  })) {
1279
1294
  isManualDiscount = false;
@@ -1284,14 +1299,14 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
1284
1299
  if ((_product$discount_lis10 = product.discount_list) !== null && _product$discount_lis10 !== void 0 && _product$discount_lis10.some(function (item) {
1285
1300
  var _options$selectedList3;
1286
1301
  return options === null || options === void 0 || (_options$selectedList3 = options.selectedList) === null || _options$selectedList3 === void 0 ? void 0 : _options$selectedList3.some(function (n) {
1287
- var _item$discount5;
1288
- return n.discountId === ((_item$discount5 = item.discount) === null || _item$discount5 === void 0 ? void 0 : _item$discount5.resource_id);
1302
+ var _item$discount6;
1303
+ return n.discountId === ((_item$discount6 = item.discount) === null || _item$discount6 === void 0 ? void 0 : _item$discount6.resource_id);
1289
1304
  });
1290
1305
  }) || (_flatItem$parentProdu8 = flatItem.parentProduct) !== null && _flatItem$parentProdu8 !== void 0 && (_flatItem$parentProdu8 = _flatItem$parentProdu8.discount_list) !== null && _flatItem$parentProdu8 !== void 0 && _flatItem$parentProdu8.some(function (item) {
1291
1306
  var _options$selectedList4;
1292
1307
  return options === null || options === void 0 || (_options$selectedList4 = options.selectedList) === null || _options$selectedList4 === void 0 ? void 0 : _options$selectedList4.some(function (n) {
1293
- var _item$discount6;
1294
- return n.discountId === ((_item$discount6 = item.discount) === null || _item$discount6 === void 0 ? void 0 : _item$discount6.resource_id);
1308
+ var _item$discount7;
1309
+ return n.discountId === ((_item$discount7 = item.discount) === null || _item$discount7 === void 0 ? void 0 : _item$discount7.resource_id);
1295
1310
  });
1296
1311
  })) {
1297
1312
  isManualDiscount = false;
@@ -1328,8 +1343,8 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
1328
1343
  discount_list: isManualDiscount ? _this4.resolveDiscountListForManualOverride(product.discount_list) : _this4.filterDiscountListByType(product.discount_list, 'promotion')
1329
1344
  }))]);
1330
1345
  } else {
1331
- var _ref14, _product$_promotion$f, _product12, _product$origin_total;
1332
- var total = product.inPromotion ? (_ref14 = (_product$_promotion$f = (_product12 = product) === null || _product12 === void 0 || (_product12 = _product12._promotion) === null || _product12 === void 0 ? void 0 : _product12.finalPrice) !== null && _product$_promotion$f !== void 0 ? _product$_promotion$f : product.origin_total) !== null && _ref14 !== void 0 ? _ref14 : product.total : (_product$origin_total = product.origin_total) !== null && _product$origin_total !== void 0 ? _product$origin_total : product.total;
1346
+ var _ref15, _product$_promotion$f, _product12, _product$origin_total;
1347
+ var total = product.inPromotion ? (_ref15 = (_product$_promotion$f = (_product12 = product) === null || _product12 === void 0 || (_product12 = _product12._promotion) === null || _product12 === void 0 ? void 0 : _product12.finalPrice) !== null && _product$_promotion$f !== void 0 ? _product$_promotion$f : product.origin_total) !== null && _ref15 !== void 0 ? _ref15 : product.total : (_product$origin_total = product.origin_total) !== null && _product$origin_total !== void 0 ? _product$origin_total : product.total;
1333
1348
  var main_product_selling_price = product.price;
1334
1349
  if ((product.discount_list || []).some(function (item) {
1335
1350
  return item.type === 'promotion';
@@ -2027,7 +2042,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
2027
2042
  } else {
2028
2043
  // 🔥 没有子商品被拆分,使用原有逻辑
2029
2044
  mainProductArr.forEach(function (mainProduct) {
2030
- var _ref16, _mainProductData$main, _mainProductData$disc, _mainProductData$disc2, _mainProductData$disc3;
2045
+ var _ref17, _mainProductData$main, _mainProductData$disc, _mainProductData$disc2, _mainProductData$disc3;
2031
2046
  var mainProductData = _this4.hooks.getProduct(mainProduct);
2032
2047
 
2033
2048
  // 重组bundle
@@ -2042,9 +2057,9 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
2042
2057
  } else {
2043
2058
  // 🔥 关键:拆分后的bundle item
2044
2059
  processedBundleItems.forEach(function (item) {
2045
- var _item$price, _ref15, _item$bundle_selling_;
2060
+ var _item$price, _ref16, _item$bundle_selling_;
2046
2061
  var nextBundlePrice = (_item$price = item.price) !== null && _item$price !== void 0 ? _item$price : bundleItem.price;
2047
- var nextBundleSellingPrice = (_ref15 = (_item$bundle_selling_ = item.bundle_selling_price) !== null && _item$bundle_selling_ !== void 0 ? _item$bundle_selling_ : item.price) !== null && _ref15 !== void 0 ? _ref15 : bundleItem.bundle_selling_price;
2062
+ var nextBundleSellingPrice = (_ref16 = (_item$bundle_selling_ = item.bundle_selling_price) !== null && _item$bundle_selling_ !== void 0 ? _item$bundle_selling_ : item.price) !== null && _ref16 !== void 0 ? _ref16 : bundleItem.bundle_selling_price;
2048
2063
  // 🔥 更新 discount_list 中的 num,使其与拆分后的 item.num 一致
2049
2064
  var updatedDiscountList = (item.discount_list || []).map(function (discount) {
2050
2065
  var _discount$metadata10;
@@ -2071,7 +2086,7 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
2071
2086
 
2072
2087
  // 主商品已经在前面的 setProduct 中应用过折扣;这里只替换 bundle,
2073
2088
  // 避免把主商品 discount_list 再扣一次。
2074
- var mainSellingPrice = (_ref16 = (_mainProductData$main = mainProductData.main_product_selling_price) !== null && _mainProductData$main !== void 0 ? _mainProductData$main : mainProductData.price) !== null && _ref16 !== void 0 ? _ref16 : 0;
2089
+ var mainSellingPrice = (_ref17 = (_mainProductData$main = mainProductData.main_product_selling_price) !== null && _mainProductData$main !== void 0 ? _mainProductData$main : mainProductData.price) !== null && _ref17 !== void 0 ? _ref17 : 0;
2075
2090
  var newTotal = Number(mainSellingPrice || 0);
2076
2091
  var newOriginTotal = Number(mainProductData.original_price || mainProductData.price || 0);
2077
2092
 
@@ -2220,14 +2235,14 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
2220
2235
  var ruleType = usageRules.type;
2221
2236
  // 套餐适用范围配置
2222
2237
  var packageScope = usageRules === null || usageRules === void 0 ? void 0 : usageRules.package_scope;
2223
- var _ref17 = packageScope || {},
2224
- scopeType = _ref17.type,
2225
- _ref17$exclude_bundle = _ref17.exclude_bundle_product_ids,
2226
- exclude_bundle_product_ids = _ref17$exclude_bundle === void 0 ? [] : _ref17$exclude_bundle,
2227
- _ref17$include_bundle = _ref17.include_bundle_product_ids,
2228
- include_bundle_product_ids = _ref17$include_bundle === void 0 ? [] : _ref17$include_bundle,
2229
- _ref17$filter = _ref17.filter,
2230
- filter = _ref17$filter === void 0 ? 0 : _ref17$filter;
2238
+ var _ref18 = packageScope || {},
2239
+ scopeType = _ref18.type,
2240
+ _ref18$exclude_bundle = _ref18.exclude_bundle_product_ids,
2241
+ exclude_bundle_product_ids = _ref18$exclude_bundle === void 0 ? [] : _ref18$exclude_bundle,
2242
+ _ref18$include_bundle = _ref18.include_bundle_product_ids,
2243
+ include_bundle_product_ids = _ref18$include_bundle === void 0 ? [] : _ref18$include_bundle,
2244
+ _ref18$filter = _ref18.filter,
2245
+ filter = _ref18$filter === void 0 ? 0 : _ref18$filter;
2231
2246
  var isMainProduct = flatItem.type === 'main'; // 单独购买
2232
2247
  var isBundleItem = flatItem.type === 'bundle'; // 套餐中购买
2233
2248
  var bundleMainProductId = (_flatItem$product = flatItem.product) === null || _flatItem$product === void 0 ? void 0 : _flatItem$product.product_id;
@@ -6005,9 +6005,7 @@ var Server = /*#__PURE__*/function () {
6005
6005
  checkoutData: checkoutData,
6006
6006
  order: pendingOrder,
6007
6007
  response: pendingResult,
6008
- requireFullyPaid: true,
6009
- // 自动小票固定使用 print_all 的收据类型 0,不随订单 type 改成券/手环类型 99。
6010
- isManualPrint: true
6008
+ requireFullyPaid: true
6011
6009
  });
6012
6010
  case 18:
6013
6011
  _context60.next = 20;
@@ -6093,9 +6091,8 @@ var Server = /*#__PURE__*/function () {
6093
6091
  checkoutData: syncResult.checkoutData,
6094
6092
  order: syncedOrder,
6095
6093
  response: syncResult.normalizedResponse,
6096
- requireFullyPaid: true,
6094
+ requireFullyPaid: true
6097
6095
  // print_all 的 type=0 是收据打印;不要沿用同步成功后的券/手环打印 type=99。
6098
- isManualPrint: true
6099
6096
  });
6100
6097
  case 16:
6101
6098
  return _context61.abrupt("return", response);
@@ -6370,7 +6367,7 @@ var Server = /*#__PURE__*/function () {
6370
6367
  value: function shouldAutoPrintCheckoutReceipt() {
6371
6368
  var _this$core$context2, _this$core$context2$g, _this$app17, _this$app17$getStorag;
6372
6369
  if (((_this$core$context2 = this.core.context) === null || _this$core$context2 === void 0 || (_this$core$context2$g = _this$core$context2.getPlatform) === null || _this$core$context2$g === void 0 ? void 0 : _this$core$context2$g.call(_this$core$context2)) !== 'android') return true;
6373
- return ((_this$app17 = this.app) === null || _this$app17 === void 0 || (_this$app17 = _this$app17.storage) === null || _this$app17 === void 0 || (_this$app17$getStorag = _this$app17.getStorage) === null || _this$app17$getStorag === void 0 ? void 0 : _this$app17$getStorag.call(_this$app17, AUTO_PRINT_STORAGE_KEY)) === 'true';
6370
+ return ((_this$app17 = this.app) === null || _this$app17 === void 0 || (_this$app17 = _this$app17.storage) === null || _this$app17 === void 0 || (_this$app17$getStorag = _this$app17.getStorage) === null || _this$app17$getStorag === void 0 ? void 0 : _this$app17$getStorag.call(_this$app17, AUTO_PRINT_STORAGE_KEY)) !== 'false';
6374
6371
  }
6375
6372
  }, {
6376
6373
  key: "shouldBuildSmallTicketData",
@@ -283,6 +283,7 @@ export declare class OrderModule extends BaseModule implements Module {
283
283
  * // => 'S-1001'
284
284
  */
285
285
  private getOrderStorageKey;
286
+ private getPersistedOrderStorageKey;
286
287
  private getOrderIdentityMatchKeys;
287
288
  private doOrdersShareIdentity;
288
289
  private findOrderIndexByIdentity;