oak-pay-business 1.0.3 → 1.0.4
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/deposit/index.js +22 -1
- package/es/components/account/deposit/index.json +9 -1
- package/es/components/account/deposit/index.less +10 -0
- package/es/components/account/deposit/index.xml +24 -0
- package/es/components/account/deposit/web.d.ts +1 -0
- package/es/components/account/deposit/web.js +12 -12
- package/es/components/account/deposit/web.pc.d.ts +1 -0
- package/es/components/account/deposit/web.pc.js +10 -10
- package/es/components/account/detail/index.js +89 -23
- package/es/components/account/detail/index.json +8 -1
- package/es/components/account/detail/index.less +80 -0
- package/es/components/account/detail/index.xml +69 -0
- package/es/components/account/detail/web.d.ts +21 -1
- package/es/components/account/detail/web.js +67 -1
- package/es/components/account/detail/web.mobile.module.less +52 -0
- package/es/components/account/detail/web.pc.d.ts +15 -1
- package/es/components/account/detail/web.pc.js +51 -77
- package/es/components/accountOper/list/web.d.ts +5 -0
- package/es/components/accountOper/list/web.js +5 -0
- package/es/components/order/pay/index.js +8 -1
- package/es/components/order/pay/info.d.ts +5 -0
- package/es/components/order/pay/info.js +11 -0
- package/es/components/order/pay/info.module.less +25 -0
- package/es/components/order/pay/web.d.ts +23 -0
- package/es/components/order/pay/web.js +67 -0
- package/es/components/order/pay/web.mobile.module.less +36 -0
- package/es/components/order/pay/web.pc.js +30 -35
- package/es/components/order/pay/web.pc.module.less +35 -59
- package/es/components/pay/channelPicker/index.js +27 -0
- package/es/components/pay/channelPicker/index.json +8 -1
- package/es/components/pay/channelPicker/index.less +31 -0
- package/es/components/pay/channelPicker/index.xml +36 -0
- package/es/components/pay/channelPicker/locales/zh-CN.json +2 -1
- package/es/components/pay/channelPicker/web.d.ts +2 -0
- package/es/components/pay/channelPicker/web.js +29 -36
- package/es/components/pay/channelPicker/web.mobile.module.less +7 -2
- package/es/components/pay/channelPicker/web.pc.js +34 -31
- package/es/components/pay/detail/index.js +81 -1
- package/es/components/pay/detail/index.json +13 -1
- package/es/components/pay/detail/index.less +139 -0
- package/es/components/pay/detail/index.xml +143 -0
- package/es/components/pay/detail/locales/zh-CN.json +7 -1
- package/es/components/pay/detail/web.d.ts +20 -1
- package/es/components/pay/detail/web.js +164 -2
- package/es/components/pay/detail/web.mobile.module.less +49 -0
- package/es/components/pay/detail/web.pc.d.ts +7 -1
- package/es/components/pay/detail/web.pc.js +79 -59
- package/es/components/pay/detail/web.pc.module.less +50 -34
- package/es/components/pay/list/index.js +6 -3
- package/es/config/constants.d.ts +3 -1
- package/es/config/constants.js +3 -1
- package/es/configuration/attrUpdateMatrix.js +3 -0
- package/es/data/i18n.js +9 -2
- package/es/entities/Pay.js +1 -1
- package/es/triggers/pay.js +5 -2
- package/es/types/DependentExceptions.d.ts +2 -2
- package/es/utils/payClazz/{WechatPay.d.ts → WechatPay/WechatPay.d.ts} +4 -4
- package/es/utils/payClazz/{WechatPay.frontend.d.ts → WechatPay/WechatPay.debug.d.ts} +5 -5
- package/es/utils/payClazz/{WechatPay.frontend.js → WechatPay/WechatPay.debug.js} +1 -1
- package/es/utils/payClazz/WechatPay/index.d.ts +3 -0
- package/es/utils/payClazz/WechatPay/index.js +4 -0
- package/es/watchers/pay.js +3 -0
- package/lib/config/constants.d.ts +3 -1
- package/lib/config/constants.js +3 -1
- package/lib/configuration/attrUpdateMatrix.js +3 -0
- package/lib/data/i18n.js +9 -2
- package/lib/entities/Pay.js +1 -1
- package/lib/triggers/pay.js +5 -2
- package/lib/types/DependentExceptions.d.ts +2 -2
- package/lib/utils/payClazz/{WechatPay.d.ts → WechatPay/WechatPay.d.ts} +4 -4
- package/lib/utils/payClazz/{WechatPay.frontend.d.ts → WechatPay/WechatPay.debug.d.ts} +5 -5
- package/lib/utils/payClazz/{WechatPay.frontend.js → WechatPay/WechatPay.debug.js} +1 -1
- package/lib/utils/payClazz/WechatPay/index.d.ts +3 -0
- package/lib/utils/payClazz/WechatPay/index.js +8 -0
- package/lib/watchers/pay.js +3 -0
- package/package.json +6 -5
- package/src/entities/Account.ts +75 -0
- package/src/entities/AccountOper.ts +64 -0
- package/src/entities/Application.ts +54 -0
- package/src/entities/Order.ts +128 -0
- package/src/entities/Pay.ts +151 -0
- package/src/entities/System.ts +28 -0
- package/src/entities/User.ts +167 -0
- package/src/entities/Withdraw.ts +72 -0
- package/src/entities/WithdrawChannel.ts +43 -0
- /package/es/utils/payClazz/{WechatPay.js → WechatPay/WechatPay.js} +0 -0
- /package/lib/utils/payClazz/{WechatPay.js → WechatPay/WechatPay.js} +0 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ToCent, ToYuan } from 'oak-domain/lib/utils/money';
|
|
1
2
|
import { PAY_CHANNEL_ACCOUNT_NAME, PAY_CHANNEL_OFFLINE_NAME } from '../../../types/PayConfig';
|
|
2
3
|
export default OakComponent({
|
|
3
4
|
properties: {
|
|
@@ -5,7 +6,7 @@ export default OakComponent({
|
|
|
5
6
|
onSetPrice: (price) => undefined,
|
|
6
7
|
onSetChannel: (channel) => undefined,
|
|
7
8
|
onSetMeta: (meta) => undefined,
|
|
8
|
-
price:
|
|
9
|
+
price: 0,
|
|
9
10
|
channel: '',
|
|
10
11
|
meta: {},
|
|
11
12
|
},
|
|
@@ -21,11 +22,31 @@ export default OakComponent({
|
|
|
21
22
|
payConfig.push(config);
|
|
22
23
|
}
|
|
23
24
|
}
|
|
25
|
+
const price = this.props.price;
|
|
24
26
|
return {
|
|
25
27
|
account: data,
|
|
26
28
|
payConfig,
|
|
29
|
+
priceStr: typeof price == 'number' ? `${ToYuan(price)}` : undefined
|
|
27
30
|
// accountConfig,
|
|
28
31
|
};
|
|
29
32
|
},
|
|
30
33
|
features: ['application'],
|
|
34
|
+
listeners: {
|
|
35
|
+
price(v) {
|
|
36
|
+
this.reRender();
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
methods: {
|
|
40
|
+
onDepPriceChangeMp(event) {
|
|
41
|
+
const { value } = event.detail;
|
|
42
|
+
const price = parseInt(value);
|
|
43
|
+
if (!isNaN(price)) {
|
|
44
|
+
this.props.onSetPrice(ToCent(price));
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
data: {
|
|
49
|
+
onChannelPickMp(channel) { this.props.onSetChannel(channel); },
|
|
50
|
+
onMetaSetMp(meta) { this.props.onSetMeta(meta); },
|
|
51
|
+
}
|
|
31
52
|
});
|
|
@@ -1 +1,9 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"usingComponents": {
|
|
3
|
+
"l-form": "@oak-frontend-base/miniprogram_npm/lin-ui/form/index",
|
|
4
|
+
"l-form-item": "@oak-frontend-base/miniprogram_npm/lin-ui/form-item/index",
|
|
5
|
+
"l-input": "@oak-frontend-base/miniprogram_npm/lin-ui/input/index",
|
|
6
|
+
"l-button": "@oak-frontend-base/miniprogram_npm/lin-ui/button/index",
|
|
7
|
+
"pay-channel-picker": "../../pay/channelPicker/index"
|
|
8
|
+
}
|
|
9
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<view class="container">
|
|
2
|
+
<l-form>
|
|
3
|
+
<l-form-item label="{{t('label.depPrice')}}">
|
|
4
|
+
<l-input
|
|
5
|
+
hide-label
|
|
6
|
+
value="{{priceStr}}"
|
|
7
|
+
type="number"
|
|
8
|
+
bind:lininput="onDepPriceChangeMp"
|
|
9
|
+
placeholder="{{t('placeholder', { max: depositMax })}}"
|
|
10
|
+
/>
|
|
11
|
+
</l-form-item>
|
|
12
|
+
<view wx:if="{{price > 0}}">
|
|
13
|
+
<l-form-item label="{{t('label.channel')}}" l-form-label-class="form-label">
|
|
14
|
+
<pay-channel-picker
|
|
15
|
+
payConfig="{{payConfig}}"
|
|
16
|
+
onPick="{{onChannelPickMp}}"
|
|
17
|
+
channel="{{channel}}"
|
|
18
|
+
meta="{{meta}}"
|
|
19
|
+
onSetMeta="{{onMetaSetMp}}"
|
|
20
|
+
/>
|
|
21
|
+
</l-form-item>
|
|
22
|
+
</view>
|
|
23
|
+
</l-form>
|
|
24
|
+
</view>
|
|
@@ -10,6 +10,7 @@ export default function Render(props: WebComponentProps<EntityDict, 'account', f
|
|
|
10
10
|
onSetChannel: (channel: string) => void;
|
|
11
11
|
onSetMeta: (meta: any) => void;
|
|
12
12
|
price: number;
|
|
13
|
+
priceStr: string | undefined;
|
|
13
14
|
channel: string;
|
|
14
15
|
meta: any;
|
|
15
16
|
}>): React.JSX.Element | null;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import ChannelPicker from '../../pay/channelPicker';
|
|
3
3
|
import { Form, Input } from 'antd-mobile';
|
|
4
|
-
import {
|
|
4
|
+
import { ToCent } from 'oak-domain/lib/utils/money';
|
|
5
5
|
export default function Render(props) {
|
|
6
|
-
const { depositMax, payConfig, price, channel, meta, onSetChannel, onSetMeta, onSetPrice } = props.data;
|
|
6
|
+
const { depositMax, payConfig, price, channel, meta, priceStr, onSetChannel, onSetMeta, onSetPrice } = props.data;
|
|
7
7
|
const { t } = props.methods;
|
|
8
8
|
if (payConfig) {
|
|
9
|
-
return (<Form layout="horizontal">
|
|
10
|
-
<Form.Item label={<span>{t("label.depPrice")}:</span>} extra={t('common::pay.symbol')}>
|
|
11
|
-
<Input type='number' placeholder={t('placeholder', { max: depositMax })} max={depositMax} min={1} value={
|
|
9
|
+
return (<Form layout="horizontal">
|
|
10
|
+
<Form.Item label={<span>{t("label.depPrice")}:</span>} extra={t('common::pay.symbol')}>
|
|
11
|
+
<Input type='number' placeholder={t('placeholder', { max: depositMax })} max={depositMax} min={1} value={priceStr} onChange={(value) => {
|
|
12
12
|
if (value === '' || value === null) {
|
|
13
13
|
onSetPrice(null);
|
|
14
14
|
return;
|
|
@@ -17,15 +17,15 @@ export default function Render(props) {
|
|
|
17
17
|
if (!isNaN(v)) {
|
|
18
18
|
onSetPrice(ToCent(v));
|
|
19
19
|
}
|
|
20
|
-
}}/>
|
|
21
|
-
</Form.Item>
|
|
22
|
-
{price > 0 && <Form.Item label={<span>
|
|
23
|
-
{t('label.channel')}:
|
|
24
|
-
</span>}>
|
|
20
|
+
}}/>
|
|
21
|
+
</Form.Item>
|
|
22
|
+
{price > 0 && <Form.Item label={<span>
|
|
23
|
+
{t('label.channel')}:
|
|
24
|
+
</span>}>
|
|
25
25
|
<ChannelPicker payConfig={payConfig} onPick={(channel) => {
|
|
26
26
|
onSetChannel(channel);
|
|
27
|
-
}} channel={channel} meta={meta} onSetMeta={(meta) => onSetMeta(meta)}/>
|
|
28
|
-
</Form.Item>}
|
|
27
|
+
}} channel={channel} meta={meta} onSetMeta={(meta) => onSetMeta(meta)}/>
|
|
28
|
+
</Form.Item>}
|
|
29
29
|
</Form>);
|
|
30
30
|
}
|
|
31
31
|
return null;
|
|
@@ -10,6 +10,7 @@ export default function Render(props: WebComponentProps<EntityDict, 'account', f
|
|
|
10
10
|
onSetChannel: (channel: string) => void;
|
|
11
11
|
onSetMeta: (meta: any) => void;
|
|
12
12
|
price: number;
|
|
13
|
+
priceStr: string | undefined;
|
|
13
14
|
channel: string;
|
|
14
15
|
meta: any;
|
|
15
16
|
}>): React.JSX.Element | null;
|
|
@@ -3,22 +3,22 @@ import { Form, InputNumber } from 'antd';
|
|
|
3
3
|
import ChannelPicker from '../../pay/channelPicker';
|
|
4
4
|
import { ToYuan, ToCent } from 'oak-domain/lib/utils/money';
|
|
5
5
|
export default function Render(props) {
|
|
6
|
-
const { depositMax, payConfig, price, channel, meta, onSetChannel, onSetMeta, onSetPrice } = props.data;
|
|
6
|
+
const { depositMax, payConfig, price, channel, meta, priceStr, onSetChannel, onSetMeta, onSetPrice } = props.data;
|
|
7
7
|
const { t } = props.methods;
|
|
8
8
|
if (payConfig) {
|
|
9
|
-
return (<Form labelCol={{ span: 4 }} wrapperCol={{ span: 14 }} layout="horizontal" style={{ minWidth: 600 }} colon={false}>
|
|
10
|
-
<Form.Item label={<span>{t("label.depPrice")}:</span>}>
|
|
9
|
+
return (<Form labelCol={{ span: 4 }} wrapperCol={{ span: 14 }} layout="horizontal" style={{ minWidth: 600 }} colon={false}>
|
|
10
|
+
<Form.Item label={<span>{t("label.depPrice")}:</span>}>
|
|
11
11
|
<InputNumber placeholder={t('placeholder', { max: depositMax })} max={depositMax} min={1} value={typeof price == 'number' ? ToYuan(price) : null} addonAfter={t('common::pay.symbol')} onChange={(value) => {
|
|
12
12
|
onSetPrice(ToCent(value || 0));
|
|
13
|
-
}}/>
|
|
14
|
-
</Form.Item>
|
|
15
|
-
{price > 0 ? <Form.Item label={<span style={{ marginTop: 10 }}>
|
|
16
|
-
{t('label.channel')}:
|
|
17
|
-
</span>}>
|
|
13
|
+
}}/>
|
|
14
|
+
</Form.Item>
|
|
15
|
+
{price > 0 ? <Form.Item label={<span style={{ marginTop: 10 }}>
|
|
16
|
+
{t('label.channel')}:
|
|
17
|
+
</span>}>
|
|
18
18
|
<ChannelPicker payConfig={payConfig} onPick={(channel) => {
|
|
19
19
|
onSetChannel(channel);
|
|
20
|
-
}} channel={channel} meta={meta} onSetMeta={(meta) => onSetMeta(meta)}/>
|
|
21
|
-
</Form.Item> : <div style={{ height: 120 }}/>}
|
|
20
|
+
}} channel={channel} meta={meta} onSetMeta={(meta) => onSetMeta(meta)}/>
|
|
21
|
+
</Form.Item> : <div style={{ height: 120 }}/>}
|
|
22
22
|
</Form>);
|
|
23
23
|
}
|
|
24
24
|
return null;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { CentToString } from "oak-domain/lib/utils/money";
|
|
1
2
|
import { generateNewIdAsync } from "oak-domain/lib/utils/uuid";
|
|
2
3
|
export default OakComponent({
|
|
3
4
|
entity: 'account',
|
|
@@ -53,39 +54,104 @@ export default OakComponent({
|
|
|
53
54
|
const unfinishedPayId = data?.pay$account?.[0]?.id;
|
|
54
55
|
return {
|
|
55
56
|
account: data,
|
|
57
|
+
availStr: data?.avail && CentToString(data.avail, 2),
|
|
58
|
+
totalStr: data?.total && CentToString(data.total, 2),
|
|
56
59
|
unfinishedPayId,
|
|
57
60
|
};
|
|
58
61
|
},
|
|
59
62
|
actions: ['deposit', 'withdraw'],
|
|
60
63
|
methods: {
|
|
61
|
-
async createDepositPay(
|
|
64
|
+
async createDepositPay() {
|
|
65
|
+
const { depPrice, depositChannel, depositMeta } = this.state;
|
|
62
66
|
const payId = await generateNewIdAsync();
|
|
63
67
|
const { oakId } = this.props;
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
68
|
+
this.setDepositing(true);
|
|
69
|
+
try {
|
|
70
|
+
await this.execute(undefined, undefined, undefined, [
|
|
71
|
+
{
|
|
72
|
+
entity: 'account',
|
|
73
|
+
operation: {
|
|
74
|
+
id: await generateNewIdAsync(),
|
|
75
|
+
action: 'deposit',
|
|
76
|
+
data: {
|
|
77
|
+
pay$account: {
|
|
78
|
+
id: await generateNewIdAsync(),
|
|
79
|
+
action: 'create',
|
|
80
|
+
data: {
|
|
81
|
+
id: payId,
|
|
82
|
+
channel: depositChannel,
|
|
83
|
+
price: depPrice,
|
|
84
|
+
meta: depositMeta,
|
|
85
|
+
},
|
|
79
86
|
},
|
|
80
87
|
},
|
|
88
|
+
filter: {
|
|
89
|
+
id: oakId,
|
|
90
|
+
}
|
|
81
91
|
},
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
92
|
+
}
|
|
93
|
+
]);
|
|
94
|
+
this.setDepositing(false);
|
|
95
|
+
}
|
|
96
|
+
catch (err) {
|
|
97
|
+
this.setDepositing(false);
|
|
98
|
+
throw err;
|
|
99
|
+
}
|
|
100
|
+
this.onDepositModalClose();
|
|
101
|
+
const { onDepositPayId } = this.props;
|
|
102
|
+
onDepositPayId && onDepositPayId(payId);
|
|
103
|
+
},
|
|
104
|
+
setDepositMeta(depositMeta) {
|
|
105
|
+
this.setState({ depositMeta });
|
|
106
|
+
},
|
|
107
|
+
setDepositOpen(depositOpen) {
|
|
108
|
+
this.setState({ depositOpen });
|
|
109
|
+
},
|
|
110
|
+
setUfOpen(ufOpen) {
|
|
111
|
+
this.setState({ ufOpen });
|
|
112
|
+
},
|
|
113
|
+
setDepPrice(depPrice) {
|
|
114
|
+
this.setState({ depPrice });
|
|
115
|
+
},
|
|
116
|
+
setDepositChannel(depositChannel) {
|
|
117
|
+
this.setState({ depositChannel });
|
|
118
|
+
},
|
|
119
|
+
setDepositing(depositing) {
|
|
120
|
+
this.setState({ depositing });
|
|
121
|
+
},
|
|
122
|
+
onDepositClick() {
|
|
123
|
+
const { unfinishedPayId } = this.state;
|
|
124
|
+
if (unfinishedPayId) {
|
|
125
|
+
this.setUfOpen(true);
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
this.setDepositOpen(true);
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
onDepositModalClose() {
|
|
132
|
+
this.setDepositOpen(false);
|
|
133
|
+
this.setDepPrice(null);
|
|
134
|
+
this.setDepositChannel(undefined);
|
|
135
|
+
this.setDepositMeta(undefined);
|
|
136
|
+
},
|
|
137
|
+
onUfModalClose() {
|
|
138
|
+
this.setUfOpen(false);
|
|
139
|
+
},
|
|
140
|
+
onUnfinishedPayClickedMp() {
|
|
141
|
+
const { onDepositPayId } = this.props;
|
|
142
|
+
const { unfinishedPayId } = this.state;
|
|
143
|
+
onDepositPayId && onDepositPayId(unfinishedPayId);
|
|
89
144
|
}
|
|
145
|
+
},
|
|
146
|
+
data: {
|
|
147
|
+
depositOpen: false,
|
|
148
|
+
ufOpen: false,
|
|
149
|
+
depPrice: null,
|
|
150
|
+
depositChannel: undefined,
|
|
151
|
+
depositMeta: undefined,
|
|
152
|
+
depositing: false,
|
|
153
|
+
setDepPriceMp(price) { this.setDepPrice(price); },
|
|
154
|
+
setDepositChannelMp(depositChannel) { this.setDepositChannel(depositChannel); },
|
|
155
|
+
setDepositMetaMp(depositMeta) { this.setDepositMeta(depositMeta); }
|
|
90
156
|
}
|
|
91
157
|
});
|
|
@@ -1 +1,8 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"usingComponents": {
|
|
3
|
+
"l-button": "@oak-frontend-base/miniprogram_npm/lin-ui/button/index",
|
|
4
|
+
"l-popup": "@oak-frontend-base/miniprogram_npm/lin-ui/popup/index",
|
|
5
|
+
"l-dialog": "@oak-frontend-base/miniprogram_npm/lin-ui/dialog/index",
|
|
6
|
+
"account-deposit": "../deposit/index"
|
|
7
|
+
}
|
|
8
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
@import '../../../config/styles/mp/mixins.less';
|
|
2
|
+
@import '../../../config/styles/mp/index.less';
|
|
3
|
+
|
|
4
|
+
.container {
|
|
5
|
+
height: 100%;
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
align-items: center;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
.info {
|
|
13
|
+
height: 600rpx;
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
align-items: center;
|
|
17
|
+
justify-content: center;
|
|
18
|
+
|
|
19
|
+
.grid {
|
|
20
|
+
padding: 20rpx;
|
|
21
|
+
display: flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
.label {
|
|
26
|
+
font-size: 28rpx;
|
|
27
|
+
color: @oak-color-primary;
|
|
28
|
+
margin-right: 8rpx;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.value {
|
|
32
|
+
font-size: 28rpx;
|
|
33
|
+
color: @oak-color-primary;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.fortify {
|
|
38
|
+
.label {
|
|
39
|
+
font-size: x-large;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.value {
|
|
43
|
+
font-size: x-large;
|
|
44
|
+
font-weight: bolder;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.btn {
|
|
50
|
+
display: flex;
|
|
51
|
+
align-self: stretch;
|
|
52
|
+
|
|
53
|
+
.item {
|
|
54
|
+
flex: 1,
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.ad-container {
|
|
59
|
+
padding: 24rpx;
|
|
60
|
+
margin-bottom: 12rpx;
|
|
61
|
+
background-color: white;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.uf {
|
|
65
|
+
background-color: white;
|
|
66
|
+
display: flex;
|
|
67
|
+
flex-direction: column;
|
|
68
|
+
align-items: center;
|
|
69
|
+
padding: 12px;
|
|
70
|
+
|
|
71
|
+
.tips {
|
|
72
|
+
color: @oak-color-warning;
|
|
73
|
+
font-size: x-large;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.btn {
|
|
77
|
+
margin-top: 18rpx;
|
|
78
|
+
align-self: stretch;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
<view class="container">
|
|
2
|
+
<view class="info">
|
|
3
|
+
<view class="grid fortify">
|
|
4
|
+
<view class="label">{{t('avail')}}:</view>
|
|
5
|
+
<view class="value">{{t('common::pay.symbol')}} {{availStr}}</view>
|
|
6
|
+
</view>
|
|
7
|
+
<view class="grid">
|
|
8
|
+
<view class="label">{{t('total')}}:</view>
|
|
9
|
+
<view class="value">{{t('common::pay.symbol')}} {{totalStr}}</view>
|
|
10
|
+
</view>
|
|
11
|
+
</view>
|
|
12
|
+
<view style="flex: 1" />
|
|
13
|
+
<view class="btn">
|
|
14
|
+
<view class="item">
|
|
15
|
+
<l-button
|
|
16
|
+
type="default"
|
|
17
|
+
size="long"
|
|
18
|
+
bind:lintap="onDepositClick"
|
|
19
|
+
>
|
|
20
|
+
{{t('account:action.deposit')}}
|
|
21
|
+
</l-button>
|
|
22
|
+
</view>
|
|
23
|
+
<view class="item">
|
|
24
|
+
<l-button
|
|
25
|
+
type="success"
|
|
26
|
+
size="long"
|
|
27
|
+
>
|
|
28
|
+
{{t('account:action.withdraw')}}
|
|
29
|
+
</l-button>
|
|
30
|
+
</view>
|
|
31
|
+
</view>
|
|
32
|
+
<l-popup
|
|
33
|
+
show="{{depositOpen}}"
|
|
34
|
+
content-align="bottom"
|
|
35
|
+
bind:lintap="onDepositModalClose"
|
|
36
|
+
>
|
|
37
|
+
<view class="ad-container">
|
|
38
|
+
<account-deposit
|
|
39
|
+
depositMax='{{depositMax}}'
|
|
40
|
+
price='{{depPrice}}'
|
|
41
|
+
channel='{{depositChannel}}'
|
|
42
|
+
meta='{{depositMeta}}'
|
|
43
|
+
onSetPrice="{{setDepPriceMp}}"
|
|
44
|
+
onSetChannel="{{setDepositChannelMp}}"
|
|
45
|
+
onSetMeta="{{setDepositMetaMp}}"
|
|
46
|
+
/>
|
|
47
|
+
<view style="margin-top: 12rpx">
|
|
48
|
+
<l-button
|
|
49
|
+
type="default"
|
|
50
|
+
size="long"
|
|
51
|
+
disabled="{{!depPrice || !depositChannel || depositing}}"
|
|
52
|
+
loading="{{depositing}}"
|
|
53
|
+
bind:lintap="createDepositPay"
|
|
54
|
+
>
|
|
55
|
+
{{depositing ? t('depositing') : t('common::confirm')}}
|
|
56
|
+
</l-button>
|
|
57
|
+
</view>
|
|
58
|
+
</view>
|
|
59
|
+
</l-popup>
|
|
60
|
+
<l-dialog
|
|
61
|
+
show="{{ufOpen}}"
|
|
62
|
+
type="alert"
|
|
63
|
+
show-title="{{false}}"
|
|
64
|
+
content="{{t('uf.content')}}"
|
|
65
|
+
confirm-text="{{t('uf.go')}}"
|
|
66
|
+
bind:linconfirm="onUnfinishedPayClickedMp"
|
|
67
|
+
bind:lintap="onUfModalClose"
|
|
68
|
+
/>
|
|
69
|
+
</view>
|
|
@@ -3,4 +3,24 @@ import { RowWithActions, WebComponentProps } from 'oak-frontend-base';
|
|
|
3
3
|
import { EntityDict } from '../../../oak-app-domain';
|
|
4
4
|
export default function Render(props: WebComponentProps<EntityDict, 'account', false, {
|
|
5
5
|
account: RowWithActions<EntityDict, 'account'>;
|
|
6
|
-
|
|
6
|
+
depositMax: number;
|
|
7
|
+
unfinishedPayId?: string;
|
|
8
|
+
onDepositPayId: (payId: string) => void;
|
|
9
|
+
depositOpen: boolean;
|
|
10
|
+
ufOpen: boolean;
|
|
11
|
+
depPrice: number | null;
|
|
12
|
+
depositChannel: string | undefined;
|
|
13
|
+
depositMeta: any;
|
|
14
|
+
depositing: boolean;
|
|
15
|
+
}, {
|
|
16
|
+
createDepositPay: () => Promise<string>;
|
|
17
|
+
setDepositOpen: (v: boolean) => void;
|
|
18
|
+
setUfOpen: (v: boolean) => void;
|
|
19
|
+
setDepPrice: (v: number | null) => void;
|
|
20
|
+
setDepositChannel: (v: string | undefined) => void;
|
|
21
|
+
setDepositMeta: (v: any) => void;
|
|
22
|
+
setDepositing: (v: boolean) => void;
|
|
23
|
+
onDepositClick: () => void;
|
|
24
|
+
onDepositModalClose: () => void;
|
|
25
|
+
onUfModalClose: () => void;
|
|
26
|
+
}>): React.JSX.Element | null;
|
|
@@ -1,4 +1,70 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { Button, Popup, Dialog } from 'antd-mobile';
|
|
3
|
+
import Styles from './web.mobile.module.less';
|
|
4
|
+
import classNames from 'classnames';
|
|
5
|
+
import { CentToString } from 'oak-domain/lib/utils/money';
|
|
6
|
+
import AccountDeposit from '../deposit';
|
|
2
7
|
export default function Render(props) {
|
|
3
|
-
|
|
8
|
+
const { account, depositMax, unfinishedPayId, onDepositPayId, depositOpen, ufOpen, depPrice, depositChannel, depositMeta, depositing } = props.data;
|
|
9
|
+
const { t, createDepositPay, setMessage, setDepositOpen, setUfOpen, setDepPrice, setDepositChannel, setDepositMeta, setDepositing, onDepositClick, onDepositModalClose, onUfModalClose } = props.methods;
|
|
10
|
+
if (account) {
|
|
11
|
+
const { total, avail, '#oakLegalActions': legalActions, accountOper$account: opers } = account;
|
|
12
|
+
return (<div className={Styles.container}>
|
|
13
|
+
<div className={Styles.info}>
|
|
14
|
+
<div className={classNames(Styles.grid, Styles.fortify)}>
|
|
15
|
+
<span className={Styles.label}>{t('avail')}:</span>
|
|
16
|
+
<span className={Styles.value}>{t('common::pay.symbol')} {CentToString(avail, 2)}</span>
|
|
17
|
+
</div>
|
|
18
|
+
<div className={Styles.grid}>
|
|
19
|
+
<span className={Styles.label}>{t('total')}:</span>
|
|
20
|
+
<span className={Styles.value}>{t('common::pay.symbol')} {CentToString(total, 2)}</span>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
<div style={{ flex: 1 }}/>
|
|
24
|
+
<div className={Styles.btn}>
|
|
25
|
+
{legalActions?.includes('deposit') && <div className={Styles.item}>
|
|
26
|
+
<Button block color="primary" disabled={ufOpen || depositOpen} onClick={() => {
|
|
27
|
+
if (unfinishedPayId) {
|
|
28
|
+
Dialog.alert({
|
|
29
|
+
title: t('uf.title'),
|
|
30
|
+
content: t('uf.content'),
|
|
31
|
+
confirmText: t('uf.go'),
|
|
32
|
+
onConfirm: () => onDepositPayId(unfinishedPayId)
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
onDepositClick();
|
|
37
|
+
}
|
|
38
|
+
}}>
|
|
39
|
+
{t('account:action.deposit')}
|
|
40
|
+
</Button>
|
|
41
|
+
</div>}
|
|
42
|
+
{legalActions?.includes('withdraw') && <div className={Styles.item}>
|
|
43
|
+
<Button block onClick={() => setMessage({
|
|
44
|
+
type: 'warning',
|
|
45
|
+
content: '尚未实现'
|
|
46
|
+
})}>
|
|
47
|
+
{t('account:action.withdraw')}
|
|
48
|
+
</Button>
|
|
49
|
+
</div>}
|
|
50
|
+
</div>
|
|
51
|
+
<Popup visible={depositOpen} onMaskClick={() => onDepositModalClose()} onClose={() => onDepositModalClose()}>
|
|
52
|
+
<div style={{ padding: 12, marginBottom: 6 }}>
|
|
53
|
+
<AccountDeposit depositMax={depositMax} price={depPrice} channel={depositChannel} meta={depositMeta} onSetPrice={(price) => setDepPrice(price)} onSetChannel={(channel) => setDepositChannel(channel)} onSetMeta={(meta) => setDepositMeta(meta)}/>
|
|
54
|
+
<Button block loading={depositing} color="primary" disabled={!depPrice || !depositChannel || depositing} onClick={() => createDepositPay()}>
|
|
55
|
+
{depositing ? t('depositing') : t('common::confirm')}
|
|
56
|
+
</Button>
|
|
57
|
+
</div>
|
|
58
|
+
</Popup>
|
|
59
|
+
<Popup visible={ufOpen} onMaskClick={() => onUfModalClose()} onClose={() => onUfModalClose()} destroyOnClose={true}>
|
|
60
|
+
<div className={Styles.uf}>
|
|
61
|
+
<div className={Styles.tips}>{t('uf.content')}</div>
|
|
62
|
+
<Button color="warning" onClick={() => onDepositPayId(unfinishedPayId)}>
|
|
63
|
+
{t('uf.go')}
|
|
64
|
+
</Button>
|
|
65
|
+
</div>
|
|
66
|
+
</Popup>
|
|
67
|
+
</div>);
|
|
68
|
+
}
|
|
69
|
+
return null;
|
|
4
70
|
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
.container {
|
|
2
|
+
height: 100%;
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
align-items: center;
|
|
6
|
+
|
|
7
|
+
.info {
|
|
8
|
+
height: 300px;
|
|
9
|
+
display: flex;
|
|
10
|
+
flex-direction: column;
|
|
11
|
+
align-items: center;
|
|
12
|
+
justify-content: center;
|
|
13
|
+
|
|
14
|
+
.grid {
|
|
15
|
+
padding: 10px;
|
|
16
|
+
display: flex;
|
|
17
|
+
align-items: center;
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
.label {
|
|
21
|
+
font-size: 14px;
|
|
22
|
+
color: var(--oak-color-primary);
|
|
23
|
+
margin-right: 4px;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.value {
|
|
27
|
+
font-size: 14px;
|
|
28
|
+
color: var(--oak-color-primary);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.fortify {
|
|
33
|
+
.label {
|
|
34
|
+
font-size: x-large;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.value {
|
|
38
|
+
font-size: x-large;
|
|
39
|
+
font-weight: bolder;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.btn {
|
|
45
|
+
display: flex;
|
|
46
|
+
align-self: stretch;
|
|
47
|
+
|
|
48
|
+
.item {
|
|
49
|
+
flex: 1,
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -6,6 +6,20 @@ export default function Render(props: WebComponentProps<EntityDict, 'account', f
|
|
|
6
6
|
depositMax: number;
|
|
7
7
|
unfinishedPayId?: string;
|
|
8
8
|
onDepositPayId: (payId: string) => void;
|
|
9
|
+
depositOpen: boolean;
|
|
10
|
+
ufOpen: boolean;
|
|
11
|
+
depPrice: number | null;
|
|
12
|
+
depositChannel: string | undefined;
|
|
13
|
+
depositMeta: any;
|
|
14
|
+
depositing: boolean;
|
|
9
15
|
}, {
|
|
10
|
-
createDepositPay: (
|
|
16
|
+
createDepositPay: () => Promise<string>;
|
|
17
|
+
setDepositOpen: (v: boolean) => void;
|
|
18
|
+
setUfOpen: (v: boolean) => void;
|
|
19
|
+
setDepPrice: (v: number | null) => void;
|
|
20
|
+
setDepositChannel: (v: string | undefined) => void;
|
|
21
|
+
setDepositMeta: (v: any) => void;
|
|
22
|
+
setDepositing: (v: boolean) => void;
|
|
23
|
+
onDepositClick: () => void;
|
|
24
|
+
onDepositModalClose: () => void;
|
|
11
25
|
}>): React.JSX.Element | null;
|