@pisell/pisellos 2.3.50 → 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 (177) 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 +6 -8
  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/Payment/types.d.ts +8 -0
  13. package/dist/modules/Payment/walletpass.d.ts +7 -1
  14. package/dist/modules/Payment/walletpass.js +155 -45
  15. package/dist/modules/Product/types.d.ts +0 -1
  16. package/dist/modules/ProductList/index.js +14 -33
  17. package/dist/modules/Quotation/index.d.ts +1 -1
  18. package/dist/modules/Quotation/index.js +2 -2
  19. package/dist/modules/Rules/index.js +32 -56
  20. package/dist/modules/SalesSummary/index.js +13 -12
  21. package/dist/modules/SalesSummary/utils.js +7 -1
  22. package/dist/modules/ScanOrderLogger/index.d.ts +0 -2
  23. package/dist/modules/ScanOrderLogger/index.js +2 -15
  24. package/dist/modules/ScanOrderLogger/providers/feishu.js +27 -45
  25. package/dist/modules/ScanOrderLogger/types.d.ts +0 -1
  26. package/dist/modules/Schedule/index.d.ts +1 -3
  27. package/dist/modules/Schedule/index.js +16 -21
  28. package/dist/modules/Summary/utils.js +13 -38
  29. package/dist/modules/index.d.ts +0 -2
  30. package/dist/modules/index.js +1 -3
  31. package/dist/plugins/window.d.ts +0 -1
  32. package/dist/server/index.d.ts +0 -14
  33. package/dist/server/index.js +793 -907
  34. package/dist/server/modules/index.d.ts +1 -1
  35. package/dist/server/modules/order/index.d.ts +16 -0
  36. package/dist/server/modules/order/index.js +964 -776
  37. package/dist/server/modules/order/types.d.ts +14 -0
  38. package/dist/server/modules/order/types.js +6 -0
  39. package/dist/solution/BaseSales/index.d.ts +18 -13
  40. package/dist/solution/BaseSales/index.js +202 -178
  41. package/dist/solution/BaseSales/utils/cartPromotion.js +5 -3
  42. package/dist/solution/BookingByStep/index.d.ts +2 -17
  43. package/dist/solution/BookingByStep/index.js +215 -294
  44. package/dist/solution/BookingByStep/types.d.ts +1 -2
  45. package/dist/solution/BookingByStep/types.js +1 -3
  46. package/dist/solution/BookingByStep/utils/capacity.js +1 -17
  47. package/dist/solution/BookingByStep/utils/timeslots.d.ts +1 -3
  48. package/dist/solution/BookingByStep/utils/timeslots.js +12 -19
  49. package/dist/solution/BookingTicket/index.d.ts +1 -13
  50. package/dist/solution/BookingTicket/index.js +2 -2
  51. package/dist/solution/BookingTicket/types.d.ts +3 -0
  52. package/dist/solution/BookingTicket/utils/cartView.js +44 -32
  53. package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +1 -3
  54. package/dist/solution/BookingTicket/utils/scan/handleScan.js +2 -10
  55. package/dist/solution/Sales/index.d.ts +1 -0
  56. package/dist/solution/Sales/index.js +16 -2
  57. package/dist/solution/ScanOrder/index.d.ts +14 -26
  58. package/dist/solution/ScanOrder/index.js +739 -1142
  59. package/dist/solution/ScanOrder/types.d.ts +1 -21
  60. package/dist/solution/ScanOrder/utils.d.ts +0 -8
  61. package/dist/solution/ScanOrder/utils.js +25 -66
  62. package/dist/solution/ShopDiscount/index.d.ts +0 -1
  63. package/dist/solution/ShopDiscount/index.js +87 -125
  64. package/dist/solution/VenueBooking/index.d.ts +11 -39
  65. package/dist/solution/VenueBooking/index.js +841 -1167
  66. package/dist/solution/VenueBooking/types.d.ts +0 -3
  67. package/dist/solution/VenueBooking/utils/resource.js +0 -1
  68. package/dist/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
  69. package/dist/solution/VenueBooking/utils/slotMerge.js +5 -10
  70. package/dist/solution/index.d.ts +0 -1
  71. package/dist/solution/index.js +1 -2
  72. package/dist/types/index.d.ts +0 -1
  73. package/lib/model/strategy/adapter/promotion/index.js +0 -51
  74. package/lib/modules/BookingContext/utils/buildCacheItemFromOrderLine.js +3 -1
  75. package/lib/modules/Discount/index.d.ts +0 -1
  76. package/lib/modules/Discount/index.js +0 -9
  77. package/lib/modules/Discount/types.d.ts +0 -1
  78. package/lib/modules/OpenData/index.js +1 -1
  79. package/lib/modules/Order/index.d.ts +6 -8
  80. package/lib/modules/Order/index.js +89 -38
  81. package/lib/modules/Order/types.d.ts +21 -12
  82. package/lib/modules/Order/utils.d.ts +0 -10
  83. package/lib/modules/Order/utils.js +5 -36
  84. package/lib/modules/Payment/types.d.ts +8 -0
  85. package/lib/modules/Payment/walletpass.d.ts +7 -1
  86. package/lib/modules/Payment/walletpass.js +107 -9
  87. package/lib/modules/Product/types.d.ts +0 -1
  88. package/lib/modules/ProductList/index.js +31 -40
  89. package/lib/modules/Quotation/index.d.ts +1 -1
  90. package/lib/modules/Quotation/index.js +2 -2
  91. package/lib/modules/Rules/index.js +32 -44
  92. package/lib/modules/SalesSummary/index.js +7 -6
  93. package/lib/modules/SalesSummary/utils.js +5 -1
  94. package/lib/modules/ScanOrderLogger/index.d.ts +0 -2
  95. package/lib/modules/ScanOrderLogger/index.js +1 -13
  96. package/lib/modules/ScanOrderLogger/providers/feishu.js +6 -15
  97. package/lib/modules/ScanOrderLogger/types.d.ts +0 -1
  98. package/lib/modules/Schedule/index.d.ts +1 -3
  99. package/lib/modules/Schedule/index.js +8 -10
  100. package/lib/modules/Summary/utils.js +1 -21
  101. package/lib/modules/index.d.ts +0 -2
  102. package/lib/modules/index.js +1 -5
  103. package/lib/plugins/window.d.ts +0 -1
  104. package/lib/server/index.d.ts +0 -14
  105. package/lib/server/index.js +15 -72
  106. package/lib/server/modules/index.d.ts +1 -1
  107. package/lib/server/modules/order/index.d.ts +16 -0
  108. package/lib/server/modules/order/index.js +140 -4
  109. package/lib/server/modules/order/types.d.ts +14 -0
  110. package/lib/server/modules/order/types.js +1 -0
  111. package/lib/solution/BaseSales/index.d.ts +18 -13
  112. package/lib/solution/BaseSales/index.js +58 -35
  113. package/lib/solution/BaseSales/utils/cartPromotion.js +5 -2
  114. package/lib/solution/BookingByStep/index.d.ts +2 -17
  115. package/lib/solution/BookingByStep/index.js +18 -60
  116. package/lib/solution/BookingByStep/types.d.ts +1 -2
  117. package/lib/solution/BookingByStep/types.js +0 -5
  118. package/lib/solution/BookingByStep/utils/capacity.js +1 -20
  119. package/lib/solution/BookingByStep/utils/timeslots.d.ts +1 -3
  120. package/lib/solution/BookingByStep/utils/timeslots.js +11 -19
  121. package/lib/solution/BookingTicket/index.d.ts +1 -13
  122. package/lib/solution/BookingTicket/index.js +2 -10
  123. package/lib/solution/BookingTicket/types.d.ts +3 -0
  124. package/lib/solution/BookingTicket/utils/cartView.js +43 -30
  125. package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +1 -3
  126. package/lib/solution/BookingTicket/utils/scan/handleScan.js +2 -2
  127. package/lib/solution/Sales/index.d.ts +1 -0
  128. package/lib/solution/Sales/index.js +15 -3
  129. package/lib/solution/ScanOrder/index.d.ts +14 -26
  130. package/lib/solution/ScanOrder/index.js +182 -449
  131. package/lib/solution/ScanOrder/types.d.ts +1 -21
  132. package/lib/solution/ScanOrder/utils.d.ts +0 -8
  133. package/lib/solution/ScanOrder/utils.js +0 -31
  134. package/lib/solution/ShopDiscount/index.d.ts +0 -1
  135. package/lib/solution/ShopDiscount/index.js +0 -14
  136. package/lib/solution/VenueBooking/index.d.ts +11 -39
  137. package/lib/solution/VenueBooking/index.js +110 -322
  138. package/lib/solution/VenueBooking/types.d.ts +0 -3
  139. package/lib/solution/VenueBooking/utils/resource.js +0 -1
  140. package/lib/solution/VenueBooking/utils/slotMerge.d.ts +4 -4
  141. package/lib/solution/VenueBooking/utils/slotMerge.js +4 -6
  142. package/lib/solution/index.d.ts +0 -1
  143. package/lib/solution/index.js +1 -3
  144. package/lib/types/index.d.ts +0 -1
  145. package/package.json +1 -1
  146. package/dist/modules/Holder/index.d.ts +0 -48
  147. package/dist/modules/Holder/index.js +0 -640
  148. package/dist/modules/Holder/types.d.ts +0 -123
  149. package/dist/modules/Holder/types.js +0 -1
  150. package/dist/modules/Holder/utils.d.ts +0 -13
  151. package/dist/modules/Holder/utils.js +0 -34
  152. package/dist/modules/ResourcePlanner/index.d.ts +0 -24
  153. package/dist/modules/ResourcePlanner/index.js +0 -181
  154. package/dist/modules/ResourcePlanner/planner.d.ts +0 -14
  155. package/dist/modules/ResourcePlanner/planner.js +0 -1069
  156. package/dist/modules/ResourcePlanner/types.d.ts +0 -227
  157. package/dist/modules/ResourcePlanner/types.js +0 -1
  158. package/dist/solution/UnifiedBookingSales/index.d.ts +0 -183
  159. package/dist/solution/UnifiedBookingSales/index.js +0 -1891
  160. package/dist/solution/UnifiedBookingSales/types.d.ts +0 -143
  161. package/dist/solution/UnifiedBookingSales/types.js +0 -11
  162. package/lib/modules/Holder/index.d.ts +0 -48
  163. package/lib/modules/Holder/index.js +0 -402
  164. package/lib/modules/Holder/types.d.ts +0 -123
  165. package/lib/modules/Holder/types.js +0 -17
  166. package/lib/modules/Holder/utils.d.ts +0 -13
  167. package/lib/modules/Holder/utils.js +0 -71
  168. package/lib/modules/ResourcePlanner/index.d.ts +0 -24
  169. package/lib/modules/ResourcePlanner/index.js +0 -148
  170. package/lib/modules/ResourcePlanner/planner.d.ts +0 -14
  171. package/lib/modules/ResourcePlanner/planner.js +0 -933
  172. package/lib/modules/ResourcePlanner/types.d.ts +0 -227
  173. package/lib/modules/ResourcePlanner/types.js +0 -17
  174. package/lib/solution/UnifiedBookingSales/index.d.ts +0 -183
  175. package/lib/solution/UnifiedBookingSales/index.js +0 -1084
  176. package/lib/solution/UnifiedBookingSales/types.d.ts +0 -143
  177. package/lib/solution/UnifiedBookingSales/types.js +0 -33
