Commit bc265b75 authored by XieZhiXiong's avatar XieZhiXiong

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

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