35 lines
1.6 KiB
JavaScript
35 lines
1.6 KiB
JavaScript
import React from 'react';
|
|
import { Form, Switch, Input, Selector } from 'antd-mobile';
|
|
export default function render(props) {
|
|
const { withdrawAccount, channels, channel, isBank } = props.data;
|
|
const { t, onSetChannelId, onUpdate } = props.methods;
|
|
if (withdrawAccount) {
|
|
return (<Form layout="horizontal">
|
|
{channels && <Form.Item label={t('withdrawAccount:attr.channel')}>
|
|
<Selector disabled={!channels} options={channels} value={channel ? [channel.id] : undefined} onChange={(ids) => {
|
|
onSetChannelId(ids[0]);
|
|
}}/>
|
|
</Form.Item>}
|
|
{isBank &&
|
|
<Form.Item label={t('label.bank.org')}>
|
|
<Input value={withdrawAccount.org} onChange={(value) => {
|
|
onUpdate('org', value);
|
|
}}/>
|
|
</Form.Item>}
|
|
<Form.Item label={isBank ? t('label.bank.name') : t('label.others.name')}>
|
|
<Input value={withdrawAccount.name} onChange={(value) => {
|
|
onUpdate('name', value);
|
|
}}/>
|
|
</Form.Item>
|
|
<Form.Item label={t('withdrawAccount:attr.code')}>
|
|
<Input value={withdrawAccount.code} onChange={(value) => {
|
|
onUpdate('code', value);
|
|
}}/>
|
|
</Form.Item>
|
|
<Form.Item label={t('withdrawAccount:attr.isDefault')}>
|
|
<Switch checked={withdrawAccount.isDefault} onChange={(value) => onUpdate('isDefault', value)}/>
|
|
</Form.Item>
|
|
</Form>);
|
|
}
|
|
}
|