提交 2c45f26b 作者: 18928357778

添-首页-筛选跳转功能

上级 9f9df0c9
...@@ -55,6 +55,7 @@ export const equipmentLeasingApi = { ...@@ -55,6 +55,7 @@ export const equipmentLeasingApi = {
export interface AppType { export interface AppType {
id: number; id: number;
name: string;
appName: string; appName: string;
createTime: string; createTime: string;
type: string; type: string;
...@@ -64,13 +65,14 @@ export interface IndustryType { ...@@ -64,13 +65,14 @@ export interface IndustryType {
id: number; id: number;
industryIcon: string; industryIcon: string;
name: string; name: string;
shortName: null; shortName: string;
industryType: null; industryType: string;
propagate1: string; propagate1: string;
propagate2: string; propagate2: string;
image: string; image: string;
video: string; video: string;
type: string; type: string;
appName: string;
} }
export const jobServicesApi = { export const jobServicesApi = {
...@@ -95,8 +97,9 @@ export const mallApi = { ...@@ -95,8 +97,9 @@ export const mallApi = {
}; };
export interface SkillsType { export interface SkillsType {
name: string;
type: string; type: string;
id: 1; id: number;
skillsName: string; skillsName: string;
} }
...@@ -128,19 +131,19 @@ export interface NewsTenderType { ...@@ -128,19 +131,19 @@ export interface NewsTenderType {
} }
export interface ListPageNewsInfoResp { export interface ListPageNewsInfoResp {
pageNo: 1; pageNo: number;
pageSize: 10; pageSize: number;
list: Array<NewsPageType>; list: Array<NewsPageType>;
totalCount: 0; totalCount: number;
totalPage: 0; totalPage: number;
} }
export interface ListTenderNewsInfoResp { export interface ListTenderNewsInfoResp {
pageNo: 1; pageNo: number;
pageSize: 10; pageSize: number;
list: Array<NewsTenderType>; list: Array<NewsTenderType>;
totalCount: 0; totalCount: number;
totalPage: 0; totalPage: number;
} }
interface ListPageNewsInfoParams { interface ListPageNewsInfoParams {
......
import React, { Component, useEffect, useState } from "react"; import React, { Component, useEffect, useState } from "react";
import { Box } from "./styled"; import { Box } from "./styled";
import api from "./api"; import api from "./api";
import icon from "./assets/icon.png";
let Map: any; let Map: any;
export default function MapComponent() { export default function MapComponent() {
const [mapItem, setMapItem] = useState(0); const [mapItem, setMapItem] = useState(0);
...@@ -41,11 +42,27 @@ export default function MapComponent() { ...@@ -41,11 +42,27 @@ export default function MapComponent() {
const addEntiy = (AMap: any, lan: any, lon: any, dizhi: string) => { const addEntiy = (AMap: any, lan: any, lon: any, dizhi: string) => {
if (!AMap) return; if (!AMap) return;
// 创建 AMap.Icon 实例:
const Icon = new AMap.Icon({
size: new AMap.Size(40, 50), // 图标尺寸
image: "//webapi.amap.com/theme/v1.3/images/newpc/way_btn2.png", // Icon的图像
imageOffset: new AMap.Pixel(0, -60), // 图像相对展示区域的偏移量,适于雪碧图等
imageSize: new AMap.Size(40, 50), // 根据所设置的大小拉伸或压缩图片
});
// 将 Icon 实例添加到 marker 上:
const marker = new AMap.Marker({ const marker = new AMap.Marker({
map: Map, position: new AMap.LngLat(lan, lon),
position: [lan, lon], offset: new AMap.Pixel(-10, -10),
icon: Icon, // 添加 Icon 实例
title: dizhi, title: dizhi,
zoom: 9,
map: Map,
}); });
// const marker = new AMap.Marker({
// map: Map,
// position: [lan, lon],
// title: dizhi,
// });
// //鼠标点击marker弹出自定义的信息窗体 // //鼠标点击marker弹出自定义的信息窗体
// AMap.Event.addListener(marker, "click", function () { // AMap.Event.addListener(marker, "click", function () {
// infoWindow.open(map, marker.getPosition()); // infoWindow.open(map, marker.getPosition());
......
...@@ -46,4 +46,9 @@ export const Box = styled.div` ...@@ -46,4 +46,9 @@ export const Box = styled.div`
color: #ff552d; color: #ff552d;
} }
} }
#container {
padding: 0px;
margin: 0px;
width: 100%;
}
`; `;
...@@ -31,9 +31,7 @@ interface ColumnsType { ...@@ -31,9 +31,7 @@ interface ColumnsType {
export default function WaterfallFlowBody() { export default function WaterfallFlowBody() {
const router = useRouter(); const router = useRouter();
const onMoreChange = (value: string) => {
console.log("更多", value);
};
const [list, setList] = useState([ const [list, setList] = useState([
"中国人寿", "中国人寿",
"中国平安", "中国平安",
...@@ -74,9 +72,6 @@ export default function WaterfallFlowBody() { ...@@ -74,9 +72,6 @@ export default function WaterfallFlowBody() {
"云享飞", "云享飞",
"科比特智教", "科比特智教",
]); ]);
// const [brandData,setBrandData] = useState<FilterOptionResp[]>([])
const [moreEqList, setMoreEqList] = useState<any>();
const columns = [ const columns = [
{ {
...@@ -108,6 +103,7 @@ export default function WaterfallFlowBody() { ...@@ -108,6 +103,7 @@ export default function WaterfallFlowBody() {
const [leftDomList, setLeftDomList] = useState( const [leftDomList, setLeftDomList] = useState(
Array<{ element: JSX.Element; type?: string }> Array<{ element: JSX.Element; type?: string }>
); );
const [rightTopDomList, setRightTopDomList] = useState<JSX.Element>(); const [rightTopDomList, setRightTopDomList] = useState<JSX.Element>();
const [rightBottomDomList, setRightBottomDomList] = useState<JSX.Element>(); const [rightBottomDomList, setRightBottomDomList] = useState<JSX.Element>();
...@@ -128,15 +124,17 @@ export default function WaterfallFlowBody() { ...@@ -128,15 +124,17 @@ export default function WaterfallFlowBody() {
const { listAllIndustry, listAllAppType } = jobServicesApi; const { listAllIndustry, listAllAppType } = jobServicesApi;
const jobApiTypeList = ["industryId", "appTypeId"]; const jobApiTypeList = ["industryId", "appTypeId"];
const onMoreChange = (
value: { value: string; label: number },
index: number,
option: []
) => {
const [item] = option.filter((item: any) => item.name === value.value);
routerPath(index, item);
};
useEffect(() => { useEffect(() => {
(async () => { (async () => {
// listNewsApi.listNewsPage({ pageNo: 1, pageSize: 5 }).then((res) => {
// setRightTopDomList(rightDom(res.result?.list!));
// });
// listNewsApi.listNewTenderInfo({ pageNo: 1, pageSize: 6 }).then((res) => {
// setRightBottomDomList(rightDom2(res.result?.list!));
// });
let res1 = await Promise.all([ let res1 = await Promise.all([
deviceCategory(), deviceCategory(),
deviceBrand(), deviceBrand(),
...@@ -172,6 +170,7 @@ export default function WaterfallFlowBody() { ...@@ -172,6 +170,7 @@ export default function WaterfallFlowBody() {
.map((item, index) => { .map((item, index) => {
return item.result?.map((it) => { return item.result?.map((it) => {
it.type = flightApiTypeList[index]; it.type = flightApiTypeList[index];
it.name = it.name || it.skillsName;
return it; return it;
}); });
}) })
...@@ -180,6 +179,8 @@ export default function WaterfallFlowBody() { ...@@ -180,6 +179,8 @@ export default function WaterfallFlowBody() {
.map((item, index) => { .map((item, index) => {
return item.result?.map((it) => { return item.result?.map((it) => {
it.type = jobApiTypeList[index]; it.type = jobApiTypeList[index];
console.log(it);
it.name = it.name || it.appName;
return it; return it;
}); });
}) })
...@@ -195,17 +196,42 @@ export default function WaterfallFlowBody() { ...@@ -195,17 +196,42 @@ export default function WaterfallFlowBody() {
resValuelist2, resValuelist2,
[], [],
resValuelist3, resValuelist3,
resValuelist4.flat(), resValuelist4,
[], [],
]; ];
const listOption = JSON.parse(JSON.stringify(list)).map(
(item: string, index: number) => {
return { id: index, name: item, value: index };
}
);
const list2Option = JSON.parse(JSON.stringify(list2)).map(
(item: string, index: number) => {
return { id: index, name: item, value: index };
}
);
const optionList = [
resValuelist1,
resValuelist2,
listOption,
resValuelist3,
resValuelist4,
list2Option,
];
console.log(optionList);
setMoreEqList(res1.map((item) => item.result).flat());
setLeftDomList( setLeftDomList(
columns.map((item, index) => { columns.map((item, index) => {
if (index < 3) { if (index < 3) {
return { element: leftDom(item, index, listValue), type: "left" }; return {
element: leftDom(item, index, listValue, optionList[index]),
type: "left",
};
} }
return { element: leftDom(item, index, listValue), type: "right" }; return {
element: leftDom(item, index, listValue, optionList[index]),
type: "right",
};
}) })
); );
...@@ -230,7 +256,8 @@ export default function WaterfallFlowBody() { ...@@ -230,7 +256,8 @@ export default function WaterfallFlowBody() {
const leftDom = ( const leftDom = (
item: ColumnsType, item: ColumnsType,
index: number, index: number,
resultList: Array<Array<AllType>> resultList: Array<Array<AllType>>,
option: []
) => { ) => {
return ( return (
<div key={item.title} className="item"> <div key={item.title} className="item">
...@@ -240,15 +267,19 @@ export default function WaterfallFlowBody() { ...@@ -240,15 +267,19 @@ export default function WaterfallFlowBody() {
{item.title} {item.title}
</div> </div>
</div> </div>
<div> <div key={item.title}>
<Select <Select
className="select-box" className="select-box"
placeholder="筛选" placeholder="筛选"
onChange={onMoreChange} labelInValue
onChange={(value) => onMoreChange(value, index, option)}
bordered={false} bordered={false}
dropdownMatchSelectWidth={false} dropdownMatchSelectWidth={false}
options={moreEqList} options={option}
fieldNames={{ value: "id", label: "name" }} fieldNames={{
value: "name",
label: "name",
}}
/> />
</div> </div>
</div> </div>
......
...@@ -192,6 +192,7 @@ export const Box = styled.div` ...@@ -192,6 +192,7 @@ export const Box = styled.div`
border-radius: 6px; border-radius: 6px;
background-color: #fff; background-color: #fff;
background: url(${xwbg.src}) no-repeat; background: url(${xwbg.src}) no-repeat;
background-size: contain;
.title { .title {
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -280,6 +281,7 @@ export const Box = styled.div` ...@@ -280,6 +281,7 @@ export const Box = styled.div`
width: 103px; width: 103px;
height: 22px; height: 22px;
background: url(${button.src}) no-repeat; background: url(${button.src}) no-repeat;
background-size: contain;
.left { .left {
width: 35px; width: 35px;
height: 22px; height: 22px;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论