@@ -321,6 +321,24 @@ export interface ReplaceTempOrderOptions {
321
321
  saveDraft?: boolean;
322
322
  }
323
323
  export type AddProductBookingInput = Record<string, any>;
324
+ /**
325
+ * 添加商品行时的顺序控制。
326
+ * 默认追加到 products 尾部;预约数量同步可插入到既有预约组的最新行之后,
327
+ * 避免步进器修改数量改变该组展示位置。
328
+ */
329
+ export interface AddProductToOrderOptions {
330
+ insertAfterProductUid?: string;
331
+ }
332
+ /**
333
+ * 删除商品后的可选位置保持策略。
334
+ * 预约合并行减量时仍删除最新真实行,再把剩余代表行移动到被删除代表行原位置。
335
+ */
336
+ export interface RemoveProductsFromOrderOptions {
337
+ preserveDisplayPosition?: {
338
+ remainingProductUid: string;
339
+ anchorProductUid: string;
340
+ };
341
+ }
324
342
  /** 更新购物车行:仅传 SKU 时命中同 SKU 第一行;多行同 SKU 须传 unique_identification_number / 选项指纹等 */
325
343
  export interface UpdateOrderProductParams {
326
344
  product_id: number | null;
@@ -396,7 +414,6 @@ export interface CommitOrderParams {
396
414
  type: 'virtual' | 'appointment_booking';
397
415
  platform?: string;
398
416
  extraData?: Record<string, any>;
399
- business_code?: string;
400
417
  };
401
418
  }
