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