@pisell/private-materials 6.2.49 → 6.2.50

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 (168) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +2 -2
  6. package/build/lowcode/preview.js +7 -7
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +7 -7
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +7 -7
  11. package/es/components/appointmentBooking/components/ConfirmInformation/index.js +27 -3
  12. package/es/components/appointmentBooking/components/Content/index.js +3 -3
  13. package/es/components/appointmentBooking/components/Services/index.js +36 -18
  14. package/es/components/appointmentBooking/components/Voucher/index.js +6 -5
  15. package/es/components/appointmentBooking/hooks.js +10 -2
  16. package/es/components/appointmentBooking/index.js +10 -0
  17. package/es/components/booking/addons/model.d.ts +1 -10
  18. package/es/components/booking/components/footer/index.js +12 -1
  19. package/es/components/booking/editBookingModal/index.js +8 -2
  20. package/es/components/booking/forms/model.d.ts +1 -10
  21. package/es/components/booking/info/model.d.ts +1 -10
  22. package/es/components/booking/info/service/addService/utils.d.ts +1 -1
  23. package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
  24. package/es/components/booking/locales.d.ts +6 -0
  25. package/es/components/booking/locales.js +12 -0
  26. package/es/components/booking/model.d.ts +1 -9
  27. package/es/components/booking/notes/model.d.ts +1 -10
  28. package/es/components/booking/payments/model.d.ts +1 -10
  29. package/es/components/eftposPay/hooks.d.ts +1 -1
  30. package/es/components/eftposPay/linkly/hooks/normal.js +3 -3
  31. package/es/components/eftposPay/linkly/hooks/useTimeQuery.js +25 -4
  32. package/es/components/eftposPay/store/index.d.ts +2 -2
  33. package/es/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +34 -8
  34. package/es/components/index.d.ts +3 -1
  35. package/es/components/index.js +3 -1
  36. package/es/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +6 -3
  37. package/es/components/pay/toC/PaymentMethods/WalletPass/List/index.d.ts +2 -0
  38. package/es/components/pay/toC/PaymentMethods/WalletPass/index.js +112 -24
  39. package/es/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +38 -2
  40. package/es/components/pay/toC/PaymentMethods/WalletPass/serve.js +78 -0
  41. package/es/components/pay/toC/PaymentMethods/WalletPass/utils.d.ts +6 -0
  42. package/es/components/pay/toC/PaymentMethods/WalletPass/utils.js +9 -0
  43. package/es/components/pay/toC/model.d.ts +1 -9
  44. package/es/components/pay/toC/utils.js +1 -1
  45. package/es/components/pinModal/hooks.d.ts +7 -0
  46. package/es/components/pinModal/hooks.js +65 -0
  47. package/es/components/pinModal/index.d.ts +4 -0
  48. package/es/components/pinModal/index.js +98 -0
  49. package/es/components/pinModal/index.less +44 -0
  50. package/es/components/pinModal/locales.d.ts +27 -0
  51. package/es/components/pinModal/locales.js +26 -0
  52. package/es/components/pinModal/serve.d.ts +6 -0
  53. package/es/components/pinModal/serve.js +11 -0
  54. package/es/components/pinModal/types.d.ts +0 -0
  55. package/es/components/pinModal/types.js +0 -0
  56. package/es/components/pinVerifyModal/hooks.d.ts +7 -0
  57. package/es/components/pinVerifyModal/hooks.js +80 -0
  58. package/es/components/pinVerifyModal/index.d.ts +5 -0
  59. package/es/components/pinVerifyModal/index.js +218 -0
  60. package/es/components/pinVerifyModal/index.less +92 -0
  61. package/es/components/pinVerifyModal/locales.d.ts +24 -0
  62. package/es/components/pinVerifyModal/locales.js +23 -0
  63. package/es/components/pinVerifyModal/types.d.ts +33 -0
  64. package/es/components/pinVerifyModal/types.js +1 -0
  65. package/es/components/schedules/model.d.ts +1 -9
  66. package/es/components/ticketBooking/components/ticketBooking/index.js +58 -10
  67. package/es/components/ticketBooking/components/timeBar/index.js +2 -1
  68. package/es/components/ticketBooking/utils/index.d.ts +1 -1
  69. package/es/components/wallet/Detail/index.js +251 -63
  70. package/es/components/wallet/Detail/locales.d.ts +51 -0
  71. package/es/components/wallet/Detail/locales.js +57 -3
  72. package/es/components/wallet/Detail/model.d.ts +1 -13
  73. package/es/components/wallet/Detail/serve.js +5 -1
  74. package/es/components/wallet/DiscountCard/model.d.ts +1 -14
  75. package/es/components/wallet/PointCard/model.d.ts +1 -13
  76. package/es/components/wallet/RechargeableCard/model.d.ts +1 -29
  77. package/es/components/wallet/Voucher/model.d.ts +1 -13
  78. package/es/components/wallet/components/UsageRules/index.d.ts +23 -0
  79. package/es/components/wallet/components/UsageRules/index.js +147 -0
  80. package/es/components/wallet/components/UsageRules/index.less +157 -0
  81. package/es/components/wallet/components/WalletCard.js +8 -3
  82. package/es/components/wallet/components/index.d.ts +1 -0
  83. package/es/components/wallet/components/index.js +2 -1
  84. package/es/components/wallet/model.d.ts +1 -9
  85. package/es/components/walletList/index.js +20 -2
  86. package/es/index.d.ts +2 -0
  87. package/es/index.js +3 -1
  88. package/lib/components/appointmentBooking/components/ConfirmInformation/index.js +22 -2
  89. package/lib/components/appointmentBooking/components/Content/index.js +2 -2
  90. package/lib/components/appointmentBooking/components/Services/index.js +13 -3
  91. package/lib/components/appointmentBooking/components/Voucher/index.js +2 -1
  92. package/lib/components/appointmentBooking/hooks.js +10 -2
  93. package/lib/components/appointmentBooking/index.js +6 -0
  94. package/lib/components/booking/addons/model.d.ts +1 -10
  95. package/lib/components/booking/components/footer/index.js +15 -2
  96. package/lib/components/booking/components/voucher/index.js +1 -3
  97. package/lib/components/booking/editBookingModal/index.js +6 -1
  98. package/lib/components/booking/forms/model.d.ts +1 -10
  99. package/lib/components/booking/info/model.d.ts +1 -10
  100. package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
  101. package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
  102. package/lib/components/booking/locales.d.ts +6 -0
  103. package/lib/components/booking/locales.js +6 -0
  104. package/lib/components/booking/model.d.ts +1 -9
  105. package/lib/components/booking/notes/model.d.ts +1 -10
  106. package/lib/components/booking/payments/model.d.ts +1 -10
  107. package/lib/components/eftposPay/hooks.d.ts +1 -1
  108. package/lib/components/eftposPay/linkly/hooks/normal.js +3 -3
  109. package/lib/components/eftposPay/linkly/hooks/useTimeQuery.js +16 -4
  110. package/lib/components/eftposPay/store/index.d.ts +2 -2
  111. package/lib/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +30 -8
  112. package/lib/components/index.d.ts +3 -1
  113. package/lib/components/index.js +6 -0
  114. package/lib/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +2 -0
  115. package/lib/components/pay/toC/PaymentMethods/WalletPass/List/index.d.ts +2 -0
  116. package/lib/components/pay/toC/PaymentMethods/WalletPass/index.js +84 -36
  117. package/lib/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +38 -2
  118. package/lib/components/pay/toC/PaymentMethods/WalletPass/serve.js +18 -0
  119. package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.d.ts +6 -0
  120. package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.js +7 -2
  121. package/lib/components/pay/toC/model.d.ts +1 -9
  122. package/lib/components/pay/toC/utils.js +1 -1
  123. package/lib/components/pinModal/hooks.d.ts +7 -0
  124. package/lib/components/pinModal/hooks.js +85 -0
  125. package/lib/components/pinModal/index.d.ts +4 -0
  126. package/lib/components/pinModal/index.js +88 -0
  127. package/lib/components/pinModal/index.less +44 -0
  128. package/lib/components/pinModal/locales.d.ts +27 -0
  129. package/lib/components/pinModal/locales.js +50 -0
  130. package/lib/components/pinModal/serve.d.ts +6 -0
  131. package/lib/components/pinModal/serve.js +37 -0
  132. package/lib/components/pinModal/types.d.ts +0 -0
  133. package/lib/components/pinModal/types.js +0 -0
  134. package/lib/components/pinVerifyModal/hooks.d.ts +7 -0
  135. package/lib/components/pinVerifyModal/hooks.js +93 -0
  136. package/lib/components/pinVerifyModal/index.d.ts +5 -0
  137. package/lib/components/pinVerifyModal/index.js +230 -0
  138. package/lib/components/pinVerifyModal/index.less +92 -0
  139. package/lib/components/pinVerifyModal/locales.d.ts +24 -0
  140. package/lib/components/pinVerifyModal/locales.js +47 -0
  141. package/lib/components/pinVerifyModal/types.d.ts +33 -0
  142. package/lib/components/pinVerifyModal/types.js +17 -0
  143. package/lib/components/schedules/model.d.ts +1 -9
  144. package/lib/components/ticketBooking/components/ticketBooking/index.js +50 -6
  145. package/lib/components/ticketBooking/components/timeBar/index.js +2 -1
  146. package/lib/components/ticketBooking/utils/index.d.ts +1 -1
  147. package/lib/components/wallet/Detail/index.js +140 -8
  148. package/lib/components/wallet/Detail/locales.d.ts +51 -0
  149. package/lib/components/wallet/Detail/locales.js +57 -3
  150. package/lib/components/wallet/Detail/model.d.ts +1 -13
  151. package/lib/components/wallet/Detail/serve.js +6 -1
  152. package/lib/components/wallet/DiscountCard/model.d.ts +1 -14
  153. package/lib/components/wallet/PointCard/model.d.ts +1 -13
  154. package/lib/components/wallet/RechargeableCard/model.d.ts +1 -29
  155. package/lib/components/wallet/Voucher/model.d.ts +1 -13
  156. package/lib/components/wallet/components/UsageRules/index.d.ts +23 -0
  157. package/lib/components/wallet/components/UsageRules/index.js +113 -0
  158. package/lib/components/wallet/components/UsageRules/index.less +157 -0
  159. package/lib/components/wallet/components/WalletCard.js +3 -1
  160. package/lib/components/wallet/components/index.d.ts +1 -0
  161. package/lib/components/wallet/components/index.js +3 -0
  162. package/lib/components/wallet/model.d.ts +1 -9
  163. package/lib/components/walletList/index.js +19 -2
  164. package/lib/index.d.ts +2 -0
  165. package/lib/index.js +6 -0
  166. package/lowcode/pin-modal/meta.ts +37 -0
  167. package/lowcode/pin-verify-modal/meta.ts +80 -0
  168. package/package.json +4 -4
