|
|
@ -1,34 +1,19 @@ |
|
|
|
import { View } from '@tarojs/components'; |
|
|
|
import { Button, CapsuleTabs, Form, Modal, Toast } from 'antd-mobile'; |
|
|
|
import { Button, Form, Modal, Toast } from 'antd-mobile'; |
|
|
|
|
|
|
|
import FormImage from '/components/FormImage'; |
|
|
|
import FormLabel from '/components/FormLabel'; |
|
|
|
import React, { useEffect, useMemo, useState } from 'react'; |
|
|
|
import React, { useEffect } from 'react'; |
|
|
|
import { getOrderInfoAction } from '/request/actions'; |
|
|
|
import { getUrlParam } from '/utils'; |
|
|
|
import Taro from '@tarojs/taro'; |
|
|
|
|
|
|
|
// import Alipay from '../Alipay'; |
|
|
|
// import Wxpay from '../Wxpay'; |
|
|
|
// import BankPay from '../BankPay'; |
|
|
|
|
|
|
|
// import aliSrc from '/assets/icons/ali.svg'; |
|
|
|
// import wxSrc from '/assets/icons/wx.svg'; |
|
|
|
// import bankSrc from '/assets/icons/bank.svg'; |
|
|
|
import { orderConfirmAction } from '../../../../request/actions'; |
|
|
|
|
|
|
|
import styles from './index.module.less'; |
|
|
|
|
|
|
|
// const TabItem = ({ src, text }) => ( |
|
|
|
// <View className={styles['tabitem']}> |
|
|
|
// <img src={src} /> |
|
|
|
// {text} |
|
|
|
// </View> |
|
|
|
// ); |
|
|
|
|
|
|
|
export default function FormBar() { |
|
|
|
const [form] = Form.useForm(); |
|
|
|
// const [showFee, updateShowFee] = useState(false); |
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
getOrderInfoAction({ |
|
|
@ -80,96 +65,36 @@ export default function FormBar() { |
|
|
|
}) |
|
|
|
}; |
|
|
|
|
|
|
|
// const way = Form.useWatch('way', form); |
|
|
|
// const feeway = Form.useWatch('feeway', form); |
|
|
|
|
|
|
|
// const detailRenderer = useMemo(() => { |
|
|
|
// return { |
|
|
|
// alipay: <Alipay namePrefix='pay' />, |
|
|
|
// wx: <Wxpay namePrefix='pay' />, |
|
|
|
// bank: <BankPay namePrefix='pay' /> |
|
|
|
// }[way]; |
|
|
|
// }, [way]); |
|
|
|
|
|
|
|
// const feeDetailRenderer = useMemo(() => { |
|
|
|
// return { |
|
|
|
// alipay: <Alipay namePrefix='fee' />, |
|
|
|
// wx: <Wxpay namePrefix='fee' />, |
|
|
|
// bank: <BankPay namePrefix='fee' /> |
|
|
|
// }[feeway]; |
|
|
|
// }, [feeway]); |
|
|
|
|
|
|
|
const payImage = Form.useWatch('payImage', form); |
|
|
|
const feeImage = Form.useWatch('feeImage', form); |
|
|
|
|
|
|
|
return ( |
|
|
|
<View className={styles.container}> |
|
|
|
<Form form={form} className={styles.form} layout='horizontal' > |
|
|
|
<Form form={form} className={styles.form} layout='vertical' > |
|
|
|
<View className={styles.title}> |
|
|
|
收款信息 |
|
|
|
</View> |
|
|
|
<Form.Item name='orderId' label='订单编号' childElementPosition='right'> |
|
|
|
<Form.Item name='orderId' label='订单编号' > |
|
|
|
<FormLabel /> |
|
|
|
</Form.Item> |
|
|
|
<Form.Item name='orderDate' label='订单日期' childElementPosition='right'> |
|
|
|
<Form.Item name='orderDate' label='订单日期' > |
|
|
|
<FormLabel /> |
|
|
|
</Form.Item> |
|
|
|
<Form.Item name='orderPrice' label='订单金额' childElementPosition='right'> |
|
|
|
<Form.Item name='orderPrice' label='订单金额' > |
|
|
|
<FormLabel render={val => `¥${val || 0}`} /> |
|
|
|
</Form.Item> |
|
|
|
<Form.Item name='feePrice' label='服务费金额' childElementPosition='right'> |
|
|
|
<Form.Item name='feePrice' label='服务费金额' > |
|
|
|
<FormLabel render={val => `¥${val || 0}`} /> |
|
|
|
</Form.Item> |
|
|
|
<Form.Item name='payUserTelephone' label='付款账号' childElementPosition='right'> |
|
|
|
<Form.Item name='payUserTelephone' label='付款账号' > |
|
|
|
<FormLabel /> |
|
|
|
</Form.Item> |
|
|
|
<Form.Item style={!payImage ? { display: 'none' } : {}} name='payImage' label='付款凭证' childElementPosition='right'> |
|
|
|
<Form.Item style={!payImage ? { display: 'none' } : {}} name='payImage' label='付款凭证' > |
|
|
|
<FormImage readonly /> |
|
|
|
</Form.Item> |
|
|
|
<Form.Item style={!feeImage ? { display: 'none' } : {}} name='feeImage' label='服务费凭证' childElementPosition='right'> |
|
|
|
<Form.Item style={!feeImage ? { display: 'none' } : {}} name='feeImage' label='服务费凭证' > |
|
|
|
<FormImage readonly /> |
|
|
|
</Form.Item> |
|
|
|
{/* <Form.Item |
|
|
|
name='way' |
|
|
|
label='提现方式' |
|
|
|
valuePropName='activeKey' |
|
|
|
initialValue='alipay' |
|
|
|
childElementPosition='right' |
|
|
|
> |
|
|
|
<CapsuleTabs style={{ padding: 0 }}> |
|
|
|
<CapsuleTabs.Tab title={<TabItem text='支付宝' src={aliSrc} />} key='alipay' /> |
|
|
|
<CapsuleTabs.Tab title={<TabItem text='微信' src={wxSrc} />} key='wx' /> |
|
|
|
<CapsuleTabs.Tab title={<TabItem text='银行卡' src={bankSrc} />} key='bank' /> |
|
|
|
</CapsuleTabs> |
|
|
|
</Form.Item> |
|
|
|
{detailRenderer} |
|
|
|
{showFee && ( |
|
|
|
<React.Fragment> |
|
|
|
<View className={styles.title}> |
|
|
|
服务费收款信息 |
|
|
|
</View> |
|
|
|
<Form.Item name='feePrice' label='服务费' childElementPosition='right'> |
|
|
|
<FormLabel render={val => `¥${val || 0}`} /> |
|
|
|
</Form.Item> |
|
|
|
<Form.Item name='feeImage' label='服务费付款凭证' childElementPosition='right'> |
|
|
|
<FormImage readonly /> |
|
|
|
</Form.Item> |
|
|
|
<Form.Item |
|
|
|
name='feeway' |
|
|
|
label='提现方式' |
|
|
|
valuePropName='activeKey' |
|
|
|
initialValue='alipay' |
|
|
|
childElementPosition='right' |
|
|
|
> |
|
|
|
<CapsuleTabs style={{ padding: 0 }}> |
|
|
|
<CapsuleTabs.Tab title={<TabItem text='支付宝' src={aliSrc} />} key='alipay' /> |
|
|
|
<CapsuleTabs.Tab title={<TabItem text='微信' src={wxSrc} />} key='wx' /> |
|
|
|
<CapsuleTabs.Tab title={<TabItem text='银行卡' src={bankSrc} />} key='bank' /> |
|
|
|
</CapsuleTabs> |
|
|
|
</Form.Item> |
|
|
|
{feeDetailRenderer} |
|
|
|
</React.Fragment> |
|
|
|
)} */} |
|
|
|
</Form > |
|
|
|
<Button color='primary' shape='rounded' className={styles.submit} onClick={handleSubmit}> |
|
|
|
确认收款 |
|
|
|