Commit d15c3c45 by HoMeTown

fix: 修复bug

parent e71e99cf
This diff was suppressed by a .gitattributes entry.
import { Button, Link } from '@nextui-org/react'
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 CardNavImg from '@/assets/card-nav.png'
import CardCalculation from '@/assets/card-calculation.png'
......@@ -22,8 +22,8 @@ export const ChatAnswerAttachment: React.FC<ChatAnswerAttachmentProps> = ({ from
}
}
const handleClickCard = (url: string) => {
window.open(url)
const handleClickCard = (attachment: Attachment) => {
window.open(attachment.content.url)
}
const handleClickDocLink = async (docId: string) => {
......@@ -103,7 +103,7 @@ export const ChatAnswerAttachment: React.FC<ChatAnswerAttachmentProps> = ({ from
{
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-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="" />}
......
......@@ -17,13 +17,13 @@ interface ChatAnswerParserProps {
onSubmitQuestion: (question: string, productCode?: string) => void
}
function CheckIcon({ size, height, width, ...props }) {
function CheckIcon({ ...props }) {
return (
<svg
fill="none"
height={size || height || 24}
height={18}
viewBox="0 0 24 24"
width={size || width || 24}
width={18}
xmlns="http://www.w3.org/2000/svg"
{...props}
>
......@@ -157,7 +157,7 @@ export const ChatAnswerParser: React.FC<ChatAnswerParserProps> = ({ isLastAnswer
</Chip>
)}
{answer.step?.step === 'finished' && (
<Chip color="primary" variant="flat" startContent={<CheckIcon size={18} />}>
<Chip color="primary" variant="flat" startContent={<CheckIcon />}>
{answer.step?.message}
</Chip>
)}
......
......@@ -13,7 +13,7 @@ export const ChatWelcome: React.FC = () => {
>
<div className="content">
<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>
</motion.div>
</div>
......
......@@ -76,7 +76,7 @@ const WelcomeWordBase: React.FC<WithAuthProps> = ({ checkAuth }) => {
<BotAnimateBox />
<div className="px-[18px] relative z-[1] box-border sm:px-[24px] pt-[68px]">
<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>
</div>
</div>
......
......@@ -12,6 +12,7 @@ interface AttachmentContent {
docList: AttachmentContentDoc[]
description: string
productList: AttachmentContentProduct[]
url: string
}
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