@pisell/private-materials 3.3.53 → 3.3.56

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 (53) 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/meta.js +1 -1
  5. package/build/lowcode/render/default/view.css +1 -1
  6. package/build/lowcode/render/default/view.js +7 -7
  7. package/build/lowcode/view.css +1 -1
  8. package/build/lowcode/view.js +2 -2
  9. package/es/components/appointmentBooking/components/Content/index.d.ts +0 -1
  10. package/es/components/appointmentBooking/components/Header/index.d.ts +0 -1
  11. package/es/components/booking/components/footer/index.d.ts +1 -0
  12. package/es/components/booking/info/index.d.ts +1 -0
  13. package/es/components/booking/info/service/addTimeModal/index.d.ts +1 -0
  14. package/es/components/booking/info2/service/addTimeModal/index.d.ts +1 -0
  15. package/es/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
  16. package/es/components/eventBooking/components/progressBar/index.js +16 -0
  17. package/es/components/eventBooking/index.d.ts +0 -1
  18. package/es/components/pay/toC/PaymentList/index.js +10 -4
  19. package/es/components/pay/toC/PaymentList/serve.d.ts +1 -1
  20. package/es/components/pay/toC/PaymentList/serve.js +7 -1
  21. package/es/components/pay/toC/PaymentMethods/SuperPayAliPayH5/index.js +30 -13
  22. package/es/components/pay/toC/PaymentMethods/SuperPayWxPayH5/index.js +30 -13
  23. package/es/components/pay/toC/PaymentMethods/index.js +29 -2
  24. package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
  25. package/es/components/pay/toC/WalletPassBlock/index.less +4 -0
  26. package/es/components/pay/toC/index.js +38 -30
  27. package/es/components/pay/toC/utils.d.ts +6 -0
  28. package/es/components/pay/toC/utils.js +21 -0
  29. package/es/components/wallet/index.js +51 -5
  30. package/lib/components/appointmentBooking/components/Content/index.d.ts +0 -1
  31. package/lib/components/appointmentBooking/components/Header/index.d.ts +0 -1
  32. package/lib/components/booking/components/footer/index.d.ts +1 -0
  33. package/lib/components/booking/info/index.d.ts +1 -0
  34. package/lib/components/booking/info/service/addTimeModal/index.d.ts +1 -0
  35. package/lib/components/booking/info2/service/addTimeModal/index.d.ts +1 -0
  36. package/lib/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
  37. package/lib/components/eventBooking/components/progressBar/index.js +15 -0
  38. package/lib/components/eventBooking/index.d.ts +0 -1
  39. package/lib/components/pay/toC/PaymentList/index.js +11 -6
  40. package/lib/components/pay/toC/PaymentList/serve.d.ts +1 -1
  41. package/lib/components/pay/toC/PaymentList/serve.js +5 -2
  42. package/lib/components/pay/toC/PaymentMethods/SuperPayAliPayH5/index.js +10 -1
  43. package/lib/components/pay/toC/PaymentMethods/SuperPayWxPayH5/index.js +10 -1
  44. package/lib/components/pay/toC/PaymentMethods/index.js +28 -4
  45. package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
  46. package/lib/components/pay/toC/WalletPassBlock/index.less +4 -0
  47. package/lib/components/pay/toC/index.js +20 -13
  48. package/lib/components/pay/toC/utils.d.ts +6 -0
  49. package/lib/components/pay/toC/utils.js +15 -0
  50. package/lib/components/wallet/index.js +26 -1
  51. package/package.json +4 -4
  52. package/es/components/booking/info2/service/editService/Resources/index.d.ts +0 -4
  53. package/lib/components/booking/info2/service/editService/Resources/index.d.ts +0 -4
@@ -1,3 +1,9 @@
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 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; }
3
+ 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; }
4
+ 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; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
+ 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); }
1
7
  import { Decimal } from 'decimal.js';
2
8
  import { isTripartitePayment } from "./status";
