import { View } from "@tarojs/components"; import IconStarColor from "@/components/icon/icon-star-color"; import { textPolishing } from '@/service/agent' import { isSuccess } from "@/utils"; import Taro from "@tarojs/taro"; interface Props { text: string; type: "personality" | "greeting" onPolished: (text:string|null) => void } const Index = ({ text, type, onPolished }: Props) => { const handleClick = async () => { // console.log('请求服务端润色') Taro.showLoading() const response = await textPolishing({ content: text, type: type }) Taro.hideLoading() if(isSuccess(response.status)){ onPolished(response.data?.content) } } return ( {" "} 润色 ); }; export default Index;