@pisell/pisellos 2.1.54 → 2.1.59

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 (95) 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 +2 -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/Rules/index.d.ts +5 -8
  12. package/dist/modules/Rules/index.js +31 -154
  13. package/dist/modules/Rules/types.d.ts +1 -1
  14. package/dist/modules/Summary/types.d.ts +0 -2
  15. package/dist/modules/Summary/utils.d.ts +0 -6
  16. package/dist/modules/Summary/utils.js +0 -21
  17. package/dist/plugins/window.d.ts +0 -2
  18. package/dist/solution/BookingByStep/index.d.ts +1 -2
  19. package/dist/solution/Checkout/index.js +0 -2
  20. package/dist/solution/ShopDiscount/index.d.ts +4 -1
  21. package/dist/solution/ShopDiscount/index.js +11 -12
  22. package/dist/solution/ShopDiscount/types.d.ts +4 -1
  23. package/dist/solution/ShopDiscount/utils.js +28 -29
  24. package/lib/index.d.ts +0 -1
  25. package/lib/index.js +1 -3
  26. package/lib/modules/Cart/types.d.ts +0 -2
  27. package/lib/modules/Cart/utils/cartProduct.js +0 -9
  28. package/lib/modules/Discount/types.d.ts +2 -15
  29. package/lib/modules/Payment/index.d.ts +1 -2
  30. package/lib/modules/Payment/index.js +0 -1
  31. package/lib/modules/Payment/utils.js +0 -3
  32. package/lib/modules/Payment/walletpass.d.ts +0 -23
  33. package/lib/modules/Payment/walletpass.js +17 -94
  34. package/lib/modules/Rules/index.d.ts +5 -8
  35. package/lib/modules/Rules/index.js +197 -372
  36. package/lib/modules/Rules/types.d.ts +1 -1
  37. package/lib/modules/Summary/types.d.ts +0 -2
  38. package/lib/modules/Summary/utils.d.ts +0 -6
  39. package/lib/modules/Summary/utils.js +0 -15
  40. package/lib/plugins/window.d.ts +0 -2
  41. package/lib/solution/BookingByStep/index.d.ts +1 -2
  42. package/lib/solution/Checkout/index.js +0 -2
  43. package/lib/solution/ShopDiscount/index.d.ts +4 -1
  44. package/lib/solution/ShopDiscount/index.js +9 -8
  45. package/lib/solution/ShopDiscount/types.d.ts +4 -1
  46. package/lib/solution/ShopDiscount/utils.js +18 -13
  47. package/package.json +1 -1
  48. package/dist/model/index.d.ts +0 -1
  49. package/dist/model/index.js +0 -1
  50. package/dist/model/strategy/adapter/index.d.ts +0 -3
  51. package/dist/model/strategy/adapter/index.js +0 -4
  52. package/dist/model/strategy/adapter/type.d.ts +0 -28
  53. package/dist/model/strategy/adapter/type.js +0 -1
  54. package/dist/model/strategy/adapter/walletPass/evaluator.d.ts +0 -84
  55. package/dist/model/strategy/adapter/walletPass/evaluator.js +0 -496
  56. package/dist/model/strategy/adapter/walletPass/example.d.ts +0 -4
  57. package/dist/model/strategy/adapter/walletPass/example.js +0 -258
  58. package/dist/model/strategy/adapter/walletPass/index.d.ts +0 -32
  59. package/dist/model/strategy/adapter/walletPass/index.js +0 -182
  60. package/dist/model/strategy/adapter/walletPass/locales.d.ts +0 -1
  61. package/dist/model/strategy/adapter/walletPass/locales.js +0 -23
  62. package/dist/model/strategy/adapter/walletPass/type.d.ts +0 -163
  63. package/dist/model/strategy/adapter/walletPass/type.js +0 -1
  64. package/dist/model/strategy/adapter/walletPass/utils.d.ts +0 -50
  65. package/dist/model/strategy/adapter/walletPass/utils.js +0 -965
  66. package/dist/model/strategy/index.d.ts +0 -94
  67. package/dist/model/strategy/index.js +0 -551
  68. package/dist/model/strategy/strategy-example.d.ts +0 -5
  69. package/dist/model/strategy/strategy-example.js +0 -331
  70. package/dist/model/strategy/type.d.ts +0 -228
  71. package/dist/model/strategy/type.js +0 -94
  72. package/lib/model/index.d.ts +0 -1
  73. package/lib/model/index.js +0 -23
  74. package/lib/model/strategy/adapter/index.d.ts +0 -3
  75. package/lib/model/strategy/adapter/index.js +0 -45
  76. package/lib/model/strategy/adapter/type.d.ts +0 -28
  77. package/lib/model/strategy/adapter/type.js +0 -17
  78. package/lib/model/strategy/adapter/walletPass/evaluator.d.ts +0 -84
  79. package/lib/model/strategy/adapter/walletPass/evaluator.js +0 -420
  80. package/lib/model/strategy/adapter/walletPass/example.d.ts +0 -4
  81. package/lib/model/strategy/adapter/walletPass/example.js +0 -207
  82. package/lib/model/strategy/adapter/walletPass/index.d.ts +0 -32
  83. package/lib/model/strategy/adapter/walletPass/index.js +0 -142
  84. package/lib/model/strategy/adapter/walletPass/locales.d.ts +0 -1
  85. package/lib/model/strategy/adapter/walletPass/locales.js +0 -51
  86. package/lib/model/strategy/adapter/walletPass/type.d.ts +0 -163
  87. package/lib/model/strategy/adapter/walletPass/type.js +0 -17
  88. package/lib/model/strategy/adapter/walletPass/utils.d.ts +0 -50
  89. package/lib/model/strategy/adapter/walletPass/utils.js +0 -660
  90. package/lib/model/strategy/index.d.ts +0 -94
  91. package/lib/model/strategy/index.js +0 -413
  92. package/lib/model/strategy/strategy-example.d.ts +0 -5
  93. package/lib/model/strategy/strategy-example.js +0 -318
  94. package/lib/model/strategy/type.d.ts +0 -228
  95. package/lib/model/strategy/type.js +0 -44