3
9
  /**
@@ -90,4 +96,19 @@ export var formatFranchiseeRoute = function formatFranchiseeRoute(url, history)
90
96
  // 获取walletPass可用最大金额
91
97
  export var getAvailableMaxAmount = function getAvailableMaxAmount(data) {
92
98
  return data.tag !== 'point_card' ? data.available_max_amount : data === null || data === void 0 ? void 0 : data.recommended_usage_amount;
99
+ };
100
+ export var clientPayment = function clientPayment(params) {
101
+ var _interaction$utils, _interaction$utils$po;
102
+ var interaction = params.interaction,
103
+ type = params.type,
104
+ order_id = params.order_id,
105
+ values = params.values;
106
+ interaction === null || interaction === void 0 || (_interaction$utils = interaction.utils) === null || _interaction$utils === void 0 || (_interaction$utils$po = _interaction$utils.postMessageToApp) === null || _interaction$utils$po === void 0 || _interaction$utils$po.call(_interaction$utils, {
107
+ module: 'global',
108
+ key: 'paymentClient',
109
+ data: _objectSpread({
110
+ type: type,
111
+ order_id: order_id
112
+ }, values)
113
+ });
93
114
  };
@@ -1,4 +1,10 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
3
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
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 _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; }
6
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
7
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
2
8
  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; }
3
9
  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); } }
4
10
  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); }); }; }
@@ -297,6 +303,16 @@ var Wallet = Provider(function () {
297
303
  count: count
298
304
  })), /*#__PURE__*/React.createElement(RightOutlined, null));
299
305
  };
306
+ var mergeSearch = function mergeSearch(currentSearch, params) {
307
+ var searchParams = new URLSearchParams(currentSearch);
308
+ Object.entries(params).forEach(function (_ref4) {
309
+ var _ref5 = _slicedToArray(_ref4, 2),
310
+ key = _ref5[0],
311
+ value = _ref5[1];
312
+ searchParams.set(key, value);
313
+ });
314
+ return searchParams.toString();
315
+ };
300
316
 
301
317
  /**
302
318
  * 创建Menu组件的配置
@@ -304,6 +320,13 @@ var Wallet = Provider(function () {
304
320
  var MenuProps = {
305
321
  className: 'pisell-lowcode-wallet-menu',
306
322
  onClick: function onClick(e) {
323
+ var _context$appHelper$ut;
324
+ (_context$appHelper$ut = context.appHelper.utils) === null || _context$appHelper$ut === void 0 || (_context$appHelper$ut = _context$appHelper$ut.history) === null || _context$appHelper$ut === void 0 || _context$appHelper$ut.push({
325
+ hash: location.hash,
326
+ search: mergeSearch(location.search, {
327
+ type: 'list'
328
+ })
329
+ });
307
330
  dispatch({
308
331
  type: 'setState',
309
332
  payload: {
@@ -341,6 +364,27 @@ var Wallet = Provider(function () {
341
364
  }]
342
365
  };
343
366
 
367
+ // 监听路由 type变化 dispatch更新setup
368
+ useEffect(function () {
369
+ var searchParams = new URLSearchParams(location.search);
370
+ var type = searchParams.get('type');
371
+ if (type) {
372
+ dispatch({
373
+ type: 'setState',
374
+ payload: {
375
+ setup: type
376
+ }
377
+ });
378
+ } else {
379
+ dispatch({
380
+ type: 'setState',
381
+ payload: {
382
+ setup: 'menu'
383
+ }
384
+ });
385
+ }
386
+ }, [location.search]);
387
+
344
388
  /**
345
389
  * 处理返回按钮点击
346
390
  */
@@ -356,6 +400,7 @@ var Wallet = Provider(function () {
356
400
  setup: prevSetup
357
401
  }
358
402
  });
403
+ history.back(); // 后退到上一步
359
404
  }
360
405
  };
361
406
 
