oak-pay-business 2.8.0-beta.0 → 3.0.0
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/es/components/account/detail/index.js +105 -17
- package/es/components/account/detail/index.json +1 -0
- package/es/components/account/detail/index.xml +36 -8
- package/es/components/order/pay/web.mobile.module.less +35 -35
- package/es/components/order/pay/web.pc.module.less +35 -35
- package/es/components/payConfig/system/web.pc.js +1 -1
- package/es/components/ship/system/web.pc.js +18 -18
- package/es/components/ship/system/web.pc.module.less +15 -15
- package/es/components/ship/wechatMpShip/upsert/web.pc.js +10 -10
- package/es/components/ship/wechatMpShip/web.pc.js +20 -20
- package/es/components/ship/wechatMpShip/web.pc.module.less +7 -7
- package/es/config/constants.d.ts +1 -0
- package/es/config/constants.js +1 -0
- package/es/endpoints/wechatPay.js +2 -0
- package/es/entities/Settlement.d.ts +3 -1
- package/es/entities/Settlement.js +2 -0
- package/es/oak-app-domain/AccountOper/Storage.js +1 -1
- package/es/oak-app-domain/AccountOper/_baseSchema.d.ts +2 -2
- package/es/oak-app-domain/EntityDict.d.ts +17 -0
- package/es/oak-app-domain/Settlement/Action.d.ts +1 -1
- package/es/oak-app-domain/Settlement/Action.js +1 -1
- package/es/oak-app-domain/Settlement/locales/zh_CN.json +3 -1
- package/es/timers/ship.js +21 -3
- package/es/triggers/deposit.js +28 -1
- package/es/triggers/order.js +42 -63
- package/es/triggers/ship.js +98 -93
- package/es/utils/ship.js +42 -25
- package/lib/config/constants.d.ts +1 -0
- package/lib/config/constants.js +1 -0
- package/lib/endpoints/wechatPay.js +2 -0
- package/lib/entities/Settlement.d.ts +3 -1
- package/lib/entities/Settlement.js +2 -0
- package/lib/oak-app-domain/AccountOper/Storage.js +1 -1
- package/lib/oak-app-domain/AccountOper/_baseSchema.d.ts +2 -2
- package/lib/oak-app-domain/EntityDict.d.ts +17 -0
- package/lib/oak-app-domain/Settlement/Action.d.ts +1 -1
- package/lib/oak-app-domain/Settlement/Action.js +1 -1
- package/lib/oak-app-domain/Settlement/locales/zh_CN.json +3 -1
- package/lib/timers/ship.js +21 -3
- package/lib/triggers/deposit.js +28 -1
- package/lib/triggers/order.js +42 -63
- package/lib/triggers/ship.js +98 -93
- package/lib/utils/ship.js +42 -26
- package/package.json +4 -4
- package/src/entities/AbstactPayProduct.ts +38 -38
- package/src/entities/AbstractShipAccount.ts +39 -39
- package/src/entities/Settlement.ts +5 -1
- package/src/entities/ShipService.ts +26 -26
- package/src/entities/WechatMpShip.ts +32 -32
|
@@ -123,6 +123,40 @@ export default OakComponent({
|
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
125
|
]);
|
|
126
|
+
this.setPayRefreshing(true);
|
|
127
|
+
const delay = 2000;
|
|
128
|
+
const wait = (ms) => new Promise(resolve => setTimeout(resolve, ms));
|
|
129
|
+
const pollUntilPaying = async () => {
|
|
130
|
+
while (true) {
|
|
131
|
+
const { data: [pay] } = await this.features.cache.refresh('pay', {
|
|
132
|
+
data: {
|
|
133
|
+
id: 1,
|
|
134
|
+
applicationId: 1,
|
|
135
|
+
price: 1,
|
|
136
|
+
meta: 1,
|
|
137
|
+
iState: 1,
|
|
138
|
+
paid: 1,
|
|
139
|
+
refunded: 1,
|
|
140
|
+
timeoutAt: 1,
|
|
141
|
+
forbidRefundAt: 1,
|
|
142
|
+
externalId: 1,
|
|
143
|
+
entity: 1,
|
|
144
|
+
entityId: 1,
|
|
145
|
+
creatorId: 1,
|
|
146
|
+
phantom3: 1,
|
|
147
|
+
},
|
|
148
|
+
filter: {
|
|
149
|
+
id: payId,
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
if (pay.iState === 'paying') {
|
|
153
|
+
this.setPayRefreshing(false);
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
await wait(delay);
|
|
157
|
+
}
|
|
158
|
+
};
|
|
159
|
+
await pollUntilPaying();
|
|
126
160
|
this.setDepositing(false);
|
|
127
161
|
}
|
|
128
162
|
catch (err) {
|
|
@@ -133,6 +167,9 @@ export default OakComponent({
|
|
|
133
167
|
const { onGoToUnfinishedPay } = this.props;
|
|
134
168
|
onGoToUnfinishedPay && onGoToUnfinishedPay(payId);
|
|
135
169
|
},
|
|
170
|
+
setPayRefreshing(payRefreshing) {
|
|
171
|
+
this.setState({ payRefreshing });
|
|
172
|
+
},
|
|
136
173
|
setDepositOpen(depositOpen) {
|
|
137
174
|
this.setState({ depositOpen }, () => {
|
|
138
175
|
setTimeout(() => {
|
|
@@ -201,10 +238,10 @@ export default OakComponent({
|
|
|
201
238
|
onUfModalClose() {
|
|
202
239
|
this.setUfOpen(false);
|
|
203
240
|
},
|
|
204
|
-
onUnfinishedDepositClick() {
|
|
241
|
+
async onUnfinishedDepositClick() {
|
|
205
242
|
const { onGoToUnfinishedPay } = this.props;
|
|
206
243
|
const { unfinishedDepositId } = this.state;
|
|
207
|
-
const [pay] = this.features.cache.
|
|
244
|
+
const { data: [pay] } = await this.features.cache.refresh('pay', {
|
|
208
245
|
data: {
|
|
209
246
|
id: 1,
|
|
210
247
|
},
|
|
@@ -221,9 +258,9 @@ export default OakComponent({
|
|
|
221
258
|
gotoHistoryMp() {
|
|
222
259
|
this.props.onGoToHistory();
|
|
223
260
|
},
|
|
224
|
-
async onUnreceivedDepositClickMp() {
|
|
261
|
+
async onUnreceivedDepositClickMp(noMessage) {
|
|
225
262
|
const { unreceivedDepositId } = this.state;
|
|
226
|
-
const { data:
|
|
263
|
+
const { data: [deposit] } = await this.features.cache.refresh('deposit', {
|
|
227
264
|
data: {
|
|
228
265
|
id: 1,
|
|
229
266
|
iState: 1,
|
|
@@ -251,10 +288,10 @@ export default OakComponent({
|
|
|
251
288
|
id: unreceivedDepositId,
|
|
252
289
|
}
|
|
253
290
|
});
|
|
254
|
-
const ship =
|
|
291
|
+
const ship = deposit?.ship;
|
|
255
292
|
if (ship && ship.id) {
|
|
256
293
|
if (ship.iState === 'receiving') {
|
|
257
|
-
const transactionId =
|
|
294
|
+
const transactionId = deposit?.pay$deposit?.[0]?.meta?.transaction_id;
|
|
258
295
|
console.log('transaction_id', transactionId);
|
|
259
296
|
if (process.env.NODE_ENV === 'development') {
|
|
260
297
|
await this.features.cache.operate('ship', [{
|
|
@@ -278,9 +315,9 @@ export default OakComponent({
|
|
|
278
315
|
extraData: {
|
|
279
316
|
transaction_id: transactionId,
|
|
280
317
|
},
|
|
281
|
-
async
|
|
318
|
+
success: async () => {
|
|
282
319
|
console.log('success');
|
|
283
|
-
const mpShipState = await this.features.cache.exec('getMpShipState', {
|
|
320
|
+
const { result: mpShipState } = await this.features.cache.exec('getMpShipState', {
|
|
284
321
|
shipId: ship.id,
|
|
285
322
|
});
|
|
286
323
|
if (mpShipState === 'received') {
|
|
@@ -325,18 +362,22 @@ export default OakComponent({
|
|
|
325
362
|
}
|
|
326
363
|
}
|
|
327
364
|
else {
|
|
365
|
+
if (!noMessage) {
|
|
366
|
+
this.setMessage({
|
|
367
|
+
type: 'warning',
|
|
368
|
+
content: this.t('no transactionId'),
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
else {
|
|
374
|
+
if (!noMessage) {
|
|
328
375
|
this.setMessage({
|
|
376
|
+
content: this.t('ship.wait'),
|
|
329
377
|
type: 'warning',
|
|
330
|
-
content: this.t('no transactionId'),
|
|
331
378
|
});
|
|
332
379
|
}
|
|
333
380
|
}
|
|
334
|
-
else {
|
|
335
|
-
this.setMessage({
|
|
336
|
-
content: this.t('ship.wait'),
|
|
337
|
-
type: 'warning',
|
|
338
|
-
});
|
|
339
|
-
}
|
|
340
381
|
}
|
|
341
382
|
}
|
|
342
383
|
},
|
|
@@ -351,12 +392,53 @@ export default OakComponent({
|
|
|
351
392
|
setDepositChannelMp(depositChannel) { this.setDepositChannel(depositChannel); },
|
|
352
393
|
focus: false,
|
|
353
394
|
unsub: undefined,
|
|
395
|
+
payRefreshing: false,
|
|
354
396
|
},
|
|
355
397
|
lifetimes: {
|
|
356
398
|
async ready() {
|
|
357
399
|
const { oakId } = this.props;
|
|
358
400
|
assert(typeof oakId === 'string');
|
|
359
|
-
const unsub = await this.subDataEvents([`${DATA_SUBSCRIBER_KEYS.accountNumberChanged}-${oakId}`])
|
|
401
|
+
const unsub = await this.subDataEvents([`${DATA_SUBSCRIBER_KEYS.accountNumberChanged}-${oakId}`, `${DATA_SUBSCRIBER_KEYS.depositStateChanged}-${oakId}`], async (event, opRecords) => {
|
|
402
|
+
for (const record of opRecords) {
|
|
403
|
+
if (record.a === 'succeed') {
|
|
404
|
+
const { e, d } = record;
|
|
405
|
+
if (e === 'deposit') {
|
|
406
|
+
await this.features.cache.refresh('deposit', {
|
|
407
|
+
data: {
|
|
408
|
+
id: 1,
|
|
409
|
+
accountId: 1,
|
|
410
|
+
iState: 1,
|
|
411
|
+
pay$deposit: {
|
|
412
|
+
$entity: 'pay',
|
|
413
|
+
data: {
|
|
414
|
+
id: 1,
|
|
415
|
+
meta: 1,
|
|
416
|
+
iState: 1,
|
|
417
|
+
entity: 1,
|
|
418
|
+
entityId: 1,
|
|
419
|
+
},
|
|
420
|
+
filter: {
|
|
421
|
+
entity: 'wpProduct',
|
|
422
|
+
iState: 'paid',
|
|
423
|
+
}
|
|
424
|
+
},
|
|
425
|
+
shipId: 1,
|
|
426
|
+
ship: {
|
|
427
|
+
id: 1,
|
|
428
|
+
iState: 1,
|
|
429
|
+
}
|
|
430
|
+
},
|
|
431
|
+
filter: {
|
|
432
|
+
accountId: oakId,
|
|
433
|
+
iState: {
|
|
434
|
+
$in: ['depositing', 'shipped'],
|
|
435
|
+
},
|
|
436
|
+
}
|
|
437
|
+
});
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
});
|
|
360
442
|
this.setState({
|
|
361
443
|
unsub,
|
|
362
444
|
});
|
|
@@ -364,6 +446,12 @@ export default OakComponent({
|
|
|
364
446
|
detached() {
|
|
365
447
|
const { unsub } = this.state;
|
|
366
448
|
unsub && unsub();
|
|
367
|
-
}
|
|
449
|
+
},
|
|
450
|
+
async mature() {
|
|
451
|
+
const { unreceivedDepositId } = this.state;
|
|
452
|
+
if (!!unreceivedDepositId && process.env.OAK_PLATFORM === 'wechatMp') {
|
|
453
|
+
await this.onUnreceivedDepositClickMp(true);
|
|
454
|
+
}
|
|
455
|
+
},
|
|
368
456
|
}
|
|
369
457
|
});
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"usingComponents": {
|
|
3
|
+
"l-loading": "@oak-frontend-base/miniprogram_npm/lin-ui/loading/index",
|
|
3
4
|
"l-button": "@oak-frontend-base/miniprogram_npm/lin-ui/button/index",
|
|
4
5
|
"l-popup": "@oak-frontend-base/miniprogram_npm/lin-ui/popup/index",
|
|
5
6
|
"l-dialog": "@oak-frontend-base/miniprogram_npm/lin-ui/dialog/index",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<view class="container">
|
|
2
|
-
<l-notice-bar show="{{unreceivedDepositId}}" front-icon-name="notification" end-icon-name="right"
|
|
2
|
+
<l-notice-bar show="{{!!unreceivedDepositId}}" front-icon-name="notification" end-icon-name="right"
|
|
3
3
|
bind:lintap="onUnreceivedDepositClickMp" bind:linicontap="onUnreceivedDepositClickMp">
|
|
4
4
|
{{t('ship.unconfirm')}}
|
|
5
5
|
</l-notice-bar>
|
|
@@ -28,9 +28,11 @@
|
|
|
28
28
|
</view>
|
|
29
29
|
</view>
|
|
30
30
|
<view style="height:30vh;" />
|
|
31
|
-
<
|
|
32
|
-
<
|
|
33
|
-
<
|
|
31
|
+
<block wx:if="{{payRefreshing}}">
|
|
32
|
+
<l-loading show="{{payRefreshing}}" type="circle" opacity="0.5">
|
|
33
|
+
<view class="btn">
|
|
34
|
+
<view class="item">
|
|
35
|
+
<l-button
|
|
34
36
|
size="long"
|
|
35
37
|
bind:lintap="onDepositClick"
|
|
36
38
|
bgColor="{{textColor}}"
|
|
@@ -38,9 +40,9 @@
|
|
|
38
40
|
>
|
|
39
41
|
{{t('account:action.deposit')}}
|
|
40
42
|
</l-button>
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
43
|
+
</view>
|
|
44
|
+
<view class="item">
|
|
45
|
+
<l-button
|
|
44
46
|
size="long"
|
|
45
47
|
plain="{{true}}"
|
|
46
48
|
bind:lintap="onWithdrawClick"
|
|
@@ -48,8 +50,34 @@
|
|
|
48
50
|
>
|
|
49
51
|
{{t('account:action.withdraw')}}
|
|
50
52
|
</l-button>
|
|
53
|
+
</view>
|
|
54
|
+
</view>
|
|
55
|
+
</l-loading>
|
|
56
|
+
</block>
|
|
57
|
+
<block wx:else>
|
|
58
|
+
<view class="btn">
|
|
59
|
+
<view class="item">
|
|
60
|
+
<l-button
|
|
61
|
+
size="long"
|
|
62
|
+
bind:lintap="onDepositClick"
|
|
63
|
+
bgColor="{{textColor}}"
|
|
64
|
+
l-class="my-button"
|
|
65
|
+
>
|
|
66
|
+
{{t('account:action.deposit')}}
|
|
67
|
+
</l-button>
|
|
68
|
+
</view>
|
|
69
|
+
<view class="item">
|
|
70
|
+
<l-button
|
|
71
|
+
size="long"
|
|
72
|
+
plain="{{true}}"
|
|
73
|
+
bind:lintap="onWithdrawClick"
|
|
74
|
+
l-class="withdrawBtn my-button"
|
|
75
|
+
>
|
|
76
|
+
{{t('account:action.withdraw')}}
|
|
77
|
+
</l-button>
|
|
78
|
+
</view>
|
|
51
79
|
</view>
|
|
52
|
-
</
|
|
80
|
+
</block>
|
|
53
81
|
<block wx:if="{{depositOpen}}">
|
|
54
82
|
<l-popup
|
|
55
83
|
show="{{depositOpen}}"
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
.container {
|
|
2
|
-
width: 100%;
|
|
3
|
-
height: 100%;
|
|
4
|
-
display: flex;
|
|
5
|
-
flex-direction: column;
|
|
6
|
-
align-items: stretch;
|
|
7
|
-
background-color: var(--oak-bg-color-page);
|
|
8
|
-
// min-height: 500px;
|
|
9
|
-
|
|
10
|
-
.ctrl {
|
|
11
|
-
margin: 8px;
|
|
12
|
-
margin-top: 10px;
|
|
13
|
-
flex: 1;
|
|
14
|
-
|
|
15
|
-
.pc1 {
|
|
16
|
-
width: 100%;
|
|
17
|
-
height: 100%;
|
|
18
|
-
display: flex;
|
|
19
|
-
flex-direction: column;
|
|
20
|
-
margin-top: 4px;
|
|
21
|
-
|
|
22
|
-
.content {
|
|
23
|
-
background-color: var(--oak-bg-color-container);
|
|
24
|
-
padding: 4px;
|
|
25
|
-
border-radius: 2px;
|
|
26
|
-
padding: 16px;
|
|
27
|
-
|
|
28
|
-
.tips {
|
|
29
|
-
color: var(--oak-color-info);
|
|
30
|
-
font-size: small;
|
|
31
|
-
margin-top: 3px;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
1
|
+
.container {
|
|
2
|
+
width: 100%;
|
|
3
|
+
height: 100%;
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
align-items: stretch;
|
|
7
|
+
background-color: var(--oak-bg-color-page);
|
|
8
|
+
// min-height: 500px;
|
|
9
|
+
|
|
10
|
+
.ctrl {
|
|
11
|
+
margin: 8px;
|
|
12
|
+
margin-top: 10px;
|
|
13
|
+
flex: 1;
|
|
14
|
+
|
|
15
|
+
.pc1 {
|
|
16
|
+
width: 100%;
|
|
17
|
+
height: 100%;
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
margin-top: 4px;
|
|
21
|
+
|
|
22
|
+
.content {
|
|
23
|
+
background-color: var(--oak-bg-color-container);
|
|
24
|
+
padding: 4px;
|
|
25
|
+
border-radius: 2px;
|
|
26
|
+
padding: 16px;
|
|
27
|
+
|
|
28
|
+
.tips {
|
|
29
|
+
color: var(--oak-color-info);
|
|
30
|
+
font-size: small;
|
|
31
|
+
margin-top: 3px;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
36
|
}
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
.container {
|
|
2
|
-
width: 100%;
|
|
3
|
-
height: 100%;
|
|
4
|
-
display: flex;
|
|
5
|
-
flex-direction: column;
|
|
6
|
-
align-items: stretch;
|
|
7
|
-
background-color: var(--oak-bg-color-page);
|
|
8
|
-
// min-height: 500px;
|
|
9
|
-
|
|
10
|
-
.ctrl {
|
|
11
|
-
margin: 8px;
|
|
12
|
-
margin-top: 10px;
|
|
13
|
-
flex: 1;
|
|
14
|
-
|
|
15
|
-
.pc1 {
|
|
16
|
-
width: 100%;
|
|
17
|
-
height: 100%;
|
|
18
|
-
display: flex;
|
|
19
|
-
flex-direction: column;
|
|
20
|
-
margin-top: 4px;
|
|
21
|
-
|
|
22
|
-
.content {
|
|
23
|
-
background-color: var(--oak-bg-color-container);
|
|
24
|
-
padding: 4px;
|
|
25
|
-
border-radius: 2px;
|
|
26
|
-
padding: 16px;
|
|
27
|
-
|
|
28
|
-
.tips {
|
|
29
|
-
color: var(--oak-color-info);
|
|
30
|
-
font-size: small;
|
|
31
|
-
font-weight: bold;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
1
|
+
.container {
|
|
2
|
+
width: 100%;
|
|
3
|
+
height: 100%;
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
align-items: stretch;
|
|
7
|
+
background-color: var(--oak-bg-color-page);
|
|
8
|
+
// min-height: 500px;
|
|
9
|
+
|
|
10
|
+
.ctrl {
|
|
11
|
+
margin: 8px;
|
|
12
|
+
margin-top: 10px;
|
|
13
|
+
flex: 1;
|
|
14
|
+
|
|
15
|
+
.pc1 {
|
|
16
|
+
width: 100%;
|
|
17
|
+
height: 100%;
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
margin-top: 4px;
|
|
21
|
+
|
|
22
|
+
.content {
|
|
23
|
+
background-color: var(--oak-bg-color-container);
|
|
24
|
+
padding: 4px;
|
|
25
|
+
border-radius: 2px;
|
|
26
|
+
padding: 16px;
|
|
27
|
+
|
|
28
|
+
.tips {
|
|
29
|
+
color: var(--oak-color-info);
|
|
30
|
+
font-size: small;
|
|
31
|
+
font-weight: bold;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
36
|
}
|
|
@@ -37,7 +37,7 @@ function PayConfig(props) {
|
|
|
37
37
|
</Popover>}>
|
|
38
38
|
<Form labelCol={{ span: 8 }} wrapperCol={{ span: 18 }} layout="horizontal" style={{ width: '100%' }}>
|
|
39
39
|
<Form.Item label={t('payConfig.label.ratio')}>
|
|
40
|
-
<InputNumber value={depositLoss?.ratio} max={20} min={0
|
|
40
|
+
<InputNumber value={depositLoss?.ratio} max={20} min={0} addonAfter={"%"} step={0.01} precision={2} disabled={!update} onChange={(value) => {
|
|
41
41
|
const ratio = value;
|
|
42
42
|
updateDepositLoss({
|
|
43
43
|
ratio: ratio || 0
|
|
@@ -16,12 +16,12 @@ function RenderShipEntity(props) {
|
|
|
16
16
|
return (<Tabs className={Styles.container} tabPosition="left" items={entities.map((entity) => {
|
|
17
17
|
const Comp = ShipSettingComponentDict[entity];
|
|
18
18
|
return {
|
|
19
|
-
label: (<div className={Styles.systemLabel}>
|
|
20
|
-
{t(`${entity}:name`)}
|
|
19
|
+
label: (<div className={Styles.systemLabel}>
|
|
20
|
+
{t(`${entity}:name`)}
|
|
21
21
|
</div>),
|
|
22
22
|
key: entity,
|
|
23
|
-
children: (<Flex vertical>
|
|
24
|
-
<Comp systemId={oakId} oakPath={`${oakFullpath}.${entity}$system`}/>
|
|
23
|
+
children: (<Flex vertical>
|
|
24
|
+
<Comp systemId={oakId} oakPath={`${oakFullpath}.${entity}$system`}/>
|
|
25
25
|
{/* <Flex
|
|
26
26
|
gap="middle"
|
|
27
27
|
justify='end'
|
|
@@ -39,24 +39,24 @@ function RenderShipEntity(props) {
|
|
|
39
39
|
>
|
|
40
40
|
{t('common::reset')}
|
|
41
41
|
</Button>
|
|
42
|
-
</Flex> */}
|
|
42
|
+
</Flex> */}
|
|
43
43
|
</Flex>)
|
|
44
44
|
};
|
|
45
45
|
})}/>);
|
|
46
46
|
}
|
|
47
|
-
return (<Flex className={Styles.tips} vertical align="stretch">
|
|
48
|
-
<Alert type="info" message={t("tips.header")} description={t('tips.desc')}/>
|
|
49
|
-
<div className={Styles.code}>
|
|
50
|
-
<Markdown>{`
|
|
51
|
-
\`\`\`
|
|
52
|
-
import { registerShipSettingComponent } from 'oak-pay-business/es/registry';
|
|
53
|
-
import WechatMpShipSetting from 'oak-pay-business/es/components/ship/wechatMpShip';
|
|
54
|
-
registerShipSettingComponent('wechatMpShip', WechatMpShipSetting);
|
|
55
|
-
\`\`\`
|
|
56
|
-
|
|
57
|
-
`}
|
|
58
|
-
</Markdown>
|
|
59
|
-
</div>
|
|
47
|
+
return (<Flex className={Styles.tips} vertical align="stretch">
|
|
48
|
+
<Alert type="info" message={t("tips.header")} description={t('tips.desc')}/>
|
|
49
|
+
<div className={Styles.code}>
|
|
50
|
+
<Markdown>{`
|
|
51
|
+
\`\`\`
|
|
52
|
+
import { registerShipSettingComponent } from 'oak-pay-business/es/registry';
|
|
53
|
+
import WechatMpShipSetting from 'oak-pay-business/es/components/ship/wechatMpShip';
|
|
54
|
+
registerShipSettingComponent('wechatMpShip', WechatMpShipSetting);
|
|
55
|
+
\`\`\`
|
|
56
|
+
|
|
57
|
+
`}
|
|
58
|
+
</Markdown>
|
|
59
|
+
</div>
|
|
60
60
|
</Flex>);
|
|
61
61
|
}
|
|
62
62
|
export default function render(props) {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
.container {
|
|
2
|
-
width: 100%;
|
|
3
|
-
height: 100%;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
.tips {
|
|
7
|
-
width: 100%;
|
|
8
|
-
height: 100%;
|
|
9
|
-
|
|
10
|
-
.code {
|
|
11
|
-
width: 80%;
|
|
12
|
-
margin-top: 40px;
|
|
13
|
-
background-color: aquamarine;
|
|
14
|
-
align-self: center;
|
|
15
|
-
}
|
|
1
|
+
.container {
|
|
2
|
+
width: 100%;
|
|
3
|
+
height: 100%;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.tips {
|
|
7
|
+
width: 100%;
|
|
8
|
+
height: 100%;
|
|
9
|
+
|
|
10
|
+
.code {
|
|
11
|
+
width: 80%;
|
|
12
|
+
margin-top: 40px;
|
|
13
|
+
background-color: aquamarine;
|
|
14
|
+
align-self: center;
|
|
15
|
+
}
|
|
16
16
|
}
|
|
@@ -4,24 +4,24 @@ export default function render(props) {
|
|
|
4
4
|
const { wechatMpShip, applicationChangable, applications } = props.data;
|
|
5
5
|
const { t, update } = props.methods;
|
|
6
6
|
if (wechatMpShip) {
|
|
7
|
-
return (<Form labelCol={{ span: 4 }} wrapperCol={{ span: 14 }} layout="horizontal" style={{ width: '100%', margin: 28 }}>
|
|
8
|
-
<Form.Item label={t('wpProduct:name')}>
|
|
7
|
+
return (<Form labelCol={{ span: 4 }} wrapperCol={{ span: 14 }} layout="horizontal" style={{ width: '100%', margin: 28 }}>
|
|
8
|
+
<Form.Item label={t('wpProduct:name')}>
|
|
9
9
|
{applicationChangable ? <Select options={applications} value={wechatMpShip.applicationId} onChange={(value) => {
|
|
10
10
|
update({
|
|
11
11
|
applicationId: value,
|
|
12
12
|
});
|
|
13
|
-
}}/> : <Input disabled={true} value={wechatMpShip.application?.name}/>}
|
|
14
|
-
</Form.Item>
|
|
15
|
-
<Form.Item label={t('wechatMpShip:attr.disabled')} help={t('help.disabled')}>
|
|
13
|
+
}}/> : <Input disabled={true} value={wechatMpShip.application?.name}/>}
|
|
14
|
+
</Form.Item>
|
|
15
|
+
<Form.Item label={t('wechatMpShip:attr.disabled')} help={t('help.disabled')}>
|
|
16
16
|
<Switch value={!!wechatMpShip.disabled} onChange={(v) => {
|
|
17
17
|
update({
|
|
18
18
|
disabled: v,
|
|
19
19
|
});
|
|
20
|
-
}}/>
|
|
21
|
-
</Form.Item>
|
|
22
|
-
<Form.Item label={t('wechatMpShip:attr.sort')} help={t('help.sort')}>
|
|
23
|
-
<Input disabled={true} value={wechatMpShip.sort}/>
|
|
24
|
-
</Form.Item>
|
|
20
|
+
}}/>
|
|
21
|
+
</Form.Item>
|
|
22
|
+
<Form.Item label={t('wechatMpShip:attr.sort')} help={t('help.sort')}>
|
|
23
|
+
<Input disabled={true} value={wechatMpShip.sort}/>
|
|
24
|
+
</Form.Item>
|
|
25
25
|
</Form>);
|
|
26
26
|
}
|
|
27
27
|
}
|
|
@@ -17,57 +17,57 @@ export default function render(props) {
|
|
|
17
17
|
}} onOk={async () => {
|
|
18
18
|
await execute();
|
|
19
19
|
setUpsertId('');
|
|
20
|
-
}} width={720} okText={t('common::confirm')} cancelText={t('common::action.cancel')}>
|
|
21
|
-
<Upsert oakPath={`${oakFullpath}.${upsertId}`} oakId={upsertId}/>
|
|
20
|
+
}} width={720} okText={t('common::confirm')} cancelText={t('common::action.cancel')}>
|
|
21
|
+
<Upsert oakPath={`${oakFullpath}.${upsertId}`} oakId={upsertId}/>
|
|
22
22
|
</Modal>);
|
|
23
23
|
if (ships?.length) {
|
|
24
|
-
return (<div>
|
|
25
|
-
<Alert message={t('help.intro')}/>
|
|
24
|
+
return (<div>
|
|
25
|
+
<Alert message={t('help.intro')}/>
|
|
26
26
|
<Space style={{
|
|
27
27
|
marginTop: 22
|
|
28
|
-
}}>
|
|
28
|
+
}}>
|
|
29
29
|
{ships.map((ele, idx) => (<Card title={ele.application.name} extra={<Button size="small" icon={<EditOutlined />} type="text" onClick={() => {
|
|
30
30
|
setUpsertId(ele.id);
|
|
31
|
-
}}/>}>
|
|
31
|
+
}}/>}>
|
|
32
32
|
<Detail key={idx} column={1} bordered entity="wechatMpShip" attributes={[
|
|
33
33
|
"disabled",
|
|
34
34
|
"sort",
|
|
35
|
-
]} data={ele}/>
|
|
36
|
-
</Card>))}
|
|
35
|
+
]} data={ele}/>
|
|
36
|
+
</Card>))}
|
|
37
37
|
{applications.length > ships.length && <Card style={{
|
|
38
38
|
width: 245.67,
|
|
39
39
|
height: 269.41,
|
|
40
40
|
display: 'flex',
|
|
41
41
|
alignItems: 'center',
|
|
42
42
|
justifyContent: 'center'
|
|
43
|
-
}}>
|
|
43
|
+
}}>
|
|
44
44
|
<Button icon={<PlusOutlined style={{ fontSize: 32, color: 'var(--oak-color-primary)' }}/>} type="text" style={{ width: 80, height: 80 }} onClick={async () => {
|
|
45
45
|
const id = await generateNewIdAsync();
|
|
46
46
|
addItem({
|
|
47
47
|
id,
|
|
48
48
|
});
|
|
49
49
|
setUpsertId(id);
|
|
50
|
-
}}/>
|
|
51
|
-
</Card>}
|
|
52
|
-
</Space>
|
|
53
|
-
{U}
|
|
50
|
+
}}/>
|
|
51
|
+
</Card>}
|
|
52
|
+
</Space>
|
|
53
|
+
{U}
|
|
54
54
|
</div>);
|
|
55
55
|
}
|
|
56
56
|
if (applications?.length) {
|
|
57
|
-
return (<>
|
|
58
|
-
<div className={Styles.container}>
|
|
57
|
+
return (<>
|
|
58
|
+
<div className={Styles.container}>
|
|
59
59
|
<Button icon={<PlusOutlined style={{ fontSize: 72, color: 'var(--oak-color-primary)' }}/>} type="text" style={{ width: 80, height: 80 }} onClick={async () => {
|
|
60
60
|
const id = await generateNewIdAsync();
|
|
61
61
|
addItem({
|
|
62
62
|
id,
|
|
63
63
|
});
|
|
64
64
|
setUpsertId(id);
|
|
65
|
-
}}/>
|
|
66
|
-
</div>
|
|
67
|
-
{U}
|
|
65
|
+
}}/>
|
|
66
|
+
</div>
|
|
67
|
+
{U}
|
|
68
68
|
</>);
|
|
69
69
|
}
|
|
70
|
-
return (<div className={Styles.container}>
|
|
71
|
-
<Alert type="info" message={t('warning.noApplication')}/>
|
|
70
|
+
return (<div className={Styles.container}>
|
|
71
|
+
<Alert type="info" message={t('warning.noApplication')}/>
|
|
72
72
|
</div>);
|
|
73
73
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
.container {
|
|
2
|
-
width: 100%;
|
|
3
|
-
height: 100%;
|
|
4
|
-
display: flex;
|
|
5
|
-
align-items: center;
|
|
6
|
-
justify-content: center;
|
|
7
|
-
min-height: 30vh;
|
|
1
|
+
.container {
|
|
2
|
+
width: 100%;
|
|
3
|
+
height: 100%;
|
|
4
|
+
display: flex;
|
|
5
|
+
align-items: center;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
min-height: 30vh;
|
|
8
8
|
}
|
package/es/config/constants.d.ts
CHANGED