@@ -1,14 +1,10 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
2
  function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
3
3
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
5
  function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
5
6
  function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
6
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
7
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
8
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
9
7
  function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
10
- function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
11
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
12
8
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
13
9
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
14
10
  function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
@@ -33,7 +29,6 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
33
29
  _defineProperty(this, "userIdentificationCodes", []);
34
30
  _defineProperty(this, "searchResults", []);
35
31
  _defineProperty(this, "walletParams", null);
36
- _defineProperty(this, "walletInitData", null);
37
32
  this.paymentModule = paymentModule;
38
33
  }
39
34
 
@@ -144,10 +139,7 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
144
139
  }
145
140
  return _context.abrupt("return", {
146
141
  walletRecommendList: [],
147
- userIdentificationCodes: [],
148
- transformList: [],
149
- noApplicableVoucher: [],
150
- products: []
142
+ userIdentificationCodes: []
151
143
  });
152
144
  case 4:
153
145
  // 发送初始化开始事件
@@ -212,121 +204,53 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
212
204
  return initializeWalletDataFromBusinessAsync;
213
205
  }()
214
206
  /**
215
- * 获取订单基础详情
207
+ * 初始化钱包数据
208
+ * 先获取推荐列表,再获取用户识别码列表(顺序执行)
216
209
  */
217
210
  )
