更新筛选条件,增加订单统计
This commit is contained in:
@@ -1,53 +1,81 @@
|
||||
import { paymentPage } from '@/services/payment';
|
||||
|
||||
|
||||
import React, { useRef, useEffect } from 'react';
|
||||
import React, { useRef, useEffect,useState } from 'react';
|
||||
import { useIntl, useAccess } from '@umijs/max';
|
||||
import { message, Tag, Image, Button, Select } from 'antd';
|
||||
import { ActionType, PageContainer, ProTable } from '@ant-design/pro-components';
|
||||
|
||||
import { usersPage } from '@/services/user/user';
|
||||
|
||||
|
||||
|
||||
const LogTableList: React.FC = () => {
|
||||
const actionRef = useRef<ActionType>();
|
||||
|
||||
|
||||
const [shopOption, setShopOption] = useState([]);
|
||||
const searchShop = async (value) => {
|
||||
const { success, data } = await usersPage({
|
||||
userName: value
|
||||
});
|
||||
data.records.map((i) => {
|
||||
i.userName = i.userName + ' ' + i.phone
|
||||
})
|
||||
setShopOption(data.records)
|
||||
}
|
||||
|
||||
const columns = [
|
||||
{
|
||||
title: '订单号',
|
||||
dataIndex: 'orderNo',
|
||||
title: '支付号',
|
||||
dataIndex: 'paymentNo',
|
||||
valueType: 'text',
|
||||
search: true,
|
||||
render: (_: any, record: any) => {
|
||||
return <div className={'flex items-center'}>
|
||||
{record.orderNo}
|
||||
<Button type="link" onClick={() => {
|
||||
|
||||
}}>查看</Button>
|
||||
</div>
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '用户信息',
|
||||
dataIndex: 'ordersGoodsList',
|
||||
dataIndex: 'userId',
|
||||
valueType: 'text',
|
||||
search: false,
|
||||
render: (_: any, record: any) => {
|
||||
// return record.ordersGoodsList.map((i) => {
|
||||
// let _Img = i.picture ? JSON.parse(i.picture)[0] : ''
|
||||
// return <div className={'flex'} key={i.id}>
|
||||
// <Image src={_Img}></Image>
|
||||
// <div>
|
||||
// <div>
|
||||
// 用户ID:{i.goodsName}
|
||||
// </div>
|
||||
// <div>
|
||||
// 用户账号:{i.salePrice}
|
||||
// </div>
|
||||
// </div>
|
||||
// </div>
|
||||
// })
|
||||
}
|
||||
return <div>
|
||||
<div>用户ID:{record?.userId}</div>
|
||||
<div>用户名:{record?.userName}</div>
|
||||
<div>手机号:{record?.phone}</div>
|
||||
</div>
|
||||
},
|
||||
renderFormItem: (
|
||||
_,
|
||||
{ type, defaultRender, formItemProps, fieldProps, ...rest },
|
||||
form,
|
||||
) => {
|
||||
return <Select
|
||||
{...fieldProps}
|
||||
allowClear
|
||||
showSearch
|
||||
placeholder="请输入用户名"
|
||||
style={{ width: "100%" }}
|
||||
filterOption={false}
|
||||
onSearch={
|
||||
(e) => {
|
||||
if (!e) {
|
||||
return;
|
||||
}
|
||||
searchShop(e);
|
||||
}
|
||||
}
|
||||
fieldNames={{
|
||||
label: "userName",
|
||||
value: "id"
|
||||
}}
|
||||
options={shopOption}
|
||||
/>
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '用户手机号',
|
||||
dataIndex: 'userInfo',
|
||||
valueType: 'text',
|
||||
search: true,
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
title: '支付类型',
|
||||
|
||||
Reference in New Issue
Block a user