浏览记录字段问题及代码优化

This commit is contained in:
clay
2023-01-17 23:19:52 +08:00
parent 2d08416f5e
commit 4b10b9486d
9 changed files with 64 additions and 29 deletions

View File

@@ -39,16 +39,18 @@
getNews() {
this.$apiServe.getNews().then(res => {
// console.log('行业新闻', res.data.data)
for (const item of res.data.data) {
let newsData = res.data.data
for (const item of newsData) {
item.pub_time_str = dateFormat(item.pub_time_str)
}
this.newsList = res.data.data
newsData = newsData.slice(0, 3)
this.newsList = newsData
}).finally(_ => {})
},
// 跳转到新闻详情页
clickNews(item) {
uni.navigateTo({
url: '../../packageReport/xwDetail/xwDetail?id=' + item.id
url: '../../packageReport/newsDetail/newsDetail?id=' + item.id
})
},
}

View File

@@ -18,7 +18,7 @@
<u-tag :text="item.tags" type="warning" shape="circle"></u-tag>
</view>
<view class="product_desc">
{{item.title}}
{{item.desc}}
</view>
<view class="releaseDate">
<u-image src="/static/products/xp_icon_sjf.png" width="22rpx" height="22rpx"