Commit d15c3c45 by HoMeTown

fix: 修复bug

parent e71e99cf
This diff was suppressed by a .gitattributes entry.
import { Button, Link } from '@nextui-org/react' import { Button, Link } from '@nextui-org/react'
import { motion } from 'framer-motion' import { motion } from 'framer-motion'
import type { Answer } from '@/types/chat' import type { Answer, Attachment } from '@/types/chat'
import AnswerProDetailIcon from '@/assets/svg/answerProDetail.svg?react' import AnswerProDetailIcon from '@/assets/svg/answerProDetail.svg?react'
import CardNavImg from '@/assets/card-nav.png' import CardNavImg from '@/assets/card-nav.png'
import CardCalculation from '@/assets/card-calculation.png' import CardCalculation from '@/assets/card-calculation.png'
...@@ -22,8 +22,8 @@ export const ChatAnswerAttachment: React.FC<ChatAnswerAttachmentProps> = ({ from ...@@ -22,8 +22,8 @@ export const ChatAnswerAttachment: React.FC<ChatAnswerAttachmentProps> = ({ from
} }
} }
const handleClickCard = (url: string) => { const handleClickCard = (attachment: Attachment) => {
window.open(url) window.open(attachment.content.url)
} }
const handleClickDocLink = async (docId: string) => { const handleClickDocLink = async (docId: string) => {
...@@ -103,7 +103,7 @@ export const ChatAnswerAttachment: React.FC<ChatAnswerAttachmentProps> = ({ from ...@@ -103,7 +103,7 @@ export const ChatAnswerAttachment: React.FC<ChatAnswerAttachmentProps> = ({ from
{ {
attachment.type?.includes('card-') && ( attachment.type?.includes('card-') && (
<div onClick={() => handleClickCard(attachment.url)}> <div onClick={() => handleClickCard(attachment)}>
{attachment.type === 'card-nav' && <img className="w-full max-w-[400px] cursor-pointer" src={CardNavImg} alt="" />} {attachment.type === 'card-nav' && <img className="w-full max-w-[400px] cursor-pointer" src={CardNavImg} alt="" />}
{attachment.type === 'card-detail' && <img className="w-full max-w-[400px] cursor-pointer" src={CardDetailImg} alt="" />} {attachment.type === 'card-detail' && <img className="w-full max-w-[400px] cursor-pointer" src={CardDetailImg} alt="" />}
{attachment.type === 'card-calculation' && <img className="w-full max-w-[400px] cursor-pointer" src={CardCalculation} alt="" />} {attachment.type === 'card-calculation' && <img className="w-full max-w-[400px] cursor-pointer" src={CardCalculation} alt="" />}
......
...@@ -17,13 +17,13 @@ interface ChatAnswerParserProps { ...@@ -17,13 +17,13 @@ interface ChatAnswerParserProps {
onSubmitQuestion: (question: string, productCode?: string) => void onSubmitQuestion: (question: string, productCode?: string) => void
} }
function CheckIcon({ size, height, width, ...props }) { function CheckIcon({ ...props }) {
return ( return (
<svg <svg
fill="none" fill="none"
height={size || height || 24} height={18}
viewBox="0 0 24 24" viewBox="0 0 24 24"
width={size || width || 24} width={18}
xmlns="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg"
{...props} {...props}
> >
...@@ -157,7 +157,7 @@ export const ChatAnswerParser: React.FC<ChatAnswerParserProps> = ({ isLastAnswer ...@@ -157,7 +157,7 @@ export const ChatAnswerParser: React.FC<ChatAnswerParserProps> = ({ isLastAnswer
</Chip> </Chip>
)} )}
{answer.step?.step === 'finished' && ( {answer.step?.step === 'finished' && (
<Chip color="primary" variant="flat" startContent={<CheckIcon size={18} />}> <Chip color="primary" variant="flat" startContent={<CheckIcon />}>
{answer.step?.message} {answer.step?.message}
</Chip> </Chip>
)} )}
......
...@@ -13,7 +13,7 @@ export const ChatWelcome: React.FC = () => { ...@@ -13,7 +13,7 @@ export const ChatWelcome: React.FC = () => {
> >
<div className="content"> <div className="content">
<p className="text-[16px] sm:text-[18px] font-medium text-[#333]">您好,我是晓得</p> <p className="text-[16px] sm:text-[18px] font-medium text-[#333]">您好,我是晓得</p>
<p className="text-[15px] mt-[8px] sm:text-13px text-[#27353C] font-300">为您的智能保险伙伴,您有各类专业相关的问题都可以抛给我哟~让我们互相帮助共同成长吧~</p> <p className="text-[15px] mt-[8px] sm:text-13px text-[#27353C] font-300">为您的智能保险伙伴,您有各类专业相关的问题都可以抛给我哟~让我们互相帮助共同成长吧~</p>
</div> </div>
</motion.div> </motion.div>
</div> </div>
......
...@@ -76,7 +76,7 @@ const WelcomeWordBase: React.FC<WithAuthProps> = ({ checkAuth }) => { ...@@ -76,7 +76,7 @@ const WelcomeWordBase: React.FC<WithAuthProps> = ({ checkAuth }) => {
<BotAnimateBox /> <BotAnimateBox />
<div className="px-[18px] relative z-[1] box-border sm:px-[24px] pt-[68px]"> <div className="px-[18px] relative z-[1] box-border sm:px-[24px] pt-[68px]">
<SayHi /> <SayHi />
<p className="mt-[16px] text-[#27353C] text-[15px] sm:mt-[24px] mb-[16px]">为您的智能保险伙伴,您有各类专业相关的问题都可以抛给我哟~让我们互相帮助共同成长吧~</p> <p className="mt-[16px] text-[#27353C] text-[15px] sm:mt-[24px] mb-[16px]">为您的智能保险伙伴,您有各类专业相关的问题都可以抛给我哟~让我们互相帮助共同成长吧~</p>
<Button className="bg-white w-full text-[#20ABD9] font-medium rounded-[20px] sm:w-auto" onClick={handleGo}>立即前往 ➔</Button> <Button className="bg-white w-full text-[#20ABD9] font-medium rounded-[20px] sm:w-auto" onClick={handleGo}>立即前往 ➔</Button>
</div> </div>
</div> </div>
......
...@@ -12,6 +12,7 @@ interface AttachmentContent { ...@@ -12,6 +12,7 @@ interface AttachmentContent {
docList: AttachmentContentDoc[] docList: AttachmentContentDoc[]
description: string description: string
productList: AttachmentContentProduct[] productList: AttachmentContentProduct[]
url: string
} }
export interface Attachment { export interface Attachment {
......
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