@@ -390,7 +435,7 @@ var Wallet = Provider(function () {
390
435
  * @param code 钱包代码
391
436
  */
392
437
  var addWallet = /*#__PURE__*/function () {
393
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(code) {
438
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(code) {
394
439
  var onError, data, tagMap, cardType, successMessage;
395
440
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
396
441
  while (1) switch (_context2.prev = _context2.next) {
@@ -452,7 +497,7 @@ var Wallet = Provider(function () {
452
497
  }, _callee2);
453
498
  }));
454
499
  return function addWallet(_x3) {
455
- return _ref4.apply(this, arguments);
500
+ return _ref6.apply(this, arguments);
456
501
  };
457
502
  }();
458
503
 
@@ -460,7 +505,7 @@ var Wallet = Provider(function () {
460
505
  * 搜索钱包
461
506
  */
462
507
  var handleSearch = /*#__PURE__*/function () {
463
- var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
508
+ var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
464
509
  var code,
465
510
  resetSearchState,
466
511
  onSearchFail,
@@ -528,7 +573,7 @@ var Wallet = Provider(function () {
528
573
  }, _callee3, null, [[6, 13]]);
529
574
  }));
530
575
  return function handleSearch() {
531
- return _ref5.apply(this, arguments);
576
+ return _ref7.apply(this, arguments);
532
577
  };
533
578
  }();
534
579
 
@@ -607,9 +652,10 @@ var Wallet = Provider(function () {
607
652
  * 渲染移动端布局
608
653
  */
609
654
  var renderMobileLayout = function renderMobileLayout() {
655
+ var _utils$interaction, _utils$interaction$is;
610
656
  return /*#__PURE__*/React.createElement("div", {
611
657
  className: "pisell-lowcode-wallet-mobile"
612
- }, /*#__PURE__*/React.createElement(WalletBar, {
658
+ }, !(utils !== null && utils !== void 0 && (_utils$interaction = utils.interaction) !== null && _utils$interaction !== void 0 && (_utils$interaction = _utils$interaction.utils) !== null && _utils$interaction !== void 0 && (_utils$interaction$is = _utils$interaction.isAppEnv) !== null && _utils$interaction$is !== void 0 && _utils$interaction$is.call(_utils$interaction)) && /*#__PURE__*/React.createElement(WalletBar, {
613
659
  setup: setup,
614
660
  onBack: onBack
615
661
  }), /*#__PURE__*/React.createElement("div", {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const Layout: () => JSX.Element;
4
3
  export default Layout;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const Header: () => JSX.Element;
4
3
  export default Header;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  /**
3
4
  * @title: 底部
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { InfoProps } from './main';
2
3
  declare const APP: (props: InfoProps) => JSX.Element;
3
4
  export default APP;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const AddTimeModal: () => JSX.Element;
3
4
  export default AddTimeModal;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import '../../../info/service/addTimeModal/index.less';
2
3
  declare const AddTimeModal: () => JSX.Element;
3
4
  export default AddTimeModal;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const Header: () => JSX.Element;
4
3
  export default Header;
@@ -37,6 +37,7 @@ var import_materials = require("@pisell/materials");
37
37
  var import_Sales = require("../../../Sales");
38
38
  var import_utils = require("@pisell/utils");
39
39
  var import_index = require("./index.less");
40
+ var import_useEngineContext = __toESM(require("../../../../hooks/useEngineContext"));
40
41
  var ProgressBar = ({
41
42
  title,
42
43
  description,
@@ -48,8 +49,11 @@ var ProgressBar = ({
48
49
  onBack,
49
50
  onClose
50
51
  }) => {
52
+ var _a;
51
53
  const [open, setOpen] = (0, import_react.useState)(false);
52
54
  const { removeSessionStorage } = (0, import_Sales.useSales)();
55
+ const context = (0, import_useEngineContext.default)();
56
+ const { interaction } = ((_a = context.appHelper) == null ? void 0 : _a.utils) || {};
53
57
  const handleClose = () => {
54
58
  if (isConfirmClose) {
55
59
  setOpen(true);
@@ -58,6 +62,17 @@ var ProgressBar = ({
58
62
  }
59
63
  };
60
64
  const handleOk = () => {
65
+ var _a2, _b;
66
+ if ((_b = (_a2 = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _a2.isAppEnv) == null ? void 0 : _b.call(_a2)) {
67
+ interaction.utils.postMessageToApp({
68
+ module: "global",
69
+ key: "paymentResultAction",
70
+ data: {
71
+ actionType: "backHome"
72
+ }
73
+ });
74
+ return;
75
+ }
61
76
  onClose == null ? void 0 : onClose();
62
77
  setOpen(false);
63
78
  removeSessionStorage == null ? void 0 : removeSessionStorage();
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const EventBooking: () => JSX.Element;
4
3
  export default EventBooking;
@@ -46,19 +46,20 @@ var offline = [
46
46
  "pisell.custom_payment"
47
47
  ];
48
48
  var PaymentList = (props, ref) => {
49
- var _a, _b;
49
+ var _a, _b, _c;
50
50
  const [paymentList, setPaymentList] = (0, import_react.useState)([]);
51
51
  const [paymentType, setPaymentType] = (0, import_react.useState)("");
52
52
  const [loading, setLoading] = (0, import_react.useState)(true);
53
53
  const context = (0, import_useEngineContext.default)();
54
+ const { interaction } = (_a = context.appHelper) == null ? void 0 : _a.utils;
54
55
  const _paymentList = (0, import_react.useMemo)(() => {
55
56
  var _a2;
56
57
  return ((_a2 = props == null ? void 0 : props.store) == null ? void 0 : _a2.paymentList) || paymentList;
57
- }, [paymentList, (_a = props == null ? void 0 : props.store) == null ? void 0 : _a.paymentList]);
58
+ }, [paymentList, (_b = props == null ? void 0 : props.store) == null ? void 0 : _b.paymentList]);
58
59
  const _paymentType = (0, import_react.useMemo)(() => {
59
60
  var _a2;
60
61
  return ((_a2 = props == null ? void 0 : props.store) == null ? void 0 : _a2.paymentType) || paymentType;
61
- }, [paymentType, (_b = props == null ? void 0 : props.store) == null ? void 0 : _b.paymentType]);
62
+ }, [paymentType, (_c = props == null ? void 0 : props.store) == null ? void 0 : _c.paymentType]);
62
63
  const _getPaymentList = async (initProps) => {
63
64
  var _a2;
64
65
  setLoading(true);
@@ -85,11 +86,15 @@ var PaymentList = (props, ref) => {
85
86
  setPaymentList(list);
86
87
  return list;
87
88
  };
89
+ const isApp = (0, import_react.useMemo)(() => {
90
+ var _a2, _b2;
91
+ return (_b2 = (_a2 = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _a2.isAppEnv) == null ? void 0 : _b2.call(_a2);
92
+ }, []);
88
93
  const init = (list) => {
89
94
  var _a2, _b2;
90
95
  setLoading(true);
91
96
  const platform = ((_b2 = (_a2 = context.appHelper) == null ? void 0 : _a2.constants) == null ? void 0 : _b2.platform) || "h5";
92
- const { paymentList: paymentList2, walletPass } = (0, import_serve.filterPaymentList)(list, platform);
97
+ const { paymentList: paymentList2, walletPass } = (0, import_serve.filterPaymentList)(list, platform, isApp);
93
98
  if (paymentList2.length > 0) {
94
99
  let first = paymentList2[0];
95
100
  setPaymentList(paymentList2);
@@ -131,13 +136,13 @@ var PaymentList = (props, ref) => {
131
136
  })
132
137
  );
133
138
  const renderToast = (_item) => {
134
- var _a2, _b2, _c;
139
+ var _a2, _b2, _c2;
135
140
  return /* @__PURE__ */ import_react.default.createElement("div", { className: "surcharge-modal-wrap" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "surcharge-modal-title" }, _item.title + " " + (((_a2 = _item == null ? void 0 : _item.params) == null ? void 0 : _a2.description) ? import_utils2.locales.getText("tocPay.text.paymentInstructions") : import_utils2.locales.getText("tocPay.text.serviceCharge"))), /* @__PURE__ */ import_react.default.createElement(
136
141
  "div",
137
142
  {
138
143
  className: "surcharge-info",
139
144
  dangerouslySetInnerHTML: {
140
- __html: ((_b2 = _item == null ? void 0 : _item.params) == null ? void 0 : _b2.description) ? (_c = _item == null ? void 0 : _item.params) == null ? void 0 : _c.description : _item.surcharge_fee
145
+ __html: ((_b2 = _item == null ? void 0 : _item.params) == null ? void 0 : _b2.description) ? (_c2 = _item == null ? void 0 : _item.params) == null ? void 0 : _c2.description : _item.surcharge_fee
141
146
  }
142
147
  }
143
148
  ));
@@ -20,7 +20,7 @@ export declare const getPaymentList: (values: any) => Promise<{
20
20
  * @Author: zhiwei.Wang
21
21
  * @Date: 2024-08-16 10:57
22
22
  */
23
- export declare const filterPaymentList: (list: any[], platform?: string) => {
23
+ export declare const filterPaymentList: (list: any[], platform: string | undefined, isApp: boolean) => {
24
24
  message: string;
25
25
  status: string;
26
26
  paymentList: any[];
@@ -31,12 +31,12 @@ var getPaymentList = async (values) => {
31
31
  let { data = [] } = await import_utils.request.getRequest().get("/h5/pay/order/payments", values);
32
32
  return filterPaymentList(data);
33
33
  };
34
- var filterPaymentList = (list, platform = "h5") => {
34
+ var filterPaymentList = (list, platform = "h5", isApp) => {
35
35
  let paymentList = [...list];
36
36
  let _paymentKeys = [...import_status.paymentKeys];
37
37
  const walletPass = paymentList.find((d) => d.service === "pisell.wallet_pass");
38
38
  let arr = [];
39
- if (!(0, import_utils2.isWx)()) {
39
+ if (!(0, import_utils2.isWx)() && !isApp) {
40
40
  arr = arr.concat(["globepay.wechat.jsapi", "superpay.wechat.h5"]);
41
41
  }
42
42
  if (platform === "h5") {
@@ -45,6 +45,9 @@ var filterPaymentList = (list, platform = "h5") => {
45
45
  if (!(0, import_utils2.isIOS)()) {
46
46
  arr = arr.concat(["mw.apple"]);
47
47
  }
48
+ if ((0, import_utils2.isIOS)() && isApp) {
49
+ arr = arr.concat(["mw.google"]);
50
+ }
48
51
  _paymentKeys = _paymentKeys.filter((d) => !arr.includes(d));
49
52
  paymentList = paymentList.filter(
50
53
  (d) => _paymentKeys.includes(d.service)
@@ -39,12 +39,21 @@ var import_ThreedsLoading = __toESM(require("../MWCreditCard/TDSPay/ThreedsLoadi
39
39
  var import_serve = require("./serve");
40
40
  var import_payGroup = require("../../payGroup");
41
41
  var import_index = require("./index.less");
42
+ var import_useEngineContext = __toESM(require("../../../../../hooks/useEngineContext"));
43
+ var import_utils2 = require("../../utils");
42
44
  var SuperPayAliPayH5 = (props, ref) => {
45
+ var _a;
43
46
  const { onChange } = props;
44
47
  const [open, setOpen] = (0, import_react.useState)(false);
48
+ const context = (0, import_useEngineContext.default)();
49
+ const { interaction } = (_a = context.appHelper) == null ? void 0 : _a.utils;
45
50
  const init = async ({ payGroup }) => {
46
- setOpen(true);
51
+ var _a2, _b;
47
52
  const values = (0, import_payGroup.getPayGroupParamsFromStorage)(payGroup.order_id);
53
+ if ((_b = (_a2 = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _a2.isAppEnv) == null ? void 0 : _b.call(_a2)) {
54
+ return (0, import_utils2.clientPayment)({ order_id: payGroup.order_id, type: "aliPay", values, interaction });
55
+ }
56
+ setOpen(true);
48
57
  if (!values) {
49
58
  setOpen(false);
50
59
  return;
@@ -39,11 +39,20 @@ var import_serve = require("./serve");
39
39
  var import_payGroup = require("../../payGroup");
40
40
  var import_index = require("./index.less");
41
41
  var import_utils = require("@pisell/utils");
42
+ var import_utils2 = require("../../utils");
43
+ var import_useEngineContext = __toESM(require("../../../../../hooks/useEngineContext"));
42
44
  var SuperPayWxPayH5 = (props, ref) => {
45
+ var _a;
43
46
  const [open, setOpen] = (0, import_react.useState)(false);
47
+ const context = (0, import_useEngineContext.default)();
48
+ const { interaction } = (_a = context.appHelper) == null ? void 0 : _a.utils;
44
49
  const init = async ({ payGroup }) => {
45
- setOpen(true);
50
+ var _a2, _b;
46
51
  const values = (0, import_payGroup.getPayGroupParamsFromStorage)(payGroup.order_id);
52
+ if ((_b = (_a2 = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _a2.isAppEnv) == null ? void 0 : _b.call(_a2)) {
53
+ return (0, import_utils2.clientPayment)({ order_id: payGroup.order_id, type: "wxPay", values, interaction });
54
+ }
55
+ setOpen(true);
47
56
  if (!values) {
48
57
  setOpen(false);
49
58
  return;
@@ -51,6 +51,9 @@ var import_GlobePayWxH5 = __toESM(require("./GlobePayWxH5"));
51
51
  var import_GlobePayQrcode = __toESM(require("./GlobePayQrcode"));
52
52
  var import_serve = require("./WalletPass/serve");
53
53
  var import_utils = require("../utils");
54
+ var import_useEngineContext = __toESM(require("../../../../hooks/useEngineContext"));
55
+ var import_utils2 = require("@pisell/utils");
56
+ var import_serve2 = require("./GlobePayQrcode/serve");
54
57
  var isOfflinePayment = (type) => {
55
58
  if ((0, import_status.isCustomPayment)(type)) {
56
59
  return true;
@@ -63,6 +66,7 @@ var isOfflinePayment = (type) => {
63
66
  ].includes(type);
64
67
  };
65
68
  var PaymentMethods = (props, ref) => {
69
+ var _a;
66
70
  const MWCreditCardRef2 = (0, import_react.useRef)(null);
67
71
  const SuperPayAliPayH5Ref2 = (0, import_react.useRef)(null);
68
72
  const StripePayRef2 = (0, import_react.useRef)(null);
@@ -77,10 +81,12 @@ var PaymentMethods = (props, ref) => {
77
81
  const GlobePayPaypalH5Ref2 = (0, import_react.useRef)(null);
78
82
  const GlobePayWxH5Ref2 = (0, import_react.useRef)(null);
79
83
  const GlobePayQrcodeRef2 = (0, import_react.useRef)(null);
84
+ const context = (0, import_useEngineContext.default)();
85
+ const { interaction } = (_a = context.appHelper) == null ? void 0 : _a.utils;
80
86
  const init = async ({ type, payGroup }) => {
81
- var _a, _b;
87
+ var _a2, _b;
82
88
  const waitAmount = (payGroup == null ? void 0 : payGroup.wait_amount) || 0;
83
- const cards = (_b = (_a = payGroup == null ? void 0 : payGroup.walletPass) == null ? void 0 : _a.cards) == null ? void 0 : _b.length;
89
+ const cards = (_b = (_a2 = payGroup == null ? void 0 : payGroup.walletPass) == null ? void 0 : _a2.cards) == null ? void 0 : _b.length;
84
90
  if (cards && (waitAmount <= 0 || isOfflinePayment(type))) {
85
91
  try {
86
92
  await (0, import_serve.walletPassPay)((0, import_utils.formatWalletPassParams)(payGroup));
@@ -110,11 +116,29 @@ var PaymentMethods = (props, ref) => {
110
116
  }
111
117
  await onPayByType({ type, payGroup });
112
118
  };
119
+ (0, import_react.useEffect)(() => {
120
+ var _a2, _b, _c, _d;
121
+ console.log("paymentResult isAppEnv", (_b = (_a2 = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _a2.isAppEnv) == null ? void 0 : _b.call(_a2));
122
+ if ((_d = (_c = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _c.isAppEnv) == null ? void 0 : _d.call(_c)) {
123
+ interaction.utils.mountFunction("global", "paymentResult", (strResult) => {
124
+ console.log("paymentResult", strResult);
125
+ if (!(0, import_utils2.isJson)(strResult)) return;
126
+ const result = JSON.parse(strResult);
127
+ const { type, pay_number, order_id } = result;
128
+ if (type && order_id && pay_number) {
129
+ (0, import_payGroup.setPayNumber)(order_id, pay_number);
130
+ }
131
+ const url = `${(0, import_serve2.getReturnUrl)()}?order_id=${order_id}&status=success`;
132
+ console.log(url, "paymentResult");
133
+ window.location.href = url;
134
+ });
135
+ }
136
+ }, []);
113
137
  const onPayByType = async ({ type, payGroup }) => {
114
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
138
+ var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
115
139
  console.log(type, payGroup);
116
140
  if (type === "mw.apple") {
117
- await ((_a = ApplePayRef2.current) == null ? void 0 : _a.init({ payGroup }));
141
+ await ((_a2 = ApplePayRef2.current) == null ? void 0 : _a2.init({ payGroup }));
118
142
  return;
119
143
  }
120
144
  if (type === "mw.google") {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { WalletPassDataType } from '../../../PaymentMethods/WalletPass/serve';
3
2
  import './index.less';
4
3
  interface WalletUseListProps {
@@ -10,6 +10,10 @@
10
10
  display: flex;
11
11
  align-items: center;
12
12
  justify-content: center;
13
+ & > span:first-child {
14
+ text-overflow: ellipsis;
15
+ overflow: hidden;
16
+ }
13
17
  }
14
18
  }
15
19
 
@@ -70,7 +70,7 @@ var ToCPay = (props, ref) => {
70
70
  import_utils.locales.init(import_locales.default, ((_m = dvaStore.core) == null ? void 0 : _m.translateLocale) || "en");
71
71
  import_utils2.request.setRequest(utils == null ? void 0 : utils.request);
72
72
  const _initStore = (initProps) => {
73
- var _a2, _b2, _c2, _d2;
73
+ var _a2;
74
74
  dispatch({
75
75
  type: "init",
76
76
  payload: {
@@ -78,15 +78,15 @@ var ToCPay = (props, ref) => {
78
78
  status: "init",
79
79
  // 将支付回调储存在store, 方便其他模块调用
80
80
  payCallback: props.callback,
81
- history: (_a2 = context.appHelper.utils) == null ? void 0 : _a2.history,
81
+ history: (_a2 = context.appHelper.utils) == null ? void 0 : _a2.history
82
82
  // 支付组
83
- payGroup: {
84
- order_id: (_b2 = initProps == null ? void 0 : initProps.order) == null ? void 0 : _b2.order_id,
85
- total_amount: (_c2 = initProps == null ? void 0 : initProps.order) == null ? void 0 : _c2.amount,
86
- // 原订单信息
87
- _order: initProps == null ? void 0 : initProps.order,
88
- payment_group_id: (_d2 = initProps == null ? void 0 : initProps.order) == null ? void 0 : _d2.payment_group_id
89
- }
83
+ // payGroup: {
84
+ // order_id: initProps?.order?.order_id,
85
+ // total_amount: initProps?.order?.amount,
86
+ // // 原订单信息
87
+ // _order: initProps?.order,
88
+ // payment_group_id: initProps?.order?.payment_group_id,
89
+ // },
90
90
  }
91
91
  });
92
92
  };
@@ -140,7 +140,12 @@ var ToCPay = (props, ref) => {
140
140
  dispatch({
141
141
  type: "setPayGroup",
142
142
  payload: {
143
- ...state.payGroup,
143
+ // ...state.payGroup,
144
+ order_id: order == null ? void 0 : order.order_id,
145
+ // total_amount: order?.amount,
146
+ // 原订单信息
147
+ _order: order,
148
+ payment_group_id: order == null ? void 0 : order.payment_group_id,
144
149
  // 支付方式没有walletPass时walletPass设置null
145
150
  walletPass: walletPass ? {
146
151
  ...(_a2 = state.payGroup) == null ? void 0 : _a2.walletPass,
@@ -148,7 +153,7 @@ var ToCPay = (props, ref) => {
148
153
  amount: wallet_pass_amount,
149
154
  cards: wallet_pass_recommend_list
150
155
  } : null,
151
- total_amount: order.amount,
156
+ total_amount: order == null ? void 0 : order.amount,
152
157
  wait_amount: remain_amount
153
158
  }
154
159
  });
@@ -277,13 +282,15 @@ var ToCPay = (props, ref) => {
277
282
  (_a2 = props.callback) == null ? void 0 : _a2.call(props, res);
278
283
  };
279
284
  const onCancel = () => {
280
- var _a2;
285
+ var _a2, _b2;
281
286
  (0, import_payGroup.removePayGroupFromStorage)((_a2 = state.payGroup) == null ? void 0 : _a2.order_id);
282
287
  setShowInformation(false);
283
288
  setOpen(false);
284
289
  payCallback({
285
290
  key: "cancel",
286
- data: {}
291
+ data: {
292
+ order_id: (_b2 = state.payGroup) == null ? void 0 : _b2.order_id
293
+ }
287
294
  });
288
295
  };
289
296
  (0, import_ahooks.useUpdateEffect)(() => {
@@ -49,3 +49,9 @@ export declare const isFranchiseeShop: (path?: any, history?: any) => any;
49
49
  export declare const getFranchiseeShopId: (path?: any, history?: any) => number;
50
50
  export declare const formatFranchiseeRoute: (url: string, history?: any) => string;
51
51
  export declare const getAvailableMaxAmount: (data: WalletPassDataType) => string;
52
+ export declare const clientPayment: (params: {
53
+ order_id: number;
54
+ type: "aliPay" | "wxPay";
55
+ values: any;
56
+ interaction?: any;
57
+ }) => void;
@@ -20,6 +20,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  var utils_exports = {};
21
21
  __export(utils_exports, {
22
22
  calcWalletPassListAmount: () => calcWalletPassListAmount,
23
+ clientPayment: () => clientPayment,
23
24
  formatFranchiseeRoute: () => formatFranchiseeRoute,
24
25
  formatWalletPassList2PreparePayments: () => formatWalletPassList2PreparePayments,
25
26
  formatWalletPassParams: () => formatWalletPassParams,
@@ -85,9 +86,23 @@ var formatFranchiseeRoute = (url, history) => {
85
86
  var getAvailableMaxAmount = (data) => {
86
87
  return data.tag !== "point_card" ? data.available_max_amount : data == null ? void 0 : data.recommended_usage_amount;
87
88
  };
89
+ var clientPayment = (params) => {
90
+ var _a, _b;
91
+ const { interaction, type, order_id, values } = params;
92
+ (_b = (_a = interaction == null ? void 0 : interaction.utils) == null ? void 0 : _a.postMessageToApp) == null ? void 0 : _b.call(_a, {
93
+ module: "global",
94
+ key: "paymentClient",
95
+ data: {
96
+ type,
97
+ order_id,
98
+ ...values
99
+ }
100
+ });
101
+ };
88
102
  // Annotate the CommonJS export names for ESM import in node:
89
103
  0 && (module.exports = {
90
104
  calcWalletPassListAmount,
105
+ clientPayment,
91
106
  formatFranchiseeRoute,
92
107
  formatWalletPassList2PreparePayments,
93
108
  formatWalletPassParams,