218
211
  }, {
219
- key: "getOrderBasicDetailAsync",
212
+ key: "initializeWalletDataAsync",
220
213
  value: (function () {
221
- var _getOrderBasicDetailAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(orderId) {
222
- var response;
214
+ var _initializeWalletDataAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(baseParams) {
215
+ var walletRecommendList, identificationParams, userIdentificationCodes;
223
216
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
224
217
  while (1) switch (_context2.prev = _context2.next) {
225
218
  case 0:
226
219
  _context2.prev = 0;
227
220
  _context2.next = 3;
228
- return this.paymentModule.request.get("/order/order/".concat(orderId, "/basic-detail"));
221
+ return this.getWalletPassRecommendListAsync(baseParams);
229
222
  case 3:
230
- response = _context2.sent;
231
- return _context2.abrupt("return", (response === null || response === void 0 ? void 0 : response.data) || {});
232
- case 7:
233
- _context2.prev = 7;
234
- _context2.t0 = _context2["catch"](0);
235
- throw _context2.t0;
236
- case 10:
237
- case "end":
238
- return _context2.stop();
239
- }
240
- }, _callee2, this, [[0, 7]]);
241
- }));
242
- function getOrderBasicDetailAsync(_x2) {
243
- return _getOrderBasicDetailAsync.apply(this, arguments);
244
- }
245
- return getOrderBasicDetailAsync;
246
- }()
247
- /**
248
- * 初始化钱包数据
249
- * 先获取推荐列表,再获取用户识别码列表(顺序执行)
250
- */
251
- )
252
- }, {
253
- key: "initializeWalletDataAsync",
254
- value: (function () {
255
- var _initializeWalletDataAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(baseParams) {
256
- var _this$paymentModule$w, _this$paymentModule$w2, identificationParams, _yield$Promise$all, _yield$Promise$all2, allList, orderBasicDetail, walletPassEvaluator, products, res, recommended, transformList, noApplicableVoucher, recommendedAmount;
257
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
258
- while (1) switch (_context3.prev = _context3.next) {
259
- case 0:
260
- _context3.prev = 0;
223
+ walletRecommendList = _context2.sent;
261
224
  // 格式化用户识别码列表参数
262
225
  identificationParams = _objectSpread(_objectSpread({}, baseParams), {}, {
263
226
  available: 2,
264
- prepare_payments: [],
227
+ prepare_payments: this.formatWalletPassList2PreparePayments(walletRecommendList),
265
228
  other_exact_codes: [],
266
229
  filter_prepare_wallet_pass: 1
267
- }); // 并行获取用户识别码列表和订单详情
268
- _context3.next = 4;
269
- return Promise.all([this.getUserIdentificationCodeListAsync(identificationParams), baseParams.payment_order_id ? this.getOrderBasicDetailAsync(baseParams.payment_order_id) : Promise.resolve(null)]);
270
- case 4:
271
- _yield$Promise$all = _context3.sent;
272
- _yield$Promise$all2 = _slicedToArray(_yield$Promise$all, 2);
273
- allList = _yield$Promise$all2[0];
274
- orderBasicDetail = _yield$Promise$all2[1];
275
- walletPassEvaluator = (_this$paymentModule$w = this.paymentModule.window) === null || _this$paymentModule$w === void 0 || (_this$paymentModule$w2 = _this$paymentModule$w.getWalletPassEvaluator) === null || _this$paymentModule$w2 === void 0 ? void 0 : _this$paymentModule$w2.call(_this$paymentModule$w);
276
- if (walletPassEvaluator) {
277
- _context3.next = 11;
278
- break;
279
- }
280
- return _context3.abrupt("return", {
281
- walletRecommendList: [],
282
- userIdentificationCodes: [],
283
- transformList: [],
284
- noApplicableVoucher: [],
285
- products: []
230
+ }); // 再获取用户识别码列表
231
+ _context2.next = 7;
232
+ return this.getUserIdentificationCodeListAsync(identificationParams);
233
+ case 7:
234
+ userIdentificationCodes = _context2.sent;
235
+ return _context2.abrupt("return", {
236
+ walletRecommendList: walletRecommendList,
237
+ userIdentificationCodes: userIdentificationCodes
286
238
  });
287
239
  case 11:
288
- products = (orderBasicDetail === null || orderBasicDetail === void 0 ? void 0 : orderBasicDetail.detail) || baseParams.products;
289
- res = walletPassEvaluator === null || walletPassEvaluator === void 0 ? void 0 : walletPassEvaluator.getRecommendedVouchers({
290
- orderTotalAmount: baseParams.order_wait_pay_amount,
291
- products: products,
292
- vouchers: allList
293
- });
294
- recommended = res.recommended, transformList = res.transformList, noApplicableVoucher = res.noApplicableVoucher, recommendedAmount = res.recommendedAmount;
295
- console.log(res, 'resres12');
296
- this.walletRecommendList = recommended;
297
-
298
- // 存储初始化数据到内存中,供 useWalletPass 使用
299
- this.walletInitData = {
300
- transformList: transformList,
301
- noApplicableVoucher: noApplicableVoucher,
302
- products: products || []
303
- };
304
-
305
- // // 再获取用户识别码列表
306
- // const userIdentificationCodes =
307
- // await this.getUserIdentificationCodeListAsync(identificationParams);
308
- return _context3.abrupt("return", {
309
- walletRecommendList: recommended,
310
- userIdentificationCodes: allList,
311
- transformList: transformList,
312
- noApplicableVoucher: noApplicableVoucher,
313
- products: products || []
314
- });
315
- case 20:
316
- _context3.prev = 20;
317
- _context3.t0 = _context3["catch"](0);
318
- this.paymentModule.logError('[WalletPass] 初始化钱包数据失败', _context3.t0, {
240
+ _context2.prev = 11;
241
+ _context2.t0 = _context2["catch"](0);
242
+ this.paymentModule.logError('[WalletPass] 初始化钱包数据失败', _context2.t0, {
319
243
  customer_id: baseParams.customer_id,
320
244
  order_expect_amount: baseParams.order_expect_amount
321
245
  });
322
- throw _context3.t0;
323
- case 24:
246
+ throw _context2.t0;
247
+ case 15:
324
248
  case "end":
325
- return _context3.stop();
249
+ return _context2.stop();
326
250
  }
327
- }, _callee3, this, [[0, 20]]);
251
+ }, _callee2, this, [[0, 11]]);
328
252
  }));
