提交 1d511bc6 作者: 龚洪江

Merge branch 'develop'

......@@ -46,7 +46,7 @@ export default function CategoryItem(props: Props) {
});
};
const showCount = 9; // 展示数量
const showCount = 10; // 展示数量
return (
<div className={styles.filterItem}>
......@@ -87,12 +87,32 @@ export default function CategoryItem(props: Props) {
}
key='1'
>
<Space size={40}>
{data.slice(showCount).map((item) => {
<Space size={[10, 0]} wrap>
{data.slice(showCount).map((item, index) => {
return (
<Button type='link' key={item.id} onClick={(e) => onClick(item)}>
{item.name}
</Button>
<div
key={item.id}
className={`${styles.filterItemContent} ${
props.currentItemIndex === index ? styles.filterItemContentHover : ''
}`}
onMouseEnter={() => onMouseEnter(item, index)}
onMouseLeave={props.categoryMouseLeave}
>
<Button type='link' onClick={(e) => onClick(item)}>
{item.name}
</Button>
{item.children ? (
<Image
src={downArrowImg}
className={styles.filterItemIcon}
width={14}
height={14}
alt='展开图标'
/>
) : (
''
)}
</div>
);
})}
</Space>
......
......@@ -42,7 +42,7 @@ const Filter = (props: Props, ref: Ref<any>) => {
const data: { [key: string]: FilterOptionResp[] | FilterOptionResp } = {};
if (type === 'categoryId') {
if (result.categoryId) {
data[type] = [...result.categoryId, item];
data[type] = [item, ...result.categoryId];
const map = new Map();
// 去重
data[type] = (data[type] as InfoList[]).filter((v) => !map.has(v.id) && map.set(v.id, 1));
......@@ -133,6 +133,7 @@ const Filter = (props: Props, ref: Ref<any>) => {
if (obj?.children) {
obj.children = obj.children.filter((item: FilterOptionResp) => item.id === v.id);
obj.name += `/${v.name}`;
console.log('选中数据-->', obj);
onChange(obj, 'categoryId');
}
};
......
......@@ -27,8 +27,8 @@ const nextConfig = {
return [
{
source: '/local/:path*',
// destination: 'https://www.iuav.shop/:path*',
destination: 'https://test.iuav.shop/:path*',
destination: 'https://www.iuav.shop/:path*',
// destination: 'https://test.iuav.shop/:path*',
},
];
},
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论