@pisell/private-materials 3.4.93 → 3.4.94

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 (73) 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 +1 -1
  6. package/build/lowcode/preview.js +9 -9
  7. package/build/lowcode/render/default/view.js +10 -10
  8. package/build/lowcode/view.js +10 -10
  9. package/es/components/booking/addons/model.d.ts +1 -10
  10. package/es/components/booking/forms/model.d.ts +1 -10
  11. package/es/components/booking/info/model.d.ts +1 -10
  12. package/es/components/booking/model.d.ts +1 -9
  13. package/es/components/booking/notes/model.d.ts +1 -10
  14. package/es/components/booking/payments/model.d.ts +1 -10
  15. package/es/components/eftposPay/hooks.d.ts +1 -1
  16. package/es/components/eftposPay/store/index.d.ts +1 -1
  17. package/es/components/pay/toC/PaymentMethods/GlobePayAliPayH5/index.js +52 -44
  18. package/es/components/pay/toC/PaymentMethods/GlobePayPaypalH5/index.js +51 -43
  19. package/es/components/pay/toC/PaymentMethods/GlobePayWxH5/index.js +51 -43
  20. package/es/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/index.js +24 -15
  21. package/es/components/pay/toC/PaymentMethods/MWCreditCard/index.js +19 -19
  22. package/es/components/pay/toC/PaymentMethods/MWCreditCard/tds2.d.ts +3 -1
  23. package/es/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +32 -27
  24. package/es/components/pay/toC/PaymentMethods/SuperPayAliPayH5/index.js +17 -16
  25. package/es/components/pay/toC/PaymentMethods/SuperPayWxPayH5/index.js +47 -42
  26. package/es/components/pay/toC/PaymentMethods/WalletPass/index.js +2 -2
  27. package/es/components/pay/toC/PaymentMethods/WalletPass/utils.d.ts +7 -0
  28. package/es/components/pay/toC/PaymentMethods/WalletPass/utils.js +18 -1
  29. package/es/components/pay/toC/PaymentMethods/index.js +116 -90
  30. package/es/components/pay/toC/index.js +4 -1
  31. package/es/components/pay/toC/locales.d.ts +5 -0
  32. package/es/components/pay/toC/locales.js +5 -0
  33. package/es/components/pay/toC/model.d.ts +1 -9
  34. package/es/components/pay/toC/payGroup.d.ts +14 -3
  35. package/es/components/pay/toC/payGroup.js +174 -15
  36. package/es/components/pay/toC/serve.d.ts +13 -0
  37. package/es/components/pay/toC/serve.js +30 -0
  38. package/es/components/pay/toC/utils.d.ts +3 -0
  39. package/es/components/pay/toC/utils.js +5 -1
  40. package/es/components/schedules/model.d.ts +1 -9
  41. package/lib/components/booking/addons/model.d.ts +1 -10
  42. package/lib/components/booking/forms/model.d.ts +1 -10
  43. package/lib/components/booking/info/model.d.ts +1 -10
  44. package/lib/components/booking/model.d.ts +1 -9
  45. package/lib/components/booking/notes/model.d.ts +1 -10
  46. package/lib/components/booking/payments/model.d.ts +1 -10
  47. package/lib/components/eftposPay/hooks.d.ts +1 -1
  48. package/lib/components/eftposPay/store/index.d.ts +1 -1
  49. package/lib/components/pay/toC/PaymentMethods/GlobePayAliPayH5/index.js +7 -3
  50. package/lib/components/pay/toC/PaymentMethods/GlobePayPaypalH5/index.js +7 -3
  51. package/lib/components/pay/toC/PaymentMethods/GlobePayWxH5/index.js +7 -3
  52. package/lib/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/index.js +19 -7
  53. package/lib/components/pay/toC/PaymentMethods/MWCreditCard/index.js +15 -9
  54. package/lib/components/pay/toC/PaymentMethods/MWCreditCard/tds2.d.ts +3 -1
  55. package/lib/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +10 -6
  56. package/lib/components/pay/toC/PaymentMethods/SuperPayAliPayH5/index.js +3 -3
  57. package/lib/components/pay/toC/PaymentMethods/SuperPayWxPayH5/index.js +3 -3
  58. package/lib/components/pay/toC/PaymentMethods/WalletPass/index.js +1 -1
  59. package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.d.ts +7 -0
  60. package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.js +16 -0
  61. package/lib/components/pay/toC/PaymentMethods/index.js +12 -7
  62. package/lib/components/pay/toC/index.js +5 -1
  63. package/lib/components/pay/toC/locales.d.ts +5 -0
  64. package/lib/components/pay/toC/locales.js +5 -0
  65. package/lib/components/pay/toC/model.d.ts +1 -9
  66. package/lib/components/pay/toC/payGroup.d.ts +14 -3
  67. package/lib/components/pay/toC/payGroup.js +60 -4
  68. package/lib/components/pay/toC/serve.d.ts +13 -0
  69. package/lib/components/pay/toC/serve.js +12 -2
  70. package/lib/components/pay/toC/utils.d.ts +3 -0
  71. package/lib/components/pay/toC/utils.js +5 -1
  72. package/lib/components/schedules/model.d.ts +1 -9
  73. package/package.json +3 -3
