还是deposit的小bug

This commit is contained in:
Xu Chang 2024-05-16 22:03:11 +08:00
parent 3b5fd00175
commit fdc0f0dbdf
15 changed files with 31 additions and 27 deletions

View File

@ -6,11 +6,12 @@ export default function Render(props: WebComponentProps<EntityDict, 'account', f
depositMax: number;
payConfig: PayConfig;
accountConfig?: AccountPayConfig;
onPriceChange: (price: null | number) => void;
onSetChannel: (channel: string) => void;
onSetMeta: (meta: any) => void;
price: number;
priceStr: string | undefined;
channel: string;
meta: any;
}, {
onPriceChange: (price: null | number) => void;
}>): React.JSX.Element | null;

View File

@ -3,8 +3,8 @@ import ChannelPicker from '../../pay/channelPicker';
import { Form, Input } from 'antd-mobile';
import { ToCent } from 'oak-domain/lib/utils/money';
export default function Render(props) {
const { depositMax, payConfig, price, channel, meta, priceStr, onSetChannel, onSetMeta, onPriceChange } = props.data;
const { t } = props.methods;
const { depositMax, payConfig, price, channel, meta, priceStr, onSetChannel, onSetMeta } = props.data;
const { t, onPriceChange } = props.methods;
if (payConfig) {
return (<Form layout="horizontal">
<Form.Item label={<span>{t("label.depPrice")}:</span>} extra={t('common::pay.symbol')}>

View File

@ -6,10 +6,11 @@ export default function Render(props: WebComponentProps<EntityDict, 'account', f
depositMax: number;
payConfig: PayConfig;
accountConfig?: AccountPayConfig;
onPriceChange: (price: null | number) => void;
onSetChannel: (channel: string) => void;
onSetMeta: (meta: any) => void;
price: number;
channel: string;
meta: any;
}, {
onPriceChange: (price: null | number) => void;
}>): React.JSX.Element | null;

View File

@ -3,8 +3,8 @@ import { Form, InputNumber } from 'antd';
import ChannelPicker from '../../pay/channelPicker';
import { ToYuan, ToCent } from 'oak-domain/lib/utils/money';
export default function Render(props) {
const { depositMax, payConfig, price, channel, meta, onSetChannel, onSetMeta, onPriceChange } = props.data;
const { t } = props.methods;
const { depositMax, payConfig, price, channel, meta, onSetChannel, onSetMeta } = props.data;
const { t, onPriceChange } = props.methods;
if (payConfig) {
return (<Form labelCol={{ span: 4 }} wrapperCol={{ span: 14 }} layout="horizontal" style={{ minWidth: 600 }} colon={false}>
<Form.Item label={<span>{t("label.depPrice")}:</span>}>

View File

@ -1,5 +1,5 @@
declare const _default: (props: import("oak-frontend-base").ReactComponentProps<import("../../../oak-app-domain").EntityDict, "account", false, {
depositMax: number;
depositMaxCent: number;
onDepositPayId: (payId: string) => void;
}>) => React.ReactElement;
export default _default;

View File

@ -49,7 +49,7 @@ export default OakComponent({
}
},
properties: {
depositMax: 10000,
depositMaxCent: 1000000,
onDepositPayId: (payId) => undefined,
},
formData({ data }) {

View File

@ -3,7 +3,7 @@ import { RowWithActions, WebComponentProps } from 'oak-frontend-base';
import { EntityDict } from '../../../oak-app-domain';
export default function Render(props: WebComponentProps<EntityDict, 'account', false, {
account: RowWithActions<EntityDict, 'account'>;
depositMax: number;
depositMaxCent: number;
unfinishedPayId?: string;
onDepositPayId: (payId: string) => void;
depositOpen: boolean;

View File

@ -5,7 +5,7 @@ import classNames from 'classnames';
import { CentToString } from 'oak-domain/lib/utils/money';
import AccountDeposit from '../deposit';
export default function Render(props) {
const { account, depositMax, unfinishedPayId, onDepositPayId, depositOpen, ufOpen, depPrice, depositChannel, depositMeta, depositing } = props.data;
const { account, depositMaxCent, unfinishedPayId, onDepositPayId, depositOpen, ufOpen, depPrice, depositChannel, depositMeta, depositing } = props.data;
const { t, createDepositPay, setMessage, setDepositOpen, setUfOpen, setDepPrice, setDepositChannel, setDepositMeta, setDepositing, onDepositClick, onDepositModalClose, onUfModalClose } = props.methods;
if (account) {
const { total, avail, '#oakLegalActions': legalActions, accountOper$account: opers } = account;
@ -50,7 +50,7 @@ export default function Render(props) {
</div>
<Popup visible={depositOpen} onMaskClick={() => onDepositModalClose()} onClose={() => onDepositModalClose()}>
<div style={{ padding: 12, marginBottom: 6 }}>
<AccountDeposit depositMax={depositMax} channel={depositChannel} meta={depositMeta} onSetPrice={(price) => setDepPrice(price)} onSetChannel={(channel) => setDepositChannel(channel)} onSetMeta={(meta) => setDepositMeta(meta)}/>
<AccountDeposit depositMaxCent={depositMaxCent} channel={depositChannel} meta={depositMeta} onSetPrice={(price) => setDepPrice(price)} onSetChannel={(channel) => setDepositChannel(channel)} onSetMeta={(meta) => setDepositMeta(meta)}/>
<Button block loading={depositing} color="primary" disabled={!depPrice || !depositChannel || depositing} onClick={() => createDepositPay()}>
{depositing ? t('depositing') : t('common::confirm')}
</Button>

View File

@ -3,7 +3,7 @@ import { RowWithActions, WebComponentProps } from 'oak-frontend-base';
import { EntityDict } from '../../../oak-app-domain';
export default function Render(props: WebComponentProps<EntityDict, 'account', false, {
account: RowWithActions<EntityDict, 'account'>;
depositMax: number;
depositMaxCent: number;
unfinishedPayId?: string;
onDepositPayId: (payId: string) => void;
depositOpen: boolean;

View File

@ -7,7 +7,7 @@ import AccountDeposit from '../deposit';
import AccountOperList from '../../accountOper/pure/List.pc';
import { AccountBookOutlined, ScheduleOutlined } from '@ant-design/icons';
export default function Render(props) {
const { account, depositMax, unfinishedPayId, onDepositPayId, depositOpen, ufOpen, depPrice, depositChannel, depositMeta, depositing } = props.data;
const { account, depositMaxCent, unfinishedPayId, onDepositPayId, depositOpen, ufOpen, depPrice, depositChannel, depositMeta, depositing } = props.data;
const { t, createDepositPay, setMessage, setDepositOpen, setUfOpen, setDepPrice, setDepositChannel, setDepositMeta, setDepositing, onDepositClick, onDepositModalClose, } = props.methods;
if (account) {
const { total, avail, '#oakLegalActions': legalActions, accountOper$account: opers } = account;
@ -51,7 +51,7 @@ export default function Render(props) {
{depositing ? t('depositing') : t('common::confirm')}
</Button>}>
<div style={{ padding: 12 }}>
<AccountDeposit depositMax={depositMax} channel={depositChannel} meta={depositMeta} onSetPrice={(price) => setDepPrice(price)} onSetChannel={(channel) => setDepositChannel(channel)} onSetMeta={(meta) => setDepositMeta(meta)}/>
<AccountDeposit depositMaxCent={depositMaxCent} channel={depositChannel} meta={depositMeta} onSetPrice={(price) => setDepPrice(price)} onSetChannel={(channel) => setDepositChannel(channel)} onSetMeta={(meta) => setDepositMeta(meta)}/>
</div>
</Modal>
<Modal title={t('uf.title')} open={ufOpen} onCancel={() => {

View File

@ -11,16 +11,17 @@ export default function Render(props: WebComponentProps<EntityDict, 'account', f
depositMax: number;
payConfig: PayConfig;
accountConfig?: AccountPayConfig;
onPriceChange: (price: null | number) => void;
onSetChannel: (channel: string) => void;
onSetMeta: (meta: any) => void;
price: number;
channel: string;
meta: any;
}, {
onPriceChange: (price: null | number) => void;
}>) {
const { depositMax, payConfig, price, channel, meta,
onSetChannel, onSetMeta, onPriceChange } = props.data;
const { t } = props.methods;
onSetChannel, onSetMeta } = props.data;
const { t, onPriceChange } = props.methods;
if (payConfig) {
return (

View File

@ -11,18 +11,19 @@ export default function Render(props: WebComponentProps<EntityDict, 'account', f
depositMax: number;
payConfig: PayConfig;
accountConfig?: AccountPayConfig;
onPriceChange: (price: null | number) => void;
onSetChannel: (channel: string) => void;
onSetMeta: (meta: any) => void;
price: number;
priceStr: string | undefined;
channel: string;
meta: any;
}, {
onPriceChange: (price: null | number) => void;
}>) {
const { depositMax, payConfig,
price, channel, meta, priceStr,
onSetChannel, onSetMeta, onPriceChange } = props.data;
const { t } = props.methods;
onSetChannel, onSetMeta } = props.data;
const { t, onPriceChange } = props.methods;
if (payConfig) {
return (

View File

@ -50,7 +50,7 @@ export default OakComponent({
}
},
properties: {
depositMax: 10000,
depositMaxCent: 1000000,
onDepositPayId: (payId: string) => undefined as void,
},
formData({ data }) {

View File

@ -12,7 +12,7 @@ import { AccountBookOutlined, ScheduleOutlined } from '@ant-design/icons';
export default function Render(props: WebComponentProps<EntityDict, 'account', false, {
account: RowWithActions<EntityDict, 'account'>;
depositMax: number;
depositMaxCent: number;
unfinishedPayId?: string;
onDepositPayId: (payId: string) => void;
depositOpen: boolean;
@ -32,7 +32,7 @@ export default function Render(props: WebComponentProps<EntityDict, 'account', f
onDepositClick: () => void;
onDepositModalClose: () => void;
}>) {
const { account, depositMax, unfinishedPayId, onDepositPayId, depositOpen,
const { account, depositMaxCent, unfinishedPayId, onDepositPayId, depositOpen,
ufOpen, depPrice, depositChannel, depositMeta, depositing
} = props.data;
const { t, createDepositPay, setMessage, setDepositOpen, setUfOpen,
@ -117,7 +117,7 @@ export default function Render(props: WebComponentProps<EntityDict, 'account', f
>
<div style={{ padding: 12 }}>
<AccountDeposit
depositMax={depositMax}
depositMaxCent={depositMaxCent}
channel={depositChannel}
meta={depositMeta}
onSetPrice={(price) => setDepPrice(price)}

View File

@ -9,7 +9,7 @@ import AccountDeposit from '../deposit';
export default function Render(props: WebComponentProps<EntityDict, 'account', false, {
account: RowWithActions<EntityDict, 'account'>;
depositMax: number;
depositMaxCent: number;
unfinishedPayId?: string;
onDepositPayId: (payId: string) => void;
depositOpen: boolean;
@ -30,7 +30,7 @@ export default function Render(props: WebComponentProps<EntityDict, 'account', f
onDepositModalClose: () => void;
onUfModalClose: () => void;
}>) {
const { account, depositMax, unfinishedPayId, onDepositPayId, depositOpen,
const { account, depositMaxCent, unfinishedPayId, onDepositPayId, depositOpen,
ufOpen, depPrice, depositChannel, depositMeta, depositing
} = props.data;
const { t, createDepositPay, setMessage, setDepositOpen, setUfOpen,
@ -96,7 +96,7 @@ export default function Render(props: WebComponentProps<EntityDict, 'account', f
>
<div style={{ padding: 12, marginBottom: 6 }}>
<AccountDeposit
depositMax={depositMax}
depositMaxCent={depositMaxCent}
channel={depositChannel}
meta={depositMeta}
onSetPrice={(price) => setDepPrice(price)}