@pisell/private-materials 6.3.79 → 6.3.80
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/meta.js +1 -1
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +9 -9
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +9 -9
- package/es/components/appointmentBooking/components/Cart/Item/Total.d.ts +0 -1
- package/es/components/appointmentBooking/components/Cart/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Footer/index.d.ts +0 -1
- package/es/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +0 -1
- package/es/components/booking/forms/footer.d.ts +0 -1
- package/es/components/booking/forms/sendModal/useSendModal.d.ts +0 -1
- package/es/components/booking/hooks/useClearCart.d.ts +0 -1
- package/es/components/booking/info/date/index.d.ts +1 -0
- package/es/components/booking/info/dateRange/index.d.ts +0 -1
- package/es/components/eftpos/const.d.ts +3 -1
- package/es/components/eftpos/const.js +2 -0
- package/es/components/eftpos/device.d.ts +3 -1
- package/es/components/eftpos/device.js +5 -3
- package/es/components/eftpos/index.d.ts +0 -1
- package/es/components/eftpos/index.js +34 -11
- package/es/components/eftpos/index.less +26 -1
- package/es/components/eftpos/locales.d.ts +3 -0
- package/es/components/eftpos/locales.js +3 -0
- package/es/components/eftposPay/aggregatePayment/hooks/usePayment.d.ts +6 -0
- package/es/components/eftposPay/aggregatePayment/hooks/usePayment.js +125 -0
- package/es/components/eftposPay/aggregatePayment/index.d.ts +3 -0
- package/es/components/eftposPay/aggregatePayment/index.js +3 -0
- package/es/components/eftposPay/aggregatePayment/mock.d.ts +495 -0
- package/es/components/eftposPay/aggregatePayment/mock.js +567 -0
- package/es/components/eftposPay/aggregatePayment/service.d.ts +24 -0
- package/es/components/eftposPay/aggregatePayment/service.js +70 -0
- package/es/components/eftposPay/aggregatePayment/types.d.ts +96 -0
- package/es/components/eftposPay/aggregatePayment/types.js +61 -0
- package/es/components/eftposPay/aggregatePayment/utils/logs.d.ts +110 -0
- package/es/components/eftposPay/aggregatePayment/utils/logs.js +385 -0
- package/es/components/eftposPay/aggregatePayment/utils/payment.d.ts +132 -0
- package/es/components/eftposPay/aggregatePayment/utils/payment.js +1127 -0
- package/es/components/eftposPay/amount.d.ts +0 -1
- package/es/components/eftposPay/const.d.ts +6 -1
- package/es/components/eftposPay/const.js +2 -0
- package/es/components/eftposPay/hooks.d.ts +2 -1
- package/es/components/eftposPay/hooks.js +12 -0
- package/es/components/eftposPay/linkly/index.js +1 -0
- package/es/components/eftposPay/manufacturer.d.ts +1 -0
- package/es/components/eftposPay/manufacturer.js +4 -0
- package/es/components/eftposPay/mx51/Action.d.ts +6 -0
- package/es/components/eftposPay/mx51/Action.js +91 -0
- package/es/components/eftposPay/mx51/const.d.ts +5 -0
- package/es/components/eftposPay/mx51/const.js +69 -0
- package/es/components/eftposPay/mx51/index.d.ts +6 -0
- package/es/components/eftposPay/mx51/index.js +362 -0
- package/es/components/eftposPay/mx51/types.d.ts +136 -0
- package/es/components/eftposPay/mx51/types.js +29 -0
- package/es/components/eftposPay/mx51/utils.d.ts +10 -0
- package/es/components/eftposPay/mx51/utils.js +120 -0
- package/es/components/eftposPay/pay.js +7 -2
- package/es/components/eftposPay/store/index.d.ts +1 -1
- package/es/components/eventBooking/components/Provider/Content/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Header/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/SelectHolderModal.d.ts +1 -0
- package/es/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +1 -0
- package/es/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +1 -0
- package/es/components/eventBooking/components/scheduleCalendar/components/ScheduleTimeItem/index.d.ts +0 -1
- package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
- package/es/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +0 -1
- package/es/components/shoppingCart/hooks/useAddService.d.ts +0 -1
- package/es/components/shoppingCart/hooks/useClearCart.d.ts +0 -1
- package/es/plus/saasRegister/components/VertifyEmail.d.ts +0 -1
- package/es/plus/skuOptionsSelection/components/OptionsCard/index.d.ts +0 -1
- package/es/plus/skuOptionsSelection/components/TitleExtra/index.d.ts +0 -1
- package/es/plus/skuOptionsSelection/components/VariantCard/index.d.ts +0 -1
- package/es/plus/walletPassGallery/components/passList/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Cart/Item/Total.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Cart/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Footer/index.d.ts +0 -1
- package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +0 -1
- package/lib/components/booking/forms/footer.d.ts +0 -1
- package/lib/components/booking/forms/sendModal/useSendModal.d.ts +0 -1
- package/lib/components/booking/hooks/useClearCart.d.ts +0 -1
- package/lib/components/booking/info/date/index.d.ts +1 -0
- package/lib/components/booking/info/dateRange/index.d.ts +0 -1
- package/lib/components/eftpos/const.d.ts +3 -1
- package/lib/components/eftpos/const.js +2 -0
- package/lib/components/eftpos/device.d.ts +3 -1
- package/lib/components/eftpos/device.js +3 -3
- package/lib/components/eftpos/index.d.ts +0 -1
- package/lib/components/eftpos/index.js +20 -5
- package/lib/components/eftpos/index.less +26 -1
- package/lib/components/eftpos/locales.d.ts +3 -0
- package/lib/components/eftpos/locales.js +3 -0
- package/lib/components/eftposPay/aggregatePayment/hooks/usePayment.d.ts +6 -0
- package/lib/components/eftposPay/aggregatePayment/hooks/usePayment.js +152 -0
- package/lib/components/eftposPay/aggregatePayment/index.d.ts +3 -0
- package/lib/components/eftposPay/aggregatePayment/index.js +32 -0
- package/lib/components/eftposPay/aggregatePayment/mock.d.ts +495 -0
- package/lib/components/eftposPay/aggregatePayment/mock.js +679 -0
- package/lib/components/eftposPay/aggregatePayment/service.d.ts +24 -0
- package/lib/components/eftposPay/aggregatePayment/service.js +81 -0
- package/lib/components/eftposPay/aggregatePayment/types.d.ts +96 -0
- package/lib/components/eftposPay/aggregatePayment/types.js +74 -0
- package/lib/components/eftposPay/aggregatePayment/utils/logs.d.ts +110 -0
- package/lib/components/eftposPay/aggregatePayment/utils/logs.js +302 -0
- package/lib/components/eftposPay/aggregatePayment/utils/payment.d.ts +132 -0
- package/lib/components/eftposPay/aggregatePayment/utils/payment.js +746 -0
- package/lib/components/eftposPay/amount.d.ts +0 -1
- package/lib/components/eftposPay/const.d.ts +6 -1
- package/lib/components/eftposPay/const.js +2 -0
- package/lib/components/eftposPay/hooks.d.ts +2 -1
- package/lib/components/eftposPay/hooks.js +16 -0
- package/lib/components/eftposPay/linkly/index.js +1 -0
- package/lib/components/eftposPay/manufacturer.d.ts +1 -0
- package/lib/components/eftposPay/manufacturer.js +6 -0
- package/lib/components/eftposPay/mx51/Action.d.ts +6 -0
- package/lib/components/eftposPay/mx51/Action.js +127 -0
- package/lib/components/eftposPay/mx51/const.d.ts +5 -0
- package/lib/components/eftposPay/mx51/const.js +85 -0
- package/lib/components/eftposPay/mx51/index.d.ts +6 -0
- package/lib/components/eftposPay/mx51/index.js +330 -0
- package/lib/components/eftposPay/mx51/types.d.ts +136 -0
- package/lib/components/eftposPay/mx51/types.js +39 -0
- package/lib/components/eftposPay/mx51/utils.d.ts +10 -0
- package/lib/components/eftposPay/mx51/utils.js +114 -0
- package/lib/components/eftposPay/pay.js +4 -2
- package/lib/components/eftposPay/store/index.d.ts +1 -1
- package/lib/components/eventBooking/components/Provider/Content/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Header/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/SelectHolderModal.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +1 -0
- package/lib/components/eventBooking/components/scheduleCalendar/components/ScheduleTimeItem/index.d.ts +0 -1
- package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
- package/lib/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +0 -1
- package/lib/components/shoppingCart/hooks/useAddService.d.ts +0 -1
- package/lib/components/shoppingCart/hooks/useClearCart.d.ts +0 -1
- package/lib/plus/saasRegister/components/VertifyEmail.d.ts +0 -1
- package/lib/plus/skuOptionsSelection/components/OptionsCard/index.d.ts +0 -1
- package/lib/plus/skuOptionsSelection/components/TitleExtra/index.d.ts +0 -1
- package/lib/plus/skuOptionsSelection/components/VariantCard/index.d.ts +0 -1
- package/lib/plus/walletPassGallery/components/passList/index.d.ts +0 -1
- package/lowcode/eco-cup-list/meta.ts +63 -0
- package/lowcode/eco-customer-list/meta.ts +63 -0
- package/package.json +1 -1
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { EPaymentStatus } from '../aggregatePayment/types';
|
|
2
|
+
/** 元素类型定义 */
|
|
3
|
+
export interface ElementType {
|
|
4
|
+
label: string;
|
|
5
|
+
key: string;
|
|
6
|
+
}
|
|
7
|
+
/** 布局类型定义 */
|
|
8
|
+
export interface LayoutType {
|
|
9
|
+
type: string;
|
|
10
|
+
elements: ElementType[];
|
|
11
|
+
}
|
|
12
|
+
/** 元素属性定义 */
|
|
13
|
+
export interface ElementProperty {
|
|
14
|
+
type: 'button' | 'text' | 'image' | 'input';
|
|
15
|
+
submit_url: string;
|
|
16
|
+
action: string | null;
|
|
17
|
+
text?: string | null;
|
|
18
|
+
name?: string | null;
|
|
19
|
+
data?: string | null;
|
|
20
|
+
encoding?: string | null;
|
|
21
|
+
}
|
|
22
|
+
/** Action Form 定义 */
|
|
23
|
+
export interface ActionFormType {
|
|
24
|
+
layout: LayoutType[];
|
|
25
|
+
properties: {
|
|
26
|
+
[key: string]: ElementProperty;
|
|
27
|
+
};
|
|
28
|
+
details: {
|
|
29
|
+
[key: string]: string;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/** POS 指令定义 */
|
|
33
|
+
export interface PosInstructions {
|
|
34
|
+
auto_actions: any;
|
|
35
|
+
action_form: ActionFormType | null;
|
|
36
|
+
}
|
|
37
|
+
/** MX51 参数定义 */
|
|
38
|
+
export interface MX51Params {
|
|
39
|
+
id: string;
|
|
40
|
+
version: number;
|
|
41
|
+
status: string;
|
|
42
|
+
message: string;
|
|
43
|
+
merchant_receipt: string | null;
|
|
44
|
+
customer_receipt: string | null;
|
|
45
|
+
result_amounts: any;
|
|
46
|
+
result_financial_status: string | null;
|
|
47
|
+
pos_instructions: PosInstructions | null;
|
|
48
|
+
}
|
|
49
|
+
/** 解析后的按钮配置 */
|
|
50
|
+
export interface ParsedElement {
|
|
51
|
+
/** 元素键 */
|
|
52
|
+
key: string;
|
|
53
|
+
/** 元素标签 */
|
|
54
|
+
label: string;
|
|
55
|
+
/** 提交URL */
|
|
56
|
+
submitUrl: string;
|
|
57
|
+
/** 按钮动作 */
|
|
58
|
+
action: string | null;
|
|
59
|
+
/** 元素类型 */
|
|
60
|
+
type: 'button' | 'text';
|
|
61
|
+
/** 文本信息 */
|
|
62
|
+
text?: string | null;
|
|
63
|
+
/** 小票信息 */
|
|
64
|
+
receipt?: string | null;
|
|
65
|
+
/** 额外信息 */
|
|
66
|
+
_extra?: {
|
|
67
|
+
/** 商户收据 */
|
|
68
|
+
merchantReceipt?: string | null;
|
|
69
|
+
/** 客户收据 */
|
|
70
|
+
customerReceipt?: string | null;
|
|
71
|
+
/** 支付状态 */
|
|
72
|
+
paymentStatus: EPaymentStatus;
|
|
73
|
+
/** 接口返回的原始数据 */
|
|
74
|
+
response: any;
|
|
75
|
+
};
|
|
76
|
+
/** 图片信息 */
|
|
77
|
+
image?: {
|
|
78
|
+
name?: string | null;
|
|
79
|
+
data?: string | null;
|
|
80
|
+
encoding?: string | null;
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
/** 解析后的布局配置 */
|
|
84
|
+
export interface ParsedLayout {
|
|
85
|
+
/** 布局类型,如 horizontal_layout */
|
|
86
|
+
layoutType: string;
|
|
87
|
+
/** 该布局中的按钮列表 */
|
|
88
|
+
elements: ParsedElement[];
|
|
89
|
+
}
|
|
90
|
+
/** 解析后的结果 */
|
|
91
|
+
export interface ParsedMX51Result {
|
|
92
|
+
/** 交易ID */
|
|
93
|
+
transactionId: string;
|
|
94
|
+
/** 版本号 */
|
|
95
|
+
version: number;
|
|
96
|
+
/** 状态 */
|
|
97
|
+
status: string;
|
|
98
|
+
/** 提示信息 */
|
|
99
|
+
message: string;
|
|
100
|
+
/** 商户收据 */
|
|
101
|
+
merchantReceipt: string | null;
|
|
102
|
+
/** 客户收据 */
|
|
103
|
+
customerReceipt: string | null;
|
|
104
|
+
/** 结果金额 */
|
|
105
|
+
resultAmounts: any;
|
|
106
|
+
/** 结果财务状态 */
|
|
107
|
+
resultFinancialStatus: string | null;
|
|
108
|
+
/** 布局列表,每个布局包含其类型和按钮 */
|
|
109
|
+
layouts: ParsedLayout[];
|
|
110
|
+
/** 详情信息 */
|
|
111
|
+
details: {
|
|
112
|
+
[key: string]: string;
|
|
113
|
+
};
|
|
114
|
+
/** 详情信息 text */
|
|
115
|
+
detailsText: string;
|
|
116
|
+
/** 自动操作 */
|
|
117
|
+
autoAction: Array<string> | null;
|
|
118
|
+
}
|
|
119
|
+
export declare enum EButtonKeyType {
|
|
120
|
+
/** 取消交易 */
|
|
121
|
+
CancelTransaction = "cancel_transaction",
|
|
122
|
+
/** 交易完成 */
|
|
123
|
+
TransactionComplete = "transaction_complete",
|
|
124
|
+
/** 重试交易 */
|
|
125
|
+
RetryTransaction = "retry_transaction",
|
|
126
|
+
/** 打印商户收据 */
|
|
127
|
+
PrintMerchantReceipt = "print_merchant_receipt",
|
|
128
|
+
/** 打印客户收据 */
|
|
129
|
+
PrintCustomerReceipt = "print_customer_receipt",
|
|
130
|
+
/** 批准签名 */
|
|
131
|
+
ApproveSignature = "approve_signature",
|
|
132
|
+
/** 拒绝签名 */
|
|
133
|
+
DeclineSignature = "decline_signature",
|
|
134
|
+
/** 提交到API */
|
|
135
|
+
SubmitToAPI = "submit_to_api"
|
|
136
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** 元素类型定义 */
|
|
2
|
+
|
|
3
|
+
/** 布局类型定义 */
|
|
4
|
+
|
|
5
|
+
/** 元素属性定义 */
|
|
6
|
+
|
|
7
|
+
/** Action Form 定义 */
|
|
8
|
+
|
|
9
|
+
/** POS 指令定义 */
|
|
10
|
+
|
|
11
|
+
/** MX51 参数定义 */
|
|
12
|
+
|
|
13
|
+
/** 解析后的按钮配置 */
|
|
14
|
+
|
|
15
|
+
/** 解析后的布局配置 */
|
|
16
|
+
|
|
17
|
+
/** 解析后的结果 */
|
|
18
|
+
|
|
19
|
+
export var EButtonKeyType = /*#__PURE__*/function (EButtonKeyType) {
|
|
20
|
+
EButtonKeyType["CancelTransaction"] = "cancel_transaction";
|
|
21
|
+
EButtonKeyType["TransactionComplete"] = "transaction_complete";
|
|
22
|
+
EButtonKeyType["RetryTransaction"] = "retry_transaction";
|
|
23
|
+
EButtonKeyType["PrintMerchantReceipt"] = "print_merchant_receipt";
|
|
24
|
+
EButtonKeyType["PrintCustomerReceipt"] = "print_customer_receipt";
|
|
25
|
+
EButtonKeyType["ApproveSignature"] = "approve_signature";
|
|
26
|
+
EButtonKeyType["DeclineSignature"] = "decline_signature";
|
|
27
|
+
EButtonKeyType["SubmitToAPI"] = "submit_to_api";
|
|
28
|
+
return EButtonKeyType;
|
|
29
|
+
}({});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { EPaymentStatus } from '../aggregatePayment/types';
|
|
2
|
+
import { type MX51Params, type ParsedMX51Result } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* 解析MX51参数
|
|
5
|
+
* @param params 接口返回的原始参数
|
|
6
|
+
* @param status 支付状态
|
|
7
|
+
* @param data 接口返回的数据
|
|
8
|
+
* @returns 解析后的结果对象
|
|
9
|
+
*/
|
|
10
|
+
export declare const parseMX51Params: (params: MX51Params, paymentStatus: EPaymentStatus, data: any) => ParsedMX51Result | null;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
import { EButtonKeyType } from "./types";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* 解析MX51参数
|
|
11
|
+
* @param params 接口返回的原始参数
|
|
12
|
+
* @param status 支付状态
|
|
13
|
+
* @param data 接口返回的数据
|
|
14
|
+
* @returns 解析后的结果对象
|
|
15
|
+
*/
|
|
16
|
+
export var parseMX51Params = function parseMX51Params(params, paymentStatus, data) {
|
|
17
|
+
if (!params) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
// 默认值
|
|
21
|
+
var result = {
|
|
22
|
+
transactionId: (params === null || params === void 0 ? void 0 : params.id) || '',
|
|
23
|
+
status: (params === null || params === void 0 ? void 0 : params.status) || '',
|
|
24
|
+
version: (params === null || params === void 0 ? void 0 : params.version) || 0,
|
|
25
|
+
message: (params === null || params === void 0 ? void 0 : params.message) || '',
|
|
26
|
+
merchantReceipt: params === null || params === void 0 ? void 0 : params.merchant_receipt,
|
|
27
|
+
customerReceipt: params === null || params === void 0 ? void 0 : params.customer_receipt,
|
|
28
|
+
resultAmounts: params === null || params === void 0 ? void 0 : params.result_amounts,
|
|
29
|
+
resultFinancialStatus: params === null || params === void 0 ? void 0 : params.result_financial_status,
|
|
30
|
+
layouts: [],
|
|
31
|
+
details: {},
|
|
32
|
+
detailsText: '',
|
|
33
|
+
autoAction: []
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
// 检查是否存在 pos_instructions
|
|
37
|
+
if (!(params !== null && params !== void 0 && params.pos_instructions)) {
|
|
38
|
+
return result;
|
|
39
|
+
}
|
|
40
|
+
var posInstructions = (params === null || params === void 0 ? void 0 : params.pos_instructions) || {};
|
|
41
|
+
|
|
42
|
+
// 检查是否有自动操作
|
|
43
|
+
result.autoAction = (posInstructions === null || posInstructions === void 0 ? void 0 : posInstructions.auto_actions) || [];
|
|
44
|
+
|
|
45
|
+
// 检查是否存在 action_form
|
|
46
|
+
if (!(posInstructions !== null && posInstructions !== void 0 && posInstructions.action_form)) {
|
|
47
|
+
return result;
|
|
48
|
+
}
|
|
49
|
+
var actionForm = (posInstructions === null || posInstructions === void 0 ? void 0 : posInstructions.action_form) || {};
|
|
50
|
+
|
|
51
|
+
// 解析详情信息
|
|
52
|
+
if (actionForm !== null && actionForm !== void 0 && actionForm.details) {
|
|
53
|
+
result.details = _objectSpread({}, (actionForm === null || actionForm === void 0 ? void 0 : actionForm.details) || {});
|
|
54
|
+
var detailsTextArr = [];
|
|
55
|
+
Object.keys((actionForm === null || actionForm === void 0 ? void 0 : actionForm.details) || {}).forEach(function (key) {
|
|
56
|
+
var _actionForm$details;
|
|
57
|
+
detailsTextArr.push("".concat(key, ": ").concat((actionForm === null || actionForm === void 0 || (_actionForm$details = actionForm.details) === null || _actionForm$details === void 0 ? void 0 : _actionForm$details[key]) || ''));
|
|
58
|
+
});
|
|
59
|
+
result.detailsText = (detailsTextArr === null || detailsTextArr === void 0 ? void 0 : detailsTextArr.join(', ')) || '';
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// 解析布局和按钮
|
|
63
|
+
if (actionForm !== null && actionForm !== void 0 && actionForm.layout && Array.isArray(actionForm === null || actionForm === void 0 ? void 0 : actionForm.layout)) {
|
|
64
|
+
var layouts = [];
|
|
65
|
+
|
|
66
|
+
// 遍历所有布局
|
|
67
|
+
actionForm.layout.forEach(function (layout) {
|
|
68
|
+
var elements = [];
|
|
69
|
+
if (layout !== null && layout !== void 0 && layout.elements && Array.isArray(layout === null || layout === void 0 ? void 0 : layout.elements)) {
|
|
70
|
+
// 遍历布局中的所有元素
|
|
71
|
+
layout.elements.forEach(function (element) {
|
|
72
|
+
var _actionForm$propertie;
|
|
73
|
+
var elementKey = (element === null || element === void 0 ? void 0 : element.key) || '';
|
|
74
|
+
var elementLabel = (element === null || element === void 0 ? void 0 : element.label) || '';
|
|
75
|
+
|
|
76
|
+
// 从 properties 中获取对应的属性
|
|
77
|
+
var property = (actionForm === null || actionForm === void 0 || (_actionForm$propertie = actionForm.properties) === null || _actionForm$propertie === void 0 ? void 0 : _actionForm$propertie[elementKey]) || {};
|
|
78
|
+
if (property) {
|
|
79
|
+
var _element = {
|
|
80
|
+
_extra: {
|
|
81
|
+
merchantReceipt: params === null || params === void 0 ? void 0 : params.merchant_receipt,
|
|
82
|
+
customerReceipt: params === null || params === void 0 ? void 0 : params.customer_receipt,
|
|
83
|
+
paymentStatus: paymentStatus,
|
|
84
|
+
response: data
|
|
85
|
+
},
|
|
86
|
+
key: elementKey,
|
|
87
|
+
label: elementLabel,
|
|
88
|
+
submitUrl: (property === null || property === void 0 ? void 0 : property.submit_url) || '',
|
|
89
|
+
action: property === null || property === void 0 ? void 0 : property.action,
|
|
90
|
+
type: (property === null || property === void 0 ? void 0 : property.type) || 'button',
|
|
91
|
+
text: property === null || property === void 0 ? void 0 : property.text,
|
|
92
|
+
// 如果是打印收据按钮,需要关联对应的小票信息
|
|
93
|
+
receipt: elementKey === EButtonKeyType.PrintMerchantReceipt ? result === null || result === void 0 ? void 0 : result.merchantReceipt : elementKey === EButtonKeyType.PrintCustomerReceipt ? result === null || result === void 0 ? void 0 : result.customerReceipt : null
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
// 只在 type 为 'image' 时添加 image 字段
|
|
97
|
+
if ((property === null || property === void 0 ? void 0 : property.type) === 'image') {
|
|
98
|
+
_element.image = {
|
|
99
|
+
name: (property === null || property === void 0 ? void 0 : property.name) || '',
|
|
100
|
+
data: (property === null || property === void 0 ? void 0 : property.data) || '',
|
|
101
|
+
encoding: (property === null || property === void 0 ? void 0 : property.encoding) || ''
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
elements.push(_element);
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// 只添加有元素的布局
|
|
110
|
+
if (elements.length > 0) {
|
|
111
|
+
layouts.push({
|
|
112
|
+
layoutType: layout.type || 'unknown',
|
|
113
|
+
elements: elements
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
result.layouts = layouts;
|
|
118
|
+
}
|
|
119
|
+
return result;
|
|
120
|
+
};
|
|
@@ -10,7 +10,7 @@ import { getPayParams } from "./helper";
|
|
|
10
10
|
import Manual from "./component/manual";
|
|
11
11
|
import Signature from "./component/signature";
|
|
12
12
|
import { StatusEnum, PayRouteEnum, ClientEnum } from "./const";
|
|
13
|
-
import { Payo, Windcave, Tyro, Linkly } from "./manufacturer";
|
|
13
|
+
import { Payo, Windcave, Tyro, Linkly, Mx51 } from "./manufacturer";
|
|
14
14
|
import { useContextData, useDispatch, updateStatus, backUpProduction, updateComponent, backUpFree, updateState } from "./store";
|
|
15
15
|
import "./index.less";
|
|
16
16
|
|
|
@@ -151,12 +151,14 @@ var Pay = function Pay(_ref) {
|
|
|
151
151
|
};
|
|
152
152
|
}, []);
|
|
153
153
|
console.log('data =>>>>>> ', data);
|
|
154
|
+
// 定制逻辑:MX51 状态为 Question 时,不展示 Header 组件
|
|
155
|
+
var isHideHeader = data.eftpos === 'mx51' && data.status === StatusEnum.Question;
|
|
154
156
|
return /*#__PURE__*/React.createElement(React.Fragment, null, data.render ? /*#__PURE__*/React.createElement("div", {
|
|
155
157
|
className: "pisell-lowcode__eft-pay-box ".concat(className),
|
|
156
158
|
style: data.type === 'step' ? {} : {
|
|
157
159
|
display: 'none'
|
|
158
160
|
}
|
|
159
|
-
}, /*#__PURE__*/React.createElement(Header, {
|
|
161
|
+
}, isHideHeader ? null : /*#__PURE__*/React.createElement(Header, {
|
|
160
162
|
status: data.status,
|
|
161
163
|
title: data.title,
|
|
162
164
|
subTitle: data.subTitle
|
|
@@ -182,6 +184,9 @@ var Pay = function Pay(_ref) {
|
|
|
182
184
|
key: data.key,
|
|
183
185
|
api: api,
|
|
184
186
|
onChange: onChange
|
|
187
|
+
}) : null, data.eftpos === 'mx51' ? /*#__PURE__*/React.createElement(Mx51, {
|
|
188
|
+
key: data.key,
|
|
189
|
+
onChange: onChange
|
|
185
190
|
}) : null) : null, data.type === PayRouteEnum.Unset && Comm ? /*#__PURE__*/React.createElement(Comm, {
|
|
186
191
|
onChange: onChange,
|
|
187
192
|
api: api,
|
|
@@ -297,7 +297,7 @@ export declare const backUpFree: (payload: Partial<State>) => {
|
|
|
297
297
|
amount?: string | number | undefined;
|
|
298
298
|
mode?: "refund" | "pay" | "fullPay" | "query" | undefined;
|
|
299
299
|
order_id?: string | number | undefined;
|
|
300
|
-
eftpos?: "stripe" | "payo" | "tyro" | "windcave" | "linkly" | undefined;
|
|
300
|
+
eftpos?: "stripe" | "payo" | "tyro" | "windcave" | "linkly" | "mx51" | undefined;
|
|
301
301
|
action?: "amount" | "pay" | "deviceList" | undefined;
|
|
302
302
|
key?: number | undefined;
|
|
303
303
|
step?: number | undefined;
|
|
@@ -31,6 +31,8 @@ var Eftpos = /* @__PURE__ */ ((Eftpos2) => {
|
|
|
31
31
|
Eftpos2["Tyro"] = "tyro";
|
|
32
32
|
Eftpos2["Windcave"] = "windcave";
|
|
33
33
|
Eftpos2["Stripe"] = "stripe";
|
|
34
|
+
Eftpos2["Linkly"] = "linkly";
|
|
35
|
+
Eftpos2["MX51"] = "mx51";
|
|
34
36
|
return Eftpos2;
|
|
35
37
|
})(Eftpos || {});
|
|
36
38
|
var DeviceEnum = /* @__PURE__ */ ((DeviceEnum2) => {
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { DeviceProp } from './const';
|
|
2
|
+
import { DeviceProp, Eftpos } from './const';
|
|
3
3
|
interface DeviceProps {
|
|
4
4
|
formItemList: any[];
|
|
5
5
|
onSave: (device: DeviceProp) => void;
|
|
6
6
|
children?: React.ReactNode;
|
|
7
|
+
type?: Eftpos;
|
|
8
|
+
status?: 'add' | 'edit' | 'repair';
|
|
7
9
|
}
|
|
8
10
|
declare const Device: (props: DeviceProps) => JSX.Element;
|
|
9
11
|
export default Device;
|
|
@@ -40,7 +40,7 @@ var import_form = __toESM(require("./form"));
|
|
|
40
40
|
var Device = (props) => {
|
|
41
41
|
const { onSave, children, formItemList } = props;
|
|
42
42
|
const initialValues = (0, import_const.getDefaultValue)(formItemList);
|
|
43
|
-
return /* @__PURE__ */ import_react.default.createElement(
|
|
43
|
+
return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, (props == null ? void 0 : props.type) === import_const.Eftpos.MX51 && /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__pos-device-pair-text" }, "Pair your POS with an mx51 terminal using the pairing code shown on the terminal."), /* @__PURE__ */ import_react.default.createElement(
|
|
44
44
|
import_antd.Form,
|
|
45
45
|
{
|
|
46
46
|
layout: "vertical",
|
|
@@ -49,7 +49,7 @@ var Device = (props) => {
|
|
|
49
49
|
className: "pisell-lowcode__pos-device"
|
|
50
50
|
},
|
|
51
51
|
/* @__PURE__ */ import_react.default.createElement("div", { style: { flex: 1, overflow: "auto", padding: "0 0 60px 0" } }, /* @__PURE__ */ import_react.default.createElement(import_form.default, { formItemList }), children),
|
|
52
|
-
/* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { className: "pisell-lowcode__pos-device-btn" }, /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { htmlType: "submit", block: true, style: { height: "48px" } }, import_utils.locales.getText("page.eftpos.text.save")))
|
|
53
|
-
);
|
|
52
|
+
/* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { className: "pisell-lowcode__pos-device-btn" }, /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { htmlType: "submit", block: true, style: { height: "48px" } }, (props == null ? void 0 : props.status) === "edit" ? import_utils.locales.getText("page.eftpos.text.save") : import_utils.locales.getText("page.eftpos.text.pair")))
|
|
53
|
+
));
|
|
54
54
|
};
|
|
55
55
|
var device_default = Device;
|
|
@@ -198,10 +198,23 @@ var eftpos_default = (props) => {
|
|
|
198
198
|
const onSave = async (device) => {
|
|
199
199
|
console.log("device = ", device);
|
|
200
200
|
const update = async () => {
|
|
201
|
-
|
|
201
|
+
var _a, _b;
|
|
202
|
+
try {
|
|
203
|
+
await onEdit({ ...device, type }, status || "add");
|
|
204
|
+
if (type === import_const.Eftpos.MX51) {
|
|
205
|
+
messageApi.open({
|
|
206
|
+
type: "success",
|
|
207
|
+
style: {
|
|
208
|
+
zIndex: (zIndex || 9999) + 1
|
|
209
|
+
},
|
|
210
|
+
content: /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__pos_message-custom-content_mx51" }, /* @__PURE__ */ import_react.default.createElement("span", null, "Terminal paired successfully."), /* @__PURE__ */ import_react.default.createElement("span", null, /* @__PURE__ */ import_react.default.createElement("span", null, "Pairing Name: ", ((_a = device == null ? void 0 : device.connection) == null ? void 0 : _a.pairing_nickname) || "-"), /* @__PURE__ */ import_react.default.createElement("span", null, "Pairing ID: ", ((_b = device == null ? void 0 : device.connection) == null ? void 0 : _b.pairing_code) || "-")))
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
} catch (error) {
|
|
214
|
+
console.error("onSave error =>", error);
|
|
215
|
+
} finally {
|
|
202
216
|
setLoading(false);
|
|
203
|
-
}
|
|
204
|
-
setLoading(false);
|
|
217
|
+
}
|
|
205
218
|
await tableRef.current.loadData();
|
|
206
219
|
setPage("list");
|
|
207
220
|
};
|
|
@@ -412,7 +425,7 @@ var eftpos_default = (props) => {
|
|
|
412
425
|
{
|
|
413
426
|
open: page === "edit",
|
|
414
427
|
onClose: onBack,
|
|
415
|
-
title: import_utils.locales.getText("page.eftpos.text.device.add")(status, name),
|
|
428
|
+
title: type === import_const.Eftpos.MX51 ? "Simple Cloud Integration" : import_utils.locales.getText("page.eftpos.text.device.add")(status, name),
|
|
416
429
|
titleNoWrap: true,
|
|
417
430
|
zIndex: zIndex || 9999,
|
|
418
431
|
destroyOnClose: true,
|
|
@@ -430,7 +443,9 @@ var eftpos_default = (props) => {
|
|
|
430
443
|
{
|
|
431
444
|
formItemList: deviceItemList,
|
|
432
445
|
onSave,
|
|
433
|
-
key: `device${type}
|
|
446
|
+
key: `device${type}`,
|
|
447
|
+
type,
|
|
448
|
+
status
|
|
434
449
|
},
|
|
435
450
|
pairStatus ? /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { label: "Status" }, /* @__PURE__ */ import_react.default.createElement(import_antd.Input, { value: pairStatus, disabled: true })) : null,
|
|
436
451
|
pairMessage ? /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { label: "Message" }, /* @__PURE__ */ import_react.default.createElement(import_antd.Input, { value: pairMessage, disabled: true })) : null
|