|
|
|
@ -2,6 +2,7 @@ import React, { useEffect, useState } from 'react';
|
|
|
|
import styles from './style/compCard.module.less';
|
|
|
|
import styles from './style/compCard.module.less';
|
|
|
|
import { compData } from '@/pages/componentMarket/test/data';
|
|
|
|
import { compData } from '@/pages/componentMarket/test/data';
|
|
|
|
import { Card, Grid, Rate, Typography } from '@arco-design/web-react';
|
|
|
|
import { Card, Grid, Rate, Typography } from '@arco-design/web-react';
|
|
|
|
|
|
|
|
import { useRouter } from 'next/router';
|
|
|
|
|
|
|
|
|
|
|
|
const { Row, Col } = Grid;
|
|
|
|
const { Row, Col } = Grid;
|
|
|
|
|
|
|
|
|
|
|
|
@ -11,6 +12,7 @@ interface CompCardProps {
|
|
|
|
|
|
|
|
|
|
|
|
const CompCard: React.FC<CompCardProps> = ({ componentClassify }) => {
|
|
|
|
const CompCard: React.FC<CompCardProps> = ({ componentClassify }) => {
|
|
|
|
const [componentClassifyData, setComponentClassifyData] = useState<any>([]);
|
|
|
|
const [componentClassifyData, setComponentClassifyData] = useState<any>([]);
|
|
|
|
|
|
|
|
const router = useRouter();
|
|
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
useEffect(() => {
|
|
|
|
if (componentClassify === '全部') setComponentClassifyData(compData);
|
|
|
|
if (componentClassify === '全部') setComponentClassifyData(compData);
|
|
|
|
@ -20,6 +22,11 @@ const CompCard: React.FC<CompCardProps> = ({ componentClassify }) => {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}, [componentClassify]);
|
|
|
|
}, [componentClassify]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const handelDetails = () => {
|
|
|
|
|
|
|
|
router.push('/componentMarket/compDetails');
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div className={styles['comp-card']}>
|
|
|
|
<div className={styles['comp-card']}>
|
|
|
|
<Row style={{ marginBottom: 16 }}>
|
|
|
|
<Row style={{ marginBottom: 16 }}>
|
|
|
|
@ -33,7 +40,7 @@ const CompCard: React.FC<CompCardProps> = ({ componentClassify }) => {
|
|
|
|
xl={6}
|
|
|
|
xl={6}
|
|
|
|
xxl={6}
|
|
|
|
xxl={6}
|
|
|
|
key={i}>
|
|
|
|
key={i}>
|
|
|
|
<Card style={{ border: '1px solid #d9d9d9' }}>
|
|
|
|
<Card style={{ cursor: 'pointer', border: '1px solid #d9d9d9' }} onClick={() => handelDetails()}>
|
|
|
|
{/*左侧图片*/}
|
|
|
|
{/*左侧图片*/}
|
|
|
|
<div className={styles['img-box']}>图片</div>
|
|
|
|
<div className={styles['img-box']}>图片</div>
|
|
|
|
{/*右侧数据*/}
|
|
|
|
{/*右侧数据*/}
|
|
|
|
|