@pisell/private-materials 6.4.31 → 6.4.33
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 +5 -5
- package/build/lowcode/render/default/view.js +6 -6
- package/build/lowcode/view.js +6 -6
- package/es/components/appointmentBooking/components/Header/index.d.ts +0 -1
- package/es/components/appointmentBooking/index.d.ts +0 -1
- package/es/components/booking/addons/model.d.ts +1 -10
- package/es/components/booking/components/TabProduct/index.d.ts +0 -1
- package/es/components/booking/components/TabProduct/productItem/index.d.ts +0 -1
- package/es/components/booking/components/footer/index.js +23 -7
- package/es/components/booking/deposit/index.d.ts +0 -1
- package/es/components/booking/forms/model.d.ts +1 -10
- package/es/components/booking/info/addServiceVariant/index.d.ts +0 -1
- package/es/components/booking/info/model.d.ts +1 -10
- package/es/components/booking/info/notes/index.d.ts +0 -1
- package/es/components/booking/info2/service/addService/index.d.ts +0 -1
- package/es/components/booking/model.d.ts +1 -9
- package/es/components/booking/notes/NoteBlock/index.d.ts +0 -1
- package/es/components/booking/notes/addNote/index.d.ts +0 -1
- package/es/components/booking/notes/model.d.ts +1 -10
- package/es/components/booking/payments/model.d.ts +1 -10
- package/es/components/checkout/PaymentModal.js +23 -33
- package/es/components/checkout/PaymentPlugin.d.ts +0 -1
- package/es/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.js +1 -1
- package/es/components/checkout/components/PaymentResultToast/index.js +1 -1
- package/es/components/checkout/components/ScrollableList/index.js +0 -1
- package/es/components/eftposPay/amount.d.ts +0 -1
- package/es/components/eftposPay/app.d.ts +0 -1
- package/es/components/eftposPay/component/fail/failCustom.d.ts +0 -1
- package/es/components/eftposPay/component/fail/index.d.ts +0 -1
- package/es/components/eftposPay/index.d.ts +0 -1
- package/es/components/eftposPay/pay.d.ts +0 -1
- package/es/components/pay/toB/components/CardGroup/index.d.ts +0 -1
- package/es/components/pay/toB/components/MX51/index.js +14 -44
- package/es/components/pay/toB/types/index.d.ts +0 -12
- package/es/components/pay/toB/types/index.js +0 -4
- package/es/components/pay/toC/model.d.ts +1 -9
- package/es/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +0 -1
- package/es/components/schedules/model.d.ts +1 -9
- package/es/components/wallet/Detail/model.d.ts +1 -13
- package/es/components/wallet/DiscountCard/model.d.ts +1 -14
- package/es/components/wallet/PointCard/model.d.ts +1 -13
- package/es/components/wallet/RechargeableCard/model.d.ts +1 -29
- package/es/components/wallet/Voucher/model.d.ts +1 -13
- package/es/components/wallet/model.d.ts +1 -9
- package/lib/components/appointmentBooking/components/Header/index.d.ts +0 -1
- package/lib/components/appointmentBooking/index.d.ts +0 -1
- package/lib/components/booking/addons/model.d.ts +1 -10
- package/lib/components/booking/components/TabProduct/index.d.ts +0 -1
- package/lib/components/booking/components/TabProduct/productItem/index.d.ts +0 -1
- package/lib/components/booking/components/footer/index.js +8 -7
- package/lib/components/booking/deposit/index.d.ts +0 -1
- package/lib/components/booking/forms/model.d.ts +1 -10
- package/lib/components/booking/info/addServiceVariant/index.d.ts +0 -1
- package/lib/components/booking/info/model.d.ts +1 -10
- package/lib/components/booking/info/notes/index.d.ts +0 -1
- package/lib/components/booking/info2/service/addService/index.d.ts +0 -1
- package/lib/components/booking/model.d.ts +1 -9
- package/lib/components/booking/notes/NoteBlock/index.d.ts +0 -1
- package/lib/components/booking/notes/addNote/index.d.ts +0 -1
- package/lib/components/booking/notes/model.d.ts +1 -10
- package/lib/components/booking/payments/model.d.ts +1 -10
- package/lib/components/checkout/PaymentModal.js +7 -17
- package/lib/components/checkout/PaymentPlugin.d.ts +0 -1
- package/lib/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.js +1 -1
- package/lib/components/checkout/components/PaymentResultToast/index.js +1 -1
- package/lib/components/checkout/components/ScrollableList/index.js +0 -1
- package/lib/components/eftposPay/amount.d.ts +0 -1
- package/lib/components/eftposPay/app.d.ts +0 -1
- package/lib/components/eftposPay/component/fail/failCustom.d.ts +0 -1
- package/lib/components/eftposPay/component/fail/index.d.ts +0 -1
- package/lib/components/eftposPay/index.d.ts +0 -1
- package/lib/components/eftposPay/pay.d.ts +0 -1
- package/lib/components/pay/toB/components/CardGroup/index.d.ts +0 -1
- package/lib/components/pay/toB/components/MX51/index.js +12 -37
- package/lib/components/pay/toB/types/index.d.ts +0 -12
- package/lib/components/pay/toC/model.d.ts +1 -9
- package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +0 -1
- package/lib/components/schedules/model.d.ts +1 -9
- package/lib/components/wallet/Detail/model.d.ts +1 -13
- package/lib/components/wallet/DiscountCard/model.d.ts +1 -14
- package/lib/components/wallet/PointCard/model.d.ts +1 -13
- package/lib/components/wallet/RechargeableCard/model.d.ts +1 -29
- package/lib/components/wallet/Voucher/model.d.ts +1 -13
- package/lib/components/wallet/model.d.ts +1 -9
- package/package.json +1 -1
- package/es/hooks/printer.d.ts +0 -4
- package/es/hooks/printer.js +0 -35
- package/lib/hooks/printer.d.ts +0 -4
- package/lib/hooks/printer.js +0 -60
@@ -1,13 +1 @@
|
|
1
|
-
|
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
|
+
export declare const Provider: any, Context: any;
|
@@ -1,14 +1 @@
|
|
1
|
-
|
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
|
+
export declare const Provider: any, Context: any;
|
@@ -1,13 +1 @@
|
|
1
|
-
|
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
|
+
export declare const Provider: any, Context: any;
|
@@ -1,29 +1 @@
|
|
1
|
-
|
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
|
+
export declare const Provider: any, Context: any;
|
@@ -1,13 +1 @@
|
|
1
|
-
|
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 {};
|
1
|
+
export declare const Provider: any, Context: any;
|
@@ -1,4 +1,3 @@
|
|
1
|
-
/// <reference types="react" />
|
2
1
|
import { IWalletListItemProps } from './serve';
|
3
2
|
export interface WalletCardItemProps {
|
4
3
|
id: string;
|
@@ -27,11 +26,4 @@ export interface WalletListProps {
|
|
27
26
|
currentSearchListItemCode?: string;
|
28
27
|
[key: string]: any;
|
29
28
|
}
|
30
|
-
export declare const Provider:
|
31
|
-
global_wallet: WalletListProps;
|
32
|
-
} & {
|
33
|
-
dispatch: (params: {
|
34
|
-
type: string;
|
35
|
-
payload: any;
|
36
|
-
}) => void;
|
37
|
-
}>;
|
29
|
+
export declare const Provider: any, Context: any;
|
@@ -1,10 +1 @@
|
|
1
|
-
|
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;
|
@@ -59,6 +59,7 @@ var import_materials = require("@pisell/materials");
|
|
59
59
|
var import_useCustomer = require("../../../ticketBooking/hooks/pisellos/useCustomer");
|
60
60
|
var import_ahooks = require("ahooks");
|
61
61
|
var import_lodash = require("lodash");
|
62
|
+
var import_hooks = require("../../../appointmentBooking/hooks");
|
62
63
|
var Footer = (props) => {
|
63
64
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
|
64
65
|
const { state, buttons, dispatch, source } = props;
|
@@ -482,10 +483,10 @@ var Footer = (props) => {
|
|
482
483
|
setPaymentCallback(() => (paymentResult) => {
|
483
484
|
var _a2, _b2, _c2, _d2;
|
484
485
|
console.log("Payment result:", paymentResult);
|
486
|
+
setIsPaymentModalOpen(false);
|
485
487
|
if ((paymentResult == null ? void 0 : paymentResult.status) === "success") {
|
486
488
|
console.log("Payment completed successfully");
|
487
489
|
(_b2 = (_a2 = window == null ? void 0 : window.shopApi) == null ? void 0 : _a2.bookingTicket) == null ? void 0 : _b2.clearAllCart();
|
488
|
-
setIsPaymentModalOpen(false);
|
489
490
|
setPaymentModalData(null);
|
490
491
|
setPaymentCallback(null);
|
491
492
|
} else if ((paymentResult == null ? void 0 : paymentResult.status) === "cancelled") {
|
@@ -493,12 +494,10 @@ var Footer = (props) => {
|
|
493
494
|
if (res == null ? void 0 : res.order_id) {
|
494
495
|
(_d2 = (_c2 = window == null ? void 0 : window.shopApi) == null ? void 0 : _c2.booking) == null ? void 0 : _d2.voidBooking(res.order_id);
|
495
496
|
}
|
496
|
-
setIsPaymentModalOpen(false);
|
497
497
|
setPaymentModalData(null);
|
498
498
|
setPaymentCallback(null);
|
499
499
|
} else {
|
500
500
|
console.log("Payment status:", paymentResult == null ? void 0 : paymentResult.status);
|
501
|
-
setIsPaymentModalOpen(false);
|
502
501
|
setPaymentModalData(null);
|
503
502
|
setPaymentCallback(null);
|
504
503
|
}
|
@@ -1195,10 +1194,10 @@ var Footer = (props) => {
|
|
1195
1194
|
const { selectCustomer } = (0, import_useCustomer.useCustomer)({
|
1196
1195
|
changeCustomerToGlobalState
|
1197
1196
|
});
|
1197
|
+
const shopDiscount = (0, import_hooks.useShopDiscount)();
|
1198
1198
|
const { clearAllScanListenersTaskQueue } = (0, import_useScanManager.default)();
|
1199
1199
|
const handleClearAllAndReset = () => {
|
1200
|
-
var _a2
|
1201
|
-
(_b2 = (_a2 = window == null ? void 0 : window.shopApi) == null ? void 0 : _a2.bookingTicket) == null ? void 0 : _b2.clearAllCart();
|
1200
|
+
var _a2;
|
1202
1201
|
clearAllScanListenersTaskQueue();
|
1203
1202
|
dispatch({
|
1204
1203
|
type: "setService",
|
@@ -1236,6 +1235,7 @@ var Footer = (props) => {
|
|
1236
1235
|
orderNote: ""
|
1237
1236
|
}
|
1238
1237
|
});
|
1238
|
+
(_a2 = shopDiscount == null ? void 0 : shopDiscount.clear) == null ? void 0 : _a2.call(shopDiscount);
|
1239
1239
|
};
|
1240
1240
|
return /* @__PURE__ */ import_react.default.createElement(import_antd.Skeleton, { title: false, round: true, loading: showFooter, active: true }, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-footer-total" }, /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-lowcode__booking-footer-left" }, /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-lowcode__booking-footer-left-total" }, totalText), /* @__PURE__ */ import_react.default.createElement("span", { className: "pisell-lowcode__booking-footer-left-arrears" }, arrearsText)), /* @__PURE__ */ import_react.default.createElement(
|
1241
1241
|
"span",
|
@@ -1325,12 +1325,13 @@ var Footer = (props) => {
|
|
1325
1325
|
state,
|
1326
1326
|
dispatch,
|
1327
1327
|
onClose: (reset) => {
|
1328
|
-
console.log("🔄 Footer: Closing PaymentModal");
|
1329
1328
|
setIsPaymentModalOpen(false);
|
1330
1329
|
setPaymentModalData(null);
|
1331
1330
|
setPaymentCallback(null);
|
1332
1331
|
if (reset) {
|
1333
|
-
|
1332
|
+
setTimeout(() => {
|
1333
|
+
handleClearAllAndReset();
|
1334
|
+
}, 0);
|
1334
1335
|
}
|
1335
1336
|
}
|
1336
1337
|
}
|
@@ -1,10 +1 @@
|
|
1
|
-
|
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:
|
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: {
|
@@ -106,11 +105,4 @@ export declare const walkInData: {
|
|
106
105
|
id: number;
|
107
106
|
nickname: string;
|
108
107
|
};
|
109
|
-
export declare const Provider:
|
110
|
-
state: FormState;
|
111
|
-
} & {
|
112
|
-
dispatch: (params: {
|
113
|
-
type: string;
|
114
|
-
payload: any;
|
115
|
-
}) => void;
|
116
|
-
}>;
|
108
|
+
export declare const Provider: any, Context: any;
|
@@ -1,10 +1 @@
|
|
1
|
-
|
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
|
-
|
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;
|
@@ -64,7 +64,6 @@ var import_lodash = require("lodash");
|
|
64
64
|
var import_utils2 = require("./utils");
|
65
65
|
var import_usePaymentLogger = __toESM(require("./hooks/usePaymentLogger"));
|
66
66
|
var import_antd = require("antd");
|
67
|
-
var import_printer = __toESM(require("../../hooks/printer"));
|
68
67
|
var CheckoutHooks = {
|
69
68
|
OnStateAmountChanged: "checkout:onStateAmountChanged",
|
70
69
|
OnBalanceDueAmountChanged: "checkout:onBalanceDueAmountChanged",
|
@@ -118,7 +117,6 @@ var PaymentContent = (0, import_react.forwardRef)(
|
|
118
117
|
const walletPassRef = (0, import_react.useRef)(null);
|
119
118
|
const [paymentItems, setPaymentItems] = (0, import_react.useState)([]);
|
120
119
|
const [walletPassData, setWalletPassData] = (0, import_react.useState)({});
|
121
|
-
const { nativePrint } = (0, import_printer.default)();
|
122
120
|
const isOrderFree = (0, import_react.useMemo)(() => {
|
123
121
|
if (!customAmount) return false;
|
124
122
|
const amount = parseFloat(customAmount);
|
@@ -301,10 +299,7 @@ var PaymentContent = (0, import_react.forwardRef)(
|
|
301
299
|
}
|
302
300
|
if (checkoutModule && isModalOpen) {
|
303
301
|
checkoutModule.getPaymentMethodsAsync().then(async (paymentMethods2) => {
|
304
|
-
const reorderedPaymentMethods = await (0, import_utils2.reorderPaymentMethodList)(
|
305
|
-
paymentMethods2,
|
306
|
-
interaction
|
307
|
-
);
|
302
|
+
const reorderedPaymentMethods = await (0, import_utils2.reorderPaymentMethodList)(paymentMethods2, interaction);
|
308
303
|
setPaymentMethods(reorderedPaymentMethods);
|
309
304
|
const isShowCashPayment = paymentMethods2.some(
|
310
305
|
(item) => item.code === "CASHMANUAL"
|
@@ -517,12 +512,11 @@ var PaymentContent = (0, import_react.forwardRef)(
|
|
517
512
|
data: {
|
518
513
|
order_id: responseData.order_id,
|
519
514
|
machine_code_print_info: responseData == null ? void 0 : responseData.machine_code_print_info,
|
520
|
-
small_ticket_data: (_b2 = responseData == null ? void 0 : responseData.payment_info) == null ? void 0 : _b2.small_ticket_data
|
521
|
-
machine_code_print_info_v2: responseData == null ? void 0 : responseData.machine_code_print_info_v2
|
515
|
+
small_ticket_data: (_b2 = responseData == null ? void 0 : responseData.payment_info) == null ? void 0 : _b2.small_ticket_data
|
522
516
|
}
|
523
517
|
};
|
524
518
|
console.log("print_order_onOrderSynced_params>>>>", params);
|
525
|
-
|
519
|
+
(0, import_utils.webPrint)(params, (res) => {
|
526
520
|
console.log("print_order_onOrderSynced_res>>>>", res);
|
527
521
|
});
|
528
522
|
} catch (error) {
|
@@ -691,7 +685,7 @@ var PaymentContent = (0, import_react.forwardRef)(
|
|
691
685
|
data: { order_id: data.orderId }
|
692
686
|
};
|
693
687
|
try {
|
694
|
-
|
688
|
+
(0, import_utils.webPrint)(params, (res) => {
|
695
689
|
console.log("handleButtonClick_print-receipt_res>>>>", res);
|
696
690
|
if (!(res == null ? void 0 : res.result)) {
|
697
691
|
Toast == null ? void 0 : Toast.error((res == null ? void 0 : res.msg) || "");
|
@@ -994,7 +988,6 @@ var PaymentModal = ({
|
|
994
988
|
const [windowHeight, setWindowHeight] = (0, import_react.useState)(0);
|
995
989
|
const [showRetryModal, setShowRetryModal] = (0, import_react.useState)(false);
|
996
990
|
const Toast = (0, import_useToast.default)();
|
997
|
-
const { nativePrint } = (0, import_printer.default)();
|
998
991
|
const handleRetry = async () => {
|
999
992
|
const checkoutModule = pisellos == null ? void 0 : pisellos.getModule("checkout");
|
1000
993
|
const res = await (checkoutModule == null ? void 0 : checkoutModule.manualSyncOrderAsync());
|
@@ -1223,7 +1216,6 @@ var PaymentModal = ({
|
|
1223
1216
|
order_rounding_setting: getData("order_rounding_setting"),
|
1224
1217
|
shop_wallet_pass_id
|
1225
1218
|
});
|
1226
|
-
console.time("initCheckoutData");
|
1227
1219
|
const newData = (0, import_lodash.cloneDeep)(data);
|
1228
1220
|
await checkout.createLocalOrderAsync({
|
1229
1221
|
orderData: newData.order_info,
|
@@ -1231,7 +1223,6 @@ var PaymentModal = ({
|
|
1231
1223
|
autoPayment: true,
|
1232
1224
|
totalInfo: newData.subtotal_info
|
1233
1225
|
});
|
1234
|
-
console.timeEnd("initCheckoutData");
|
1235
1226
|
const orderInfo2 = checkout.getCurrentOrderInfo();
|
1236
1227
|
if (orderInfo2 && orderInfo2.totalAmount) {
|
1237
1228
|
setTotalAmount(orderInfo2.totalAmount);
|
@@ -1279,8 +1270,7 @@ var PaymentModal = ({
|
|
1279
1270
|
data: {
|
1280
1271
|
order_id: responseData.order_id,
|
1281
1272
|
machine_code_print_info: responseData == null ? void 0 : responseData.machine_code_print_info,
|
1282
|
-
small_ticket_data: (_c2 = responseData == null ? void 0 : responseData.payment_info) == null ? void 0 : _c2.small_ticket_data
|
1283
|
-
machine_code_print_info_v2: responseData == null ? void 0 : responseData.machine_code_print_info_v2
|
1273
|
+
small_ticket_data: (_c2 = responseData == null ? void 0 : responseData.payment_info) == null ? void 0 : _c2.small_ticket_data
|
1284
1274
|
}
|
1285
1275
|
};
|
1286
1276
|
console.log("print_order_onOrderSynced_params>>>>", params);
|
@@ -1291,7 +1281,7 @@ var PaymentModal = ({
|
|
1291
1281
|
params
|
1292
1282
|
}
|
1293
1283
|
});
|
1294
|
-
|
1284
|
+
(0, import_utils.webPrint)(params, (res) => {
|
1295
1285
|
console.log("print_order_onOrderSynced_res>>>>", res);
|
1296
1286
|
logger == null ? void 0 : logger.addLog({
|
1297
1287
|
type: "info",
|
@@ -1435,7 +1425,7 @@ var PaymentModal = ({
|
|
1435
1425
|
data: { order_id: data2.orderId }
|
1436
1426
|
};
|
1437
1427
|
try {
|
1438
|
-
|
1428
|
+
(0, import_utils.webPrint)(params, (res) => {
|
1439
1429
|
console.log("handleButtonClick_print-receipt_res>>>>", res);
|
1440
1430
|
if (!(res == null ? void 0 : res.result)) {
|
1441
1431
|
Toast == null ? void 0 : Toast.error((res == null ? void 0 : res.msg) || "");
|
@@ -1,4 +1,3 @@
|
|
1
|
-
/// <reference types="react" />
|
2
1
|
import { PosProps, RouteType } from './const';
|
3
2
|
declare const App: ({ action, api, device_number, terminal, tyroUrl, tyroVersion, onChangeParams, isMobile, channel, formatAmount, ...props }: Omit<PosProps, "type" | "mode" | "getApi"> & {
|
4
3
|
action: RouteType;
|
@@ -33,8 +33,8 @@ __export(MX51_exports, {
|
|
33
33
|
});
|
34
34
|
module.exports = __toCommonJS(MX51_exports);
|
35
35
|
var import_react = require("react");
|
36
|
+
var import_utils = require("@pisell/utils");
|
36
37
|
var import_useLogger = __toESM(require("../../../../../hooks/useLogger"));
|
37
|
-
var import_useEngineContext = __toESM(require("../../../../../hooks/useEngineContext"));
|
38
38
|
var getUuid = () => {
|
39
39
|
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxx".replace(/[xy]/g, (c) => {
|
40
40
|
const r = Math.random() * 16 | 0;
|
@@ -43,10 +43,7 @@ var getUuid = () => {
|
|
43
43
|
});
|
44
44
|
};
|
45
45
|
var MX51 = (props, ref) => {
|
46
|
-
var _a, _b;
|
47
46
|
const logger = (0, import_useLogger.default)();
|
48
|
-
const context = (0, import_useEngineContext.default)();
|
49
|
-
const action = (_b = (_a = context == null ? void 0 : context.appHelper) == null ? void 0 : _a.utils) == null ? void 0 : _b.action;
|
50
47
|
const onOpen = ({ data, payCallback }) => {
|
51
48
|
const { params, mode } = data;
|
52
49
|
const uniquePaymentNumber = getUuid();
|
@@ -65,40 +62,18 @@ var MX51 = (props, ref) => {
|
|
65
62
|
title: "ToB_MX51_onOpen 开始调用",
|
66
63
|
metadata: { params: newData }
|
67
64
|
});
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
isSame = (_res == null ? void 0 : _res.uniquePaymentNumber) === uniquePaymentNumber;
|
77
|
-
if (isSame) {
|
78
|
-
payCallback == null ? void 0 : payCallback(_res);
|
79
|
-
}
|
80
|
-
} else {
|
81
|
-
const _res = res;
|
82
|
-
const newRes = {
|
83
|
-
result: (_res == null ? void 0 : _res.code) == "200" ? true : false,
|
84
|
-
msg: _res == null ? void 0 : _res.msg,
|
85
|
-
amount: (_a2 = _res == null ? void 0 : _res.data) == null ? void 0 : _a2.amount,
|
86
|
-
surcharge: (_b2 = _res == null ? void 0 : _res.data) == null ? void 0 : _b2.surcharge,
|
87
|
-
uniquePaymentNumber: _res == null ? void 0 : _res.uuid
|
88
|
-
};
|
89
|
-
isSame = (_res == null ? void 0 : _res.uuid) === uniquePaymentNumber;
|
90
|
-
if (isSame) {
|
91
|
-
payCallback == null ? void 0 : payCallback(newRes);
|
92
|
-
}
|
65
|
+
(0, import_utils.webPayment)(newData, (res) => {
|
66
|
+
const isSame = (res == null ? void 0 : res.uniquePaymentNumber) === uniquePaymentNumber;
|
67
|
+
logger == null ? void 0 : logger.addLog({
|
68
|
+
type: "info",
|
69
|
+
title: "ToB_MX51_onOpen_callback",
|
70
|
+
metadata: {
|
71
|
+
msg: isSame ? "uniquePaymentNumber一致" : "uniquePaymentNumber不一致",
|
72
|
+
res
|
93
73
|
}
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
metadata: {
|
98
|
-
msg: isSame ? "交易流水号一致" : "交易流水号不一致",
|
99
|
-
res
|
100
|
-
}
|
101
|
-
});
|
74
|
+
});
|
75
|
+
if (isSame) {
|
76
|
+
payCallback == null ? void 0 : payCallback(res);
|
102
77
|
}
|
103
78
|
});
|
104
79
|
};
|
@@ -58,15 +58,3 @@ export interface MX51PayResult {
|
|
58
58
|
surcharge: number;
|
59
59
|
uniquePaymentNumber: string;
|
60
60
|
}
|
61
|
-
/**
|
62
|
-
* @title 原生MX51支付结果
|
63
|
-
*/
|
64
|
-
export interface NativeMX51PayResult {
|
65
|
-
code: string;
|
66
|
-
msg?: string;
|
67
|
-
data: {
|
68
|
-
amount: number;
|
69
|
-
surcharge: number;
|
70
|
-
};
|
71
|
-
uuid: string;
|
72
|
-
}
|
@@ -1,4 +1,3 @@
|
|
1
|
-
/// <reference types="react" />
|
2
1
|
export interface FormState {
|
3
2
|
platform: 'pc' | 'h5' | '' | undefined;
|
4
3
|
order: any;
|
@@ -29,11 +28,4 @@ export interface PayGroup {
|
|
29
28
|
pay_number?: string;
|
30
29
|
_order: any;
|
31
30
|
}
|
32
|
-
export declare const Provider:
|
33
|
-
state: FormState;
|
34
|
-
} & {
|
35
|
-
dispatch: (params: {
|
36
|
-
type: string;
|
37
|
-
payload: any;
|
38
|
-
}) => void;
|
39
|
-
}>;
|
31
|
+
export declare const Provider: any, Context: any;
|
@@ -1,4 +1,3 @@
|
|
1
|
-
/// <reference types="react" />
|
2
1
|
import { CalendarDataItem, ScheduleItem } from "./type";
|
3
2
|
import dayjs from "dayjs";
|
4
3
|
export interface FormState {
|
@@ -69,11 +68,4 @@ export interface FormState {
|
|
69
68
|
};
|
70
69
|
setGlobalState: Function | null;
|
71
70
|
}
|
72
|
-
export declare const Provider:
|
73
|
-
state: FormState;
|
74
|
-
} & {
|
75
|
-
dispatch: (params: {
|
76
|
-
type: string;
|
77
|
-
payload: any;
|
78
|
-
}) => void;
|
79
|
-
}>;
|
71
|
+
export declare const Provider: any, Context: any;
|