@@ -7,7 +7,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
7
7
  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; }
8
8
  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); } }
9
9
  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); }); }; }
10
- import React, { forwardRef, useImperativeHandle, useEffect } from 'react';
10
+ import React, { forwardRef, useImperativeHandle, useEffect, useRef } from 'react';
11
11
  import { locales, isMobile } from '@pisell/utils';
12
12
  import useEngineContext from "../../../../hooks/useEngineContext";
13
13
  import { useAppointmentBookingContext } from "../../context";
@@ -18,9 +18,12 @@ import { getFormParams } from "./utils";
18
18
  import "./index.less";
19
19
  var ConfirmInformation = /*#__PURE__*/forwardRef(function (props, ref) {
20
20
  var _context$appHelper;
21
+ // 用于跟踪是否已经订阅了事件,避免重复订阅
22
+ var hasSubscribedRef = useRef(false);
21
23
  var context = useEngineContext();
22
24
  var config = (context === null || context === void 0 || (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 || (_context$appHelper = _context$appHelper.constants) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.config) || {};
23
25
  var utils = contextUtils();
26
+ var pubsub = context.appHelper.utils.pubsub;
24
27
  var _ref = useAppointmentBookingContext(),
25
28
  appointmentBooking = _ref.appointmentBooking,
26
29
  summary = _ref.summary,
@@ -252,15 +255,36 @@ var ConfirmInformation = /*#__PURE__*/forwardRef(function (props, ref) {
252
255
  return _ref4.apply(this, arguments);
253
256
  };
254
257
  }();
258
+ var handleSubmit = function handleSubmit() {
259
+ var _utils$businessUtils, _utils$businessUtils$;
260
+ // 如果用户是guest用户,下单时则拉起注册弹窗
261
+ if (utils !== null && utils !== void 0 && (_utils$businessUtils = utils.businessUtils) !== null && _utils$businessUtils !== void 0 && (_utils$businessUtils$ = _utils$businessUtils.isGuestUser) !== null && _utils$businessUtils$ !== void 0 && _utils$businessUtils$.call(_utils$businessUtils)) {
262
+ var _utils$businessUtils2, _utils$businessUtils3;
263
+ // 避免重复订阅
264
+ if (!hasSubscribedRef.current) {
265
+ pubsub.subscribe('bind.guest.user', handleNext);
266
+ hasSubscribedRef.current = true;
267
+ }
268
+ utils === null || utils === void 0 || (_utils$businessUtils2 = utils.businessUtils) === null || _utils$businessUtils2 === void 0 || (_utils$businessUtils3 = _utils$businessUtils2.openRegisterModal) === null || _utils$businessUtils3 === void 0 || _utils$businessUtils3.call(_utils$businessUtils2, true);
269
+ return;
270
+ }
271
+ handleNext();
272
+ };
273
+ useEffect(function () {
274
+ return function () {
275
+ pubsub.unsubscribe('bind.guest.user', handleNext);
276
+ hasSubscribedRef.current = false;
277
+ };
278
+ }, []);
255
279
  useImperativeHandle(ref, function () {
256
280
  return {
257
- next: handleNext
281
+ next: handleSubmit
258
282
  };
259
283
  });
260
284
  return /*#__PURE__*/React.createElement("div", {
261
285
  className: "appointment-confirm-information-wrap"
262
286
  }, isMobile() ? /*#__PURE__*/React.createElement(CartItem, {
263
- onNext: handleNext
287
+ onNext: handleSubmit
264
288
  }) : /*#__PURE__*/React.createElement("div", {
265
289
  className: "appointment-confirm-information-content"
266
290
  }, /*#__PURE__*/React.createElement("div", {
@@ -87,7 +87,7 @@ var Layout = function Layout() {
87
87
  var pubsub = context.appHelper.utils.pubsub;
88
88
  useEffect(function () {
89
89
  var handleLoginSuccess = /*#__PURE__*/function () {
90
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
90
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(res) {
91
91
  var _utils$storage, user, currentUser, accountLists, meAccount;
92
92
  return _regeneratorRuntime().wrap(function _callee$(_context) {
93
93
  while (1) switch (_context.prev = _context.next) {
@@ -118,13 +118,13 @@ var Layout = function Layout() {
118
118
  }
119
119
  }, _callee);
120
120
  }));
121
- return function handleLoginSuccess() {
121
+ return function handleLoginSuccess(_x) {
122
122
  return _ref2.apply(this, arguments);
123
123
  };
124
124
  }();
125
125
  pubsub.subscribe('pisell1.login.success', handleLoginSuccess);
126
126
  return function () {
127
- pubsub.unsubscribe('pisell1.login.success');
127
+ pubsub.unsubscribe('pisell1.login.success', handleLoginSuccess);
128
128
  };
129
129
  }, []);
130
130
  useEffect(function () {
@@ -99,7 +99,7 @@ var Services = /*#__PURE__*/forwardRef(function (props, ref) {
99
99
  },
100
100
  callback: function () {
101
101
  var _callback = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(data) {
102
- var product, session, startDate, endDate, _data$origin, resources, activeStatus, index, stepList, hasResourceStep, description;
102
+ var product, res, session, startDate, endDate, _res, _data$origin, resources, activeStatus, _res2, index, stepList, hasResourceStep, description;
103
103
  return _regeneratorRuntime().wrap(function _callee$(_context) {
104
104
  while (1) switch (_context.prev = _context.next) {
105
105
  case 0:
@@ -117,7 +117,7 @@ var Services = /*#__PURE__*/forwardRef(function (props, ref) {
117
117
 
118
118
  // 零售模版,直接加入购物车
119
119
  if (!isRetailTemplate) {
120
- _context.next = 10;
120
+ _context.next = 12;
121
121
  break;
122
122
  }
123
123
  if (!(data !== null && data !== void 0 && data.isCancel)) {
@@ -126,51 +126,69 @@ var Services = /*#__PURE__*/forwardRef(function (props, ref) {
126
126
  }
127
127
  return _context.abrupt("return");
128
128
  case 8:
129
- appointmentBooking.storeProduct(product);
129
+ res = appointmentBooking.storeProduct(product);
130
+ if (!(!res.success && res.errorCode === 'not_enough_stock')) {
131
+ _context.next = 11;
132
+ break;
133
+ }
134
+ return _context.abrupt("return", Toast(locales.getText('pisell2.appointment.unuse.stock')));
135
+ case 11:
130
136
  return _context.abrupt("return");
131
- case 10:
137
+ case 12:
132
138
  session = data === null || data === void 0 ? void 0 : data.session;
133
139
  if (!session) {
134
- _context.next = 19;
140
+ _context.next = 24;
135
141
  break;
136
142
  }
137
143
  startDate = dayjs(session === null || session === void 0 ? void 0 : session.start_at).format('YYYY-MM-DD');
138
144
  endDate = dayjs(session === null || session === void 0 ? void 0 : session.end_at).format('YYYY-MM-DD');
139
- appointmentBooking.addProductToCart({
145
+ _res = appointmentBooking.addProductToCart({
140
146
  product: _objectSpread({}, product),
141
147
  date: {
142
148
  startTime: "".concat(startDate, " ").concat(session === null || session === void 0 ? void 0 : session.start_time),
143
149
  endTime: "".concat(endDate, " ").concat(session === null || session === void 0 ? void 0 : session.end_time)
144
150
  }
145
151
  });
146
- _context.next = 17;
152
+ if (!(!_res.success && _res.errorCode === 'not_enough_stock')) {
153
+ _context.next = 19;
154
+ break;
155
+ }
156
+ return _context.abrupt("return", Toast(locales.getText('pisell2.appointment.unuse.stock')));
157
+ case 19:
158
+ appointmentBooking.closeProductDetail();
159
+ _context.next = 22;
147
160
  return appointmentBooking.getAvailableDate({
148
161
  startDate: startDate,
149
162
  endDate: endDate
150
163
  });
151
- case 17:
152
- _context.next = 27;
164
+ case 22:
165
+ _context.next = 34;
153
166
  break;
154
- case 19:
167
+ case 24:
155
168
  resources = (data === null || data === void 0 || (_data$origin = data.origin) === null || _data$origin === void 0 || (_data$origin = _data$origin.product_resource) === null || _data$origin === void 0 ? void 0 : _data$origin.resources) || [];
156
169
  activeStatus = resources.find(function (item) {
157
170
  return item.status === 1;
158
171
  });
159
172
  if (!(!activeStatus && !appointmentBooking.isTargetNormalProduct(data === null || data === void 0 ? void 0 : data.origin))) {
160
- _context.next = 23;
173
+ _context.next = 28;
161
174
  break;
162
175
  }
163
176
  return _context.abrupt("return", Toast(locales.getText('pisell2.appointment.no.available.service')));
164
- case 23:
165
- appointmentBooking.storeProduct(product);
166
- // duration 类型的商品,要获取一下资源,在先选日期的 duration 步骤里目前只能通过这个动作拉取
177
+ case 28:
178
+ _res2 = appointmentBooking.storeProduct(product);
179
+ if (!(!_res2.success && _res2.errorCode === 'not_enough_stock')) {
180
+ _context.next = 31;
181
+ break;
182
+ }
183
+ return _context.abrupt("return", Toast(locales.getText('pisell2.appointment.unuse.stock')));
184
+ case 31:
167
185
  if (!(type === 'duration')) {
168
- _context.next = 27;
186
+ _context.next = 34;
169
187
  break;
170
188
  }
171
- _context.next = 27;
189
+ _context.next = 34;
172
190
  return appointmentBooking.getAvailableDate();
173
- case 27:
191
+ case 34:
174
192
  appointmentBooking.closeProductDetail();
175
193
 
176
194
  // 先选择日期流程
@@ -199,7 +217,7 @@ var Services = /*#__PURE__*/forwardRef(function (props, ref) {
199
217
  removeStep('select-time');
200
218
  }
201
219
  }
202
- case 29:
220
+ case 36:
203
221
  case "end":
204
222
  return _context.stop();
205
223
  }
@@ -136,13 +136,14 @@ var VoucherCard = function VoucherCard(props) {
136
136
  // // apply code
137
137
  var onScanCode = /*#__PURE__*/function () {
138
138
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
139
- var val;
139
+ var customerId, val;
140
140
  return _regeneratorRuntime().wrap(function _callee$(_context) {
141
141
  while (1) switch (_context.prev = _context.next) {
142
142
  case 0:
143
- _context.next = 2;
144
- return shopDiscount.scanCode(code);
145
- case 2:
143
+ customerId = currentUser.id;
144
+ _context.next = 3;
145
+ return shopDiscount.scanCode(code, customerId);
146
+ case 3:
146
147
  val = _context.sent;
147
148
  if (val !== null && val !== void 0 && val.isAvailable) {
148
149
  batchUpdateCart(val.productList);
@@ -152,7 +153,7 @@ var VoucherCard = function VoucherCard(props) {
152
153
  content: val.type === 'server' ? locales.getText('pisell2.text.goodpass.code-invalid') : locales.getText('pisell2.text.goodpass.code-invalid-cart')
153
154
  });
154
155
  }
155
- case 4:
156
+ case 5:
156
157
  case "end":
157
158
  return _context.stop();
158
159
  }
@@ -206,6 +206,12 @@ export var useAppointmentBookingStep = function useAppointmentBookingStep() {
206
206
  if (!result) {
207
207
  return Toast(locales.getText('pisell2.appointment.unuse.date'));
208
208
  }
209
+ var capacityResult = appointmentBooking.checkMaxDurationCapacity();
210
+ if (!capacityResult.success) {
211
+ var getMessage = locales.getText('pisell2.appointment.unuse.capacity');
212
+ var message = typeof getMessage === 'function' ? getMessage(capacityResult.minAvailableCount) : getMessage;
213
+ return Toast(message);
214
+ }
209
215
  }
210
216
  if (!isRetailTemplate && currentKey !== null && currentKey !== void 0 && currentKey.startsWith('select-resource')) {
211
217
  var _currentSelectedResou;
@@ -357,8 +363,10 @@ export var useAppointmentBookingStep = function useAppointmentBookingStep() {
357
363
  }
358
364
  // const accountLists = await appointmentBooking.getAccounts()
359
365
  pubsub = utils.pubsub;
360
- pubsub.once('pisell1.login.success', function () {
361
- checkHolder();
366
+ pubsub.once('pisell1.login.success', function (res) {
367
+ if (res === 'success') {
368
+ checkHolder();
369
+ }
362
370
  });
363
371
  return _context3.abrupt("return", openLoginModal({
364
372
  callback: function callback(status) {
@@ -24,6 +24,16 @@ var AppointmentBooking = function AppointmentBooking() {
24
24
  if (!data.length) {
25
25
  var currentUser = formatCurrentUser(utils);
26
26
  appointmentBooking.addAccounts([currentUser]);
27
+ } else if (data.length >= 1) {
28
+ var meAccount = data === null || data === void 0 ? void 0 : data.find(function (d) {
29
+ return !(d !== null && d !== void 0 && d.isGuest);
30
+ });
31
+ // 如果 length >= 1 找到非 guest 账号,检测这个账号是否跟 localStorage 里已登录的账号 id 一致
32
+ // 如果不一致的话,则setLoginAccount ls 里的账号
33
+ var _currentUser = formatCurrentUser(utils);
34
+ if (_currentUser && meAccount.id !== _currentUser.id) {
35
+ appointmentBooking.setLoginAccount(meAccount.id, _currentUser);
36
+ }
27
37
  }
28
38
  });
29
39
  }, []);
@@ -1,10 +1 @@
1
- /// <reference types="react" />
2
- import { FormState } from "../model";
3
- export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
4
- state: FormState;
5
- } & {
6
- dispatch: (params: {
7
- type: string;
8
- payload: any;
9
- }) => void;
10
- }>;
1
+ export declare const Provider: any, Context: any;
@@ -435,7 +435,7 @@ var Footer = function Footer(props) {
435
435
  */
436
436
  var handleSave = /*#__PURE__*/function () {
437
437
  var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(_ref4) {
438
- var type, _ref4$messageShow, messageShow, isHasDayProducts, _setLoading, _getApis, createBooking, editBooking, editApi, createApi, saveOtherValue, _state$onSave, callbackData, values, api;
438
+ var type, _ref4$messageShow, messageShow, isHasDayProducts, _setLoading, _getApis, createBooking, editBooking, editApi, createApi, saveOtherValue, _state$onSave, _store$getState, _window, callbackData, values, api;
439
439
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
440
440
  while (1) switch (_context4.prev = _context4.next) {
441
441
  case 0:
@@ -492,6 +492,17 @@ var Footer = function Footer(props) {
492
492
  }, {
493
493
  key: '日期',
494
494
  value: dayjs().format('YYYY-MM-DD HH:mm')
495
+ }, {
496
+ key: '店铺id',
497
+ value: store === null || store === void 0 || (_store$getState = store.getState) === null || _store$getState === void 0 || (_store$getState = _store$getState.call(store)) === null || _store$getState === void 0 || (_store$getState = _store$getState.global) === null || _store$getState === void 0 || (_store$getState = _store$getState.globalConfig) === null || _store$getState === void 0 ? void 0 : _store$getState.id
498
+ }, {
499
+ key: 'shopApi',
500
+ value: JSON.stringify((_window = window) === null || _window === void 0 ? void 0 : _window.shopApi, function (key, value) {
501
+ if (typeof value === 'function') {
502
+ return 'function';
503
+ }
504
+ return value;
505
+ })
495
506
  }]
496
507
  });
497
508
 
@@ -71,7 +71,7 @@ var EditBookingModal = function EditBookingModal(props, ref) {
71
71
  var getInitData = /*#__PURE__*/function () {
72
72
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(params) {
73
73
  var _data$fromResource, _data$toResource;
74
- var mockProps, _data, _initResourceVal, fromResourceFormId, toResourceFormId, _form_id, _data$toResource2, _formatResources, list, maps, currentForm, relation_id, _currentForm$renderLi, _currentForm$renderLi2, _currentForm$renderLi3, _currentForm$renderLi4, _targetResource, _cloned, _idx, _sameResource;
74
+ var mockProps, _data, _initResourceVal, fromResourceFormId, toResourceFormId, _form_id, _data$toResource2, _formatResources, list, maps, currentForm, relation_id, _currentForm$renderLi, _currentForm$renderLi2, _currentForm$renderLi3, _currentForm$renderLi4, _targetResource, _cloned, _idx, _sameResource, _targetIdx;
75
75
  return _regeneratorRuntime().wrap(function _callee$(_context) {
76
76
  while (1) switch (_context.prev = _context.next) {
77
77
  case 0:
@@ -129,7 +129,13 @@ var EditBookingModal = function EditBookingModal(props, ref) {
129
129
  _cloned[_idx] = _targetResource; // 替换现有对象
130
130
  }
131
131
  } else {
132
- _cloned.push(_targetResource); // 添加新对象
132
+ // 未发现原资源位置(短时间内通过其它渠道修改过资源)
133
+ _targetIdx = _cloned.findIndex(function (rs) {
134
+ return rs.relation_id == (_targetResource === null || _targetResource === void 0 ? void 0 : _targetResource.relation_id);
135
+ }); // 判断是否已经包含了目标资源,不包含则加入进来
136
+ if (_targetIdx === -1) {
137
+ _cloned.push(_targetResource); // 添加新对象
138
+ }
133
139
  }
134
140
  _initResourceVal = _objectSpread(_objectSpread({}, _initResourceVal), {}, _defineProperty({}, _form_id, _cloned));
135
141
  } else {
@@ -1,10 +1 @@
1
- /// <reference types="react" />
2
- import { FormState } from "../model";
3
- export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
4
- state: FormState;
5
- } & {
6
- dispatch: (params: {
7
- type: string;
8
- payload: any;
9
- }) => void;
10
- }>;
1
+ export declare const Provider: any, Context: any;
@@ -1,14 +1,5 @@
1
- /// <reference types="react" />
2
- import { FormState } from '../model';
3
1
  export declare const walkInData: {
4
2
  id: number;
5
3
  nickname: string;
6
4
  };
7
- export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
8
- state: FormState;
9
- } & {
10
- dispatch: (params: {
11
- type: string;
12
- payload: any;
13
- }) => void;
14
- }>;
5
+ export declare const Provider: any, Context: any;
@@ -6,7 +6,7 @@ export declare const getDurationProps: ({ cacheItem, useStartTime, currentResour
6
6
  type: string;
7
7
  value: number;
8
8
  };
9
- locale: any;
9
+ locale: string;
10
10
  slice: any;
11
11
  selectProps: {
12
12
  size: string;
@@ -7,7 +7,7 @@ export declare const getDurationProps: ({ cacheItem, useStartTime, currentResour
7
7
  type: string;
8
8
  value: number;
9
9
  };
10
- locale: any;
10
+ locale: string;
11
11
  slice: any;
12
12
  selectProps: {
13
13
  size: string;
@@ -156,6 +156,8 @@ declare const _default: {
156
156
  'pisell2.text.deposit-delete-message': string;
157
157
  'pisell2.text.deposit-paid': string;
158
158
  "pisell2.text.stock": string;
159
+ 'pisell2.appointment.unuse.stock': string;
160
+ 'pisell2.appointment.unuse.capacity': (count: number) => string;
159
161
  'pisell2.text.payment-link': string;
160
162
  'pisell2.text.send-mail': string;
161
163
  'pisell2.text.copy-to-clipboard': string;
@@ -458,6 +460,8 @@ declare const _default: {
458
460
  'pisell2.text.deposit-delete-message': string;
459
461
  'pisell2.text.deposit-paid': string;
460
462
  "pisell2.text.stock": string;
463
+ 'pisell2.appointment.unuse.stock': string;
464
+ 'pisell2.appointment.unuse.capacity': (count: number) => string;
461
465
  'pisell2.text.payment-link': string;
462
466
  'pisell2.text.send-mail': string;
463
467
  'pisell2.text.copy-to-clipboard': string;
@@ -760,6 +764,8 @@ declare const _default: {
760
764
  'pisell2.text.deposit-delete-message': string;
761
765
  'pisell2.text.deposit-paid': string;
762
766
  "pisell2.text.stock": string;
767
+ 'pisell2.appointment.unuse.stock': string;
768
+ 'pisell2.appointment.unuse.capacity': (count: number) => string;
763
769
  'pisell2.text.payment-link': string;
764
770
  'pisell2.text.send-mail': string;
765
771
  'pisell2.text.copy-to-clipboard': string;
@@ -174,6 +174,10 @@ export default {
174
174
  'pisell2.text.deposit-delete-message': "It cannot be restored after deletion. Please confirm the operation.",
175
175
  'pisell2.text.deposit-paid': "Deposit paid",
176
176
  "pisell2.text.stock": "Stock",
177
+ 'pisell2.appointment.unuse.stock': "Not enough stock",
178
+ 'pisell2.appointment.unuse.capacity': function pisell2AppointmentUnuseCapacity(count) {
179
+ return "Only ".concat(count, " spots available. Please reduce quantity.");
180
+ },
177
181
  'pisell2.text.payment-link': "Payment link",
178
182
  'pisell2.text.send-mail': "Send email",
179
183
  'pisell2.text.copy-to-clipboard': "Copy to clipboard",
@@ -531,6 +535,10 @@ export default {
531
535
  'pisell2.text.deposit-delete-message': "删除后不可恢复,请确认操作",
532
536
  'pisell2.text.deposit-paid': "已付定金",
533
537
  "pisell2.text.stock": "库存",
538
+ 'pisell2.appointment.unuse.stock': "库存不足",
539
+ 'pisell2.appointment.unuse.capacity': function pisell2AppointmentUnuseCapacity(count) {
540
+ return "\u4EC5\u53EF\u9884\u7EA6 ".concat(count, " \u4E2A\uFF0C\u8BF7\u51CF\u5C11\u6570\u91CF");
541
+ },
534
542
  'pisell2.text.payment-link': "付款链接",
535
543
  'pisell2.text.send-mail': "发送邮件",
536
544
  'pisell2.text.copy-to-clipboard': "复制到剪切板",
@@ -888,6 +896,10 @@ export default {
888
896
  'pisell2.text.deposit-delete-message': "刪除後不可恢復,請確認操作",
889
897
  'pisell2.text.deposit-paid': "已付定金",
890
898
  "pisell2.text.stock": "庫存",
899
+ 'pisell2.appointment.unuse.stock': "庫存不足",
900
+ 'pisell2.appointment.unuse.capacity': function pisell2AppointmentUnuseCapacity(count) {
901
+ return "\u50C5\u53EF\u9810\u7D04 ".concat(count, " \u500B\uFF0C\u8ACB\u6E1B\u5C11\u6578\u91CF");
902
+ },
891
903
  'pisell2.text.payment-link': "付款鏈接",
892
904
  'pisell2.text.send-mail': "發送郵件",
893
905
  'pisell2.text.copy-to-clipboard': "複製到剪切板",
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export interface FormState {
3
2
  amountSymbol: string;
4
3
  apis: {
@@ -106,11 +105,4 @@ export declare const walkInData: {
106
105
  id: number;
107
106
  nickname: string;
108
107
  };
109
- export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
110
- state: FormState;
111
- } & {
112
- dispatch: (params: {
113
- type: string;
114
- payload: any;
115
- }) => void;
116
- }>;
108
+ export declare const Provider: any, Context: any;
@@ -1,10 +1 @@
1
- /// <reference types="react" />
2
- import { FormState } from "../model";
3
- export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
4
- state: FormState;
5
- } & {
6
- dispatch: (params: {
7
- type: string;
8
- payload: any;
9
- }) => void;
10
- }>;
1
+ export declare const Provider: any, Context: any;
@@ -1,10 +1 @@
1
- /// <reference types="react" />
2
- import { FormState } from "../model";
3
- export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
4
- state: FormState;
5
- } & {
6
- dispatch: (params: {
7
- type: string;
8
- payload: any;
9
- }) => void;
10
- }>;
1
+ export declare const Provider: any, Context: any;
@@ -19,7 +19,7 @@ export declare const useStoreRef: <T extends {
19
19
  readonly netRef: React.MutableRefObject<boolean | undefined>;
20
20
  readonly symbolRef: React.MutableRefObject<string>;
21
21
  readonly amountRef: React.MutableRefObject<string | number>;
22
- readonly eftposRef: React.MutableRefObject<"stripe" | "tyro" | "windcave" | "payo" | "linkly">;
22
+ readonly eftposRef: React.MutableRefObject<"payo" | "tyro" | "windcave" | "stripe" | "linkly">;
23
23
  readonly clientRef: React.MutableRefObject<ClientEnum>;
24
24
  readonly dataRef: React.MutableRefObject<import("./store").State>;
25
25
  };
@@ -74,7 +74,7 @@ export var useLinklyPayOrRefund = function useLinklyPayOrRefund(handleCheck) {
74
74
  var status = res === null || res === void 0 || (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.status;
75
75
 
76
76
  // 继续查询交易状态
77
- if (status === 0) {
77
+ if (status == 0) {
78
78
  var _res$data2;
79
79
  // 交易流水号
80
80
  numRef.current = res === null || res === void 0 || (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.session_id;
@@ -89,7 +89,7 @@ export var useLinklyPayOrRefund = function useLinklyPayOrRefund(handleCheck) {
89
89
  setTimeout(function () {
90
90
  var _resultQueryRef$curre;
91
91
  (_resultQueryRef$curre = resultQueryRef.current) === null || _resultQueryRef$curre === void 0 || _resultQueryRef$curre.call(resultQueryRef);
92
- });
92
+ }, 300);
93
93
  return;
94
94
  }
95
95
 
@@ -99,7 +99,7 @@ export var useLinklyPayOrRefund = function useLinklyPayOrRefund(handleCheck) {
99
99
  }));
100
100
 
101
101
  // 交易成功
102
- if (status === 1) {
102
+ if (status == 1) {
103
103
  var _handleLinklySuccessR;
104
104
  (_handleLinklySuccessR = handleLinklySuccessRef.current) === null || _handleLinklySuccessR === void 0 || _handleLinklySuccessR.call(handleLinklySuccessRef, res);
105
105
  return;
@@ -86,15 +86,22 @@ export var useTimeResultQuery = function useTimeResultQuery(api, resultCheck, ha
86
86
  isQueryFinishedRef.current = true;
87
87
  var data = (result === null || result === void 0 ? void 0 : result.data) || {};
88
88
  // 交易成功,终止查询
89
- if (data.status === 1) {
89
+ if (data.status == 1) {
90
90
  console.log('交易成功,终止查询');
91
+ sendWarningLog({
92
+ title: "Linkly-".concat(isPay ? 'Pay' : 'Refund', "-\u4EA4\u6613\u6210\u529F"),
93
+ content: [{
94
+ key: 'response',
95
+ value: JSON.stringify(result)
96
+ }]
97
+ });
91
98
  reset();
92
99
  handleLinklySuccess(result);
93
100
  return;
94
101
  }
95
102
 
96
103
  // 交易状态为0,且不需要签名,则继续查询
97
- if (data.status !== undefined && (data === null || data === void 0 ? void 0 : data.status) === 0) {
104
+ if ((data === null || data === void 0 ? void 0 : data.status) == 0 && (data === null || data === void 0 ? void 0 : data.signature_flag) != 1) {
98
105
  console.log('交易状态为0需要继续查询');
99
106
  isQueryFinishedRef.current = false;
100
107
  _resultQuery();
@@ -105,6 +112,13 @@ export var useTimeResultQuery = function useTimeResultQuery(api, resultCheck, ha
105
112
  if (data.status < 0) {
106
113
  var _failRef$current;
107
114
  console.log('交易失败,终止查询');
115
+ sendWarningLog({
116
+ title: "Linkly-".concat(isPay ? 'Pay' : 'Refund', "-\u4EA4\u6613\u5931\u8D25"),
117
+ content: [{
118
+ key: 'response',
119
+ value: JSON.stringify(result)
120
+ }]
121
+ });
108
122
  reset();
109
123
  // 交易失败,code码转换为支付失败code码
110
124
  result.code = PayStatus.Unknown;
@@ -113,8 +127,15 @@ export var useTimeResultQuery = function useTimeResultQuery(api, resultCheck, ha
113
127
  }
114
128
 
115
129
  // 需要签名
116
- if (data.signature_flag === 1) {
130
+ if (data.signature_flag == 1) {
117
131
  console.log('交易需要签名,终止查询');
132
+ sendWarningLog({
133
+ title: "Linkly-".concat(isPay ? 'Pay' : 'Refund', "-\u4EA4\u6613\u9700\u8981\u7B7E\u540D"),
134
+ content: [{
135
+ key: 'response',
136
+ value: JSON.stringify(result)
137
+ }]
138
+ });
118
139
  reset();
119
140
  gotoSignature();
120
141
  return;
@@ -240,7 +261,7 @@ export var useTimeResultQuery = function useTimeResultQuery(api, resultCheck, ha
240
261
  });
241
262
  }
242
263
  sendWarningLog({
243
- title: "Linkly-".concat(isPay ? 'Pay' : 'Refund', "-\u7ED3\u679C\u67E5\u8BE2--").concat(type),
264
+ title: "Linkly-".concat(isPay ? 'Pay' : 'Refund', "-\u4EA4\u6613\u7ED3\u679C\u8F6E\u8BE2"),
244
265
  content: content
245
266
  });
246
267
  };
@@ -297,8 +297,8 @@ export declare const backUpFree: (payload: Partial<State>) => {
297
297
  amount?: string | number | undefined;
298
298
  mode?: "refund" | "pay" | "fullPay" | "query" | undefined;
299
299
  order_id?: string | number | undefined;
300
- eftpos?: "stripe" | "tyro" | "windcave" | "payo" | "linkly" | undefined;
301
- action?: "amount" | "pay" | "deviceList" | undefined;
300
+ eftpos?: "payo" | "tyro" | "windcave" | "stripe" | "linkly" | undefined;
301
+ action?: "pay" | "amount" | "deviceList" | undefined;
302
302
  key?: number | undefined;
303
303
  step?: number | undefined;
304
304
  title?: string | undefined;