浏览记录字段问题及代码优化
This commit is contained in:
@@ -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
|
||||
})
|
||||
},
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user