@pisell/pisellos 0.0.144 → 0.0.145

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.
@@ -179,8 +179,8 @@ export var RulesModule = /*#__PURE__*/function (_BaseModule) {
179
179
  } else if (a.tag === 'product_discount_card' && b.tag === 'product_discount_card') {
180
180
  // 都是折扣券,按照par_value排序(折扣越大越优先,即par_value越小越优先)
181
181
  if (a.par_value !== b.par_value) {
182
- var valueA = new Decimal(a.par_value || 0);
183
- var valueB = new Decimal(b.par_value || 0);
182
+ var valueA = new Decimal(100).minus(a.par_value || 0);
183
+ var valueB = new Decimal(100).minus(b.par_value || 0);
184
184
  return valueA.minus(valueB).toNumber();
185
185
  }
186
186
  // 相同折扣的情况下,按照过期时间排序
@@ -126,8 +126,8 @@ var RulesModule = class extends import_BaseModule.BaseModule {
126
126
  return compareByExpireTime(a, b);
127
127
  } else if (a.tag === "product_discount_card" && b.tag === "product_discount_card") {
128
128
  if (a.par_value !== b.par_value) {
129
- const valueA = new import_decimal.default(a.par_value || 0);
130
- const valueB = new import_decimal.default(b.par_value || 0);
129
+ const valueA = new import_decimal.default(100).minus(a.par_value || 0);
130
+ const valueB = new import_decimal.default(100).minus(b.par_value || 0);
131
131
  return valueA.minus(valueB).toNumber();
132
132
  }
133
133
  return compareByExpireTime(a, b);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@pisell/pisellos",
4
- "version": "0.0.144",
4
+ "version": "0.0.145",
5
5
  "description": "一个可扩展的前端模块化SDK框架,支持插件系统",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",