oak-pay-business 1.1.1 → 2.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/checkers/account.js +14 -1
- package/es/checkers/accountOper.js +6 -0
- package/es/checkers/pay.js +13 -1
- package/es/components/AbstractComponents.d.ts +2 -2
- package/es/components/offlineAccount/config/web.pc.js +1 -1
- package/es/components/offlineAccount/upsert/index.js +3 -2
- package/es/components/offlineAccount/upsert/locales/zh-CN.json +3 -2
- package/es/components/offlineAccount/upsert/web.pc.js +15 -9
- package/es/components/order/pay/index.js +9 -10
- package/es/components/order/pay/index.json +1 -1
- package/es/components/order/pay/index.xml +4 -6
- package/es/components/order/pay/web.d.ts +5 -4
- package/es/components/order/pay/web.js +5 -11
- package/es/components/order/pay/web.pc.d.ts +5 -4
- package/es/components/order/pay/web.pc.js +5 -11
- package/es/components/pay/detail/index.xml +1 -1
- package/es/components/pay/detail/web.js +1 -1
- package/es/components/pay/list/web.pc.js +22 -19
- package/es/components/payConfig/system/index.js +1 -0
- package/es/components/payConfig/system/locales/zh-CN.json +20 -3
- package/es/components/payConfig/system/web.pc.js +135 -4
- package/es/components/payConfig/system/web.pc.module.less +4 -0
- package/es/components/wpAccount/config/index.js +1 -3
- package/es/components/wpAccount/config/web.pc.js +2 -4
- package/es/components/wpAccount/upsert/index.js +3 -4
- package/es/components/wpAccount/upsert/locales/zh-CN.json +3 -4
- package/es/components/wpAccount/upsert/web.pc.js +9 -25
- package/es/components/wpProduct/upsert/locales/zh-CN.json +1 -1
- package/es/components/wpProduct/upsert/web.pc.js +4 -4
- package/es/configuration/attrUpdateMatrix.js +11 -2
- package/es/data/i18n.js +30 -11
- package/es/entities/AbstractAccount.d.ts +3 -7
- package/es/entities/AbstractAccount.js +2 -16
- package/es/entities/AccountOper.d.ts +1 -1
- package/es/entities/AccountOper.js +2 -0
- package/es/entities/OfflineAccount.d.ts +0 -7
- package/es/entities/OfflineAccount.js +2 -7
- package/es/entities/Pay.d.ts +1 -0
- package/es/entities/Pay.js +1 -0
- package/es/entities/System.d.ts +16 -0
- package/es/entities/System.js +1 -0
- package/es/entities/WpAccount.d.ts +1 -3
- package/es/entities/WpAccount.js +2 -16
- package/es/entities/WpProduct.d.ts +1 -1
- package/es/entities/WpProduct.js +1 -1
- package/es/features/Pay.js +1 -1
- package/es/locales/common/zh_CN.json +3 -1
- package/es/oak-app-domain/AbstractAccount/Schema.d.ts +11 -23
- package/es/oak-app-domain/AbstractAccount/Storage.js +5 -16
- package/es/oak-app-domain/AbstractAccount/Style.js +0 -6
- package/es/oak-app-domain/AbstractAccount/locales/zh_CN.json +1 -1
- package/es/oak-app-domain/Account/Schema.d.ts +0 -16
- package/es/oak-app-domain/AccountOper/Schema.d.ts +1 -1
- package/es/oak-app-domain/AccountOper/Storage.js +1 -1
- package/es/oak-app-domain/AccountOper/Style.js +1 -0
- package/es/oak-app-domain/AccountOper/locales/zh_CN.json +1 -1
- package/es/oak-app-domain/OfflineAccount/Schema.d.ts +10 -38
- package/es/oak-app-domain/OfflineAccount/Storage.js +5 -16
- package/es/oak-app-domain/OfflineAccount/locales/zh_CN.json +1 -1
- package/es/oak-app-domain/Pay/Schema.d.ts +6 -0
- package/es/oak-app-domain/Pay/Storage.js +3 -0
- package/es/oak-app-domain/Pay/locales/zh_CN.json +1 -1
- package/es/oak-app-domain/System/Schema.d.ts +20 -0
- package/es/oak-app-domain/System/Storage.js +5 -1
- package/es/oak-app-domain/System/locales/zh_CN.json +1 -1
- package/es/oak-app-domain/WithdrawAccount/Schema.d.ts +0 -6
- package/es/oak-app-domain/WpAccount/Schema.d.ts +11 -23
- package/es/oak-app-domain/WpAccount/Storage.js +5 -16
- package/es/oak-app-domain/WpAccount/Style.js +0 -6
- package/es/oak-app-domain/WpAccount/locales/zh_CN.json +1 -1
- package/es/oak-app-domain/WpProduct/Schema.d.ts +5 -5
- package/es/oak-app-domain/WpProduct/Storage.js +1 -1
- package/es/oak-app-domain/WpProduct/locales/zh_CN.json +1 -1
- package/es/triggers/pay.d.ts +2 -2
- package/es/triggers/pay.js +128 -47
- package/es/triggers/refund.js +5 -5
- package/es/types/PayClazz.d.ts +1 -0
- package/es/utils/application.js +8 -7
- package/es/utils/pay.d.ts +2 -4
- package/es/utils/pay.js +41 -72
- package/es/utils/payClazz/Account.d.ts +1 -0
- package/es/utils/payClazz/Account.js +4 -0
- package/es/utils/payClazz/Offline.d.ts +4 -0
- package/es/utils/payClazz/Offline.js +9 -0
- package/es/utils/payClazz/WechatPay/WechatPay.d.ts +1 -0
- package/es/utils/payClazz/WechatPay/WechatPay.debug.d.ts +1 -0
- package/es/utils/payClazz/WechatPay/WechatPay.debug.js +4 -2
- package/es/utils/payClazz/WechatPay/WechatPay.js +6 -5
- package/es/utils/payClazz/index.js +27 -1
- package/lib/checkers/index.d.ts +1 -1
- package/lib/checkers/pay.js +12 -0
- package/lib/components/payConfig/system/web.pc.js +1 -1
- package/lib/configuration/attrUpdateMatrix.js +3 -0
- package/lib/entities/Pay.d.ts +1 -0
- package/lib/entities/Pay.js +1 -0
- package/lib/oak-app-domain/Pay/Schema.d.ts +6 -0
- package/lib/oak-app-domain/Pay/Storage.js +3 -0
- package/lib/oak-app-domain/Pay/locales/zh_CN.json +1 -1
- package/lib/oak-app-domain/System/Storage.js +4 -5
- package/lib/oak-app-domain/WpAccount/Style.js +0 -6
- package/lib/ports/index.d.ts +1 -1
- package/lib/routines/start.d.ts +1 -1
- package/lib/timers/index.d.ts +1 -1
- package/lib/triggers/index.d.ts +1 -1
- package/lib/triggers/pay.js +30 -1
- package/lib/types/Exception.d.ts +1 -1
- package/lib/types/PayClazz.d.ts +1 -0
- package/lib/utils/payClazz/Account.d.ts +1 -0
- package/lib/utils/payClazz/Account.js +4 -0
- package/lib/utils/payClazz/Offline.d.ts +4 -0
- package/lib/utils/payClazz/Offline.js +9 -0
- package/lib/utils/payClazz/WechatPay/WechatPay.d.ts +1 -0
- package/lib/utils/payClazz/WechatPay/WechatPay.debug.d.ts +1 -0
- package/lib/utils/payClazz/WechatPay/WechatPay.debug.js +4 -2
- package/lib/utils/payClazz/WechatPay/WechatPay.js +6 -5
- package/lib/utils/payClazz/index.js +27 -1
- package/lib/watchers/index.d.ts +1 -1
- package/package.json +4 -4
package/es/checkers/account.js
CHANGED
|
@@ -81,6 +81,12 @@ const checkers = [
|
|
|
81
81
|
}
|
|
82
82
|
break;
|
|
83
83
|
}
|
|
84
|
+
case 'tax': {
|
|
85
|
+
if (totalPlus >= 0 || availPlus >= 0 || totalPlus !== availPlus) {
|
|
86
|
+
throw new OakInputIllegalException('accountOper', ['totalPlus', 'availPlus'], 'accountOper为tax时,其totalPlus/availPlus必须为负且相等');
|
|
87
|
+
}
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
84
90
|
default: {
|
|
85
91
|
assert(false);
|
|
86
92
|
break;
|
package/es/checkers/pay.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OakInputIllegalException } from 'oak-domain/lib/types';
|
|
1
|
+
import { OakAttrNotNullException, OakInputIllegalException } from 'oak-domain/lib/types';
|
|
2
2
|
import { pipeline } from 'oak-domain/lib/utils/executor';
|
|
3
3
|
import assert from 'assert';
|
|
4
4
|
const checkers = [
|
|
@@ -98,6 +98,18 @@ const checkers = [
|
|
|
98
98
|
};
|
|
99
99
|
}
|
|
100
100
|
},
|
|
101
|
+
{
|
|
102
|
+
entity: 'pay',
|
|
103
|
+
action: 'succeedPaying',
|
|
104
|
+
type: 'data',
|
|
105
|
+
checker(data) {
|
|
106
|
+
assert(!(data instanceof Array));
|
|
107
|
+
const { successAt } = data;
|
|
108
|
+
if (!successAt) {
|
|
109
|
+
throw new OakAttrNotNullException('pay', ['successAt']);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
},
|
|
101
113
|
{
|
|
102
114
|
// 如果在开始支付或者继续支付过程中,paid达到了price,pay的状态可以改为paid
|
|
103
115
|
entity: 'pay',
|
|
@@ -58,14 +58,14 @@ declare const Detail: <T extends keyof EntityDict>(props: ReactComponentProps<En
|
|
|
58
58
|
data: Partial<EntityDict[T]["Schema"]>;
|
|
59
59
|
title?: string | undefined;
|
|
60
60
|
bordered?: boolean | undefined;
|
|
61
|
-
layout?: "
|
|
61
|
+
layout?: "horizontal" | "vertical" | undefined;
|
|
62
62
|
}>) => React.ReactElement;
|
|
63
63
|
declare const Upsert: <T extends keyof EntityDict>(props: ReactComponentProps<EntityDict, T, false, {
|
|
64
64
|
helps: Record<string, string>;
|
|
65
65
|
entity: T;
|
|
66
66
|
attributes: OakAbsAttrUpsertDef<EntityDict, T, string | number>[];
|
|
67
67
|
data: EntityDict[T]["Schema"];
|
|
68
|
-
layout: "
|
|
68
|
+
layout: "horizontal" | "vertical";
|
|
69
69
|
mode: "default" | "card";
|
|
70
70
|
}>) => React.ReactElement;
|
|
71
71
|
export { FilterPanel, List, ListPro, Detail, Upsert, ReactComponentProps, ColumnProps, RowWithActions, OakExtraActionProps, OakAbsAttrDef, onActionFnDef, };
|
|
@@ -41,7 +41,7 @@ export default function render(props) {
|
|
|
41
41
|
return t('notnull', { value: t(`offlineAccount:attr.${attr}`) });
|
|
42
42
|
};
|
|
43
43
|
const errMsg = oakExecutable instanceof OakException && (oakExecutable instanceof OakAttrNotNullException ? getNotNullMessage(oakExecutable.getAttributes()[0]) : t(oakExecutable.message));
|
|
44
|
-
const U = (<Modal destroyOnClose width={
|
|
44
|
+
const U = (<Modal destroyOnClose width={920} title={`${t('offlineAccount:name')}${t('common::action.add')}`} open={!!upsertId} onCancel={() => {
|
|
45
45
|
clean();
|
|
46
46
|
setUpsertId('');
|
|
47
47
|
}} closeIcon={null} onOk={async () => {
|
|
@@ -18,8 +18,9 @@
|
|
|
18
18
|
"shouqianba": "请将二维码解析后的字符串填入",
|
|
19
19
|
"others": "请将二维码解析后的字符串填入"
|
|
20
20
|
},
|
|
21
|
-
"
|
|
22
|
-
"
|
|
21
|
+
"taxLossRatio": "渠道收款时收取的手续费百分比,0.6代表千分之六",
|
|
22
|
+
"refundGapDays": "超过这个天数后将无法退款",
|
|
23
|
+
"refundCompensateRatio": "渠道退款时,返回的手续费比例(50代表渠道将返回当时收取的手续费的一半)"
|
|
23
24
|
},
|
|
24
25
|
"help": {
|
|
25
26
|
"allowDeposit": "是否允许用户在系统中主动向此账号发起充值",
|
|
@@ -4,7 +4,7 @@ export default function render(props) {
|
|
|
4
4
|
const { offlineAccount } = props.data;
|
|
5
5
|
const { t, update } = props.methods;
|
|
6
6
|
if (offlineAccount) {
|
|
7
|
-
return (<Form labelCol={{ span:
|
|
7
|
+
return (<Form labelCol={{ span: 8 }} wrapperCol={{ span: 12 }} layout="horizontal" style={{ minWidth: 860 }}>
|
|
8
8
|
<Form.Item label={t('offlineAccount:attr.type')} required>
|
|
9
9
|
<Select value={offlineAccount.type} options={['bank', 'alipay', 'wechat', 'shouqianba', 'others'].map(ele => ({
|
|
10
10
|
label: t(`offlineAccount:v.type.${ele}`),
|
|
@@ -41,16 +41,22 @@ export default function render(props) {
|
|
|
41
41
|
});
|
|
42
42
|
}} placeholder={t(`placeholder.qrCode.${offlineAccount.type}`)}/>}
|
|
43
43
|
</Form.Item>}
|
|
44
|
-
<Form.Item label={t('offlineAccount:attr.
|
|
45
|
-
<InputNumber value={offlineAccount.
|
|
46
|
-
const
|
|
47
|
-
update({
|
|
44
|
+
<Form.Item label={t('offlineAccount:attr.taxLossRatio')} help={t('placeholder.taxLossRatio')}>
|
|
45
|
+
<InputNumber value={offlineAccount.taxLossRatio} max={5} min={0.01} addonAfter={"%"} step={0.01} precision={2} onChange={(value) => {
|
|
46
|
+
const taxLossRatio = value;
|
|
47
|
+
update({ taxLossRatio });
|
|
48
48
|
}}/>
|
|
49
49
|
</Form.Item>
|
|
50
|
-
<Form.Item label={t('offlineAccount:attr.
|
|
51
|
-
<InputNumber value={offlineAccount.
|
|
52
|
-
const
|
|
53
|
-
update({
|
|
50
|
+
<Form.Item label={t('offlineAccount:attr.refundGapDays')} help={t('placeholder.refundGapDays')}>
|
|
51
|
+
<InputNumber value={offlineAccount.refundGapDays} max={365} min={7} addonAfter={"天"} step={1} onChange={(value) => {
|
|
52
|
+
const refundGapDays = value;
|
|
53
|
+
update({ refundGapDays });
|
|
54
|
+
}}/>
|
|
55
|
+
</Form.Item>
|
|
56
|
+
<Form.Item label={t('offlineAccount:attr.refundCompensateRatio')} help={t('placeholder.refundCompensateRatio')}>
|
|
57
|
+
<InputNumber value={offlineAccount.refundCompensateRatio} max={100} min={1} addonAfter={"%"} step={1} onChange={(value) => {
|
|
58
|
+
const refundCompensateRatio = value;
|
|
59
|
+
update({ refundCompensateRatio });
|
|
54
60
|
}}/>
|
|
55
61
|
</Form.Item>
|
|
56
62
|
{!!offlineAccount.type && <Form.Item label={t('offlineAccount:attr.allowDeposit')} required help={t('help.allowDeposit')}>
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { PAY_CHANNEL_ACCOUNT_NAME } from "../../../types/PayConfig";
|
|
2
1
|
import { generateNewId } from "oak-domain/lib/utils/uuid";
|
|
3
2
|
import { ToCent, ToYuan } from "oak-domain/lib/utils/money";
|
|
4
3
|
export default OakComponent({
|
|
@@ -15,6 +14,8 @@ export default OakComponent({
|
|
|
15
14
|
price: 1,
|
|
16
15
|
paid: 1,
|
|
17
16
|
iState: 1,
|
|
17
|
+
entity: 1,
|
|
18
|
+
entityId: 1,
|
|
18
19
|
},
|
|
19
20
|
filter: {
|
|
20
21
|
iState: 'paying',
|
|
@@ -28,9 +29,7 @@ export default OakComponent({
|
|
|
28
29
|
onSetPays: (pays) => undefined,
|
|
29
30
|
},
|
|
30
31
|
formData({ data }) {
|
|
31
|
-
const
|
|
32
|
-
const accountConfig = payConfig?.find(ele => ele.channel === PAY_CHANNEL_ACCOUNT_NAME);
|
|
33
|
-
const payConfig2 = payConfig?.filter(ele => ele !== accountConfig);
|
|
32
|
+
const payChannels = features.pay.getPayChannels('pay');
|
|
34
33
|
const activePay = data && data.pay$order?.[0];
|
|
35
34
|
const { accountPrice } = this.state;
|
|
36
35
|
const { accountAvailMax } = this.props;
|
|
@@ -40,11 +39,10 @@ export default OakComponent({
|
|
|
40
39
|
accountAvailMaxStr: accountAvailMax && ToYuan(accountAvailMax),
|
|
41
40
|
order: data,
|
|
42
41
|
activePay,
|
|
43
|
-
accountConfig,
|
|
44
|
-
payConfig: payConfig2,
|
|
45
42
|
rest,
|
|
46
43
|
restYuan: ToYuan(rest),
|
|
47
44
|
legal: !!(data?.['#oakLegalActions']?.includes('startPaying')),
|
|
45
|
+
payChannels,
|
|
48
46
|
};
|
|
49
47
|
},
|
|
50
48
|
features: ['application'],
|
|
@@ -52,7 +50,7 @@ export default OakComponent({
|
|
|
52
50
|
useAccount: false,
|
|
53
51
|
accountPrice: 0,
|
|
54
52
|
accountPriceYuan: 0,
|
|
55
|
-
channel:
|
|
53
|
+
channel: undefined,
|
|
56
54
|
restYuan: 0,
|
|
57
55
|
meta: undefined,
|
|
58
56
|
onPickMp(channel) {
|
|
@@ -127,9 +125,9 @@ export default OakComponent({
|
|
|
127
125
|
if (useAccount && accountPrice) {
|
|
128
126
|
pays.push({
|
|
129
127
|
id: generateNewId(),
|
|
130
|
-
|
|
128
|
+
entity: 'account',
|
|
129
|
+
entityId: accountId,
|
|
131
130
|
price: accountPrice,
|
|
132
|
-
accountId,
|
|
133
131
|
});
|
|
134
132
|
rest = rest - accountPrice;
|
|
135
133
|
}
|
|
@@ -137,7 +135,8 @@ export default OakComponent({
|
|
|
137
135
|
payId = generateNewId();
|
|
138
136
|
pays.push({
|
|
139
137
|
id: payId,
|
|
140
|
-
channel,
|
|
138
|
+
entity: channel.entity,
|
|
139
|
+
entityId: channel.entityId,
|
|
141
140
|
meta,
|
|
142
141
|
price: rest,
|
|
143
142
|
});
|
|
@@ -12,6 +12,6 @@
|
|
|
12
12
|
"l-icon": "@oak-frontend-base/miniprogram_npm/lin-ui/icon/index",
|
|
13
13
|
"l-button": "@oak-frontend-base/miniprogram_npm/lin-ui/button/index",
|
|
14
14
|
"l-switch": "@oak-frontend-base/miniprogram_npm/lin-ui/switch/index",
|
|
15
|
-
"channel-picker": "../../pay/
|
|
15
|
+
"channel-picker": "../../pay/channelPicker2"
|
|
16
16
|
}
|
|
17
17
|
}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
>
|
|
10
10
|
</l-status-show>
|
|
11
11
|
</view>
|
|
12
|
-
<view wx:elif="{{activePay}}" class="error-container">
|
|
12
|
+
<view wx:elif="{{activePay}}" class="error-container">
|
|
13
13
|
<l-status-show
|
|
14
14
|
show="{{true}}"
|
|
15
15
|
type="order"
|
|
@@ -52,18 +52,16 @@
|
|
|
52
52
|
</view>
|
|
53
53
|
</view>
|
|
54
54
|
<view wx:if="{{rest}}" class="ctrl">
|
|
55
|
-
<view class="pc1">
|
|
55
|
+
<view class="pc1">
|
|
56
56
|
<view class="text">
|
|
57
57
|
请选择支付方式({{restYuan}}元):
|
|
58
58
|
</view>
|
|
59
59
|
</view>
|
|
60
60
|
<view class="pc2">
|
|
61
61
|
<channel-picker
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
meta="{{meta}}"
|
|
62
|
+
payChannels="{{payChannels}}"
|
|
63
|
+
payChannel="{{channel}}"
|
|
65
64
|
onPick="{{onPickMp}}"
|
|
66
|
-
onSetMeta="{{onSetMetaMp}}"
|
|
67
65
|
/>
|
|
68
66
|
</view>
|
|
69
67
|
</view>
|
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { WebComponentProps } from 'oak-frontend-base';
|
|
3
3
|
import { EntityDict } from '../../../oak-app-domain';
|
|
4
|
-
import { AccountPayConfig
|
|
4
|
+
import { AccountPayConfig } from '../../../types/PayConfig';
|
|
5
|
+
import { PayChannel, PayChannels } from '../../../types/Pay';
|
|
5
6
|
export default function Render(props: WebComponentProps<EntityDict, 'order', false, {
|
|
6
7
|
accountId?: string;
|
|
7
8
|
accountAvailMax: number;
|
|
8
9
|
order: EntityDict['order']['OpSchema'];
|
|
9
10
|
activePay?: EntityDict['pay']['OpSchema'];
|
|
10
11
|
accountConfig?: AccountPayConfig;
|
|
11
|
-
|
|
12
|
+
payChannels?: PayChannels;
|
|
13
|
+
channel?: PayChannel;
|
|
12
14
|
accountPrice: number;
|
|
13
|
-
channel?: string;
|
|
14
15
|
meta?: object;
|
|
15
16
|
useAccount: boolean;
|
|
16
17
|
rest: number;
|
|
17
18
|
legal: false;
|
|
18
19
|
}, {
|
|
19
20
|
setAccountPrice: (price: number) => void;
|
|
20
|
-
onPickChannel: (channel:
|
|
21
|
+
onPickChannel: (channel: PayChannel) => void;
|
|
21
22
|
onSetChannelMeta: (meta?: object) => void;
|
|
22
23
|
switchUseAccount: () => void;
|
|
23
24
|
}>): React.JSX.Element | null;
|
|
@@ -1,25 +1,19 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ToYuan, ToCent } from 'oak-domain/lib/utils/money';
|
|
3
3
|
import Styles from './web.mobile.module.less';
|
|
4
|
-
|
|
4
|
+
import PayChannelPicker from '../../pay/channelPicker2';
|
|
5
5
|
import { InputNumber } from 'antd';
|
|
6
6
|
import { Checkbox, Divider, ErrorBlock } from 'antd-mobile';
|
|
7
7
|
import Info from './info';
|
|
8
8
|
function RenderPayChannel(props) {
|
|
9
|
-
const { price,
|
|
9
|
+
const { price, payChannels, t, channel, meta, onPick, } = props;
|
|
10
10
|
return (<div className={Styles.pc1}>
|
|
11
11
|
<div className={Styles.content}>
|
|
12
12
|
<div>
|
|
13
13
|
{t('choose', { price: ToYuan(price) })}
|
|
14
14
|
</div>
|
|
15
15
|
<Divider />
|
|
16
|
-
{
|
|
17
|
-
payConfig={payConfig}
|
|
18
|
-
channel={channel}
|
|
19
|
-
meta={meta}
|
|
20
|
-
onPick={onPick}
|
|
21
|
-
onSetMeta={onSetMeta}
|
|
22
|
-
/> */}
|
|
16
|
+
<PayChannelPicker payChannels={payChannels} payChannel={channel} onPick={onPick}/>
|
|
23
17
|
</div>
|
|
24
18
|
</div>);
|
|
25
19
|
}
|
|
@@ -45,7 +39,7 @@ function RenderAccountPay(props) {
|
|
|
45
39
|
</div>);
|
|
46
40
|
}
|
|
47
41
|
export default function Render(props) {
|
|
48
|
-
const { accountId, accountAvailMax, legal, accountPrice, useAccount, order, activePay,
|
|
42
|
+
const { accountId, accountAvailMax, legal, accountPrice, useAccount, order, activePay, payChannels, channel, meta, rest } = props.data;
|
|
49
43
|
const { t, setAccountPrice, onPickChannel, onSetChannelMeta, switchUseAccount } = props.methods;
|
|
50
44
|
if (order) {
|
|
51
45
|
if (activePay) {
|
|
@@ -60,7 +54,7 @@ export default function Render(props) {
|
|
|
60
54
|
<RenderAccountPay max={Math.min(accountAvailMax, rest + accountPrice)} t={t} setAccountPrice={setAccountPrice} useAccount={useAccount} switchUseAccount={switchUseAccount} accountPrice={accountPrice} accountAvail={accountAvailMax}/>
|
|
61
55
|
</div>}
|
|
62
56
|
{!!(rest && rest > 0) && <div className={Styles.ctrl}>
|
|
63
|
-
<RenderPayChannel
|
|
57
|
+
<RenderPayChannel price={rest} t={t} payChannels={payChannels} channel={channel} meta={meta} onPick={onPickChannel}/>
|
|
64
58
|
</div>}
|
|
65
59
|
</div>);
|
|
66
60
|
}
|
|
@@ -1,23 +1,24 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { WebComponentProps } from 'oak-frontend-base';
|
|
3
3
|
import { EntityDict } from '../../../oak-app-domain';
|
|
4
|
-
import { AccountPayConfig
|
|
4
|
+
import { AccountPayConfig } from '../../../types/PayConfig';
|
|
5
|
+
import { PayChannel, PayChannels } from '../../../types/Pay';
|
|
5
6
|
export default function Render(props: WebComponentProps<EntityDict, 'order', false, {
|
|
6
7
|
accountId?: string;
|
|
7
8
|
accountAvailMax: number;
|
|
8
9
|
order: EntityDict['order']['OpSchema'];
|
|
9
10
|
activePay?: EntityDict['pay']['OpSchema'];
|
|
10
11
|
accountConfig?: AccountPayConfig;
|
|
11
|
-
|
|
12
|
+
payChannels?: PayChannels;
|
|
13
|
+
channel?: PayChannel;
|
|
12
14
|
accountPrice: number;
|
|
13
|
-
channel?: string;
|
|
14
15
|
meta?: object;
|
|
15
16
|
useAccount: boolean;
|
|
16
17
|
rest: number;
|
|
17
18
|
legal: false;
|
|
18
19
|
}, {
|
|
19
20
|
setAccountPrice: (price: number) => void;
|
|
20
|
-
onPickChannel: (channel:
|
|
21
|
+
onPickChannel: (channel: PayChannel) => void;
|
|
21
22
|
onSetChannelMeta: (meta?: object) => void;
|
|
22
23
|
switchUseAccount: () => void;
|
|
23
24
|
}>): React.JSX.Element | null;
|
|
@@ -1,24 +1,18 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ToYuan, ToCent } from 'oak-domain/lib/utils/money';
|
|
3
3
|
import Styles from './web.pc.module.less';
|
|
4
|
-
|
|
4
|
+
import PayChannelPicker from '../../pay/channelPicker2';
|
|
5
5
|
import { Divider, Checkbox, InputNumber, Flex, Result } from 'antd';
|
|
6
6
|
import Info from './info';
|
|
7
7
|
function RenderPayChannel(props) {
|
|
8
|
-
const { price,
|
|
8
|
+
const { price, payChannels, t, channel, meta, onPick, } = props;
|
|
9
9
|
return (<div className={Styles.pc1}>
|
|
10
10
|
<div className={Styles.content}>
|
|
11
11
|
<div>
|
|
12
12
|
{t('choose', { price: ToYuan(price) })}
|
|
13
13
|
</div>
|
|
14
14
|
<Divider />
|
|
15
|
-
{
|
|
16
|
-
payConfig={payConfig}
|
|
17
|
-
channel={channel}
|
|
18
|
-
meta={meta}
|
|
19
|
-
onPick={onPick}
|
|
20
|
-
onSetMeta={onSetMeta}
|
|
21
|
-
/> */}
|
|
15
|
+
<PayChannelPicker payChannels={payChannels} payChannel={channel} onPick={onPick}/>
|
|
22
16
|
</div>
|
|
23
17
|
</div>);
|
|
24
18
|
}
|
|
@@ -44,7 +38,7 @@ function RenderAccountPay(props) {
|
|
|
44
38
|
</div>);
|
|
45
39
|
}
|
|
46
40
|
export default function Render(props) {
|
|
47
|
-
const { accountId, accountAvailMax, legal, accountPrice, useAccount, order, activePay,
|
|
41
|
+
const { accountId, accountAvailMax, legal, accountPrice, useAccount, order, activePay, payChannels, channel, meta, rest } = props.data;
|
|
48
42
|
const { t, setAccountPrice, onPickChannel, onSetChannelMeta, switchUseAccount } = props.methods;
|
|
49
43
|
if (order) {
|
|
50
44
|
if (activePay) {
|
|
@@ -59,7 +53,7 @@ export default function Render(props) {
|
|
|
59
53
|
<RenderAccountPay max={Math.min(accountAvailMax, rest + accountPrice)} t={t} setAccountPrice={setAccountPrice} useAccount={useAccount} switchUseAccount={switchUseAccount} accountPrice={accountPrice} accountAvail={accountAvailMax}/>
|
|
60
54
|
</div>}
|
|
61
55
|
{!!(rest && rest > 0) && <div className={Styles.ctrl}>
|
|
62
|
-
<RenderPayChannel
|
|
56
|
+
<RenderPayChannel price={rest} t={t} payChannels={payChannels} channel={channel} meta={meta} onPick={onPickChannel}/>
|
|
63
57
|
</div>}
|
|
64
58
|
</div>);
|
|
65
59
|
}
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<view class="list">
|
|
10
10
|
<l-list title="{{t('type.label')}}" icon="warning" right-desc="{{t('type.' + type)}}" is-link="{{false}}" />
|
|
11
11
|
<l-list title="{{t('pay:attr.price')}}" icon="cart" right-desc="{{priceStr}}" is-link="{{false}}" />
|
|
12
|
-
<l-list title="{{t('pay:attr.
|
|
12
|
+
<l-list title="{{t('pay:attr.entity')}}" icon="research" right-desc="{{t('payChannel::' + pay.entity)}}" is-link="{{false}}" />
|
|
13
13
|
</view>
|
|
14
14
|
</view>
|
|
15
15
|
<view class="meta">
|
|
@@ -182,7 +182,7 @@ export default function Render(props) {
|
|
|
182
182
|
{t('pay:attr.price')}
|
|
183
183
|
</List.Item>
|
|
184
184
|
<List.Item prefix={<GlobalOutline />} extra={t(`payChannel::${entity}`)}>
|
|
185
|
-
{t('pay:attr.
|
|
185
|
+
{t('pay:attr.entity')}
|
|
186
186
|
</List.Item>
|
|
187
187
|
</List>
|
|
188
188
|
</div>
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import { Tag, Modal, Alert, Divider, Button } from 'antd';
|
|
2
|
+
import { Input, DatePicker, Form, Tag, Modal, Alert, Divider, Button } from 'antd';
|
|
3
3
|
import Styles from './web.pc.module.less';
|
|
4
4
|
import ListPro from 'oak-frontend-base/es/components/listPro';
|
|
5
5
|
import { RenderOffline } from '../detail/web.pc';
|
|
6
|
-
import { generateNewId
|
|
6
|
+
import { generateNewId } from 'oak-domain/lib/utils/uuid';
|
|
7
|
+
import { ToYuan } from 'oak-domain/lib/utils/money';
|
|
7
8
|
export default function Render(props) {
|
|
8
|
-
const { pays, offlines } = props.data;
|
|
9
|
+
const { pays, offlines, oakExecutable } = props.data;
|
|
9
10
|
const { t, execute, updateItem, setMessage, clean } = props.methods;
|
|
10
11
|
const [spId, setSpId] = useState('');
|
|
11
12
|
if (pays) {
|
|
@@ -108,6 +109,9 @@ export default function Render(props) {
|
|
|
108
109
|
});
|
|
109
110
|
}
|
|
110
111
|
else {
|
|
112
|
+
updateItem({
|
|
113
|
+
paid: row.price,
|
|
114
|
+
}, row.id, 'succeedPaying');
|
|
111
115
|
setSpId(row.id);
|
|
112
116
|
}
|
|
113
117
|
}
|
|
@@ -123,24 +127,23 @@ export default function Render(props) {
|
|
|
123
127
|
entity: 'offlineAccount',
|
|
124
128
|
entityId
|
|
125
129
|
}, spId)}/>
|
|
130
|
+
<Divider style={{ width: '80%', alignSelf: 'flex-end' }}/>
|
|
131
|
+
<Form labelCol={{ span: 8 }} wrapperCol={{ span: 12 }} layout="horizontal" style={{ width: '100%', marginTop: 12 }}>
|
|
132
|
+
<Form.Item label={t('pay:attr.price')}>
|
|
133
|
+
<Input value={ToYuan(spRow.price)} addonBefore={t('common::pay.symbol')} disabled={true}/>
|
|
134
|
+
</Form.Item>
|
|
135
|
+
<Form.Item label={t('pay:attr.successAt')}>
|
|
136
|
+
<DatePicker showTime onChange={(value, dateString) => {
|
|
137
|
+
updateItem({
|
|
138
|
+
successAt: value?.valueOf(),
|
|
139
|
+
}, spId);
|
|
140
|
+
}}/>
|
|
141
|
+
</Form.Item>
|
|
142
|
+
</Form>
|
|
126
143
|
<div className={Styles.btn}>
|
|
127
|
-
<Button type="primary" onClick={async () => {
|
|
144
|
+
<Button disabled={oakExecutable !== true} type="primary" onClick={async () => {
|
|
128
145
|
const spRow = pays.find(ele => ele.id === spId);
|
|
129
|
-
await execute(
|
|
130
|
-
{
|
|
131
|
-
entity: 'pay',
|
|
132
|
-
operation: {
|
|
133
|
-
id: await generateNewIdAsync(),
|
|
134
|
-
action: 'succeedPaying',
|
|
135
|
-
data: {
|
|
136
|
-
paid: spRow.price,
|
|
137
|
-
},
|
|
138
|
-
filter: {
|
|
139
|
-
id: spId,
|
|
140
|
-
},
|
|
141
|
-
},
|
|
142
|
-
}
|
|
143
|
-
]);
|
|
146
|
+
await execute();
|
|
144
147
|
setSpId('');
|
|
145
148
|
}}>
|
|
146
149
|
{t('common::confirm')}
|
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
{
|
|
2
|
-
"system": "
|
|
3
|
-
"
|
|
4
|
-
"
|
|
2
|
+
"system": "系统相关配置",
|
|
3
|
+
"help": "说明",
|
|
4
|
+
"payConfig": {
|
|
5
|
+
"label": {
|
|
6
|
+
"depositLoss": "充值手续费",
|
|
7
|
+
"withdrawLoss": "提现手续费",
|
|
8
|
+
"conservative": "保守策略",
|
|
9
|
+
"ratio": "按比例",
|
|
10
|
+
"lowest": "最低(分)",
|
|
11
|
+
"highest": "最高(分)",
|
|
12
|
+
"trim": "去尾",
|
|
13
|
+
"jiao": "角",
|
|
14
|
+
"yuan": "元",
|
|
15
|
+
"null": "不去尾"
|
|
16
|
+
},
|
|
17
|
+
"help": {
|
|
18
|
+
"depositLoss": "若不配置手续费,用户充值时渠道的手续费损失将被计算到system关联的账户之中",
|
|
19
|
+
"withdrawLoss": "若配置为保守策略,系统将自动计算渠道的损耗,在system账户不贴现的前提下让用户可提现的额度最大化"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
5
22
|
}
|