提交 452312a7 作者: 18928357778

合并代码

...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
box-shadow: 0px 2px 10px 0px rgba(232,232,232,0.5);
} }
.nav{ .nav{
......
...@@ -82,7 +82,7 @@ export default function Forum() { ...@@ -82,7 +82,7 @@ export default function Forum() {
}} }}
> >
<Space size={6} wrap> <Space size={6} wrap>
{item?.mediaVO?.picture.map((img) => { {item?.mediaVO?.picture?.map((img) => {
return ( return (
<Image <Image
key={img} key={img}
......
...@@ -89,8 +89,8 @@ export default function MallDetail() { ...@@ -89,8 +89,8 @@ export default function MallDetail() {
<div className={`${styles.font1} ${styles.ellipsis}`}> <div className={`${styles.font1} ${styles.ellipsis}`}>
{detail?.goodsName} {detail?.goodsName}
</div> </div>
<div className={`${styles.font2} ${styles.ellipsis}`}> <div className={`${styles.font2} ${styles.ellipsis}`} style={{height: 22}}>
交通事故处理、违章取证、指挥调度、日常巡 {detail?.goodsDesc}
</div> </div>
<Space <Space
size={24} size={24}
......
...@@ -22,6 +22,7 @@ export interface GetAppGoodsInfoDetailResult { ...@@ -22,6 +22,7 @@ export interface GetAppGoodsInfoDetailResult {
shelfStatus?: number; shelfStatus?: number;
otherService?: OtherService[]; otherService?: OtherService[];
question?: Question[]; question?: Question[];
goodsDesc?: string
} }
export interface GoodsDetail { export interface GoodsDetail {
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
gap: 12px; gap: 12px;
height: 856px; height: auto;
.item { .item {
cursor: pointer; cursor: pointer;
......
...@@ -35,6 +35,9 @@ export default function Mall(props: Props) { ...@@ -35,6 +35,9 @@ export default function Mall(props: Props) {
//端口列表请求 //端口列表请求
useEffect(() => { useEffect(() => {
if (!abort) {
return;
}
api api
.listPageGoodsInfo( .listPageGoodsInfo(
{ {
......
import { RightOutlined } from "@ant-design/icons";
import { Col, Row, Space, Image } from "antd";
import { useRouter } from "next/router";
import { useEffect, useState } from "react";
import errImg from "~/assets/errImg";
import Layout from "~/components/layout";
import newsApi, { Item } from "../components/news/api";
import api, { DetailsResp } from "./api";
import styles from "./index.module.scss";
export default function CaseArticle() {
const router = useRouter();
const [data, setData] = useState<DetailsResp | null>(null);
const [newsList, setNewList] = useState<Item[]>([]);
//获取案例详情
useEffect(() => {
const id = Number(router.query.id);
if (id) {
api
.details({
id,
})
.then((res) => {
setData(res.result || null);
});
}
}, [router]);
//获取新闻列表
useEffect(() => {
newsApi
.listNewsPage({
pageNo: 1,
pageSize: 5,
})
.then((res) => {
setNewList(res.result?.list || []);
});
});
return (
<Layout layoutStyle={{ backgroundColor: "#fff" }}>
<div style={{ paddingTop: 29 }}>
<Row justify="space-between">
<Col flex="auto">
<div className={styles.font1}>{data?.caseTitle}</div>
<div
className={styles.font2}
style={{ marginTop: 18, marginBottom: 41 }}
>
{data?.createTime} · {data?.caseAuthor}
</div>
<div
dangerouslySetInnerHTML={{ __html: data?.caseContents || "" }}
></div>
</Col>
<Col>
<div className={styles.newsBox}>
<Row
className={styles.font4}
align="middle"
style={{ paddingTop: 24, paddingLeft: 24 }}
>
行业新闻
<RightOutlined style={{ fontSize: 16, marginLeft: 15 }} />
</Row>
<Row gutter={10} style={{ marginTop: 18 }}>
<Col span={24}>
{newsList.map((item) => {
return (
<Row
key={item.id}
justify="space-between"
align="middle"
style={{ cursor: "pointer" }}
onClick={() => {
router.push("/projectInfo/newsArticle/" + item.id);
}}
>
<Col
className={`${styles.font3} ${styles.ellipse2}`}
style={{ width: 217, padding: "13px 0 17px 20px" }}
>
{item.newsTitle}
</Col>
<Col style={{ paddingRight: 16 }}>
<Image
src={item.surfaceImg}
width={90}
height={60}
preview={false}
fallback={errImg}
style={{ borderRadius: 6 }}
></Image>
</Col>
</Row>
);
})}
</Col>
</Row>
</div>
</Col>
</Row>
</div>
</Layout>
);
}
import request, { Response } from "~/api/request";
export interface DetailsParams {
id: number;
}
export interface DetailsResp {
id: number;
caseTitle?: string;
caseAuthor?: string;
userAccountId?: number;
surfaceImg?: string;
caseContents?: string;
createTime?: string;
updateTime?: string;
}
export default {
//案例详情
details(params: DetailsParams): Promise<Response<DetailsResp>> {
return request("/release/industry-case/details", "get", params);
},
};
@import "~/styles/mixins.scss";
.font1 {
font-size: 36px;
font-family: MicrosoftYaHeiUI-Bold, MicrosoftYaHeiUI;
font-weight: bold;
color: #000000;
line-height: 50px;
}
.font2 {
font-size: 12px;
font-family: MicrosoftYaHei;
color: #333333;
line-height: 16px;
}
.font3 {
font-size: 16px;
font-family: MicrosoftYaHei;
color: #323232;
line-height: 21px;
}
.font4 {
font-size: 20px;
font-family: MicrosoftYaHeiUI-Bold, MicrosoftYaHeiUI;
font-weight: bold;
color: #000000;
line-height: 25px;
}
.newsBox {
width: 384px;
height: 491px;
background-image: url("./assets/bk.png");
background-size: 100% 100%;
}
.ellipse2 {
@include ellipsis(2);
}
...@@ -19,6 +19,9 @@ export default function Bids() { ...@@ -19,6 +19,9 @@ export default function Bids() {
}, [pageParams]); }, [pageParams]);
useEffect(() => { useEffect(() => {
if (!abort) {
return;
}
api api
.listNewTenderInfo( .listNewTenderInfo(
{ {
......
...@@ -19,14 +19,13 @@ export interface ListCasePageResp { ...@@ -19,14 +19,13 @@ export interface ListCasePageResp {
export interface Item { export interface Item {
id: number; id: number;
newsTitle: string; caseTitle: string;
newsAuthor: string; caseAuthor: string;
userAccountId: number; userAccountId: number;
surfaceImg: string; surfaceImg: string;
newsContents: string; caseContents: string;
createTime: string; createTime: string;
updateTime: string; updateTime: string;
isApply: 0 | 1
} }
export default { export default {
......
import { Button } from "antd"; import { Button } from "antd";
import { useRouter } from "next/router";
import { useState, useEffect } from "react"; import { useState, useEffect } from "react";
import api, { Item } from "./api"; import api, { Item } from "./api";
import styles from "./index.module.scss"; import styles from "./index.module.scss";
...@@ -13,45 +14,54 @@ const list = [ ...@@ -13,45 +14,54 @@ const list = [
]; ];
export default function Cases() { export default function Cases() {
const [list, setList] = useState<Array<Item>>([]); const [list, setList] = useState<Array<Item>>([]);
const [pageParams, setPageParams] = useState({ const [pageParams, setPageParams] = useState({
pageNo: 1, pageNo: 1,
pageSize: 5, pageSize: 5,
}); });
const [count, setCount] = useState(0); const [count, setCount] = useState(0);
const [abort, setAbort] = useState<AbortController | null>(null); const [abort, setAbort] = useState<AbortController | null>(null);
const Router = useRouter();
useEffect(() => { useEffect(() => {
//中断前一次请求 //中断前一次请求
abort?.abort(); abort?.abort();
setAbort(new AbortController()); setAbort(new AbortController());
}, [pageParams]); }, [pageParams]);
useEffect(() => {
if (!abort) {
return;
}
api
.listCasePage(
{
...pageParams,
},
{
signal: abort?.signal,
}
)
.then((res) => {
setList(res.result?.list || []);
setCount(res.result?.totalCount || 0);
});
}, [abort]);
useEffect(() => {
api
.listCasePage(
{
...pageParams,
},
{
signal: abort?.signal,
}
)
.then((res) => {
setList(res.result?.list || []);
setCount(res.result?.totalCount || 0);
});
}, [abort]);
return ( return (
<div className={styles.casas}> <div className={styles.casas}>
{list.map((item) => { {list.map((item) => {
return ( return (
<div className={styles.item} key={item.id}> <div className={styles.item} key={item.id}>
<div className={styles.info}> <div className={styles.info}>
<div className={styles.title}>{item.newsTitle}</div> <div className={styles.title}>{item.caseTitle}</div>
</div> </div>
<Button className={styles.btn}>查看案例</Button> <Button
className={styles.btn}
onClick={() => Router.push("/projectInfo/caseArticle/" + item.id)}
>
查看案例
</Button>
</div> </div>
); );
})} })}
......
...@@ -4,6 +4,7 @@ import styles from "./index.module.scss"; ...@@ -4,6 +4,7 @@ import styles from "./index.module.scss";
import Image from "next/image"; import Image from "next/image";
import { useState, useEffect } from "react"; import { useState, useEffect } from "react";
import api, { Item } from "./api"; import api, { Item } from "./api";
import { useRouter } from "next/router";
export default function News() { export default function News() {
const [list, setList] = useState<Array<Item>>([]); const [list, setList] = useState<Array<Item>>([]);
...@@ -13,6 +14,7 @@ export default function News() { ...@@ -13,6 +14,7 @@ export default function News() {
}); });
const [count, setCount] = useState(0); const [count, setCount] = useState(0);
const [abort, setAbort] = useState<AbortController | null>(null); const [abort, setAbort] = useState<AbortController | null>(null);
const router = useRouter();
useEffect(() => { useEffect(() => {
//中断前一次请求 //中断前一次请求
...@@ -21,6 +23,9 @@ export default function News() { ...@@ -21,6 +23,9 @@ export default function News() {
}, [pageParams]); }, [pageParams]);
useEffect(() => { useEffect(() => {
if (!abort) {
return;
}
api api
.listNewsPage( .listNewsPage(
{ {
...@@ -41,7 +46,7 @@ export default function News() { ...@@ -41,7 +46,7 @@ export default function News() {
<Col className={styles.new}> <Col className={styles.new}>
{list.map((item) => { {list.map((item) => {
return ( return (
<div className={styles.item} key={item.id}> <div className={styles.item} key={item.id} onClick={() => router.push('/projectInfo/newsArticle/' + item.id)}>
<Image <Image
className={styles.logo} className={styles.logo}
src={item.surfaceImg} src={item.surfaceImg}
......
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from "react";
import api, { Item } from "./api"; import api, { Item } from "./api";
import styles from './index.module.scss'; import styles from "./index.module.scss";
export default function Requirements(){ export default function Requirements() {
const [list, setList] = useState<Array<Item>>([]); const [list, setList] = useState<Array<Item>>([]);
const [pageParams, setPageParams] = useState({ const [pageParams, setPageParams] = useState({
pageNo: 1, pageNo: 1,
...@@ -18,6 +18,9 @@ export default function Requirements(){ ...@@ -18,6 +18,9 @@ export default function Requirements(){
}, [pageParams]); }, [pageParams]);
useEffect(() => { useEffect(() => {
if (!abort) {
return;
}
api api
.listPublishPage( .listPublishPage(
{ {
...@@ -35,7 +38,7 @@ export default function Requirements(){ ...@@ -35,7 +38,7 @@ export default function Requirements(){
return ( return (
<div className={styles.requirements}> <div className={styles.requirements}>
{list.map(item => { {list.map((item) => {
return ( return (
<div <div
className={`${styles.item} ${!item.solved && styles.noResolve}`} className={`${styles.item} ${!item.solved && styles.noResolve}`}
...@@ -53,4 +56,4 @@ export default function Requirements(){ ...@@ -53,4 +56,4 @@ export default function Requirements(){
})} })}
</div> </div>
); );
} }
\ No newline at end of file
import { RightOutlined } from "@ant-design/icons";
import { Col, Row, Space, Image } from "antd";
import { useRouter } from "next/router";
import { useEffect, useState } from "react";
import errImg from "~/assets/errImg";
import Layout from "~/components/layout";
import newsApi, { Item } from "../components/news/api";
import api, { DetailsResp } from "./api";
import styles from "./index.module.scss";
export default function CaseArticle() {
const router = useRouter();
const [data, setData] = useState<DetailsResp | null>(null);
const [newsList, setNewList] = useState<Item[]>([]);
//获取案例详情
useEffect(() => {
const id = Number(router.query.id);
if (id) {
api
.details({
id,
})
.then((res) => {
setData(res.result || null);
});
}
}, [router]);
//获取新闻列表
useEffect(() => {
newsApi
.listNewsPage({
pageNo: 1,
pageSize: 5,
})
.then((res) => {
setNewList(res.result?.list || []);
});
});
return (
<Layout layoutStyle={{ backgroundColor: "#fff" }}>
<div style={{ paddingTop: 29 }}>
<Row justify="space-between">
<Col flex="auto">
<div className={styles.font1}>{data?.newsTitle}</div>
<div
className={styles.font2}
style={{ marginTop: 18, marginBottom: 41 }}
>
{data?.createTime} · {data?.newsAuthor}
</div>
<div
dangerouslySetInnerHTML={{ __html: data?.newsContents || "" }}
></div>
</Col>
<Col>
<div className={styles.newsBox}>
<Row
className={styles.font4}
align="middle"
style={{ paddingTop: 24, paddingLeft: 24 }}
>
行业新闻
<RightOutlined style={{ fontSize: 16, marginLeft: 15 }} />
</Row>
<Row gutter={10} style={{ marginTop: 18 }}>
<Col span={24}>
{newsList.map((item) => {
return (
<Row
key={item.id}
justify="space-between"
align="middle"
style={{ cursor: "pointer" }}
onClick={() => {
router.push("/projectInfo/newsArticle/" + item.id);
}}
>
<Col
className={`${styles.font3} ${styles.ellipse2}`}
style={{ width: 217, padding: "13px 0 17px 20px" }}
>
{item.newsTitle}
</Col>
<Col style={{ paddingRight: 16 }}>
<Image
src={item.surfaceImg}
width={90}
height={60}
preview={false}
fallback={errImg}
style={{ borderRadius: 6 }}
></Image>
</Col>
</Row>
);
})}
</Col>
</Row>
</div>
</Col>
</Row>
</div>
</Layout>
);
}
import request, { Response } from "~/api/request";
export interface DetailsParams {
id: number;
}
export interface DetailsResp {
id: number;
newsTitle?: string;
newsAuthor?: string;
userAccountId?: number;
surfaceImg?: string;
newsContents?: string;
createTime?: string;
updateTime?: string;
}
export default {
//案例详情
details(params: DetailsParams): Promise<Response<DetailsResp>> {
return request("/release/industry-news/details", "get", params);
},
};
@import "~/styles/mixins.scss";
.font1 {
font-size: 36px;
font-family: MicrosoftYaHeiUI-Bold, MicrosoftYaHeiUI;
font-weight: bold;
color: #000000;
line-height: 50px;
}
.font2 {
font-size: 12px;
font-family: MicrosoftYaHei;
color: #333333;
line-height: 16px;
}
.font3 {
font-size: 16px;
font-family: MicrosoftYaHei;
color: #323232;
line-height: 21px;
}
.font4 {
font-size: 20px;
font-family: MicrosoftYaHeiUI-Bold, MicrosoftYaHeiUI;
font-weight: bold;
color: #000000;
line-height: 25px;
}
.newsBox {
width: 384px;
height: 491px;
background-image: url("./assets/bk.png");
background-size: 100% 100%;
}
.ellipse2 {
@include ellipsis(2);
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论