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