@pisell/pisellos 2.3.113 → 2.3.114

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.
@@ -5,18 +5,33 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.PaymentServerModule = void 0;
7
7
  var _BaseModule = require("../../../modules/BaseModule");
8
+ var _lodashEs = require("lodash-es");
8
9
  const WALLET_PASS_CODE = 'WALLET_PASS';
9
10
  const WALLET_DEPENDENT_CODES = new Set(['PRODUCTVOUCHER', 'GIFTCARD', 'POINTCARD']);
10
11
  const PAYMENT_METHODS_LOADED_EVENT = 'payment:onPaymentMethodsLoaded';
12
+ const PAYMENT_METHODS_CHANGED_EVENT = 'payment:onPaymentMethodsChanged';
13
+ const PAYMENT_METHOD_STORE_NAME = 'pay_method';
14
+ const CUSTOM_PAYMENT_MODULE = 'custom_payment';
15
+ const PAYMENT_METHOD_SYNC_DEBOUNCE_MS = 500;
16
+ const SNAPSHOT_ORDER_FIELD = '__payment_snapshot_order';
17
+ const SNAPSHOT_SHOP_ID_FIELD = '__payment_snapshot_shop_id';
11
18
  class PaymentServerModule extends _BaseModule.BaseModule {
12
19
  defaultName = 'payment';
13
20
  defaultVersion = '1.0.0';
14
21
  request;
15
22
  app;
16
23
  logger;
24
+ dbManager;
17
25
  store;
18
- payMethodMemoryCache = null;
19
- payMethodListInFlight = null;
26
+ paymentDataSource;
27
+ initialLoadInFlight = null;
28
+ refreshInFlight = null;
29
+ hasLoadedPayMethods = false;
30
+ hasEmittedLoaded = false;
31
+ syncTimer;
32
+ pendingMessageUuids = new Set();
33
+ queuedTrailingRefresh = false;
34
+ trailingMessageUuids = new Set();
20
35
  constructor(name, version) {
21
36
  super(name || 'payment', version);
22
37
  }
@@ -31,78 +46,327 @@ class PaymentServerModule extends _BaseModule.BaseModule {
31
46
  const appPlugin = core.getPlugin('app');
32
47
  this.app = appPlugin?.getApp();
33
48
  this.logger = this.app?.logger;
49
+ this.dbManager = this.app?.sqlite;
34
50
  if (!this.request && !this.app?.request) {
35
51
  throw new Error('PaymentServerModule 需要 request 插件或 app.request 支持');
36
52
  }
53
+ this.initPaymentDataSource();
54
+ this.setupPaymentMethodSync();
37
55
  this.logInfo('PaymentServerModule initialized successfully', {
38
- hasAppRequest: !!this.app?.request
56
+ hasAppRequest: !!this.app?.request,
57
+ hasSQLite: !!this.dbManager,
58
+ hasPaymentDataSource: !!this.paymentDataSource
39
59
  });
40
60
  }
41
-
42
- // getRoutes(): RouteDefinition[] {
43
- // return [
44
- // {
45
- // method: 'get',
46
- // path: '/pay/custom-payment/all',
47
- // handler: async ({ data, config }) => {
48
- // const payMethods = await this.getPayMethodListAsync({
49
- // shouldFilter: this.shouldFilterPayMethods(data, config),
50
- // });
51
- // return {
52
- // code: 200,
53
- // status: true,
54
- // data: payMethods,
55
- // };
56
- // },
57
- // },
58
- // ];
59
- // }
60
-
61
+ async preload() {
62
+ try {
63
+ await this.ensureInitialPayMethods('preload');
64
+ } catch (error) {
65
+ this.logError('preload 支付方式失败,保持空列表并允许后续读取重试', {
66
+ error: this.getErrorMessage(error)
67
+ });
68
+ }
69
+ }
61
70
  async getPayMethodListAsync(options = {}) {
62
- this.logInfo('Starting getPayMethodListAsync');
63
- if (this.payMethodMemoryCache?.length) {
64
- return this.resolvePayMethods(this.payMethodMemoryCache, options);
71
+ this.logInfo('Starting getPayMethodListAsync', {
72
+ hasLoadedPayMethods: this.hasLoadedPayMethods,
73
+ cachedCount: this.store.payMethods.length
74
+ });
75
+ if (!this.hasLoadedPayMethods) {
76
+ try {
77
+ await this.ensureInitialPayMethods('route');
78
+ } catch (error) {
79
+ this.logError('getPayMethodListAsync 初始化失败', {
80
+ error: this.getErrorMessage(error)
81
+ });
82
+ }
83
+ } else if (!this.paymentDataSource) {
84
+ try {
85
+ await this.refreshPayMethodsSingleFlight({
86
+ trigger: 'compat.route',
87
+ emitChanged: false
88
+ });
89
+ } catch (error) {
90
+ this.logWarning('兼容模式远端刷新失败,保留当前运行态快照', {
91
+ error: this.getErrorMessage(error)
92
+ });
93
+ }
65
94
  }
66
- if (this.payMethodListInFlight) {
67
- const payMethods = await this.payMethodListInFlight;
68
- return this.resolvePayMethods(payMethods, options);
95
+ return this.resolvePayMethods(this.store.payMethods, options);
96
+ }
97
+ async ensureInitialPayMethods(trigger) {
98
+ if (this.hasLoadedPayMethods) return this.store.payMethods;
99
+ if (this.initialLoadInFlight) return this.initialLoadInFlight;
100
+ this.initialLoadInFlight = (async () => {
101
+ const localSnapshot = await this.loadPayMethodsFromSQLite();
102
+ if (localSnapshot.available) {
103
+ this.setPayMethodMirror(localSnapshot.methods);
104
+ this.logInfo('从 SQLite 加载支付方式兜底快照', {
105
+ trigger,
106
+ count: localSnapshot.methods.length,
107
+ shopScope: this.resolveCurrentShopScope(localSnapshot.methods)
108
+ });
109
+ }
110
+ try {
111
+ await this.refreshPayMethodsSingleFlight({
112
+ trigger,
113
+ emitChanged: false
114
+ });
115
+ this.hasLoadedPayMethods = true;
116
+ } catch (error) {
117
+ if (!localSnapshot.available) throw error;
118
+ this.hasLoadedPayMethods = true;
119
+ this.logWarning('远端刷新失败,继续使用 SQLite 支付方式快照', {
120
+ trigger,
121
+ count: localSnapshot.methods.length,
122
+ error: this.getErrorMessage(error)
123
+ });
124
+ }
125
+ if (!this.hasEmittedLoaded) {
126
+ this.hasEmittedLoaded = true;
127
+ await this.core.effects.emit(PAYMENT_METHODS_LOADED_EVENT, this.store.payMethods);
128
+ }
129
+ return this.store.payMethods;
130
+ })().finally(() => {
131
+ this.initialLoadInFlight = null;
132
+ });
133
+ return this.initialLoadInFlight;
134
+ }
135
+ initPaymentDataSource() {
136
+ const PaymentDataSourceClass = this.core.serverOptions?.All_DATA_SOURCES?.PaymentDataSource;
137
+ if (!PaymentDataSourceClass) {
138
+ this.logWarning('PaymentDataSource 不可用,使用无本地持久化的兼容模式');
139
+ return;
69
140
  }
70
- this.payMethodListInFlight = this.loadPayMethodListAsync().finally(() => {
71
- this.payMethodListInFlight = null;
141
+ this.paymentDataSource = new PaymentDataSourceClass();
142
+ }
143
+ setupPaymentMethodSync() {
144
+ if (!this.paymentDataSource) return;
145
+ this.paymentDataSource.run({
146
+ pubsub: {
147
+ callback: res => {
148
+ const message = res?.data || res;
149
+ if (!message || message.module !== CUSTOM_PAYMENT_MODULE) return;
150
+ const messageUuid = String(message.message_uuid || '').trim();
151
+ if (messageUuid) this.pendingMessageUuids.add(messageUuid);
152
+ this.logInfo('收到 custom_payment Ably 消息,等待全量刷新', {
153
+ message_uuid: messageUuid || undefined,
154
+ action: message.action,
155
+ operation: message.operation
156
+ });
157
+ this.schedulePaymentMethodRefresh();
158
+ }
159
+ }
160
+ }).catch(error => {
161
+ this.logError('建立 custom_payment pubsub 订阅失败', {
162
+ error: this.getErrorMessage(error)
163
+ });
72
164
  });
73
- const payMethods = await this.payMethodListInFlight;
74
- return this.resolvePayMethods(payMethods, options);
75
165
  }
76
- clearPayMethodCache() {
77
- this.payMethodMemoryCache = null;
78
- this.store.payMethods = [];
166
+ schedulePaymentMethodRefresh() {
167
+ if (this.syncTimer) clearTimeout(this.syncTimer);
168
+ this.syncTimer = setTimeout(() => {
169
+ this.syncTimer = undefined;
170
+ const messageUuids = [...this.pendingMessageUuids];
171
+ this.pendingMessageUuids.clear();
172
+ void this.refreshPayMethodsSingleFlight({
173
+ trigger: 'ably',
174
+ emitChanged: true,
175
+ messageUuids
176
+ }).catch(error => {
177
+ this.logError('custom_payment Ably 全量刷新失败,保留旧快照', {
178
+ message_uuids: messageUuids,
179
+ error: this.getErrorMessage(error)
180
+ });
181
+ });
182
+ }, PAYMENT_METHOD_SYNC_DEBOUNCE_MS);
79
183
  }
80
- async loadPayMethodListAsync() {
184
+ async refreshPayMethodsSingleFlight(context) {
185
+ if (this.refreshInFlight) {
186
+ if (context.trigger.startsWith('ably')) {
187
+ this.queuedTrailingRefresh = true;
188
+ context.messageUuids?.forEach(uuid => this.trailingMessageUuids.add(uuid));
189
+ this.logInfo('支付方式刷新进行中,已排队一次尾随刷新', {
190
+ trigger: context.trigger,
191
+ message_uuids: context.messageUuids || []
192
+ });
193
+ }
194
+ return this.refreshInFlight;
195
+ }
196
+ const refreshTask = this.performRemoteRefresh(context);
197
+ this.refreshInFlight = refreshTask;
81
198
  try {
82
- const payMethods = await this.fetchRemotePayMethods();
83
- this.setPayMethodCache(payMethods);
84
- await this.core.effects.emit(PAYMENT_METHODS_LOADED_EVENT, payMethods);
85
- this.logInfo('getPayMethodListAsync completed successfully', {
86
- payMethods
199
+ return await refreshTask;
200
+ } finally {
201
+ if (this.refreshInFlight === refreshTask) this.refreshInFlight = null;
202
+ if (this.queuedTrailingRefresh) {
203
+ this.queuedTrailingRefresh = false;
204
+ const messageUuids = [...this.trailingMessageUuids];
205
+ this.trailingMessageUuids.clear();
206
+ void this.refreshPayMethodsSingleFlight({
207
+ trigger: 'ably.trailing',
208
+ emitChanged: true,
209
+ messageUuids
210
+ }).catch(error => {
211
+ this.logError('custom_payment 尾随刷新失败,保留当前快照', {
212
+ message_uuids: messageUuids,
213
+ error: this.getErrorMessage(error)
214
+ });
215
+ });
216
+ }
217
+ }
218
+ }
219
+ async performRemoteRefresh(context) {
220
+ const oldMethods = this.store.payMethods;
221
+ const payMethods = await this.fetchRemotePayMethods();
222
+ const persisted = await this.replacePayMethodsInSQLite(payMethods);
223
+ if (!persisted) {
224
+ this.logWarning('SQLite 不可用,支付方式仅用于当前运行时', {
225
+ trigger: context.trigger,
226
+ count: payMethods.length
87
227
  });
88
- return payMethods;
89
- } catch (error) {
90
- console.error('[PaymentServerModule] 获取支付方式列表失败', error);
91
- this.logError('getPayMethodListAsync failed', error);
92
- return [];
93
228
  }
229
+ this.setPayMethodMirror(payMethods);
230
+ this.hasLoadedPayMethods = true;
231
+ const changed = !this.arePayMethodsEqual(oldMethods, payMethods);
232
+ if (context.emitChanged && changed) {
233
+ await this.core.effects.emit(PAYMENT_METHODS_CHANGED_EVENT, {
234
+ oldMethods,
235
+ newMethods: this.store.payMethods
236
+ });
237
+ }
238
+ this.logInfo('远端支付方式全量刷新成功', {
239
+ trigger: context.trigger,
240
+ message_uuids: context.messageUuids || [],
241
+ count: payMethods.length,
242
+ persisted,
243
+ changed
244
+ });
245
+ return this.store.payMethods;
94
246
  }
95
247
  async fetchRemotePayMethods() {
96
- const requester = this.app?.request || this.request;
97
- const response = await requester.get('/shop/pay/custom-payment/all', undefined);
98
- const payMethods = response?.data || response || [];
99
- return Array.isArray(payMethods) ? payMethods : [];
248
+ const response = this.paymentDataSource ? await this.paymentDataSource.run({
249
+ http: {
250
+ url: '/shop/pay/custom-payment/all'
251
+ }
252
+ }) : await (this.app?.request || this.request).get('/shop/pay/custom-payment/all', undefined);
253
+ const payMethods = response?.data !== undefined ? response.data : response;
254
+ if (!Array.isArray(payMethods)) {
255
+ throw new Error('支付方式全量接口返回值不是数组');
256
+ }
257
+ if (payMethods.some(method => !method || method.id === undefined || method.id === null)) {
258
+ throw new Error('支付方式全量接口存在缺少 id 的记录');
259
+ }
260
+ return payMethods;
261
+ }
262
+ async loadPayMethodsFromSQLite() {
263
+ if (!this.dbManager) return {
264
+ available: false,
265
+ methods: []
266
+ };
267
+ try {
268
+ const rows = await this.dbManager.getAll(PAYMENT_METHOD_STORE_NAME);
269
+ if (!Array.isArray(rows) || rows.length === 0) {
270
+ return {
271
+ available: false,
272
+ methods: []
273
+ };
274
+ }
275
+ const currentShopScope = this.resolveCurrentShopScope();
276
+ if (!currentShopScope) {
277
+ this.logWarning('无法确认当前店铺,忽略 SQLite 支付方式快照');
278
+ return {
279
+ available: false,
280
+ methods: []
281
+ };
282
+ }
283
+ const scopedRows = rows.filter(row => String(row?.[SNAPSHOT_SHOP_ID_FIELD] || '') === currentShopScope);
284
+ if (scopedRows.length === 0) {
285
+ this.logWarning('忽略其他店铺的 SQLite 支付方式快照', {
286
+ currentShopScope,
287
+ storedShopScopes: [...new Set(rows.map(row => String(row?.[SNAPSHOT_SHOP_ID_FIELD] || '')).filter(Boolean))]
288
+ });
289
+ return {
290
+ available: false,
291
+ methods: []
292
+ };
293
+ }
294
+ const methods = scopedRows.slice().sort((left, right) => Number(left?.[SNAPSHOT_ORDER_FIELD] || 0) - Number(right?.[SNAPSHOT_ORDER_FIELD] || 0)).map(row => this.stripSnapshotFields(row));
295
+ return {
296
+ available: true,
297
+ methods
298
+ };
299
+ } catch (error) {
300
+ this.logWarning('从 SQLite 读取支付方式失败', {
301
+ error: this.getErrorMessage(error)
302
+ });
303
+ return {
304
+ available: false,
305
+ methods: []
306
+ };
307
+ }
308
+ }
309
+ async replacePayMethodsInSQLite(payMethods) {
310
+ if (!this.dbManager) return false;
311
+ const previousRows = await this.dbManager.getAll(PAYMENT_METHOD_STORE_NAME);
312
+ const shopScope = this.resolveCurrentShopScope(payMethods);
313
+ const snapshotRows = payMethods.map((method, index) => ({
314
+ ...method,
315
+ [SNAPSHOT_ORDER_FIELD]: index,
316
+ [SNAPSHOT_SHOP_ID_FIELD]: shopScope
317
+ }));
318
+ try {
319
+ await this.dbManager.clear(PAYMENT_METHOD_STORE_NAME);
320
+ if (snapshotRows.length > 0) {
321
+ await this.dbManager.bulkAdd(PAYMENT_METHOD_STORE_NAME, snapshotRows);
322
+ }
323
+ return true;
324
+ } catch (error) {
325
+ const writeError = this.getErrorMessage(error);
326
+ try {
327
+ await this.dbManager.clear(PAYMENT_METHOD_STORE_NAME);
328
+ if (Array.isArray(previousRows) && previousRows.length > 0) {
329
+ await this.dbManager.bulkAdd(PAYMENT_METHOD_STORE_NAME, previousRows);
330
+ }
331
+ } catch (rollbackError) {
332
+ this.logError('支付方式 SQLite 快照回滚失败', {
333
+ writeError,
334
+ rollbackError: this.getErrorMessage(rollbackError)
335
+ });
336
+ }
337
+ throw new Error(`支付方式 SQLite 全量替换失败: ${writeError}`);
338
+ }
339
+ }
340
+ resolveCurrentShopScope(payMethods = []) {
341
+ const readStorageObject = key => {
342
+ try {
343
+ const raw = this.app?.storage?.getStorage?.(key);
344
+ if (!raw) return {};
345
+ if (typeof raw === 'object') return raw;
346
+ const parsed = JSON.parse(raw);
347
+ return parsed && typeof parsed === 'object' ? parsed : {};
348
+ } catch {
349
+ return {};
350
+ }
351
+ };
352
+ const selectedStore = readStorageObject('selectedStore');
353
+ const core = readStorageObject('core');
354
+ const scope = selectedStore.id ?? selectedStore.shop_id ?? core.id ?? core.shop_id ?? payMethods.find(method => method?.shop_id != null)?.shop_id;
355
+ return scope === undefined || scope === null ? '' : String(scope);
356
+ }
357
+ stripSnapshotFields(row) {
358
+ const {
359
+ [SNAPSHOT_ORDER_FIELD]: _snapshotOrder,
360
+ [SNAPSHOT_SHOP_ID_FIELD]: _snapshotShopId,
361
+ ...method
362
+ } = row;
363
+ return method;
100
364
  }
101
- shouldFilterPayMethods(data, config) {
102
- return data?.filterPaymentMethods === true || config?.filterPaymentMethods === true;
365
+ arePayMethodsEqual(left, right) {
366
+ return (0, _lodashEs.isEqual)(left, right);
103
367
  }
104
368
  resolvePayMethods(payMethods, options) {
105
- if (!options.shouldFilter) return payMethods;
369
+ if (!options.shouldFilter) return [...payMethods];
106
370
  return this.filterPayMethods(payMethods);
107
371
  }
108
372
  filterPayMethods(payMethods) {
@@ -121,48 +385,56 @@ class PaymentServerModule extends _BaseModule.BaseModule {
121
385
  });
122
386
  return availableMethods;
123
387
  }
124
- setPayMethodCache(payMethods) {
125
- this.payMethodMemoryCache = payMethods;
126
- this.store.payMethods = payMethods;
388
+ setPayMethodMirror(payMethods) {
389
+ this.store.payMethods = payMethods.map(method => ({
390
+ ...method
391
+ }));
392
+ }
393
+ getErrorMessage(error) {
394
+ return error instanceof Error ? error.message : String(error);
127
395
  }
128
396
  logInfo(title, metadata) {
129
397
  try {
130
- if (this.logger) {
131
- this.logger.addLog({
132
- type: 'info',
133
- title: `[PaymentServerModule] ${title}`,
134
- metadata: metadata || {}
135
- });
136
- }
398
+ this.logger?.addLog({
399
+ type: 'info',
400
+ title: `[PaymentServerModule] ${title}`,
401
+ metadata: metadata || {}
402
+ });
137
403
  } catch {
138
404
  // 日志记录失败不影响主流程
139
405
  }
140
406
  }
141
407
  logWarning(title, metadata) {
142
408
  try {
143
- if (this.logger) {
144
- this.logger.addLog({
145
- type: 'warning',
146
- title: `[PaymentServerModule] ${title}`,
147
- metadata: metadata || {}
148
- });
149
- }
409
+ this.logger?.addLog({
410
+ type: 'warning',
411
+ title: `[PaymentServerModule] ${title}`,
412
+ metadata: metadata || {}
413
+ });
150
414
  } catch {
151
415
  // 日志记录失败不影响主流程
152
416
  }
153
417
  }
154
418
  logError(title, metadata) {
155
419
  try {
156
- if (this.logger) {
157
- this.logger.addLog({
158
- type: 'error',
159
- title: `[PaymentServerModule] ${title}`,
160
- metadata: metadata || {}
161
- });
162
- }
420
+ this.logger?.addLog({
421
+ type: 'error',
422
+ title: `[PaymentServerModule] ${title}`,
423
+ metadata: metadata || {}
424
+ });
163
425
  } catch {
164
426
  // 日志记录失败不影响主流程
165
427
  }
166
428
  }
429
+ destroy() {
430
+ if (this.syncTimer) clearTimeout(this.syncTimer);
431
+ this.syncTimer = undefined;
432
+ this.pendingMessageUuids.clear();
433
+ this.trailingMessageUuids.clear();
434
+ this.queuedTrailingRefresh = false;
435
+ this.paymentDataSource?.destroy?.();
436
+ this.paymentDataSource = undefined;
437
+ super.destroy();
438
+ }
167
439
  }
168
440
  exports.PaymentServerModule = PaymentServerModule;
@@ -72,6 +72,7 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
72
72
  private walletAssetsRefreshSequence;
73
73
  private salesDetailHydrateQueue;
74
74
  private serverOrderChangeUnsubscribe;
75
+ private paymentMethodsChangedUnsubscribe;
75
76
  private serverOrderChangeHydrateInFlight;
76
77
  private queuedServerOrderChanges;
77
78
  private serverOrderChangeSyncEnabled;
@@ -101,6 +102,7 @@ export declare class BaseSalesImpl extends BaseModule implements Module {
101
102
  private drainQueuedServerOrderChanges;
102
103
  private syncCurrentSalesDetailFromServerOrderChange;
103
104
  private registerServerOrderChangeSync;
105
+ private registerPaymentMethodsChangeSync;
104
106
  private hydrateLatestLoadedSalesDetail;
105
107
  private hydrateOrderPaymentNames;
106
108
  get payment(): PaymentModule | undefined;
@@ -37,6 +37,7 @@ var _transformBaseProductToOrderProduct = require("./utils/transformBaseProductT
37
37
  var _quotationPrice = require("./utils/quotationPrice");
38
38
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
39
39
  const SERVER_ORDER_CHANGED_EVENT = 'order:onOrdersChanged';
40
+ const PAYMENT_METHODS_CHANGED_EVENT = 'payment:onPaymentMethodsChanged';
40
41
  const OS_FULFILLMENT_REF_MODE_FIELD = '_os_fulfillment_ref_mode';
41
42
  const OS_INVOICE_LAYOUT_CONFIG_FIELD = '_os_invoice_layout_config';
42
43
  const OS_INVOICE_TEMPLATE_SETTINGS_FIELD = '_os_invoice_template_settings';
@@ -487,6 +488,7 @@ class BaseSalesImpl extends _BaseModule.BaseModule {
487
488
  walletAssetsRefreshSequence = 0;
488
489
  salesDetailHydrateQueue = Promise.resolve();
489
490
  serverOrderChangeUnsubscribe = null;
491
+ paymentMethodsChangedUnsubscribe = null;
490
492
  serverOrderChangeHydrateInFlight = null;
491
493
  queuedServerOrderChanges = [];
492
494
  serverOrderChangeSyncEnabled = false;
@@ -630,6 +632,15 @@ class BaseSalesImpl extends _BaseModule.BaseModule {
630
632
  });
631
633
  });
632
634
  }
635
+ registerPaymentMethodsChangeSync() {
636
+ this.paymentMethodsChangedUnsubscribe?.();
637
+ const effects = this.core?.effects;
638
+ if (!effects || typeof effects.on !== 'function') return;
639
+ this.paymentMethodsChangedUnsubscribe = effects.on(PAYMENT_METHODS_CHANGED_EVENT, async payload => {
640
+ if (!Array.isArray(payload?.newMethods)) return;
641
+ await this.getPaymentMethodsAsync();
642
+ });
643
+ }
633
644
  async hydrateLatestLoadedSalesDetail(record, loadSequence, options) {
634
645
  let hydratedSales = null;
635
646
  let skippedBeforeHydrate = false;
@@ -1429,12 +1440,15 @@ class BaseSalesImpl extends _BaseModule.BaseModule {
1429
1440
  this.store.order.setEnableTempOrderPersist(this.otherParams.enableTempOrderPersist);
1430
1441
  }
1431
1442
  await this.getPaymentMethodsAsync();
1443
+ this.registerPaymentMethodsChangeSync();
1432
1444
  this.registerServerOrderChangeSync();
1433
1445
  this.core.effects.emit(`${this.name}:onInited`, {});
1434
1446
  }
1435
1447
  async destroy() {
1436
1448
  this.serverOrderChangeUnsubscribe?.();
1437
1449
  this.serverOrderChangeUnsubscribe = null;
1450
+ this.paymentMethodsChangedUnsubscribe?.();
1451
+ this.paymentMethodsChangedUnsubscribe = null;
1438
1452
  Object.keys(this.store).forEach(key => {
1439
1453
  if (this.reusedSharedSubModuleNames.has(key)) return;
1440
1454
  const sub = this.store[key];
@@ -326,7 +326,7 @@ export declare class BookingByStepImpl extends BaseModule implements Module {
326
326
  date: string;
327
327
  status: string;
328
328
  week: string;
329
- weekNum: 0 | 2 | 1 | 6 | 5 | 3 | 4;
329
+ weekNum: 0 | 2 | 3 | 1 | 5 | 6 | 4;
330
330
  }[]>;
331
331
  submitTimeSlot(timeSlots: TimeSliceItem): void;
332
332
  private getScheduleDataByIds;
@@ -345,7 +345,7 @@ export declare class BookingTicketImpl extends BaseSalesImpl implements Module {
345
345
  * 获取当前的客户搜索条件
346
346
  * @returns 当前搜索条件
347
347
  */
348
- getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
348
+ getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "num" | "skip">;
349
349
  /**
350
350
  * 获取客户列表状态(包含滚动加载相关状态)
351
351
  * @returns 客户状态
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "2.3.113",
4
+ "version": "2.3.114",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",