@pisell/pisellos 2.1.118 → 2.1.119

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 (106) hide show
  1. package/dist/index.d.ts +0 -1
  2. package/dist/index.js +0 -1
  3. package/dist/modules/Cart/types.d.ts +0 -2
  4. package/dist/modules/Cart/utils/cartProduct.js +24 -56
  5. package/dist/modules/Discount/types.d.ts +0 -18
  6. package/dist/modules/Payment/index.d.ts +1 -2
  7. package/dist/modules/Payment/index.js +7 -10
  8. package/dist/modules/Payment/utils.js +0 -3
  9. package/dist/modules/Payment/walletpass.d.ts +0 -23
  10. package/dist/modules/Payment/walletpass.js +95 -191
  11. package/dist/modules/Product/index.d.ts +1 -1
  12. package/dist/modules/Rules/index.d.ts +5 -9
  13. package/dist/modules/Rules/index.js +162 -674
  14. package/dist/modules/Rules/types.d.ts +0 -2
  15. package/dist/modules/Summary/types.d.ts +0 -2
  16. package/dist/modules/Summary/utils.d.ts +0 -6
  17. package/dist/modules/Summary/utils.js +0 -21
  18. package/dist/plugins/window.d.ts +0 -2
  19. package/dist/solution/BookingByStep/index.d.ts +0 -1
  20. package/dist/solution/BookingByStep/index.js +44 -42
  21. package/dist/solution/BookingByStep/utils/timeslots.d.ts +3 -1
  22. package/dist/solution/BookingByStep/utils/timeslots.js +19 -12
  23. package/dist/solution/BookingTicket/index.d.ts +1 -1
  24. package/dist/solution/Checkout/index.js +0 -2
  25. package/dist/solution/ShopDiscount/index.d.ts +0 -1
  26. package/dist/solution/ShopDiscount/index.js +7 -23
  27. package/dist/solution/ShopDiscount/types.d.ts +0 -1
  28. package/dist/solution/ShopDiscount/types.js +1 -2
  29. package/dist/solution/ShopDiscount/utils.js +12 -26
  30. package/lib/index.d.ts +0 -1
  31. package/lib/index.js +1 -3
  32. package/lib/modules/Cart/types.d.ts +0 -2
  33. package/lib/modules/Cart/utils/cartProduct.js +11 -39
  34. package/lib/modules/Discount/types.d.ts +0 -18
  35. package/lib/modules/Payment/index.d.ts +1 -2
  36. package/lib/modules/Payment/index.js +0 -1
  37. package/lib/modules/Payment/utils.js +0 -3
  38. package/lib/modules/Payment/walletpass.d.ts +0 -23
  39. package/lib/modules/Payment/walletpass.js +17 -94
  40. package/lib/modules/Product/index.d.ts +1 -1
  41. package/lib/modules/Rules/index.d.ts +5 -9
  42. package/lib/modules/Rules/index.js +284 -779
  43. package/lib/modules/Rules/types.d.ts +0 -2
  44. package/lib/modules/Summary/types.d.ts +0 -2
  45. package/lib/modules/Summary/utils.d.ts +0 -6
  46. package/lib/modules/Summary/utils.js +0 -15
  47. package/lib/plugins/window.d.ts +0 -2
  48. package/lib/solution/BookingByStep/index.d.ts +0 -1
  49. package/lib/solution/BookingByStep/index.js +4 -2
  50. package/lib/solution/BookingByStep/utils/timeslots.d.ts +3 -1
  51. package/lib/solution/BookingByStep/utils/timeslots.js +19 -11
  52. package/lib/solution/BookingTicket/index.d.ts +1 -1
  53. package/lib/solution/Checkout/index.js +0 -2
  54. package/lib/solution/ShopDiscount/index.d.ts +0 -1
  55. package/lib/solution/ShopDiscount/index.js +8 -22
  56. package/lib/solution/ShopDiscount/types.d.ts +0 -1
  57. package/lib/solution/ShopDiscount/utils.js +6 -10
  58. package/package.json +1 -1
  59. package/dist/model/index.d.ts +0 -1
  60. package/dist/model/index.js +0 -1
  61. package/dist/model/strategy/adapter/index.d.ts +0 -3
  62. package/dist/model/strategy/adapter/index.js +0 -4
  63. package/dist/model/strategy/adapter/type.d.ts +0 -28
  64. package/dist/model/strategy/adapter/type.js +0 -1
  65. package/dist/model/strategy/adapter/walletPass/evaluator.d.ts +0 -84
  66. package/dist/model/strategy/adapter/walletPass/evaluator.js +0 -499
  67. package/dist/model/strategy/adapter/walletPass/example.d.ts +0 -4
  68. package/dist/model/strategy/adapter/walletPass/example.js +0 -258
  69. package/dist/model/strategy/adapter/walletPass/index.d.ts +0 -32
  70. package/dist/model/strategy/adapter/walletPass/index.js +0 -182
  71. package/dist/model/strategy/adapter/walletPass/locales.d.ts +0 -1
  72. package/dist/model/strategy/adapter/walletPass/locales.js +0 -26
  73. package/dist/model/strategy/adapter/walletPass/type.d.ts +0 -187
  74. package/dist/model/strategy/adapter/walletPass/type.js +0 -1
  75. package/dist/model/strategy/adapter/walletPass/utils.d.ts +0 -50
  76. package/dist/model/strategy/adapter/walletPass/utils.js +0 -1104
  77. package/dist/model/strategy/index.d.ts +0 -94
  78. package/dist/model/strategy/index.js +0 -551
  79. package/dist/model/strategy/strategy-example.d.ts +0 -5
  80. package/dist/model/strategy/strategy-example.js +0 -331
  81. package/dist/model/strategy/type.d.ts +0 -228
  82. package/dist/model/strategy/type.js +0 -94
  83. package/lib/model/index.d.ts +0 -1
  84. package/lib/model/index.js +0 -23
  85. package/lib/model/strategy/adapter/index.d.ts +0 -3
  86. package/lib/model/strategy/adapter/index.js +0 -45
  87. package/lib/model/strategy/adapter/type.d.ts +0 -28
  88. package/lib/model/strategy/adapter/type.js +0 -17
  89. package/lib/model/strategy/adapter/walletPass/evaluator.d.ts +0 -84
  90. package/lib/model/strategy/adapter/walletPass/evaluator.js +0 -423
  91. package/lib/model/strategy/adapter/walletPass/example.d.ts +0 -4
  92. package/lib/model/strategy/adapter/walletPass/example.js +0 -207
  93. package/lib/model/strategy/adapter/walletPass/index.d.ts +0 -32
  94. package/lib/model/strategy/adapter/walletPass/index.js +0 -142
  95. package/lib/model/strategy/adapter/walletPass/locales.d.ts +0 -1
  96. package/lib/model/strategy/adapter/walletPass/locales.js +0 -54
  97. package/lib/model/strategy/adapter/walletPass/type.d.ts +0 -187
  98. package/lib/model/strategy/adapter/walletPass/type.js +0 -17
  99. package/lib/model/strategy/adapter/walletPass/utils.d.ts +0 -50
  100. package/lib/model/strategy/adapter/walletPass/utils.js +0 -791
  101. package/lib/model/strategy/index.d.ts +0 -94
  102. package/lib/model/strategy/index.js +0 -413
  103. package/lib/model/strategy/strategy-example.d.ts +0 -5
  104. package/lib/model/strategy/strategy-example.js +0 -318
  105. package/lib/model/strategy/type.d.ts +0 -228
  106. package/lib/model/strategy/type.js +0 -44
