@pisell/private-materials 6.8.76 → 6.8.78
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 +7 -7
- 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 +8 -8
- package/es/components/checkout/PaymentModal.js +32 -8
- package/es/components/checkout/components/PaymentOptionsModule/index.js +1 -1
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/app.d.ts +1 -1
- package/es/components/eftposPay/app.js +0 -5
- package/es/components/eftposPay/component/fail/failCustom.js +12 -16
- package/es/components/eftposPay/component/fail/index.js +5 -12
- package/es/components/eftposPay/const.d.ts +1 -6
- package/es/components/eftposPay/const.js +0 -3
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +2 -3
- package/es/components/eftposPay/hooks.js +0 -12
- package/es/components/eftposPay/index.js +1 -5
- package/es/components/eftposPay/locales.d.ts +0 -36
- package/es/components/eftposPay/locales.js +3 -42
- package/es/components/eftposPay/manufacturer.d.ts +0 -1
- package/es/components/eftposPay/manufacturer.js +0 -5
- package/es/components/eftposPay/pay.js +2 -6
- package/es/components/eftposPay/store/index.d.ts +5 -12
- package/es/components/kioskSkuDetail/index.d.ts +0 -3
- package/es/components/kioskSkuDetail/index.js +173 -266
- package/es/components/kioskSkuDetail/index.less +7 -49
- package/es/components/kioskSkuDetail/locales.d.ts +0 -6
- package/es/components/kioskSkuDetail/locales.js +3 -9
- package/es/components/pay/toB/components/EFTPOS/index.js +1 -8
- package/es/components/pay/toB/types/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentList/serve.js +0 -14
- package/es/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +6 -7
- package/es/plus/skuOptionsSelection/components/VariantCard/index.js +1 -1
- package/es/plus/skuOptionsSelection/locales.d.ts +0 -3
- package/es/plus/skuOptionsSelection/locales.js +0 -3
- package/es/pro/Login2.0/components/LoginCodeInput.js +3 -36
- package/es/pro/Login2.0/steps/CodeInput.js +7 -37
- package/lib/components/checkout/PaymentModal.js +41 -24
- package/lib/components/checkout/components/PaymentOptionsModule/index.js +1 -2
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/app.d.ts +1 -1
- package/lib/components/eftposPay/app.js +0 -5
- package/lib/components/eftposPay/component/fail/failCustom.js +9 -15
- package/lib/components/eftposPay/component/fail/index.js +1 -4
- package/lib/components/eftposPay/const.d.ts +1 -6
- package/lib/components/eftposPay/const.js +0 -3
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +2 -3
- package/lib/components/eftposPay/hooks.js +0 -16
- package/lib/components/eftposPay/index.js +1 -5
- package/lib/components/eftposPay/locales.d.ts +0 -36
- package/lib/components/eftposPay/locales.js +3 -42
- package/lib/components/eftposPay/manufacturer.d.ts +0 -1
- package/lib/components/eftposPay/manufacturer.js +0 -7
- package/lib/components/eftposPay/pay.js +2 -3
- package/lib/components/eftposPay/store/index.d.ts +5 -12
- package/lib/components/kioskSkuDetail/index.d.ts +0 -3
- package/lib/components/kioskSkuDetail/index.js +113 -180
- package/lib/components/kioskSkuDetail/index.less +7 -49
- package/lib/components/kioskSkuDetail/locales.d.ts +0 -6
- package/lib/components/kioskSkuDetail/locales.js +3 -9
- package/lib/components/pay/toB/components/EFTPOS/index.js +1 -8
- package/lib/components/pay/toB/types/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentList/serve.js +0 -15
- package/lib/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +6 -7
- package/lib/plus/skuOptionsSelection/components/VariantCard/index.js +0 -2
- package/lib/plus/skuOptionsSelection/locales.d.ts +0 -3
- package/lib/plus/skuOptionsSelection/locales.js +0 -3
- package/lib/pro/Login2.0/components/LoginCodeInput.js +4 -26
- package/lib/pro/Login2.0/steps/CodeInput.js +5 -27
- package/lowcode/kiosk-sku-detail/meta.ts +94 -229
- package/package.json +8 -2
- package/es/components/eftposPay/aggregatePayment/hooks/useMicropay.d.ts +0 -7
- package/es/components/eftposPay/aggregatePayment/hooks/useMicropay.js +0 -120
- package/es/components/eftposPay/aggregatePayment/index.d.ts +0 -3
- package/es/components/eftposPay/aggregatePayment/index.js +0 -3
- package/es/components/eftposPay/aggregatePayment/service.d.ts +0 -24
- package/es/components/eftposPay/aggregatePayment/service.js +0 -69
- package/es/components/eftposPay/aggregatePayment/types.d.ts +0 -106
- package/es/components/eftposPay/aggregatePayment/types.js +0 -65
- package/es/components/eftposPay/aggregatePayment/utils/logs.d.ts +0 -110
- package/es/components/eftposPay/aggregatePayment/utils/logs.js +0 -371
- package/es/components/eftposPay/aggregatePayment/utils/payment.d.ts +0 -139
- package/es/components/eftposPay/aggregatePayment/utils/payment.js +0 -1138
- package/es/components/eftposPay/huifu/Action.d.ts +0 -8
- package/es/components/eftposPay/huifu/Action.js +0 -146
- package/es/components/eftposPay/huifu/const.d.ts +0 -5
- package/es/components/eftposPay/huifu/const.js +0 -70
- package/es/components/eftposPay/huifu/hooks.d.ts +0 -25
- package/es/components/eftposPay/huifu/hooks.js +0 -184
- package/es/components/eftposPay/huifu/index.d.ts +0 -5
- package/es/components/eftposPay/huifu/index.js +0 -196
- package/es/components/eftposPay/huifu/index.less +0 -180
- package/es/components/eftposPay/huifu/types.d.ts +0 -14
- package/es/components/eftposPay/huifu/types.js +0 -1
- package/es/pro/skuDetailModal/index.d.ts +0 -5
- package/lib/components/eftposPay/aggregatePayment/hooks/useMicropay.d.ts +0 -7
- package/lib/components/eftposPay/aggregatePayment/hooks/useMicropay.js +0 -133
- package/lib/components/eftposPay/aggregatePayment/index.d.ts +0 -3
- package/lib/components/eftposPay/aggregatePayment/index.js +0 -42
- package/lib/components/eftposPay/aggregatePayment/service.d.ts +0 -24
- package/lib/components/eftposPay/aggregatePayment/service.js +0 -81
- package/lib/components/eftposPay/aggregatePayment/types.d.ts +0 -106
- package/lib/components/eftposPay/aggregatePayment/types.js +0 -74
- package/lib/components/eftposPay/aggregatePayment/utils/logs.d.ts +0 -110
- package/lib/components/eftposPay/aggregatePayment/utils/logs.js +0 -294
- package/lib/components/eftposPay/aggregatePayment/utils/payment.d.ts +0 -139
- package/lib/components/eftposPay/aggregatePayment/utils/payment.js +0 -752
- package/lib/components/eftposPay/huifu/Action.d.ts +0 -8
- package/lib/components/eftposPay/huifu/Action.js +0 -174
- package/lib/components/eftposPay/huifu/const.d.ts +0 -5
- package/lib/components/eftposPay/huifu/const.js +0 -86
- package/lib/components/eftposPay/huifu/hooks.d.ts +0 -25
- package/lib/components/eftposPay/huifu/hooks.js +0 -186
- package/lib/components/eftposPay/huifu/index.d.ts +0 -5
- package/lib/components/eftposPay/huifu/index.js +0 -200
- package/lib/components/eftposPay/huifu/index.less +0 -180
- package/lib/components/eftposPay/huifu/types.d.ts +0 -14
- package/lib/components/eftposPay/huifu/types.js +0 -17
- package/lib/pro/skuDetailModal/index.d.ts +0 -5
|
@@ -1,261 +1,126 @@
|
|
|
1
1
|
|
|
2
|
-
import {
|
|
2
|
+
import type { IPublicTypeComponentMetadata, IPublicTypeSnippet } from '@alilc/lowcode-types';
|
|
3
3
|
|
|
4
|
-
const KioskSkuDetailMeta:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
4
|
+
const KioskSkuDetailMeta: IPublicTypeComponentMetadata = {
|
|
5
|
+
componentName: 'KioskSkuDetail',
|
|
6
|
+
title: 'KioskSkuDetail',
|
|
7
|
+
docUrl: '',
|
|
8
|
+
screenshot: '',
|
|
9
|
+
devMode: 'proCode',
|
|
10
|
+
npm: {
|
|
11
|
+
package: '@pisell/private-materials',
|
|
12
|
+
version: '1.0.4',
|
|
13
|
+
exportName: 'KioskSkuDetail',
|
|
14
|
+
main: 'src/index.ts',
|
|
15
|
+
destructuring: true,
|
|
16
|
+
subName: '',
|
|
17
17
|
},
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
configure: {
|
|
19
|
+
props: [
|
|
20
20
|
{
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
name: 'productId',
|
|
22
|
+
title: {
|
|
23
|
+
label: {
|
|
24
|
+
type: 'i18n',
|
|
25
|
+
'en-US': 'productId',
|
|
26
|
+
'zh-CN': '商品ID',
|
|
26
27
|
},
|
|
27
|
-
"tip": "productId | 商品 id(可选:目前默认从 URL 读取,props 仅作为兜底以兼容老用法)"
|
|
28
28
|
},
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
{
|
|
36
|
-
"componentName": "ObjectSetter",
|
|
37
|
-
"props": {
|
|
38
|
-
"config": {
|
|
39
|
-
"extraSetter": {
|
|
40
|
-
"componentName": "MixedSetter",
|
|
41
|
-
"isRequired": false,
|
|
42
|
-
"props": {}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
|
-
"isRequired": false,
|
|
47
|
-
"initialValue": {}
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
"componentName": "StringSetter",
|
|
51
|
-
"isRequired": false,
|
|
52
|
-
"initialValue": ""
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
"componentName": "NumberSetter",
|
|
56
|
-
"isRequired": false,
|
|
57
|
-
"initialValue": 0
|
|
58
|
-
}
|
|
59
|
-
]
|
|
60
|
-
}
|
|
61
|
-
}
|
|
29
|
+
description: '外部传入商品 id,用于拉取商品详情',
|
|
30
|
+
setter: [
|
|
31
|
+
{ componentName: 'NumberSetter' },
|
|
32
|
+
{ componentName: 'StringSetter' },
|
|
33
|
+
{ componentName: 'VariableSetter' },
|
|
34
|
+
],
|
|
62
35
|
},
|
|
63
36
|
{
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
37
|
+
name: 'scheduleDate',
|
|
38
|
+
title: {
|
|
39
|
+
label: {
|
|
40
|
+
type: 'i18n',
|
|
41
|
+
'en-US': 'scheduleDate',
|
|
42
|
+
'zh-CN': '预约日期',
|
|
69
43
|
},
|
|
70
|
-
"tip": "scheduleDate | 可选:用于商品报价的日期(预约类商品)"
|
|
71
44
|
},
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
"setter": {
|
|
75
|
-
"componentName": "MixedSetter",
|
|
76
|
-
"props": {
|
|
77
|
-
"setters": [
|
|
78
|
-
{
|
|
79
|
-
"componentName": "ObjectSetter",
|
|
80
|
-
"props": {
|
|
81
|
-
"config": {
|
|
82
|
-
"extraSetter": {
|
|
83
|
-
"componentName": "MixedSetter",
|
|
84
|
-
"isRequired": false,
|
|
85
|
-
"props": {}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
},
|
|
89
|
-
"isRequired": false,
|
|
90
|
-
"initialValue": {}
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
"componentName": "StringSetter",
|
|
94
|
-
"isRequired": false,
|
|
95
|
-
"initialValue": ""
|
|
96
|
-
}
|
|
97
|
-
]
|
|
98
|
-
}
|
|
99
|
-
}
|
|
45
|
+
description: '可选:用于预约类商品报价(如 2025-12-18)',
|
|
46
|
+
setter: [{ componentName: 'StringSetter' }, { componentName: 'VariableSetter' }],
|
|
100
47
|
},
|
|
101
48
|
{
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
49
|
+
title: {
|
|
50
|
+
label: {
|
|
51
|
+
type: 'i18n',
|
|
52
|
+
'en-US': 'className',
|
|
53
|
+
'zh-CN': '类名',
|
|
107
54
|
},
|
|
108
|
-
"tip": "className | 自定义类名"
|
|
109
55
|
},
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
"setter": {
|
|
113
|
-
"componentName": "MixedSetter",
|
|
114
|
-
"props": {
|
|
115
|
-
"setters": [
|
|
116
|
-
{
|
|
117
|
-
"componentName": "ObjectSetter",
|
|
118
|
-
"props": {
|
|
119
|
-
"config": {
|
|
120
|
-
"extraSetter": {
|
|
121
|
-
"componentName": "MixedSetter",
|
|
122
|
-
"isRequired": false,
|
|
123
|
-
"props": {}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
},
|
|
127
|
-
"isRequired": false,
|
|
128
|
-
"initialValue": {}
|
|
129
|
-
},
|
|
130
|
-
{
|
|
131
|
-
"componentName": "StringSetter",
|
|
132
|
-
"isRequired": false,
|
|
133
|
-
"initialValue": ""
|
|
134
|
-
}
|
|
135
|
-
]
|
|
136
|
-
}
|
|
137
|
-
}
|
|
56
|
+
name: 'className',
|
|
57
|
+
setter: 'StringSetter',
|
|
138
58
|
},
|
|
139
59
|
{
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
60
|
+
title: {
|
|
61
|
+
label: {
|
|
62
|
+
type: 'i18n',
|
|
63
|
+
'en-US': 'style',
|
|
64
|
+
'zh-CN': '样式',
|
|
145
65
|
},
|
|
146
|
-
"tip": "style | 自定义样式"
|
|
147
66
|
},
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
"setter": {
|
|
151
|
-
"componentName": "MixedSetter",
|
|
152
|
-
"props": {
|
|
153
|
-
"setters": [
|
|
154
|
-
{
|
|
155
|
-
"componentName": "ObjectSetter",
|
|
156
|
-
"props": {
|
|
157
|
-
"config": {
|
|
158
|
-
"extraSetter": {
|
|
159
|
-
"componentName": "MixedSetter",
|
|
160
|
-
"isRequired": false,
|
|
161
|
-
"props": {}
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
},
|
|
165
|
-
"isRequired": false,
|
|
166
|
-
"initialValue": {}
|
|
167
|
-
}
|
|
168
|
-
]
|
|
169
|
-
}
|
|
170
|
-
}
|
|
67
|
+
name: 'style',
|
|
68
|
+
setter: 'StyleSetter',
|
|
171
69
|
},
|
|
172
70
|
{
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
71
|
+
title: {
|
|
72
|
+
label: {
|
|
73
|
+
type: 'i18n',
|
|
74
|
+
'en-US': 'onBack',
|
|
75
|
+
'zh-CN': '返回事件',
|
|
178
76
|
},
|
|
179
|
-
"tip": "onBack | 返回"
|
|
180
77
|
},
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
"setter": {
|
|
184
|
-
"componentName": "MixedSetter",
|
|
185
|
-
"props": {
|
|
186
|
-
"setters": [
|
|
187
|
-
{
|
|
188
|
-
"componentName": "ObjectSetter",
|
|
189
|
-
"props": {
|
|
190
|
-
"config": {
|
|
191
|
-
"extraSetter": {
|
|
192
|
-
"componentName": "MixedSetter",
|
|
193
|
-
"isRequired": false,
|
|
194
|
-
"props": {}
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
},
|
|
198
|
-
"isRequired": false,
|
|
199
|
-
"initialValue": {}
|
|
200
|
-
},
|
|
201
|
-
{
|
|
202
|
-
"componentName": "FunctionSetter",
|
|
203
|
-
"isRequired": false
|
|
204
|
-
}
|
|
205
|
-
]
|
|
206
|
-
}
|
|
207
|
-
}
|
|
78
|
+
name: 'onBack',
|
|
79
|
+
setter: 'FunctionSetter',
|
|
208
80
|
},
|
|
209
81
|
{
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
82
|
+
title: {
|
|
83
|
+
label: {
|
|
84
|
+
type: 'i18n',
|
|
85
|
+
'en-US': 'onAddToCart',
|
|
86
|
+
'zh-CN': '加入购物车事件',
|
|
215
87
|
},
|
|
216
|
-
"tip": "onAddToCart | 加入购物车"
|
|
217
88
|
},
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
"componentName": "MixedSetter",
|
|
222
|
-
"props": {
|
|
223
|
-
"setters": [
|
|
224
|
-
{
|
|
225
|
-
"componentName": "ObjectSetter",
|
|
226
|
-
"props": {
|
|
227
|
-
"config": {
|
|
228
|
-
"extraSetter": {
|
|
229
|
-
"componentName": "MixedSetter",
|
|
230
|
-
"isRequired": false,
|
|
231
|
-
"props": {}
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
},
|
|
235
|
-
"isRequired": false,
|
|
236
|
-
"initialValue": {}
|
|
237
|
-
},
|
|
238
|
-
{
|
|
239
|
-
"componentName": "FunctionSetter"
|
|
240
|
-
}
|
|
241
|
-
]
|
|
242
|
-
}
|
|
243
|
-
}
|
|
244
|
-
}
|
|
89
|
+
name: 'onAddToCart',
|
|
90
|
+
setter: 'FunctionSetter',
|
|
91
|
+
},
|
|
245
92
|
],
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
93
|
+
supports: {
|
|
94
|
+
style: true,
|
|
95
|
+
// lowcode-types 在不同版本下 events 结构有差异,这里以运行时能力为准并做类型兜底
|
|
96
|
+
events: [
|
|
97
|
+
{
|
|
98
|
+
name: 'onBack',
|
|
99
|
+
template: "onBack(${extParams}){ console.log('onBack'); }",
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
name: 'onAddToCart',
|
|
103
|
+
template:
|
|
104
|
+
"onAddToCart(params, ${extParams}){ console.log('onAddToCart', params); }",
|
|
105
|
+
},
|
|
106
|
+
] as any,
|
|
107
|
+
},
|
|
108
|
+
component: {
|
|
109
|
+
isContainer: false,
|
|
110
|
+
},
|
|
111
|
+
},
|
|
249
112
|
};
|
|
250
|
-
const snippets:
|
|
113
|
+
const snippets: IPublicTypeSnippet[] = [
|
|
251
114
|
{
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
115
|
+
title: 'KioskSkuDetail',
|
|
116
|
+
screenshot: '',
|
|
117
|
+
schema: {
|
|
118
|
+
componentName: 'KioskSkuDetail',
|
|
119
|
+
props: {
|
|
120
|
+
productId: 1,
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
},
|
|
259
124
|
];
|
|
260
125
|
|
|
261
126
|
export default {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/private-materials",
|
|
3
|
-
"version": "6.8.
|
|
3
|
+
"version": "6.8.78",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -66,6 +66,8 @@
|
|
|
66
66
|
"@dnd-kit/modifiers": "^6.0.1",
|
|
67
67
|
"@dnd-kit/sortable": "^7.0.2",
|
|
68
68
|
"@dnd-kit/utilities": "^3.2.1",
|
|
69
|
+
"@react-spring/web": "^9.6.1",
|
|
70
|
+
"@use-gesture/react": "^10.3.1",
|
|
69
71
|
"ahooks": "^3.7.6",
|
|
70
72
|
"classnames": "^2.3.2",
|
|
71
73
|
"dayjs": "^1.11.9",
|
|
@@ -73,7 +75,11 @@
|
|
|
73
75
|
"rc-virtual-list": "^3.11.3",
|
|
74
76
|
"react-infinite-scroll-component": "^6.1.0",
|
|
75
77
|
"react-resizable": "^3.0.5",
|
|
76
|
-
"styled-components": "^6.0.0-rc.3"
|
|
78
|
+
"styled-components": "^6.0.0-rc.3",
|
|
79
|
+
"@pisell/date-picker": "3.0.7",
|
|
80
|
+
"@pisell/materials": "6.8.12",
|
|
81
|
+
"@pisell/utils": "3.0.2",
|
|
82
|
+
"@pisell/icon": "0.0.11"
|
|
77
83
|
},
|
|
78
84
|
"peerDependencies": {
|
|
79
85
|
"react": "^18.0.0",
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { HooksRunParams, PaymentMethodOptions } from '../types';
|
|
2
|
-
declare const useMicropay: (options: PaymentMethodOptions) => {
|
|
3
|
-
run: (runParams?: HooksRunParams) => void;
|
|
4
|
-
query: () => void;
|
|
5
|
-
action: (data: Record<string, any>) => void;
|
|
6
|
-
};
|
|
7
|
-
export default useMicropay;
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import { useEffect, useRef } from 'react';
|
|
2
|
-
import PaymentMethod from "../utils/payment";
|
|
3
|
-
import { ModeEnum } from "../../const";
|
|
4
|
-
import { useStoreRef } from "../../hooks";
|
|
5
|
-
import { getUuid } from "../../helper";
|
|
6
|
-
import { useDispatch, updateState } from "../../store";
|
|
7
|
-
import { useContextData } from "../../store";
|
|
8
|
-
var useMicropay = function useMicropay(options) {
|
|
9
|
-
var _useContextData = useContextData(),
|
|
10
|
-
custom = _useContextData.custom;
|
|
11
|
-
var _useStoreRef = useStoreRef(),
|
|
12
|
-
modeRef = _useStoreRef.modeRef,
|
|
13
|
-
payRef = _useStoreRef.payRef,
|
|
14
|
-
orderIdRef = _useStoreRef.orderIdRef,
|
|
15
|
-
eftposRef = _useStoreRef.eftposRef,
|
|
16
|
-
deviceRef = _useStoreRef.deviceRef,
|
|
17
|
-
amountRef = _useStoreRef.amountRef;
|
|
18
|
-
var paymentMethodRef = useRef(null);
|
|
19
|
-
var dispatch = useDispatch();
|
|
20
|
-
var uniquePaymentNumberRef = useRef(null);
|
|
21
|
-
var isPay = modeRef.current === ModeEnum.Pay || modeRef.current === ModeEnum.FullPay;
|
|
22
|
-
useEffect(function () {
|
|
23
|
-
if (!paymentMethodRef.current) {
|
|
24
|
-
var _deviceRef$current;
|
|
25
|
-
// 如果不存在交易号需要先创建一个交易号
|
|
26
|
-
if (!options.paymentNum) {
|
|
27
|
-
var paymentNum = getUuid();
|
|
28
|
-
dispatch(updateState({
|
|
29
|
-
number: paymentNum
|
|
30
|
-
}));
|
|
31
|
-
options.paymentNum = paymentNum;
|
|
32
|
-
uniquePaymentNumberRef.current = paymentNum;
|
|
33
|
-
} else {
|
|
34
|
-
uniquePaymentNumberRef.current = options.paymentNum;
|
|
35
|
-
}
|
|
36
|
-
options.orderId = orderIdRef.current;
|
|
37
|
-
options.deviceId = (_deviceRef$current = deviceRef.current) === null || _deviceRef$current === void 0 ? void 0 : _deviceRef$current.id;
|
|
38
|
-
paymentMethodRef.current = new PaymentMethod(options);
|
|
39
|
-
}
|
|
40
|
-
return function () {
|
|
41
|
-
var _paymentMethodRef$cur, _paymentMethodRef$cur2;
|
|
42
|
-
// 卸载组件时,如果paymentMethodRef存在需要先执行销毁,再清空
|
|
43
|
-
(_paymentMethodRef$cur = paymentMethodRef.current) === null || _paymentMethodRef$cur === void 0 || (_paymentMethodRef$cur2 = _paymentMethodRef$cur.destroy) === null || _paymentMethodRef$cur2 === void 0 || _paymentMethodRef$cur2.call(_paymentMethodRef$cur);
|
|
44
|
-
paymentMethodRef.current = null;
|
|
45
|
-
};
|
|
46
|
-
}, []);
|
|
47
|
-
var run = function run(runParams) {
|
|
48
|
-
var _payRef$current, _deviceRef$current2;
|
|
49
|
-
var params = {
|
|
50
|
-
order_id: orderIdRef.current,
|
|
51
|
-
unique_payment_number: uniquePaymentNumberRef.current,
|
|
52
|
-
payment_code: options.paymentCode,
|
|
53
|
-
amount: isPay ? (_payRef$current = payRef.current) === null || _payRef$current === void 0 ? void 0 : _payRef$current.total : amountRef.current,
|
|
54
|
-
operator_id: custom === null || custom === void 0 ? void 0 : custom.operator_id,
|
|
55
|
-
operator_type: custom === null || custom === void 0 ? void 0 : custom.operator_type,
|
|
56
|
-
platform: custom === null || custom === void 0 ? void 0 : custom.platform,
|
|
57
|
-
micropay: {
|
|
58
|
-
card_reader_type: eftposRef.current,
|
|
59
|
-
card_reader_id: (_deviceRef$current2 = deviceRef.current) === null || _deviceRef$current2 === void 0 ? void 0 : _deviceRef$current2.id
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
if (isPay) {
|
|
63
|
-
var _payRef$current2, _payRef$current3, _payRef$current4, _paymentMethodRef$cur3;
|
|
64
|
-
params.payment = {
|
|
65
|
-
original_amount: (_payRef$current2 = payRef.current) === null || _payRef$current2 === void 0 ? void 0 : _payRef$current2.amount,
|
|
66
|
-
order_payment_type: 'normal',
|
|
67
|
-
// TODO: 需要使用方提供
|
|
68
|
-
custom_payment_id: custom === null || custom === void 0 ? void 0 : custom.custom_payment_id,
|
|
69
|
-
custom_payment_code: custom === null || custom === void 0 ? void 0 : custom.custom_payment_code,
|
|
70
|
-
custom_payment_name: custom === null || custom === void 0 ? void 0 : custom.custom_payment_name,
|
|
71
|
-
custom_payment_type: custom === null || custom === void 0 ? void 0 : custom.custom_payment_type,
|
|
72
|
-
service_charge: {
|
|
73
|
-
amount: (_payRef$current3 = payRef.current) === null || _payRef$current3 === void 0 ? void 0 : _payRef$current3.surMoney,
|
|
74
|
-
percentage: (_payRef$current4 = payRef.current) === null || _payRef$current4 === void 0 ? void 0 : _payRef$current4.surPercentRate
|
|
75
|
-
},
|
|
76
|
-
metadata: {
|
|
77
|
-
unique_payment_number: uniquePaymentNumberRef.current
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
// 支付场景需要传付款码
|
|
81
|
-
params.micropay.auth_code = (runParams === null || runParams === void 0 ? void 0 : runParams.authCode) || '';
|
|
82
|
-
(_paymentMethodRef$cur3 = paymentMethodRef.current) === null || _paymentMethodRef$cur3 === void 0 || _paymentMethodRef$cur3.pay(params);
|
|
83
|
-
} else {
|
|
84
|
-
var _paymentMethodRef$cur4;
|
|
85
|
-
// 退款场景需要传 order_payment_id
|
|
86
|
-
params.micropay.order_payment_id = (runParams === null || runParams === void 0 ? void 0 : runParams.orderPaymentId) || '';
|
|
87
|
-
(_paymentMethodRef$cur4 = paymentMethodRef.current) === null || _paymentMethodRef$cur4 === void 0 || _paymentMethodRef$cur4.refund(params);
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
var query = function query() {
|
|
91
|
-
if (isPay) {
|
|
92
|
-
var _paymentMethodRef$cur5;
|
|
93
|
-
(_paymentMethodRef$cur5 = paymentMethodRef.current) === null || _paymentMethodRef$cur5 === void 0 || _paymentMethodRef$cur5.payQuery();
|
|
94
|
-
} else {
|
|
95
|
-
var _paymentMethodRef$cur6;
|
|
96
|
-
(_paymentMethodRef$cur6 = paymentMethodRef.current) === null || _paymentMethodRef$cur6 === void 0 || _paymentMethodRef$cur6.refundQuery();
|
|
97
|
-
}
|
|
98
|
-
};
|
|
99
|
-
var action = function action(data) {
|
|
100
|
-
var params = {
|
|
101
|
-
order_id: orderIdRef.current,
|
|
102
|
-
unique_payment_number: uniquePaymentNumberRef.current,
|
|
103
|
-
payment_code: options.paymentCode,
|
|
104
|
-
data: data
|
|
105
|
-
};
|
|
106
|
-
if (isPay) {
|
|
107
|
-
var _paymentMethodRef$cur7;
|
|
108
|
-
(_paymentMethodRef$cur7 = paymentMethodRef.current) === null || _paymentMethodRef$cur7 === void 0 || _paymentMethodRef$cur7.payAction(params);
|
|
109
|
-
} else {
|
|
110
|
-
var _paymentMethodRef$cur8;
|
|
111
|
-
(_paymentMethodRef$cur8 = paymentMethodRef.current) === null || _paymentMethodRef$cur8 === void 0 || _paymentMethodRef$cur8.refundAction(params);
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
return {
|
|
115
|
-
run: run,
|
|
116
|
-
query: query,
|
|
117
|
-
action: action
|
|
118
|
-
};
|
|
119
|
-
};
|
|
120
|
-
export default useMicropay;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 聚合支付-支付接口
|
|
3
|
-
*/
|
|
4
|
-
export declare const AGPTPayApi: (data: any, config: any) => Promise<any>;
|
|
5
|
-
/**
|
|
6
|
-
* 聚合支付-支付-查询接口
|
|
7
|
-
*/
|
|
8
|
-
export declare const AGPTQueryApi: (param: any, config: any) => Promise<any>;
|
|
9
|
-
/**
|
|
10
|
-
* 聚合支付-支付-支付行为接口
|
|
11
|
-
*/
|
|
12
|
-
export declare const AGPTActionApi: (param: any, config: any) => Promise<any>;
|
|
13
|
-
/**
|
|
14
|
-
* 聚合支付-退款接口
|
|
15
|
-
*/
|
|
16
|
-
export declare const AGPTRefundApi: (data: any, config: any) => Promise<any>;
|
|
17
|
-
/**
|
|
18
|
-
* 聚合支付-退款-查询接口
|
|
19
|
-
*/
|
|
20
|
-
export declare const AGPTRefundQueryApi: (param: any, config: any) => Promise<any>;
|
|
21
|
-
/**
|
|
22
|
-
* 聚合支付-退款-支付行为接口
|
|
23
|
-
*/
|
|
24
|
-
export declare const AGPTRefundActionApi: (param: any, config: any) => Promise<any>;
|
|
@@ -1,69 +0,0 @@
|
|
|
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 { request } from "../../../utils";
|
|
8
|
-
|
|
9
|
-
///////////////// 支付相关接口 /////////////////
|
|
10
|
-
/**
|
|
11
|
-
* 聚合支付-支付接口
|
|
12
|
-
*/
|
|
13
|
-
export var AGPTPayApi = function AGPTPayApi(data, config) {
|
|
14
|
-
return request.getRequest().post('/shop/pay/external-unified/pay', data, _objectSpread(_objectSpread({}, config || {}), {}, {
|
|
15
|
-
customMessage: true,
|
|
16
|
-
fullResult: true
|
|
17
|
-
}));
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* 聚合支付-支付-查询接口
|
|
22
|
-
*/
|
|
23
|
-
export var AGPTQueryApi = function AGPTQueryApi(param, config) {
|
|
24
|
-
return request.getRequest().post('/shop/pay/external-unified/pay/verify', param, _objectSpread(_objectSpread({}, config || {}), {}, {
|
|
25
|
-
customMessage: true,
|
|
26
|
-
fullResult: true
|
|
27
|
-
}));
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* 聚合支付-支付-支付行为接口
|
|
32
|
-
*/
|
|
33
|
-
export var AGPTActionApi = function AGPTActionApi(param, config) {
|
|
34
|
-
return request.getRequest().post('/shop/pay/external-unified/pay/action', param, _objectSpread(_objectSpread({}, config || {}), {}, {
|
|
35
|
-
customMessage: true,
|
|
36
|
-
fullResult: true
|
|
37
|
-
}));
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
///////////////// 退款相关接口 /////////////////
|
|
41
|
-
/**
|
|
42
|
-
* 聚合支付-退款接口
|
|
43
|
-
*/
|
|
44
|
-
export var AGPTRefundApi = function AGPTRefundApi(data, config) {
|
|
45
|
-
return request.getRequest().post('/shop/pay/external-unified/refund', data, _objectSpread(_objectSpread({}, config || {}), {}, {
|
|
46
|
-
customMessage: true,
|
|
47
|
-
fullResult: true
|
|
48
|
-
}));
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* 聚合支付-退款-查询接口
|
|
53
|
-
*/
|
|
54
|
-
export var AGPTRefundQueryApi = function AGPTRefundQueryApi(param, config) {
|
|
55
|
-
return request.getRequest().post('/shop/pay/external-unified/refund/verify', param, _objectSpread(_objectSpread({}, config || {}), {}, {
|
|
56
|
-
customMessage: true,
|
|
57
|
-
fullResult: true
|
|
58
|
-
}));
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* 聚合支付-退款-支付行为接口
|
|
63
|
-
*/
|
|
64
|
-
export var AGPTRefundActionApi = function AGPTRefundActionApi(param, config) {
|
|
65
|
-
return request.getRequest().post('/shop/pay/external-unified/refund/action', param, _objectSpread(_objectSpread({}, config || {}), {}, {
|
|
66
|
-
customMessage: true,
|
|
67
|
-
fullResult: true
|
|
68
|
-
}));
|
|
69
|
-
};
|