@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,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;
@@ -9,7 +9,9 @@ import { PisellHeaderProgressBar, PisellModal } from '@pisell/materials';
9
9
  import { useSales } from "../../../Sales";
10
10
  import { locales } from '@pisell/utils';
11
11
  import "./index.less";
12
+ import useEngineContext from "../../../../hooks/useEngineContext";
12
13
  var ProgressBar = function ProgressBar(_ref) {
14
+ var _context$appHelper;
13
15
  var title = _ref.title,
14
16
  description = _ref.description,
15
17
  _ref$showClose = _ref.showClose,
@@ -29,6 +31,9 @@ var ProgressBar = function ProgressBar(_ref) {
29
31
  setOpen = _useState2[1];
30
32
  var _useSales = useSales(),
31
33
  removeSessionStorage = _useSales.removeSessionStorage;
34
+ var context = useEngineContext();
35
+ var _ref2 = ((_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils) || {},
36
+ interaction = _ref2.interaction;
32
37
 
33
38
  /**
34
39
  * @title: 点击关闭
@@ -54,6 +59,17 @@ var ProgressBar = function ProgressBar(_ref) {
54
59
  * @Date: 2025-02-10 17:46
55
60
  */
56
61
  var handleOk = function handleOk() {
62
+ var _interaction$utils, _interaction$utils$is;
63
+ if (interaction !== null && interaction !== void 0 && (_interaction$utils = interaction.utils) !== null && _interaction$utils !== void 0 && (_interaction$utils$is = _interaction$utils.isAppEnv) !== null && _interaction$utils$is !== void 0 && _interaction$utils$is.call(_interaction$utils)) {
64
+ interaction.utils.postMessageToApp({
65
+ module: 'global',
66
+ key: 'paymentResultAction',
67
+ data: {
68
+ actionType: 'backHome'
69
+ }
70
+ });
71
+ return;
72
+ }
57
73
  onClose === null || onClose === void 0 || onClose();
58
74
  setOpen(false);
59
75
  // 清空数据
@@ -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;
@@ -36,7 +36,7 @@ var offline = ['pisell.offline_payment', 'pisell.other.cashmanual', 'pisell.cust
36
36
  * @Date: 2024-08-16 10:52
37
37
  */
38
38
  var PaymentList = function PaymentList(props, ref) {
39
- var _props$store2, _props$store4;
39
+ var _context$appHelper, _props$store2, _props$store4;
40
40
  // 支付列表
41
41
  var _useState = useState([]),
42
42
  _useState2 = _slicedToArray(_useState, 2),
@@ -53,6 +53,8 @@ var PaymentList = function PaymentList(props, ref) {
53
53
  loading = _useState6[0],
54
54
  setLoading = _useState6[1];
55
55
  var context = useEngineContext();
56
+ var _context$appHelper$ut = (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils,
57
+ interaction = _context$appHelper$ut.interaction;
56
58
 
57
59
  // 支付列表, 补充图标 兼容受控方式
58
60
  var _paymentList = useMemo(function () {
@@ -139,6 +141,10 @@ var PaymentList = function PaymentList(props, ref) {
139
141
  setPaymentList(list);
140
142
  return list;
141
143
  };
144
+ var isApp = useMemo(function () {
145
+ var _interaction$utils, _interaction$utils$is;
146
+ return interaction === null || interaction === void 0 || (_interaction$utils = interaction.utils) === null || _interaction$utils === void 0 || (_interaction$utils$is = _interaction$utils.isAppEnv) === null || _interaction$utils$is === void 0 ? void 0 : _interaction$utils$is.call(_interaction$utils);
147
+ }, []);
142
148
 
143
149
  /**
144
150
  * @title: 唯一初始化
@@ -149,13 +155,13 @@ var PaymentList = function PaymentList(props, ref) {
149
155
  * @Date: 2024-08-16 10:53
150
156
  */
151
157
  var init = function init(list) {
152
- var _context$appHelper;
158
+ var _context$appHelper2;
153
159
  // 打开loading
154
160
  setLoading(true);
155
- var platform = ((_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 || (_context$appHelper = _context$appHelper.constants) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.platform) || 'h5';
161
+ var platform = ((_context$appHelper2 = context.appHelper) === null || _context$appHelper2 === void 0 || (_context$appHelper2 = _context$appHelper2.constants) === null || _context$appHelper2 === void 0 ? void 0 : _context$appHelper2.platform) || 'h5';
156
162
 
157
163
  // 过滤数据
158
- var _filterPaymentList = filterPaymentList(list, platform),
164
+ var _filterPaymentList = filterPaymentList(list, platform, isApp),
159
165
  paymentList = _filterPaymentList.paymentList,
160
166
  walletPass = _filterPaymentList.walletPass;
161
167
 
@@ -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[];
@@ -60,6 +60,7 @@ export var getPaymentList = /*#__PURE__*/function () {
60
60
  */
61
61
  export var filterPaymentList = function filterPaymentList(list) {
62
62
  var platform = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'h5';
63
+ var isApp = arguments.length > 2 ? arguments[2] : undefined;
63
64
  var paymentList = _toConsumableArray(list);
64
65
  var _paymentKeys = _toConsumableArray(paymentKeys);
65
66
 
@@ -77,7 +78,7 @@ export var filterPaymentList = function filterPaymentList(list) {
77
78
  // }
78
79
 
79
80
  // 非微信环境隐藏微信支付
80
- if (!isWx()) {
81
+ if (!isWx() && !isApp) {
81
82
  arr = arr.concat(['globepay.wechat.jsapi', 'superpay.wechat.h5']);
82
83
  }
83
84
 
@@ -96,6 +97,11 @@ export var filterPaymentList = function filterPaymentList(list) {
96
97
  arr = arr.concat(['mw.apple']);
97
98
  }
98
99
 
100
+ // iosApp内不展示谷歌支付
101
+ if (isIOS() && isApp) {
102
+ arr = arr.concat(['mw.google']);
103
+ }
104
+
99
105
  // 删除以上key
100
106
  _paymentKeys = _paymentKeys.filter(function (d) {
101
107
  return !arr.includes(d);
@@ -15,6 +15,8 @@ import ThreedsLoading from "../MWCreditCard/TDSPay/ThreedsLoading";
15
15
  import { getAliPayUrl } from "./serve";
16
16
  import { getPayGroupParamsFromStorage, setPayNumber } from "../../payGroup";
17
17
  import "./index.less";
18
+ import useEngineContext from "../../../../../hooks/useEngineContext";
19
+ import { clientPayment } from "../../utils";
18
20
  /**
19
21
  * @title: 支付宝支付
20
22
  * @description:
@@ -23,11 +25,15 @@ import "./index.less";
23
25
  * @Date: 2024-08-16 11:18
24
26
  */
25
27
  var SuperPayAliPayH5 = function SuperPayAliPayH5(props, ref) {
28
+ var _context$appHelper;
26
29
  var onChange = props.onChange;
27
30
  var _useState = useState(false),
28
31
  _useState2 = _slicedToArray(_useState, 2),
29
32
  open = _useState2[0],
30
33
  setOpen = _useState2[1];
34
+ var context = useEngineContext();
35
+ var _context$appHelper$ut = (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils,
36
+ interaction = _context$appHelper$ut.interaction;
31
37
 
32
38
  /**
33
39
  * @title: 初始化
@@ -39,26 +45,37 @@ var SuperPayAliPayH5 = function SuperPayAliPayH5(props, ref) {
39
45
  */
40
46
  var init = /*#__PURE__*/function () {
41
47
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
48
+ var _interaction$utils, _interaction$utils$is;
42
49
  var payGroup, values, data;
43
50
  return _regeneratorRuntime().wrap(function _callee$(_context) {
44
51
  while (1) switch (_context.prev = _context.next) {
45
52
  case 0:
46
53
  payGroup = _ref.payGroup;
47
- setOpen(true);
48
-
49
54
  // 交易组
50
55
  values = getPayGroupParamsFromStorage(payGroup.order_id);
56
+ if (!(interaction !== null && interaction !== void 0 && (_interaction$utils = interaction.utils) !== null && _interaction$utils !== void 0 && (_interaction$utils$is = _interaction$utils.isAppEnv) !== null && _interaction$utils$is !== void 0 && _interaction$utils$is.call(_interaction$utils))) {
57
+ _context.next = 4;
58
+ break;
59
+ }
60
+ return _context.abrupt("return", clientPayment({
61
+ order_id: payGroup.order_id,
62
+ type: 'aliPay',
63
+ values: values,
64
+ interaction: interaction
65
+ }));
66
+ case 4:
67
+ setOpen(true);
51
68
  if (values) {
52
- _context.next = 6;
69
+ _context.next = 8;
53
70
  break;
54
71
  }
55
72
  setOpen(false);
56
73
  return _context.abrupt("return");
57
- case 6:
58
- _context.prev = 6;
59
- _context.next = 9;
74
+ case 8:
75
+ _context.prev = 8;
76
+ _context.next = 11;
60
77
  return getAliPayUrl(payGroup.order_id, values);
61
- case 9:
78
+ case 11:
62
79
  data = _context.sent;
63
80
  if (data !== null && data !== void 0 && data.pay_url) {
64
81
  // 设置交易号
@@ -69,17 +86,17 @@ var SuperPayAliPayH5 = function SuperPayAliPayH5(props, ref) {
69
86
  } else {
70
87
  setOpen(false);
71
88
  }
72
- _context.next = 16;
89
+ _context.next = 18;
73
90
  break;
74
- case 13:
75
- _context.prev = 13;
76
- _context.t0 = _context["catch"](6);
91
+ case 15:
92
+ _context.prev = 15;
93
+ _context.t0 = _context["catch"](8);
77
94
  setOpen(false);
78
- case 16:
95
+ case 18:
79
96
  case "end":
80
97
  return _context.stop();
81
98
  }
82
- }, _callee, null, [[6, 13]]);
99
+ }, _callee, null, [[8, 15]]);
83
100
  }));
84
101
  return function init(_x) {
85
102
  return _ref2.apply(this, arguments);
@@ -15,6 +15,8 @@ import { getWxPayUrl } from "./serve";
15
15
  import { getPayGroupParamsFromStorage, setPayNumber } from "../../payGroup";
16
16
  import "./index.less";
17
17
  import { locales } from '@pisell/utils';
18
+ import { clientPayment } from "../../utils";
19
+ import useEngineContext from "../../../../../hooks/useEngineContext";
18
20
  /**
19
21
  * @title: 微信支付
20
22
  * @description:
@@ -25,10 +27,14 @@ import { locales } from '@pisell/utils';
25
27
  * @Date: 2024-08-16 11:18
26
28
  */
27
29
  var SuperPayWxPayH5 = function SuperPayWxPayH5(props, ref) {
30
+ var _context$appHelper;
28
31
  var _useState = useState(false),
29
32
  _useState2 = _slicedToArray(_useState, 2),
30
33
  open = _useState2[0],
31
34
  setOpen = _useState2[1];
35
+ var context = useEngineContext();
36
+ var _context$appHelper$ut = (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils,
37
+ interaction = _context$appHelper$ut.interaction;
32
38
 
33
39
  /**
34
40
  * @title: 初始化
@@ -40,26 +46,37 @@ var SuperPayWxPayH5 = function SuperPayWxPayH5(props, ref) {
40
46
  */
41
47
  var init = /*#__PURE__*/function () {
42
48
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
49
+ var _interaction$utils, _interaction$utils$is;
43
50
  var payGroup, values, data;
44
51
  return _regeneratorRuntime().wrap(function _callee$(_context) {
45
52
  while (1) switch (_context.prev = _context.next) {
46
53
  case 0:
47
54
  payGroup = _ref.payGroup;
48
- setOpen(true);
49
-
50
55
  // 获取交易组
51
56
  values = getPayGroupParamsFromStorage(payGroup.order_id);
57
+ if (!(interaction !== null && interaction !== void 0 && (_interaction$utils = interaction.utils) !== null && _interaction$utils !== void 0 && (_interaction$utils$is = _interaction$utils.isAppEnv) !== null && _interaction$utils$is !== void 0 && _interaction$utils$is.call(_interaction$utils))) {
58
+ _context.next = 4;
59
+ break;
60
+ }
61
+ return _context.abrupt("return", clientPayment({
62
+ order_id: payGroup.order_id,
63
+ type: 'wxPay',
64
+ values: values,
65
+ interaction: interaction
66
+ }));
67
+ case 4:
68
+ setOpen(true);
52
69
  if (values) {
53
- _context.next = 6;
70
+ _context.next = 8;
54
71
  break;
55
72
  }
56
73
  setOpen(false);
57
74
  return _context.abrupt("return");
58
- case 6:
59
- _context.prev = 6;
60
- _context.next = 9;
75
+ case 8:
76
+ _context.prev = 8;
77
+ _context.next = 11;
61
78
  return getWxPayUrl(payGroup.order_id, values);
62
- case 9:
79
+ case 11:
63
80
  data = _context.sent;
64
81
  if (data !== null && data !== void 0 && data.pay_url) {
65
82
  // 设置交易号
@@ -70,17 +87,17 @@ var SuperPayWxPayH5 = function SuperPayWxPayH5(props, ref) {
70
87
  } else {
71
88
  setOpen(false);
72
89
  }
73
- _context.next = 16;
90
+ _context.next = 18;
74
91
  break;
75
- case 13:
76
- _context.prev = 13;
77
- _context.t0 = _context["catch"](6);
92
+ case 15:
93
+ _context.prev = 15;
94
+ _context.t0 = _context["catch"](8);
78
95
  setOpen(false);
79
- case 16:
96
+ case 18:
80
97
  case "end":
81
98
  return _context.stop();
82
99
  }
83
- }, _callee, null, [[6, 13]]);
100
+ }, _callee, null, [[8, 15]]);
84
101
  }));
85
102
  return function init(_x) {
86
103
  return _ref2.apply(this, arguments);
@@ -7,7 +7,7 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
7
7
  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); }
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, { useImperativeHandle, forwardRef, useRef } from 'react';
10
+ import React, { useImperativeHandle, forwardRef, useRef, useEffect } from 'react';
11
11
  import MWCreditCard from "./MWCreditCard";
12
12
  import SuperPayAliPayH5 from "./SuperPayAliPayH5";
13
13
  import StripePay from "./StripePay";
@@ -18,7 +18,7 @@ import CustomPayment from "./CustomPayment";
18
18
  import { isCustomPayment } from "../PaymentList/status";
19
19
  import CashManual from "./CashManual";
20
20
  import GooglePay from "./GooglePay";
21
- import { removePayGroupFromStorage, syncPayGroupToStorage } from "../payGroup";
21
+ import { removePayGroupFromStorage, setPayNumber, syncPayGroupToStorage } from "../payGroup";
22
22
  import ApplePay from "./ApplePay";
23
23
  import GlobePayAliPayH5 from "./GlobePayAliPayH5";
24
24
  import GlobePayPaypalH5 from "./GlobePayPaypalH5";
@@ -26,6 +26,9 @@ import GlobePayWxH5 from "./GlobePayWxH5";
26
26
  import GlobePayQrcode from "./GlobePayQrcode";
27
27
  import { walletPassPay } from "./WalletPass/serve";
28
28
  import { formatWalletPassParams } from "../utils";
29
+ import useEngineContext from "../../../../hooks/useEngineContext";
30
+ import { isJson } from "@pisell/utils";
31
+ import { getReturnUrl } from "./GlobePayQrcode/serve";
29
32
  var isOfflinePayment = function isOfflinePayment(type) {
30
33
  if (isCustomPayment(type)) {
31
34
  return true;
@@ -33,6 +36,7 @@ var isOfflinePayment = function isOfflinePayment(type) {
33
36
  return ['pisell.bank_deposit', 'pisell.offline_payment', 'pisell.other.cashmanual', 'pisell.custom_bank_transfer'].includes(type);
34
37
  };
35
38
  var PaymentMethods = function PaymentMethods(props, ref) {
39
+ var _context$appHelper;
36
40
  var MWCreditCardRef = useRef(null);
37
41
  var SuperPayAliPayH5Ref = useRef(null);
38
42
  var StripePayRef = useRef(null);
@@ -47,6 +51,9 @@ var PaymentMethods = function PaymentMethods(props, ref) {
47
51
  var GlobePayPaypalH5Ref = useRef(null);
48
52
  var GlobePayWxH5Ref = useRef(null);
49
53
  var GlobePayQrcodeRef = useRef(null);
54
+ var context = useEngineContext();
55
+ var _context$appHelper$ut = (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils,
56
+ interaction = _context$appHelper$ut.interaction;
50
57
  var init = /*#__PURE__*/function () {
51
58
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
52
59
  var _payGroup$walletPass;
@@ -112,6 +119,26 @@ var PaymentMethods = function PaymentMethods(props, ref) {
112
119
  return _ref2.apply(this, arguments);
113
120
  };
114
121
  }();
122
+ useEffect(function () {
123
+ var _interaction$utils, _interaction$utils$is, _interaction$utils2, _interaction$utils2$i;
124
+ console.log('paymentResult isAppEnv', interaction === null || interaction === void 0 || (_interaction$utils = interaction.utils) === null || _interaction$utils === void 0 || (_interaction$utils$is = _interaction$utils.isAppEnv) === null || _interaction$utils$is === void 0 ? void 0 : _interaction$utils$is.call(_interaction$utils));
125
+ if (interaction !== null && interaction !== void 0 && (_interaction$utils2 = interaction.utils) !== null && _interaction$utils2 !== void 0 && (_interaction$utils2$i = _interaction$utils2.isAppEnv) !== null && _interaction$utils2$i !== void 0 && _interaction$utils2$i.call(_interaction$utils2)) {
126
+ interaction.utils.mountFunction('global', 'paymentResult', function (strResult) {
127
+ console.log('paymentResult', strResult);
128
+ if (!isJson(strResult)) return;
129
+ var result = JSON.parse(strResult);
130
+ var type = result.type,
131
+ pay_number = result.pay_number,
132
+ order_id = result.order_id;
133
+ if (type && order_id && pay_number) {
134
+ setPayNumber(order_id, pay_number);
135
+ }
136
+ var url = "".concat(getReturnUrl(), "?order_id=").concat(order_id, "&status=success");
137
+ console.log(url, 'paymentResult');
138
+ window.location.href = url;
139
+ });
140
+ }
141
+ }, []);
115
142
  var onPayByType = /*#__PURE__*/function () {
116
143
  var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref3) {
117
144
  var type, payGroup, _ApplePayRef$current, _GooglePayRef$current, _MWCreditCardRef$curr, _SuperPayAliPayH5Ref$, _SuperPayWxPayH5Ref$c, _StripePayRef$current, _OfflinePaymentRef$cu, _BankDepositRef$curre, _CashManualRef$curren, _GlobePayAliPayH5Ref$, _GlobePayPaypalH5Ref$, _GlobePayWxH5Ref$curr, _GlobePayQrcodeRef$cu, _CustomPaymentRef$cur;
@@ -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
 
@@ -41,7 +41,7 @@ import "./index.less";
41
41
  * @Date: 2024-08-16 10:43
42
42
  */
43
43
  var ToCPay = function ToCPay(props, ref) {
44
- var _context$appHelper$ut, _context$appHelper$ut2, _context$appHelper$ut3, _context$appHelper$ut4, _dvaStore$core, _dvaStore$core2, _state$payGroup6, _state$payGroup16, _state$order, _state$order2, _state$payGroup21, _state$payGroup22, _state$payGroup23;
44
+ var _context$appHelper$ut, _context$appHelper$ut2, _context$appHelper$ut3, _context$appHelper$ut4, _dvaStore$core, _dvaStore$core2, _state$payGroup6, _state$payGroup17, _state$order, _state$order2, _state$payGroup22, _state$payGroup23, _state$payGroup24;
45
45
  //@ts-ignore
46
46
  var _useContext = useContext(Context),
47
47
  state = _useContext.state,
@@ -107,33 +107,33 @@ var ToCPay = function ToCPay(props, ref) {
107
107
  * @Date: 2024-08-15 14:02
108
108
  */
109
109
  var _initStore = function _initStore(initProps) {
110
- var _context$appHelper$ut5, _initProps$order, _initProps$order2, _initProps$order3;
110
+ var _context$appHelper$ut5;
111
111
  dispatch({
112
112
  type: 'init',
113
113
  payload: _objectSpread(_objectSpread({}, initProps), {}, {
114
114
  status: 'init',
115
115
  // 将支付回调储存在store, 方便其他模块调用
116
116
  payCallback: props.callback,
117
- history: (_context$appHelper$ut5 = context.appHelper.utils) === null || _context$appHelper$ut5 === void 0 ? void 0 : _context$appHelper$ut5.history,
117
+ history: (_context$appHelper$ut5 = context.appHelper.utils) === null || _context$appHelper$ut5 === void 0 ? void 0 : _context$appHelper$ut5.history
118
118
  // 支付组
119
- payGroup: {
120
- order_id: initProps === null || initProps === void 0 || (_initProps$order = initProps.order) === null || _initProps$order === void 0 ? void 0 : _initProps$order.order_id,
121
- total_amount: initProps === null || initProps === void 0 || (_initProps$order2 = initProps.order) === null || _initProps$order2 === void 0 ? void 0 : _initProps$order2.amount,
122
- // 原订单信息
123
- _order: initProps === null || initProps === void 0 ? void 0 : initProps.order,
124
- payment_group_id: initProps === null || initProps === void 0 || (_initProps$order3 = initProps.order) === null || _initProps$order3 === void 0 ? void 0 : _initProps$order3.payment_group_id
125
- }
119
+ // payGroup: {
120
+ // order_id: initProps?.order?.order_id,
121
+ // total_amount: initProps?.order?.amount,
122
+ // // 原订单信息
123
+ // _order: initProps?.order,
124
+ // payment_group_id: initProps?.order?.payment_group_id,
125
+ // },
126
126
  })
127
127
  });
128
128
  };
129
129
  var getWalletSetting = /*#__PURE__*/function () {
130
130
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(initProps) {
131
- var _initProps$order4, _utils$translation, _wallet_setting$popup;
131
+ var _initProps$order, _utils$translation, _wallet_setting$popup;
132
132
  var sale_channel, _yield$getWalletNameA, wallet, wallet_setting, setting;
133
133
  return _regeneratorRuntime().wrap(function _callee$(_context) {
134
134
  while (1) switch (_context.prev = _context.next) {
135
135
  case 0:
136
- sale_channel = (initProps === null || initProps === void 0 || (_initProps$order4 = initProps.order) === null || _initProps$order4 === void 0 ? void 0 : _initProps$order4.sale_channel) || 'online-store';
136
+ sale_channel = (initProps === null || initProps === void 0 || (_initProps$order = initProps.order) === null || _initProps$order === void 0 ? void 0 : _initProps$order.sale_channel) || 'online-store';
137
137
  _context.next = 3;
138
138
  return getWalletNameAndPopupStatus({
139
139
  setting_type: "".concat(sale_channel, "-wallet-setting")
@@ -241,15 +241,21 @@ var ToCPay = function ToCPay(props, ref) {
241
241
  _ref4 = data || {}, _ref4$remain_amount = _ref4.remain_amount, remain_amount = _ref4$remain_amount === void 0 ? 0 : _ref4$remain_amount, wallet_pass_recommend_list = _ref4.wallet_pass_recommend_list, wallet_pass_amount = _ref4.wallet_pass_amount, payment_list = _ref4.payment_list, walletPass = _ref4.walletPass; // 设置交易组
242
242
  dispatch({
243
243
  type: 'setPayGroup',
244
- payload: _objectSpread(_objectSpread({}, state.payGroup), {}, {
244
+ payload: {
245
+ // ...state.payGroup,
246
+ order_id: order === null || order === void 0 ? void 0 : order.order_id,
247
+ // total_amount: order?.amount,
248
+ // 原订单信息
249
+ _order: order,
250
+ payment_group_id: order === null || order === void 0 ? void 0 : order.payment_group_id,
245
251
  // 支付方式没有walletPass时walletPass设置null
246
252
  walletPass: walletPass ? _objectSpread(_objectSpread(_objectSpread({}, (_state$payGroup = state.payGroup) === null || _state$payGroup === void 0 ? void 0 : _state$payGroup.walletPass), walletPass), {}, {
247
253
  amount: wallet_pass_amount,
248
254
  cards: wallet_pass_recommend_list
249
255
  }) : null,
250
- total_amount: order.amount,
256
+ total_amount: order === null || order === void 0 ? void 0 : order.amount,
251
257
  wait_amount: remain_amount
252
- })
258
+ }
253
259
  });
254
260
 
255
261
  // 初始化支付列表
@@ -596,7 +602,7 @@ var ToCPay = function ToCPay(props, ref) {
596
602
  * @Date: 2024-08-08 16:34
597
603
  */
598
604
  var onCancel = function onCancel() {
599
- var _state$payGroup14;
605
+ var _state$payGroup14, _state$payGroup15;
600
606
  // 删除交易组
601
607
  removePayGroupFromStorage((_state$payGroup14 = state.payGroup) === null || _state$payGroup14 === void 0 ? void 0 : _state$payGroup14.order_id);
602
608
 
@@ -609,15 +615,17 @@ var ToCPay = function ToCPay(props, ref) {
609
615
  // 回调外部
610
616
  payCallback({
611
617
  key: 'cancel',
612
- data: {}
618
+ data: {
619
+ order_id: (_state$payGroup15 = state.payGroup) === null || _state$payGroup15 === void 0 ? void 0 : _state$payGroup15.order_id
620
+ }
613
621
  });
614
622
  };
615
623
 
616
624
  // 待支付金额变化时, 重新计算附加费
617
625
  useUpdateEffect(function () {
618
- var _paymentListRef$curre2, _state$payGroup15;
619
- (_paymentListRef$curre2 = paymentListRef.current) === null || _paymentListRef$curre2 === void 0 || _paymentListRef$curre2.calculateSurcharge(((_state$payGroup15 = state.payGroup) === null || _state$payGroup15 === void 0 ? void 0 : _state$payGroup15.wait_amount) || 0);
620
- }, [(_state$payGroup16 = state.payGroup) === null || _state$payGroup16 === void 0 ? void 0 : _state$payGroup16.wait_amount]);
626
+ var _paymentListRef$curre2, _state$payGroup16;
627
+ (_paymentListRef$curre2 = paymentListRef.current) === null || _paymentListRef$curre2 === void 0 || _paymentListRef$curre2.calculateSurcharge(((_state$payGroup16 = state.payGroup) === null || _state$payGroup16 === void 0 ? void 0 : _state$payGroup16.wait_amount) || 0);
628
+ }, [(_state$payGroup17 = state.payGroup) === null || _state$payGroup17 === void 0 ? void 0 : _state$payGroup17.wait_amount]);
621
629
  useImperativeHandle(ref, function () {
622
630
  return {
623
631
  init: init,
@@ -634,7 +642,7 @@ var ToCPay = function ToCPay(props, ref) {
634
642
  * @Date: 2024-08-16 10:49
635
643
  */
636
644
  var renderPaymentListTitle = function renderPaymentListTitle() {
637
- var _state$payGroup17;
645
+ var _state$payGroup18;
638
646
  // 待支付金额为0 展示无需选择支付方式
639
647
  if (waitAmount == 0) {
640
648
  return /*#__PURE__*/React.createElement("div", {
@@ -647,13 +655,13 @@ var ToCPay = function ToCPay(props, ref) {
647
655
  }
648
656
 
649
657
  // 有剩余金额, 展示继续支付
650
- if (((_state$payGroup17 = state.payGroup) === null || _state$payGroup17 === void 0 ? void 0 : _state$payGroup17.total_amount) !== waitAmount) {
651
- var _state$payGroup18;
658
+ if (((_state$payGroup18 = state.payGroup) === null || _state$payGroup18 === void 0 ? void 0 : _state$payGroup18.total_amount) !== waitAmount) {
659
+ var _state$payGroup19;
652
660
  return /*#__PURE__*/React.createElement("div", {
653
661
  className: "custom-payment-list-title"
654
662
  }, locales.getText('tocPay.text.continuePayment'), ' ', /*#__PURE__*/React.createElement(PisellText.Amount, {
655
663
  className: "custom-payment-list-title-price",
656
- value: ((_state$payGroup18 = state.payGroup) === null || _state$payGroup18 === void 0 ? void 0 : _state$payGroup18.wait_amount) || 0.0
664
+ value: ((_state$payGroup19 = state.payGroup) === null || _state$payGroup19 === void 0 ? void 0 : _state$payGroup19.wait_amount) || 0.0
657
665
  }));
658
666
  }
659
667
 
@@ -669,12 +677,12 @@ var ToCPay = function ToCPay(props, ref) {
669
677
  * @Date: 2024-08-16 10:50
670
678
  */
671
679
  var onWalletPassChange = useMemoizedFn(function (walletPass) {
672
- var _state$payGroup19, _state$payGroup20;
673
- var _waitAmount = new Decimal(String(((_state$payGroup19 = state.payGroup) === null || _state$payGroup19 === void 0 ? void 0 : _state$payGroup19.total_amount) || 0)).minus(new Decimal(String(walletPass.amount || 0))).toNumber();
680
+ var _state$payGroup20, _state$payGroup21;
681
+ var _waitAmount = new Decimal(String(((_state$payGroup20 = state.payGroup) === null || _state$payGroup20 === void 0 ? void 0 : _state$payGroup20.total_amount) || 0)).minus(new Decimal(String(walletPass.amount || 0))).toNumber();
674
682
  dispatch({
675
683
  type: 'setPayGroup',
676
684
  payload: {
677
- walletPass: _objectSpread(_objectSpread({}, (_state$payGroup20 = state.payGroup) === null || _state$payGroup20 === void 0 ? void 0 : _state$payGroup20.walletPass), walletPass),
685
+ walletPass: _objectSpread(_objectSpread({}, (_state$payGroup21 = state.payGroup) === null || _state$payGroup21 === void 0 ? void 0 : _state$payGroup21.walletPass), walletPass),
678
686
  wait_amount: _waitAmount
679
687
  }
680
688
  });
@@ -753,8 +761,8 @@ var ToCPay = function ToCPay(props, ref) {
753
761
  }, ((_state$order = state.order) === null || _state$order === void 0 ? void 0 : _state$order.countdown) && /*#__PURE__*/React.createElement(PayCountdown, {
754
762
  time: (_state$order2 = state.order) === null || _state$order2 === void 0 ? void 0 : _state$order2.countdown
755
763
  }), /*#__PURE__*/React.createElement(PayAmount, {
756
- amount: ((_state$payGroup21 = state.payGroup) === null || _state$payGroup21 === void 0 ? void 0 : _state$payGroup21.total_amount) || 0
757
- }), ((_state$payGroup22 = state.payGroup) === null || _state$payGroup22 === void 0 ? void 0 : _state$payGroup22.walletPass) && /*#__PURE__*/React.createElement(WalletPassBlock, {
764
+ amount: ((_state$payGroup22 = state.payGroup) === null || _state$payGroup22 === void 0 ? void 0 : _state$payGroup22.total_amount) || 0
765
+ }), ((_state$payGroup23 = state.payGroup) === null || _state$payGroup23 === void 0 ? void 0 : _state$payGroup23.walletPass) && /*#__PURE__*/React.createElement(WalletPassBlock, {
758
766
  customer_id: customer_id,
759
767
  payGroup: state.payGroup,
760
768
  onWalletPassChange: onWalletPassChange,
@@ -766,7 +774,7 @@ var ToCPay = function ToCPay(props, ref) {
766
774
  handlePaymentByType(detail === null || detail === void 0 ? void 0 : detail.service);
767
775
  },
768
776
  paymentTypeChange: paymentTypeChange,
769
- hide: ((_state$payGroup23 = state.payGroup) === null || _state$payGroup23 === void 0 ? void 0 : _state$payGroup23.wait_amount) == 0,
777
+ hide: ((_state$payGroup24 = state.payGroup) === null || _state$payGroup24 === void 0 ? void 0 : _state$payGroup24.wait_amount) == 0,
770
778
  renderTitle: renderPaymentListTitle
771
779
  })), /*#__PURE__*/React.createElement(PaymentMethods, {
772
780
  ref: paymentMethodsRef,
@@ -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;