Commit 279b6785 authored by XieZhiXiong's avatar XieZhiXiong

fixbug

parent b215bcda
......@@ -2,7 +2,7 @@
* @Author: XieZhiXiong
* @Date: 2020-09-23 11:02:03
* @LastEditors: XieZhiXiong
* @LastEditTime: 2020-10-21 15:19:00
* @LastEditTime: 2020-10-26 09:52:13
* @Description:
*/
import React, { useState, useEffect } from 'react';
......@@ -31,28 +31,28 @@ import styles from './evaluate.less';
const formActions = createFormActions();
interface OrderInfo {
// 下单时间
created: string;
// 订单号
orderNo: string;
};
const CommentManageDetailed: React.FC = () => {
const { id, orderId } = usePageStatus();
const [orderInfo, setOrderInfo] = useState<GetOrderPlatformOrderDetailsResponse>();
const [orderInfoLoading, setOrderInfoLoading] = useState(false);
const [orderInfo, setOrderInfo] = useState<OrderInfo>();
const [commentInfo, setCommentInfo] = useState<Unevaluated[]>([]);
const [commentInfoLoading, setCommentInfoLoading] = useState(false);
// 获取订单详情
const getOrderInfo = () => {
if (!orderId || orderId === 'undefined') {
const getOrderInfo = (data) => {
if (!data || !data.id) {
return;
}
setOrderInfoLoading(true);
PublicApi.getOrderPlatformOrderDetails({
id: orderId,
}).then(res => {
if (res.code === 1000) {
setOrderInfo(res.data);
}
}).finally(() => {
setOrderInfoLoading(false);
});
return {
created: data.dealTime,
orderNo: data.remark,
};
};
// 获取评论详情
......@@ -66,6 +66,7 @@ const CommentManageDetailed: React.FC = () => {
}).then(res => {
if (res.code === 1000) {
setCommentInfo(normalizeUnevaluatedList([res.data]));
setOrderInfo(getOrderInfo(res.data));
}
}).finally(() => {
setCommentInfoLoading(false);
......@@ -73,7 +74,6 @@ const CommentManageDetailed: React.FC = () => {
};
useEffect(() => {
getOrderInfo();
getCommentInfo();
}, []);
......@@ -100,7 +100,7 @@ const CommentManageDetailed: React.FC = () => {
);
return (
<Spin spinning={commentInfoLoading || orderInfoLoading}>
<Spin spinning={commentInfoLoading}>
<PageHeaderWrapper
title={
<>
......@@ -123,7 +123,7 @@ const CommentManageDetailed: React.FC = () => {
padding: '0 32px',
}}
>
<Descriptions.Item label="下单时间" span={2}>{orderInfo?.createTime}</Descriptions.Item>
<Descriptions.Item label="下单时间" span={2}>{orderInfo?.created}</Descriptions.Item>
</Descriptions>
</PageHeader>
</>
......
......@@ -50,7 +50,7 @@ const CommentManage: React.FC = () => {
align: 'center',
render: (text, record) => (
<EyePreview
url={`/comment/manage/detail?orderId=${record.orderId}&id=${record.id}`}
url={`/comment/manage/detail?id=${record.id}`}
>
{text}
</EyePreview>
......
......@@ -31,7 +31,7 @@ const CommentQuery = () => {
align: 'center',
render: (text, record) => (
<EyePreview
url={`/comment/query/detail`}
url={`/comment/query/detail?memberId=${record.memberId}&roleId=${record.roleId}`}
>
{text}
</EyePreview>
......
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