This commit is contained in:
parent
4109d592d7
commit
9d93a8ec37
|
|
@ -5,6 +5,7 @@ import { useStore } from "@/store";
|
||||||
type Data = {
|
type Data = {
|
||||||
title: string;
|
title: string;
|
||||||
createTime: string;
|
createTime: string;
|
||||||
|
publishTime: string;
|
||||||
readTimes: string | number;
|
readTimes: string | number;
|
||||||
content: string;
|
content: string;
|
||||||
}
|
}
|
||||||
|
|
@ -22,7 +23,7 @@ export default function Article({ data, prevItem, nextItem, setDetailId }: {
|
||||||
const appConfig = useStore((s) => s.appConfig);
|
const appConfig = useStore((s) => s.appConfig);
|
||||||
const {
|
const {
|
||||||
back = "返回",
|
back = "返回",
|
||||||
publishTime = "发布时间",
|
publishTime: publishTimeText = "发布时间",
|
||||||
readTimes = "阅读次数",
|
readTimes = "阅读次数",
|
||||||
prevArticle = "上一篇",
|
prevArticle = "上一篇",
|
||||||
nextArticle = "下一篇",
|
nextArticle = "下一篇",
|
||||||
|
|
@ -38,7 +39,7 @@ export default function Article({ data, prevItem, nextItem, setDetailId }: {
|
||||||
<div className={styles.articleHeader}>
|
<div className={styles.articleHeader}>
|
||||||
<div className={styles.articleHeaderTitle}>{data.title}</div>
|
<div className={styles.articleHeaderTitle}>{data.title}</div>
|
||||||
<div className={styles.articleHeaderTimeLine}>
|
<div className={styles.articleHeaderTimeLine}>
|
||||||
<span className={styles.articleHeaderTime}>{publishTime}:{dateFormat(data.createTime, 'yyyy-MM-dd')}</span>
|
<span className={styles.articleHeaderTime}>{publishTimeText}:{dateFormat(data.publishTime || data.createTime, 'yyyy-MM-dd')}</span>
|
||||||
<span className={styles.articleHeaderReadTimes}>{readTimes}:{data.readTimes}</span>
|
<span className={styles.articleHeaderReadTimes}>{readTimes}:{data.readTimes}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -420,6 +420,7 @@
|
||||||
margin: 0 0 0.5rem;
|
margin: 0 0 0.5rem;
|
||||||
line-height: 1.6;
|
line-height: 1.6;
|
||||||
height: 4.375rem;
|
height: 4.375rem;
|
||||||
|
max-width: 37.5rem;
|
||||||
|
|
||||||
display: -webkit-box;
|
display: -webkit-box;
|
||||||
-webkit-line-clamp: 2;
|
-webkit-line-clamp: 2;
|
||||||
|
|
|
||||||
|
|
@ -114,7 +114,7 @@ function News({data}: any) {
|
||||||
return {
|
return {
|
||||||
id: item.id,
|
id: item.id,
|
||||||
title: item.title,
|
title: item.title,
|
||||||
date: item.create_time,
|
date: item.publish_time || item.create_time,
|
||||||
image: item.covers_show === 'image' ? item.covers.image[0] : '',
|
image: item.covers_show === 'image' ? item.covers.image[0] : '',
|
||||||
video: item.covers_show === 'video' ? item.covers.video[0] : '',
|
video: item.covers_show === 'video' ? item.covers.video[0] : '',
|
||||||
snippet: item.content,
|
snippet: item.content,
|
||||||
|
|
@ -127,7 +127,7 @@ function News({data}: any) {
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const category_id = categoryList?.find((item: any) => item.name === '【首页】新闻资讯')?.id;
|
const category_id = categoryList?.find((item: any) => item.name === '【集团发布】')?.id;
|
||||||
handleSearch(category_id)
|
handleSearch(category_id)
|
||||||
}, [])
|
}, [])
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -41,11 +41,12 @@
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
font-size: 1.125rem;
|
font-size: 1.125rem;
|
||||||
color: #FFFFFF;
|
color: #FFFFFF;
|
||||||
line-height: 2.5rem;
|
/* line-height: 2.5rem; */
|
||||||
height: 0;
|
height: 0;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
overflow: hidden;
|
/* overflow: hidden; */
|
||||||
transition: all 0.3s ease-in-out;
|
transition: all 0.3s ease-in-out;
|
||||||
|
text-align: center;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ type NewsDetail = {
|
||||||
id: number;
|
id: number;
|
||||||
title: string;
|
title: string;
|
||||||
createTime: string;
|
createTime: string;
|
||||||
|
publishTime: string;
|
||||||
readTimes: number;
|
readTimes: number;
|
||||||
content: string;
|
content: string;
|
||||||
lang: "lang" | "EN"
|
lang: "lang" | "EN"
|
||||||
|
|
@ -30,6 +31,7 @@ export default function NewsDetail() {
|
||||||
id: item.id,
|
id: item.id,
|
||||||
title: item.title,
|
title: item.title,
|
||||||
createTime: item.create_time,
|
createTime: item.create_time,
|
||||||
|
publishTime: item.publish_time,
|
||||||
readTimes: item.count,
|
readTimes: item.count,
|
||||||
content: item.content,
|
content: item.content,
|
||||||
lang: item.lang,
|
lang: item.lang,
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ type NewsItem = {
|
||||||
id: number;
|
id: number;
|
||||||
title: string;
|
title: string;
|
||||||
createTime: string;
|
createTime: string;
|
||||||
|
publishTime: string;
|
||||||
image: string;
|
image: string;
|
||||||
video: string;
|
video: string;
|
||||||
lang: "ZH" | "EN"
|
lang: "ZH" | "EN"
|
||||||
|
|
@ -43,6 +44,7 @@ export default function NewsPublic() {
|
||||||
id: item.id,
|
id: item.id,
|
||||||
title: item.title,
|
title: item.title,
|
||||||
createTime: item.create_time,
|
createTime: item.create_time,
|
||||||
|
publishTime: item.publish_time,
|
||||||
image: item.covers_show === 'image' ? item.covers.image[0] : '',
|
image: item.covers_show === 'image' ? item.covers.image[0] : '',
|
||||||
video: item.covers_show === 'video' ? item.covers.video[0] : '',
|
video: item.covers_show === 'video' ? item.covers.video[0] : '',
|
||||||
lang: item.lang,
|
lang: item.lang,
|
||||||
|
|
@ -123,7 +125,7 @@ export default function NewsPublic() {
|
||||||
<div className={styles.newItemContent}>
|
<div className={styles.newItemContent}>
|
||||||
<div className={styles.newItemTitle}>{item.title}</div>
|
<div className={styles.newItemTitle}>{item.title}</div>
|
||||||
<div className={styles.newItemCreateTime}>
|
<div className={styles.newItemCreateTime}>
|
||||||
{dateFormat(item.createTime, "yyyy-MM-dd")}
|
{dateFormat(item.publishTime || item.createTime, "yyyy-MM-dd")}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Link>
|
</Link>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue