import React, { useState } from 'react' import styles from './index.module.scss' import { Radio } from 'antd' import { TextArea, Input, Button, Toast } from 'antd-mobile' import http from '@/utils/axios' const TYPE = ['回答不相关', '回答不完整', '答案错误', '无法回答问题', '其他'] interface HelpImproveProps { question: string answer: string onClose: () => void } function HelpImprove({ question, answer, onClose }: HelpImproveProps) { const [type, setType] = useState('') const [suggest, setSuggest] = useState('') const [userName, setUserName] = useState('') const [phone, setPhone] = useState('') const [isSubmitting, setIsSubmitting] = useState(false) const handleSubmit = async () => { if (!type) { Toast.show({ icon: 'fail', content: '请选择反馈类型' }) return } setIsSubmitting(true) try { const response = await http.post('/show/aiSave', { answer, phone, question, suggest, type, userName }) if (response.code === 0) { Toast.show({ icon: 'success', content: '提交成功' }) onClose() } } catch (error) { console.error('提交失败:', error) } finally { setIsSubmitting(false) } } const handleCancel = () => { onClose() } return (

AI问答反馈

原问题:

{question}

原回答:

{answer}

反馈类型

setType(e.target.value)}> {TYPE.map(item => ( {item} ))}