@pisell/pisellos 2.2.39 → 2.2.40

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 (99) 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 +0 -11
  5. package/dist/modules/Discount/types.d.ts +0 -15
  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 +3 -8
  13. package/dist/modules/Rules/index.js +23 -143
  14. package/dist/modules/Rules/types.d.ts +0 -1
  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/BookingTicket/index.d.ts +1 -1
  21. package/dist/solution/Checkout/index.js +0 -2
  22. package/dist/solution/RegisterAndLogin/config.js +339 -1
  23. package/dist/solution/ShopDiscount/index.d.ts +0 -1
  24. package/dist/solution/ShopDiscount/index.js +3 -13
  25. package/dist/solution/ShopDiscount/types.d.ts +0 -1
  26. package/lib/index.d.ts +0 -1
  27. package/lib/index.js +1 -3
  28. package/lib/modules/Cart/types.d.ts +0 -2
  29. package/lib/modules/Cart/utils/cartProduct.js +0 -9
  30. package/lib/modules/Discount/types.d.ts +0 -15
  31. package/lib/modules/Payment/index.d.ts +1 -2
  32. package/lib/modules/Payment/index.js +0 -1
  33. package/lib/modules/Payment/utils.js +0 -3
  34. package/lib/modules/Payment/walletpass.d.ts +0 -23
  35. package/lib/modules/Payment/walletpass.js +17 -94
  36. package/lib/modules/Product/index.d.ts +1 -1
  37. package/lib/modules/Rules/index.d.ts +3 -8
  38. package/lib/modules/Rules/index.js +187 -352
  39. package/lib/modules/Rules/types.d.ts +0 -1
  40. package/lib/modules/Summary/types.d.ts +0 -2
  41. package/lib/modules/Summary/utils.d.ts +0 -6
  42. package/lib/modules/Summary/utils.js +0 -15
  43. package/lib/plugins/window.d.ts +0 -2
  44. package/lib/solution/BookingByStep/index.d.ts +0 -1
  45. package/lib/solution/BookingTicket/index.d.ts +1 -1
  46. package/lib/solution/Checkout/index.js +0 -2
  47. package/lib/solution/RegisterAndLogin/config.js +265 -1
  48. package/lib/solution/ShopDiscount/index.d.ts +0 -1
  49. package/lib/solution/ShopDiscount/index.js +2 -8
  50. package/lib/solution/ShopDiscount/types.d.ts +0 -1
  51. package/package.json +1 -1
  52. package/dist/model/index.d.ts +0 -1
  53. package/dist/model/index.js +0 -1
  54. package/dist/model/strategy/adapter/index.d.ts +0 -3
  55. package/dist/model/strategy/adapter/index.js +0 -4
  56. package/dist/model/strategy/adapter/type.d.ts +0 -28
  57. package/dist/model/strategy/adapter/type.js +0 -1
  58. package/dist/model/strategy/adapter/walletPass/evaluator.d.ts +0 -84
  59. package/dist/model/strategy/adapter/walletPass/evaluator.js +0 -497
  60. package/dist/model/strategy/adapter/walletPass/example.d.ts +0 -4
  61. package/dist/model/strategy/adapter/walletPass/example.js +0 -258
  62. package/dist/model/strategy/adapter/walletPass/index.d.ts +0 -32
  63. package/dist/model/strategy/adapter/walletPass/index.js +0 -182
  64. package/dist/model/strategy/adapter/walletPass/locales.d.ts +0 -1
  65. package/dist/model/strategy/adapter/walletPass/locales.js +0 -23
  66. package/dist/model/strategy/adapter/walletPass/type.d.ts +0 -165
  67. package/dist/model/strategy/adapter/walletPass/type.js +0 -1
  68. package/dist/model/strategy/adapter/walletPass/utils.d.ts +0 -50
  69. package/dist/model/strategy/adapter/walletPass/utils.js +0 -965
  70. package/dist/model/strategy/index.d.ts +0 -94
  71. package/dist/model/strategy/index.js +0 -551
  72. package/dist/model/strategy/strategy-example.d.ts +0 -5
  73. package/dist/model/strategy/strategy-example.js +0 -331
  74. package/dist/model/strategy/type.d.ts +0 -228
  75. package/dist/model/strategy/type.js +0 -94
  76. package/lib/model/index.d.ts +0 -1
  77. package/lib/model/index.js +0 -23
  78. package/lib/model/strategy/adapter/index.d.ts +0 -3
  79. package/lib/model/strategy/adapter/index.js +0 -45
  80. package/lib/model/strategy/adapter/type.d.ts +0 -28
  81. package/lib/model/strategy/adapter/type.js +0 -17
  82. package/lib/model/strategy/adapter/walletPass/evaluator.d.ts +0 -84
  83. package/lib/model/strategy/adapter/walletPass/evaluator.js +0 -421
  84. package/lib/model/strategy/adapter/walletPass/example.d.ts +0 -4
  85. package/lib/model/strategy/adapter/walletPass/example.js +0 -207
  86. package/lib/model/strategy/adapter/walletPass/index.d.ts +0 -32
  87. package/lib/model/strategy/adapter/walletPass/index.js +0 -142
  88. package/lib/model/strategy/adapter/walletPass/locales.d.ts +0 -1
  89. package/lib/model/strategy/adapter/walletPass/locales.js +0 -51
  90. package/lib/model/strategy/adapter/walletPass/type.d.ts +0 -165
  91. package/lib/model/strategy/adapter/walletPass/type.js +0 -17
  92. package/lib/model/strategy/adapter/walletPass/utils.d.ts +0 -50
  93. package/lib/model/strategy/adapter/walletPass/utils.js +0 -660
  94. package/lib/model/strategy/index.d.ts +0 -94
  95. package/lib/model/strategy/index.js +0 -413
  96. package/lib/model/strategy/strategy-example.d.ts +0 -5
  97. package/lib/model/strategy/strategy-example.js +0 -318
  98. package/lib/model/strategy/type.d.ts +0 -228
  99. package/lib/model/strategy/type.js +0 -44