329
- function initializeWalletDataAsync(_x3) {
253
+ function initializeWalletDataAsync(_x2) {
330
254
  return _initializeWalletDataAsync.apply(this, arguments);
331
255
  }
332
256
  return initializeWalletDataAsync;
@@ -334,23 +258,23 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
334
258
  }, {
335
259
  key: "getWalletPassRecommendListAsync",
336
260
  value: function () {
337
- var _getWalletPassRecommendListAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(params) {
261
+ var _getWalletPassRecommendListAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(params) {
338
262
  var _this$walletParams, response;
339
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
340
- while (1) switch (_context4.prev = _context4.next) {
263
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
264
+ while (1) switch (_context3.prev = _context3.next) {
341
265
  case 0:
342
- _context4.prev = 0;
266
+ _context3.prev = 0;
343
267
  this.paymentModule.logInfo('[WalletPass] 开始获取钱包推荐列表', {
344
268
  customer_id: params.customer_id,
345
269
  order_expect_amount: params.order_expect_amount,
346
270
  sale_channel: params.sale_channel,
347
271
  payment_order_id: (_this$walletParams = this.walletParams) === null || _this$walletParams === void 0 ? void 0 : _this$walletParams.payment_order_id
348
272
  });
349
- _context4.next = 4;
273
+ _context3.next = 4;
350
274
  return this.paymentModule.request.post('/machinecode/prepare/deduction/recommend', params // 将 params 作为请求体数据
351
275
  );
352
276
  case 4:
353
- response = _context4.sent;
277
+ response = _context3.sent;
354
278
  this.walletRecommendList = (response === null || response === void 0 ? void 0 : response.data) || [];
355
279
 
356
280
  // 发送钱包推荐列表更新事件(使用专用的WalletPassHooks)
@@ -368,24 +292,24 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
368
292
  };
369
293
  })
370
294
  });
371
- return _context4.abrupt("return", this.walletRecommendList);
295
+ return _context3.abrupt("return", this.walletRecommendList);
372
296
  case 11:
373
- _context4.prev = 11;
374
- _context4.t0 = _context4["catch"](0);
375
- this.paymentModule.logError('[WalletPass] 获取钱包推荐列表失败', _context4.t0, {
297
+ _context3.prev = 11;
298
+ _context3.t0 = _context3["catch"](0);
299
+ this.paymentModule.logError('[WalletPass] 获取钱包推荐列表失败', _context3.t0, {
376
300
  customer_id: params.customer_id,
377
301
  order_expect_amount: params.order_expect_amount,
378
302
  sale_channel: params.sale_channel
379
303
  });
380
304
  // throw error;
381
- return _context4.abrupt("return", []);
305
+ return _context3.abrupt("return", []);
382
306
  case 15:
383
307
  case "end":
384
- return _context4.stop();
308
+ return _context3.stop();
385
309
  }
386
- }, _callee4, this, [[0, 11]]);
310
+ }, _callee3, this, [[0, 11]]);
387
311
  }));
