This commit is contained in:
toom1996
2025-08-05 10:32:00 +08:00
parent c7d0627793
commit 6c084793ec

View File

@ -4,7 +4,7 @@ import { getConfig } from "../../utils/config";
import { newsIndex } from "../../utils/rpc"; import { newsIndex } from "../../utils/rpc";
import { Image } from "astro:assets"; import { Image } from "astro:assets";
const config = getConfig(Astro); const config = getConfig(Astro);
const { code, data, guess } = await newsIndex(config.id, 20, 1); const { code, data, guess } = await newsIndex(config.id, 3, 1);
console.log(data) console.log(data)
--- ---
@ -215,89 +215,40 @@ console.log(data)
</div> </div>
<div class="news"> <div class="news">
<div class="container"> <div class="container">
<div class="team-head text-center"> <div class="section_title_wrapper mb-60 text-center">
<h3>最新资讯</h3> <h2 class="section-title team_title_h3">最新资讯</h2>
<p style="width:unset;margin-bottom:1rem">
霍尔果斯飞驰广告有限公司专注于提供从基础到进阶的SEO优化策略、广告投放方案、内容运营实战技巧以及网站转化率提升解决方案。同时我们也持续分享最新的科技动态、财经洞察、软件评测等多类型优质资讯助力用户在数字时代高效获取价值信息。
</p>
</div> </div>
<div class="row"> <div class="row">
<div class="xznews-container width-1200"> {
<div class="xznews-box"> data.map((item) => {
<div class="xznews-box-f xznews-box-width news-box"> return (
<div class="xznews-f-pitem"> <div class="col-xl-4 col-lg-4 col-md-6">
{ <div class="blog">
data?.slice(0, 2).map((e, index) => ( <a title={item.title} href={`/news/${item.id}`}>
<a title={e.title} class="pitem-item" target="_blank" href={`/news/${e.id}`}> <div class="blog__image">
<div class="item-img-wrapper"> <Image
<Image src={e.cover} alt={e.title} class="item-img" height={100} width={100} /> class="blog-image"
</div> width={100}
<div class="item-title">{e.title}</div> height={100}
</a> alt={item.title}
)) src={item.cover}
} />
</div>
{
data?.slice(2, 3).map((e, index) => (
<div style="padding:.5rem">
<a title={e.title} class="xznews-f-fitem" target="_blank" href={`/news/${e.id}`}>
<Image src={e.cover} alt={e.title} class="f-item-img" height={100} width={100} />
<div class="fitem-tip">{e.title}</div>
</a>
</div> </div>
)) <div class="blog__meta">
} <span>{item.created_at}</span>
</div> <div>
<div class="xznews-box-s xznews-box-width2 news-box"> <h3 class="title">
<div class="xznews-s-list spc-list"> {item.title}
{ </h3>
data?.slice(3, 10).map((e, index) => (
<div class="es">
<a title={e.title} class={index > 0 ? ' s-list-item' : 's-list-item spc-item'} target="_blank" href={`/news/${e.id}`}>{e.title}</a>
</div> </div>
)) </div>
} <a title={`${item.column_tag}`} href={item.column_tag_url}><span class="label label-success">{item.column_tag}</span></a>
</div> </a>
<div class="xznews-s-list">
{
data?.slice(10, 17).map((e, index) => (
<div class="es">
<a title={e.title} class={index > 0 ? ' s-list-item' : 's-list-item spc-item'} target="_blank" href={`/news/${e.id}`}>{e.title}</a>
</div>
))
}
</div> </div>
</div> </div>
<div class="xznews-box-t xznews-box-width3 news-box"> );
<div class="t-list"> })
{ }
data?.slice(18, 20).map((e, index) => (
<div>
<a class="t-item-spc" target="_blank" title={e.title} href={`/news/${e.id}`}>
<div class="item-img-wrapper">
<Image src={e.cover} alt={e.title} class="item-img" height={100} width={100} />
</div>
<div class="t-item-box">
<div class="t-item-title">{e.title}</div>
</div>
</a>
</div>
))
}
{
guess?.slice(0, 9).map((e, index) => (
<div>
<a class="t-item" target="_blank" title={e.title} href={`/news/${e.id}`}>
<div class="t-item-tip">{index + 1}. </div>
<div class="t-item-title es">{e.title}</div>
</a>
</div>
))
}
</div>
</div>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>