package/lib/index.js CHANGED
@@ -38,7 +38,6 @@ __reExport(src_exports, require("./types"), module.exports);
38
38
  __reExport(src_exports, require("./modules"), module.exports);
39
39
  __reExport(src_exports, require("./plugins"), module.exports);
40
40
  __reExport(src_exports, require("./solution"), module.exports);
41
- __reExport(src_exports, require("./model"), module.exports);
42
41
  var import_core = require("./core");
43
42
  var import_core2 = __toESM(require("./core"));
44
43
  var src_default = import_core2.default;
@@ -48,6 +47,5 @@ var src_default = import_core2.default;
48
47
  ...require("./types"),
49
48
  ...require("./modules"),
50
49
  ...require("./plugins"),
51
- ...require("./solution"),
52
- ...require("./model")
50
+ ...require("./solution")
53
51
  });
@@ -75,8 +75,6 @@ export interface CartItem {
75
75
  summaryTotal?: number | string;
76
76
  /** 商品原价总价,排除原始价格为0的场景 */
77
77
  origin_total?: number | string;
78
- /** 基于 origin_total 乘以 商品数量的价格 */
79
- summaryOriginTotal?: number | string;
80
78
  /** 商品数量 */
81
79
  num?: number;
82
80
  /** 商品图片 */
@@ -46,18 +46,6 @@ var import_decimal = __toESM(require("decimal.js"));
46
46
  var import_utils = require("../../Product/utils");
47
47
  var import_utils2 = require("../../../solution/ShopDiscount/utils");
48
48
  var import_utils3 = require("../../Summary/utils");
49
- var toDiscountPayload = (discountItem) => {
50
- var _a, _b;
51
- return {
52
- amount: discountItem.amount,
53
- tag: discountItem.type,
54
- par_value: (_a = discountItem.discount) == null ? void 0 : _a.percent,
55
- config: discountItem.config,
56
- metadata: {
57
- discount_card_type: (_b = discountItem == null ? void 0 : discountItem.discount) == null ? void 0 : _b.discount_card_type
58
- }
59
- };
60
- };
61
49
  var handleVariantProduct = (product) => {
62
50
  var _a;
63
51
  if (product == null ? void 0 : product.product_variant_id) {
@@ -102,14 +90,6 @@ var formatProductToCartItem = (params) => {
102
90
  num,
103
91
  discounts
104
92
  });
105
- const origin_total = getProductTotalPrice({
106
- product: cartItem._productInit || cartItem._productOrigin,
107
- bundle,
108
- options,
109
- num,
110
- discounts: []
111
- });
112
- cartItem.summaryOriginTotal = (origin_total || 0) * (num || 1);
113
93
  cartItem.image = product == null ? void 0 : product.cover;
114
94
  cartItem.like_status = "common";
115
95
  cartItem.duration = product == null ? void 0 : product.duration;
@@ -204,24 +184,17 @@ var formatProductToCartItemOrigin = (params) => {
204
184
  var getProductTotalPrice = (params) => {
205
185
  const { product, bundle, options, discounts } = params;
206
186
  let price = Number(product.price);
207
- const optionRows = (options == null ? void 0 : options.map((currentValue) => ({
208
- unit: Number(currentValue.price ?? currentValue.add_price ?? 0),
209
- num: Number(currentValue.num ?? currentValue.quantity ?? 1)
210
- }))) ?? [];
211
187
  if (discounts == null ? void 0 : discounts.length) {
212
188
  discounts.forEach((currentValue) => {
213
189
  var _a;
214
- const payload = toDiscountPayload(currentValue);
215
- price = (0, import_utils2.getDiscountAmount)(payload, price, price);
216
- if (((_a = currentValue == null ? void 0 : currentValue.config) == null ? void 0 : _a.deductOptionPrice) && optionRows.length) {
217
- for (let i = 0; i < optionRows.length; i++) {
218
- const row = optionRows[i];
219
- optionRows[i] = {
220
- ...row,
221
- unit: (0, import_utils2.getDiscountAmount)(payload, row.unit, row.unit)
222
- };
190
+ price = (0, import_utils2.getDiscountAmount)({
191
+ amount: currentValue.amount,
192
+ tag: currentValue.type,
193
+ par_value: currentValue.discount.percent,
194
+ metadata: {
195
+ discount_card_type: (_a = currentValue == null ? void 0 : currentValue.discount) == null ? void 0 : _a.discount_card_type
223
196
  }
224
- }
197
+ }, price, price);
225
198
  });
226
199
  }
227
200
  if (bundle == null ? void 0 : bundle.length) {
@@ -229,11 +202,10 @@ var getProductTotalPrice = (params) => {
229
202
  return accumulator + Number(currentValue.price) * Number(currentValue.num);
230
203
  }, price);
231
204
  }
232
- if (optionRows.length) {
233
- price = optionRows.reduce(
234
- (accumulator, row) => accumulator + row.unit * row.num,
235
- price
236
- );
205
+ if (options == null ? void 0 : options.length) {
206
+ price = options.reduce((accumulator, currentValue) => {
207
+ return accumulator + Number(currentValue.price) * Number(currentValue.num);
208
+ }, price);
237
209
  }
238
210
  return Math.max(0, price);
239
211
  };
@@ -33,8 +33,6 @@ interface Limitedrelationproductdata {
33
33
  product_ids: number[];
34
34
  product_collection_id: number[];
35
35
  package_sub_item_usage_rules?: PackageSubItemUsageRules;
36
- filter: 0 | 1;
37
- exclude_product_ids: number[];
38
36
  }
39
37
  interface ApplicableProductDetails {
40
38
  amount: string;
@@ -91,7 +89,6 @@ export interface Discount {
91
89
  balance: string;
92
90
  format_title: Formattitle;
93
91
  metadata?: {
94
- num?: number;
95
92
  discount_card_type?: 'fixed_amount' | 'percent';
96
93
  custom_product_bundle_map_id?: string;
97
94
  validity_type?: "custom_schedule_validity" | "fixed_validity";
@@ -116,21 +113,6 @@ export interface Discount {
116
113
  isSelected?: boolean;
117
114
  isAvailable?: boolean;
118
115
  isUsed?: boolean;
119
- config?: {
120
- isAvailable?: boolean;
121
- /** 最大抵扣金额 */
122
- maxDeductionAmount?: number;
123
- /** 每单最多使用张数 */
124
- maxUsagePerOrder?: number;
125
- /** 是否抵扣税费与附加费 */
126
- deductTaxAndFee?: boolean;
127
- /** 适用粒度(多商品共用) */
128
- allowCrossProduct?: boolean;
129
- /** 可用商品数量上限 */
130
- applicableProductLimit?: number;
131
- /** 是否抵扣单规格价格 (Option Price) */
132
- deductOptionPrice?: boolean;
133
- };
134
116
  applicableProductIds?: number[];
135
117
  applicableProductDetails: ApplicableProductDetails[];
136
118
  appliedProductDetails: ApplicableProductDetails[];
@@ -1,5 +1,5 @@
1
1
  import { Module, PisellCore, ModuleOptions } from '../../types';
2
- import { RequestPlugin, WindowPlugin } from '../../plugins';
2
+ import { RequestPlugin } from '../../plugins';
3
3
  import { BaseModule } from '../BaseModule';
4
4
  import { PaymentModuleAPI, PaymentMethod, PaymentOrder, PaymentItem, PaymentItemInput, PaymentUpdateFields, PushOrderParams, CashPayment, EftposPayment, WalletPassPayment, RoundingRule, RoundingInterval, RoundingResult } from './types';
5
5
  export * from './types';
@@ -21,7 +21,6 @@ export declare class PaymentModule extends BaseModule implements Module, Payment
21
21
  request: RequestPlugin;
22
22
  private app;
23
23
  private store;
24
- window: WindowPlugin;
25
24
  private dbManager;
26
25
  private logger;
27
26
  protected otherParams: any;
@@ -70,7 +70,6 @@ var PaymentModule = class extends import_BaseModule.BaseModule {
70
70
  this.otherParams = options.otherParams || {};
71
71
  this.request = core.getPlugin("request");
72
72
  const appPlugin = core.getPlugin("app");
73
- this.window = core.getPlugin("window");
74
73
  if (!this.request) {
75
74
  throw new Error("支付模块需要 request 插件支持");
76
75
  }
@@ -25,9 +25,6 @@ __export(utils_exports, {
25
25
  });
26
26
  module.exports = __toCommonJS(utils_exports);
27
27
  var getAvailableMaxAmount = (data) => {
28
- if (typeof data._available_max_amount === "number") {
29
- return data._available_max_amount;
30
- }
31
28
  return data.tag !== "point_card" ? data.available_max_amount : data == null ? void 0 : data.recommended_usage_amount;
32
29
  };
33
30
  var formatWalletPassList2PreparePayments = (list) => {
@@ -9,7 +9,6 @@ export declare class WalletPassPaymentImpl implements WalletPassPayment {
9
9
  private userIdentificationCodes;
10
10
  private searchResults;
11
11
  private walletParams;
12
- private walletInitData;
13
12
  constructor(paymentModule: PaymentModule);
14
13
  /**
15
14
  * 发送事件的辅助方法
@@ -38,14 +37,7 @@ export declare class WalletPassPaymentImpl implements WalletPassPayment {
38
37
  initializeWalletDataFromBusinessAsync(businessData: WalletInitBusinessData): Promise<{
39
38
  walletRecommendList: WalletRecommendItem[];
40
39
  userIdentificationCodes: UserIdentificationCodeItem[];
41
- transformList: any[];
42
- noApplicableVoucher: any[];
43
- products: any[];
44
40
  }>;
45
- /**
46
- * 获取订单基础详情
47
- */
48
- getOrderBasicDetailAsync(orderId: string): Promise<any>;
49
41
  /**
50
42
  * 初始化钱包数据
51
43
  * 先获取推荐列表,再获取用户识别码列表(顺序执行)
@@ -53,9 +45,6 @@ export declare class WalletPassPaymentImpl implements WalletPassPayment {
53
45
  initializeWalletDataAsync(baseParams: WalletDeductionRecommendParams): Promise<{
54
46
  walletRecommendList: WalletRecommendItem[];
55
47
  userIdentificationCodes: UserIdentificationCodeItem[];
56
- transformList: any[];
57
- noApplicableVoucher: any[];
58
- products: any[];
59
48
  }>;
60
49
  getWalletPassRecommendListAsync(params: WalletDeductionRecommendParams): Promise<WalletRecommendItem[]>;
61
50
  formatWalletPassList2PreparePayments(list: WalletRecommendItem[]): {
@@ -103,18 +92,6 @@ export declare class WalletPassPaymentImpl implements WalletPassPayment {
103
92
  * 清除搜索结果缓存
104
93
  */
105
94
  clearSearchResults(): void;
106
- /**
107
- * 获取存储的钱包初始化数据
108
- */
109
- getStoredWalletInitData(): {
110
- transformList: any[];
111
- noApplicableVoucher: any[];
112
- products: any[];
113
- } | null;
114
- /**
115
- * 清除存储的钱包初始化数据
116
- */
117
- clearStoredWalletInitData(): void;
118
95
  /**
119
96
  * 清除所有缓存数据
120
97
  */
@@ -31,7 +31,6 @@ var WalletPassPaymentImpl = class {
31
31
  this.userIdentificationCodes = [];
32
32
  this.searchResults = [];
33
33
  this.walletParams = null;
34
- this.walletInitData = null;
35
34
  }
36
35
  /**
37
36
  * 发送事件的辅助方法
@@ -43,9 +42,7 @@ var WalletPassPaymentImpl = class {
43
42
  const fullEventName = `${this.paymentModule.name}:${eventName}`;
44
43
  this.paymentModule.core.effects.emit(fullEventName, data);
45
44
  } catch (error) {
46
- this.paymentModule.logError("[WalletPass] 发送事件失败", error, {
47
- hook
48
- });
45
+ this.paymentModule.logError("[WalletPass] 发送事件失败", error, { hook });
49
46
  }
50
47
  }
51
48
  /**
@@ -115,10 +112,7 @@ var WalletPassPaymentImpl = class {
115
112
  if (Number(((_a = businessData == null ? void 0 : businessData.amountInfo) == null ? void 0 : _a.totalAmount) || 0) < 0 || Number(((_b = businessData == null ? void 0 : businessData.amountInfo) == null ? void 0 : _b.subTotal) || 0) < 0) {
116
113
  return {
117
114
  walletRecommendList: [],
118
- userIdentificationCodes: [],
119
- transformList: [],
120
- noApplicableVoucher: [],
121
- products: []
115
+ userIdentificationCodes: []
122
116
  };
123
117
  }
124
118
  this.emitEvent(import_types.WalletPassHooks.OnWalletInitializationStarted, {
@@ -159,28 +153,11 @@ var WalletPassPaymentImpl = class {
159
153
  endTime,
160
154
  duration
161
155
  });
162
- this.paymentModule.logError(
163
- `[WalletPass] 从业务数据初始化钱包数据失败`,
164
- error,
165
- {
166
- duration: `${duration}ms`,
167
- customer_id: businessData.customer_id,
168
- totalAmount: (_h = businessData.amountInfo) == null ? void 0 : _h.totalAmount
169
- }
170
- );
171
- throw error;
172
- }
173
- }
174
- /**
175
- * 获取订单基础详情
176
- */
177
- async getOrderBasicDetailAsync(orderId) {
178
- try {
179
- const response = await this.paymentModule.request.get(
180
- `/order/order/${orderId}/basic-detail`
181
- );
182
- return (response == null ? void 0 : response.data) || {};
183
- } catch (error) {
156
+ this.paymentModule.logError(`[WalletPass] 从业务数据初始化钱包数据失败`, error, {
157
+ duration: `${duration}ms`,
158
+ customer_id: businessData.customer_id,
159
+ totalAmount: (_h = businessData.amountInfo) == null ? void 0 : _h.totalAmount
160
+ });
184
161
  throw error;
185
162
  }
186
163
  }
@@ -189,49 +166,19 @@ var WalletPassPaymentImpl = class {
189
166
  * 先获取推荐列表,再获取用户识别码列表(顺序执行)
190
167
  */
191
168
  async initializeWalletDataAsync(baseParams) {
192
- var _a, _b;
193
169
  try {
170
+ const walletRecommendList = await this.getWalletPassRecommendListAsync(baseParams);
194
171
  const identificationParams = {
195
172
  ...baseParams,
196
173
  available: 2,
197
- prepare_payments: [],
174
+ prepare_payments: this.formatWalletPassList2PreparePayments(walletRecommendList),
198
175
  other_exact_codes: [],
199
176
  filter_prepare_wallet_pass: 1
200
177
  };
201
- const [allList, orderBasicDetail] = await Promise.all([
202
- this.getUserIdentificationCodeListAsync(identificationParams),
203
- baseParams.payment_order_id ? this.getOrderBasicDetailAsync(baseParams.payment_order_id) : Promise.resolve(null)
204
- ]);
205
- const walletPassEvaluator = (_b = (_a = this.paymentModule.window) == null ? void 0 : _a.getWalletPassEvaluator) == null ? void 0 : _b.call(_a);
206
- if (!walletPassEvaluator) {
207
- return {
208
- walletRecommendList: [],
209
- userIdentificationCodes: [],
210
- transformList: [],
211
- noApplicableVoucher: [],
212
- products: []
213
- };
214
- }
215
- const products = (orderBasicDetail == null ? void 0 : orderBasicDetail.detail) || baseParams.products;
216
- const res = walletPassEvaluator == null ? void 0 : walletPassEvaluator.getRecommendedVouchers({
217
- orderTotalAmount: baseParams.order_wait_pay_amount,
218
- products,
219
- vouchers: allList
220
- });
221
- const { recommended, transformList, noApplicableVoucher, recommendedAmount } = res;
222
- console.log(res, "resres12");
223
- this.walletRecommendList = recommended;
224
- this.walletInitData = {
225
- transformList,
226
- noApplicableVoucher,
227
- products: products || []
228
- };
178
+ const userIdentificationCodes = await this.getUserIdentificationCodeListAsync(identificationParams);
229
179
  return {
230
- walletRecommendList: recommended,
231
- userIdentificationCodes: allList,
232
- transformList,
233
- noApplicableVoucher,
234
- products: products || []
180
+ walletRecommendList,
181
+ userIdentificationCodes
235
182
  };
236
183
  } catch (error) {
237
184
  this.paymentModule.logError("[WalletPass] 初始化钱包数据失败", error, {
@@ -314,14 +261,10 @@ var WalletPassPaymentImpl = class {
314
261
  });
315
262
  return this.userIdentificationCodes;
316
263
  } catch (error) {
317
- this.paymentModule.logError(
318
- "[WalletPass] 获取用户识别码列表失败",
319
- error,
320
- {
321
- customer_id: params.customer_id,
322
- available: params.available
323
- }
324
- );
264
+ this.paymentModule.logError("[WalletPass] 获取用户识别码列表失败", error, {
265
+ customer_id: params.customer_id,
266
+ available: params.available
267
+ });
325
268
  return [];
326
269
  }
327
270
  }
@@ -519,19 +462,6 @@ var WalletPassPaymentImpl = class {
519
462
  this.searchResults = [];
520
463
  this.paymentModule.logInfo("[WalletPass] 搜索结果缓存已清除");
521
464
  }
522
- /**
523
- * 获取存储的钱包初始化数据
524
- */
525
- getStoredWalletInitData() {
526
- return this.walletInitData;
527
- }
528
- /**
529
- * 清除存储的钱包初始化数据
530
- */
531
- clearStoredWalletInitData() {
532
- this.walletInitData = null;
533
- this.paymentModule.logInfo("[WalletPass] 钱包初始化数据已清除");
534
- }
535
465
  /**
536
466
  * 清除所有缓存数据
537
467
  */
@@ -540,18 +470,11 @@ var WalletPassPaymentImpl = class {
540
470
  this.userIdentificationCodes = [];
541
471
  this.searchResults = [];
542
472
  this.walletParams = null;
543
- this.walletInitData = null;
544
473
  this.emitEvent(import_types.WalletPassHooks.OnWalletCacheCleared, {
545
474
  clearedTypes: ["all"]
546
475
  });
547
476
  this.paymentModule.logInfo("[WalletPass] 所有缓存数据已清除", {
548
- cleared_types: [
549
- "walletRecommendList",
550
- "userIdentificationCodes",
551
- "searchResults",
552
- "walletParams",
553
- "walletInitData"
554
- ]
477
+ cleared_types: ["walletRecommendList", "userIdentificationCodes", "searchResults", "walletParams"]
555
478
  });
556
479
  }
557
480
  };
@@ -49,5 +49,5 @@ export declare class Product extends BaseModule implements Module {
49
49
  getCategories(): ProductCategory[];
50
50
  setOtherParams(key: string, value: any): void;
51
51
  getOtherParams(): any;
52
- getProductType(): "normal" | "duration" | "session";
52
+ getProductType(): "duration" | "session" | "normal";
53
53
  }
@@ -1,28 +1,25 @@
1
1
  import { Module, PisellCore, ModuleOptions } from '../../types';
2
2
  import { BaseModule } from '../BaseModule';
3
3
  import { Rules, RulesModuleAPI, DiscountResult, UnavailableReason } from './types';
4
- import { Discount } from '../Discount/types';
5
- import { WindowPlugin } from '../../plugins';
4
+ import { Discount } from "../Discount/types";
5
+ import { SetDiscountSelectedParams } from '../../solution/ShopDiscount/types';
6
6
  export declare class RulesModule extends BaseModule implements Module, RulesModuleAPI {
7
7
  protected defaultName: string;
8
8
  protected defaultVersion: string;
9
9
  private store;
10
- window: WindowPlugin;
11
10
  private hooks;
12
11
  constructor(name?: string, version?: string);
13
12
  initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
14
13
  setRulesList(rulesList: Rules[]): Promise<void>;
15
14
  getRulesList(): Rules[];
16
15
  private checkHolderMatch;
17
- getWalletPassEvaluator(): import("../..").WalletPassEvaluator | undefined;
18
- isDiscountListAvailable({ oldDiscountList, newDiscountList, productList, orderTotalAmount, holders, isFormSubject, }: {
16
+ isDiscountListAvailable({ oldDiscountList, newDiscountList, productList, holders, isFormSubject, }: {
19
17
  oldDiscountList: Discount[];
20
18
  newDiscountList: Discount[];
21
19
  productList: any[];
22
20
  holders: {
23
21
  form_record_id: number;
24
22
  }[];
25
- orderTotalAmount: number;
26
23
  isFormSubject: boolean;
27
24
  }): {
28
25
  isAvailable: boolean;
@@ -32,18 +29,17 @@ export declare class RulesModule extends BaseModule implements Module, RulesModu
32
29
  };
33
30
  filterDiscountListByType(discountList: Discount[], type: string): Discount[];
34
31
  private getUnavailableReason;
35
- calcDiscount({ discountList, productList, holders, isFormSubject, orderTotalAmount }: {
32
+ calcDiscount({ discountList, productList, holders, isFormSubject, }: {
36
33
  discountList: Discount[];
37
34
  productList: any[];
38
35
  holders: {
39
36
  form_record_id: number;
40
37
  }[];
41
38
  isFormSubject: boolean;
42
- orderTotalAmount: number;
43
39
  }, options?: {
44
40
  isSelected?: boolean;
45
41
  discountId?: number;
46
- selectedList?: any[];
42
+ selectedList?: SetDiscountSelectedParams[];
47
43
  scan?: boolean;
48
44
  }): DiscountResult;
49
45
  /**