@@ -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;
@@ -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;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export interface FormState {
3
2
  amountSymbol: string;
4
3
  apis: {
@@ -109,11 +108,4 @@ export declare const walkInData: {
109
108
  id: number;
110
109
  nickname: string;
111
110
  };
112
- export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
113
- state: FormState;
114
- } & {
115
- dispatch: (params: {
116
- type: string;
117
- payload: any;
118
- }) => void;
119
- }>;
111
+ 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<"payo" | "tyro" | "windcave" | "stripe" | "linkly">;
22
+ readonly eftposRef: React.MutableRefObject<"stripe" | "payo" | "tyro" | "windcave" | "linkly">;
23
23
  readonly clientRef: React.MutableRefObject<ClientEnum>;
24
24
  readonly dataRef: React.MutableRefObject<import("./store").State>;
25
25
  };
@@ -299,7 +299,7 @@ export declare const backUpFree: (payload: Partial<State>) => {
299
299
  amount?: string | number | undefined;
300
300
  mode?: "refund" | "pay" | "fullPay" | "query" | undefined;
301
301
  order_id?: string | number | undefined;
302
- eftpos?: "payo" | "tyro" | "windcave" | "stripe" | "linkly" | undefined;
302
+ eftpos?: "stripe" | "payo" | "tyro" | "windcave" | "linkly" | undefined;
303
303
  action?: "amount" | "pay" | "deviceList" | undefined;
304
304
  key?: number | undefined;
305
305
  step?: number | undefined;
@@ -16,6 +16,7 @@ import { getAliPayUrl } from "./serve";
16
16
  import { Context } from "../../model";
17
17
  import { getPayGroupParamsFromStorage, setPayNumber } from "../../payGroup";
18
18
  import usePaymentLogger from "../../../../../hooks/usePaymentLogger";
19
+ import useEngineContext from "../../../../../hooks/useEngineContext";
19
20
  import "./index.less";
20
21
  /**
21
22
  * @title: 支付宝支付
@@ -25,7 +26,7 @@ import "./index.less";
25
26
  * @Date: 2024-08-16 11:18
26
27
  */
27
28
  var GlobePayAliPayH5 = function GlobePayAliPayH5(props, ref) {
28
- var _state$payGroup;
29
+ var _context$appHelper, _state$payGroup;
29
30
  var _useContext = useContext(Context),
30
31
  state = _useContext.state;
31
32
  var onChange = props.onChange;
@@ -37,6 +38,9 @@ var GlobePayAliPayH5 = function GlobePayAliPayH5(props, ref) {
37
38
  _useState4 = _slicedToArray(_useState3, 2),
38
39
  showSuccessBackButton = _useState4[0],
39
40
  setShowSuccessBackButton = _useState4[1];
41
+ var context = useEngineContext();
42
+ var _ref = ((_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils) || {},
43
+ token = _ref.token;
40
44
 
41
45
  // GlobePayAliPayH5支付日志记录器
42
46
  var paymentLogger = usePaymentLogger({
@@ -53,12 +57,12 @@ var GlobePayAliPayH5 = function GlobePayAliPayH5(props, ref) {
53
57
  * @Date: 2024-08-16 11:18
54
58
  */
55
59
  var init = /*#__PURE__*/function () {
56
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
57
- var payGroup, values, data, url;
60
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref2) {
61
+ var payGroup, values, data, url, _token$get;
58
62
  return _regeneratorRuntime().wrap(function _callee$(_context) {
59
63
  while (1) switch (_context.prev = _context.next) {
60
64
  case 0:
61
- payGroup = _ref.payGroup;
65
+ payGroup = _ref2.payGroup;
62
66
  // 记录GlobePayAliPayH5初始化开始
63
67
  paymentLogger.addLog({
64
68
  key: 'GlobePayAliPayH5初始化开始',
@@ -104,47 +108,51 @@ var GlobePayAliPayH5 = function GlobePayAliPayH5(props, ref) {
104
108
  case 14:
105
109
  data = _context.sent;
106
110
  url = data.url || (data === null || data === void 0 ? void 0 : data.pay_url);
107
- if (url) {
108
- // 记录获取支付链接成功
109
- paymentLogger.addLog({
110
- key: 'GlobePayAliPayH5获取支付链接成功',
111
- value: ""
112
- });
113
-
114
- // 设置交易号
115
- setPayNumber(payGroup === null || payGroup === void 0 ? void 0 : payGroup.order_id, data === null || data === void 0 ? void 0 : data.pay_number);
116
-
117
- // 记录准备跳转支付宝
118
- paymentLogger.addLog({
119
- key: 'GlobePayAliPayH5准备跳转支付宝',
120
- value: ""
121
- });
122
- setShowSuccessBackButton(true);
111
+ if (!url) {
112
+ _context.next = 26;
113
+ break;
114
+ }
115
+ // 记录获取支付链接成功
116
+ paymentLogger.addLog({
117
+ key: 'GlobePayAliPayH5获取支付链接成功',
118
+ value: ""
119
+ });
120
+ _context.next = 20;
121
+ return setPayNumber(payGroup === null || payGroup === void 0 ? void 0 : payGroup.order_id, data === null || data === void 0 ? void 0 : data.pay_number, token === null || token === void 0 || (_token$get = token.get) === null || _token$get === void 0 ? void 0 : _token$get.call(token));
122
+ case 20:
123
+ // 记录准备跳转支付宝
124
+ paymentLogger.addLog({
125
+ key: 'GlobePayAliPayH5准备跳转支付宝',
126
+ value: ""
127
+ });
128
+ setShowSuccessBackButton(true);
123
129
 
124
- // 在跳转前发送日志
125
- paymentLogger.sendLogs('GlobePayAliPayH5跳转成功');
130
+ // 在跳转前发送日志
131
+ paymentLogger.sendLogs('GlobePayAliPayH5跳转成功');
126
132
 
127
- // 跳转
128
- window.location.href = url;
129
- } else {
130
- // 记录未获取到支付链接
131
- paymentLogger.addLog({
132
- key: 'GlobePayAliPayH5未获取到支付链接',
133
- value: {
134
- title: "\u8BA2\u5355".concat(payGroup === null || payGroup === void 0 ? void 0 : payGroup.order_id, " \u672A\u83B7\u53D6\u5230\u6709\u6548\u7684\u652F\u4ED8\u94FE\u63A5"),
135
- data: {
136
- payGroup: payGroup,
137
- response: data
138
- }
133
+ // 跳转
134
+ window.location.href = url;
135
+ _context.next = 29;
136
+ break;
137
+ case 26:
138
+ // 记录未获取到支付链接
139
+ paymentLogger.addLog({
140
+ key: 'GlobePayAliPayH5未获取到支付链接',
141
+ value: {
142
+ title: "\u8BA2\u5355".concat(payGroup === null || payGroup === void 0 ? void 0 : payGroup.order_id, " \u672A\u83B7\u53D6\u5230\u6709\u6548\u7684\u652F\u4ED8\u94FE\u63A5"),
143
+ data: {
144
+ payGroup: payGroup,
145
+ response: data
139
146
  }
140
- });
141
- paymentLogger.sendLogs('GlobePayAliPayH5未获取到支付链接');
142
- setOpen(false);
143
- }
144
- _context.next = 24;
147
+ }
148
+ });
149
+ paymentLogger.sendLogs('GlobePayAliPayH5未获取到支付链接');
150
+ setOpen(false);
151
+ case 29:
152
+ _context.next = 36;
145
153
  break;
146
- case 19:
147
- _context.prev = 19;
154
+ case 31:
155
+ _context.prev = 31;
148
156
  _context.t0 = _context["catch"](10);
149
157
  // 记录GlobePayAliPayH5处理错误
150
158
  paymentLogger.addLog({
@@ -159,14 +167,14 @@ var GlobePayAliPayH5 = function GlobePayAliPayH5(props, ref) {
159
167
  });
160
168
  paymentLogger.sendLogs('GlobePayAliPayH5处理失败', _context.t0);
161
169
  setOpen(false);
162
- case 24:
170
+ case 36:
163
171
  case "end":
164
172
  return _context.stop();
165
173
  }
166
- }, _callee, null, [[10, 19]]);
174
+ }, _callee, null, [[10, 31]]);
167
175
  }));
168
176
  return function init(_x) {
169
- return _ref2.apply(this, arguments);
177
+ return _ref3.apply(this, arguments);
170
178
  };
171
179
  }();
172
180
  useImperativeHandle(ref, function () {
@@ -16,6 +16,7 @@ import { getAliPayUrl } from "./serve";
16
16
  import { Context } from "../../model";
17
17
  import { getPayGroupParamsFromStorage, setPayNumber } from "../../payGroup";
18
18
  import usePaymentLogger from "../../../../../hooks/usePaymentLogger";
19
+ import useEngineContext from "../../../../../hooks/useEngineContext";
19
20
  import "./index.less";
20
21
  /**
21
22
  * @title: Paypal支付
@@ -25,7 +26,7 @@ import "./index.less";
25
26
  * @Date: 2024-08-16 11:18
26
27
  */
27
28
  var GlobePayPaypalH5 = function GlobePayPaypalH5(props, ref) {
28
- var _state$payGroup;
29
+ var _context$appHelper, _state$payGroup;
29
30
  var _useContext = useContext(Context),
30
31
  state = _useContext.state;
31
32
  var onChange = props.onChange;
@@ -33,6 +34,9 @@ var GlobePayPaypalH5 = function GlobePayPaypalH5(props, ref) {
33
34
  _useState2 = _slicedToArray(_useState, 2),
34
35
  open = _useState2[0],
35
36
  setOpen = _useState2[1];
37
+ var context = useEngineContext();
38
+ var _ref = ((_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils) || {},
39
+ token = _ref.token;
36
40
 
37
41
  // GlobePayPaypalH5支付日志记录器
38
42
  var paymentLogger = usePaymentLogger({
@@ -49,12 +53,12 @@ var GlobePayPaypalH5 = function GlobePayPaypalH5(props, ref) {
49
53
  * @Date: 2024-08-16 11:18
50
54
  */
51
55
  var init = /*#__PURE__*/function () {
52
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
53
- var payGroup, values, data, url;
56
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref2) {
57
+ var payGroup, values, data, url, _token$get;
54
58
  return _regeneratorRuntime().wrap(function _callee$(_context) {
55
59
  while (1) switch (_context.prev = _context.next) {
56
60
  case 0:
57
- payGroup = _ref.payGroup;
61
+ payGroup = _ref2.payGroup;
58
62
  // 记录GlobePayPaypalH5初始化开始
59
63
  paymentLogger.addLog({
60
64
  key: 'GlobePayPaypalH5初始化开始',
@@ -100,46 +104,50 @@ var GlobePayPaypalH5 = function GlobePayPaypalH5(props, ref) {
100
104
  case 14:
101
105
  data = _context.sent;
102
106
  url = data.url || (data === null || data === void 0 ? void 0 : data.pay_url);
103
- if (url) {
104
- // 记录获取支付链接成功
105
- paymentLogger.addLog({
106
- key: 'GlobePayPaypalH5获取支付链接成功',
107
- value: ""
108
- });
109
-
110
- // 设置交易号
111
- setPayNumber(payGroup === null || payGroup === void 0 ? void 0 : payGroup.order_id, data === null || data === void 0 ? void 0 : data.pay_number);
112
-
113
- // 记录准备跳转Paypal
114
- paymentLogger.addLog({
115
- key: 'GlobePayPaypalH5准备跳转Paypal',
116
- value: ""
117
- });
107
+ if (!url) {
108
+ _context.next = 25;
109
+ break;
110
+ }
111
+ // 记录获取支付链接成功
112
+ paymentLogger.addLog({
113
+ key: 'GlobePayPaypalH5获取支付链接成功',
114
+ value: ""
115
+ });
116
+ _context.next = 20;
117
+ return setPayNumber(payGroup === null || payGroup === void 0 ? void 0 : payGroup.order_id, data === null || data === void 0 ? void 0 : data.pay_number, token === null || token === void 0 || (_token$get = token.get) === null || _token$get === void 0 ? void 0 : _token$get.call(token));
118
+ case 20:
119
+ // 记录准备跳转Paypal
120
+ paymentLogger.addLog({
121
+ key: 'GlobePayPaypalH5准备跳转Paypal',
122
+ value: ""
123
+ });
118
124
 
119
- // 在跳转前发送日志
120
- paymentLogger.sendLogs('GlobePayPaypalH5跳转成功');
125
+ // 在跳转前发送日志
126
+ paymentLogger.sendLogs('GlobePayPaypalH5跳转成功');
121
127
 
122
- // 跳转
123
- window.location.href = url;
124
- } else {
125
- // 记录未获取到支付链接
126
- paymentLogger.addLog({
127
- key: 'GlobePayPaypalH5未获取到支付链接',
128
- value: {
129
- title: "\u8BA2\u5355".concat(payGroup === null || payGroup === void 0 ? void 0 : payGroup.order_id, " \u672A\u83B7\u53D6\u5230\u6709\u6548\u7684\u652F\u4ED8\u94FE\u63A5"),
130
- data: {
131
- payGroup: payGroup,
132
- response: data
133
- }
128
+ // 跳转
129
+ window.location.href = url;
130
+ _context.next = 28;
131
+ break;
132
+ case 25:
133
+ // 记录未获取到支付链接
134
+ paymentLogger.addLog({
135
+ key: 'GlobePayPaypalH5未获取到支付链接',
136
+ value: {
137
+ title: "\u8BA2\u5355".concat(payGroup === null || payGroup === void 0 ? void 0 : payGroup.order_id, " \u672A\u83B7\u53D6\u5230\u6709\u6548\u7684\u652F\u4ED8\u94FE\u63A5"),
138
+ data: {
139
+ payGroup: payGroup,
140
+ response: data
134
141
  }
135
- });
136
- paymentLogger.sendLogs('GlobePayPaypalH5未获取到支付链接');
137
- setOpen(false);
138
- }
139
- _context.next = 24;
142
+ }
143
+ });
144
+ paymentLogger.sendLogs('GlobePayPaypalH5未获取到支付链接');
145
+ setOpen(false);
146
+ case 28:
147
+ _context.next = 35;
140
148
  break;
141
- case 19:
142
- _context.prev = 19;
149
+ case 30:
150
+ _context.prev = 30;
143
151
  _context.t0 = _context["catch"](10);
144
152
  // 记录GlobePayPaypalH5处理错误
145
153
  paymentLogger.addLog({
@@ -154,14 +162,14 @@ var GlobePayPaypalH5 = function GlobePayPaypalH5(props, ref) {
154
162
  });
155
163
  paymentLogger.sendLogs('GlobePayPaypalH5处理失败', _context.t0);
156
164
  setOpen(false);
157
- case 24:
165
+ case 35:
158
166
  case "end":
159
167
  return _context.stop();
160
168
  }
161
- }, _callee, null, [[10, 19]]);
169
+ }, _callee, null, [[10, 30]]);
162
170
  }));
163
171
  return function init(_x) {
164
- return _ref2.apply(this, arguments);
172
+ return _ref3.apply(this, arguments);
165
173
  };
166
174
  }();
167
175
  useImperativeHandle(ref, function () {
@@ -16,6 +16,7 @@ import { getAliPayUrl } from "./serve";
16
16
  import { Context } from "../../model";
17
17
  import { getPayGroupParamsFromStorage, setPayNumber } from "../../payGroup";
18
18
  import usePaymentLogger from "../../../../../hooks/usePaymentLogger";
19
+ import useEngineContext from "../../../../../hooks/useEngineContext";
19
20
  import "./index.less";
20
21
  /**
21
22
  * @title: Globe微信支付
@@ -25,7 +26,7 @@ import "./index.less";
25
26
  * @Date: 2024-08-16 11:18
26
27
  */
27
28
  var GlobePayWxH5 = function GlobePayWxH5(props, ref) {
28
- var _state$payGroup;
29
+ var _context$appHelper, _state$payGroup;
29
30
  var _useContext = useContext(Context),
30
31
  state = _useContext.state;
31
32
  var onChange = props.onChange;
@@ -33,6 +34,9 @@ var GlobePayWxH5 = function GlobePayWxH5(props, ref) {
33
34
  _useState2 = _slicedToArray(_useState, 2),
34
35
  open = _useState2[0],
35
36
  setOpen = _useState2[1];
37
+ var context = useEngineContext();
38
+ var _ref = ((_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils) || {},
39
+ token = _ref.token;
36
40
 
37
41
  // GlobePayWxH5支付日志记录器
38
42
  var paymentLogger = usePaymentLogger({
@@ -49,12 +53,12 @@ var GlobePayWxH5 = function GlobePayWxH5(props, ref) {
49
53
  * @Date: 2024-08-16 11:18
50
54
  */
51
55
  var init = /*#__PURE__*/function () {
52
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
53
- var payGroup, values, data, url;
56
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref2) {
57
+ var payGroup, values, data, url, _token$get;
54
58
  return _regeneratorRuntime().wrap(function _callee$(_context) {
55
59
  while (1) switch (_context.prev = _context.next) {
56
60
  case 0:
57
- payGroup = _ref.payGroup;
61
+ payGroup = _ref2.payGroup;
58
62
  // 记录GlobePayWxH5初始化开始
59
63
  paymentLogger.addLog({
60
64
  key: 'GlobePayWxH5初始化开始',
@@ -100,46 +104,50 @@ var GlobePayWxH5 = function GlobePayWxH5(props, ref) {
100
104
  case 14:
101
105
  data = _context.sent;
102
106
  url = data.url || (data === null || data === void 0 ? void 0 : data.pay_url);
103
- if (url) {
104
- // 记录获取支付链接成功
105
- paymentLogger.addLog({
106
- key: 'GlobePayWxH5获取支付链接成功',
107
- value: ""
108
- });
109
-
110
- // 设置交易号
111
- setPayNumber(payGroup === null || payGroup === void 0 ? void 0 : payGroup.order_id, data === null || data === void 0 ? void 0 : data.pay_number);
112
-
113
- // 记录准备跳转微信
114
- paymentLogger.addLog({
115
- key: 'GlobePayWxH5准备跳转微信',
116
- value: ""
117
- });
107
+ if (!url) {
108
+ _context.next = 25;
109
+ break;
110
+ }
111
+ // 记录获取支付链接成功
112
+ paymentLogger.addLog({
113
+ key: 'GlobePayWxH5获取支付链接成功',
114
+ value: ""
115
+ });
116
+ _context.next = 20;
117
+ return setPayNumber(payGroup === null || payGroup === void 0 ? void 0 : payGroup.order_id, data === null || data === void 0 ? void 0 : data.pay_number, token === null || token === void 0 || (_token$get = token.get) === null || _token$get === void 0 ? void 0 : _token$get.call(token));
118
+ case 20:
119
+ // 记录准备跳转微信
120
+ paymentLogger.addLog({
121
+ key: 'GlobePayWxH5准备跳转微信',
122
+ value: ""
123
+ });
118
124
 
119
- // 在跳转前发送日志
120
- paymentLogger.sendLogs('GlobePayWxH5跳转成功');
125
+ // 在跳转前发送日志
126
+ paymentLogger.sendLogs('GlobePayWxH5跳转成功');
121
127
 
122
- // 跳转
123
- window.location.href = url;
124
- } else {
125
- // 记录未获取到支付链接
126
- paymentLogger.addLog({
127
- key: 'GlobePayWxH5未获取到支付链接',
128
- value: {
129
- title: "\u8BA2\u5355".concat(payGroup === null || payGroup === void 0 ? void 0 : payGroup.order_id, " \u672A\u83B7\u53D6\u5230\u6709\u6548\u7684\u652F\u4ED8\u94FE\u63A5"),
130
- data: {
131
- payGroup: payGroup,
132
- response: data
133
- }
128
+ // 跳转
129
+ window.location.href = url;
130
+ _context.next = 28;
131
+ break;
132
+ case 25:
133
+ // 记录未获取到支付链接
134
+ paymentLogger.addLog({
135
+ key: 'GlobePayWxH5未获取到支付链接',
136
+ value: {
137
+ title: "\u8BA2\u5355".concat(payGroup === null || payGroup === void 0 ? void 0 : payGroup.order_id, " \u672A\u83B7\u53D6\u5230\u6709\u6548\u7684\u652F\u4ED8\u94FE\u63A5"),
138
+ data: {
139
+ payGroup: payGroup,
140
+ response: data
134
141
  }
135
- });
136
- paymentLogger.sendLogs('GlobePayWxH5未获取到支付链接');
137
- setOpen(false);
138
- }
139
- _context.next = 24;
142
+ }
143
+ });
144
+ paymentLogger.sendLogs('GlobePayWxH5未获取到支付链接');
145
+ setOpen(false);
146
+ case 28:
147
+ _context.next = 35;
140
148
  break;
141
- case 19:
142
- _context.prev = 19;
149
+ case 30:
150
+ _context.prev = 30;
143
151
  _context.t0 = _context["catch"](10);
144
152
  // 记录GlobePayWxH5处理错误
145
153
  paymentLogger.addLog({
@@ -154,14 +162,14 @@ var GlobePayWxH5 = function GlobePayWxH5(props, ref) {
154
162
  });
155
163
  paymentLogger.sendLogs('GlobePayWxH5处理失败', _context.t0);
156
164
  setOpen(false);
157
- case 24:
165
+ case 35:
158
166
  case "end":
159
167
  return _context.stop();
160
168
  }
161
- }, _callee, null, [[10, 19]]);
169
+ }, _callee, null, [[10, 30]]);
162
170
  }));
163
171
  return function init(_x) {
164
- return _ref2.apply(this, arguments);
172
+ return _ref3.apply(this, arguments);
165
173
  };
166
174
  }();
167
175
  useImperativeHandle(ref, function () {