package/dist/index.d.ts CHANGED
@@ -6,7 +6,6 @@ export * from './types';
6
6
  export * from './modules';
7
7
  export * from './plugins';
8
8
  export * from './solution';
9
- export * from './model';
10
9
  export { PisellOSCore } from './core';
11
10
  import PisellOSCore from './core';
12
11
  export default PisellOSCore;
package/dist/index.js CHANGED
@@ -8,7 +8,6 @@ export * from "./types";
8
8
  export * from "./modules";
9
9
  export * from "./plugins";
10
10
  export * from "./solution";
11
- export * from "./model";
12
11
 
13
12
  // 导出核心实现
14
13
  export { PisellOSCore } from "./core";
@@ -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
  /** 商品图片 */
@@ -57,7 +57,6 @@ export var formatProductToCartItem = function formatProductToCartItem(params) {
57
57
  quantity = _params$quantity === void 0 ? 1 : _params$quantity,
58
58
  discounts = params.discounts;
59
59
  var num = quantity; // 当前按照单个商品加入购物车
60
-
61
60
  if (product) {
62
61
  cartItem.id = product === null || product === void 0 ? void 0 : product.id;
63
62
  cartItem.name = product === null || product === void 0 ? void 0 : product.title;
@@ -78,15 +77,6 @@ export var formatProductToCartItem = function formatProductToCartItem(params) {
78
77
  num: num,
79
78
  discounts: discounts
80
79
  });
81
- // 不包含折扣卡商品券的总价
82
- var origin_total = getProductTotalPrice({
83
- product: cartItem._productInit || cartItem._productOrigin,
84
- bundle: bundle,
85
- options: options,
86
- num: num,
87
- discounts: []
88
- });
89
- cartItem.summaryOriginTotal = (origin_total || 0) * (num || 1);
90
80
  cartItem.image = product === null || product === void 0 ? void 0 : product.cover;
91
81
  cartItem.like_status = 'common';
92
82
  cartItem.duration = product === null || product === void 0 ? void 0 : product.duration;
@@ -207,7 +197,6 @@ export var getProductTotalPrice = function getProductTotalPrice(params) {
207
197
  amount: currentValue.amount,
208
198
  tag: currentValue.type,
209
199
  par_value: currentValue.discount.percent,
210
- config: currentValue.config,
211
200
  metadata: {
212
201
  discount_card_type: currentValue === null || currentValue === void 0 || (_currentValue$discoun = currentValue.discount) === null || _currentValue$discoun === void 0 ? void 0 : _currentValue$discoun.discount_card_type
213
202
  }
@@ -25,8 +25,6 @@ interface Limitedrelationproductdata {
25
25
  product_ids: number[];
26
26
  product_collection_id: number[];
27
27
  package_sub_item_usage_rules?: PackageSubItemUsageRules;
28
- filter: 0 | 1;
29
- exclude_product_ids: number[];
30
28
  }
31
29
  interface ApplicableProductDetails {
32
30
  amount: string;
@@ -107,19 +105,6 @@ export interface Discount {
107
105
  isSelected?: boolean;
108
106
  isAvailable?: boolean;
109
107
  isUsed?: boolean;
110
- config?: {
111
- isAvailable?: boolean;
112
- /** 最大抵扣金额 */
113
- maxDeductionAmount?: number;
114
- /** 每单最多使用张数 */
115
- maxUsagePerOrder?: number;
116
- /** 是否抵扣税费与附加费 */
117
- deductTaxAndFee?: boolean;
118
- /** 适用粒度(多商品共用) */
119
- allowCrossProduct?: boolean;
120
- /** 可用商品数量上限 */
121
- applicableProductLimit?: number;
122
- };
123
108
  applicableProductIds?: number[];
124
109
  applicableProductDetails: ApplicableProductDetails[];
125
110
  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
  private voucherUpdateLockByOrderUuid;
@@ -96,8 +96,6 @@ export var PaymentModule = /*#__PURE__*/function (_BaseModule) {
96
96
  _defineProperty(_assertThisInitialized(_this), "app", void 0);
97
97
  // App instance
98
98
  _defineProperty(_assertThisInitialized(_this), "store", void 0);
99
- _defineProperty(_assertThisInitialized(_this), "window", void 0);
100
- // WindowPlugin 实例
101
99
  _defineProperty(_assertThisInitialized(_this), "dbManager", void 0);
102
100
  // IndexDBManager 实例
103
101
  _defineProperty(_assertThisInitialized(_this), "logger", void 0);
@@ -172,27 +170,26 @@ export var PaymentModule = /*#__PURE__*/function (_BaseModule) {
172
170
  // 获取依赖的插件
173
171
  this.request = core.getPlugin('request');
174
172
  appPlugin = core.getPlugin('app');
175
- this.window = core.getPlugin('window');
176
173
  if (this.request) {
177
- _context.next = 8;
174
+ _context.next = 7;
178
175
  break;
179
176
  }
180
177
  throw new Error('支付模块需要 request 插件支持');
181
- case 8:
178
+ case 7:
182
179
  if (appPlugin) {
183
- _context.next = 10;
180
+ _context.next = 9;
184
181
  break;
185
182
  }
186
183
  throw new Error('支付模块需要 app 插件支持');
187
- case 10:
184
+ case 9:
188
185
  this.app = appPlugin.getApp();
189
186
  this.dbManager = this.app.dbManager;
190
187
  this.logger = this.app.logger;
191
188
 
192
189
  // 确保支付模块所需的对象存储已创建
193
- _context.next = 15;
190
+ _context.next = 14;
194
191
  return this.ensurePaymentTables();
195
- case 15:
192
+ case 14:
196
193
  this.registerNetworkHandlers();
197
194
 
198
195
  // // 预连接数据库
@@ -200,7 +197,7 @@ export var PaymentModule = /*#__PURE__*/function (_BaseModule) {
200
197
 
201
198
  console.log('[PaymentModule] 初始化完成');
202
199
  this.logInfo('PaymentModule initialized successfully');
203
- case 18:
200
+ case 17:
204
201
  case "end":
205
202
  return _context.stop();
206
203
  }
@@ -1,8 +1,5 @@
1
1
  // 获取walletPass可用最大金额
2
2
  export var getAvailableMaxAmount = function getAvailableMaxAmount(data) {
3
- if (typeof data._available_max_amount === 'number') {
4
- return data._available_max_amount;
5
- }
6
3
  return data.tag !== 'point_card' ? data.available_max_amount : data === null || data === void 0 ? void 0 : data.recommended_usage_amount;
7
4
  };
8
5
 
@@ -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
  */