402
419
  export interface OrderSubmitBooking {
@@ -572,12 +589,6 @@ export interface SyncPaymentsToOrderParams {
572
589
  payments: OrderPaymentSource[];
573
590
  paymentStatus?: SubmitSalesOrderParams['query']['payment_status'];
574
591
  submitWhenPaid?: boolean;
575
- /**
576
- * Whether the checkout should be queued as the local `sync_sales` task.
577
- * Defaults to true to preserve the WebPOS retry path. Set to false when
578
- * the caller must wait for the cloud checkout response before proceeding.
579
- */
580
- checkoutSyncTaskEnabled?: boolean;
581
592
  smallTicketDataFlag?: number;
582
593
  businessCode?: string;
583
594
  channel?: string;
@@ -722,15 +733,15 @@ export interface OrderModuleAPI {
722
733
  updateTempOrderCustomer: (customer: UpdateTempOrderCustomerInput) => OrderSnapshot['customer'];
723
734
  updateTempOrderBuzzer: (buzzer: string) => string;
724
735
  updateTempOrderContactsInfo: (contactsInfo: Record<string, any> | null) => Record<string, any> | null;
725
- addProductToOrder: (product: Partial<OrderProduct> & OrderProductIdentity, booking?: AddProductBookingInput) => Promise<OrderProduct[]>;
736
+ addProductToOrder: (product: Partial<OrderProduct> & OrderProductIdentity, booking?: AddProductBookingInput, options?: AddProductToOrderOptions) => Promise<OrderProduct[]>;
726
737
  updateOrderProduct: (params: UpdateOrderProductParams) => Promise<OrderProduct[]>;
727
738
  /** 批量更新购物车行,末尾仅触发一次促销重算与 summary 刷新 */
728
739
  updateOrderProducts: (paramsList: UpdateOrderProductParams[]) => Promise<OrderProduct[]>;
729
740
  updateOrderProductQuantity: (params: UpdateOrderProductQuantityParams) => Promise<OrderProduct[]>;
730
741
  updateOrderBooking: (params: UpdateOrderBookingParams) => any[];
731
- removeProductFromOrder: (identity: OrderProductIdentity) => Promise<OrderProduct[]>;
742
+ removeProductFromOrder: (identity: OrderProductIdentity, options?: RemoveProductsFromOrderOptions) => Promise<OrderProduct[]>;
732
743
  /** 批量删除购物车行,末尾仅触发一次促销重算与 summary 刷新 */
733
- removeProductsFromOrder: (identities: OrderProductIdentity[]) => Promise<OrderProduct[]>;
744
+ removeProductsFromOrder: (identities: OrderProductIdentity[], options?: RemoveProductsFromOrderOptions) => Promise<OrderProduct[]>;
734
745
  /** @deprecated no-op;OrderModule 不再负责 tempOrder localStorage 持久化。 */
735
746
  persistTempOrder: () => void;
736
747
  /**
@@ -740,8 +751,6 @@ export interface OrderModuleAPI {
740
751
  setEnableTempOrderPersist: (enabled: boolean) => void;
741
752
  /** 是否允许 saveDraft 写入 IndexedDB 草稿。 */
742
753
  isTempOrderPersistEnabled: () => boolean;
743
- /** 提交 tempOrder 变更并触发 `{moduleName}:changed` 事件 */
744
- notifyTempOrderChanged: () => void;
745
754
  submitTempOrder: <T = any>(params?: {
746
755
  cacheId?: string;
747
756
  platform?: string;
@@ -63,6 +63,17 @@ export var OrderHooks = /*#__PURE__*/function (OrderHooks) {
63
63
  * 清空时整个 payload 为 null。
64
64
  */
65
65
 
66
+ /**
67
+ * 添加商品行时的顺序控制。
68
+ * 默认追加到 products 尾部;预约数量同步可插入到既有预约组的最新行之后,
69
+ * 避免步进器修改数量改变该组展示位置。
70
+ */
71
+
72
+ /**
73
+ * 删除商品后的可选位置保持策略。
74
+ * 预约合并行减量时仍删除最新真实行,再把剩余代表行移动到被删除代表行原位置。
75
+ */
76
+
66
77
  /** 更新购物车行:仅传 SKU 时命中同 SKU 第一行;多行同 SKU 须传 unique_identification_number / 选项指纹等 */
67
78
 
68
79
  /** 仅更新购物车行数量;行定位语义与 updateOrderProduct / removeProductFromOrder 保持一致 */
@@ -15,7 +15,6 @@ export interface OrderProductsDepositSummary {
15
15
  deposit_policy_ids: number[];
16
16
  hasDeposit: boolean;
17
17
  }
18
- import type { WindowPlugin } from '../../plugins';
19
18
  /**
20
19
  * 把"含 option 的主商品单价"与 bundle 合成"单行 composite 单价"。
21
20
  *
@@ -178,15 +177,6 @@ export declare const mergeRelationForms: (relationForms: {
178
177
  form_id: number;
179
178
  form_record_ids: number[];
180
179
  }[];
181
- export interface CartOrderHolder {
182
- customer_id?: number;
183
- form_id: number | string;
184
- form_record: (number | string)[] | null;
185
- }
186
- /**
187
- * 为购物车行补齐订单所需的 holder 信息(与 cartAccount 结构保持一致)
188
- */
189
- export declare function ensureCartItemOriginHolder(cartItem: CartItem, window?: WindowPlugin): void;
190
180
  export declare const getAllDiscountList: (cartItem: CartItem) => any;
191
181
  export { createUuidV4 };
192
182
  export declare function isTempOrder(data: any): data is OrderTempOrder;
@@ -20,7 +20,6 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
20
20
  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; }
21
21
  import dayjs from "dayjs";
22
22
  import Decimal from 'decimal.js';
23
- import { getProductHolderConfig } from "../Holder/utils";
24
23
  import { buildProductLineFingerprint, createEmptySummary } from "../../solution/ScanOrder/utils";
25
24
  import { createUuidV4 } from "./utils/orderCollectionIdentity";
26
25
  /**
@@ -745,41 +744,10 @@ export var mergeRelationForms = function mergeRelationForms(relationForms) {
745
744
  return item.form_record_ids.length > 0;
746
745
  }); // 过滤掉没有有效记录的表单
747
746
  };
748
- function getCustomerIdFromStorage(window) {
749
- try {
750
- var _window$getLocalStora;
751
- var customer = JSON.parse((window === null || window === void 0 || (_window$getLocalStora = window.getLocalStorage) === null || _window$getLocalStora === void 0 ? void 0 : _window$getLocalStora.call(window, 'customer')) || '{}');
752
- var customerId = Number(customer === null || customer === void 0 ? void 0 : customer.id);
753
- return Number.isFinite(customerId) && customerId > 0 ? customerId : undefined;
754
- } catch (_unused) {
755
- return undefined;
756
- }
757
- }
758
-
759
- /**
760
- * 为购物车行补齐订单所需的 holder 信息(与 cartAccount 结构保持一致)
761
- */
762
- export function ensureCartItemOriginHolder(cartItem, window) {
763
- var _cartItem$_origin, _cartItem$_productIni;
764
- if (cartItem !== null && cartItem !== void 0 && (_cartItem$_origin = cartItem._origin) !== null && _cartItem$_origin !== void 0 && _cartItem$_origin.holder) {
765
- return;
766
- }
767
- var holderConfig = getProductHolderConfig((_cartItem$_productIni = cartItem === null || cartItem === void 0 ? void 0 : cartItem._productInit) !== null && _cartItem$_productIni !== void 0 ? _cartItem$_productIni : cartItem === null || cartItem === void 0 ? void 0 : cartItem._productOrigin);
768
- var formRecordId = cartItem === null || cartItem === void 0 ? void 0 : cartItem.holder_id;
769
- if (!(holderConfig !== null && holderConfig !== void 0 && holderConfig.resource_id) || formRecordId == null) {
770
- return;
771
- }
772
- cartItem._origin.holder = {
773
- customer_id: getCustomerIdFromStorage(window),
774
- form_id: holderConfig.resource_id,
775
- form_record: [formRecordId]
776
- };
777
- }
778
- ;
779
747
  export var getAllDiscountList = function getAllDiscountList(cartItem) {
780
- var _cartItem$_origin2, _cartItem$_origin3;
781
- var discountList = (cartItem === null || cartItem === void 0 || (_cartItem$_origin2 = cartItem._origin) === null || _cartItem$_origin2 === void 0 || (_cartItem$_origin2 = _cartItem$_origin2.product) === null || _cartItem$_origin2 === void 0 ? void 0 : _cartItem$_origin2.discount_list) || [];
782
- ((cartItem === null || cartItem === void 0 || (_cartItem$_origin3 = cartItem._origin) === null || _cartItem$_origin3 === void 0 || (_cartItem$_origin3 = _cartItem$_origin3.product) === null || _cartItem$_origin3 === void 0 ? void 0 : _cartItem$_origin3.product_bundle) || []).forEach(function (item) {
748
+ var _cartItem$_origin, _cartItem$_origin2;
749
+ var discountList = (cartItem === null || cartItem === void 0 || (_cartItem$_origin = cartItem._origin) === null || _cartItem$_origin === void 0 || (_cartItem$_origin = _cartItem$_origin.product) === null || _cartItem$_origin === void 0 ? void 0 : _cartItem$_origin.discount_list) || [];
750
+ ((cartItem === null || cartItem === void 0 || (_cartItem$_origin2 = cartItem._origin) === null || _cartItem$_origin2 === void 0 || (_cartItem$_origin2 = _cartItem$_origin2.product) === null || _cartItem$_origin2 === void 0 ? void 0 : _cartItem$_origin2.product_bundle) || []).forEach(function (item) {
783
751
  discountList = [].concat(_toConsumableArray(discountList), _toConsumableArray((item === null || item === void 0 ? void 0 : item.discount_list) || []));
784
752
  item.discount_list = undefined;
785
753
  });
@@ -397,12 +397,18 @@ export interface WalletAssetsState {
397
397
  export interface WalletAssetsSnapshot {
398
398
  state: WalletAssetsState;
399
399
  searchResults: SearchIdentificationCodeItem[];
400
+ /** 已搜索但尚未满足订单条件、等待首次可用后自动选中的 Wallet Asset code。 */
401
+ pendingAutoSelectSearchCodes?: string[];
400
402
  walletParams: WalletDeductionRecommendParams | null;
401
403
  calculationContext: {
402
404
  orderTotalAmount: number;
403
405
  products: any[];
404
406
  };
405
407
  }
408
+ export interface WalletAssetsBehaviorOptions {
409
+ /** 搜索到 Wallet Asset 后,当前或后续首次可用时是否自动选中。 */
410
+ autoSelectAfterSearch?: boolean;
411
+ }
406
412
  export interface RefreshWalletAssetsOptions {
407
413
  /** 商品/金额变化默认保留并重验选择;客户变化由实现层强制清空。 */
408
414
  preserveSelection?: boolean;
@@ -472,6 +478,8 @@ export interface WalletPassPayment {
472
478
  refreshWalletAssetsFromBusinessAsync: (businessData: WalletInitBusinessData, options?: RefreshWalletAssetsOptions) => Promise<WalletAssetsState>;
473
479
  /** 获取共享钱包资产状态快照。 */
474
480
  getWalletAssetsState: () => WalletAssetsState;
481
+ /** 配置仅影响 Wallet Assets 的交互行为。 */
482
+ configureWalletAssetsBehavior: (options: WalletAssetsBehaviorOptions) => void;
475
483
  /** 导出供 Shared Checkout 跨运行时传递的 Wallet Assets 快照。 */
476
484
  exportWalletAssetsSnapshot: () => WalletAssetsSnapshot;
477
485
  /** 恢复 Shared Checkout 传回的 Wallet Assets 快照。 */
@@ -1,4 +1,4 @@
1
- import { WalletPassPayment, WalletDeductionRecommendParams, WalletRecommendItem, UserIdentificationCodeParams, UserIdentificationCodeItem, SearchIdentificationCodeParams, SearchIdentificationCodeItem, SearchIdentificationCodeResult, WalletInitBusinessData, WalletAssetId, WalletAssetsSnapshot, WalletAssetsState, RefreshWalletAssetsOptions, SelectWalletAssetOptions, ScanWalletAssetResult } from './types';
1
+ import { WalletPassPayment, WalletDeductionRecommendParams, WalletRecommendItem, UserIdentificationCodeParams, UserIdentificationCodeItem, SearchIdentificationCodeParams, SearchIdentificationCodeItem, SearchIdentificationCodeResult, WalletInitBusinessData, WalletAssetId, WalletAssetsBehaviorOptions, WalletAssetsSnapshot, WalletAssetsState, RefreshWalletAssetsOptions, SelectWalletAssetOptions, ScanWalletAssetResult } from './types';
2
2
  import type { PaymentModule } from './index';
3
3
  /**
4
4
  * 钱包支付实现
@@ -12,8 +12,11 @@ export declare class WalletPassPaymentImpl implements WalletPassPayment {
12
12
  private walletInitData;
13
13
  private walletAssetsState;
14
14
  private walletAssetsRequestSequence;
15
+ private walletAssetsBehavior;
16
+ private pendingAutoSelectSearchCodes;
15
17
  private walletAssetsCalculationContext;
16
18
  constructor(paymentModule: PaymentModule);
19
+ configureWalletAssetsBehavior(options: WalletAssetsBehaviorOptions): void;
17
20
  /**
18
21
  * 发送事件的辅助方法
19
22
  * 支持使用WalletPassHooks或PaymentHooks
@@ -28,6 +31,9 @@ export declare class WalletPassPaymentImpl implements WalletPassPayment {
28
31
  * 接口暂时缺失某个扫码 code 时继续保留旧值,避免列表闪空。
29
32
  */
30
33
  private syncSearchedWalletAssets;
34
+ private isPendingAutoSelectAsset;
35
+ private clearPendingAutoSelectForAsset;
36
+ private queuePendingAutoSelectForAssets;
31
37
  /**
32
38
  * 生成钱包API默认参数
33
39
  * 根据业务数据生成标准的钱包API参数,并存储在模块中
@@ -39,6 +39,12 @@ function matchesWalletAssetCode(asset, normalizedCode) {
39
39
  return String(identifier !== null && identifier !== void 0 ? identifier : '').trim() === normalizedCode;
40
40
  });
41
41
  }
42
+ function normalizeWalletAssetCode(code) {
43
+ return String(code !== null && code !== void 0 ? code : '').trim().toUpperCase();
44
+ }
45
+ function getWalletAssetCodeKeys(asset) {
46
+ return [asset === null || asset === void 0 ? void 0 : asset.code, asset === null || asset === void 0 ? void 0 : asset.encoded].map(normalizeWalletAssetCode).filter(Boolean);
47
+ }
42
48
  function isWalletAssetAvailable(asset) {
43
49
  if (!asset) return false;
44
50
  if (asset.unified_available_status !== undefined && Number(asset.unified_available_status) !== 1) {
@@ -102,18 +108,31 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
102
108
  _defineProperty(this, "walletInitData", null);
103
109
  _defineProperty(this, "walletAssetsState", createInitialWalletAssetsState());
104
110
  _defineProperty(this, "walletAssetsRequestSequence", 0);
111
+ _defineProperty(this, "walletAssetsBehavior", {
112
+ autoSelectAfterSearch: true
113
+ });
114
+ _defineProperty(this, "pendingAutoSelectSearchCodes", new Set());
105
115
  _defineProperty(this, "walletAssetsCalculationContext", {
106
116
  orderTotalAmount: 0,
107
117
  products: []
108
118
  });
109
119
  this.paymentModule = paymentModule;
110
120
  }
111
-
112
- /**
113
- * 发送事件的辅助方法
114
- * 支持使用WalletPassHooks或PaymentHooks
115
- */
116
121
  _createClass(WalletPassPaymentImpl, [{
122
+ key: "configureWalletAssetsBehavior",
123
+ value: function configureWalletAssetsBehavior(options) {
124
+ if (options.autoSelectAfterSearch === undefined) return;
125
+ this.walletAssetsBehavior.autoSelectAfterSearch = options.autoSelectAfterSearch;
126
+ if (!options.autoSelectAfterSearch) {
127
+ this.pendingAutoSelectSearchCodes.clear();
128
+ }
129
+ }
130
+
131
+ /**
132
+ * 发送事件的辅助方法
133
+ * 支持使用WalletPassHooks或PaymentHooks
134
+ */
135
+ }, {
117
136
  key: "emitEvent",
118
137
  value: function emitEvent(hook, data) {
119
138
  try {
@@ -250,6 +269,33 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
250
269
  }
251
270
  return mergeWalletAssets(cachedAssets, refreshedAssets);
252
271
  }
272
+ }, {
273
+ key: "isPendingAutoSelectAsset",
274
+ value: function isPendingAutoSelectAsset(asset) {
275
+ var _this = this;
276
+ return getWalletAssetCodeKeys(asset).some(function (code) {
277
+ return _this.pendingAutoSelectSearchCodes.has(code);
278
+ });
279
+ }
280
+ }, {
281
+ key: "clearPendingAutoSelectForAsset",
282
+ value: function clearPendingAutoSelectForAsset(asset) {
283
+ var _this2 = this;
284
+ getWalletAssetCodeKeys(asset).forEach(function (code) {
285
+ _this2.pendingAutoSelectSearchCodes.delete(code);
286
+ });
287
+ }
288
+ }, {
289
+ key: "queuePendingAutoSelectForAssets",
290
+ value: function queuePendingAutoSelectForAssets(assets) {
291
+ var _this3 = this;
292
+ if (!this.walletAssetsBehavior.autoSelectAfterSearch) return;
293
+ assets.forEach(function (asset) {
294
+ getWalletAssetCodeKeys(asset).forEach(function (code) {
295
+ _this3.pendingAutoSelectSearchCodes.add(code);
296
+ });
297
+ });
298
+ }
253
299
 
254
300
  /**
255
301
  * 生成钱包API默认参数
@@ -960,7 +1006,8 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
960
1006
  key: "refreshWalletAssetsFromBusinessAsync",
961
1007
  value: (function () {
962
1008
  var _refreshWalletAssetsFromBusinessAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(businessData) {
963
- var _businessData$product2;
1009
+ var _businessData$product2,
1010
+ _this4 = this;
964
1011
  var options,
965
1012
  requestSequence,
966
1013
  nextCustomerId,
@@ -971,6 +1018,7 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
971
1018
  committedItems,
972
1019
  selectedIds,
973
1020
  selectionSources,
1021
+ scanSelectedAssets,
974
1022
  restoredSearchedAssets,
975
1023
  searchedWalletAssetCodes,
976
1024
  useAggregateRecalculate,
@@ -984,6 +1032,11 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
984
1032
  items,
985
1033
  latestSelectedIds,
986
1034
  latestSelectionSources,
1035
+ pendingAutoSelectAssets,
1036
+ requestedKeySet,
1037
+ nextState,
1038
+ selectedKeySet,
1039
+ droppedScanSelectedAssets,
987
1040
  _args8 = arguments;
988
1041
  return _regeneratorRuntime().wrap(function _callee8$(_context8) {
989
1042
  while (1) switch (_context8.prev = _context8.next) {
@@ -1004,12 +1057,18 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
1004
1057
  return committedKeys.has(getWalletAssetKey(item));
1005
1058
  });
1006
1059
  selectedIds = preserveSelection ? _toConsumableArray(this.walletAssetsState.selectedIds) : [];
1007
- selectionSources = preserveSelection ? _objectSpread({}, this.walletAssetsState.selectionSources) : {}; // aggregate-recalculate 不接受空商品列表。
1008
- // 清空购物车时保留扫码资产供后续加购恢复,但必须取消当前选择。
1060
+ selectionSources = preserveSelection ? _objectSpread({}, this.walletAssetsState.selectionSources) : {};
1061
+ scanSelectedAssets = preserveSelection ? this.walletAssetsState.selectedItems.filter(function (asset) {
1062
+ var assetId = getWalletAssetId(asset);
1063
+ return assetId !== undefined && assetId !== null && selectionSources[String(assetId)] === 'scan';
1064
+ }) : []; // aggregate-recalculate 不接受空商品列表。
1065
+ // 清空购物车时保留扫码资产供后续加购恢复;只有手动 Remove/Clear
1066
+ // 会取消自动应用资格,商品变化导致的自动失效需要重新进入待选队列。
1009
1067
  if ((_businessData$product2 = businessData.products) !== null && _businessData$product2 !== void 0 && _businessData$product2.length) {
1010
- _context8.next = 20;
1068
+ _context8.next = 22;
1011
1069
  break;
1012
1070
  }
1071
+ this.queuePendingAutoSelectForAssets(scanSelectedAssets);
1013
1072
  this.generateWalletParams(businessData);
1014
1073
  restoredSearchedAssets = this.searchResults.filter(isWalletPaymentAsset).map(function (item) {
1015
1074
  return _objectSpread(_objectSpread({}, item), {}, {
@@ -1044,7 +1103,7 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
1044
1103
  totalSelectedAmount: 0,
1045
1104
  error: null
1046
1105
  }));
1047
- case 20:
1106
+ case 22:
1048
1107
  this.publishWalletAssetsState({
1049
1108
  status: 'loading',
1050
1109
  customerId: nextCustomerId,
@@ -1055,40 +1114,40 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
1055
1114
  totalSelectedAmount: preserveSelection ? this.walletAssetsState.totalSelectedAmount : 0,
1056
1115
  error: null
1057
1116
  });
1058
- _context8.prev = 21;
1117
+ _context8.prev = 23;
1059
1118
  searchedWalletAssetCodes = preserveSelection ? this.getSearchedWalletAssetCodes() : [];
1060
1119
  useAggregateRecalculate = preserveSelection && (selectedIds.length > 0 || searchedWalletAssetCodes.length > 0);
1061
1120
  if (!useAggregateRecalculate) {
1062
- _context8.next = 30;
1121
+ _context8.next = 32;
1063
1122
  break;
1064
1123
  }
1065
- _context8.next = 27;
1124
+ _context8.next = 29;
1066
1125
  return this.aggregateRecalculateWalletAssetsAsync(businessData, selectedIds);
1067
- case 27:
1126
+ case 29:
1068
1127
  _context8.t0 = _context8.sent;
1069
- _context8.next = 31;
1128
+ _context8.next = 33;
1070
1129
  break;
1071
- case 30:
1130
+ case 32:
1072
1131
  _context8.t0 = null;
1073
- case 31:
1132
+ case 33:
1074
1133
  aggregateResult = _context8.t0;
1075
1134
  _context8.t1 = aggregateResult;
1076
1135
  if (_context8.t1) {
1077
- _context8.next = 37;
1136
+ _context8.next = 39;
1078
1137
  break;
1079
1138
  }
1080
- _context8.next = 36;
1139
+ _context8.next = 38;
1081
1140
  return this.initializeWalletDataFromBusinessAsync(businessData);
1082
- case 36:
1141
+ case 38:
1083
1142
  _context8.t1 = _context8.sent;
1084
- case 37:
1143
+ case 39:
1085
1144
  result = _context8.t1;
1086
1145
  if (!(requestSequence !== this.walletAssetsRequestSequence)) {
1087
- _context8.next = 40;
1146
+ _context8.next = 42;
1088
1147
  break;
1089
1148
  }
1090
1149
  return _context8.abrupt("return", this.getWalletAssetsState());
1091
- case 40:
1150
+ case 42:
1092
1151
  this.walletAssetsCalculationContext = {
1093
1152
  orderTotalAmount: Number(businessData.order_wait_pay_amount || 0),
1094
1153
  products: result.products || businessData.products || []
@@ -1111,11 +1170,11 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
1111
1170
  }
1112
1171
  searchedWalletAssets = preserveSelection ? this.syncSearchedWalletAssets([].concat(_toConsumableArray(result.transformList || []), _toConsumableArray(result.noApplicableVoucher || []))) : [];
1113
1172
  if (!(requestSequence !== this.walletAssetsRequestSequence)) {
1114
- _context8.next = 46;
1173
+ _context8.next = 48;
1115
1174
  break;
1116
1175
  }
1117
1176
  return _context8.abrupt("return", this.getWalletAssetsState());
1118
- case 46:
1177
+ case 48:
1119
1178
  recommendedKeys = new Set((result.walletRecommendList || []).map(function (asset) {
1120
1179
  return getWalletAssetKey(asset);
1121
1180
  }));
@@ -1126,16 +1185,47 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
1126
1185
  });
1127
1186
  latestSelectedIds = preserveSelection ? authoritativeSelectedIds : [];
1128
1187
  latestSelectionSources = preserveSelection ? _objectSpread({}, this.walletAssetsState.selectionSources) : {};
1129
- return _context8.abrupt("return", this.recalculateWalletAssets(items, latestSelectedIds, latestSelectionSources));
1130
- case 53:
1131
- _context8.prev = 53;
1132
- _context8.t2 = _context8["catch"](21);
1188
+ pendingAutoSelectAssets = this.walletAssetsBehavior.autoSelectAfterSearch ? items.filter(function (asset) {
1189
+ return _this4.isPendingAutoSelectAsset(asset) && isWalletAssetAvailable(asset);
1190
+ }) : [];
1191
+ requestedKeySet = new Set(latestSelectedIds.map(function (id) {
1192
+ return String(id);
1193
+ }));
1194
+ pendingAutoSelectAssets.forEach(function (asset) {
1195
+ var assetId = getWalletAssetId(asset);
1196
+ if (assetId === undefined || assetId === null) return;
1197
+ var assetKey = String(assetId);
1198
+ if (!requestedKeySet.has(assetKey)) {
1199
+ requestedKeySet.add(assetKey);
1200
+ latestSelectedIds.push(assetId);
1201
+ }
1202
+ latestSelectionSources[assetKey] = 'scan';
1203
+ });
1204
+ nextState = this.recalculateWalletAssets(items, latestSelectedIds, latestSelectionSources);
1205
+ selectedKeySet = new Set(nextState.selectedIds.map(function (id) {
1206
+ return String(id);
1207
+ }));
1208
+ pendingAutoSelectAssets.forEach(function (asset) {
1209
+ var assetId = getWalletAssetId(asset);
1210
+ if (assetId !== undefined && assetId !== null && selectedKeySet.has(String(assetId))) {
1211
+ _this4.clearPendingAutoSelectForAsset(asset);
1212
+ }
1213
+ });
1214
+ droppedScanSelectedAssets = scanSelectedAssets.filter(function (asset) {
1215
+ var assetId = getWalletAssetId(asset);
1216
+ return assetId !== undefined && assetId !== null && !selectedKeySet.has(String(assetId));
1217
+ });
1218
+ this.queuePendingAutoSelectForAssets(droppedScanSelectedAssets);
1219
+ return _context8.abrupt("return", nextState);
1220
+ case 63:
1221
+ _context8.prev = 63;
1222
+ _context8.t2 = _context8["catch"](23);
1133
1223
  if (!(requestSequence !== this.walletAssetsRequestSequence)) {
1134
- _context8.next = 57;
1224
+ _context8.next = 67;
1135
1225
  break;
1136
1226
  }
1137
1227
  return _context8.abrupt("return", this.getWalletAssetsState());
1138
- case 57:
1228
+ case 67:
1139
1229
  this.paymentModule.logError('[WalletPass] 刷新共享钱包资产失败,保留刷新前状态', _context8.t2, {
1140
1230
  customer_id: businessData.customer_id,
1141
1231
  selected_ids: selectedIds,
@@ -1151,11 +1241,11 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
1151
1241
  customerId: nextCustomerId,
1152
1242
  error: _context8.t2 instanceof Error ? _context8.t2.message : String(_context8.t2)
1153
1243
  }));
1154
- case 59:
1244
+ case 69:
1155
1245
  case "end":
1156
1246
  return _context8.stop();
1157
1247
  }
1158
- }, _callee8, this, [[21, 53]]);
1248
+ }, _callee8, this, [[23, 63]]);
1159
1249
  }));
1160
1250
  function refreshWalletAssetsFromBusinessAsync(_x9) {
1161
1251
  return _refreshWalletAssetsFromBusinessAsync.apply(this, arguments);
@@ -1179,6 +1269,7 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
1179
1269
  return {
1180
1270
  state: this.getWalletAssetsState(),
1181
1271
  searchResults: _toConsumableArray(this.searchResults),
1272
+ pendingAutoSelectSearchCodes: _toConsumableArray(this.pendingAutoSelectSearchCodes),
1182
1273
  walletParams: this.walletParams ? _objectSpread({}, this.walletParams) : null,
1183
1274
  calculationContext: {
1184
1275
  orderTotalAmount: this.walletAssetsCalculationContext.orderTotalAmount,
@@ -1193,6 +1284,7 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
1193
1284
  if (!(snapshot !== null && snapshot !== void 0 && snapshot.state)) return this.getWalletAssetsState();
1194
1285
  this.walletAssetsRequestSequence += 1;
1195
1286
  this.searchResults = Array.isArray(snapshot.searchResults) ? _toConsumableArray(snapshot.searchResults) : [];
1287
+ this.pendingAutoSelectSearchCodes = this.walletAssetsBehavior.autoSelectAfterSearch && Array.isArray(snapshot.pendingAutoSelectSearchCodes) ? new Set(snapshot.pendingAutoSelectSearchCodes.map(normalizeWalletAssetCode).filter(Boolean)) : new Set();
1196
1288
  this.walletParams = snapshot.walletParams ? _objectSpread({}, snapshot.walletParams) : null;
1197
1289
  this.walletAssetsCalculationContext = {
1198
1290
  orderTotalAmount: Number(((_snapshot$calculation = snapshot.calculationContext) === null || _snapshot$calculation === void 0 ? void 0 : _snapshot$calculation.orderTotalAmount) || 0),
@@ -1210,6 +1302,9 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
1210
1302
  key: "selectWalletAsset",
1211
1303
  value: function selectWalletAsset(assetId, options) {
1212
1304
  var assetKey = String(assetId);
1305
+ var asset = this.walletAssetsState.items.find(function (item) {
1306
+ return getWalletAssetKey(item) === assetKey;
1307
+ });
1213
1308
  var committedKeys = new Set(this.walletAssetsState.committedIds.map(function (id) {
1214
1309
  return String(id);
1215
1310
  }));
@@ -1220,22 +1315,27 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
1220
1315
  var selectionSources = _objectSpread({}, this.walletAssetsState.selectionSources);
1221
1316
  delete selectionSources[assetKey];
1222
1317
  if (options.selected) {
1223
- var asset = this.walletAssetsState.items.find(function (item) {
1224
- return getWalletAssetKey(item) === assetKey;
1225
- });
1226
1318
  if (!asset || !isWalletAssetAvailable(asset)) {
1227
1319
  return this.getWalletAssetsState();
1228
1320
  }
1229
1321
  selectedIds.push(assetId);
1230
1322
  selectionSources[assetKey] = options.source || 'manual';
1323
+ } else if (asset) {
1324
+ this.clearPendingAutoSelectForAsset(asset);
1231
1325
  }
1232
- return this.recalculateWalletAssets(this.walletAssetsState.items, selectedIds, selectionSources);
1326
+ var nextState = this.recalculateWalletAssets(this.walletAssetsState.items, selectedIds, selectionSources);
1327
+ if (options.selected && asset && nextState.selectedIds.some(function (id) {
1328
+ return String(id) === assetKey;
1329
+ })) {
1330
+ this.clearPendingAutoSelectForAsset(asset);
1331
+ }
1332
+ return nextState;
1233
1333
  }
1234
1334
  }, {
1235
1335
  key: "scanWalletAssetAsync",
1236
1336
  value: function () {
1237
1337
  var _scanWalletAssetAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(code) {
1238
- var normalizedCode, selectedAsset, result, paymentAssets, asset, items, assetId, selected;
1338
+ var normalizedCode, selectedAsset, result, paymentAssets, asset, items, recalculatedState, assetId, selected, isSelected;
1239
1339
  return _regeneratorRuntime().wrap(function _callee9$(_context9) {
1240
1340
  while (1) switch (_context9.prev = _context9.next) {
1241
1341
  case 0:
@@ -1288,21 +1388,28 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
1288
1388
  });
1289
1389
  case 14:
1290
1390
  items = mergeWalletAssets(this.walletAssetsState.items, [asset]);
1291
- this.recalculateWalletAssets(items, this.walletAssetsState.selectedIds, this.walletAssetsState.selectionSources);
1391
+ recalculatedState = this.recalculateWalletAssets(items, this.walletAssetsState.selectedIds, this.walletAssetsState.selectionSources);
1292
1392
  assetId = getWalletAssetId(asset);
1293
- selected = assetId !== undefined && isWalletAssetAvailable(asset) ? this.selectWalletAsset(assetId, {
1393
+ selected = this.walletAssetsBehavior.autoSelectAfterSearch && assetId !== undefined && isWalletAssetAvailable(asset) ? this.selectWalletAsset(assetId, {
1294
1394
  selected: true,
1295
1395
  source: 'scan'
1296
- }) : this.getWalletAssetsState();
1396
+ }) : recalculatedState;
1397
+ isSelected = assetId !== undefined && selected.selectedIds.some(function (id) {
1398
+ return String(id) === String(assetId);
1399
+ });
1400
+ if (isSelected) {
1401
+ this.clearPendingAutoSelectForAsset(asset);
1402
+ } else if (this.walletAssetsBehavior.autoSelectAfterSearch) {
1403
+ this.pendingAutoSelectSearchCodes.add(normalizeWalletAssetCode(normalizedCode));
1404
+ this.queuePendingAutoSelectForAssets([asset]);
1405
+ }
1297
1406
  return _context9.abrupt("return", {
1298
1407
  type: result.type,
1299
1408
  asset: asset,
1300
- selected: assetId !== undefined && selected.selectedIds.some(function (id) {
1301
- return String(id) === String(assetId);
1302
- }),
1409
+ selected: isSelected,
1303
1410
  state: selected
1304
1411
  });
1305
- case 19:
1412
+ case 21:
1306
1413
  case "end":
1307
1414
  return _context9.stop();
1308
1415
  }
@@ -1316,6 +1423,7 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
1316
1423
  }, {
1317
1424
  key: "clearWalletAssetSelection",
1318
1425
  value: function clearWalletAssetSelection() {
1426
+ this.pendingAutoSelectSearchCodes.clear();
1319
1427
  return this.recalculateWalletAssets(this.walletAssetsState.items, [], {});
1320
1428
  }
1321
1429
  }, {
@@ -1491,6 +1599,7 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
1491
1599
  key: "clearSearchResults",
1492
1600
  value: function clearSearchResults() {
1493
1601
  this.searchResults = [];
1602
+ this.pendingAutoSelectSearchCodes.clear();
1494
1603
  this.paymentModule.logInfo('[WalletPass] 搜索结果缓存已清除');
1495
1604
  }
1496
1605
 
@@ -1522,6 +1631,7 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
1522
1631
  this.walletRecommendList = [];
1523
1632
  this.userIdentificationCodes = [];
1524
1633
  this.searchResults = [];
1634
+ this.pendingAutoSelectSearchCodes.clear();
1525
1635
  this.walletParams = null;
1526
1636
  this.walletInitData = null;
1527
1637
  this.walletAssetsRequestSequence += 1;
@@ -193,7 +193,6 @@ export interface ProductData {
193
193
  status?: string;
194
194
  required?: number | string | boolean;
195
195
  resource_id?: number | string | null;
196
- [key: string]: any;
197
196
  };
198
197
  /** 组合商品id,动态附加 */
199
198
  product_variant_id?: number;