Commit bc265b75 authored by XieZhiXiong's avatar XieZhiXiong

对接会员评价查询新接口完毕

parent b879f033
......@@ -19,15 +19,15 @@ export interface Search {
/**
* 交易时间开始
*/
dealTimeStart: string | null
// dealTimeStart: string | null
/**
* 交易时间结束
*/
dealTimeEnd: string | null
// dealTimeEnd: string | null
/**
* 评价方名称
*/
memberName: string | null
// memberName: string | null
};
export interface ListParams extends Search {
......
......@@ -3,6 +3,7 @@ import { Tabs, Row, Col, Button } from 'antd';
import { history } from 'umi';
import { PublicApi } from '@/services/api';
import { isJSONStr } from '@/utils';
import { usePageStatus } from '@/hooks/usePageStatus';
import MellowCard from '@/components/MellowCard';
import PolymericTable from '@/components/PolymericTable';
import { EditableColumns } from '@/components/PolymericTable/interface';
......@@ -26,6 +27,7 @@ interface EstimateSumItems {
};
const CommentDetailed: React.FC = () => {
const { memberId, roleId } = usePageStatus();
const [evaluateSum, setEvaluateSum] = useState<EstimateSumItems[]>([]);
const [evaluatePie, setEvaluatePie] = useState<{ x: string, y: number }[]>([]);
......@@ -126,7 +128,10 @@ const CommentDetailed: React.FC = () => {
// 获取评价汇总
const getTradeSummary = () => {
PublicApi.getMemberPlatformCommentCountSupplyTradeSummary().then(res => {
PublicApi.getMemberPlatformCommentTradeSummary({
memberId,
roleId,
}).then(res => {
if (res.code === 1000) {
const evaluate = summaryEvaluate(res.data.rows);
const evaluatePieData = getSummaryEvaluatePie(evaluate);
......@@ -140,9 +145,11 @@ const CommentDetailed: React.FC = () => {
const getTradeHistory = (params: ListParams): Promise<RecordRes> => {
const { star, ...rest } = params;
return new Promise((resolve, reject) => {
PublicApi.getMemberPlatformCommentCountSupplyTradeHistoryPage({
PublicApi.getMemberPlatformCommentTradeHistoryPage({
memberId,
roleId,
...rest,
starLevel: params.star,
starLevel: params.star as string,
}).then(res => {
if (res.code === 1000) {
const { data, totalCount } = res.data;
......
......@@ -47,7 +47,7 @@ const CommentQuery = () => {
const columns: ColumnType<any>[] = [
{
title: 'ID',
dataIndex: 'id',
dataIndex: 'memberId',
align: 'center',
},
{
......@@ -64,62 +64,54 @@ const CommentQuery = () => {
},
{
title: '会员类型',
dataIndex: 'memberType',
dataIndex: 'memberTypeName',
align: 'center',
},
{
title: '会员角色',
dataIndex: 'memberRole',
dataIndex: 'roleName',
align: 'center',
render: (text, record) => <>{text}</>,
},
{
title: '会员等级',
dataIndex: 'memberLevel',
dataIndex: 'levelTag',
align: 'center',
render: (text, record) => <>{text}</>,
},
{
title: '交易满意度',
dataIndex: 'satisfaction',
dataIndex: 'avgStar',
align: 'center',
render: text => <Rate value={text} disabled />,
},
{
title: '收到评价总数',
dataIndex: 'count',
dataIndex: 'receiveCountTotal',
align: 'center',
},
{
title: '最近7天评价数',
dataIndex: 'day7',
dataIndex: 'receiveCount7',
align: 'center',
},
{
title: '最近180天评价数',
dataIndex: 'day180',
dataIndex: 'receiveCount180',
align: 'center',
},
];
const fetchListData = (params: any) => {
// return new Promise((resolve, reject) => {
// PublicApi.getMemberPlatformCommentOrderTradeHistoryPage(params)
// .then(res => {
// if (res.code === 1000) {
// resolve(res.data);
// }
// reject();
// })
// .catch(() => {
// reject();
// });
// });
return new Promise((resolve, reject) => {
resolve({
data: mock,
totalCount: 2,
});
PublicApi.getMemberPlatformCommentTradePage(params)
.then(res => {
if (res.code === 1000) {
resolve(res.data);
}
reject();
})
.catch(() => {
reject();
});
});
};
......@@ -132,7 +124,7 @@ const CommentQuery = () => {
<Card>
<StandardTable
tableProps={{
rowKey: 'id',
rowKey: record => `${record.memberId}+${record.roleId}`,
}}
columns={columns}
currentRef={ref}
......@@ -145,7 +137,7 @@ const CommentQuery = () => {
useStateFilterSearchLinkageEffect(
$,
actions,
'name',
'memberName',
FORM_FILTER_PATH,
);
useAsyncInitSelect(
......
......@@ -8,7 +8,7 @@ export const listSearchSchema: ISchema = {
type: 'object',
'x-component': 'mega-layout',
properties: {
name: {
memberName: {
type: 'string',
'x-component': 'Search',
'x-component-props': {
......@@ -26,7 +26,7 @@ export const listSearchSchema: ISchema = {
columns: 6,
},
properties: {
memberTypeId: {
memberType: {
type: 'string',
default: undefined,
'x-component-props': {
......@@ -34,7 +34,7 @@ export const listSearchSchema: ISchema = {
allowClear: true,
},
},
orderType: {
roleId: {
type: 'string',
default: undefined,
enum: [],
......@@ -43,7 +43,7 @@ export const listSearchSchema: ISchema = {
allowClear: true,
},
},
outerStatus: {
memberLevel: {
type: 'string',
default: undefined,
enum: [],
......@@ -52,10 +52,31 @@ export const listSearchSchema: ISchema = {
allowClear: true,
},
},
innerStatus: {
avgStar: {
type: 'string',
default: undefined,
enum: [],
enum: [
{
label: '一星',
value: 1,
},
{
label: '二星',
value: 2,
},
{
label: '三星',
value: 3,
},
{
label: '四星',
value: 4,
},
{
label: '五星',
value: 5,
},
],
'x-component-props': {
placeholder: '交易满意度(全部)',
allowClear: true,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment