提交 58b10ac3 作者: 18928357778

改-解决页面因为未给图片默认值出现白屏的错误,给新闻添加图片默认值

上级 010275b6
import React from 'react'; import React from "react";
import {Empty} from 'antd'; import { Empty } from "antd";
import { Box } from './styled'; import { Box } from "./styled";
import {leftBoxProps} from '../interface'; import { leftBoxProps } from "../interface";
export default function Left(props:leftBoxProps) { export default function Left(props: leftBoxProps) {
const { boxIndex , leftRenderDom , leftcontentstyle} = props const { boxIndex, leftRenderDom, leftcontentstyle } = props;
return ( return (
<div> <div>
{ {leftRenderDom.columns.map((item) => {
leftRenderDom.columns.map((item)=>{
if (item.noFor) { if (item.noFor) {
return item.element return item.element;
}
return null
})
} }
return null;
})}
{ {
<Box index={boxIndex} leftcontentstyle={leftcontentstyle}> <Box index={boxIndex} leftcontentstyle={leftcontentstyle}>
{ {leftRenderDom.columns.map((item) => {
leftRenderDom.columns.map((item)=>{
if (!item.noFor) { if (!item.noFor) {
return item.element return item.element;
}
return null
})
} }
return null;
})}
</Box> </Box>
} }
{ {!leftRenderDom.columns.length ? (
!leftRenderDom.columns.length ? <Empty description={"暂无数据"}/> : null <Empty description={"暂无数据"} />
} ) : null}
</div> </div>
) );
} }
...@@ -10,9 +10,8 @@ import PartItem from "./compoents/partItem"; ...@@ -10,9 +10,8 @@ import PartItem from "./compoents/partItem";
import QualityItem from "./compoents/qualityItem"; import QualityItem from "./compoents/qualityItem";
import Industry from "./compoents/industry"; import Industry from "./compoents/industry";
import AppType from "./compoents/appType"; import AppType from "./compoents/appType";
import DeviceBrand from './compoents/deviceBrand'; import DeviceBrand from "./compoents/deviceBrand";
import DeviceModel from './compoents/deviceModel'; import DeviceModel from "./compoents/deviceModel";
export type AdapterResult = { export type AdapterResult = {
brandId?: number; brandId?: number;
...@@ -21,6 +20,9 @@ export type AdapterResult = { ...@@ -21,6 +20,9 @@ export type AdapterResult = {
partsId?: number; partsId?: number;
productCategoryId?: number; productCategoryId?: number;
qualityId?: number; qualityId?: number;
industryId?: number;
appTypeId?: number;
categoryId?: number;
}; };
export type FilterResult = { export type FilterResult = {
...@@ -30,16 +32,30 @@ export type FilterResult = { ...@@ -30,16 +32,30 @@ export type FilterResult = {
part?: FilterOptionResp; part?: FilterOptionResp;
model?: FilterOptionResp; model?: FilterOptionResp;
quality?: FilterOptionResp; quality?: FilterOptionResp;
industryId?: FilterOptionResp;
appTypeId?: FilterOptionResp;
categoryId?: FilterOptionResp;
}; };
type itemType = "类目" | "地域" | "品牌" | "部件" | "型号" | "成色" | "行业" | "应用" | "设备品牌" | "设备型号"; type itemType =
| "类目"
| "地域"
| "品牌"
| "部件"
| "型号"
| "成色"
| "行业"
| "应用"
| "设备品牌"
| "设备型号"
| "设备类目";
type Props = { type Props = {
types: itemType[]; //需要包含的筛选条件项 types: itemType[]; //需要包含的筛选条件项
showResultItem: Boolean; //显示结果栏 showResultItem: Boolean; //显示结果栏
onChange: ( onChange: (
filterResult: FilterResult, filterResult: FilterResult,
adapterFilterResult: AdapterResult, //适配器,直接用于接口请求 adapterFilterResult: AdapterResult //适配器,直接用于接口请求
) => void; //筛选条件更改事件 ) => void; //筛选条件更改事件
}; };
export default function Filter(props: Props) { export default function Filter(props: Props) {
...@@ -51,17 +67,17 @@ export default function Filter(props: Props) { ...@@ -51,17 +67,17 @@ export default function Filter(props: Props) {
}; };
useEffect(() => { useEffect(() => {
props.onChange( props.onChange(result, {
result,
{
brandId: result.brand?.id, brandId: result.brand?.id,
districtId: result.region?.id, districtId: result.region?.id,
modelId: result.model?.id, modelId: result.model?.id,
partsId: result.part?.id, partsId: result.part?.id,
productCategoryId: result.category?.id, productCategoryId: result.category?.id,
qualityId: result.quality?.id, qualityId: result.quality?.id,
} industryId: result.industryId?.id,
); appTypeId: result.appTypeId?.id,
categoryId: result.categoryId?.id,
});
}, [result]); }, [result]);
const onDel = (key: string) => { const onDel = (key: string) => {
//@ts-ignore //@ts-ignore
...@@ -92,7 +108,7 @@ export default function Filter(props: Props) { ...@@ -92,7 +108,7 @@ export default function Filter(props: Props) {
)} )}
{props.types.includes("设备品牌") && ( {props.types.includes("设备品牌") && (
<DeviceBrand <DeviceBrand
onChange={(item: FilterOptionResp) => onChange(item, "quality")} onChange={(item: FilterOptionResp) => onChange(item, "brand")}
></DeviceBrand> ></DeviceBrand>
)} )}
{props.types.includes("类目") && ( {props.types.includes("类目") && (
...@@ -100,6 +116,11 @@ export default function Filter(props: Props) { ...@@ -100,6 +116,11 @@ export default function Filter(props: Props) {
onChange={(item: FilterOptionResp) => onChange(item, "category")} onChange={(item: FilterOptionResp) => onChange(item, "category")}
></CategoryItem> ></CategoryItem>
)} )}
{props.types.includes("设备类目") && (
<CategoryItem
onChange={(item: FilterOptionResp) => onChange(item, "categoryId")}
></CategoryItem>
)}
{props.types.includes("部件") && ( {props.types.includes("部件") && (
<PartItem <PartItem
onChange={(item: FilterOptionResp) => onChange(item, "part")} onChange={(item: FilterOptionResp) => onChange(item, "part")}
...@@ -112,7 +133,7 @@ export default function Filter(props: Props) { ...@@ -112,7 +133,7 @@ export default function Filter(props: Props) {
)} )}
{props.types.includes("设备型号") && ( {props.types.includes("设备型号") && (
<DeviceModel <DeviceModel
onChange={(item: FilterOptionResp) => onChange(item, "quality")} onChange={(item: FilterOptionResp) => onChange(item, "model")}
></DeviceModel> ></DeviceModel>
)} )}
{props.types.includes("成色") && ( {props.types.includes("成色") && (
...@@ -122,12 +143,12 @@ export default function Filter(props: Props) { ...@@ -122,12 +143,12 @@ export default function Filter(props: Props) {
)} )}
{props.types.includes("行业") && ( {props.types.includes("行业") && (
<Industry <Industry
onChange={(item: FilterOptionResp) => onChange(item, "quality")} onChange={(item: FilterOptionResp) => onChange(item, "industryId")}
></Industry> ></Industry>
)} )}
{props.types.includes("应用") && ( {props.types.includes("应用") && (
<AppType <AppType
onChange={(item: FilterOptionResp) => onChange(item, "quality")} onChange={(item: FilterOptionResp) => onChange(item, "appTypeId")}
></AppType> ></AppType>
)} )}
......
import React, { useEffect, useState } from "react"; import React, { useEffect, useState } from "react";
import { useRouter } from "next/router"; import { useRouter } from "next/router";
import { Pagination } from "antd"; import { Pagination } from "antd";
import {Box} from './styled'; import { Box } from "./styled";
import Layout from "~/components/layout"; import Layout from "~/components/layout";
import ContentBox from '~/components/contentBox'; import ContentBox from "~/components/contentBox";
import Filter, { FilterResult , AdapterResult} from "~/components/filter"; import Filter, { FilterResult, AdapterResult } from "~/components/filter";
import Image from 'next/image'; import Image from "next/image";
import api,{Device,Advertisement} from './api'; import api, { Device, Advertisement } from "./api";
// 此函数在构建时被调用 // 此函数在构建时被调用
export async function getStaticProps() { export async function getStaticProps() {
//获取筛选数据,进行静态渲染 //获取筛选数据,进行静态渲染
return { return {
props: { props: {},
},
}; };
} }
type Props = { type Props = {};
};
export default function EquipmentLeasing(props:Props) { export default function EquipmentLeasing(props: Props) {
const router = useRouter(); const router = useRouter();
const [productList, setProductList] = useState(Array<{element:JSX.Element}>); const [productList, setProductList] = useState(
const [rightProductList, setRightProductList] = useState(Array<{element:JSX.Element}>); Array<{ element: JSX.Element }>
);
const [rightProductList, setRightProductList] = useState(
Array<{ element: JSX.Element }>
);
const leftDom = (item:Device)=>{ const leftDom = (item: Device) => {
return (<div key={item.id} className='item' onClick={() => router.push(`/equipmentLeasing/detail/${item.id}`)}> return (
<div
key={item.id}
className="item"
onClick={() => router.push(`/equipmentLeasing/detail/${item.id}`)}
>
<div className="item-top"> <div className="item-top">
<div className="item-top-image"> <Image src={item.wareImgs[0].imgUrl} alt="error" width={116} height={116}/> </div> <div className="item-top-image">
{" "}
<Image
src={item.wareImgs[0].imgUrl}
alt="error"
width={116}
height={116}
/>{" "}
</div>
</div> </div>
<div className="item-bottom"> <div className="item-bottom">
<div className="item-bottom-title" title={item.wareTitle}>{item.wareTitle}</div> <div className="item-bottom-title" title={item.wareTitle}>
{item.wareTitle}
</div>
<div className="item-bottom-price"> <div className="item-bottom-price">
<span className="money">¥{item.minRent}</span> <span className="money">¥{item.minRent}</span>
<span className="unit">/天起</span> <span className="unit">/天起</span>
</div> </div>
</div> </div>
</div>) </div>
} );
};
const rightDom = (item:Advertisement) => { const rightDom = (item: Advertisement) => {
return ( return (
<div key={item.id} className="right-box-item right-item"> <div key={item.id} className="right-box-item right-item">
<Image src={item.imageUrl} alt="error" width={270} height={422}/> <Image src={item.imageUrl} alt="error" width={270} height={422} />
</div> </div>
) );
} };
const [filterResult, setFilterResult] = useState<AdapterResult>({}); //筛选结果 const [filterResult, setFilterResult] = useState<AdapterResult>({}); //筛选结果
const [count, setCount] = useState(0); //商品总数 const [count, setCount] = useState(0); //商品总数
...@@ -75,14 +93,18 @@ export default function EquipmentLeasing(props:Props) { ...@@ -75,14 +93,18 @@ export default function EquipmentLeasing(props:Props) {
{ {
...filterResult, ...filterResult,
...pageParams, ...pageParams,
...router.query ...router.query,
}, },
{ {
signal: abort?.signal, signal: abort?.signal,
} }
) )
.then((res) => { .then((res) => {
setProductList(res.result?.list.map(item=>{return { element:leftDom(item) }}) || []); setProductList(
res.result?.list.map((item) => {
return { element: leftDom(item) };
}) || []
);
setCount(res.result?.totalCount || 0); setCount(res.result?.totalCount || 0);
}); });
}, [abort]); }, [abort]);
...@@ -95,32 +117,39 @@ export default function EquipmentLeasing(props:Props) { ...@@ -95,32 +117,39 @@ export default function EquipmentLeasing(props:Props) {
setFilterResult(adapterFilterResult); setFilterResult(adapterFilterResult);
}; };
useEffect(() => { useEffect(() => {
api api.listAdvertisementInfo().then((res) => {
.listAdvertisementInfo() setRightProductList(
.then((res) => { res.result?.map((item) => {
setRightProductList(res.result?.map(item=>{return { element:rightDom(item) }}) || []) return { element: rightDom(item) };
}) || []
);
}); });
}, []); }, []);
useEffect(() => {
useEffect(()=>{
if (router.query) { if (router.query) {
setFilterResult({...router.query}); setFilterResult({ ...router.query });
} }
},[router]) }, [router]);
return ( return (
<Layout> <Layout>
<Box> <Box>
<Filter <Filter
types={[ "地域", "类目", "设备品牌", "设备型号"]} types={["地域", "设备类目", "设备品牌", "设备型号"]}
showResultItem showResultItem
onChange={onFilterChange} onChange={onFilterChange}
></Filter> ></Filter>
<div style={{paddingTop:13}}> <div style={{ paddingTop: 13 }}>
<ContentBox boxIndex={4} leftcontentstyle={{width:"916px",margin:{top:0,right:"12px",bottom:"12px",left:0}}} leftRenderDom={{columns:productList}} rightRenderDom={{columns:rightProductList}}/> <ContentBox
boxIndex={4}
leftcontentstyle={{
width: "916px",
margin: { top: 0, right: "12px", bottom: "12px", left: 0 },
}}
leftRenderDom={{ columns: productList }}
rightRenderDom={{ columns: rightProductList }}
/>
<Pagination <Pagination
current={pageParams.pageNo} current={pageParams.pageNo}
pageSize={pageParams.pageSize} pageSize={pageParams.pageSize}
...@@ -134,5 +163,5 @@ export default function EquipmentLeasing(props:Props) { ...@@ -134,5 +163,5 @@ export default function EquipmentLeasing(props:Props) {
</div> </div>
</Box> </Box>
</Layout> </Layout>
) );
} }
import React , {useEffect,useState} from 'react'; import React, { useEffect, useState } from "react";
import {Box} from './styled'; import { Box } from "./styled";
import Image from 'next/image'; import Image from "next/image";
import { Button, Select, Space , Pagination , Cascader } from "antd"; import { Button, Select, Space, Pagination, Cascader } from "antd";
import Layout from "~/components/layout"; import Layout from "~/components/layout";
import ContentBox from '~/components/contentBox'; import ContentBox from "~/components/contentBox";
import api , {Flying,SkillsType,RegionResp} from "./api"; import api, { Flying, SkillsType, RegionResp } from "./api";
import {useRouter} from 'next/router'; import { useRouter } from "next/router";
interface FilterInfoParams { interface FilterInfoParams {
regionId?:number, regionId?: number;
flightSkillsId?:number, flightSkillsId?: number;
licenseId?:number licenseId?: number;
} }
export default function FlyingHandService() { export default function FlyingHandService() {
const router = useRouter() const router = useRouter();
const [list,setList] = useState(["https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/925072db-5872-44dd-8b71-e408ad3adf41.jpg","https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/12d624b0-1250-44a6-9a3f-9025725a2adc.jpg"]) const [list, setList] = useState([
const [productList, setProductList] = useState(Array<{element:JSX.Element}>); "https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/925072db-5872-44dd-8b71-e408ad3adf41.jpg",
const [rightDomList, setRightDomList] = useState(Array<{element:JSX.Element}>) "https://pad-video-x.oss-cn-shenzhen.aliyuncs.com/file/12d624b0-1250-44a6-9a3f-9025725a2adc.jpg",
const [secondDistrictInfo, setSecondDistrictInfo] = useState(Array<RegionResp> ) ]);
const [flightSkillsList, setFlightSkillsList] = useState(Array<SkillsType> ) const [productList, setProductList] = useState(
Array<{ element: JSX.Element }>
);
const [rightDomList, setRightDomList] = useState(
Array<{ element: JSX.Element }>
);
const [secondDistrictInfo, setSecondDistrictInfo] = useState(
Array<RegionResp>
);
const [flightSkillsList, setFlightSkillsList] = useState(Array<SkillsType>);
const leftDom = (item:Flying)=>{ const leftDom = (item: Flying) => {
return (<div className='item' key={item.id}> return (
<div className='item-top'> <div className="item" key={item.id}>
<Image src={`${item.videoUrl}?x-oss-process=video/snapshot,t_1000,m_fast`} alt='#' width={220} height={160}/> <div className="item-top">
<Image
src={`${item.videoUrl}?x-oss-process=video/snapshot,t_1000,m_fast`}
alt="#"
width={220}
height={160}
/>
</div> </div>
<div className='item-bottom'> <div className="item-bottom">
<div className="bottom-title">{item.curriculumName}</div> <div className="bottom-title">{item.curriculumName}</div>
<div className="bottom-details">{item.curriculumDesc}</div> <div className="bottom-details">{item.curriculumDesc}</div>
<div className='bottom-price'> <div className="bottom-price">
<div className='bottom-price-left' title={item.supplierName}>{item.supplierName}</div> <div className="bottom-price-left" title={item.supplierName}>
<div className='bottom-price-right'> {item.supplierName}
{ </div>
item.free ? <div className='price-right-label'>{item.price}</div> : <div> <div className="bottom-price-right">
<span className='price-right-label'>限免</span> {item.free ? (
<div className="price-right-label">{item.price}</div>
) : (
<div>
<span className="price-right-label">限免</span>
{/* <span className='price-right-money'>{`¥${item.price}`}</span> */} {/* <span className='price-right-money'>{`¥${item.price}`}</span> */}
</div> </div>
} )}
</div> </div>
</div> </div>
</div> </div>
</div>) </div>
} );
};
const rightDom = (item:string) => { const rightDom = (item: string) => {
return ( <div className='right-box-item right-item' key={item}> return (
<Image src={item} alt="error" width={260} height={420}/> <div className="right-box-item right-item" key={item}>
</div>) <Image src={item} alt="error" width={260} height={420} />
} </div>
);
};
const [pageParams, setPageParams] = useState({ const [pageParams, setPageParams] = useState({
pageNo: 1, pageNo: 1,
pageSize: 12, pageSize: 12,
}); //分页器对象 }); //分页器对象
const [filterParams,setFilterParams] = useState<FilterInfoParams>() const [filterParams, setFilterParams] = useState<FilterInfoParams>();
const [count, setCount] = useState(0); //商品总数 const [count, setCount] = useState(0); //商品总数
const [abort, setAbort] = useState<AbortController | null>(null); //请求中断 const [abort, setAbort] = useState<AbortController | null>(null); //请求中断
...@@ -70,78 +92,84 @@ export default function FlyingHandService() { ...@@ -70,78 +92,84 @@ export default function FlyingHandService() {
//中断前一次列表请求 //中断前一次列表请求
abort?.abort(); abort?.abort();
setAbort(new AbortController()); setAbort(new AbortController());
}, [filterParams,pageParams]); }, [filterParams, pageParams]);
//端口列表请求 //端口列表请求
useEffect(() => { useEffect(() => {
api api
.listPageJobServicesInfo( .listPageJobServicesInfo({
{
...pageParams, ...pageParams,
...filterParams, ...filterParams,
...router.query ...router.query,
}, })
)
.then((res) => { .then((res) => {
setProductList(res.result?.list.map(item=>{return { element:leftDom(item) }}) || []); setProductList(
res.result?.list?.map((item) => {
return { element: leftDom(item) };
}) || []
);
setCount(res.result?.totalCount || 0); setCount(res.result?.totalCount || 0);
}); });
}, [abort]); }, [abort]);
const onProvinceChange = (value: string, type: string) => {
const onProvinceChange = (value: string, type:string) => { if (type === "考证") {
if (type === '考证') { setFilterParams((props) => {
setFilterParams((props)=>{
return { return {
...props, ...props,
licenseId:Number(value) licenseId: Number(value),
} };
}) });
}else{ } else {
setFilterParams((props)=>{ setFilterParams((props) => {
return { return {
...props, ...props,
flightSkillsId:Number(value) flightSkillsId: Number(value),
} };
}) });
} }
}; };
const onChange = (value: any) => { const onChange = (value: any) => {
console.log(value); setFilterParams((props) => {
return {
...props,
flightSkillsId: (value && value[value.length - 1]) || undefined,
};
});
}; };
useEffect(() => { useEffect(() => {
setRightDomList(list.map(item=>{return {element:rightDom(item)}})) setRightDomList(
api list.map((item) => {
.region() return { element: rightDom(item) };
.then((res) => { })
setSecondDistrictInfo(res.result || []) );
api.region().then((res) => {
setSecondDistrictInfo(res.result || []);
}); });
api api.IndustryFlightSkills().then((res) => {
.IndustryFlightSkills() setFlightSkillsList(res.result || []);
.then((res) => {
setFlightSkillsList(res.result || [])
}); });
}, []); }, []);
useEffect(()=>{ useEffect(() => {
if (Object.keys(router.query).length) { if (Object.keys(router.query).length) {
setFilterParams((props)=>{ setFilterParams((props) => {
return { return {
...props, ...props,
...router.query ...router.query,
} };
}); });
} }
},[router]) }, [router]);
return ( return (
<Layout> <Layout>
<Box> <Box>
<div className='flyingTop'> <div className="flyingTop">
<div className='flyingTop-left'> <div className="flyingTop-left">
<Space> <Space>
{/* <Select {/* <Select
className='selectItem' className='selectItem'
...@@ -152,37 +180,61 @@ export default function FlyingHandService() { ...@@ -152,37 +180,61 @@ export default function FlyingHandService() {
onChange={onProvinceChange} onChange={onProvinceChange}
options={secondDistrictInfo} options={secondDistrictInfo}
/> */} /> */}
<Cascader clearIcon placeholder="地域" bordered={false} className='selectItem' size="large" fieldNames={{ label: "name", value: "id", children: "childInfo" }} options={secondDistrictInfo} onChange={onChange} changeOnSelect /> <Cascader
allowClear
placeholder="地域"
bordered={false}
className="selectItem"
size="large"
fieldNames={{
label: "name",
value: "id",
children: "childInfo",
}}
options={secondDistrictInfo}
onChange={onChange}
changeOnSelect
/>
<Select <Select
className='selectItem' className="selectItem"
bordered={false} bordered={false}
popupMatchSelectWidth={false} popupMatchSelectWidth={false}
placeholder="考证" placeholder="考证"
size="large" size="large"
onChange={(value)=>onProvinceChange(value,"考证")} onChange={(value) => onProvinceChange(value, "考证")}
options={[ options={[
{ value: "1", label: "视距内驾驶员" }, { value: "1", label: "视距内驾驶员" },
{ value: "2", label: "视距外驾驶员" }, { value: "2", label: "视距外驾驶员" },
{ value: "3", label: "教员" }, { value: "3", label: "教员" },
]} ]}
clearIcon allowClear
/> />
<Select <Select
className='selectItem' className="selectItem"
bordered={false} bordered={false}
popupMatchSelectWidth={false} popupMatchSelectWidth={false}
placeholder="技能" placeholder="技能"
size="large" size="large"
onChange={(value)=>onProvinceChange(value,"技能")} onChange={(value) => onProvinceChange(value, "技能")}
options={flightSkillsList} options={flightSkillsList}
fieldNames={{value:"id",label:"skillsName"}} fieldNames={{ value: "id", label: "skillsName" }}
clearIcon allowClear
/> />
</Space> </Space>
</div> </div>
<Button type="primary" className='btn'>报名学习课程</Button> <Button type="primary" className="btn">
报名学习课程
</Button>
</div> </div>
<ContentBox boxIndex={4} leftcontentstyle={{width:"925px",margin:{top:0,right:"15px",bottom:"15px",left:0}}} leftRenderDom={{columns:productList}} rightRenderDom={{columns:rightDomList}}/> <ContentBox
boxIndex={4}
leftcontentstyle={{
width: "925px",
margin: { top: 0, right: "15px", bottom: "15px", left: 0 },
}}
leftRenderDom={{ columns: productList }}
rightRenderDom={{ columns: rightDomList }}
/>
<Pagination <Pagination
current={pageParams.pageNo} current={pageParams.pageNo}
pageSize={pageParams.pageSize} pageSize={pageParams.pageSize}
......
...@@ -187,15 +187,6 @@ export default function WaterfallFlowBody() { ...@@ -187,15 +187,6 @@ export default function WaterfallFlowBody() {
}) })
.flat(); .flat();
// console.log("测试数据1");
// console.log("测试数据2",);
// console.log("测试数据3",res3.map((item,index)=>{
// return item.result?.map(it=>{it.type = mallApiTypeList[index];return it})
// }));
// console.log("测试数据5",res5.map((item,index)=>{
// return item.result?.map(it=>{it.type = flightApiTypeList[index];return it})
// }));
let res7 = await listNewsApi.listNewsPage({ pageNo: 1, pageSize: 10 }); let res7 = await listNewsApi.listNewsPage({ pageNo: 1, pageSize: 10 });
let res8 = await listNewsApi.listNewTenderInfo({ let res8 = await listNewsApi.listNewTenderInfo({
pageNo: 1, pageNo: 1,
...@@ -220,16 +211,6 @@ export default function WaterfallFlowBody() { ...@@ -220,16 +211,6 @@ export default function WaterfallFlowBody() {
setRightTopDomList(rightDom(res7.result?.list!)); setRightTopDomList(rightDom(res7.result?.list!));
setRightBottomDomList(rightDom2(res8.result?.list!)); setRightBottomDomList(rightDom2(res8.result?.list!));
})(); })();
// Promise.all([category(),brand(),model(),part(),quality(),region()]).then((res)=>{
// console.log("resssss ",res);
// const resultList = res.map(item=>{ return {result:item.result}})
// console.log(resultList[0].result);
// console.log(Array(resultList[0].result)[0]!.map((item,index)=>{
// console.log(item,index);
// return item.name
// }));
// setLeftDomList(columns.map((item,index)=>{return {element:leftDom(item,index,resultList)}}))
// })
}, []); }, []);
const routerPath = (item: AllType, index: number) => { const routerPath = (item: AllType, index: number) => {
...@@ -297,7 +278,7 @@ export default function WaterfallFlowBody() { ...@@ -297,7 +278,7 @@ export default function WaterfallFlowBody() {
const rightDom = (list: Array<NewsPageType>) => { const rightDom = (list: Array<NewsPageType>) => {
return ( return (
<div className="right-box-item right-item"> <div key={1} className="right-box-item right-item">
<div className="title">行业新闻</div> <div className="title">行业新闻</div>
<div className="body"> <div className="body">
{list?.map((item) => ( {list?.map((item) => (
...@@ -306,7 +287,11 @@ export default function WaterfallFlowBody() { ...@@ -306,7 +287,11 @@ export default function WaterfallFlowBody() {
<div className="item-image"> <div className="item-image">
<Image <Image
className="item-image" className="item-image"
src={item.surfaceImg} src={
item.surfaceImg
? item.surfaceImg
: require("./assets/xw.jpg")
}
alt="#" alt="#"
width={40} width={40}
height={40} height={40}
...@@ -321,7 +306,7 @@ export default function WaterfallFlowBody() { ...@@ -321,7 +306,7 @@ export default function WaterfallFlowBody() {
const rightDom2 = (list: Array<NewsTenderType>) => { const rightDom2 = (list: Array<NewsTenderType>) => {
return ( return (
<div className="right-box-item right-item-second"> <div key={2} className="right-box-item right-item-second">
<div className="title">招标快讯</div> <div className="title">招标快讯</div>
<div className="body"> <div className="body">
{list?.map((item) => ( {list?.map((item) => (
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论