帮助中心详情添加判断
This commit is contained in:
@ -12,12 +12,13 @@ const HelpInfoPage: React.FC = () => {
|
|||||||
const intl = useIntl();
|
const intl = useIntl();
|
||||||
const [helpDetail, setHelpDetail] = useState<API.HelpCenterDetailResponse | null>(null);
|
const [helpDetail, setHelpDetail] = useState<API.HelpCenterDetailResponse | null>(null);
|
||||||
const [loading, setLoading] = useState<boolean>(true);
|
const [loading, setLoading] = useState<boolean>(true);
|
||||||
|
let tabActiveKey = 'helpCenter';
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
// 获取URL中的id参数
|
// 获取URL中的id参数
|
||||||
const query = new URLSearchParams(window.location.search);
|
const query = new URLSearchParams(window.location.search);
|
||||||
const id = query.get('id');
|
const id = query.get('id');
|
||||||
const tabActiveKey = query.get('tabActiveKey') || 'helpCenter';
|
tabActiveKey = query.get('tabActiveKey') || 'helpCenter';
|
||||||
|
|
||||||
if (!id) {
|
if (!id) {
|
||||||
message.error(intl.formatMessage({ id: 'help.message.idNotFound' }));
|
message.error(intl.formatMessage({ id: 'help.message.idNotFound' }));
|
||||||
@ -97,7 +98,11 @@ const HelpInfoPage: React.FC = () => {
|
|||||||
{/* <QuestionCircleOutlined /> */}
|
{/* <QuestionCircleOutlined /> */}
|
||||||
<CommentOutlined />
|
<CommentOutlined />
|
||||||
<span style={{ margin: '0 15px' }}>{helpDetail.title}</span>
|
<span style={{ margin: '0 15px' }}>{helpDetail.title}</span>
|
||||||
|
{tabActiveKey == 'helpCenter' ? (
|
||||||
|
''
|
||||||
|
) : (
|
||||||
<Tag color="success">{helpDetail.isAnswer == '1' ? '已回答' : '未回答'}</Tag>
|
<Tag color="success">{helpDetail.isAnswer == '1' ? '已回答' : '未回答'}</Tag>
|
||||||
|
)}
|
||||||
</Title>
|
</Title>
|
||||||
<div dangerouslySetInnerHTML={{ __html: helpDetail.content || '' }} />
|
<div dangerouslySetInnerHTML={{ __html: helpDetail.content || '' }} />
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user