388
- function getWalletPassRecommendListAsync(_x4) {
312
+ function getWalletPassRecommendListAsync(_x3) {
389
313
  return _getWalletPassRecommendListAsync.apply(this, arguments);
390
314
  }
391
315
  return getWalletPassRecommendListAsync;
@@ -398,12 +322,12 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
398
322
  }, {
399
323
  key: "getUserIdentificationCodeListAsync",
400
324
  value: function () {
401
- var _getUserIdentificationCodeListAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(params) {
325
+ var _getUserIdentificationCodeListAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(params) {
402
326
  var _newParams$prepare_pa, _this$walletParams2, newParams, response, sortedData;
403
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
404
- while (1) switch (_context5.prev = _context5.next) {
327
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
328
+ while (1) switch (_context4.prev = _context4.next) {
405
329
  case 0:
406
- _context5.prev = 0;
330
+ _context4.prev = 0;
407
331
  newParams = _objectSpread(_objectSpread({}, this.walletParams), params);
408
332
  this.paymentModule.logInfo('[WalletPass] 开始获取用户识别码列表', {
409
333
  customer_id: newParams.customer_id,
@@ -412,10 +336,10 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
412
336
  filter_prepare_wallet_pass: newParams.filter_prepare_wallet_pass,
413
337
  payment_order_id: (_this$walletParams2 = this.walletParams) === null || _this$walletParams2 === void 0 ? void 0 : _this$walletParams2.payment_order_id
414
338
  });
415
- _context5.next = 5;
339
+ _context4.next = 5;
416
340
  return this.paymentModule.request.post('/machinecode/prepare/deduction', newParams);
417
341
  case 5:
418
- response = _context5.sent;
342
+ response = _context4.sent;
419
343
  // 对获取到的数据进行排序,将错误码为 500100、500200、500300 的项目排到最后
420
344
  sortedData = sortUserIdentificationCodeList((response === null || response === void 0 ? void 0 : response.data) || []);
421
345
  this.userIdentificationCodes = sortedData;
@@ -434,22 +358,22 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
434
358
  };
435
359
  })
436
360
  });
437
- return _context5.abrupt("return", this.userIdentificationCodes);
361
+ return _context4.abrupt("return", this.userIdentificationCodes);
438
362
  case 13:
439
- _context5.prev = 13;
440
- _context5.t0 = _context5["catch"](0);
441
- this.paymentModule.logError('[WalletPass] 获取用户识别码列表失败', _context5.t0, {
363
+ _context4.prev = 13;
364
+ _context4.t0 = _context4["catch"](0);
365
+ this.paymentModule.logError('[WalletPass] 获取用户识别码列表失败', _context4.t0, {
442
366
  customer_id: params.customer_id,
443
367
  available: params.available
444
368
  });
445
- return _context5.abrupt("return", []);
369
+ return _context4.abrupt("return", []);
446
370
  case 17:
447
371
  case "end":
448
- return _context5.stop();
372
+ return _context4.stop();
449
373
  }
450
- }, _callee5, this, [[0, 13]]);
374
+ }, _callee4, this, [[0, 13]]);
451
375
  }));
