import React from 'react';
import { ToYuan, ToCent } from 'oak-domain/lib/utils/money';
import Styles from './web.pc.module.less';
import PayChannelPicker from '../../pay/channelPicker2';
import { Divider, Checkbox, InputNumber, Flex, Result } from 'antd';
import Info from './info';
function RenderPayChannel(props) {
const { price, payChannels, t, channel, meta, onPick, } = props;
return (
{t('choose', { price: ToYuan(price) })}
);
}
function RenderAccountPay(props) {
const { max, t, accountPrice, setAccountPrice, useAccount, switchUseAccount, accountAvail, accountTips } = props;
return (
switchUseAccount()}>
{t('useAccount')}
{useAccount && (<>
{
if (typeof v === 'number') {
setAccountPrice(Math.floor(ToCent(v)));
}
}}/>
{accountTips || t('accountMax', { max: ToYuan(accountAvail) })}
>)}
);
}
export default function Render(props) {
const { accountId, accountAvailMax, legal, accountPrice, useAccount, order, activePay, payChannels, channel, meta, rest, accountTips } = props.data;
const { t, setAccountPrice, onPickChannel, onSetChannelMeta, switchUseAccount } = props.methods;
if (order) {
if (activePay) {
return ();
}
if (!legal) {
return ();
}
return (
{(accountId && accountAvailMax) ?
: null}
{!!(rest && rest > 0) &&
}
);
}
return null;
}