@pisell/pisellos 2.1.3 → 2.1.5
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.
- package/dist/core/index.js +2 -1
- package/dist/effects/index.d.ts +4 -3
- package/dist/effects/index.js +15 -6
- package/dist/modules/AccountList/index.d.ts +7 -1
- package/dist/modules/AccountList/index.js +81 -14
- package/dist/modules/AccountList/types.d.ts +28 -0
- package/dist/modules/AccountList/types.js +8 -0
- package/dist/modules/Cart/index.js +1 -1
- package/dist/modules/Customer/constants.d.ts +7 -0
- package/dist/modules/Customer/constants.js +12 -0
- package/dist/modules/Customer/index.d.ts +122 -0
- package/dist/modules/Customer/index.js +697 -0
- package/dist/modules/Customer/types.d.ts +146 -0
- package/dist/modules/Customer/types.js +41 -0
- package/dist/modules/Date/index.d.ts +17 -0
- package/dist/modules/Date/index.js +92 -4
- package/dist/modules/Discount/index.d.ts +1 -0
- package/dist/modules/Order/index.d.ts +25 -1
- package/dist/modules/Order/index.js +224 -2
- package/dist/modules/Order/types.d.ts +45 -0
- package/dist/modules/Order/types.js +8 -0
- package/dist/modules/Payment/cash.d.ts +19 -0
- package/dist/modules/Payment/cash.js +97 -0
- package/dist/modules/Payment/cashRecommendationAlgorithm.d.ts +22 -0
- package/dist/modules/Payment/cashRecommendationAlgorithm.js +423 -0
- package/dist/modules/Payment/eftpos.d.ts +11 -0
- package/dist/modules/Payment/eftpos.js +80 -0
- package/dist/modules/Payment/index.d.ts +184 -9
- package/dist/modules/Payment/index.js +2012 -108
- package/dist/modules/Payment/mx51.d.ts +0 -0
- package/dist/modules/Payment/mx51.js +0 -0
- package/dist/modules/Payment/types.d.ts +750 -30
- package/dist/modules/Payment/types.js +236 -12
- package/dist/modules/Payment/utils.d.ts +17 -0
- package/dist/modules/Payment/utils.js +62 -0
- package/dist/modules/Payment/walletpass.d.ts +99 -0
- package/dist/modules/Payment/walletpass.js +701 -0
- package/dist/modules/Product/index.d.ts +1 -1
- package/dist/modules/ProductList/index.d.ts +12 -1
- package/dist/modules/ProductList/index.js +27 -3
- package/dist/modules/Rules/index.d.ts +2 -0
- package/dist/modules/Rules/index.js +39 -17
- package/dist/modules/Rules/types.d.ts +1 -0
- package/dist/modules/Schedule/index.d.ts +9 -0
- package/dist/modules/Schedule/index.js +68 -0
- package/dist/modules/index.d.ts +1 -0
- package/dist/modules/index.js +1 -0
- package/dist/plugins/app-types/app/app.d.ts +83 -0
- package/dist/plugins/app-types/app/const.d.ts +4 -0
- package/dist/plugins/app-types/app/index.d.ts +14 -0
- package/dist/plugins/app-types/applicationManager/application.d.ts +50 -0
- package/dist/plugins/app-types/applicationManager/index.d.ts +13 -0
- package/dist/plugins/app-types/config.d.ts +3 -0
- package/dist/plugins/app-types/cookie/index.d.ts +13 -0
- package/dist/plugins/app-types/data/index.d.ts +8 -0
- package/dist/plugins/app-types/history/config.d.ts +24 -0
- package/dist/plugins/app-types/history/index.d.ts +20 -0
- package/dist/plugins/app-types/history/type.d.ts +2 -0
- package/dist/plugins/app-types/hooks/index.d.ts +12 -0
- package/dist/plugins/app-types/hooks/useDelayedValue/index.d.ts +2 -0
- package/dist/plugins/app-types/hooks/useDispatch/index.d.ts +2 -0
- package/dist/plugins/app-types/hooks/useLowCode/index.d.ts +13 -0
- package/dist/plugins/app-types/hooks/useStore/index.d.ts +6 -0
- package/dist/plugins/app-types/index.d.ts +6 -0
- package/dist/plugins/app-types/indexDB/index.d.ts +178 -0
- package/dist/plugins/app-types/locales/en.d.ts +3 -0
- package/dist/plugins/app-types/locales/index.d.ts +37 -0
- package/dist/plugins/app-types/locales/original.d.ts +3 -0
- package/dist/plugins/app-types/locales/type.d.ts +19 -0
- package/dist/plugins/app-types/locales/zh-CN.d.ts +3 -0
- package/dist/plugins/app-types/locales/zh-HK.d.ts +3 -0
- package/dist/plugins/app-types/logger/feishu.d.ts +11 -0
- package/dist/plugins/app-types/logger/index.d.ts +122 -0
- package/dist/plugins/app-types/menuManager/hooks.d.ts +17 -0
- package/dist/plugins/app-types/menuManager/index.d.ts +28 -0
- package/dist/plugins/app-types/models/global.d.ts +32 -0
- package/dist/plugins/app-types/models/index.d.ts +45 -0
- package/dist/plugins/app-types/models/type.d.ts +2 -0
- package/dist/plugins/app-types/package.json +15 -0
- package/dist/plugins/app-types/plugin/index.d.ts +0 -0
- package/dist/plugins/app-types/pubsub/example.d.ts +5 -0
- package/dist/plugins/app-types/pubsub/index.d.ts +63 -0
- package/dist/plugins/app-types/request/cache.d.ts +46 -0
- package/dist/plugins/app-types/request/cancelToken.d.ts +38 -0
- package/dist/plugins/app-types/request/config.d.ts +3 -0
- package/dist/plugins/app-types/request/constants.d.ts +2 -0
- package/dist/plugins/app-types/request/index.d.ts +24 -0
- package/dist/plugins/app-types/request/pisell2Request.d.ts +6 -0
- package/dist/plugins/app-types/request/type.d.ts +41 -0
- package/dist/plugins/app-types/request/utils.d.ts +46 -0
- package/dist/plugins/app-types/routes/config.d.ts +7 -0
- package/dist/plugins/app-types/routes/index.d.ts +28 -0
- package/dist/plugins/app-types/socket/components/SocketMonitorPage.d.ts +6 -0
- package/dist/plugins/app-types/socket/components/index.d.ts +2 -0
- package/dist/plugins/app-types/socket/constants.d.ts +33 -0
- package/dist/plugins/app-types/socket/events.d.ts +31 -0
- package/dist/plugins/app-types/socket/heartbeat.d.ts +66 -0
- package/dist/plugins/app-types/socket/index.d.ts +61 -0
- package/dist/plugins/app-types/socket/monitor.d.ts +169 -0
- package/dist/plugins/app-types/socket/reconnect.d.ts +61 -0
- package/dist/plugins/app-types/socket/socket.d.ts +129 -0
- package/dist/plugins/app-types/socket/types.d.ts +85 -0
- package/dist/plugins/app-types/storage/index.d.ts +17 -0
- package/dist/plugins/app-types/tasks/index.d.ts +77 -0
- package/dist/plugins/app-types/tasks/type.d.ts +62 -0
- package/dist/plugins/app-types/tasks/useTasks.d.ts +5 -0
- package/dist/plugins/app-types/type.d.ts +2 -0
- package/dist/plugins/app-types/variables/VariablesProvider.d.ts +7 -0
- package/dist/plugins/app-types/variables/config.d.ts +3 -0
- package/dist/plugins/app-types/variables/index.d.ts +6 -0
- package/dist/plugins/app-types/variables/type.d.ts +2 -0
- package/dist/plugins/app-types/website/index.d.ts +6 -0
- package/dist/plugins/app.d.ts +8 -0
- package/dist/plugins/app.js +1 -0
- package/dist/plugins/window.d.ts +1 -0
- package/dist/solution/BookingByStep/index.d.ts +1 -1
- package/dist/solution/BookingByStep/index.js +1 -1
- package/dist/solution/BookingTicket/index.d.ts +180 -0
- package/dist/solution/BookingTicket/index.js +689 -0
- package/dist/solution/BookingTicket/types.d.ts +68 -0
- package/dist/solution/BookingTicket/types.js +43 -0
- package/dist/solution/BookingTicket/utils/scan/cloudSearch.d.ts +22 -0
- package/dist/solution/BookingTicket/utils/scan/cloudSearch.js +159 -0
- package/dist/solution/BookingTicket/utils/scan/handleScan.d.ts +22 -0
- package/dist/solution/BookingTicket/utils/scan/handleScan.js +189 -0
- package/dist/solution/BookingTicket/utils/scan/index.d.ts +81 -0
- package/dist/solution/BookingTicket/utils/scan/index.js +285 -0
- package/dist/solution/BookingTicket/utils/scan/scanCache.d.ts +78 -0
- package/dist/solution/BookingTicket/utils/scan/scanCache.js +305 -0
- package/dist/solution/Checkout/appointmentDemo.json +1 -0
- package/dist/solution/Checkout/index.d.ts +509 -0
- package/dist/solution/Checkout/index.js +4874 -0
- package/dist/solution/Checkout/types.d.ts +923 -0
- package/dist/solution/Checkout/types.js +148 -0
- package/dist/solution/Checkout/utils/index.d.ts +117 -0
- package/dist/solution/Checkout/utils/index.js +549 -0
- package/dist/solution/ShopDiscount/index.d.ts +4 -9
- package/dist/solution/ShopDiscount/index.js +106 -54
- package/dist/solution/ShopDiscount/types.d.ts +10 -1
- package/dist/solution/index.d.ts +2 -0
- package/dist/solution/index.js +3 -1
- package/dist/types/index.d.ts +3 -1
- package/dist/utils/task.d.ts +40 -0
- package/dist/utils/task.js +171 -0
- package/dist/utils/watch.d.ts +102 -0
- package/dist/utils/watch.js +294 -0
- package/lib/core/index.js +1 -1
- package/lib/effects/index.d.ts +4 -3
- package/lib/effects/index.js +4 -1
- package/lib/modules/AccountList/index.d.ts +7 -1
- package/lib/modules/AccountList/index.js +27 -0
- package/lib/modules/AccountList/types.d.ts +28 -0
- package/lib/modules/Cart/index.js +1 -1
- package/lib/modules/Customer/constants.d.ts +7 -0
- package/lib/modules/Customer/constants.js +39 -0
- package/lib/modules/Customer/index.d.ts +122 -0
- package/lib/modules/Customer/index.js +440 -0
- package/lib/modules/Customer/types.d.ts +146 -0
- package/lib/modules/Customer/types.js +37 -0
- package/lib/modules/Date/index.d.ts +17 -0
- package/lib/modules/Date/index.js +64 -0
- package/lib/modules/Discount/index.d.ts +1 -0
- package/lib/modules/Order/index.d.ts +25 -1
- package/lib/modules/Order/index.js +182 -0
- package/lib/modules/Order/types.d.ts +45 -0
- package/lib/modules/Payment/cash.d.ts +19 -0
- package/lib/modules/Payment/cash.js +64 -0
- package/lib/modules/Payment/cashRecommendationAlgorithm.d.ts +22 -0
- package/lib/modules/Payment/cashRecommendationAlgorithm.js +342 -0
- package/lib/modules/Payment/eftpos.d.ts +11 -0
- package/lib/modules/Payment/eftpos.js +51 -0
- package/lib/modules/Payment/index.d.ts +184 -9
- package/lib/modules/Payment/index.js +1044 -50
- package/lib/modules/Payment/mx51.d.ts +0 -0
- package/lib/modules/Payment/mx51.js +0 -0
- package/lib/modules/Payment/types.d.ts +750 -30
- package/lib/modules/Payment/types.js +79 -6
- package/lib/modules/Payment/utils.d.ts +17 -0
- package/lib/modules/Payment/utils.js +67 -0
- package/lib/modules/Payment/walletpass.d.ts +99 -0
- package/lib/modules/Payment/walletpass.js +468 -0
- package/lib/modules/Product/index.d.ts +1 -1
- package/lib/modules/ProductList/index.d.ts +12 -1
- package/lib/modules/ProductList/index.js +29 -2
- package/lib/modules/Rules/index.d.ts +2 -0
- package/lib/modules/Rules/index.js +32 -15
- package/lib/modules/Rules/types.d.ts +1 -0
- package/lib/modules/Schedule/index.d.ts +9 -0
- package/lib/modules/Schedule/index.js +51 -0
- package/lib/modules/index.d.ts +1 -0
- package/lib/modules/index.js +2 -0
- package/lib/plugins/app-types/app/app.d.ts +83 -0
- package/lib/plugins/app-types/app/const.d.ts +4 -0
- package/lib/plugins/app-types/app/index.d.ts +14 -0
- package/lib/plugins/app-types/applicationManager/application.d.ts +50 -0
- package/lib/plugins/app-types/applicationManager/index.d.ts +13 -0
- package/lib/plugins/app-types/config.d.ts +3 -0
- package/lib/plugins/app-types/cookie/index.d.ts +13 -0
- package/lib/plugins/app-types/data/index.d.ts +8 -0
- package/lib/plugins/app-types/history/config.d.ts +24 -0
- package/lib/plugins/app-types/history/index.d.ts +20 -0
- package/lib/plugins/app-types/history/type.d.ts +2 -0
- package/lib/plugins/app-types/hooks/index.d.ts +12 -0
- package/lib/plugins/app-types/hooks/useDelayedValue/index.d.ts +2 -0
- package/lib/plugins/app-types/hooks/useDispatch/index.d.ts +2 -0
- package/lib/plugins/app-types/hooks/useLowCode/index.d.ts +13 -0
- package/lib/plugins/app-types/hooks/useStore/index.d.ts +6 -0
- package/lib/plugins/app-types/index.d.ts +6 -0
- package/lib/plugins/app-types/indexDB/index.d.ts +178 -0
- package/lib/plugins/app-types/locales/en.d.ts +3 -0
- package/lib/plugins/app-types/locales/index.d.ts +37 -0
- package/lib/plugins/app-types/locales/original.d.ts +3 -0
- package/lib/plugins/app-types/locales/type.d.ts +19 -0
- package/lib/plugins/app-types/locales/zh-CN.d.ts +3 -0
- package/lib/plugins/app-types/locales/zh-HK.d.ts +3 -0
- package/lib/plugins/app-types/logger/feishu.d.ts +11 -0
- package/lib/plugins/app-types/logger/index.d.ts +122 -0
- package/lib/plugins/app-types/menuManager/hooks.d.ts +17 -0
- package/lib/plugins/app-types/menuManager/index.d.ts +28 -0
- package/lib/plugins/app-types/models/global.d.ts +32 -0
- package/lib/plugins/app-types/models/index.d.ts +45 -0
- package/lib/plugins/app-types/models/type.d.ts +2 -0
- package/lib/plugins/app-types/package.json +15 -0
- package/lib/plugins/app-types/plugin/index.d.ts +0 -0
- package/lib/plugins/app-types/pubsub/example.d.ts +5 -0
- package/lib/plugins/app-types/pubsub/index.d.ts +63 -0
- package/lib/plugins/app-types/request/cache.d.ts +46 -0
- package/lib/plugins/app-types/request/cancelToken.d.ts +38 -0
- package/lib/plugins/app-types/request/config.d.ts +3 -0
- package/lib/plugins/app-types/request/constants.d.ts +2 -0
- package/lib/plugins/app-types/request/index.d.ts +24 -0
- package/lib/plugins/app-types/request/pisell2Request.d.ts +6 -0
- package/lib/plugins/app-types/request/type.d.ts +41 -0
- package/lib/plugins/app-types/request/utils.d.ts +46 -0
- package/lib/plugins/app-types/routes/config.d.ts +7 -0
- package/lib/plugins/app-types/routes/index.d.ts +28 -0
- package/lib/plugins/app-types/socket/components/SocketMonitorPage.d.ts +6 -0
- package/lib/plugins/app-types/socket/components/index.d.ts +2 -0
- package/lib/plugins/app-types/socket/constants.d.ts +33 -0
- package/lib/plugins/app-types/socket/events.d.ts +31 -0
- package/lib/plugins/app-types/socket/heartbeat.d.ts +66 -0
- package/lib/plugins/app-types/socket/index.d.ts +61 -0
- package/lib/plugins/app-types/socket/monitor.d.ts +169 -0
- package/lib/plugins/app-types/socket/reconnect.d.ts +61 -0
- package/lib/plugins/app-types/socket/socket.d.ts +129 -0
- package/lib/plugins/app-types/socket/types.d.ts +85 -0
- package/lib/plugins/app-types/storage/index.d.ts +17 -0
- package/lib/plugins/app-types/tasks/index.d.ts +77 -0
- package/lib/plugins/app-types/tasks/type.d.ts +62 -0
- package/lib/plugins/app-types/tasks/useTasks.d.ts +5 -0
- package/lib/plugins/app-types/type.d.ts +2 -0
- package/lib/plugins/app-types/variables/VariablesProvider.d.ts +7 -0
- package/lib/plugins/app-types/variables/config.d.ts +3 -0
- package/lib/plugins/app-types/variables/index.d.ts +6 -0
- package/lib/plugins/app-types/variables/type.d.ts +2 -0
- package/lib/plugins/app-types/website/index.d.ts +6 -0
- package/lib/plugins/app.d.ts +8 -0
- package/lib/plugins/app.js +17 -0
- package/lib/plugins/window.d.ts +1 -0
- package/lib/solution/BookingByStep/index.d.ts +1 -1
- package/lib/solution/BookingByStep/index.js +1 -2
- package/lib/solution/BookingTicket/index.d.ts +180 -0
- package/lib/solution/BookingTicket/index.js +420 -0
- package/lib/solution/BookingTicket/types.d.ts +68 -0
- package/lib/solution/BookingTicket/types.js +72 -0
- package/lib/solution/BookingTicket/utils/scan/cloudSearch.d.ts +22 -0
- package/lib/solution/BookingTicket/utils/scan/cloudSearch.js +117 -0
- package/lib/solution/BookingTicket/utils/scan/handleScan.d.ts +22 -0
- package/lib/solution/BookingTicket/utils/scan/handleScan.js +132 -0
- package/lib/solution/BookingTicket/utils/scan/index.d.ts +81 -0
- package/lib/solution/BookingTicket/utils/scan/index.js +210 -0
- package/lib/solution/BookingTicket/utils/scan/scanCache.d.ts +78 -0
- package/lib/solution/BookingTicket/utils/scan/scanCache.js +231 -0
- package/lib/solution/Checkout/appointmentDemo.json +1 -0
- package/lib/solution/Checkout/index.d.ts +509 -0
- package/lib/solution/Checkout/index.js +3002 -0
- package/lib/solution/Checkout/types.d.ts +923 -0
- package/lib/solution/Checkout/types.js +87 -0
- package/lib/solution/Checkout/utils/index.d.ts +117 -0
- package/lib/solution/Checkout/utils/index.js +403 -0
- package/lib/solution/ShopDiscount/index.d.ts +4 -9
- package/lib/solution/ShopDiscount/index.js +41 -13
- package/lib/solution/ShopDiscount/types.d.ts +10 -1
- package/lib/solution/index.d.ts +2 -0
- package/lib/solution/index.js +5 -1
- package/lib/types/index.d.ts +3 -1
- package/lib/utils/task.d.ts +40 -0
- package/lib/utils/task.js +109 -0
- package/lib/utils/watch.d.ts +102 -0
- package/lib/utils/watch.js +217 -0
- package/package.json +4 -2
|
@@ -0,0 +1,701 @@
|
|
|
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
|
+
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
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); }
|
|
5
|
+
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
6
|
+
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
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; }
|
|
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; }
|
|
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; }
|
|
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; }
|
|
11
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
12
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
13
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
14
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
15
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
16
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
17
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
18
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
19
|
+
import { WalletPassHooks } from "./types";
|
|
20
|
+
import { formatWalletPassList2PreparePayments as formatWalletPassList2PreparePaymentsUtils, sortUserIdentificationCodeList } from "./utils";
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* 钱包支付实现
|
|
24
|
+
*/
|
|
25
|
+
export var WalletPassPaymentImpl = /*#__PURE__*/function () {
|
|
26
|
+
function WalletPassPaymentImpl(paymentModule) {
|
|
27
|
+
_classCallCheck(this, WalletPassPaymentImpl);
|
|
28
|
+
_defineProperty(this, "walletRecommendList", []);
|
|
29
|
+
_defineProperty(this, "userIdentificationCodes", []);
|
|
30
|
+
_defineProperty(this, "searchResults", []);
|
|
31
|
+
_defineProperty(this, "walletParams", null);
|
|
32
|
+
this.paymentModule = paymentModule;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* 发送事件的辅助方法
|
|
37
|
+
* 支持使用WalletPassHooks或PaymentHooks
|
|
38
|
+
*/
|
|
39
|
+
_createClass(WalletPassPaymentImpl, [{
|
|
40
|
+
key: "emitEvent",
|
|
41
|
+
value: function emitEvent(hook, data) {
|
|
42
|
+
try {
|
|
43
|
+
this.paymentModule.core.effects.emit(hook, data);
|
|
44
|
+
} catch (error) {
|
|
45
|
+
this.paymentModule.logError('[WalletPass] 发送事件失败', error, {
|
|
46
|
+
hook: hook
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* 生成钱包API默认参数
|
|
53
|
+
* 根据业务数据生成标准的钱包API参数,并存储在模块中
|
|
54
|
+
*/
|
|
55
|
+
}, {
|
|
56
|
+
key: "generateWalletParams",
|
|
57
|
+
value: function generateWalletParams(businessData) {
|
|
58
|
+
var _walletParams$product;
|
|
59
|
+
var customer_id = businessData.customer_id,
|
|
60
|
+
amountInfo = businessData.amountInfo,
|
|
61
|
+
products = businessData.products,
|
|
62
|
+
order_wait_pay_amount = businessData.order_wait_pay_amount;
|
|
63
|
+
|
|
64
|
+
// 转换金额为数字类型
|
|
65
|
+
var totalAmount = Number(amountInfo.totalAmount);
|
|
66
|
+
var subTotal = Number(amountInfo.subTotal);
|
|
67
|
+
var walletParams = {
|
|
68
|
+
sale_channel: 'pos',
|
|
69
|
+
customer_id: customer_id || 0,
|
|
70
|
+
// 提供默认值,确保类型为 number
|
|
71
|
+
order_expect_amount: totalAmount,
|
|
72
|
+
// 订单小计金额
|
|
73
|
+
order_product_amount: subTotal,
|
|
74
|
+
// 订单待支付金额
|
|
75
|
+
order_wait_pay_amount: order_wait_pay_amount || totalAmount,
|
|
76
|
+
// order_behavior_count_customer_id: 1,
|
|
77
|
+
products: products,
|
|
78
|
+
prepare_payments: []
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
// 存储生成的参数到模块中
|
|
82
|
+
this.walletParams = walletParams;
|
|
83
|
+
this.paymentModule.logInfo('[WalletPass] 钱包默认参数已生成并存储', {
|
|
84
|
+
customer_id: walletParams.customer_id,
|
|
85
|
+
order_expect_amount: walletParams.order_expect_amount,
|
|
86
|
+
order_product_amount: walletParams.order_product_amount,
|
|
87
|
+
order_wait_pay_amount: walletParams.order_wait_pay_amount,
|
|
88
|
+
products_count: ((_walletParams$product = walletParams.products) === null || _walletParams$product === void 0 ? void 0 : _walletParams$product.length) || 0
|
|
89
|
+
});
|
|
90
|
+
return walletParams;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* 获取已存储的钱包参数
|
|
95
|
+
* 返回之前生成并存储的钱包参数
|
|
96
|
+
*/
|
|
97
|
+
}, {
|
|
98
|
+
key: "getStoredWalletParams",
|
|
99
|
+
value: function getStoredWalletParams() {
|
|
100
|
+
return this.walletParams;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* 清理已存储的钱包参数
|
|
105
|
+
* 清除之前存储的钱包参数
|
|
106
|
+
*/
|
|
107
|
+
}, {
|
|
108
|
+
key: "clearStoredWalletParams",
|
|
109
|
+
value: function clearStoredWalletParams() {
|
|
110
|
+
this.walletParams = null;
|
|
111
|
+
this.paymentModule.logInfo('[WalletPass] 已存储的钱包参数已清理');
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* 从业务数据初始化钱包数据
|
|
116
|
+
* 内部生成参数,然后调用标准的初始化流程
|
|
117
|
+
*/
|
|
118
|
+
}, {
|
|
119
|
+
key: "initializeWalletDataFromBusinessAsync",
|
|
120
|
+
value: (function () {
|
|
121
|
+
var _initializeWalletDataFromBusinessAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(businessData) {
|
|
122
|
+
var _businessData$amountI, _businessData$amountI2, _businessData$amountI3, _businessData$amountI4, _businessData$product;
|
|
123
|
+
var startTime, walletParams, _result$walletRecomme, _result$userIdentific, result, endTime, duration, _businessData$amountI5, _endTime, _duration;
|
|
124
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
125
|
+
while (1) switch (_context.prev = _context.next) {
|
|
126
|
+
case 0:
|
|
127
|
+
startTime = Date.now();
|
|
128
|
+
walletParams = this.generateWalletParams(businessData);
|
|
129
|
+
if (!(Number((businessData === null || businessData === void 0 || (_businessData$amountI = businessData.amountInfo) === null || _businessData$amountI === void 0 ? void 0 : _businessData$amountI.totalAmount) || 0) < 0 || Number((businessData === null || businessData === void 0 || (_businessData$amountI2 = businessData.amountInfo) === null || _businessData$amountI2 === void 0 ? void 0 : _businessData$amountI2.subTotal) || 0) < 0)) {
|
|
130
|
+
_context.next = 4;
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
return _context.abrupt("return", {
|
|
134
|
+
walletRecommendList: [],
|
|
135
|
+
userIdentificationCodes: []
|
|
136
|
+
});
|
|
137
|
+
case 4:
|
|
138
|
+
// 发送初始化开始事件
|
|
139
|
+
this.emitEvent(WalletPassHooks.OnWalletInitializationStarted, {
|
|
140
|
+
businessData: businessData,
|
|
141
|
+
startTime: startTime
|
|
142
|
+
});
|
|
143
|
+
this.paymentModule.logInfo('[WalletPass] 开始从业务数据初始化钱包数据', {
|
|
144
|
+
customer_id: businessData.customer_id,
|
|
145
|
+
totalAmount: (_businessData$amountI3 = businessData.amountInfo) === null || _businessData$amountI3 === void 0 ? void 0 : _businessData$amountI3.totalAmount,
|
|
146
|
+
subTotal: (_businessData$amountI4 = businessData.amountInfo) === null || _businessData$amountI4 === void 0 ? void 0 : _businessData$amountI4.subTotal,
|
|
147
|
+
order_wait_pay_amount: businessData.order_wait_pay_amount,
|
|
148
|
+
products_count: ((_businessData$product = businessData.products) === null || _businessData$product === void 0 ? void 0 : _businessData$product.length) || 0
|
|
149
|
+
});
|
|
150
|
+
_context.prev = 6;
|
|
151
|
+
_context.next = 9;
|
|
152
|
+
return this.initializeWalletDataAsync(walletParams);
|
|
153
|
+
case 9:
|
|
154
|
+
result = _context.sent;
|
|
155
|
+
endTime = Date.now();
|
|
156
|
+
duration = endTime - startTime; // 发送初始化完成事件
|
|
157
|
+
this.emitEvent(WalletPassHooks.OnWalletInitializationCompleted, {
|
|
158
|
+
businessData: businessData,
|
|
159
|
+
result: result,
|
|
160
|
+
startTime: startTime,
|
|
161
|
+
endTime: endTime,
|
|
162
|
+
duration: duration
|
|
163
|
+
});
|
|
164
|
+
this.paymentModule.logInfo("[WalletPass] \u4ECE\u4E1A\u52A1\u6570\u636E\u521D\u59CB\u5316\u94B1\u5305\u6570\u636E\u6210\u529F", {
|
|
165
|
+
duration: "".concat(duration, "ms"),
|
|
166
|
+
walletRecommendList_count: ((_result$walletRecomme = result.walletRecommendList) === null || _result$walletRecomme === void 0 ? void 0 : _result$walletRecomme.length) || 0,
|
|
167
|
+
userIdentificationCodes_count: ((_result$userIdentific = result.userIdentificationCodes) === null || _result$userIdentific === void 0 ? void 0 : _result$userIdentific.length) || 0
|
|
168
|
+
});
|
|
169
|
+
return _context.abrupt("return", result);
|
|
170
|
+
case 17:
|
|
171
|
+
_context.prev = 17;
|
|
172
|
+
_context.t0 = _context["catch"](6);
|
|
173
|
+
_endTime = Date.now();
|
|
174
|
+
_duration = _endTime - startTime; // 发送初始化失败事件
|
|
175
|
+
this.emitEvent(WalletPassHooks.OnWalletInitializationFailed, {
|
|
176
|
+
businessData: businessData,
|
|
177
|
+
error: _context.t0,
|
|
178
|
+
startTime: startTime,
|
|
179
|
+
endTime: _endTime,
|
|
180
|
+
duration: _duration
|
|
181
|
+
});
|
|
182
|
+
this.paymentModule.logError("[WalletPass] \u4ECE\u4E1A\u52A1\u6570\u636E\u521D\u59CB\u5316\u94B1\u5305\u6570\u636E\u5931\u8D25", _context.t0, {
|
|
183
|
+
duration: "".concat(_duration, "ms"),
|
|
184
|
+
customer_id: businessData.customer_id,
|
|
185
|
+
totalAmount: (_businessData$amountI5 = businessData.amountInfo) === null || _businessData$amountI5 === void 0 ? void 0 : _businessData$amountI5.totalAmount
|
|
186
|
+
});
|
|
187
|
+
throw _context.t0;
|
|
188
|
+
case 24:
|
|
189
|
+
case "end":
|
|
190
|
+
return _context.stop();
|
|
191
|
+
}
|
|
192
|
+
}, _callee, this, [[6, 17]]);
|
|
193
|
+
}));
|
|
194
|
+
function initializeWalletDataFromBusinessAsync(_x) {
|
|
195
|
+
return _initializeWalletDataFromBusinessAsync.apply(this, arguments);
|
|
196
|
+
}
|
|
197
|
+
return initializeWalletDataFromBusinessAsync;
|
|
198
|
+
}()
|
|
199
|
+
/**
|
|
200
|
+
* 初始化钱包数据
|
|
201
|
+
* 先获取推荐列表,再获取用户识别码列表(顺序执行)
|
|
202
|
+
*/
|
|
203
|
+
)
|
|
204
|
+
}, {
|
|
205
|
+
key: "initializeWalletDataAsync",
|
|
206
|
+
value: (function () {
|
|
207
|
+
var _initializeWalletDataAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(baseParams) {
|
|
208
|
+
var walletRecommendList, identificationParams, userIdentificationCodes;
|
|
209
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
210
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
211
|
+
case 0:
|
|
212
|
+
_context2.prev = 0;
|
|
213
|
+
_context2.next = 3;
|
|
214
|
+
return this.getWalletPassRecommendListAsync(baseParams);
|
|
215
|
+
case 3:
|
|
216
|
+
walletRecommendList = _context2.sent;
|
|
217
|
+
// 格式化用户识别码列表参数
|
|
218
|
+
identificationParams = _objectSpread(_objectSpread({}, baseParams), {}, {
|
|
219
|
+
available: 2,
|
|
220
|
+
prepare_payments: this.formatWalletPassList2PreparePayments(walletRecommendList),
|
|
221
|
+
other_exact_codes: [],
|
|
222
|
+
filter_prepare_wallet_pass: 1
|
|
223
|
+
}); // 再获取用户识别码列表
|
|
224
|
+
_context2.next = 7;
|
|
225
|
+
return this.getUserIdentificationCodeListAsync(identificationParams);
|
|
226
|
+
case 7:
|
|
227
|
+
userIdentificationCodes = _context2.sent;
|
|
228
|
+
return _context2.abrupt("return", {
|
|
229
|
+
walletRecommendList: walletRecommendList,
|
|
230
|
+
userIdentificationCodes: userIdentificationCodes
|
|
231
|
+
});
|
|
232
|
+
case 11:
|
|
233
|
+
_context2.prev = 11;
|
|
234
|
+
_context2.t0 = _context2["catch"](0);
|
|
235
|
+
this.paymentModule.logError('[WalletPass] 初始化钱包数据失败', _context2.t0, {
|
|
236
|
+
customer_id: baseParams.customer_id,
|
|
237
|
+
order_expect_amount: baseParams.order_expect_amount
|
|
238
|
+
});
|
|
239
|
+
throw _context2.t0;
|
|
240
|
+
case 15:
|
|
241
|
+
case "end":
|
|
242
|
+
return _context2.stop();
|
|
243
|
+
}
|
|
244
|
+
}, _callee2, this, [[0, 11]]);
|
|
245
|
+
}));
|
|
246
|
+
function initializeWalletDataAsync(_x2) {
|
|
247
|
+
return _initializeWalletDataAsync.apply(this, arguments);
|
|
248
|
+
}
|
|
249
|
+
return initializeWalletDataAsync;
|
|
250
|
+
}())
|
|
251
|
+
}, {
|
|
252
|
+
key: "getWalletPassRecommendListAsync",
|
|
253
|
+
value: function () {
|
|
254
|
+
var _getWalletPassRecommendListAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(params) {
|
|
255
|
+
var response;
|
|
256
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
257
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
258
|
+
case 0:
|
|
259
|
+
_context3.prev = 0;
|
|
260
|
+
this.paymentModule.logInfo('[WalletPass] 开始获取钱包推荐列表', {
|
|
261
|
+
customer_id: params.customer_id,
|
|
262
|
+
order_expect_amount: params.order_expect_amount,
|
|
263
|
+
sale_channel: params.sale_channel
|
|
264
|
+
});
|
|
265
|
+
_context3.next = 4;
|
|
266
|
+
return this.paymentModule.request.post('/machinecode/prepare/deduction/recommend', params // 将 params 作为请求体数据
|
|
267
|
+
);
|
|
268
|
+
case 4:
|
|
269
|
+
response = _context3.sent;
|
|
270
|
+
this.walletRecommendList = (response === null || response === void 0 ? void 0 : response.data) || [];
|
|
271
|
+
|
|
272
|
+
// 发送钱包推荐列表更新事件(使用专用的WalletPassHooks)
|
|
273
|
+
this.emitEvent(WalletPassHooks.OnWalletRecommendListUpdated, {
|
|
274
|
+
walletRecommendList: this.walletRecommendList
|
|
275
|
+
});
|
|
276
|
+
this.paymentModule.logInfo('[WalletPass] 钱包推荐列表已更新', {
|
|
277
|
+
count: this.walletRecommendList.length,
|
|
278
|
+
items: this.walletRecommendList.map(function (item) {
|
|
279
|
+
return {
|
|
280
|
+
voucher_id: item.voucher_id,
|
|
281
|
+
name: item.name,
|
|
282
|
+
amount: item.amount,
|
|
283
|
+
tag: item.tag
|
|
284
|
+
};
|
|
285
|
+
})
|
|
286
|
+
});
|
|
287
|
+
return _context3.abrupt("return", this.walletRecommendList);
|
|
288
|
+
case 11:
|
|
289
|
+
_context3.prev = 11;
|
|
290
|
+
_context3.t0 = _context3["catch"](0);
|
|
291
|
+
this.paymentModule.logError('[WalletPass] 获取钱包推荐列表失败', _context3.t0, {
|
|
292
|
+
customer_id: params.customer_id,
|
|
293
|
+
order_expect_amount: params.order_expect_amount,
|
|
294
|
+
sale_channel: params.sale_channel
|
|
295
|
+
});
|
|
296
|
+
// throw error;
|
|
297
|
+
return _context3.abrupt("return", []);
|
|
298
|
+
case 15:
|
|
299
|
+
case "end":
|
|
300
|
+
return _context3.stop();
|
|
301
|
+
}
|
|
302
|
+
}, _callee3, this, [[0, 11]]);
|
|
303
|
+
}));
|
|
304
|
+
function getWalletPassRecommendListAsync(_x3) {
|
|
305
|
+
return _getWalletPassRecommendListAsync.apply(this, arguments);
|
|
306
|
+
}
|
|
307
|
+
return getWalletPassRecommendListAsync;
|
|
308
|
+
}()
|
|
309
|
+
}, {
|
|
310
|
+
key: "formatWalletPassList2PreparePayments",
|
|
311
|
+
value: function formatWalletPassList2PreparePayments(list) {
|
|
312
|
+
return formatWalletPassList2PreparePaymentsUtils(list);
|
|
313
|
+
}
|
|
314
|
+
}, {
|
|
315
|
+
key: "getUserIdentificationCodeListAsync",
|
|
316
|
+
value: function () {
|
|
317
|
+
var _getUserIdentificationCodeListAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(params) {
|
|
318
|
+
var _newParams$prepare_pa, newParams, response, sortedData;
|
|
319
|
+
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
320
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
321
|
+
case 0:
|
|
322
|
+
_context4.prev = 0;
|
|
323
|
+
newParams = _objectSpread(_objectSpread({}, this.walletParams), params);
|
|
324
|
+
this.paymentModule.logInfo('[WalletPass] 开始获取用户识别码列表', {
|
|
325
|
+
customer_id: newParams.customer_id,
|
|
326
|
+
available: newParams.available,
|
|
327
|
+
prepare_payments_count: ((_newParams$prepare_pa = newParams.prepare_payments) === null || _newParams$prepare_pa === void 0 ? void 0 : _newParams$prepare_pa.length) || 0,
|
|
328
|
+
filter_prepare_wallet_pass: newParams.filter_prepare_wallet_pass
|
|
329
|
+
});
|
|
330
|
+
_context4.next = 5;
|
|
331
|
+
return this.paymentModule.request.post('/machinecode/prepare/deduction', newParams);
|
|
332
|
+
case 5:
|
|
333
|
+
response = _context4.sent;
|
|
334
|
+
// 对获取到的数据进行排序,将错误码为 500100、500200、500300 的项目排到最后
|
|
335
|
+
sortedData = sortUserIdentificationCodeList((response === null || response === void 0 ? void 0 : response.data) || []);
|
|
336
|
+
this.userIdentificationCodes = sortedData;
|
|
337
|
+
|
|
338
|
+
// 发送用户识别码列表更新事件(使用专用的WalletPassHooks)
|
|
339
|
+
this.emitEvent(WalletPassHooks.OnUserIdentificationCodesUpdated, {
|
|
340
|
+
userIdentificationCodes: this.userIdentificationCodes
|
|
341
|
+
});
|
|
342
|
+
this.paymentModule.logInfo('[WalletPass] 用户识别码列表已更新', {
|
|
343
|
+
count: this.userIdentificationCodes.length,
|
|
344
|
+
sorted_items: this.userIdentificationCodes.slice(0, 5).map(function (item) {
|
|
345
|
+
return {
|
|
346
|
+
code: item.code,
|
|
347
|
+
error_code: item.error_code,
|
|
348
|
+
error_msg: item.error_msg
|
|
349
|
+
};
|
|
350
|
+
})
|
|
351
|
+
});
|
|
352
|
+
return _context4.abrupt("return", this.userIdentificationCodes);
|
|
353
|
+
case 13:
|
|
354
|
+
_context4.prev = 13;
|
|
355
|
+
_context4.t0 = _context4["catch"](0);
|
|
356
|
+
this.paymentModule.logError('[WalletPass] 获取用户识别码列表失败', _context4.t0, {
|
|
357
|
+
customer_id: params.customer_id,
|
|
358
|
+
available: params.available
|
|
359
|
+
});
|
|
360
|
+
return _context4.abrupt("return", []);
|
|
361
|
+
case 17:
|
|
362
|
+
case "end":
|
|
363
|
+
return _context4.stop();
|
|
364
|
+
}
|
|
365
|
+
}, _callee4, this, [[0, 13]]);
|
|
366
|
+
}));
|
|
367
|
+
function getUserIdentificationCodeListAsync(_x4) {
|
|
368
|
+
return _getUserIdentificationCodeListAsync.apply(this, arguments);
|
|
369
|
+
}
|
|
370
|
+
return getUserIdentificationCodeListAsync;
|
|
371
|
+
}()
|
|
372
|
+
/**
|
|
373
|
+
* 搜索识别码信息
|
|
374
|
+
* 通过识别码搜索相关的钱包通行证信息
|
|
375
|
+
* 基于 WalletDeductionRecommendParams 参数结构
|
|
376
|
+
* 特殊逻辑:当识别码长度为9位且前3位为"000"时,调用 /wallet/detail/search 接口
|
|
377
|
+
*/
|
|
378
|
+
}, {
|
|
379
|
+
key: "searchIdentificationCodeAsync",
|
|
380
|
+
value: (function () {
|
|
381
|
+
var _searchIdentificationCodeAsync = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(params) {
|
|
382
|
+
var config,
|
|
383
|
+
code,
|
|
384
|
+
isWalletCode,
|
|
385
|
+
walletDetailParams,
|
|
386
|
+
_response,
|
|
387
|
+
_searchResults,
|
|
388
|
+
baseWalletParams,
|
|
389
|
+
searchParams,
|
|
390
|
+
response,
|
|
391
|
+
searchResults,
|
|
392
|
+
_this$searchResults,
|
|
393
|
+
existingCodes,
|
|
394
|
+
newResults,
|
|
395
|
+
_args5 = arguments;
|
|
396
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
397
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
398
|
+
case 0:
|
|
399
|
+
config = _args5.length > 1 && _args5[1] !== undefined ? _args5[1] : {};
|
|
400
|
+
_context5.prev = 1;
|
|
401
|
+
code = params.code;
|
|
402
|
+
this.paymentModule.logInfo('[WalletPass] 开始搜索识别码', {
|
|
403
|
+
code: code,
|
|
404
|
+
code_length: code.length,
|
|
405
|
+
noCache: config.noCache || false
|
|
406
|
+
});
|
|
407
|
+
|
|
408
|
+
// 检查识别码是否为9位且前3位为"000"
|
|
409
|
+
// const isWalletCode = code.length === 9 && code.startsWith('000');
|
|
410
|
+
// 测试环境先使用 WL
|
|
411
|
+
isWalletCode = code.startsWith('WL');
|
|
412
|
+
if (!isWalletCode) {
|
|
413
|
+
_context5.next = 14;
|
|
414
|
+
break;
|
|
415
|
+
}
|
|
416
|
+
// 钱包识别码直接调用专门接口,不缓存,直接返回
|
|
417
|
+
walletDetailParams = {
|
|
418
|
+
code: code,
|
|
419
|
+
with_customer: 1,
|
|
420
|
+
with: ['wallet']
|
|
421
|
+
};
|
|
422
|
+
this.paymentModule.logInfo('[WalletPass] 搜索钱包识别码', {
|
|
423
|
+
code: code,
|
|
424
|
+
with_customer: walletDetailParams.with_customer,
|
|
425
|
+
with: walletDetailParams.with
|
|
426
|
+
});
|
|
427
|
+
_context5.next = 10;
|
|
428
|
+
return this.paymentModule.request.post('/wallet/detail/search', walletDetailParams);
|
|
429
|
+
case 10:
|
|
430
|
+
_response = _context5.sent;
|
|
431
|
+
_searchResults = (_response === null || _response === void 0 ? void 0 : _response.data) || [];
|
|
432
|
+
this.paymentModule.logInfo('[WalletPass] 钱包识别码搜索完成', {
|
|
433
|
+
code: code,
|
|
434
|
+
results_count: _searchResults.length,
|
|
435
|
+
type: 'walletCode'
|
|
436
|
+
});
|
|
437
|
+
return _context5.abrupt("return", {
|
|
438
|
+
type: 'walletCode',
|
|
439
|
+
data: _searchResults
|
|
440
|
+
});
|
|
441
|
+
case 14:
|
|
442
|
+
// 合并钱包参数和搜索参数
|
|
443
|
+
baseWalletParams = this.walletParams; // 构建完整的搜索参数,包含钱包扣款推荐的所有参数
|
|
444
|
+
searchParams = {
|
|
445
|
+
// 基础钱包参数
|
|
446
|
+
sale_channel: params.sale_channel || (baseWalletParams === null || baseWalletParams === void 0 ? void 0 : baseWalletParams.sale_channel),
|
|
447
|
+
customer_id: params.customer_id || (baseWalletParams === null || baseWalletParams === void 0 ? void 0 : baseWalletParams.customer_id),
|
|
448
|
+
order_expect_amount: params.order_expect_amount || (baseWalletParams === null || baseWalletParams === void 0 ? void 0 : baseWalletParams.order_expect_amount),
|
|
449
|
+
order_product_amount: params.order_product_amount || (baseWalletParams === null || baseWalletParams === void 0 ? void 0 : baseWalletParams.order_product_amount),
|
|
450
|
+
order_wait_pay_amount: params.order_wait_pay_amount || (baseWalletParams === null || baseWalletParams === void 0 ? void 0 : baseWalletParams.order_wait_pay_amount),
|
|
451
|
+
order_behavior_count_customer_id: params.order_behavior_count_customer_id || (baseWalletParams === null || baseWalletParams === void 0 ? void 0 : baseWalletParams.order_behavior_count_customer_id),
|
|
452
|
+
products: params.products || (baseWalletParams === null || baseWalletParams === void 0 ? void 0 : baseWalletParams.products),
|
|
453
|
+
prepare_payments: params.prepare_payments || (baseWalletParams === null || baseWalletParams === void 0 ? void 0 : baseWalletParams.prepare_payments),
|
|
454
|
+
multiple: 1,
|
|
455
|
+
// 搜索特有参数
|
|
456
|
+
code: params.code
|
|
457
|
+
};
|
|
458
|
+
this.paymentModule.logInfo('[WalletPass] 搜索普通识别码', {
|
|
459
|
+
code: searchParams.code,
|
|
460
|
+
customer_id: searchParams.customer_id,
|
|
461
|
+
order_expect_amount: searchParams.order_expect_amount,
|
|
462
|
+
multiple: searchParams.multiple
|
|
463
|
+
});
|
|
464
|
+
_context5.next = 19;
|
|
465
|
+
return this.paymentModule.request.post('/machinecode/prepare/deduction/search', searchParams);
|
|
466
|
+
case 19:
|
|
467
|
+
response = _context5.sent;
|
|
468
|
+
searchResults = (response === null || response === void 0 ? void 0 : response.data) || [];
|
|
469
|
+
if (!config.noCache) {
|
|
470
|
+
_context5.next = 23;
|
|
471
|
+
break;
|
|
472
|
+
}
|
|
473
|
+
return _context5.abrupt("return", {
|
|
474
|
+
type: 'normalCode',
|
|
475
|
+
data: searchResults
|
|
476
|
+
});
|
|
477
|
+
case 23:
|
|
478
|
+
// 将搜索结果存储到缓存数组中
|
|
479
|
+
if (searchResults.length > 0) {
|
|
480
|
+
// 避免重复存储相同的识别码
|
|
481
|
+
existingCodes = new Set(this.searchResults.map(function (item) {
|
|
482
|
+
return item.code;
|
|
483
|
+
}));
|
|
484
|
+
newResults = searchResults.filter(function (item) {
|
|
485
|
+
return !existingCodes.has(item.code);
|
|
486
|
+
});
|
|
487
|
+
(_this$searchResults = this.searchResults).push.apply(_this$searchResults, _toConsumableArray(newResults));
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
// 通过事件暴露当前搜索结果和缓存结果
|
|
491
|
+
this.emitEvent(WalletPassHooks.OnSearchIdentificationCodeCompleted, {
|
|
492
|
+
searchCode: params.code,
|
|
493
|
+
currentSearchResults: searchResults,
|
|
494
|
+
cachedSearchResults: _toConsumableArray(this.searchResults),
|
|
495
|
+
searchParams: params
|
|
496
|
+
});
|
|
497
|
+
this.paymentModule.logInfo('[WalletPass] 普通识别码搜索完成', {
|
|
498
|
+
code: params.code,
|
|
499
|
+
results_count: searchResults.length,
|
|
500
|
+
cached_results_count: this.searchResults.length,
|
|
501
|
+
type: 'normalCode'
|
|
502
|
+
});
|
|
503
|
+
return _context5.abrupt("return", {
|
|
504
|
+
type: 'normalCode',
|
|
505
|
+
data: searchResults
|
|
506
|
+
});
|
|
507
|
+
case 29:
|
|
508
|
+
_context5.prev = 29;
|
|
509
|
+
_context5.t0 = _context5["catch"](1);
|
|
510
|
+
this.paymentModule.logError('[WalletPass] 搜索识别码信息失败', _context5.t0, {
|
|
511
|
+
code: params.code,
|
|
512
|
+
customer_id: params.customer_id,
|
|
513
|
+
order_expect_amount: params.order_expect_amount
|
|
514
|
+
});
|
|
515
|
+
throw _context5.t0;
|
|
516
|
+
case 33:
|
|
517
|
+
case "end":
|
|
518
|
+
return _context5.stop();
|
|
519
|
+
}
|
|
520
|
+
}, _callee5, this, [[1, 29]]);
|
|
521
|
+
}));
|
|
522
|
+
function searchIdentificationCodeAsync(_x5) {
|
|
523
|
+
return _searchIdentificationCodeAsync.apply(this, arguments);
|
|
524
|
+
}
|
|
525
|
+
return searchIdentificationCodeAsync;
|
|
526
|
+
}())
|
|
527
|
+
}, {
|
|
528
|
+
key: "processWalletPayment",
|
|
529
|
+
value: function () {
|
|
530
|
+
var _processWalletPayment = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(amount, orderUuid, voucherId) {
|
|
531
|
+
var walletMethod, paymentItem;
|
|
532
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
533
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
534
|
+
case 0:
|
|
535
|
+
this.paymentModule.logInfo('[WalletPass] 开始处理钱包支付', {
|
|
536
|
+
amount: amount,
|
|
537
|
+
orderUuid: orderUuid,
|
|
538
|
+
voucherId: voucherId || 'none'
|
|
539
|
+
});
|
|
540
|
+
_context6.next = 3;
|
|
541
|
+
return this.paymentModule.getWalletPaymentMethod();
|
|
542
|
+
case 3:
|
|
543
|
+
walletMethod = _context6.sent;
|
|
544
|
+
if (walletMethod) {
|
|
545
|
+
_context6.next = 7;
|
|
546
|
+
break;
|
|
547
|
+
}
|
|
548
|
+
this.paymentModule.logError('[WalletPass] 钱包支付方式未找到', null, {
|
|
549
|
+
amount: amount,
|
|
550
|
+
orderUuid: orderUuid,
|
|
551
|
+
voucherId: voucherId
|
|
552
|
+
});
|
|
553
|
+
throw new Error('钱包支付方式未找到');
|
|
554
|
+
case 7:
|
|
555
|
+
paymentItem = {
|
|
556
|
+
amount: amount.toString(),
|
|
557
|
+
code: walletMethod.code,
|
|
558
|
+
id: walletMethod.id,
|
|
559
|
+
name: walletMethod.name,
|
|
560
|
+
type: walletMethod.type,
|
|
561
|
+
voucher_id: voucherId || ''
|
|
562
|
+
};
|
|
563
|
+
_context6.next = 10;
|
|
564
|
+
return this.paymentModule.addPaymentItemAsync(orderUuid, paymentItem);
|
|
565
|
+
case 10:
|
|
566
|
+
this.paymentModule.logInfo('[WalletPass] 钱包支付处理完成', {
|
|
567
|
+
amount: amount,
|
|
568
|
+
orderUuid: orderUuid,
|
|
569
|
+
voucherId: voucherId || 'none',
|
|
570
|
+
payment_method: walletMethod.name
|
|
571
|
+
});
|
|
572
|
+
case 11:
|
|
573
|
+
case "end":
|
|
574
|
+
return _context6.stop();
|
|
575
|
+
}
|
|
576
|
+
}, _callee6, this);
|
|
577
|
+
}));
|
|
578
|
+
function processWalletPayment(_x6, _x7, _x8) {
|
|
579
|
+
return _processWalletPayment.apply(this, arguments);
|
|
580
|
+
}
|
|
581
|
+
return processWalletPayment;
|
|
582
|
+
}()
|
|
583
|
+
}, {
|
|
584
|
+
key: "getWalletBalance",
|
|
585
|
+
value: function () {
|
|
586
|
+
var _getWalletBalance = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(voucherId) {
|
|
587
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
588
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
589
|
+
case 0:
|
|
590
|
+
return _context7.abrupt("return", 0);
|
|
591
|
+
case 1:
|
|
592
|
+
case "end":
|
|
593
|
+
return _context7.stop();
|
|
594
|
+
}
|
|
595
|
+
}, _callee7);
|
|
596
|
+
}));
|
|
597
|
+
function getWalletBalance(_x9) {
|
|
598
|
+
return _getWalletBalance.apply(this, arguments);
|
|
599
|
+
}
|
|
600
|
+
return getWalletBalance;
|
|
601
|
+
}()
|
|
602
|
+
/**
|
|
603
|
+
* 获取缓存的钱包推荐列表
|
|
604
|
+
*/
|
|
605
|
+
}, {
|
|
606
|
+
key: "getWalletRecommendList",
|
|
607
|
+
value: function getWalletRecommendList() {
|
|
608
|
+
return this.walletRecommendList;
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
/**
|
|
612
|
+
* 获取缓存的用户识别码列表
|
|
613
|
+
*/
|
|
614
|
+
}, {
|
|
615
|
+
key: "getUserIdentificationCodes",
|
|
616
|
+
value: function getUserIdentificationCodes() {
|
|
617
|
+
return this.userIdentificationCodes;
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
/**
|
|
621
|
+
* 清除钱包推荐列表
|
|
622
|
+
*/
|
|
623
|
+
}, {
|
|
624
|
+
key: "clearWalletRecommendList",
|
|
625
|
+
value: function clearWalletRecommendList() {
|
|
626
|
+
this.walletRecommendList = [];
|
|
627
|
+
|
|
628
|
+
// 发送钱包推荐列表清除事件
|
|
629
|
+
this.emitEvent(WalletPassHooks.OnWalletRecommendListCleared, {
|
|
630
|
+
clearedTypes: ['walletRecommendList']
|
|
631
|
+
});
|
|
632
|
+
this.paymentModule.logInfo('[WalletPass] 钱包推荐列表已清除');
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
/**
|
|
636
|
+
* 清除用户识别码列表
|
|
637
|
+
*/
|
|
638
|
+
}, {
|
|
639
|
+
key: "clearUserIdentificationCodes",
|
|
640
|
+
value: function clearUserIdentificationCodes() {
|
|
641
|
+
this.userIdentificationCodes = [];
|
|
642
|
+
|
|
643
|
+
// 发送用户识别码列表清除事件
|
|
644
|
+
this.emitEvent(WalletPassHooks.OnUserIdentificationCodesCleared, {
|
|
645
|
+
clearedTypes: ['userIdentificationCodes']
|
|
646
|
+
});
|
|
647
|
+
this.paymentModule.logInfo('[WalletPass] 用户识别码列表已清除');
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
/**
|
|
651
|
+
* 获取缓存的搜索结果列表
|
|
652
|
+
*/
|
|
653
|
+
}, {
|
|
654
|
+
key: "getSearchResults",
|
|
655
|
+
value: function getSearchResults() {
|
|
656
|
+
return this.searchResults;
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
/**
|
|
660
|
+
* 根据识别码查找搜索结果
|
|
661
|
+
*/
|
|
662
|
+
}, {
|
|
663
|
+
key: "findSearchResultByCode",
|
|
664
|
+
value: function findSearchResultByCode(code) {
|
|
665
|
+
return this.searchResults.find(function (item) {
|
|
666
|
+
return item.code === code;
|
|
667
|
+
});
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
/**
|
|
671
|
+
* 清除搜索结果缓存
|
|
672
|
+
*/
|
|
673
|
+
}, {
|
|
674
|
+
key: "clearSearchResults",
|
|
675
|
+
value: function clearSearchResults() {
|
|
676
|
+
this.searchResults = [];
|
|
677
|
+
this.paymentModule.logInfo('[WalletPass] 搜索结果缓存已清除');
|
|
678
|
+
}
|
|
679
|
+
|
|
680
|
+
/**
|
|
681
|
+
* 清除所有缓存数据
|
|
682
|
+
*/
|
|
683
|
+
}, {
|
|
684
|
+
key: "clearAllCache",
|
|
685
|
+
value: function clearAllCache() {
|
|
686
|
+
this.walletRecommendList = [];
|
|
687
|
+
this.userIdentificationCodes = [];
|
|
688
|
+
this.searchResults = [];
|
|
689
|
+
this.walletParams = null;
|
|
690
|
+
|
|
691
|
+
// 发送所有缓存清除事件
|
|
692
|
+
this.emitEvent(WalletPassHooks.OnWalletCacheCleared, {
|
|
693
|
+
clearedTypes: ['all']
|
|
694
|
+
});
|
|
695
|
+
this.paymentModule.logInfo('[WalletPass] 所有缓存数据已清除', {
|
|
696
|
+
cleared_types: ['walletRecommendList', 'userIdentificationCodes', 'searchResults', 'walletParams']
|
|
697
|
+
});
|
|
698
|
+
}
|
|
699
|
+
}]);
|
|
700
|
+
return WalletPassPaymentImpl;
|
|
701
|
+
}();
|