Commit 01ff539a by Liu

fix:左侧推荐问部分样式

parent 32c6981d
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
This diff was suppressed by a .gitattributes entry.
......@@ -5,8 +5,8 @@ import { Outlet, useLocation } from 'react-router-dom'
import { useLocalStorageState } from 'ahooks'
import styles from './Home.module.less'
import { QuestionList } from './components/QuestionList'
import HomeIcon1 from '@/assets/homeIcon1.png'
import HomeIcon2 from '@/assets/homeIcon2.png'
import SmartIce from '@/assets/smart-ice.png'
import { createConversation, fetchConversations } from '@/store/conversationSlice'
import { useAppDispatch } from '@/store/hook'
import { fetchQuestionList } from '@/api/home'
......@@ -46,7 +46,7 @@ export const Home: React.FC = () => {
const location = useLocation()
const hasFetched = useRef(false)
// 使用 useState
const [productQuestions, setProductQuestions] = useState<any>({ content: [] })
const [_productQuestions, setProductQuestions] = useState<any>({ content: [] })
const [otherQuestions, setOtherQuestions] = useState<any>({ content: [] })
const [token, setToken] = useLocalStorageState<string | undefined>('__TOKEN__', {
......@@ -188,9 +188,9 @@ export const Home: React.FC = () => {
{/* 左侧区域 - 产品问答和您可以试着问我 */}
<div
className="flex flex-col gap-[20px] items-center overflow-y-auto scrollbar-hide"
style={{ height: 'calc(100vh - 64px)' }}
style={{ height: 'calc(100vh - 64px)', background: 'linear-gradient(180deg, #DBF1FF 0%, #FFFFFF 50%, #FFFFFF 100%)', borderRadius: '24px' }}
>
<motion.div className="w-full sm:w-auto" {...getAnimationProps(2)}>
{/* <motion.div className="w-full sm:w-auto" {...getAnimationProps(2)}>
<QuestionList
questions={productQuestions.content}
dotColor="#D4CCFF"
......@@ -198,16 +198,20 @@ export const Home: React.FC = () => {
title={productQuestions.configName}
iconImg={HomeIcon1}
/>
</motion.div>
</motion.div> */}
<motion.div className="w-full sm:w-auto" {...getAnimationProps(3)}>
<QuestionList
questions={otherQuestions.content}
dotColor="#CBECFF"
background="linear-gradient(180deg, #DBF1FF 0%, #FFFFFF 50%, #FFFFFF 100%)"
height="388px"
title={otherQuestions.configName}
iconImg={HomeIcon2}
/>
</motion.div>
<div>
<img src={SmartIce} alt="Smart Ice" className="w-[260px] h-[330px] object-contain" />
</div>
</div>
{/* 右侧区域 */}
<div className="hidden sm:flex flex-1 h-full">
......
......@@ -16,6 +16,7 @@ interface QuestionListProps {
showRefresh?: boolean
displayCount?: number
background: string
height?: string
}
const containerVariants = {
hidden: {},
......@@ -55,10 +56,11 @@ const QuestionListBase: React.FC<QuestionListProps & WithAuthProps> = ({
questions,
dotColor,
background,
height,
title,
iconImg,
showRefresh = true,
displayCount = 4,
displayCount = 8,
}) => {
const [isRotating, setIsRotating] = useState(false)
const [displayedItems, setDisplayedItems] = useState<string[]>([])
......@@ -97,8 +99,8 @@ const QuestionListBase: React.FC<QuestionListProps & WithAuthProps> = ({
}, [updateDisplayedItems])
return (
<div
className="bg-white box-border px-[20px] py-[12px] rounded-[24px] w-full sm:w-[360px] md:w-[300px]"
style={{ background }}
className="bg-white box-border px-[20px] py-[12px] rounded-[24px] w-full sm:w-[300px] md:w-[300px]"
style={{ background, height }}
>
<h3 className="flex items-center justify-between whitespace-nowrap">
<div className="flex items-center min-w-0 flex-1 h-full">
......
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