|
@@ -1,14 +1,12 @@
|
|
|
-
|
|
|
-import { View } from '@tarojs/components'
|
|
|
-import style from './index.module.less'
|
|
|
-import PersonalCard from '../personal-card'
|
|
|
-import MessageRobotPlain from '@/components/chat-message/MessageRobotPlain'
|
|
|
-import { TAgentDetail } from '@/types/agent';
|
|
|
-import { useChatInput } from '../input-bar/chatInput';
|
|
|
+import { View } from "@tarojs/components";
|
|
|
+import style from "./index.module.less";
|
|
|
+import PersonalCard from "../personal-card";
|
|
|
+import { TAgentDetail } from "@/types/agent";
|
|
|
+import { useChatInput } from "../input-bar/chatInput";
|
|
|
interface IProps {
|
|
|
agent: TAgentDetail | null;
|
|
|
}
|
|
|
-export default ({agent}: IProps)=> {
|
|
|
+export default ({ agent }: IProps) => {
|
|
|
const { handleOnSend } = useChatInput({
|
|
|
agent,
|
|
|
});
|
|
@@ -17,36 +15,40 @@ export default ({agent}: IProps)=> {
|
|
|
handleOnSend(q);
|
|
|
};
|
|
|
|
|
|
-
|
|
|
- if(!agent){
|
|
|
- return <></>
|
|
|
+ if (!agent) {
|
|
|
+ return <></>;
|
|
|
}
|
|
|
|
|
|
- let greeting = ''
|
|
|
+ let greeting = "";
|
|
|
// 默认打招呼文案
|
|
|
- if(!agent.greeting){
|
|
|
- greeting = `Hi~ 你好我是${agent.name}`
|
|
|
- }else{
|
|
|
+ if (!agent.greeting) {
|
|
|
+ greeting = `Hi~ 你好我是${agent.name}`;
|
|
|
+ } else {
|
|
|
// 用户自定义文案
|
|
|
- greeting = agent.greeting
|
|
|
+ greeting = agent.greeting;
|
|
|
}
|
|
|
|
|
|
// 3个引导提问提示词
|
|
|
- const questions = agent.questionGuides ?? []
|
|
|
-
|
|
|
+ const questions = agent.questionGuides ?? [];
|
|
|
+
|
|
|
return (
|
|
|
- <View className='pt-118'>
|
|
|
<View className={style.container}>
|
|
|
- <View className='mb-24'>
|
|
|
- <PersonalCard agent={agent} />
|
|
|
- </View>
|
|
|
- <View className='flex flex-col gap-8'>
|
|
|
- <MessageRobotPlain text={greeting}/>
|
|
|
- {questions.map(q => {
|
|
|
- return <MessageRobotPlain text={q} onClick={handleClick} />
|
|
|
- })}
|
|
|
- </View>
|
|
|
- </View>
|
|
|
- </View>
|
|
|
- )
|
|
|
-}
|
|
|
+ {/* <View className="mb-24">
|
|
|
+ <PersonalCard agent={agent} />
|
|
|
+ </View> */}
|
|
|
+ <View className="flex flex-col gap-8">
|
|
|
+ <View className="text-[#111A34] text-14 leading-28 mb-18">{greeting}</View>
|
|
|
+ {questions.map((q) => {
|
|
|
+ return (
|
|
|
+ <View
|
|
|
+ className="p-12 rounded-8 leading-22 text-12 bg-[#F4F9FF] text-[#414A64]"
|
|
|
+ onClick={() => handleClick(q)}
|
|
|
+ >
|
|
|
+ {q}
|
|
|
+ </View>
|
|
|
+ );
|
|
|
+ })}
|
|
|
+ </View>
|
|
|
+ </View>
|
|
|
+ );
|
|
|
+};
|