452
- function getUserIdentificationCodeListAsync(_x5) {
376
+ function getUserIdentificationCodeListAsync(_x4) {
453
377
  return _getUserIdentificationCodeListAsync.apply(this, arguments);
454
378
  }
455
379
  return getUserIdentificationCodeListAsync;
@@ -463,7 +387,7 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
463
387
  }, {
464
388
  key: "searchIdentificationCodeAsync",
465
389
  value: (function () {
466
- var _searchIdentificationCodeAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(params) {
390
+ var _searchIdentificationCodeAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(params) {
467
391
  var config,
468
392
  code,
469
393
  isWalletCode,
@@ -477,12 +401,12 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
477
401
  _this$searchResults,
478
402
  existingCodes,
479
403
  newResults,
480
- _args6 = arguments;
481
- return _regeneratorRuntime().wrap(function _callee6$(_context6) {
482
- while (1) switch (_context6.prev = _context6.next) {
404
+ _args5 = arguments;
405
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
406
+ while (1) switch (_context5.prev = _context5.next) {
483
407
  case 0:
484
- config = _args6.length > 1 && _args6[1] !== undefined ? _args6[1] : {};
485
- _context6.prev = 1;
408
+ config = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {};
409
+ _context5.prev = 1;
486
410
  code = params.code;
487
411
  this.paymentModule.logInfo('[WalletPass] 开始搜索识别码', {
488
412
  code: code,
@@ -494,7 +418,7 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
494
418
  isWalletCode = code.length === 9 && code.startsWith('000'); // 测试环境先使用 WL
495
419
  // const isWalletCode = code.startsWith('WL');
496
420
  if (!isWalletCode) {
497
- _context6.next = 14;
421
+ _context5.next = 14;
498
422
  break;
499
423
  }
500
424
  // 钱包识别码直接调用专门接口,不缓存,直接返回
@@ -508,17 +432,17 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
508
432
  with_customer: walletDetailParams.with_customer,
509
433
  with: walletDetailParams.with
510
434
  });
511
- _context6.next = 10;
435
+ _context5.next = 10;
512
436
  return this.paymentModule.request.post('/wallet/detail/search', walletDetailParams);
513
437
  case 10:
514
- _response = _context6.sent;
438
+ _response = _context5.sent;
515
439
  _searchResults = (_response === null || _response === void 0 ? void 0 : _response.data) || [];
516
440
  this.paymentModule.logInfo('[WalletPass] 钱包识别码搜索完成', {
517
441
  code: code,
518
442
  results_count: _searchResults.length,
519
443
  type: 'walletCode'
520
444
  });
521
- return _context6.abrupt("return", {
445
+ return _context5.abrupt("return", {
522
446
  type: 'walletCode',
523
447
  data: _searchResults
524
448
  });
@@ -527,7 +451,7 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
527
451
  baseWalletParams = this.walletParams; // 构建完整的搜索参数,包含钱包扣款推荐的所有参数
528
452
  searchParams = {
529
453
  // 基础钱包参数
530
- sale_channel: params.sale_channel || (baseWalletParams === null || baseWalletParams === void 0 ? void 0 : baseWalletParams.sale_channel) || 'pos',
454
+ sale_channel: params.sale_channel || (baseWalletParams === null || baseWalletParams === void 0 ? void 0 : baseWalletParams.sale_channel) || "pos",
531
455
  customer_id: params.customer_id || (baseWalletParams === null || baseWalletParams === void 0 ? void 0 : baseWalletParams.customer_id),
532
456
  order_expect_amount: params.order_expect_amount || (baseWalletParams === null || baseWalletParams === void 0 ? void 0 : baseWalletParams.order_expect_amount),
533
457
  order_product_amount: params.order_product_amount || (baseWalletParams === null || baseWalletParams === void 0 ? void 0 : baseWalletParams.order_product_amount),
@@ -547,16 +471,16 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
547
471
  multiple: searchParams.multiple,
548
472
  payment_order_id: baseWalletParams === null || baseWalletParams === void 0 ? void 0 : baseWalletParams.payment_order_id
549
473
  });
550
- _context6.next = 19;
474
+ _context5.next = 19;
551
475
  return this.paymentModule.request.post('/machinecode/prepare/deduction/search', searchParams);
552
476
  case 19:
553
- response = _context6.sent;
477
+ response = _context5.sent;
554
478
  searchResults = (response === null || response === void 0 ? void 0 : response.data) || [];
555
479
  if (!config.noCache) {
556
- _context6.next = 23;
480
+ _context5.next = 23;
557
481
  break;
558
482
  }
559
- return _context6.abrupt("return", {
483
+ return _context5.abrupt("return", {
560
484
  type: 'normalCode',
561
485
  data: searchResults
562
486
  });
@@ -586,26 +510,26 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
586
510
  cached_results_count: this.searchResults.length,
587
511
  type: 'normalCode'
588
512
  });
589
- return _context6.abrupt("return", {
513
+ return _context5.abrupt("return", {
590
514
  type: 'normalCode',
591
515
  data: searchResults
592
516
  });
593
517
  case 29:
594
- _context6.prev = 29;
595
- _context6.t0 = _context6["catch"](1);
596
- this.paymentModule.logError('[WalletPass] 搜索识别码信息失败', _context6.t0, {
518
+ _context5.prev = 29;
519
+ _context5.t0 = _context5["catch"](1);
520
+ this.paymentModule.logError('[WalletPass] 搜索识别码信息失败', _context5.t0, {
597
521
  code: params.code,
598
522
  customer_id: params.customer_id,
599
523
  order_expect_amount: params.order_expect_amount
600
524
  });
601
- throw _context6.t0;
525
+ throw _context5.t0;
602
526
  case 33:
603
527
  case "end":
604
- return _context6.stop();
528
+ return _context5.stop();
605
529
  }
606
- }, _callee6, this, [[1, 29]]);
530
+ }, _callee5, this, [[1, 29]]);
607
531
  }));
608
- function searchIdentificationCodeAsync(_x6) {
532
+ function searchIdentificationCodeAsync(_x5) {
609
533
  return _searchIdentificationCodeAsync.apply(this, arguments);
610
534
  }
611
535
  return searchIdentificationCodeAsync;
@@ -613,22 +537,22 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
613
537
  }, {
614
538
  key: "processWalletPayment",
615
539
  value: function () {
616
- var _processWalletPayment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(amount, orderUuid, voucherId) {
540
+ var _processWalletPayment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(amount, orderUuid, voucherId) {
617
541
  var walletMethod, paymentItem;
618
- return _regeneratorRuntime().wrap(function _callee7$(_context7) {
619
- while (1) switch (_context7.prev = _context7.next) {
542
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
543
+ while (1) switch (_context6.prev = _context6.next) {
620
544
  case 0:
621
545
  this.paymentModule.logInfo('[WalletPass] 开始处理钱包支付', {
622
546
  amount: amount,
623
547
  orderUuid: orderUuid,
624
548
  voucherId: voucherId || 'none'
625
549
  });
626
- _context7.next = 3;
550
+ _context6.next = 3;
627
551
  return this.paymentModule.getWalletPaymentMethod();
628
552
  case 3:
629
- walletMethod = _context7.sent;
553
+ walletMethod = _context6.sent;
630
554
  if (walletMethod) {
631
- _context7.next = 7;
555
+ _context6.next = 7;
632
556
  break;
633
557
  }
634
558
  this.paymentModule.logError('[WalletPass] 钱包支付方式未找到', null, {
@@ -646,7 +570,7 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
646
570
  type: walletMethod.type,
647
571
  voucher_id: voucherId || ''
648
572
  };
649
- _context7.next = 10;
573
+ _context6.next = 10;
650
574
  return this.paymentModule.addPaymentItemAsync(orderUuid, paymentItem);
651
575
  case 10:
652
576
  this.paymentModule.logInfo('[WalletPass] 钱包支付处理完成', {
@@ -657,11 +581,11 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
657
581
  });
658
582
  case 11:
659
583
  case "end":
660
- return _context7.stop();
584
+ return _context6.stop();
661
585
  }
662
- }, _callee7, this);
586
+ }, _callee6, this);
663
587
  }));
664
- function processWalletPayment(_x7, _x8, _x9) {
588
+ function processWalletPayment(_x6, _x7, _x8) {
665
589
  return _processWalletPayment.apply(this, arguments);
666
590
  }
667
591
  return processWalletPayment;
@@ -669,18 +593,18 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
669
593
  }, {
670
594
  key: "getWalletBalance",
671
595
  value: function () {
672
- var _getWalletBalance = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(voucherId) {
673
- return _regeneratorRuntime().wrap(function _callee8$(_context8) {
674
- while (1) switch (_context8.prev = _context8.next) {
596
+ var _getWalletBalance = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(voucherId) {
597
+ return _regeneratorRuntime().wrap(function _callee7$(_context7) {
598
+ while (1) switch (_context7.prev = _context7.next) {
675
599
  case 0:
676
- return _context8.abrupt("return", 0);
600
+ return _context7.abrupt("return", 0);
677
601
  case 1:
678
602
  case "end":
679
- return _context8.stop();
603
+ return _context7.stop();
680
604
  }
681
- }, _callee8);
605
+ }, _callee7);
682
606
  }));
683
- function getWalletBalance(_x10) {
607
+ function getWalletBalance(_x9) {
684
608
  return _getWalletBalance.apply(this, arguments);
685
609
  }
686
610
  return getWalletBalance;
@@ -763,25 +687,6 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
763
687
  this.paymentModule.logInfo('[WalletPass] 搜索结果缓存已清除');
764
688
  }
765
689
 
766
- /**
767
- * 获取存储的钱包初始化数据
768
- */
769
- }, {
770
- key: "getStoredWalletInitData",
771
- value: function getStoredWalletInitData() {
772
- return this.walletInitData;
773
- }
774
-
775
- /**
776
- * 清除存储的钱包初始化数据
777
- */
778
- }, {
779
- key: "clearStoredWalletInitData",
780
- value: function clearStoredWalletInitData() {
781
- this.walletInitData = null;
782
- this.paymentModule.logInfo('[WalletPass] 钱包初始化数据已清除');
783
- }
784
-
785
690
  /**
786
691
  * 清除所有缓存数据
787
692
  */
@@ -792,14 +697,13 @@ export var WalletPassPaymentImpl = /*#__PURE__*/function () {
792
697
  this.userIdentificationCodes = [];
793
698
  this.searchResults = [];
794
699
  this.walletParams = null;
795
- this.walletInitData = null;
796
700
 
797
701
  // 发送所有缓存清除事件
798
702
  this.emitEvent(WalletPassHooks.OnWalletCacheCleared, {
799
703
  clearedTypes: ['all']
800
704
  });
801
705
  this.paymentModule.logInfo('[WalletPass] 所有缓存数据已清除', {
802
- cleared_types: ['walletRecommendList', 'userIdentificationCodes', 'searchResults', 'walletParams', 'walletInitData']
706
+ cleared_types: ['walletRecommendList', 'userIdentificationCodes', 'searchResults', 'walletParams']
803
707
  });
804
708
  }
805
709
  }]);
@@ -1,41 +1,38 @@
1
1
  import { Module, PisellCore, ModuleOptions } from '../../types';
2
2
  import { BaseModule } from '../BaseModule';
3
3
  import { Rules, RulesModuleAPI, DiscountResult } from './types';
4
- import { Discount } from '../Discount/types';
4
+ import { Discount } from "../Discount/types";
5
5
  import { SetDiscountSelectedParams } from '../../solution/ShopDiscount/types';
6
- import { WindowPlugin } from '../../plugins';
7
6
  export declare class RulesModule extends BaseModule implements Module, RulesModuleAPI {
8
7
  protected defaultName: string;
9
8
  protected defaultVersion: string;
10
9
  private store;
11
- window: WindowPlugin;
12
10
  private hooks;
13
11
  constructor(name?: string, version?: string);
14
12
  initialize(core: PisellCore, options?: ModuleOptions): Promise<void>;
15
13
  setRulesList(rulesList: Rules[]): Promise<void>;
16
14
  getRulesList(): Rules[];
17
- getWalletPassEvaluator(): import("../..").WalletPassEvaluator | undefined;
18
15
  private checkHolderMatch;
19
- isDiscountListAvailable({ oldDiscountList, newDiscountList, productList, holders, orderTotalAmount, }: {
16
+ isDiscountListAvailable({ oldDiscountList, newDiscountList, productList, holders, isFormSubject, }: {
20
17
  oldDiscountList: Discount[];
21
18
  newDiscountList: Discount[];
22
19
  productList: any[];
23
20
  holders: {
24
21
  form_record_id: number;
25
22
  }[];
26
- orderTotalAmount: number;
23
+ isFormSubject: boolean;
27
24
  }): {
28
25
  isAvailable: boolean;
29
26
  discountList: Discount[];
30
27
  productList: any[];
31
28
  };
32
- calcDiscount({ discountList, productList, holders, orderTotalAmount }: {
29
+ calcDiscount({ discountList, productList, holders, isFormSubject, }: {
33
30
  discountList: Discount[];
34
31
  productList: any[];
35
32
  holders: {
36
33
  form_record_id: number;
37
34
  }[];
38
- orderTotalAmount: number;
35
+ isFormSubject: boolean;
39
36
  }, options?: {
40
37
  isSelected?: boolean;
41
38
  discountId?: number;