提交 3b81e4be 作者: 翁进城

项目资讯筛选条件对接,样式调整

上级 1953aa0d
pages/projectInfo/assets/banner.png

83.2 KB | W: | H:

pages/projectInfo/assets/banner.png

56.0 KB | W: | H:

pages/projectInfo/assets/banner.png
pages/projectInfo/assets/banner.png
pages/projectInfo/assets/banner.png
pages/projectInfo/assets/banner.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -3,7 +3,7 @@
//项目需求
.bids {
.item {
padding: 24px 17px 24px 16px;
padding: 12px 17px 12px 16px;
display: flex;
border-bottom: 1px dashed RGBA(222, 222, 222, 1);
justify-content: space-between;
......@@ -11,7 +11,7 @@
.info {
.title {
font-size: 16px;
font-size: 14px;
font-family: MicrosoftYaHeiUI-Bold, MicrosoftYaHeiUI;
font-weight: bold;
color: #3c3e42;
......@@ -28,7 +28,7 @@
.btn {
width: 168px;
height: 40px;
height: 36px;
border-radius: 6px;
font-size: 14px;
font-family: MicrosoftYaHei;
......
......@@ -3,7 +3,16 @@ import { useState, useEffect } from "react";
import api, { Item } from "./api";
import styles from "./index.module.scss";
export default function Bids() {
type Props = {
params?: {
cityCode: number; //市编码
date: string; //时间 2023-05-19
districtCode: number; //区编码
provinceCode: number; //省编码
};
};
export default function Bids(props: Props) {
const [list, setList] = useState<Array<Item>>([]);
const [pageParams, setPageParams] = useState({
pageNo: 1,
......@@ -16,7 +25,7 @@ export default function Bids() {
//中断前一次请求
abort?.abort();
setAbort(new AbortController());
}, [pageParams]);
}, [pageParams, props.params]);
useEffect(() => {
if (!abort) {
......@@ -26,6 +35,7 @@ export default function Bids() {
.listNewTenderInfo(
{
...pageParams,
...props.params,
},
{
signal: abort?.signal,
......
......@@ -4,16 +4,16 @@ import { useState, useEffect } from "react";
import api, { Item } from "./api";
import styles from "./index.module.scss";
const list = [
{
isApply: false,
},
{
isApply: true,
},
];
type Props = {
params?: {
cityCode: number; //市编码
date: string; //时间 2023-05-19
districtCode: number; //区编码
provinceCode: number; //省编码
};
};
export default function Cases() {
export default function Cases(props: Props) {
const [list, setList] = useState<Array<Item>>([]);
const [pageParams, setPageParams] = useState({
pageNo: 1,
......@@ -27,7 +27,7 @@ export default function Cases() {
//中断前一次请求
abort?.abort();
setAbort(new AbortController());
}, [pageParams]);
}, [pageParams, props.params]);
useEffect(() => {
if (!abort) {
......@@ -37,6 +37,7 @@ export default function Cases() {
.listCasePage(
{
...pageParams,
...props.params,
},
{
signal: abort?.signal,
......
......@@ -22,6 +22,7 @@
border-radius: 6px;
margin-right: 22px;
@include ellipsis(1);
flex-shrink: 0;
}
.info {
......
......@@ -6,7 +6,16 @@ import { useState, useEffect } from "react";
import api, { Item } from "./api";
import { useRouter } from "next/router";
export default function News() {
type Props = {
params?: {
cityCode: number; //市编码
date: string; //时间 2023-05-19
districtCode: number; //区编码
provinceCode: number; //省编码
};
};
export default function News(props: Props) {
const [list, setList] = useState<Array<Item>>([]);
const [pageParams, setPageParams] = useState({
pageNo: 1,
......@@ -20,7 +29,7 @@ export default function News() {
//中断前一次请求
abort?.abort();
setAbort(new AbortController());
}, [pageParams]);
}, [pageParams, props.params]);
useEffect(() => {
if (!abort) {
......@@ -30,6 +39,7 @@ export default function News() {
.listNewsPage(
{
...pageParams,
...props.params,
},
{
signal: abort?.signal,
......@@ -46,7 +56,11 @@ export default function News() {
<Col className={styles.new}>
{list.map((item) => {
return (
<div className={styles.item} key={item.id} onClick={() => router.push('/projectInfo/newsArticle/' + item.id)}>
<div
className={styles.item}
key={item.id}
onClick={() => router.push("/projectInfo/newsArticle/" + item.id)}
>
<Image
className={styles.logo}
src={item.surfaceImg}
......@@ -60,7 +74,6 @@ export default function News() {
</div>
);
})}
</Col>
</Row>
);
......
//项目需求
.requirements {
padding-top: 20px;
.item {
cursor: pointer;
padding: 20px 19px;
padding: 15px 15px;
display: flex;
border-bottom: 1px dashed RGBA(222, 222, 222, 1);
.logo {
width: 60px;
height: 60px;
width: 50px;
height: 50px;
margin-right: 24px;
background: url('./assets/resolved.png') no-repeat;
background-size: 100% 100%;
......@@ -23,27 +22,27 @@
white-space: nowrap; /* 防止换行 */
overflow: hidden; /* 隐藏溢出部分 */
text-overflow: ellipsis; /* 使用省略号代替溢出部分 */
font-size: 18px;
font-size: 16px;
font-family: MicrosoftYaHeiUI-Bold, MicrosoftYaHeiUI;
font-weight: bold;
margin-bottom: 11px;
color: RGBA(127, 127, 127, 1);
margin-bottom: 6px;
color: RGBA(0, 0, 0, 0.4);
}
.desc {
white-space: nowrap; /* 防止换行 */
overflow: hidden; /* 隐藏溢出部分 */
text-overflow: ellipsis; /* 使用省略号代替溢出部分 */
font-size: 16px;
font-size: 14px;
font-family: MicrosoftYaHei;
color: RGBA(169, 170, 171, 1);
line-height: 22px;
color: RGBA(135, 135, 135, 0.4);
line-height: 1;
}
}
&.noResolve {
.logo {
background-image: url('./assets//noResolve.png');
background-image: url('./assets/noResolve.png');
}
.info {
......
......@@ -17,7 +17,7 @@ export default function Requirements(props: Props) {
const [list, setList] = useState<Array<Item>>([]);
const [pageParams, setPageParams] = useState({
pageNo: 1,
pageSize: 5,
pageSize: 8,
});
const [count, setCount] = useState(0);
const [abort, setAbort] = useState<AbortController | null>(null);
......@@ -37,6 +37,7 @@ export default function Requirements(props: Props) {
.listPublishPage(
{
...pageParams,
...props.params,
},
{
signal: abort?.signal,
......@@ -58,7 +59,7 @@ export default function Requirements(props: Props) {
return (
<Spin spinning={loading} delay={500}>
<div className={styles.requirements} style={{ height: 557 }}>
<div className={styles.requirements} style={{ height: 635 }}>
{list.map((item) => {
return (
<div
......
.bannerWrap{
height: 160px;
height: 100px;
position: relative;
}
......
......@@ -22,29 +22,26 @@ export interface Params {
provinceCode?: number; //省编码
}
interface RegionOptions extends RegionResp {
value: string;
}
const items = ["项目需求", "招投标项目", "业务案例", "行业新闻"].map(
const items = (params) => ["项目需求", "招投标项目", "业务案例", "行业新闻"].map(
(value) => {
let children: JSX.Element | string = <></>;
switch (value) {
case "项目需求":
children = <Requirements></Requirements>;
children = <Requirements params={params}></Requirements>;
break;
case "招投标项目":
children = <Bids></Bids>;
children = <Bids params={params}></Bids>;
break;
case "业务案例":
children = <Cases></Cases>;
children = <Cases params={params}></Cases>;
break;
case "行业新闻":
children = <News></News>;
children = <News params={params}></News>;
break;
}
return {
......@@ -56,18 +53,18 @@ const items = ["项目需求", "招投标项目", "业务案例", "行业新闻"
);
export default function ProjectInfo() {
const [region, setRegion] = useState<Array<RegionOptions>>([]);
const [region, setRegion] = useState<Array<RegionResp>>([]);
const [params, setParams] = useState<Params | null>({});
useEffect(() => {
commonApi.region().then((res) => {
let temp = res.result || [];
let temp1: Array<RegionOptions> = [];
let temp1: Array<RegionResp> = [];
if (res.result) {
temp1 = temp.map((item) => {
let t = {
...item,
value: item.id + "," + item.level,
id: item.id,
};
return t;
});
......@@ -76,15 +73,30 @@ export default function ProjectInfo() {
});
}, []);
const onRegionChange = (value: string) => {
const onRegionChange = (value: Array<string>, list: Array<RegionResp>) => {
console.log(value);
let params1: Params = {
provinceCode: undefined,
districtCode: undefined
};
list?.forEach(item => {
if(item.level == 1){
params1.provinceCode = item.id;
} else if(item.level == 2){
params1.districtCode = item.id;
}
})
setParams({
...params,
...params1,
});
};
const onDateChange: DatePickerProps["onChange"] = (date, dateString) => {
console.log(date, dateString);
setParams({
...params,
date: dateString,
date: dateString || undefined,
});
};
return (
......@@ -108,7 +120,7 @@ export default function ProjectInfo() {
borderRadiusSM={6}
fieldNames={{
label: "name",
value: "value",
value: "id",
children: "childInfo",
}}
changeOnSelect
......@@ -117,8 +129,9 @@ export default function ProjectInfo() {
<DatePicker onChange={onDateChange} />
</Space>
}
items={items}
items={items(params)}
tabBarGutter={41}
destroyInactiveTabPane={true}
/>
</div>
</div>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论