@pisell/private-materials 6.3.14 → 6.3.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +13 -13
- package/build/lowcode/render/default/view.js +9 -9
- package/build/lowcode/view.js +9 -9
- package/es/components/booking/addons/model.d.ts +10 -1
- package/es/components/booking/forms/model.d.ts +10 -1
- package/es/components/booking/info/model.d.ts +10 -1
- package/es/components/booking/model.d.ts +9 -1
- package/es/components/booking/notes/model.d.ts +10 -1
- package/es/components/booking/payments/model.d.ts +10 -1
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/store/index.d.ts +1 -1
- package/es/components/pay/toC/PaymentMethods/ApplePay/index.js +52 -6
- package/es/components/pay/toC/PaymentMethods/BankDeposit/index.js +58 -8
- package/es/components/pay/toC/PaymentMethods/CashManual/index.js +74 -12
- package/es/components/pay/toC/PaymentMethods/CustomPayment/index.js +73 -12
- package/es/components/pay/toC/PaymentMethods/GlobePayAliPayH5/index.js +93 -11
- package/es/components/pay/toC/PaymentMethods/GlobePayPaypalH5/index.js +90 -12
- package/es/components/pay/toC/PaymentMethods/GlobePayQrcode/index.js +46 -7
- package/es/components/pay/toC/PaymentMethods/GlobePayWxH5/index.js +90 -12
- package/es/components/pay/toC/PaymentMethods/GooglePay/index.js +64 -13
- package/es/components/pay/toC/PaymentMethods/OfflinePayment/index.js +73 -8
- package/es/components/pay/toC/PaymentMethods/StripePay/index.js +68 -17
- package/es/components/pay/toC/PaymentMethods/SuperPayAliPayH5/index.js +86 -14
- package/es/components/pay/toC/PaymentMethods/SuperPayWxPayH5/index.js +89 -15
- package/es/components/pay/toC/index.js +278 -118
- package/es/components/pay/toC/model.d.ts +9 -1
- package/es/components/schedules/model.d.ts +9 -1
- package/es/components/schedules/utils.d.ts +1 -1
- package/es/components/ticketBooking/components/ticketBooking/index.js +2 -0
- package/es/components/wallet/Detail/index.js +3 -1
- package/es/components/wallet/Detail/model.d.ts +13 -1
- package/es/components/wallet/DiscountCard/model.d.ts +14 -1
- package/es/components/wallet/PointCard/model.d.ts +13 -1
- package/es/components/wallet/RechargeableCard/model.d.ts +29 -1
- package/es/components/wallet/Voucher/model.d.ts +13 -1
- package/es/components/wallet/components/WalletCard.js +8 -3
- package/es/components/wallet/model.d.ts +9 -1
- package/es/hooks/usePaymentLogger.d.ts +22 -0
- package/es/hooks/usePaymentLogger.js +78 -0
- package/es/utils/index.d.ts +1 -1
- package/lib/components/booking/addons/model.d.ts +10 -1
- package/lib/components/booking/forms/model.d.ts +10 -1
- package/lib/components/booking/info/model.d.ts +10 -1
- package/lib/components/booking/model.d.ts +9 -1
- package/lib/components/booking/notes/model.d.ts +10 -1
- package/lib/components/booking/payments/model.d.ts +10 -1
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/store/index.d.ts +1 -1
- package/lib/components/pay/toC/PaymentMethods/ApplePay/index.js +42 -3
- package/lib/components/pay/toC/PaymentMethods/BankDeposit/index.js +52 -15
- package/lib/components/pay/toC/PaymentMethods/CashManual/index.js +60 -2
- package/lib/components/pay/toC/PaymentMethods/CustomPayment/index.js +60 -2
- package/lib/components/pay/toC/PaymentMethods/GlobePayAliPayH5/index.js +66 -2
- package/lib/components/pay/toC/PaymentMethods/GlobePayPaypalH5/index.js +61 -0
- package/lib/components/pay/toC/PaymentMethods/GlobePayQrcode/index.js +29 -0
- package/lib/components/pay/toC/PaymentMethods/GlobePayWxH5/index.js +61 -0
- package/lib/components/pay/toC/PaymentMethods/GooglePay/index.js +50 -6
- package/lib/components/pay/toC/PaymentMethods/OfflinePayment/index.js +72 -10
- package/lib/components/pay/toC/PaymentMethods/StripePay/index.js +47 -5
- package/lib/components/pay/toC/PaymentMethods/SuperPayAliPayH5/index.js +61 -3
- package/lib/components/pay/toC/PaymentMethods/SuperPayWxPayH5/index.js +63 -3
- package/lib/components/pay/toC/index.js +183 -48
- package/lib/components/pay/toC/model.d.ts +9 -1
- package/lib/components/schedules/model.d.ts +9 -1
- package/lib/components/schedules/utils.d.ts +1 -1
- package/lib/components/ticketBooking/components/ticketBooking/index.js +1 -0
- package/lib/components/wallet/Detail/index.js +18 -5
- package/lib/components/wallet/Detail/model.d.ts +13 -1
- package/lib/components/wallet/DiscountCard/model.d.ts +14 -1
- package/lib/components/wallet/PointCard/model.d.ts +13 -1
- package/lib/components/wallet/RechargeableCard/model.d.ts +29 -1
- package/lib/components/wallet/Voucher/model.d.ts +13 -1
- package/lib/components/wallet/components/WalletCard.js +3 -1
- package/lib/components/wallet/model.d.ts +9 -1
- package/lib/hooks/usePaymentLogger.d.ts +22 -0
- package/lib/hooks/usePaymentLogger.js +69 -0
- package/lib/utils/index.d.ts +1 -1
- package/package.json +3 -3
@@ -45,13 +45,14 @@ var import_PaymentMethods = __toESM(require("./PaymentMethods"));
|
|
45
45
|
var import_serve = require("./serve");
|
46
46
|
var import_model = require("./model");
|
47
47
|
var import_useEngineContext = __toESM(require("../../../hooks/useEngineContext"));
|
48
|
+
var import_usePaymentLogger = __toESM(require("../../../hooks/usePaymentLogger"));
|
48
49
|
var import_utils2 = require("../../../utils");
|
49
50
|
var import_payGroup = require("./payGroup");
|
50
51
|
var import_locales = __toESM(require("./locales"));
|
51
52
|
var import_utils3 = require("./utils");
|
52
53
|
var import_index = require("./index.less");
|
53
54
|
var ToCPay = (props, ref) => {
|
54
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t;
|
55
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u;
|
55
56
|
const { state, dispatch } = (0, import_react.useContext)(import_model.Context);
|
56
57
|
const paymentListRef = (0, import_react.useRef)();
|
57
58
|
const paymentMethodsRef = (0, import_react.useRef)();
|
@@ -61,13 +62,17 @@ var ToCPay = (props, ref) => {
|
|
61
62
|
const [renderType, setRenderType] = (0, import_react.useState)("modal");
|
62
63
|
const walletPassBlockRef = (0, import_react.useRef)(null);
|
63
64
|
const context = (0, import_useEngineContext.default)();
|
65
|
+
const paymentLogger = (0, import_usePaymentLogger.default)({
|
66
|
+
orderId: ((_a = state.payGroup) == null ? void 0 : _a.order_id) || "unknown",
|
67
|
+
step: "1"
|
68
|
+
});
|
64
69
|
const [showInformation, setShowInformation] = (0, import_react.useState)(false);
|
65
70
|
const [showDetectIncognitoConfirm, setShowDetectIncognitoConfirm] = (0, import_react.useState)(false);
|
66
71
|
const utils = context.appHelper.utils || {};
|
67
|
-
const dvaStore = (
|
68
|
-
const customer_id = (_i = (_h = (_g = (_f = (_e =
|
69
|
-
const shopName = (
|
70
|
-
import_utils.locales.init(import_locales.default, ((
|
72
|
+
const dvaStore = (_d = (_c = (_b = context.appHelper.utils) == null ? void 0 : _b.getStore) == null ? void 0 : _c.call(_b)) == null ? void 0 : _d.getState();
|
73
|
+
const customer_id = (_j = (_i = (_h = (_g = (_f = (_e = context.appHelper.utils) == null ? void 0 : _e.getStore()) == null ? void 0 : _f.getState) == null ? void 0 : _g.call(_f)) == null ? void 0 : _h.global) == null ? void 0 : _i.userInfo) == null ? void 0 : _j.id;
|
74
|
+
const shopName = (_m = (_l = (_k = dvaStore.core) == null ? void 0 : _k.core) == null ? void 0 : _l.shop) == null ? void 0 : _m.name;
|
75
|
+
import_utils.locales.init(import_locales.default, ((_n = dvaStore.core) == null ? void 0 : _n.translateLocale) || "en");
|
71
76
|
import_utils2.request.setRequest(utils == null ? void 0 : utils.request);
|
72
77
|
const _initStore = (initProps) => {
|
73
78
|
var _a2;
|
@@ -112,18 +117,47 @@ var ToCPay = (props, ref) => {
|
|
112
117
|
});
|
113
118
|
};
|
114
119
|
const init = async (initProps) => {
|
120
|
+
var _a2;
|
115
121
|
const { renderType: renderType2 } = initProps;
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
122
|
+
paymentLogger.addLog({
|
123
|
+
key: "初始化开始",
|
124
|
+
value: ``
|
125
|
+
});
|
126
|
+
try {
|
127
|
+
setRenderType(renderType2 ?? "modal");
|
128
|
+
setOpen(true);
|
129
|
+
setSubmitLoading(false);
|
130
|
+
setLoading(true);
|
131
|
+
_initStore(initProps);
|
132
|
+
(0, import_payGroup.removePayGroupFromStorage)(initProps.order.order_id);
|
133
|
+
await _getPaymentsAndWalletPass(initProps.order);
|
134
|
+
await getWalletSetting(initProps);
|
135
|
+
paymentLogger.addLog({
|
136
|
+
key: "初始化成功",
|
137
|
+
value: ``
|
138
|
+
});
|
139
|
+
} catch (error) {
|
140
|
+
paymentLogger.addLog({
|
141
|
+
key: "初始化错误",
|
142
|
+
value: {
|
143
|
+
title: `订单${(_a2 = initProps == null ? void 0 : initProps.order) == null ? void 0 : _a2.order_id} 初始化失败: ${(error == null ? void 0 : error.message) || "未知错误"}`,
|
144
|
+
data: {
|
145
|
+
order: initProps == null ? void 0 : initProps.order
|
146
|
+
}
|
147
|
+
}
|
148
|
+
});
|
149
|
+
paymentLogger.sendLogs("支付初始化失败", error);
|
150
|
+
throw error;
|
151
|
+
}
|
124
152
|
};
|
125
153
|
const _getPaymentsAndWalletPass = async (order) => {
|
126
154
|
var _a2, _b2;
|
155
|
+
paymentLogger.addLog({
|
156
|
+
key: "获取支付列表开始",
|
157
|
+
value: {
|
158
|
+
title: `订单${order == null ? void 0 : order.order_id} 开始获取支付列表, 金额: ${order == null ? void 0 : order.amount}`
|
159
|
+
}
|
160
|
+
});
|
127
161
|
try {
|
128
162
|
const data = await (0, import_serve.getPaymentsAndWalletPass)({
|
129
163
|
order_id: order.order_id,
|
@@ -137,6 +171,10 @@ var ToCPay = (props, ref) => {
|
|
137
171
|
payment_list,
|
138
172
|
walletPass
|
139
173
|
} = data || {};
|
174
|
+
paymentLogger.addLog({
|
175
|
+
key: "支付数据获取",
|
176
|
+
value: ""
|
177
|
+
});
|
140
178
|
dispatch({
|
141
179
|
type: "setPayGroup",
|
142
180
|
payload: {
|
@@ -161,8 +199,22 @@ var ToCPay = (props, ref) => {
|
|
161
199
|
setTimeout(() => {
|
162
200
|
setLoading(false);
|
163
201
|
}, 100);
|
202
|
+
paymentLogger.addLog({
|
203
|
+
key: "获取支付列表成功",
|
204
|
+
value: ""
|
205
|
+
});
|
164
206
|
} catch (err) {
|
165
207
|
console.log("err", err);
|
208
|
+
paymentLogger.addLog({
|
209
|
+
key: "获取支付列表错误",
|
210
|
+
value: {
|
211
|
+
title: `订单${order == null ? void 0 : order.order_id} 获取失败: ${(err == null ? void 0 : err.message) || "未知错误"}`,
|
212
|
+
data: {
|
213
|
+
order
|
214
|
+
}
|
215
|
+
}
|
216
|
+
});
|
217
|
+
paymentLogger.sendLogs("获取支付列表失败", err);
|
166
218
|
payCallback({
|
167
219
|
key: "fail",
|
168
220
|
data: {
|
@@ -175,16 +227,47 @@ var ToCPay = (props, ref) => {
|
|
175
227
|
};
|
176
228
|
const handlePaymentByType = async (type, payGroup) => {
|
177
229
|
var _a2, _b2, _c2;
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
230
|
+
const paymentType = type || ((_b2 = (_a2 = state.payGroup) == null ? void 0 : _a2.otherPayment) == null ? void 0 : _b2.service);
|
231
|
+
const currentPayGroup = payGroup || state.payGroup;
|
232
|
+
paymentLogger.addLog({
|
233
|
+
key: "开始支付处理",
|
234
|
+
value: ""
|
235
|
+
});
|
236
|
+
try {
|
237
|
+
setSubmitLoading(true);
|
238
|
+
await ((_c2 = paymentMethodsRef.current) == null ? void 0 : _c2.onPay({
|
239
|
+
type: paymentType,
|
240
|
+
payGroup: currentPayGroup
|
241
|
+
}));
|
242
|
+
paymentLogger.addLog({
|
243
|
+
key: "支付方法调用成功",
|
244
|
+
value: ""
|
245
|
+
});
|
246
|
+
paymentLogger.sendLogs("支付方法调用成功");
|
247
|
+
setSubmitLoading(false);
|
248
|
+
} catch (error) {
|
249
|
+
paymentLogger.addLog({
|
250
|
+
key: "支付处理错误",
|
251
|
+
value: {
|
252
|
+
title: `订单${currentPayGroup == null ? void 0 : currentPayGroup.order_id} ${paymentType}支付失败: ${(error == null ? void 0 : error.message) || "未知错误"}`,
|
253
|
+
data: {
|
254
|
+
type: paymentType,
|
255
|
+
payGroup: currentPayGroup
|
256
|
+
}
|
257
|
+
}
|
258
|
+
});
|
259
|
+
paymentLogger.sendLogs("支付处理失败", error);
|
260
|
+
setSubmitLoading(false);
|
261
|
+
throw error;
|
262
|
+
}
|
184
263
|
};
|
185
264
|
const paymentInit = async (newOrderId) => {
|
186
265
|
var _a2, _b2;
|
187
266
|
const orderId = newOrderId || ((_a2 = state.payGroup) == null ? void 0 : _a2.order_id);
|
267
|
+
paymentLogger.addLog({
|
268
|
+
key: "开始创建交易组",
|
269
|
+
value: ""
|
270
|
+
});
|
188
271
|
setSubmitLoading(true);
|
189
272
|
try {
|
190
273
|
const data = await (0, import_serve.getPaymentInit)({
|
@@ -200,6 +283,10 @@ var ToCPay = (props, ref) => {
|
|
200
283
|
payment_priority: data.payment_priority
|
201
284
|
}
|
202
285
|
});
|
286
|
+
paymentLogger.addLog({
|
287
|
+
key: "创建交易组成功",
|
288
|
+
value: ""
|
289
|
+
});
|
203
290
|
return {
|
204
291
|
...state.payGroup,
|
205
292
|
order_id: orderId,
|
@@ -208,14 +295,16 @@ var ToCPay = (props, ref) => {
|
|
208
295
|
payment_priority: data.payment_priority
|
209
296
|
};
|
210
297
|
} catch (err) {
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
298
|
+
paymentLogger.addLog({
|
299
|
+
key: "创建交易组错误",
|
300
|
+
value: {
|
301
|
+
title: `订单${orderId} 创建交易组失败: ${(err == null ? void 0 : err.message) || "未知错误"}`,
|
302
|
+
data: {
|
303
|
+
order: orderId
|
304
|
+
}
|
305
|
+
}
|
218
306
|
});
|
307
|
+
paymentLogger.sendLogs("创建交易组失败", err);
|
219
308
|
setSubmitLoading(false);
|
220
309
|
payCallback({
|
221
310
|
key: "fail",
|
@@ -230,7 +319,7 @@ var ToCPay = (props, ref) => {
|
|
230
319
|
const waitAmount = (0, import_react.useMemo)(() => {
|
231
320
|
var _a2;
|
232
321
|
return ((_a2 = state.payGroup) == null ? void 0 : _a2.wait_amount) || 0;
|
233
|
-
}, [(
|
322
|
+
}, [(_o = state.payGroup) == null ? void 0 : _o.wait_amount]);
|
234
323
|
const isWalletPassPay = (0, import_react.useMemo)(() => {
|
235
324
|
var _a2, _b2, _c2;
|
236
325
|
const isWalletPass = (_c2 = (_b2 = (_a2 = state.payGroup) == null ? void 0 : _a2.walletPass) == null ? void 0 : _b2.cards) == null ? void 0 : _c2.length;
|
@@ -250,28 +339,50 @@ var ToCPay = (props, ref) => {
|
|
250
339
|
return ((payGroup == null ? void 0 : payGroup.wait_amount) || 0) > 0 && (0, import_utils3.getIsWalletPassAndTripartitePayment)(payGroup) && isPrivate;
|
251
340
|
};
|
252
341
|
const onSubmit = async (newOrderId) => {
|
253
|
-
var _a2;
|
342
|
+
var _a2, _b2, _c2, _d2, _e2, _f2, _g2;
|
343
|
+
paymentLogger.addLog({
|
344
|
+
key: "开始提交支付",
|
345
|
+
value: `订单${newOrderId || ((_a2 = state.payGroup) == null ? void 0 : _a2.order_id)} 开始提交, 待支付: ${(_b2 = state.payGroup) == null ? void 0 : _b2.wait_amount}, 总金额: ${(_c2 = state.payGroup) == null ? void 0 : _c2.total_amount}`
|
346
|
+
});
|
347
|
+
let newPayGroup = state.payGroup;
|
254
348
|
try {
|
255
|
-
let newPayGroup = state.payGroup;
|
256
349
|
const result = await getIsShowDetectIncognitoConfirm(newPayGroup);
|
257
350
|
if (result) {
|
351
|
+
paymentLogger.addLog({
|
352
|
+
key: "无痕模式检测",
|
353
|
+
value: ""
|
354
|
+
});
|
258
355
|
setShowDetectIncognitoConfirm(true);
|
259
356
|
return;
|
260
357
|
}
|
261
|
-
if (!((
|
358
|
+
if (!((_d2 = state.payGroup) == null ? void 0 : _d2.payment_group_id)) {
|
359
|
+
paymentLogger.addLog({
|
360
|
+
key: "需要创建交易组",
|
361
|
+
value: ""
|
362
|
+
});
|
262
363
|
newPayGroup = await paymentInit(newOrderId);
|
263
364
|
}
|
365
|
+
paymentLogger.addLog({
|
366
|
+
key: "调用支付方法",
|
367
|
+
value: `订单${newPayGroup == null ? void 0 : newPayGroup.order_id} 交易组${newPayGroup == null ? void 0 : newPayGroup.payment_group_id} 使用${(_f2 = (_e2 = state.payGroup) == null ? void 0 : _e2.otherPayment) == null ? void 0 : _f2.service}支付`
|
368
|
+
});
|
264
369
|
handlePaymentByType(void 0, newPayGroup);
|
370
|
+
paymentLogger.addLog({
|
371
|
+
key: "支付提交调用成功",
|
372
|
+
value: ""
|
373
|
+
});
|
265
374
|
} catch (err) {
|
266
375
|
console.log("err", err);
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
{
|
271
|
-
|
272
|
-
|
273
|
-
|
376
|
+
paymentLogger.addLog({
|
377
|
+
key: "提交支付错误",
|
378
|
+
value: {
|
379
|
+
title: `订单${newOrderId || ((_g2 = state.payGroup) == null ? void 0 : _g2.order_id)} 提交失败: ${(err == null ? void 0 : err.message) || "未知错误"}`,
|
380
|
+
data: {
|
381
|
+
newPayGroup
|
382
|
+
}
|
383
|
+
}
|
274
384
|
});
|
385
|
+
paymentLogger.sendLogs("提交支付失败", err);
|
275
386
|
}
|
276
387
|
};
|
277
388
|
const paymentTypeChange = (payload) => {
|
@@ -295,21 +406,45 @@ var ToCPay = (props, ref) => {
|
|
295
406
|
}
|
296
407
|
}, [state.payGroup]);
|
297
408
|
const payCallback = async (res) => {
|
298
|
-
var _a2;
|
299
|
-
|
409
|
+
var _a2, _b2, _c2, _d2;
|
410
|
+
const orderId = ((_a2 = res == null ? void 0 : res.data) == null ? void 0 : _a2.order_id) || ((_b2 = state.payGroup) == null ? void 0 : _b2.order_id);
|
411
|
+
if (res.key === "success") {
|
412
|
+
paymentLogger.addLog({
|
413
|
+
key: "支付最终成功",
|
414
|
+
value: `订单${orderId} 支付成功`
|
415
|
+
});
|
416
|
+
paymentLogger.sendLogs("支付成功");
|
417
|
+
} else if (res.key === "fail") {
|
418
|
+
paymentLogger.addLog({
|
419
|
+
key: "支付最终失败",
|
420
|
+
value: {
|
421
|
+
title: `订单${orderId} 支付失败`,
|
422
|
+
data: res == null ? void 0 : res.data
|
423
|
+
}
|
424
|
+
});
|
425
|
+
paymentLogger.sendLogs("支付失败", (_c2 = res == null ? void 0 : res.data) == null ? void 0 : _c2.err);
|
426
|
+
} else if (res.key === "cancel") {
|
427
|
+
paymentLogger.addLog({
|
428
|
+
key: "支付被取消",
|
429
|
+
value: `订单${orderId} 支付被取消`
|
430
|
+
});
|
300
431
|
setOpen(false);
|
301
432
|
}
|
302
|
-
(
|
433
|
+
(_d2 = props.callback) == null ? void 0 : _d2.call(props, res);
|
303
434
|
};
|
304
435
|
const onCancel = () => {
|
305
|
-
var _a2, _b2;
|
306
|
-
|
436
|
+
var _a2, _b2, _c2;
|
437
|
+
paymentLogger.addLog({
|
438
|
+
key: "用户主动取消支付",
|
439
|
+
value: `订单${(_a2 = state.payGroup) == null ? void 0 : _a2.order_id} 用户取消支付`
|
440
|
+
});
|
441
|
+
(0, import_payGroup.removePayGroupFromStorage)((_b2 = state.payGroup) == null ? void 0 : _b2.order_id);
|
307
442
|
setShowInformation(false);
|
308
443
|
setOpen(false);
|
309
444
|
payCallback({
|
310
445
|
key: "cancel",
|
311
446
|
data: {
|
312
|
-
order_id: (
|
447
|
+
order_id: (_c2 = state.payGroup) == null ? void 0 : _c2.order_id
|
313
448
|
}
|
314
449
|
});
|
315
450
|
};
|
@@ -318,7 +453,7 @@ var ToCPay = (props, ref) => {
|
|
318
453
|
(_b2 = paymentListRef.current) == null ? void 0 : _b2.calculateSurcharge(
|
319
454
|
((_a2 = state.payGroup) == null ? void 0 : _a2.wait_amount) || 0
|
320
455
|
);
|
321
|
-
}, [(
|
456
|
+
}, [(_p = state.payGroup) == null ? void 0 : _p.wait_amount]);
|
322
457
|
(0, import_react.useImperativeHandle)(ref, () => {
|
323
458
|
return {
|
324
459
|
init,
|
@@ -432,9 +567,9 @@ var ToCPay = (props, ref) => {
|
|
432
567
|
loading,
|
433
568
|
mask: true
|
434
569
|
},
|
435
|
-
((
|
436
|
-
/* @__PURE__ */ import_react.default.createElement(import_PayAmount.default, { amount: ((
|
437
|
-
((
|
570
|
+
((_q = state.order) == null ? void 0 : _q.countdown) && /* @__PURE__ */ import_react.default.createElement(import_PayCountdown.default, { time: (_r = state.order) == null ? void 0 : _r.countdown }),
|
571
|
+
/* @__PURE__ */ import_react.default.createElement(import_PayAmount.default, { amount: ((_s = state.payGroup) == null ? void 0 : _s.total_amount) || 0 }),
|
572
|
+
((_t = state.payGroup) == null ? void 0 : _t.walletPass) && /* @__PURE__ */ import_react.default.createElement(
|
438
573
|
import_WalletPassBlock.default,
|
439
574
|
{
|
440
575
|
customer_id,
|
@@ -452,7 +587,7 @@ var ToCPay = (props, ref) => {
|
|
452
587
|
handlePaymentByType(detail == null ? void 0 : detail.service);
|
453
588
|
},
|
454
589
|
paymentTypeChange,
|
455
|
-
hide: ((
|
590
|
+
hide: ((_u = state.payGroup) == null ? void 0 : _u.wait_amount) == 0,
|
456
591
|
renderTitle: renderPaymentListTitle
|
457
592
|
}
|
458
593
|
)
|
@@ -1,3 +1,4 @@
|
|
1
|
+
/// <reference types="react" />
|
1
2
|
export interface FormState {
|
2
3
|
platform: 'pc' | 'h5' | '' | undefined;
|
3
4
|
order: any;
|
@@ -28,4 +29,11 @@ export interface PayGroup {
|
|
28
29
|
pay_number?: string;
|
29
30
|
_order: any;
|
30
31
|
}
|
31
|
-
export declare const Provider: any, Context:
|
32
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
33
|
+
state: FormState;
|
34
|
+
} & {
|
35
|
+
dispatch: (params: {
|
36
|
+
type: string;
|
37
|
+
payload: any;
|
38
|
+
}) => void;
|
39
|
+
}>;
|
@@ -1,3 +1,4 @@
|
|
1
|
+
/// <reference types="react" />
|
1
2
|
import { CalendarDataItem, ScheduleItem } from "./type";
|
2
3
|
import dayjs from "dayjs";
|
3
4
|
export interface FormState {
|
@@ -68,4 +69,11 @@ export interface FormState {
|
|
68
69
|
};
|
69
70
|
setGlobalState: Function | null;
|
70
71
|
}
|
71
|
-
export declare const Provider: any, Context:
|
72
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
73
|
+
state: FormState;
|
74
|
+
} & {
|
75
|
+
dispatch: (params: {
|
76
|
+
type: string;
|
77
|
+
payload: any;
|
78
|
+
}) => void;
|
79
|
+
}>;
|
@@ -17,6 +17,6 @@ declare let modal: Omit<ModalStaticFunctions, "warn">;
|
|
17
17
|
export declare const setModal: (m: Omit<ModalStaticFunctions, "warn">) => void;
|
18
18
|
export declare const saveConfirm: () => Promise<{
|
19
19
|
destroy: () => void;
|
20
|
-
update: (configUpdate: import("antd
|
20
|
+
update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
|
21
21
|
}>;
|
22
22
|
export { modal };
|
@@ -210,6 +210,7 @@ var TicketBooking = () => {
|
|
210
210
|
const _callbackFnRef = (0, import_react.useRef)();
|
211
211
|
(0, import_react.useEffect)(() => {
|
212
212
|
var _a2, _b2, _c2, _d, _e, _f;
|
213
|
+
localStorage.removeItem("bookingResourceList");
|
213
214
|
_persistentRef.current = storage.get(`drawer-booking`) === "true" ? true : isTerminal();
|
214
215
|
if (lowcodeRef) {
|
215
216
|
lowcodeRef.onReady(void 0);
|
@@ -67,7 +67,11 @@ var Detail = (0, import_react.forwardRef)((props, ref) => {
|
|
67
67
|
expire_date = "",
|
68
68
|
product = {}
|
69
69
|
} = detail;
|
70
|
-
const {
|
70
|
+
const {
|
71
|
+
description = "",
|
72
|
+
extension_data = [],
|
73
|
+
customer_order_behavior_count = 0
|
74
|
+
} = product || {};
|
71
75
|
const context = (0, import_useEngineContext.default)();
|
72
76
|
const [extensionData, setExtensionData] = (0, import_react.useState)([]);
|
73
77
|
const [customerOrderBehaviorCount, setCustomerOrderBehaviorCount] = (0, import_react.useState)(0);
|
@@ -154,7 +158,10 @@ var Detail = (0, import_react.forwardRef)((props, ref) => {
|
|
154
158
|
};
|
155
159
|
};
|
156
160
|
const usageRules = generateUsageRules(usageCreditsData);
|
157
|
-
const personalLimit = generatePersonalLimit(usageCreditsData, {
|
161
|
+
const personalLimit = generatePersonalLimit(usageCreditsData, {
|
162
|
+
totalOrderBehaviorCount,
|
163
|
+
customerOrderBehaviorCount
|
164
|
+
});
|
158
165
|
const utils = ((_a = context == null ? void 0 : context.appHelper) == null ? void 0 : _a.utils) || {};
|
159
166
|
const dvaStore = (_c = (_b = utils == null ? void 0 : utils.getStore) == null ? void 0 : _b.call(utils)) == null ? void 0 : _c.getState();
|
160
167
|
const [TimeLineData, setTimeLineData] = (0, import_react.useState)([]);
|
@@ -206,6 +213,7 @@ var Detail = (0, import_react.forwardRef)((props, ref) => {
|
|
206
213
|
}
|
207
214
|
};
|
208
215
|
(0, import_react.useEffect)(() => {
|
216
|
+
var _a2;
|
209
217
|
let data = [
|
210
218
|
{
|
211
219
|
label: import_utils.locales.getText("page.wallet.cardName"),
|
@@ -222,9 +230,10 @@ var Detail = (0, import_react.forwardRef)((props, ref) => {
|
|
222
230
|
}
|
223
231
|
];
|
224
232
|
if (tag === "product_discount_card") {
|
233
|
+
const isFixedAmount = ((_a2 = detail.metadata) == null ? void 0 : _a2.discount_card_type) === "fixed_amount";
|
225
234
|
data.splice(2, 0, {
|
226
235
|
label: import_utils.locales.getText("page.wallet.discount"),
|
227
|
-
value: balance ? `${Number(balance)}%` : ""
|
236
|
+
value: balance ? isFixedAmount ? `${symbol}${Number(balance)}` : `${Number(balance)}%` : ""
|
228
237
|
});
|
229
238
|
} else if (tag === "point_card") {
|
230
239
|
data.splice(2, 0, {
|
@@ -287,7 +296,9 @@ var Detail = (0, import_react.forwardRef)((props, ref) => {
|
|
287
296
|
setWeekOrderBehaviorCount(week_order_behavior_count);
|
288
297
|
setMonthOrderBehaviorCount(month_order_behavior_count);
|
289
298
|
if (Array.isArray(extension_data2) && extension_data2.length > 0) {
|
290
|
-
const usageCreditsItem = extension_data2.find(
|
299
|
+
const usageCreditsItem = extension_data2.find(
|
300
|
+
(item) => item.field_key === "usage_credits"
|
301
|
+
);
|
291
302
|
if (usageCreditsItem == null ? void 0 : usageCreditsItem.value) {
|
292
303
|
setUsageCreditsData(usageCreditsItem.value);
|
293
304
|
setShouldShowUsageRules(true);
|
@@ -388,7 +399,9 @@ var Detail = (0, import_react.forwardRef)((props, ref) => {
|
|
388
399
|
throw new Error(`HTTP error! status: ${response.status}`);
|
389
400
|
}
|
390
401
|
const passData = await response.arrayBuffer();
|
391
|
-
const blob = new Blob([passData], {
|
402
|
+
const blob = new Blob([passData], {
|
403
|
+
type: "application/vnd.apple.pkpass"
|
404
|
+
});
|
392
405
|
const downloadUrl = URL.createObjectURL(blob);
|
393
406
|
const a = document.createElement("a");
|
394
407
|
a.href = downloadUrl;
|
@@ -1 +1,13 @@
|
|
1
|
-
|
1
|
+
/// <reference types="react" />
|
2
|
+
interface RechargeState {
|
3
|
+
addWalletCard: any;
|
4
|
+
}
|
5
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
6
|
+
walletDetailState: RechargeState;
|
7
|
+
} & {
|
8
|
+
dispatch: (params: {
|
9
|
+
type: string;
|
10
|
+
payload: any;
|
11
|
+
}) => void;
|
12
|
+
}>;
|
13
|
+
export {};
|
@@ -1 +1,14 @@
|
|
1
|
-
|
1
|
+
/// <reference types="react" />
|
2
|
+
interface RechargeState {
|
3
|
+
total: number;
|
4
|
+
setup?: 'menu' | 'list' | 'detail' | string;
|
5
|
+
}
|
6
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
7
|
+
state: RechargeState;
|
8
|
+
} & {
|
9
|
+
dispatch: (params: {
|
10
|
+
type: string;
|
11
|
+
payload: any;
|
12
|
+
}) => void;
|
13
|
+
}>;
|
14
|
+
export {};
|
@@ -1 +1,13 @@
|
|
1
|
-
|
1
|
+
/// <reference types="react" />
|
2
|
+
interface RechargeState {
|
3
|
+
total: number;
|
4
|
+
}
|
5
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
6
|
+
state: RechargeState;
|
7
|
+
} & {
|
8
|
+
dispatch: (params: {
|
9
|
+
type: string;
|
10
|
+
payload: any;
|
11
|
+
}) => void;
|
12
|
+
}>;
|
13
|
+
export {};
|
@@ -1 +1,29 @@
|
|
1
|
-
|
1
|
+
/// <reference types="react" />
|
2
|
+
interface RechargeState {
|
3
|
+
selectedGiftOptionId: string | null;
|
4
|
+
cardList: Array<{
|
5
|
+
id: string;
|
6
|
+
name: string;
|
7
|
+
price: number;
|
8
|
+
}>;
|
9
|
+
selectedItem: {
|
10
|
+
id?: string;
|
11
|
+
gift_price?: number;
|
12
|
+
price?: number;
|
13
|
+
name?: string;
|
14
|
+
variant_id?: string;
|
15
|
+
};
|
16
|
+
productId?: string;
|
17
|
+
detailId?: string;
|
18
|
+
total: string | number;
|
19
|
+
rechargeModalOpen: boolean;
|
20
|
+
}
|
21
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
22
|
+
state: RechargeState;
|
23
|
+
} & {
|
24
|
+
dispatch: (params: {
|
25
|
+
type: string;
|
26
|
+
payload: any;
|
27
|
+
}) => void;
|
28
|
+
}>;
|
29
|
+
export {};
|
@@ -1 +1,13 @@
|
|
1
|
-
|
1
|
+
/// <reference types="react" />
|
2
|
+
interface RechargeState {
|
3
|
+
total: 0;
|
4
|
+
}
|
5
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
6
|
+
state: RechargeState;
|
7
|
+
} & {
|
8
|
+
dispatch: (params: {
|
9
|
+
type: string;
|
10
|
+
payload: any;
|
11
|
+
}) => void;
|
12
|
+
}>;
|
13
|
+
export {};
|
@@ -54,7 +54,8 @@ var WalletCard = ({
|
|
54
54
|
limit_status,
|
55
55
|
product_cover = "",
|
56
56
|
par_value = "",
|
57
|
-
unified_messages = {}
|
57
|
+
unified_messages = {},
|
58
|
+
...rest
|
58
59
|
} = item;
|
59
60
|
const platform = (0, import_react.useMemo)(() => (0, import_utils.isMobile)() ? "h5" : "pc", []);
|
60
61
|
const { title: disabledReason = "" } = unified_messages;
|
@@ -64,6 +65,7 @@ var WalletCard = ({
|
|
64
65
|
return /* @__PURE__ */ import_react.default.createElement(
|
65
66
|
import_materials.PisellWalletPassCard,
|
66
67
|
{
|
68
|
+
...rest,
|
67
69
|
balanceTitle,
|
68
70
|
showDetail: false,
|
69
71
|
showRedeem: false,
|
@@ -1,3 +1,4 @@
|
|
1
|
+
/// <reference types="react" />
|
1
2
|
import { IWalletListItemProps } from './serve';
|
2
3
|
export interface WalletCardItemProps {
|
3
4
|
id: string;
|
@@ -26,4 +27,11 @@ export interface WalletListProps {
|
|
26
27
|
currentSearchListItemCode?: string;
|
27
28
|
[key: string]: any;
|
28
29
|
}
|
29
|
-
export declare const Provider: any, Context:
|
30
|
+
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
31
|
+
global_wallet: WalletListProps;
|
32
|
+
} & {
|
33
|
+
dispatch: (params: {
|
34
|
+
type: string;
|
35
|
+
payload: any;
|
36
|
+
}) => void;
|
37
|
+
}>;
|
@@ -0,0 +1,22 @@
|
|
1
|
+
interface LogData {
|
2
|
+
key: string;
|
3
|
+
value: any;
|
4
|
+
}
|
5
|
+
interface UsePaymentLoggerOptions {
|
6
|
+
orderId: string;
|
7
|
+
step?: string;
|
8
|
+
}
|
9
|
+
/**
|
10
|
+
* @title: 支付日志记录器 Hook
|
11
|
+
* @description: 用于记录支付过程中的关键信息
|
12
|
+
* @param {UsePaymentLoggerOptions} options - 配置选项
|
13
|
+
* @return {object} 返回日志记录相关方法
|
14
|
+
* @Author: AI Assistant
|
15
|
+
*/
|
16
|
+
declare const usePaymentLogger: (options: UsePaymentLoggerOptions) => {
|
17
|
+
logs: import("react").MutableRefObject<LogData[]>;
|
18
|
+
addLog: (logData: LogData) => void;
|
19
|
+
sendLogs: (title?: string, err?: any) => void;
|
20
|
+
};
|
21
|
+
export default usePaymentLogger;
|
22
|
+
export type { LogData, UsePaymentLoggerOptions };
|