@pisell/pisellos 2.2.66 → 2.2.67

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.
@@ -482,6 +482,8 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
482
482
  value: (function () {
483
483
  var _searchIdentificationCodeAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(params) {
484
484
  var config,
485
+ _ref,
486
+ _response2,
485
487
  code,
486
488
  isWalletCode,
487
489
  walletDetailParams,
@@ -564,20 +566,31 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
564
566
  multiple: searchParams.multiple,
565
567
  payment_order_id: baseWalletParams === null || baseWalletParams === void 0 ? void 0 : baseWalletParams.payment_order_id
566
568
  });
567
- _context6.next = 19;
569
+ if (!(!searchParams.products || ((_ref = searchParams.products || []) === null || _ref === void 0 ? void 0 : _ref.length) === 0)) {
570
+ _context6.next = 21;
571
+ break;
572
+ }
573
+ response = {
574
+ data: []
575
+ };
576
+ _context6.next = 24;
577
+ break;
578
+ case 21:
579
+ _context6.next = 23;
568
580
  return this.paymentModule.request.post('/machinecode/prepare/deduction/search', searchParams);
569
- case 19:
581
+ case 23:
570
582
  response = _context6.sent;
571
- searchResults = (response === null || response === void 0 ? void 0 : response.data) || [];
583
+ case 24:
584
+ searchResults = ((_response2 = response) === null || _response2 === void 0 ? void 0 : _response2.data) || [];
572
585
  if (!config.noCache) {
573
- _context6.next = 23;
586
+ _context6.next = 27;
574
587
  break;
575
588
  }
576
589
  return _context6.abrupt("return", {
577
590
  type: 'normalCode',
578
591
  data: searchResults
579
592
  });
580
- case 23:
593
+ case 27:
581
594
  // 将搜索结果存储到缓存数组中
582
595
  if (searchResults.length > 0) {
583
596
  // 避免重复存储相同的识别码
@@ -607,8 +620,8 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
607
620
  type: 'normalCode',
608
621
  data: searchResults
609
622
  });
610
- case 29:
611
- _context6.prev = 29;
623
+ case 33:
624
+ _context6.prev = 33;
612
625
  _context6.t0 = _context6["catch"](1);
613
626
  this.paymentModule.logError('[WalletPass] 搜索识别码信息失败', _context6.t0, {
614
627
  code: params.code,
@@ -616,11 +629,11 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
616
629
  order_expect_amount: params.order_expect_amount
617
630
  });
618
631
  throw _context6.t0;
619
- case 33:
632
+ case 37:
620
633
  case "end":
621
634
  return _context6.stop();
622
635
  }
623
- }, _callee6, this, [[1, 29]]);
636
+ }, _callee6, this, [[1, 33]]);
624
637
  }));
625
638
  function searchIdentificationCodeAsync(_x6) {
626
639
  return _searchIdentificationCodeAsync.apply(this, arguments);
@@ -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
  }
@@ -123,7 +123,7 @@ export declare class BookingTicketImpl extends BaseModule implements Module {
123
123
  * 获取当前的客户搜索条件
124
124
  * @returns 当前搜索条件
125
125
  */
126
- getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "num" | "skip">;
126
+ getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
127
127
  /**
128
128
  * 获取客户列表状态(包含滚动加载相关状态)
129
129
  * @returns 客户状态
@@ -346,6 +346,7 @@ var WalletPassPaymentImpl = class {
346
346
  * 特殊逻辑:当识别码长度为9位且前3位为"000"时,调用 /wallet/detail/search 接口
347
347
  */
348
348
  async searchIdentificationCodeAsync(params, config = {}) {
349
+ var _a;
349
350
  try {
350
351
  const { code } = params;
351
352
  this.paymentModule.logInfo("[WalletPass] 开始搜索识别码", {
@@ -403,10 +404,17 @@ var WalletPassPaymentImpl = class {
403
404
  multiple: searchParams.multiple,
404
405
  payment_order_id: baseWalletParams == null ? void 0 : baseWalletParams.payment_order_id
405
406
  });
406
- const response = await this.paymentModule.request.post(
407
- "/machinecode/prepare/deduction/search",
408
- searchParams
409
- );
407
+ let response;
408
+ if (!searchParams.products || ((_a = searchParams.products || []) == null ? void 0 : _a.length) === 0) {
409
+ response = {
410
+ data: []
411
+ };
412
+ } else {
413
+ response = await this.paymentModule.request.post(
414
+ "/machinecode/prepare/deduction/search",
415
+ searchParams
416
+ );
417
+ }
410
418
  const searchResults = (response == null ? void 0 : response.data) || [];
411
419
  if (config.noCache) {
412
420
  return {
@@ -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
  }
@@ -123,7 +123,7 @@ export declare class BookingTicketImpl extends BaseModule implements Module {
123
123
  * 获取当前的客户搜索条件
124
124
  * @returns 当前搜索条件
125
125
  */
126
- getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "num" | "skip">;
126
+ getCurrentCustomerSearchParams(): Omit<import("../../modules").ShopGetCustomerListParams, "skip" | "num">;
127
127
  /**
128
128
  * 获取客户列表状态(包含滚动加载相关状态)
129
129
  * @returns 客户状态
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "2.2.66",
4
+ "version": "2.2.67",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",